/* ============================================================
   Felt Trainer — Three Card 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;
}

/* ===== Dealer + player hands (stacked) ===== */

.poker-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 0 6px;
}

/* Printed dealer-qualify rule on the felt */
.dealer-qualify {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(212,175,55,0.62);
  text-align: center;
  border-top: 1px solid rgba(212,175,55,0.18);
  border-bottom: 1px solid rgba(212,175,55,0.18);
  padding: 5px 0;
  width: 100%;
  max-width: 360px;
}

/* Printed paytables on the felt */
.felt-paytables {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 4px;
}
.felt-pt {
  min-width: 168px;
  padding: 8px 12px;
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 8px;
  background: rgba(0,0,0,0.22);
}
.felt-pt-title {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-align: center;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(212,175,55,0.2);
}
.felt-pt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.64rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.62);
}
.felt-pt-row b { color: var(--gold-bright); font-variant-numeric: tabular-nums; }

.hand-area {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.12);
  transition: border-color .25s, box-shadow .25s;
}
.dealer-area { box-shadow: inset 0 0 0 1px rgba(224,82,82,0.12); }
.player-area { box-shadow: inset 0 0 0 1px rgba(91,142,201,0.12); }

.hand-area.winner.player-area {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), 0 0 24px rgba(91,142,201,0.4);
}
.hand-area.winner.dealer-area {
  border-color: var(--red-bright);
  box-shadow: 0 0 0 1px var(--red-bright), 0 0 24px rgba(224,82,82,0.4);
}

.hand-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.dealer-area .hand-label { color: #ef8a8a; }
.player-area .hand-label { color: #8fb6e3; }

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

.hand-eval {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  min-height: 1rem;
  text-align: center;
}

/* ===== 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, #e16363 0%, #b22828 100%); }
.result-badge.badge-push { background: linear-gradient(180deg, #6fa0d8 0%, #3f6da8 100%); }
.result-badge.badge-fold { background: linear-gradient(180deg, #8a8a8a 0%, #555 100%); }
@keyframes badgePop {
  from { transform: scale(0.2); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ===== Cards ===== */

.card {
  width: 60px;
  height: 86px;
  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;
}
.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.8rem; font-weight: 800; }
.card .card-suit { font-size: 0.6rem; margin-top: -1px; }
.card .card-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem; opacity: 0.82;
}
.card.face-card .card-center { font-size: 1.3rem; font-weight: 800; opacity: 0.6; }

/* Face-down dealer card */
.card.card-back {
  background: linear-gradient(135deg, #1e4528 0%, #0f2a16 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,.4), inset 0 0 0 2px rgba(255,255,255,.08);
}
.card.card-back .card-back-pattern {
  position: absolute;
  inset: 6px;
  border-radius: 4px;
  border: 1px solid rgba(212,175,55,.35);
  background:
    repeating-linear-gradient(45deg, rgba(212,175,55,.12) 0 4px, transparent 4px 8px),
    repeating-linear-gradient(-45deg, rgba(212,175,55,.12) 0 4px, transparent 4px 8px);
}

/* ===== 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: var(--chip-red); }
.history-dot.dot-push { background: var(--blue); }
.history-dot.dot-fold { background: #6b6b6b; }

/* ===== 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);
}

/* Bet spots (Pair Plus / Ante / Play) */
.bet-spots { display: flex; gap: 14px; align-items: stretch; }
.bet-spot {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 84px; padding: 10px 12px;
  border-radius: 12px;
  border: 2px dashed rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.16);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.bet-spot:hover:not(.disabled) { border-color: var(--gold); transform: translateY(-1px); }
.bet-spot.disabled { opacity: 0.5; cursor: default; }
.bet-spot.has-bet { border-style: solid; border-color: var(--gold); background: rgba(212,175,55,0.1); }
.bet-spot .spot-name {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text);
}
.bet-spot .spot-sub { font-size: 0.6rem; color: var(--text-dim); }
.bet-spot .spot-amount {
  font-size: 0.78rem; font-weight: 800; color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
#play-spot { border-color: rgba(91,142,201,0.5); cursor: default; }
#play-spot.has-bet { border-color: var(--blue); background: rgba(91,142,201,0.12); }

/* Chips */
.chip-rack { display: flex; gap: 8px; align-items: center; }
.chip-rack.disabled { opacity: 0.5; pointer-events: none; }
.chip-btn {
  width: 50px; height: 50px; border-radius: 50%;
  border: 3px dashed rgba(255,255,255,0.4);
  cursor: pointer; font-family: var(--font-body); font-weight: 800; font-size: 0.76rem; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 -2px 4px rgba(0,0,0,.3);
  transition: transform .1s, filter .12s; flex-shrink: 0;
}
.chip-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.chip-btn.selected { outline: 3px solid var(--gold); outline-offset: 2px; transform: translateY(-2px); }
.chip-btn[data-denom="1"]   { background: radial-gradient(circle at 35% 30%, #fff 0%, #d2d2d2 80%); color: #222; }
.chip-btn[data-denom="5"]   { background: radial-gradient(circle at 35% 30%, #e05252 0%, var(--chip-red) 80%); }
.chip-btn[data-denom="25"]  { background: radial-gradient(circle at 35% 30%, #3bb46f 0%, var(--chip-green) 80%); }
.chip-btn[data-denom="100"] { background: radial-gradient(circle at 35% 30%, #2a2a2a 0%, var(--chip-black) 80%); }

/* 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-play { background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(91,142,201,.3); min-width: 100px; }
.btn-action.btn-play:hover:not(:disabled) { filter: brightness(1.12); }
.btn-action.btn-fold { border-color: var(--red-bright); color: var(--red-bright); }
.btn-action.btn-fold:hover:not(:disabled) { background: rgba(224,82,82,.12); }
.btn-action.btn-new { background: var(--gold); color: #1a1a1a; border-color: transparent; }
.btn-action.btn-new:hover { background: var(--gold-bright); }
.btn-action.btn-rebet { border-color: var(--gold-dim); color: var(--gold); }
.btn-action.btn-rebet:hover { border-color: var(--gold); background: var(--gold-dim); }

/* ===== Tutorial dock (roulette/baccarat 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 12px 14px; border-width: 6px; }
  .hand-area { max-width: 100%; }
  /* Sit side-by-side when there's room, stack on small phones */
  .felt-paytables { gap: 10px; }
  .felt-pt { min-width: 0; flex: 1 1 150px; }
  .card { width: 52px; height: 75px; }
  .card .card-center { font-size: 1.35rem; }
  .controls-area { gap: 10px; padding: 12px; }
  .chip-btn { width: 44px; height: 44px; font-size: 0.66rem; }
  .btn-action { padding: 9px 12px; font-size: 0.78rem; min-width: 70px; }
  .bet-spot { min-width: 72px; padding: 8px 10px; }
}
@media (max-width: 460px) {
  .felt-edge-label { display: none; }
  .card { width: 46px; height: 67px; }
  .bet-spots { gap: 8px; }
}
