/* 5crowns/public/css/game.css — only what is specific to 5 Crowns' table.
   Page chrome, seats, cards, tray, lobby and reveal screens all come from
   the shared kit stylesheets. */

:root {
  --fc-red: #c0392b;
  --fc-black: #23241f;
  --fc-star: #b8860b;
  --fc-wild-glow: #ffd54a;
}

/* Room reserved around the felt for the top bar, info strip and this
   game's tray (status row, groups + loose cards, two rows of buttons). */
.table-felt { --tbl-felt-chrome: 430px; }
#game-table { padding: 46px 38px; }

/* ── Piles in the felt centre ─────────────────────────────────────── */
#table-center { align-items: center; gap: 26px; }
.fc-pile { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pile-label { font-size: 0.66rem; color: var(--tbl-text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pile-count { font-size: 0.68rem; color: var(--tbl-text-muted); min-height: 1em; }
.pile-slot { border-radius: 8px; }
.pile-slot.clickable { cursor: pointer; transition: transform 0.12s ease; }
.pile-slot.clickable .pcard { box-shadow: 0 0 0 3px rgba(255, 228, 56, 0.55), 0 2px 4px rgba(0,0,0,0.3); }
.pile-slot.clickable:hover { transform: translateY(-3px); }
.pcard.fc-empty { background: transparent; border: 2px dashed rgba(255,255,255,0.28); box-shadow: none; }

/* ── The five-suit deck ───────────────────────────────────────────── */
.pcard.fc-red { color: var(--fc-red); }
.pcard.fc-black { color: var(--fc-black); }
.pcard.fc-star { color: var(--fc-star); }
.pcard.fc-joker .pc-suit { font-size: 1.5em; }
.pcard .fc-joker-label { font-size: 0.42em; letter-spacing: 0.04em; }
.pcard.is-wild { box-shadow: 0 0 0 2px var(--fc-wild-glow), 0 2px 10px rgba(255, 215, 0, 0.5); }
.pcard.selected { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--accent), 0 6px 14px rgba(0,0,0,0.3); }
.pcard.is-wild.selected { box-shadow: 0 0 0 3px var(--accent), 0 0 0 5px var(--fc-wild-glow), 0 6px 14px rgba(0,0,0,0.3); }
.pcard.fc-just-drawn::after { content: 'new'; position: absolute; top: -8px; right: -6px; font-size: 0.5rem; font-weight: 800; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 1px 5px; }
#hand-area .pcard { position: relative; }

/* ── Hand: groups + loose cards, stacked ──────────────────────────── */
#hand-area { display: block; width: 100%; max-width: 640px; margin: 0 auto 6px; }
.fc-hand { display: flex; flex-direction: column; gap: 6px; }
.fc-group {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 2px solid var(--tbl-panel-border);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}
.fc-group.valid { border-color: #1f8a4c; }
.fc-group.invalid { border-color: var(--danger); }
.fc-group-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--tbl-text-muted); width: 34px; flex-shrink: 0; }
.fc-group.valid .fc-group-label { color: #43a047; }
.fc-group-cards, .fc-ungrouped { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-ungrouped { padding: 6px 4px 2px; justify-content: center; min-height: 40px; align-items: center; }
.fc-hint { font-size: 0.78rem; color: var(--tbl-text-muted); }
#hand-area .pcard { width: 48px; height: 68px; font-size: 15px; }
#hand-area .pcard .pc-suit { font-size: 17px; }
#hand-area .pcard.selectable:hover { transform: translateY(-4px); }
#hand-area .pcard.selectable.selected:hover { transform: translateY(-8px); }

#action-row { gap: 8px; }
#action-row button { padding: 0.5rem 0.9rem; font-size: 0.82rem; }
#action-row button.fc-goout { background: linear-gradient(135deg, #ffe89a, var(--fc-wild-glow)); color: #3a2c00; }

/* ── Status strip / tokens ────────────────────────────────────────── */
.fc-wild-chip { color: var(--tbl-accent); font-weight: 700; }
.tk-badge.fc-dealer { background: var(--accent); color: var(--on-accent); }
.tk-badge.fc-out { background: #1f8a4c; color: #fff; }
.tk-seat.sitting-out { opacity: 0.6; }
.tk-muted { font-size: 0.66rem; color: var(--tbl-text-muted); }

/* ── Reveal ───────────────────────────────────────────────────────── */
.fc-reveal-block {
  width: 100%; max-width: 480px;
  padding: 8px 12px; margin: 0 auto 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--tbl-panel-border);
}
.fc-reveal-block.winner { border-color: #43a047; }
.fc-reveal-name { display: flex; justify-content: space-between; font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.fc-reveal-score { color: var(--accent); }
.fc-reveal-score small { color: var(--tbl-text-muted); font-weight: 400; }
.fc-reveal-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-mini-group { display: flex; gap: 2px; padding: 3px; border-radius: 6px; border: 1px solid #1f8a4c; }
.fc-mini-group.leftover { border-color: var(--danger); }
.fc-mini {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 38px; border-radius: 4px;
  background: #f4f1ea; border: 1px solid rgba(0,0,0,0.25);
  font-family: var(--font-display); font-weight: 800; font-size: 0.66rem;
}
.fc-mini.fc-red { color: var(--fc-red); }
.fc-mini.fc-black { color: var(--fc-black); }
.fc-mini.fc-star { color: var(--fc-star); }
.fc-mini.is-wild { box-shadow: 0 0 0 1.5px var(--fc-wild-glow); }

/* ── Score table (game over + scoreboard) ─────────────────────────── */
.fc-score-table { width: 100%; max-width: 560px; margin: 0 auto; border-collapse: collapse; font-size: 0.78rem; }
.fc-score-table th, .fc-score-table td { padding: 5px 6px; text-align: right; border-bottom: 1px solid var(--tbl-panel-border); }
.fc-score-table th:first-child, .fc-score-table td:first-child { text-align: left; font-weight: 700; }
.fc-score-table td.total { font-weight: 800; }
.fc-score-table tr.leader td.total { color: var(--accent); }
.fc-scoreboard-box { max-width: 560px; width: 92%; max-height: 80dvh; overflow: auto; }
.fc-scoreboard-box h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.1rem; text-align: center; }

@media (max-width: 480px) {
  #hand-area .pcard { width: 40px; height: 56px; font-size: 13px; }
  #hand-area .pcard .pc-suit { font-size: 14px; }
  .fc-group-cards, .fc-ungrouped { gap: 4px; }
  #action-row { gap: 6px; }
  #action-row button { padding: 0.45rem 0.7rem; font-size: 0.76rem; }
  .fc-score-table { font-size: 0.7rem; }
  .fc-score-table th, .fc-score-table td { padding: 4px 3px; }
}
