/* ============================================================
   Felt Trainer — Ultimate Texas Hold'em game-specific styles
   Tokens, resets, setup screen, header, toast, 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: 14px; padding: 24px 18px 16px;
  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 20px; 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;
}

/* ===== Table layout (dealer / community / player / bet spots) ===== */
.uth-table { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 12px 0 4px; }

.hand-area {
  width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 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-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; }
.dealer-area .hand-label { color: #ef8a8a; }
.player-area .hand-label { color: #8fb6e3; }
.hand-eval { font-size: 0.8rem; font-weight: 700; color: var(--gold); min-height: 1rem; text-align: center; }

.community-area { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.community-label { font-size: 0.56rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; color: rgba(212,175,55,0.55); }

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

/* ===== Printed bet spots ===== */
.bet-spots { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.bet-spot {
  min-width: 62px; padding: 6px 10px; border-radius: 10px;
  border: 2px dashed rgba(255,255,255,0.22); background: rgba(0,0,0,0.16);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transition: border-color .15s, background .15s;
}
.bet-spot .spot-name { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.bet-spot .spot-amount { font-size: 0.76rem; font-weight: 800; color: var(--gold-bright); font-variant-numeric: tabular-nums; min-height: 0.9rem; }
.bet-spot.has-bet { border-style: solid; border-color: var(--gold); background: rgba(212,175,55,0.1); }
.bet-spot-trips.has-bet { border-color: var(--cyan); background: rgba(34,211,238,0.08); }
.bet-spot-play.has-bet { border-color: var(--blue); background: rgba(91,142,201,0.12); }

/* ===== 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%); }
@keyframes badgePop { from { transform: scale(0.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== Cards ===== */
.card {
  width: 58px; height: 84px; 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.78rem; 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.55rem; opacity: 0.82; }
.card.face-card .card-center { font-size: 1.25rem; font-weight: 800; opacity: 0.6; }
.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); }

/* ===== 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: 14px; padding: 14px 20px 20px; background: var(--surface); border-top: 1px solid var(--border);
}
.bet-controls, .decision-controls { display: flex; gap: 8px; align-items: center; }
.decision-controls .bet-display { font-size: 0.78rem; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; margin-right: 4px; }

.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-bet { background: var(--gold); color: #1a1a1a; border-color: transparent; }
.btn-action.btn-bet:hover:not(:disabled) { background: var(--gold-bright); }
.btn-action.btn-trips { border-color: var(--cyan); color: var(--cyan); }
.btn-action.btn-trips.active { background: var(--cyan); color: #042; border-color: var(--cyan); }
.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-raise { background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(91,142,201,.3); min-width: 110px; }
.btn-action.btn-raise:hover:not(:disabled) { filter: brightness(1.12); }
.btn-action.btn-check { border-color: var(--gold-dim); color: var(--gold); }
.btn-action.btn-check:hover:not(:disabled) { border-color: var(--gold); background: var(--gold-dim); }
.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); }

/* ===== 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 8px 12px; gap: 10px; }
  .felt-surface { padding: 24px 8px 14px; border-width: 6px; }
  .hand-area { max-width: 100%; padding: 8px 8px; }
  .card { width: 48px; height: 70px; }
  .card .card-center { font-size: 1.3rem; }
  .hand-cards { gap: 4px; min-height: 74px; }
  .controls-area { gap: 8px; padding: 12px 8px; }
  .btn-action { padding: 9px 12px; font-size: 0.78rem; min-width: 64px; }
  .btn-action.btn-raise { min-width: 92px; }
  .bet-spot { min-width: 54px; padding: 5px 7px; }
}
@media (max-width: 460px) {
  .felt-edge-label { display: none; }
  .card { width: 42px; height: 61px; }
  .hand-cards { gap: 3px; }
  .bet-spots { gap: 6px; }
}

/* ===== Pre-flop strategy chart overlay ===== */
.chart-overlay {
  position: fixed; inset: 0; z-index: 100; padding: 16px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.72);
}
.chart-overlay.hidden { display: none; }
.chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px 18px; max-width: 540px; width: 100%; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.55);
}
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chart-head h3 { font-family: var(--font-display); font-size: 1.05rem; color: var(--text); }
.chart-sub { font-size: 0.72rem; color: var(--text-muted); line-height: 1.6; margin: 8px 0 12px; }
.chart-key { font-weight: 800; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.chart-key-raise { background: var(--gold); color: #1a1a1a; }
.chart-key-check { background: var(--surface-3); color: var(--text-muted); }

.chart-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 2px; }
.chart-cell {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; font-weight: 800; border-radius: 3px; font-variant-numeric: tabular-nums;
}
.chart-cell.cc-raise { background: var(--gold); color: #1a1a1a; }
.chart-cell.cc-check { background: var(--surface-3); color: var(--text-dim); }
.chart-cell.current { outline: 2px solid var(--cyan); outline-offset: -1px; box-shadow: 0 0 10px var(--cyan); z-index: 1; }

@media (max-width: 480px) {
  .chart-card { padding: 12px; }
  .chart-cell { font-size: 0.42rem; border-radius: 2px; }
  .chart-grid { gap: 1px; }
}
