/* ============================================================
   Felt Trainer — Poker Reads Trainer styles
   Tokens, resets, setup screen, header, toast, and the tutorial card
   base live in shared/styles.css. This file owns the felt, the cards,
   the 13×13 heatmap, the archetype picker, and the controls.
   ============================================================ */

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

/* ===== Archetype picker (setup) ===== */
.archetype-picker { display: flex; flex-direction: column; gap: 8px; }
.archetype-opt {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px;
  text-align: left; padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-family: var(--font-body); cursor: pointer; transition: all .15s;
}
.archetype-opt:hover { border-color: var(--text-dim); background: var(--surface-3); }
.archetype-opt.is-active { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; background: rgba(45,159,95,.08); }
.archetype-opt .ao-name { font-weight: 800; font-size: 0.92rem; }
.archetype-opt .ao-diff { color: var(--gold); font-size: 0.7rem; letter-spacing: 1px; }
.archetype-opt .ao-tag { grid-column: 1 / -1; color: var(--text-muted); font-size: 0.74rem; line-height: 1.35; }

/* ===== Mode toggle ===== */
.mode-toggle { display: flex; gap: 6px; }
.mode-opt {
  flex: 1; padding: 9px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); font-family: var(--font-body);
  font-weight: 700; font-size: 0.82rem; cursor: pointer; transition: all .15s;
}
.mode-opt:hover { border-color: var(--text-dim); color: var(--text); }
.mode-opt.is-active { background: var(--green); color: #fff; border-color: transparent; }

/* ===== Game screen scaffolding ===== */
.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: 22px 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: 720px; position: relative;
  padding: 28px 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;
}

.reads-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: 8px 14px; border-radius: 14px; border: 2px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.12);
}
.opp-area { box-shadow: inset 0 0 0 1px rgba(224,82,82,0.12); }
.hand-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: #ef8a8a; }
.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: 76px; align-items: center; justify-content: center; }

/* ===== Bet chips (animate in when the bot bets / raises) ===== */
.bet-chips { display: flex; gap: 6px; align-items: flex-end; justify-content: center; min-height: 40px; margin-top: 2px; }
.bet-chips .chip-label {
  align-self: center; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--gold-bright); margin-left: 6px; opacity: 0; animation: chipLabelIn .3s ease .25s forwards;
}
.chip {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background:
    radial-gradient(circle at 50% 42%, #fff6 0 18%, transparent 19%),
    repeating-conic-gradient(var(--chip-c, #c0392b) 0 18deg, #fff 18deg 24deg, var(--chip-c, #c0392b) 24deg 36deg);
  box-shadow: 0 2px 5px rgba(0,0,0,.45), inset 0 0 0 3px rgba(255,255,255,.85), inset 0 0 0 4px rgba(0,0,0,.15);
  transform: translateY(-26px) scale(.4); opacity: 0; animation: chipDrop .35s cubic-bezier(.34,1.56,.64,1) forwards;
}
.chip.chip-blue { --chip-c: #2f6da8; }
.chip.chip-green { --chip-c: #2d9f5f; }
.chip.chip-black { --chip-c: #2a2a2a; }
.chip.chip-white { --chip-c: #9aa3ad; }
@keyframes chipDrop { to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes chipLabelIn { to { opacity: 1; } }

/* ===== Cards (simple rank+suit) ===== */
.card {
  width: 50px; height: 72px; border-radius: 6px; background: #fffef8; color: #1a1a1a;
  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);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: 'Plus Jakarta Sans', Georgia, serif; flex-shrink: 0;
}
.card.card-red { color: #c0392b; }
.card .card-rank { font-size: 1.05rem; font-weight: 800; line-height: 1; }
.card .card-suit { font-size: 1.1rem; line-height: 1; }
.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);
}

/* ===== Heatmap ===== */
.heatmap-wrap {
  width: 100%; max-width: 264px; display: flex; flex-direction: column; gap: 5px;
  padding: 8px 10px 10px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border);
}
.heatmap-head { display: flex; align-items: baseline; justify-content: space-between; }
.heatmap-title { font-size: 0.58rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.5); }
.heatmap-meta { font-size: 0.7rem; font-weight: 800; color: var(--gold-bright); font-variant-numeric: tabular-nums; }

/* bulk-select toolbar (quiz) */
.quick-select { display: flex; flex-wrap: wrap; gap: 5px; }
.quick-select button {
  flex: 1 1 auto; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-family: var(--font-body);
  font-size: 0.72rem; font-weight: 700; cursor: pointer; transition: all .12s; min-width: 52px;
}
.quick-select button:hover { background: var(--surface-3); border-color: var(--text-dim); }
.quick-select button:active { transform: scale(.96); }
.quick-select button.qs-clear { color: var(--red-bright); border-color: var(--red-bright); flex-grow: 0; }

.heatmap-grid {
  display: grid; grid-template-columns: repeat(13, 1fr); gap: 1px; width: 100%;
}
/* the grid is the interactive surface in quiz mode → make it bigger + tappable */
.game-screen.quiz-mode .heatmap-wrap { max-width: 380px; }
.game-screen.quiz-mode .heat-cell { font-size: 0.42rem; }
.heat-cell {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  font-size: 0.36rem; font-weight: 700; border-radius: 2px; cursor: default;
  background: transparent; color: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.06); user-select: none;
  font-variant-numeric: tabular-nums; letter-spacing: -0.04em;
}
/* discrete, easy-to-discern tiers */
.heat-cell.hc-likely { background: #46c97f; color: #062611; border-color: #7ee0a6; }
.heat-cell.hc-possible { background: #2a6b46; color: #cdedd9; border-color: #3c8a5d; }
.heat-cell.hc-cold { background: rgba(255,255,255,0.025); color: rgba(255,255,255,0.18); }
/* quiz: cells are clickable */
.game-screen.quiz-mode .heat-cell { cursor: pointer; }
.heat-cell.hc-pick { box-shadow: 0 0 0 2px var(--cyan) inset; color: #fff; }
.heat-cell.hc-hit { box-shadow: 0 0 0 2px var(--green-bright) inset; }
.heat-cell.hc-miss { box-shadow: 0 0 0 2px var(--red-bright) inset; }
.heat-cell.hc-missed-target { box-shadow: 0 0 0 2px var(--gold) inset; }

.heatmap-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 2px; }
.heatmap-legend .lg { font-size: 0.66rem; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.heatmap-legend .lg-quiz { color: var(--cyan); font-weight: 700; }
.heatmap-legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.heatmap-legend .sw-hot { background: #46c97f; }
.heatmap-legend .sw-mid { background: #2a6b46; }
.heatmap-legend .sw-cold { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }

/* ===== Coach panel ===== */
.coach-panel {
  width: 100%; max-width: 720px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px; display: flex; align-items: flex-start; 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; padding-top: 3px; }
.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 .grade-sub { color: var(--text-dim); font-size: 0.82rem; }

/* "Explain more" collapsible */
.coach-explain { margin-top: 8px; }
.coach-explain > summary {
  cursor: pointer; color: var(--cyan); font-size: 0.78rem; font-weight: 700;
  list-style: none; display: inline-flex; align-items: center; gap: 5px; user-select: none;
}
.coach-explain > summary::-webkit-details-marker { display: none; }
.coach-explain > summary::before { content: '▸'; font-size: 0.7rem; transition: transform .15s; }
.coach-explain[open] > summary::before { transform: rotate(90deg); }
.coach-explain p { margin: 7px 0 0; font-size: 0.84rem; line-height: 1.5; color: var(--text-muted); }
.coach-explain .ex-label { color: var(--gold); 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);
}
.decision-controls { 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: 96px;
}
.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-next { background: var(--blue); color: #fff; border-color: transparent; box-shadow: 0 2px 10px rgba(91,142,201,.3); }
.btn-action.btn-next:hover:not(:disabled) { filter: brightness(1.12); }
.btn-action.btn-submit { background: var(--cyan); color: #042; border-color: transparent; }
.btn-action.btn-submit:hover:not(:disabled) { filter: brightness(1.1); }
.btn-action.btn-reveal { border-color: var(--gold-dim); color: var(--gold); }
.btn-action.btn-reveal: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 ===== */
.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; border-left: none; border-top: 1px solid var(--green); box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
}
@media (max-width: 600px) {
  .felt-surface { padding: 22px 8px 14px; border-width: 6px; }
  .card { width: 42px; height: 60px; }
  .card .card-rank { font-size: 0.9rem; }
  .heatmap-wrap { max-width: 300px; }
  .heat-cell { font-size: 0.34rem; }
  .btn-action { padding: 9px 12px; min-width: 72px; font-size: 0.78rem; }
  .header-stats { gap: 12px; }
}
