/* ═══════════════════════════════════════════════════════════════════════════
   TRUMP CARD — Premium Card Game Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shell ── */
.tc-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: #080c0a;
  font-family: "Space Grotesk", system-ui, sans-serif;
  overflow: hidden;
  position: relative;
}

.tc-shell,
.tc-shell * {
  box-sizing: border-box;
}

/* ── Header Bar ── */
.tc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}

.tc-header-left { display: flex; align-items: center; gap: 12px; }
.tc-game-title  { font-size: 0.95rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; }
.tc-phase-badge {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.1);
}
.tc-phase-badge.active { background: rgba(250,204,21,0.15); color: #facc15; border-color: rgba(250,204,21,0.3); }

.tc-trump-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
}
.tc-trump-badge.spades   { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }
.tc-trump-badge.hearts   { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.3);  }
.tc-trump-badge.diamonds { background: rgba(251,146,60,0.15); color: #fb923c; border: 1px solid rgba(251,146,60,0.3); }
.tc-trump-badge.clubs    { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }

.tc-score-btn {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700; padding: 5px 12px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7);
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.tc-score-btn:hover { background: rgba(255,255,255,0.10); color: #fff; }

/* ── Main arena ── */
.tc-arena {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  position: relative;
  padding: 0;
  min-height: 0;
  min-width: 0;
}

/* ── Felt table center ── */
.tc-table {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, #0d3320 0%, #071a10 55%, #040e08 100%);
  border: 2px solid rgba(255,255,255,0.05);
  flex: 1;
  min-height: 260px;
  min-width: 0;
  width: 100%;
  overflow: visible;
}

.tc-table::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.04);
  pointer-events: none;
}

/* ── 4-player layout wrapper ── */
.tc-players-layout {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-areas:
    ". north ."
    "west  center east"
    ". south .";
  grid-template-columns: 220px 1fr 220px;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  min-height: 520px;
  padding: 16px;
}

@media (max-width: 700px) {
  .tc-players-layout {
    grid-template-columns: 160px 1fr 160px;
    min-height: 420px;
  }
}

/* ── Player pods ── */
.tc-player-pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  position: relative;
  min-width: 0;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: border-color 0.2s;
}

.tc-player-pod.is-active  { border-color: rgba(250,204,21,0.35); box-shadow: 0 0 20px rgba(250,204,21,0.08); }
.tc-player-pod.is-me      { border-color: rgba(99,102,241,0.5);  box-shadow: 0 0 24px rgba(99,102,241,0.12); background: rgba(99,102,241,0.06); }
.tc-player-pod.is-partner { border-color: rgba(74,222,128,0.3);  box-shadow: 0 0 16px rgba(74,222,128,0.06); }
.tc-player-pod.is-ai      { opacity: 0.85; }

.tc-pod-north { grid-area: north; }
.tc-pod-south { grid-area: south; }
.tc-pod-west  { grid-area: west;  }
.tc-pod-east  { grid-area: east;  }

.tc-pod-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #1e3a2f, #0a1f15);
  border: 2px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 800; color: rgba(255,255,255,0.8);
  letter-spacing: -0.02em; text-transform: uppercase;
  flex-shrink: 0; overflow: hidden; position: relative;
}
.tc-pod-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tc-pod-avatar-ai { font-size: 1.2rem; }

.tc-pod-name {
  font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,0.85);
  letter-spacing: 0.01em; text-align: center; white-space: nowrap;
  max-width: 130px; overflow: hidden; text-overflow: ellipsis;
}
.tc-pod-you-tag {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: #818cf8; margin-top: -4px;
}
.tc-pod-ai-tag {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3); margin-top: -4px;
}
.tc-pod-partner-tag {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: #4ade80; margin-top: -4px;
}

.tc-pod-stats {
  display: flex; gap: 10px; align-items: center;
  font-size: 0.65rem; color: rgba(255,255,255,0.45);
}
.tc-pod-bid   { font-weight: 700; color: rgba(250,204,21,0.85); }
.tc-pod-tricks{ font-weight: 700; color: rgba(99,102,241,0.85); }
.tc-pod-score { font-weight: 700; color: rgba(255,255,255,0.5); }

/* Mini face-down card fan for opponents */
.tc-pod-card-fan {
  display: flex; gap: -4px; justify-content: center;
  height: 38px; position: relative;
}
.tc-pod-card-fan .tc-fan-card {
  width: 20px; height: 34px;
  background: linear-gradient(135deg, #1a3a5c 0%, #0d1f31 100%);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 5px;
  margin-left: -6px;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.5);
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.tc-pod-card-fan .tc-fan-card::after {
  content: "";
  width: 10px; height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.08);
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.02) 0px,
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 4px
  );
}
.tc-pod-card-fan .tc-fan-card:first-child { margin-left: 0; }

/* ── Table center ── */
.tc-center {
  grid-area: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  position: relative;
}

.tc-table-label {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(255,255,255,0.12);
  position: absolute; top: 8px;
}

/* ── Playing Cards ── */
.tc-card {
  width: 56px; height: 82px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 4px 14px rgba(0,0,0,0.55), 0 1px 3px rgba(0,0,0,0.3);
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: default;
  flex-shrink: 0;
}
.tc-card.is-red  { color: #dc2626; }
.tc-card.is-black{ color: #111; }
.tc-card.is-back {
  background: linear-gradient(135deg, #1a3a5c 0%, #0d1f31 100%);
  color: transparent;
  border-color: rgba(255,255,255,0.12);
}
.tc-card.is-back::after {
  content: "";
  position: absolute; inset: 4px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.02) 0px,
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 5px
  );
}

.tc-card-corner {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1;
  gap: 1px;
}
.tc-card-corner.top    { top: 5px; left: 5px; }
.tc-card-corner.bottom { bottom: 5px; right: 5px; transform: rotate(180deg); }

.tc-card-rank { font-size: 0.75rem; font-weight: 900; letter-spacing: -0.03em; }
.tc-card-suit { font-size: 0.7rem; }

.tc-card-center-suit {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 1.75rem; opacity: 0.12;
  pointer-events: none;
}

/* Trick cards — diamond layout (north top-center, south bottom-center, west left, east right) */
.tc-trick-area {
  position: relative;
  width: 200px; height: 200px;
}
.tc-trick-slot {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
}
.tc-trick-slot-north { top: 0;   left: 50%; transform: translateX(-50%); }
.tc-trick-slot-south { bottom: 0; left: 50%; transform: translateX(-50%); }
.tc-trick-slot-west  { left: 0;  top: 50%; transform: translateY(-50%); }
.tc-trick-slot-east  { right: 0; top: 50%; transform: translateY(-50%); }

/* Played card animation */
@keyframes tcCardPlay {
  from { transform: scale(0.55) translateY(-18px) rotate(-6deg); opacity: 0; }
  60%  { transform: scale(1.08) translateY(2px)   rotate(1deg);  opacity: 1; }
  to   { transform: scale(1)    translateY(0)     rotate(0deg);  opacity: 1; }
}
.tc-trick-card { animation: tcCardPlay 0.32s cubic-bezier(0.175,0.885,0.32,1.2) both; }

/* Trick win pod flash — animates opacity only (compositor-only, no paint/layout) */
@keyframes tcWinFlash {
  0%   { opacity: 1; }
  15%  { opacity: 0.55; }
  35%  { opacity: 1; }
  55%  { opacity: 0.65; }
  100% { opacity: 1; }
}
.tc-player-pod.tc-trick-win-flash {
  outline: 2px solid rgba(250,204,21,0.85);
  animation: tcWinFlash 0.85s ease forwards !important;
}

/* ── Player's own hand (south) ── */
.tc-my-hand {
  padding: 12px 16px 16px;
  background: rgba(0,0,0,0.55);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 5;
}

.tc-hand-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
}

.tc-hand-cards {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 4px 0;
}

/* Hand cards are larger and interactive */
.tc-hand-card {
  width: 60px; height: 90px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transform: translateY(0);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tc-hand-card:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow: 0 12px 30px rgba(0,0,0,0.7) !important;
  z-index: 20;
}
.tc-hand-card.is-playable:hover { box-shadow: 0 12px 30px rgba(99,102,241,0.4) !important; }
.tc-hand-card.is-unplayable { opacity: 0.45; cursor: not-allowed; }
.tc-hand-card.is-unplayable:hover { transform: none; }

/* Selected card */
.tc-hand-card.is-selected {
  transform: translateY(-14px) scale(1.06) !important;
  box-shadow: 0 16px 36px rgba(250,204,21,0.4) !important;
  outline: 2px solid #facc15;
  outline-offset: 2px;
}

/* Deal-in animation */
@keyframes tcDealIn {
  from { transform: translateX(40vw) rotate(15deg) scale(0.5); opacity: 0; }
  to   { transform: translateX(0)    rotate(0deg)  scale(1);   opacity: 1; }
}
.tc-hand-card { animation: tcDealIn 0.35s cubic-bezier(0.175,0.885,0.32,1.15) both; }
.tc-hand-card:nth-child(2)  { animation-delay: 0.04s; }
.tc-hand-card:nth-child(3)  { animation-delay: 0.08s; }
.tc-hand-card:nth-child(4)  { animation-delay: 0.12s; }
.tc-hand-card:nth-child(5)  { animation-delay: 0.16s; }
.tc-hand-card:nth-child(6)  { animation-delay: 0.20s; }
.tc-hand-card:nth-child(7)  { animation-delay: 0.24s; }
.tc-hand-card:nth-child(8)  { animation-delay: 0.28s; }
.tc-hand-card:nth-child(9)  { animation-delay: 0.32s; }
.tc-hand-card:nth-child(10) { animation-delay: 0.36s; }
.tc-hand-card:nth-child(11) { animation-delay: 0.40s; }
.tc-hand-card:nth-child(12) { animation-delay: 0.44s; }
.tc-hand-card:nth-child(13) { animation-delay: 0.48s; }

.tc-hand-action-row {
  display: flex; gap: 10px; justify-content: center; align-items: center;
}

.tc-play-btn {
  padding: 8px 24px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; font-size: 0.82rem; font-weight: 700;
  border: none; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.tc-play-btn:hover { transform: scale(1.04); box-shadow: 0 6px 20px rgba(99,102,241,0.55); }
.tc-play-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.tc-hand-hint {
  font-size: 0.72rem; color: rgba(255,255,255,0.4); text-align: center;
}
.tc-hand-hint.is-my-turn {
  color: #facc15; font-weight: 700;
  animation: tcTurnPulse 1.5s ease infinite;
}

/* Last trick winner toast */
.tc-last-trick-badge {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  color: rgba(250,204,21,0.8); text-transform: uppercase;
  background: rgba(250,204,21,0.08); border: 1px solid rgba(250,204,21,0.15);
  border-radius: 999px; padding: 3px 12px;
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; pointer-events: none;
}

/* ── Trump Selection Panel ── */
.tc-trump-select-overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(0,0,0,0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.tc-trump-select-panel {
  background: linear-gradient(145deg, #0f2419, #081510);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 28px;
  padding: 32px 36px;
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; gap: 24px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.8);
  animation: tcPanelPop 0.3s cubic-bezier(0.175,0.885,0.32,1.28) both;
}

@keyframes tcPanelPop {
  from { transform: scale(0.88) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.tc-trump-select-title {
  font-size: 1.2rem; font-weight: 800; color: #fff; text-align: center;
  letter-spacing: -0.01em;
}
.tc-trump-select-sub {
  font-size: 0.78rem; color: rgba(255,255,255,0.45); text-align: center;
  line-height: 1.5; margin-top: -14px;
}

.tc-peek-hand {
  display: flex; gap: 6px; justify-content: center;
  padding: 8px 0;
}
.tc-peek-hand .tc-hand-card {
  cursor: default;
  animation: none;
}
.tc-peek-hand .tc-hand-card:hover { transform: translateY(-8px) scale(1.04); }

.tc-suit-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tc-suit-btn {
  padding: 16px 12px;
  border-radius: 18px;
  border: 1.5px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: all 0.15s ease;
  font-size: 2rem; line-height: 1;
}
.tc-suit-btn:hover { transform: scale(1.04); border-color: rgba(255,255,255,0.2); }

.tc-suit-btn.spades:hover,   .tc-suit-btn.spades.is-selected   { background: rgba(168,85,247,0.18); border-color: rgba(168,85,247,0.5); color: #c084fc; }
.tc-suit-btn.hearts:hover,   .tc-suit-btn.hearts.is-selected   { background: rgba(239,68,68,0.18);  border-color: rgba(239,68,68,0.5);  color: #f87171; }
.tc-suit-btn.diamonds:hover, .tc-suit-btn.diamonds.is-selected { background: rgba(251,146,60,0.18); border-color: rgba(251,146,60,0.5); color: #fb923c; }
.tc-suit-btn.clubs:hover,    .tc-suit-btn.clubs.is-selected    { background: rgba(74,222,128,0.18); border-color: rgba(74,222,128,0.5); color: #4ade80; }

.tc-suit-btn-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(255,255,255,0.6);
}

/* ── Dealing Panel (hand review before bidding) ── */
.tc-dealing-overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(0,0,0,0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.tc-dealing-panel {
  background: linear-gradient(145deg, #0b1f14, #060e09);
  border: 1px solid rgba(74,222,128,0.15);
  border-radius: 28px;
  padding: 28px 32px;
  width: 100%; max-width: 600px;
  display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.85), 0 0 60px rgba(74,222,128,0.04);
  animation: tcPanelPop 0.35s cubic-bezier(0.175,0.885,0.32,1.28) both;
}

/* Trump announcement banner */
.tc-trump-announce {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 14px 18px;
}
.tc-trump-announce-icon {
  font-size: 2.4rem; line-height: 1; flex-shrink: 0;
  animation: tcIconBounce 0.5s ease both 0.1s;
}
.tc-trump-announce-who {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 4px;
}
.tc-trump-announce-suit {
  font-size: 1.3rem; font-weight: 900; letter-spacing: -0.01em;
}
.tc-trump-announce-suit.spades   { color: #c084fc; }
.tc-trump-announce-suit.hearts   { color: #f87171; }
.tc-trump-announce-suit.diamonds { color: #fb923c; }
.tc-trump-announce-suit.clubs    { color: #4ade80; }

.tc-dealing-hand-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.35); text-align: center;
}

.tc-dealing-hand {
  display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; padding: 4px 0;
}
.tc-dealing-hand .tc-hand-card { animation: tcDealIn 0.35s cubic-bezier(0.175,0.885,0.32,1.15) both; }
.tc-dealing-hand .tc-hand-card:nth-child(2)  { animation-delay: 0.04s; }
.tc-dealing-hand .tc-hand-card:nth-child(3)  { animation-delay: 0.08s; }
.tc-dealing-hand .tc-hand-card:nth-child(4)  { animation-delay: 0.12s; }
.tc-dealing-hand .tc-hand-card:nth-child(5)  { animation-delay: 0.16s; }
.tc-dealing-hand .tc-hand-card:nth-child(6)  { animation-delay: 0.20s; }
.tc-dealing-hand .tc-hand-card:nth-child(7)  { animation-delay: 0.24s; }
.tc-dealing-hand .tc-hand-card:nth-child(8)  { animation-delay: 0.28s; }
.tc-dealing-hand .tc-hand-card:nth-child(9)  { animation-delay: 0.32s; }
.tc-dealing-hand .tc-hand-card:nth-child(10) { animation-delay: 0.36s; }
.tc-dealing-hand .tc-hand-card:nth-child(11) { animation-delay: 0.40s; }
.tc-dealing-hand .tc-hand-card:nth-child(12) { animation-delay: 0.44s; }
.tc-dealing-hand .tc-hand-card:nth-child(13) { animation-delay: 0.48s; }
.tc-dealing-hand .tc-hand-card { cursor: default; }
.tc-dealing-hand .tc-hand-card:hover { transform: translateY(-8px) scale(1.04); }

.tc-ready-bid-btn {
  padding: 13px; border-radius: 14px;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #052e10; font-size: 0.92rem; font-weight: 800;
  border: none; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 18px rgba(74,222,128,0.35);
  letter-spacing: 0.01em;
}
.tc-ready-bid-btn:hover { transform: scale(1.02); box-shadow: 0 6px 26px rgba(74,222,128,0.5); }
.tc-ready-bid-btn.is-waiting {
  background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.4);
  box-shadow: none; cursor: default; font-size: 0.8rem;
}
.tc-ready-bid-btn.is-waiting:hover { transform: none; box-shadow: none; }

/* Ready-pip progress indicators */
.tc-ready-progress {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.tc-ready-pip {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: rgba(255,255,255,0.4);
}
.tc-ready-pip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.18); border: 1.5px solid rgba(255,255,255,0.15);
  transition: background 0.2s, border-color 0.2s;
}
.tc-ready-pip.is-ready .tc-ready-pip-dot {
  background: #4ade80; border-color: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,0.6);
}
.tc-ready-pip.is-ready { color: rgba(255,255,255,0.7); }

/* Trump caller inline tag used in bid panel sub-text */
.tc-trump-caller-tag {
  display: inline-block;
  font-weight: 700; color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px; padding: 2px 10px;
  font-size: 0.78rem;
}

/* ── Bidding Panel ── */
.tc-bid-overlay {
  position: absolute; inset: 0; z-index: 30;
  background: rgba(0,0,0,0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.tc-bid-panel {
  background: linear-gradient(145deg, #0f1e2e, #080d17);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 28px;
  padding: 32px 36px;
  width: 100%; max-width: 460px;
  display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.8);
  animation: tcPanelPop 0.3s cubic-bezier(0.175,0.885,0.32,1.28) both;
}

.tc-bid-title { font-size: 1.2rem; font-weight: 800; color: #fff; text-align: center; }
.tc-bid-sub   { font-size: 0.78rem; color: rgba(255,255,255,0.45); text-align: center; margin-top: -14px; }

.tc-bid-context {
  display: flex; flex-direction: column; gap: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px; padding: 12px 16px;
}
.tc-bid-context-row {
  display: flex; justify-content: space-between; font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}
.tc-bid-context-row strong { color: rgba(255,255,255,0.9); }

.tc-bid-selector {
  display: flex; flex-direction: column; gap: 12px;
}
.tc-bid-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.45);
  text-align: center;
}
.tc-bid-display {
  font-size: 3rem; font-weight: 900; color: #facc15;
  text-align: center; line-height: 1; font-family: "Space Grotesk", sans-serif;
}
.tc-bid-chips {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.tc-bid-chip {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7); font-size: 0.78rem; font-weight: 800;
  cursor: pointer; transition: all 0.12s ease;
  display: flex; align-items: center; justify-content: center;
}
.tc-bid-chip:hover { background: rgba(250,204,21,0.15); border-color: rgba(250,204,21,0.4); color: #facc15; }
.tc-bid-chip.selected { background: rgba(250,204,21,0.25); border-color: #facc15; color: #facc15; }

.tc-bid-submit-btn {
  padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0a0a00; font-size: 0.88rem; font-weight: 800;
  border: none; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 4px 16px rgba(250,204,21,0.35);
}
.tc-bid-submit-btn:hover { transform: scale(1.02); box-shadow: 0 6px 22px rgba(250,204,21,0.5); }

/* ── Score Overlay ── */
.tc-score-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: tcFadeIn 0.15s ease both;
}
@keyframes tcFadeIn { from { opacity: 0; } to { opacity: 1; } }

.tc-score-panel {
  background: #0a0e12;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 28px;
  width: 100%; max-width: 500px;
  display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  animation: tcPanelPop 0.28s cubic-bezier(0.175,0.885,0.32,1.28) both;
  max-height: 85vh; overflow-y: auto;
}

.tc-score-header {
  display: flex; align-items: center; justify-content: space-between;
}
.tc-score-title { font-size: 1.1rem; font-weight: 800; color: #fff; }
.tc-score-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s; line-height: 1;
}
.tc-score-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

.tc-score-teams {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.tc-score-team {
  padding: 16px; border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  display: flex; flex-direction: column; gap: 6px;
  text-align: center;
}
.tc-score-team.winning {
  background: rgba(250,204,21,0.07);
  border-color: rgba(250,204,21,0.25);
}
.tc-score-team-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4); }
.tc-score-team-players { font-size: 0.75rem; color: rgba(255,255,255,0.55); line-height: 1.4; }
.tc-score-team-total   { font-size: 2rem; font-weight: 900; color: #facc15; font-family: "Space Grotesk", sans-serif; }
.tc-win-target { font-size: 0.65rem; color: rgba(250,204,21,0.5); }

.tc-score-table { width: 100%; border-collapse: collapse; }
.tc-score-table th {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
}
.tc-score-table td {
  font-size: 0.78rem; padding: 8px; color: rgba(255,255,255,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.tc-score-table tr:last-child td { border-bottom: none; }
.tc-delta-pos { color: #4ade80; font-weight: 700; }
.tc-delta-neg { color: #f87171; font-weight: 700; }

/* ── Phase Panels (waiting/overview) ── */
.tc-waiting-panel {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 20px; padding: 32px;
  background: rgba(0,0,0,0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.tc-waiting-title   { font-size: 1.6rem; font-weight: 900; color: #fff; text-align: center; }
.tc-waiting-sub     { font-size: 0.85rem; color: rgba(255,255,255,0.5); text-align: center; max-width: 320px; line-height: 1.6; }
.tc-waiting-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.tc-start-btn {
  padding: 12px 32px; border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff; font-size: 0.9rem; font-weight: 700;
  border: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
  transition: transform 0.12s, box-shadow 0.12s;
}
.tc-start-btn:hover { transform: scale(1.04); box-shadow: 0 8px 28px rgba(99,102,241,0.55); }
.tc-start-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.tc-reset-btn {
  padding: 10px 22px; border-radius: 14px;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
  font-size: 0.82rem; font-weight: 700; border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer; transition: background 0.12s;
}
.tc-reset-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ── Round Over Panel ── */
.tc-round-over-overlay {
  position: absolute; inset: 0; z-index: 25;
  background: rgba(0,0,0,0.75); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.tc-round-over-panel {
  background: #0a0e12; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px; padding: 28px;
  width: 100%; max-width: 480px;
  display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  animation: tcPanelPop 0.28s cubic-bezier(0.175,0.885,0.32,1.28) both;
}
.tc-round-over-title { font-size: 1.2rem; font-weight: 800; color: #fff; text-align: center; }
.tc-round-over-table { width: 100%; border-collapse: collapse; }
.tc-round-over-table th {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
}
.tc-round-over-table td {
  font-size: 0.8rem; padding: 9px 8px; color: rgba(255,255,255,0.75);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.tc-rd-made { color: #4ade80; }
.tc-rd-miss { color: #f87171; }

/* ── Game Over ── */
.tc-game-over-overlay {
  position: absolute; inset: 0; z-index: 35;
  background: rgba(0,0,0,0.85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.tc-game-over-panel {
  background: linear-gradient(135deg, #0a1a10, #060d09);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 28px; padding: 36px 32px;
  width: 100%; max-width: 420px; text-align: center;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.9), 0 0 60px rgba(74,222,128,0.05);
  animation: tcPanelPop 0.35s cubic-bezier(0.175,0.885,0.32,1.28) both;
}
.tc-game-over-icon   { font-size: 3rem; animation: tcIconBounce 0.6s ease both 0.2s; }
@keyframes tcIconBounce {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.tc-game-over-title { font-size: 1.8rem; font-weight: 900; color: #facc15; letter-spacing: -0.02em; }
.tc-game-over-sub   { font-size: 0.88rem; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* ── Log ── */
.tc-log-panel { background: rgba(0,0,0,0.3); border-top: 1px solid rgba(255,255,255,0.05); }
.tc-log-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px; cursor: pointer;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
}
.tc-log-toggle:hover { color: rgba(255,255,255,0.55); }
.tc-log-list { max-height: 120px; overflow-y: auto; padding: 0 18px 10px; display: none; }
.tc-log-panel.is-open .tc-log-list { display: block; }
.tc-log-item { font-size: 0.75rem; color: rgba(255,255,255,0.5); padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.04); line-height: 1.4; }
.tc-log-item:last-child { border-bottom: none; }

/* ── Suppress deal-in re-animation on re-renders ── */
.tc-no-deal-anim .tc-hand-card {
  animation: none !important;
}

/* ── Turn indicator pulse ── */
@keyframes tcTurnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250,204,21,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(250,204,21,0); }
}
.tc-player-pod.is-active { animation: tcTurnPulse 1.5s ease infinite; }

/* Win flash takes priority over turn pulse */
.tc-player-pod.tc-trick-win-flash {
  animation: tcWinFlash 0.85s ease forwards !important;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .tc-shell {
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .tc-header {
    padding: 8px 10px;
    gap: 8px;
    align-items: flex-start;
  }

  .tc-header-left {
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
  }

  .tc-game-title {
    width: 100%;
    font-size: 0.82rem;
  }

  .tc-phase-badge,
  .tc-trump-badge,
  .tc-score-btn,
  .tc-reset-btn {
    font-size: 0.58rem;
    padding: 4px 8px !important;
  }

  .tc-table {
    width: 100%;
    max-width: 100vw;
    min-height: 340px;
    justify-content: stretch;
    overflow: hidden;
  }

  .tc-table::before {
    inset: 8px;
    border-radius: 28px;
  }

  .tc-players-layout {
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    grid-template-rows: 76px minmax(148px, 1fr) 76px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 340px;
    padding: 6px;
    align-items: center;
    justify-items: center;
    overflow: hidden;
  }

  .tc-player-pod {
    width: 100%;
    max-width: 104px;
    min-width: 0;
    gap: 4px;
    padding: 6px 5px;
    border-radius: 12px;
  }

  .tc-pod-west,
  .tc-pod-east {
    max-width: 54px;
    padding-inline: 3px;
  }

  .tc-pod-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
    border-width: 1px;
  }

  .tc-pod-name {
    max-width: 64px;
    font-size: 0.62rem;
  }

  .tc-pod-west .tc-pod-name,
  .tc-pod-east .tc-pod-name {
    max-width: 46px;
  }

  .tc-pod-you-tag,
  .tc-pod-ai-tag,
  .tc-pod-partner-tag {
    font-size: 0.5rem;
    margin-top: -2px;
  }

  .tc-pod-stats {
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.54rem;
    line-height: 1.1;
  }

  .tc-pod-west .tc-pod-stats,
  .tc-pod-east .tc-pod-stats {
    gap: 2px;
  }

  .tc-pod-west .tc-pod-stats span:nth-child(2),
  .tc-pod-west .tc-pod-stats span:nth-child(4),
  .tc-pod-west .tc-pod-score,
  .tc-pod-east .tc-pod-stats span:nth-child(2),
  .tc-pod-east .tc-pod-stats span:nth-child(4),
  .tc-pod-east .tc-pod-score {
    display: none;
  }

  .tc-pod-card-fan {
    height: 20px;
    max-width: 46px;
    overflow: hidden;
  }

  .tc-pod-card-fan .tc-fan-card {
    width: 12px;
    height: 20px;
    border-radius: 4px;
    margin-left: -5px;
  }

  .tc-pod-card-fan .tc-fan-card::after {
    width: 7px;
    height: 10px;
  }

  .tc-center {
    width: 100%;
    min-width: 0;
    padding: 4px;
    gap: 8px;
  }

  .tc-table-label {
    top: 2px;
    font-size: 0.52rem;
    letter-spacing: 0.11em;
  }

  .tc-trick-area {
    width: min(124px, 100%);
    height: 124px;
  }

  .tc-card {
    width: 36px;
    height: 52px;
    border-radius: 7px;
  }

  .tc-card-corner.top { top: 4px; left: 4px; }
  .tc-card-corner.bottom { bottom: 4px; right: 4px; }
  .tc-card-rank { font-size: 0.58rem; }
  .tc-card-suit { font-size: 0.56rem; }
  .tc-card-center-suit { font-size: 1.25rem; }

  .tc-my-hand {
    padding: 8px 10px 10px;
    gap: 7px;
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .tc-hand-label {
    font-size: 0.56rem;
  }

  .tc-hand-cards {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 8px 2px 12px;
    scrollbar-width: thin;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .tc-hand-card {
    width: 46px;
    height: 68px;
    border-radius: 8px;
  }

  .tc-hand-card:hover,
  .tc-peek-hand .tc-hand-card:hover,
  .tc-dealing-hand .tc-hand-card:hover {
    transform: translateY(-5px) scale(1.03);
  }

  .tc-hand-card.is-selected {
    transform: translateY(-7px) scale(1.04) !important;
  }

  .tc-hand-action-row {
    gap: 6px;
    flex-wrap: wrap;
  }

  .tc-play-btn {
    width: 100%;
    max-width: 220px;
    padding: 8px 14px;
    border-radius: 10px;
  }

  .tc-hand-hint {
    width: 100%;
    min-height: 1.1em;
    font-size: 0.66rem;
  }

  .tc-trump-select-overlay,
  .tc-dealing-overlay,
  .tc-bid-overlay,
  .tc-round-over-overlay,
  .tc-game-over-overlay,
  .tc-score-overlay {
    padding: 10px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .tc-trump-select-panel,
  .tc-dealing-panel,
  .tc-bid-panel,
  .tc-round-over-panel,
  .tc-game-over-panel,
  .tc-score-panel {
    margin: auto 0;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    border-radius: 18px;
    padding: 18px 14px;
  }

  .tc-peek-hand,
  .tc-dealing-hand {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px 2px 12px;
  }

  .tc-suit-grid,
  .tc-score-teams {
    gap: 8px;
  }

  .tc-suit-btn {
    padding: 12px 8px;
    border-radius: 12px;
    font-size: 1.5rem;
  }

  .tc-bid-chip {
    width: 34px;
    height: 34px;
  }

  .tc-log-toggle {
    padding: 7px 10px;
    font-size: 0.62rem;
  }

  .tc-log-list {
    max-height: 90px;
    padding: 0 10px 8px;
  }
}

@media (max-width: 380px) {
  .tc-players-layout {
    grid-template-columns: 50px minmax(0, 1fr) 50px;
    grid-template-rows: 70px minmax(136px, 1fr) 70px;
    min-height: 316px;
    padding: 5px;
  }

  .tc-table {
    min-height: 316px;
  }

  .tc-pod-west,
  .tc-pod-east {
    max-width: 48px;
  }

  .tc-pod-stats span:nth-child(2),
  .tc-pod-stats span:nth-child(4),
  .tc-pod-score {
    display: none;
  }

  .tc-trick-area {
    width: 112px;
    height: 112px;
  }

  .tc-card {
    width: 34px;
    height: 49px;
  }

  .tc-hand-card {
    width: 43px;
    height: 64px;
  }
}
