/* ==========================================================================
   PLAYER SEATS, AVATARS, CARDS, TIMERS, BADGES & STAMPS
   ========================================================================== */

/* Compact AI Opponent Pods (Upper-Left, Mid-Left, Upper-Right) */
.ai-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 14;
  width: 78px;
  transition: opacity 0.3s ease;
}

#seat-3 { top: 56px; left: 8px; }
#seat-4 { top: 56px; right: 8px; }
#seat-2 { top: 53%; left: 8px; }
#seat-5 { top: 53%; right: 8px; }

.ai-seat.selectable {
  z-index: 46;
  cursor: pointer;
}

/* On-Board Multiplayer Room Lobby Seats */
.seat-lobby-clickable {
  cursor: pointer;
}

.seat-lobby-clickable:hover .avatar-wrap {
  transform: scale(1.06);
  filter: brightness(1.12);
}

.seat-lobby-empty-avatar {
  border-radius: 50%;
  border: 2px dashed rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.55);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.seat-lobby-clickable .seat-lobby-empty-avatar {
  border-color: rgba(74, 222, 128, 0.78);
  background: rgba(16, 185, 129, 0.16);
}

.seat-lobby-plus {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #86efac;
  line-height: 1;
}

.seat-lobby-empty:not(.seat-lobby-clickable) .seat-lobby-plus {
  color: #64748b;
  font-size: 16px;
}

.lobby-seat-tag {
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: 'Fredoka', sans-serif;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.lobby-tag-add {
  background: rgba(16, 185, 129, 0.9);
  border: 1px solid #a7f3d0;
  color: #022c22;
}

.lobby-tag-remove {
  background: rgba(225, 29, 72, 0.9);
  border: 1px solid #fecdd3;
  color: #fff1f2;
}

.lobby-tag-ready {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(74, 222, 128, 0.55);
  color: #86efac;
}

.lobby-tag-wait {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #94a3b8;
}

.lobby-kick-btn {
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(159, 18, 57, 0.9);
  border: 1px solid #fda4af;
  color: #ffe4e6;
  font-family: 'Fredoka', sans-serif;
  font-size: 8.5px;
  font-weight: 700;
  cursor: pointer;
}

.seat-name-row {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 2px;
  background: rgba(10, 15, 28, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 999px;
  max-width: 78px;
}

.active-pulse .seat-name-row {
  background: rgba(20, 83, 45, 0.92);
  border-color: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.45);
}

.turn-tag {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  font-family: 'Fredoka', sans-serif;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.45px;
  background: linear-gradient(180deg, #86efac 0%, #22c55e 100%);
  border: 1.2px solid #052e16;
  color: #052e16;
  padding: 0 5px;
  border-radius: 999px;
  line-height: 1.3;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  pointer-events: none;
}

.online-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 5px #4ade80;
  flex-shrink: 0;
}

.seat-name {
  font-size: 9.5px;
  font-weight: 800;
  color: #eef2ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact 42px AI Avatar & 50px Human Avatar */
.avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.25s ease;
}

.human-avatar-wrap {
  width: 50px;
  height: 50px;
}

.avatar-frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2.2px solid #f0b949;
  background: #1c243a;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 0 6px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 2;
}

.seat-eliminated .avatar-frame {
  filter: grayscale(0.95) brightness(0.45);
  border-color: #64748b;
}

.seat-badge {
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe27c 0%, #d98a1a 100%);
  border: 1.5px solid #593204;
  color: #3c1e02;
  font-family: 'Fredoka', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Countdown / Active Turn Ring */
.turn-ring-svg {
  position: absolute;
  inset: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  z-index: 4;
  pointer-events: none;
  transform: rotate(-90deg);
}

.turn-ring-bg {
  fill: none;
  stroke: rgba(74, 222, 128, 0.16);
  stroke-width: 4;
}

.turn-ring-progress {
  fill: none;
  stroke: #4ade80;
  stroke-width: 4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px #4ade80);
  transition: stroke-dashoffset 0.15s linear;
}

.turn-ring-progress.urgent {
  stroke: #fb7185;
  filter: drop-shadow(0 0 6px #f43f5e);
}

.active-pulse .avatar-frame {
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.72), 0 3px 8px rgba(0, 0, 0, 0.55);
}

/* Strictly Anchored Target Crosshair & Target Label (opacity/scale only, NO horizontal shift) */
.crosshair-overlay {
  position: absolute;
  inset: -5px;
  z-index: 9;
  pointer-events: none;
  animation: crosshairPulse 0.9s ease-in-out infinite alternate;
}

@keyframes crosshairPulse {
  0% { transform: scale(0.94); opacity: 0.82; }
  100% { transform: scale(1.04); opacity: 1; }
}

.target-tag-anchor {
  position: absolute;
  top: -17px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 22;
  pointer-events: none;
}

.target-tag {
  background: linear-gradient(180deg, #ffe27a 0%, #dfa020 100%);
  color: #361c00;
  font-family: 'Fredoka', sans-serif;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid #6b3f04;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  animation: fadeScaleIn 0.35s ease forwards;
}

/* Compact 22x32px AI Mini Cards */
.ai-cards-row {
  display: flex;
  gap: 3px;
  margin-top: 3px;
}

.mini-card {
  position: relative;
  width: 22px;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.mini-card-back {
  width: 100%;
  height: 100%;
  background: linear-gradient(155deg, #c6286b 0%, #861547 100%);
  border: 1.5px solid #f0b949;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tiny Gold Coin Counter */
.coin-badge-row {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(10, 15, 28, 0.72);
  padding: 1px 6px 1px 4px;
  border-radius: 999px;
  border: 1px solid rgba(243, 181, 59, 0.35);
}

.coin-count {
  font-family: 'Fredoka', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  min-width: 11px;
  text-align: center;
}

.coin-count.bump {
  animation: coinBump 0.65s ease;
}

@keyframes coinBump {
  0% { transform: scale(1); color: #fff; }
  45% { transform: scale(1.4); color: #fde047; }
  100% { transform: scale(1); color: #fff; }
}

.select-label {
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 800;
  color: #fde047;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Strictly Anchored Player Status Badges (Fade + Scale only, ZERO layout shift) */
.pod-badge-anchor {
  position: absolute;
  z-index: 28;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

#seat-2 .pod-badge-anchor,
#seat-3 .pod-badge-anchor {
  top: 16px;
  left: 66px;
  align-items: flex-start;
}

#seat-4 .pod-badge-anchor,
#seat-5 .pod-badge-anchor {
  top: 16px;
  right: 66px;
  align-items: flex-end;
}

#seat-1-profile .pod-badge-anchor {
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
}

/* Persistent Turn Action Pill (floats in .pod-badge-anchor without shifting cards) */
.turn-action-pill {
  padding: 1px 7px;
  border-radius: 999px;
  font-family: 'Fredoka', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid #facc15;
  color: #fef08a;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  animation: fadeScaleIn 0.35s ease forwards;
}

.turn-action-pill.tone-income { border-color: #eab308; color: #fef08a; }
.turn-action-pill.tone-aid { border-color: #22c55e; color: #bbf7d0; }
.turn-action-pill.tone-tax { border-color: #60a5fa; color: #dbeafe; }
.turn-action-pill.tone-steal { border-color: #f87171; color: #fee2e2; }
.turn-action-pill.tone-assassinate { border-color: #34d399; color: #d1fae5; }
.turn-action-pill.tone-exchange { border-color: #c084fc; color: #f3e8ff; }
.turn-action-pill.tone-raid { border-color: #fb923c; color: #ffedd5; }

.pill-land-pop {
  animation: pillLandPop 0.5s cubic-bezier(0.22, 1.35, 0.36, 1) forwards;
}

@keyframes pillLandPop {
  0% { transform: scale(1.35); filter: brightness(1.35); }
  100% { transform: scale(1); filter: brightness(1); }
}

.pod-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: 'Fredoka', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  animation: fadeScaleIn 0.35s ease forwards;
}

.pod-status-badge.b-pass {
  background: #dcfce7;
  border: 1.5px solid #22c55e;
  color: #14532d;
  padding: 0 6px;
}

.pod-status-badge.b-challenge {
  background: #ffe4e6;
  border: 1.5px solid #f43f5e;
  color: #9f1239;
}

.pod-status-badge.b-block {
  background: #0284c7;
  border: 1.5px solid #bae6fd;
  color: #ffffff;
}

.pod-status-badge.b-chat {
  background: #1e293b;
  border: 1.5px solid #f5c156;
  color: #fef3c7;
}

@keyframes fadeScaleIn {
  0% { opacity: 0; transform: scale(0.78); }
  100% { opacity: 1; transform: scale(1); }
}

/* Emote popup anchored directly over avatar center */
.floating-emote-wrap {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  pointer-events: none;
}

.floating-emote {
  font-size: 26px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
  animation: emoteFadeScale 2.8s ease forwards;
}

@keyframes emoteFadeScale {
  0% { opacity: 0; transform: scale(0.5); }
  16% { opacity: 1; transform: scale(1.15); }
  78% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.85); }
}

/* 4. Compact Bottom Human Player HUD */
.human-dock {
  position: relative;
  z-index: 20;
  height: 102px;
  padding: 4px 12px 4px;
  display: grid;
  grid-template-columns: 74px 1fr 64px;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.human-profile-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 74px;
}

.human-cards-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Compact 64x92px Human Role Cards */
.role-card {
  position: relative;
  width: 64px;
  height: 92px;
  border-radius: 9px;
  overflow: hidden;
  background: #1a2234;
  border: 2.4px solid #f0b949;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.52), inset 0 1px 2px rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  flex-shrink: 0;
}

.role-card:hover {
  transform: translateY(-2px);
}

.role-card.card-lg {
  width: 104px;
  height: 146px;
  border-radius: 12px;
  border-width: 3px;
}

.role-card.card-xl {
  width: 140px;
  height: 196px;
  border-radius: 14px;
  border-width: 3.5px;
}

.role-card.selectable-card {
  box-shadow: 0 0 0 3px #4ade80, 0 0 20px rgba(74, 222, 128, 0.72);
  transform: translateY(-3px);
}

.role-card.card-dead svg,
.mini-card.card-dead svg {
  filter: grayscale(1) contrast(0.85) brightness(0.68);
}

.role-card.card-dead {
  border-color: #64748b;
}

.role-card-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.92);
  padding: 2px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.role-card-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1;
}

.card-lg .role-card-title { font-size: 12px; }
.card-xl .role-card-title { font-size: 14.5px; }

/* Distressed TERMINATED Stamp */
.terminated-stamp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.25);
}

.terminated-stamp-inner {
  transform: rotate(-22deg);
  border: 2px solid #dc2626;
  background: rgba(255, 255, 255, 0.92);
  color: #b91c1c;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
  white-space: nowrap;
}

.mini-card .terminated-stamp-inner {
  font-size: 4.5px;
  padding: 0.5px 1.5px;
  border-width: 1px;
  letter-spacing: 0;
}

.card-lg .terminated-stamp-inner {
  font-size: 13px;
  padding: 3px 7px;
  border-width: 2.5px;
}

.stamp-slam-anim {
  animation: stampSlam 0.75s cubic-bezier(0.2, 0.9, 0.3, 1.15) forwards;
}

@keyframes stampSlam {
  0% { transform: scale(2.8) rotate(-32deg); opacity: 0; }
  65% { transform: scale(0.92) rotate(-20deg); opacity: 1; }
  100% { transform: scale(1) rotate(-22deg); opacity: 1; }
}

/* WIN / LOSE Badges */
.win-stamp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  pointer-events: none;
}

.win-stamp-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #fff9c4 0%, #facc15 48%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #1e3a8a) drop-shadow(0 0 12px rgba(250, 204, 21, 0.9));
  transform: rotate(-10deg);
  animation: winPop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lose-badge-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 18;
  pointer-events: none;
}

.lose-badge-text {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #ff4d4f;
  -webkit-text-stroke: 1px #450a0a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.6px;
}

.win-badge-avatar {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: #fde047;
  -webkit-text-stroke: 1px #1e3a8a;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.95), 0 2px 5px rgba(0, 0, 0, 0.8);
}

@keyframes winPop {
  0% { transform: scale(0.25) rotate(-22deg); opacity: 0; }
  70% { transform: scale(1.16) rotate(-8deg); opacity: 1; }
  100% { transform: scale(1) rotate(-10deg); opacity: 1; }
}

/* Compact 2x2 Utility Icon Grid (28x28px buttons) */
.utility-grid {
  display: grid;
  grid-template-columns: repeat(2, 28px);
  gap: 5px;
  justify-content: end;
}

.util-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(180deg, #b86250 0%, #8f3f31 100%);
  border: 1.5px solid #df9281;
  box-shadow: 0 2px 0 #572219, 0 3px 6px rgba(0, 0, 0, 0.38);
  color: #fff3eb;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.12s ease;
}

.util-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #572219;
}

.util-btn.muted {
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  border-color: #94a3b8;
  box-shadow: 0 2px 0 #1e293b;
}
