/* ============================================================
   Felt Trainer — Video Poker game-specific styles
   Tokens, resets, setup screen, header bar, toasts, tooltips,
   and the tutorial card base live in shared/styles.css.
   ============================================================ */

.setup-brand {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  margin-bottom: 8px;
}

/* ===== Game screen ===== */

.game-screen { display: none; flex-direction: column; height: 100vh; height: 100dvh; }
.game-screen.active { display: flex; }

.game-main { flex: 1; display: flex; min-height: 0; }

.table-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 16px;
  padding: 28px 18px 18px;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(13,107,44,.18) 0%, transparent 70%),
    var(--bg);
  overflow-y: auto;
}

/* ===== Felt ===== */

.felt-surface {
  width: 100%;
  max-width: 760px;
  position: relative;
  padding: 30px 22px 22px;
  border-radius: 16px;
  border: 8px solid #14341c;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.015) 2px, rgba(0,0,0,.015) 4px),
    radial-gradient(ellipse at 50% 35%, var(--felt-light) 0%, var(--felt) 55%, var(--felt-dark) 100%);
  box-shadow: inset 0 2px 32px rgba(0,0,0,.32), 0 6px 24px rgba(0,0,0,.5);
}
.felt-surface::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  background: linear-gradient(180deg, #1e4528 0%, #14341c 50%, #0f2a16 100%);
  z-index: -1;
  box-shadow: inset 0 2px 6px rgba(255,255,255,.08), inset 0 -2px 6px rgba(0,0,0,.3), 0 8px 30px rgba(0,0,0,.55);
}
.felt-edge-label {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(255,255,255,0.22);
  white-space: nowrap;
}

/* ===== Layout: paytable beside the hand ===== */

/* ===== Machine cabinet: belly-glass paytable on top, screen below ===== */

.vp-machine {
  width: 100%;
  max-width: 560px;
  box-sizing: border-box;
  margin: 6px auto 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, #2a2f3a 0%, #1a1d24 60%, #14161b 100%);
  border: 1px solid rgba(0,0,0,0.5);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 10px 28px rgba(0,0,0,0.5);
}

.vp-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 12px 14px;
  border-radius: 0 0 8px 8px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(20,52,28,0.9) 0%, rgba(8,20,12,0.95) 75%);
  border: 2px solid #0a0c10;
  border-top: none;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.6);
}

.hand-cards {
  display: flex;
  gap: 8px;
  min-height: 116px;
  align-items: center;
  justify-content: center;
}

.bet-display {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  min-height: 1rem;
}

/* ===== HOLD buttons (one under each card, machine-style) ===== */

.hold-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.hold-buttons.hidden { display: none; }
.hold-btn {
  width: 64px;
  padding: 6px 0;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.18);
  background: linear-gradient(180deg, #3a3f4a 0%, #23262e 100%);
  color: rgba(255,255,255,0.65);
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all .12s;
}
.hold-btn:hover:not(:disabled) { border-color: var(--cyan); color: #fff; }
.hold-btn:disabled { opacity: 0.5; cursor: default; }
.hold-btn.active {
  background: linear-gradient(180deg, #ffe9a8 0%, var(--gold) 100%);
  color: #1a1a1a;
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(212,175,55,0.6), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ===== Paytable: the belly glass ===== */

.paytable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  background: linear-gradient(180deg, #0a2a6b 0%, #06184a 100%);
  border: 2px solid #0a0c10;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: inset 0 0 16px rgba(0,0,0,0.45);
}
.paytable caption {
  caption-side: top;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #ffd54a;
  padding: 6px 0;
  background: #05123a;
}
.paytable th {
  padding: 4px 8px;
  font-size: 0.62rem;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  text-align: right;
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
.paytable th.pt-hand { text-align: left; }
.paytable td {
  padding: 3px 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.paytable .pt-hand {
  text-align: left;
  font-weight: 700;
  color: #ffd54a;
  white-space: nowrap;
}
.paytable .pt-amount {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.78);
}
.paytable tr.royal-row .pt-hand,
.paytable tr.royal-row .pt-amount { color: #fff; }
/* Highlight the active coin column */
.paytable th.col-active,
.paytable td.col-active {
  background: rgba(255,213,74,0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,213,74,0.3);
}
.paytable td.pt-amount.col-active { color: #ffe9a8; }
/* Flash the winning hand's row */
.paytable tr.win-row .pt-hand,
.paytable tr.win-row .pt-amount { color: #fff; }
.paytable tr.win-row {
  background: rgba(70,183,106,0.28);
  animation: ptWinFlash .5s ease 3;
}
@keyframes ptWinFlash {
  0%, 100% { background: rgba(70,183,106,0.28); }
  50% { background: rgba(70,183,106,0.5); }
}

/* ===== Result badge ===== */

.result-badge {
  align-self: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  padding: 8px 18px;
  border-radius: 10px;
  color: #fff;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.45);
  animation: badgePop .4s cubic-bezier(.34,1.56,.64,1);
}
.result-badge.badge-win   { background: linear-gradient(180deg, #46b76a 0%, #0d6b2c 100%); }
.result-badge.badge-lose  { background: linear-gradient(180deg, #6b6b6b 0%, #444 100%); }
.result-badge.badge-royal { background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold-dim) 100%); color: #1a1a1a; }
@keyframes badgePop {
  from { transform: scale(0.2); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ===== Cards (held + recommended states are VP-specific) ===== */

.card {
  width: 64px;
  height: 92px;
  border-radius: 6px;
  background: #fffef8;
  box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 4px 10px rgba(0,0,0,.15), inset 0 0 0 1px rgba(0,0,0,.08);
  position: relative;
  font-family: 'Plus Jakarta Sans', Georgia, serif;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
}
.card.red { color: #c0392b; }
.card.black { color: #1a1a1a; }
.card .card-corner-tl {
  position: absolute; top: 4px; left: 5px;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
}
.card .card-corner-br {
  position: absolute; bottom: 4px; right: 5px;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
  transform: rotate(180deg);
}
.card .card-rank { font-size: 0.86rem; font-weight: 800; }
.card .card-suit { font-size: 0.64rem; margin-top: -1px; }
.card .card-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.7rem; opacity: 0.82;
}
.card.face-card .card-center { font-size: 1.35rem; font-weight: 800; opacity: 0.6; }

/* "HELD" tag — hidden unless the card is held */
.card .hold-tag {
  position: absolute;
  top: -11px; left: 50%; transform: translateX(-50%);
  font-size: 0.56rem; font-weight: 800; letter-spacing: 0.08em;
  background: var(--cyan); color: #042;
  padding: 2px 7px; border-radius: 6px;
  opacity: 0; transition: opacity .12s;
  pointer-events: none; white-space: nowrap;
}
.card.held {
  transform: translateY(-12px);
  box-shadow: 0 0 0 2px var(--cyan), 0 10px 18px rgba(0,0,0,.4);
}
.card.held .hold-tag { opacity: 1; }

/* Coach's recommended hold — a dashed gold ring (advice, distinct from HELD) */
.card.recommended::after {
  content: 'best';
  position: absolute;
  bottom: -10px; left: 50%; transform: translateX(-50%);
  font-size: 0.5rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--gold-bright); background: rgba(0,0,0,0.55);
  padding: 1px 5px; border-radius: 5px; white-space: nowrap;
}
.card.recommended {
  outline: 2px dashed var(--gold);
  outline-offset: 2px;
}

/* ===== Scoreboard ===== */

.history-strip {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  min-height: 26px; margin-top: 6px;
}
.history-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 800; color: #fff;
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: 0 2px 4px rgba(0,0,0,.35);
  font-family: var(--font-body);
}
.history-dot.dot-win  { background: var(--green); }
.history-dot.dot-lose { background: #6b6b6b; }
.history-dot.dot-push { background: var(--blue); }

/* ===== Coach panel ===== */

.coach-panel {
  width: 100%; max-width: 760px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; font-size: 0.9rem;
}
.coach-panel .coach-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--cyan); flex-shrink: 0;
}
.coach-panel .coach-text { color: var(--text-muted); flex: 1; line-height: 1.5; }
.coach-panel .coach-text strong { color: var(--text); }
.coach-panel .coach-text .pos { color: var(--green-bright); font-weight: 700; }
.coach-panel .coach-text .neg { color: var(--red-bright); font-weight: 700; }

/* ===== Controls ===== */

.controls-area {
  flex-shrink: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 16px; padding: 14px 20px 20px;
  background: var(--surface); border-top: 1px solid var(--border);
}

/* Coin selector */
.coin-controls { display: flex; align-items: center; gap: 10px; }
.coin-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-dim);
}
.coin-selector { display: flex; gap: 6px; }
.coin-selector.disabled { opacity: 0.5; pointer-events: none; }
.coin-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 2px solid rgba(212,175,55,0.4);
  background: rgba(0,0,0,0.2); color: var(--text);
  font-family: var(--font-body); font-weight: 800; font-size: 0.84rem;
  cursor: pointer; transition: transform .1s, background .12s, border-color .12s;
  flex-shrink: 0;
}
.coin-btn:hover { transform: translateY(-2px); border-color: var(--gold); }
.coin-btn.selected {
  background: radial-gradient(circle at 35% 30%, var(--gold-bright) 0%, var(--gold-dim) 85%);
  color: #1a1a1a; border-color: var(--gold-bright);
}

/* Action buttons */
.action-buttons { display: flex; gap: 8px; align-items: center; }
.btn-action {
  padding: 11px 18px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; border-radius: var(--radius);
  cursor: pointer; transition: all .15s; min-width: 84px;
}
.btn-action:hover:not(:disabled) { background: var(--surface-3); border-color: var(--text-dim); }
.btn-action:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-action.btn-deal { background: var(--green); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(45,159,95,.3); }
.btn-action.btn-deal:hover:not(:disabled) { background: var(--green-bright); }
.btn-action.btn-deal:disabled { background: var(--surface-2); color: var(--text-dim); box-shadow: none; }
.btn-action.btn-draw { background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(91,142,201,.3); min-width: 100px; }
.btn-action.btn-draw:hover:not(:disabled) { filter: brightness(1.12); }
.btn-action.btn-betmax { border-color: var(--gold-dim); color: var(--gold); }
.btn-action.btn-betmax:hover:not(:disabled) { border-color: var(--gold); background: var(--gold-dim); }
.btn-action.btn-new { background: var(--gold); color: #1a1a1a; border-color: transparent; }
.btn-action.btn-new:hover { background: var(--gold-bright); }

/* ===== Tutorial dock (poker pattern) ===== */
.tut-step-counter { margin-left: auto; }
.game-main .tutorial-card {
  position: static; z-index: 2; inset: auto; flex-shrink: 0;
  width: 340px; max-width: none; overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--surface); border: none; border-left: 1px solid var(--green);
  border-radius: 0; box-shadow: -8px 0 30px rgba(0, 0, 0, .35);
  animation: pkrTutSlideIn .3s ease;
}
@keyframes pkrTutSlideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tut-skip { margin-top: auto; flex-shrink: 0; }
@media (max-width: 820px) {
  .game-main { flex-direction: column; }
  .game-main .tutorial-card {
    width: auto; max-height: 42vh; border-left: none; border-top: 1px solid var(--green);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .35);
  }
}

/* ===== Responsive ===== */
@media (max-width: 720px) {
  .table-area { padding: 18px 10px 12px; gap: 12px; }
  .felt-surface { padding: 24px 10px 14px; border-width: 6px; }
  .vp-machine { padding: 8px; }
  .vp-screen { padding: 14px 8px 12px; }
  .paytable { font-size: 0.62rem; }
  .paytable th, .paytable td { padding: 3px 4px; }
  .card { width: 52px; height: 75px; }
  .card .card-center { font-size: 1.4rem; }
  .hold-btn { width: 52px; }
  .controls-area { gap: 10px; padding: 12px; }
  .btn-action { padding: 9px 12px; font-size: 0.78rem; min-width: 70px; }
}
@media (max-width: 460px) {
  .felt-edge-label { display: none; }
  .vp-machine { padding: 6px; }
  .vp-screen { padding: 12px 5px 10px; }
  /* Let long hand names wrap so the active coin column is never clipped */
  .paytable .pt-hand { white-space: normal; line-height: 1.15; }
  .paytable th, .paytable td { padding: 3px 3px; font-size: 0.58rem; }
  .hand-cards { gap: 4px; }
  .card { width: 44px; height: 64px; }
  .card .card-center { font-size: 1.2rem; }
  .card .card-rank { font-size: 0.74rem; }
  .card .card-suit { font-size: 0.56rem; }
  .hold-buttons { gap: 4px; }
  .hold-btn { width: 44px; font-size: 0.5rem; padding: 5px 0; letter-spacing: 0.06em; }
  .coin-btn { width: 34px; height: 34px; font-size: 0.78rem; }
}
