/* ===========================================================
   Hearts — game-specific styles only.
   Chrome, buttons, #status, .hint, .score-box/.stat all come
   from shared.css; here we style the table, seats and cards.
   =========================================================== */

body { gap: 14px; }

h1 { font-size: 2.4rem; }

/* ---------- lifetime wins / losses tally ---------- */
#stats { display: flex; gap: 12px; }

/* ---------- the four running game totals ---------- */
#scores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.score-box.player {
  min-width: 76px;
  padding: 8px 16px;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}
.score-box.player .val { font-size: 1.6rem; }
/* lowest score(s) = currently winning */
.score-box.player.leading { border-color: var(--green); }
/* whoever is to play right now */
.score-box.player.turn { transform: translateY(-3px); box-shadow: 0 6px 18px var(--shadow); }

/* ---------- the trick table: a cross of four seats ---------- */
#table {
  position: relative;
  width: 360px;
  max-width: 94vw;
  height: 300px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 10px 40px var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  align-items: center;
  justify-items: center;
}

.seat { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.seat-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  font-weight: 700;
}
.seat-n { grid-column: 2; grid-row: 1; }
.seat-w { grid-column: 1; grid-row: 2; }
.seat-e { grid-column: 3; grid-row: 2; }
.seat-s { grid-column: 2; grid-row: 3; }
.trick-centre { grid-column: 2; grid-row: 2; }

/* the small slot a played card sits in */
.seat-card { min-height: 70px; display: flex; align-items: center; justify-content: center; }

/* ---------- the hand header ---------- */
.hand-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: min(520px, 94vw);
  font-weight: 600;
}
.hand-name { letter-spacing: 1px; text-transform: uppercase; font-size: 0.8rem; opacity: 0.7; }
.hand-info { font-size: 0.85rem; color: var(--muted); }

/* ---------- the cards row (your hand) ---------- */
.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: min(560px, 96vw);
  min-height: 92px;
}

/* ---------- a single playing card ---------- */
.card {
  position: relative;
  width: 50px;
  height: 70px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 3px 10px var(--shadow);
  flex: 0 0 auto;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}
/* a card sitting in the centre trick area */
.seat-card .card { width: 46px; height: 64px; animation: deal 0.22s ease both; }

.card .rank {
  position: absolute;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
}
.card .rank.tl { top: 5px; left: 6px; }
.card .rank.br { bottom: 5px; right: 6px; transform: rotate(180deg); }
.card .pip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.card.red { color: var(--red); }
.card.black { color: var(--text); }

/* hand interactivity states */
.card.legal:hover { transform: translateY(-8px); box-shadow: 0 8px 18px var(--shadow); }
.card.selected { transform: translateY(-12px); outline: 3px solid var(--accent); outline-offset: 1px; }
.card.disabled { opacity: 0.4; }

@keyframes deal {
  from { opacity: 0; transform: translateY(-10px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- passing controls ---------- */
/* `display: flex` would otherwise override the [hidden] attribute, so the
   controls only appear during the passing phase (game.js toggles .hidden). */
#passControls[hidden] { display: none; }
#passControls { display: flex; justify-content: center; }
#passBtn:disabled { opacity: 0.4; cursor: not-allowed; }

#newGame { padding: 10px 22px; }

/* ---------- narrow phones ---------- */
@media (max-width: 420px) {
  #table { width: 300px; height: 260px; }
  .card { width: 42px; height: 60px; }
  .seat-card .card { width: 40px; height: 56px; }
  .card .rank { font-size: 0.78rem; }
  .card .pip { font-size: 1.4rem; }
  .score-box.player { min-width: 64px; padding: 6px 10px; }
  .score-box.player .val { font-size: 1.3rem; }
}
