/* ============================================================
   POKER IQ — shared.css
   Global styles, design tokens, card components, typography
   Version 1.0 | April 2026
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Core Palette */
  --color-felt:        #0A1F0F;   /* deep green — primary background */
  --color-felt-light:  #0F2A15;   /* slightly lighter felt */
  --color-felt-mid:    #122B18;   /* card/panel backgrounds */
  --color-felt-border: #1C3D22;   /* subtle borders */

  --color-gold:        #C8A84B;   /* primary accent */
  --color-gold-bright: #E8C86A;   /* hover / highlight gold */
  --color-gold-dim:    #8A7030;   /* muted gold for secondary elements */

  --color-cream:       #F5F0E8;   /* primary text */
  --color-cream-dim:   #B8B0A0;   /* secondary text */
  --color-cream-muted: #7A7268;   /* placeholder / disabled text */

  /* Suit Colors */
  --color-hearts:      #E8524A;
  --color-diamonds:    #E8524A;
  --color-spades:      #F5F0E8;
  --color-clubs:       #F5F0E8;

  /* Equity Bar */
  --color-equity-strong: #3DAA5C;   /* >65% */
  --color-equity-medium: #C8A84B;   /* 35–65% */
  --color-equity-weak:   #C0392B;   /* <35% */

  /* Functional */
  --color-success:     #3DAA5C;
  --color-warning:     #C8A84B;
  --color-danger:      #C0392B;

  /* Typography */
  --font-display:  'Bebas Neue', sans-serif;
  --font-body:     'DM Sans', sans-serif;
  --font-mono:     'DM Mono', monospace;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   40px;
  --space-2xl:  64px;

  /* Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;

  /* Shadows */
  --shadow-card:   0 4px 24px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 24px rgba(200,168,75,0.15);
  --shadow-deep:   0 8px 48px rgba(0,0,0,0.7);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.25s ease;
  --transition-slow:   0.4s ease;

  /* Layout */
  --max-width:   480px;   /* mobile-first max content width */
  --nav-height:  56px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-felt);
  color: var(--color-cream);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Subtle felt texture via noise pattern */
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(61,170,92,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(200,168,75,0.04) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-gold-bright);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
}

input, textarea, select {
  font-family: var(--font-body);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

/* Display — Bebas Neue */
.display-xl  { font-family: var(--font-display); font-size: 72px; line-height: 0.95; letter-spacing: 0.02em; }
.display-lg  { font-family: var(--font-display); font-size: 56px; line-height: 1;    letter-spacing: 0.02em; }
.display-md  { font-family: var(--font-display); font-size: 40px; line-height: 1.05; letter-spacing: 0.02em; }
.display-sm  { font-family: var(--font-display); font-size: 28px; line-height: 1.1;  letter-spacing: 0.03em; }
.display-xs  { font-family: var(--font-display); font-size: 20px; line-height: 1.2;  letter-spacing: 0.04em; }

/* Body — DM Sans */
.text-lg   { font-size: 18px; line-height: 1.6; }
.text-base { font-size: 16px; line-height: 1.6; }
.text-sm   { font-size: 14px; line-height: 1.5; }
.text-xs   { font-size: 12px; line-height: 1.4; }

/* Mono — DM Mono */
.mono-lg   { font-family: var(--font-mono); font-size: 18px; }
.mono-base { font-family: var(--font-mono); font-size: 15px; }
.mono-sm   { font-family: var(--font-mono); font-size: 13px; }

/* Color utilities */
.text-gold       { color: var(--color-gold); }
.text-gold-bright{ color: var(--color-gold-bright); }
.text-cream      { color: var(--color-cream); }
.text-cream-dim  { color: var(--color-cream-dim); }
.text-muted      { color: var(--color-cream-muted); }
.text-success    { color: var(--color-success); }
.text-danger     { color: var(--color-danger); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-content {
  width: 100%;
  max-width: var(--max-width);
  padding: var(--space-lg) var(--space-md);
  flex: 1;
}

.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-center   { justify-content: center; }
.justify-between  { justify-content: space-between; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }

.text-center { text-align: center; }
.text-right  { text-align: right; }

.w-full { width: 100%; }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }

/* ============================================================
   NAV BAR
   ============================================================ */
.navbar {
  width: 100%;
  height: var(--nav-height);
  background: rgba(10, 31, 15, 0.95);
  border-bottom: 1px solid var(--color-felt-border);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.05em;
  color: var(--color-gold);
}

.navbar-brand span {
  color: var(--color-cream);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ============================================================
   PLAYING CARDS
   ============================================================ */

/* Card container — renders two hole cards side by side */
.hole-cards {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  align-items: center;
}

/* Individual card */
.card {
  width: 72px;
  height: 100px;
  background: #FAFAF8;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(0,0,0,0.08);
  position: relative;
  transition: transform var(--transition-base);
  user-select: none;
}

.card:hover {
  transform: translateY(-3px);
}

/* Card rank + suit at top-left */
.card-corner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.card-rank {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  color: #1a1a1a;
}

.card-suit-small {
  font-size: 14px;
  line-height: 1;
}

/* Large suit in center */
.card-suit-large {
  font-size: 36px;
  line-height: 1;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Bottom corner (rotated) */
.card-corner-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
  transform: rotate(180deg);
  align-self: flex-end;
}

/* Suit color variants */
.card.hearts .card-rank,
.card.hearts .card-suit-small,
.card.hearts .card-suit-large,
.card.diamonds .card-rank,
.card.diamonds .card-suit-small,
.card.diamonds .card-suit-large {
  color: var(--color-hearts);
}

.card.spades .card-rank,
.card.spades .card-suit-small,
.card.spades .card-suit-large,
.card.clubs .card-rank,
.card.clubs .card-suit-small,
.card.clubs .card-suit-large {
  color: #1a1a1a;
}

/* Card back (for hidden/folded cards) */
.card.card-back {
  background: #B22222;
  border: 2px solid #fff;
  overflow: hidden;
}

/* Inner border frame */
.card.card-back::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 3px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255,255,255,0.07) 0px,
      rgba(255,255,255,0.07) 1px,
      transparent 1px,
      transparent 6px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255,255,255,0.07) 0px,
      rgba(255,255,255,0.07) 1px,
      transparent 1px,
      transparent 6px
    );
}

.card.card-back::after {
  content: '♦';
  font-size: 28px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.18);
}

/* Small board cards (community cards) */
.card.card-sm {
  width: 48px;
  height: 68px;
  padding: 4px;
}

.card.card-sm .card-rank      { font-size: 14px; }
.card.card-sm .card-suit-small { font-size: 10px; }
.card.card-sm .card-suit-large { font-size: 24px; }

/* Board — 5 community cards in a row */
.board-cards {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
}

/* Card placeholder (unrevealed street card) */
.card-placeholder {
  width: 48px;
  height: 68px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--color-felt-border);
  background: rgba(28, 61, 34, 0.3);
}

/* ============================================================
   SCENARIO CARD (main quiz unit)
   ============================================================ */
.scenario-card {
  background: var(--color-felt-mid);
  border: 1px solid var(--color-felt-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-deep);
  position: relative;
  overflow: hidden;
}

/* Subtle top accent line */
.scenario-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
}

.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.scenario-street {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--color-gold);
  text-transform: uppercase;
}

.scenario-number {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-cream-muted);
}

/* Situation text */
.situation-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-cream-dim);
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--color-gold-dim);
}

/* Pot / players info row */
.scenario-meta {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin: var(--space-md) 0;
}

.meta-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-cream-dim);
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--color-felt-border);
  border-radius: 100px;
  padding: 4px 12px;
  white-space: nowrap;
}

.meta-pill.highlight {
  color: var(--color-gold);
  border-color: var(--color-gold-dim);
}

/* ============================================================
   ACTION BUTTONS (Fold / Call / Bet / Raise / Shove)
   ============================================================ */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.action-grid.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

.btn-action {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--color-cream);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--color-felt-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(200,168,75,0.08) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-action:hover {
  border-color: var(--color-gold-dim);
  color: var(--color-gold-bright);
  transform: translateY(-1px);
}

.btn-action:hover::before {
  opacity: 1;
}

.btn-action:active {
  transform: translateY(0);
}

/* Fold button — distinct red tint */
.btn-action.fold {
  border-color: rgba(192,57,43,0.3);
}

.btn-action.fold:hover {
  border-color: var(--color-danger);
  color: #E8796F;
}

/* Selected state */
.btn-action.selected {
  border-color: var(--color-gold);
  background: rgba(200,168,75,0.12);
  color: var(--color-gold-bright);
}

/* ============================================================
   EQUITY BAR
   ============================================================ */
.equity-reveal {
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-felt-border);
}

.equity-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-sm);
}

.equity-label-text {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--color-cream-dim);
  text-transform: uppercase;
}

.equity-percentage {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
}

.equity-percentage.strong { color: var(--color-equity-strong); }
.equity-percentage.medium { color: var(--color-equity-medium); }
.equity-percentage.weak   { color: var(--color-equity-weak); }

.equity-bar-track {
  height: 10px;
  background: rgba(0,0,0,0.4);
  border-radius: 100px;
  overflow: hidden;
}

.equity-bar-fill {
  height: 100%;
  border-radius: 100px;
  width: 0%;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.equity-bar-fill.strong { background: linear-gradient(90deg, #2E8B4A, var(--color-equity-strong)); }
.equity-bar-fill.medium { background: linear-gradient(90deg, var(--color-gold-dim), var(--color-gold-bright)); }
.equity-bar-fill.weak   { background: linear-gradient(90deg, #8B2020, var(--color-equity-weak)); }

/* Equity explanation text */
.equity-explanation {
  margin-top: var(--space-md);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-cream-dim);
}

.equity-best-move {
  margin-top: var(--space-sm);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-cream);
}

.equity-best-move span {
  color: var(--color-gold);
  font-weight: 600;
}

/* ============================================================
   BUTTONS — General
   ============================================================ */

/* Primary CTA */
.btn-primary {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--color-felt);
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-bright) 100%);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-xl);
  width: 100%;
  text-align: center;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px rgba(200,168,75,0.25);
  display: block;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200,168,75,0.35);
  color: var(--color-felt);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Ghost button */
.btn-ghost {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--color-gold);
  background: transparent;
  border: 1px solid var(--color-gold-dim);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  background: rgba(200,168,75,0.08);
  border-color: var(--color-gold);
}

/* Icon button */
.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-cream-dim);
  transition: all var(--transition-fast);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--color-felt-border);
}

.btn-icon:hover {
  color: var(--color-gold);
  border-color: var(--color-gold-dim);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--color-cream-dim);
  text-transform: uppercase;
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--color-felt-border);
  border-radius: var(--radius-sm);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-size: 16px;
  padding: var(--space-sm) var(--space-md);
  transition: border-color var(--transition-fast);
  width: 100%;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-gold-dim);
  background: rgba(0,0,0,0.4);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-cream-muted);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23C8A84B' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--color-felt);
  color: var(--color-cream);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

/* ============================================================
   PROGRESS / ROUND INDICATOR
   ============================================================ */
.progress-bar-track {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold-dim), var(--color-gold));
  border-radius: 100px;
  transition: width var(--transition-slow);
}

.round-indicators {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.round-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-felt-border);
  transition: background var(--transition-fast);
}

.round-dot.active  { background: var(--color-gold); }
.round-dot.complete { background: var(--color-success); }

/* ============================================================
   P-IQ SCORE DISPLAY
   ============================================================ */
.piq-display {
  text-align: center;
  padding: var(--space-lg);
}

.piq-label {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--color-gold-dim);
  text-transform: uppercase;
  margin-bottom: var(--space-xs);
}

.piq-value {
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 0.9;
  color: var(--color-gold);
  text-shadow: 0 0 40px rgba(200,168,75,0.3);
}

.piq-unit {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--color-cream-muted);
  margin-top: var(--space-xs);
}

/* ============================================================
   MEDAL BADGES
   ============================================================ */
.medal-row {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}

.medal {
  font-size: 20px;
  line-height: 1;
}

.medal-placeholder {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-cream-muted);
}

/* ============================================================
   LEADERBOARD TABLE
   ============================================================ */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--color-gold-dim);
  text-transform: uppercase;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-felt-border);
}

.leaderboard-table td {
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  border-bottom: 1px solid rgba(28,61,34,0.5);
  vertical-align: middle;
}

.leaderboard-table tr:hover td {
  background: rgba(200,168,75,0.04);
}

.leaderboard-rank {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-cream-muted);
  width: 32px;
}

.leaderboard-rank.top-3 {
  color: var(--color-gold);
  font-weight: 500;
}

.leaderboard-name {
  font-weight: 500;
  color: var(--color-cream);
}

.leaderboard-score {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--color-gold);
  font-weight: 500;
  text-align: right;
}

/* ============================================================
   DR. P CHAT INTERFACE
   ============================================================ */
.drp-message {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.drp-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold-dim), var(--color-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--color-felt);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(200,168,75,0.3);
}

.drp-bubble {
  background: var(--color-felt-mid);
  border: 1px solid var(--color-felt-border);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  padding: var(--space-md);
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-cream-dim);
  flex: 1;
}

.drp-bubble strong {
  color: var(--color-gold);
}

.user-message {
  flex-direction: row-reverse;
}

.user-bubble {
  background: rgba(200,168,75,0.08);
  border: 1px solid var(--color-gold-dim);
  border-radius: var(--radius-md) 0 var(--radius-md) var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 15px;
  color: var(--color-cream);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-gold-dim);
  animation: typing-pulse 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.9); }
  40%            { opacity: 1;   transform: scale(1.1); }
}

/* ============================================================
   SECTION / PANEL COMPONENTS
   ============================================================ */
.panel {
  background: var(--color-felt-mid);
  border: 1px solid var(--color-felt-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--color-gold);
  margin-bottom: var(--space-md);
}

.divider {
  height: 1px;
  background: var(--color-felt-border);
  margin: var(--space-lg) 0;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid;
}

.badge-gold    { color: var(--color-gold);    border-color: var(--color-gold-dim);    background: rgba(200,168,75,0.1); }
.badge-success { color: var(--color-success); border-color: rgba(61,170,92,0.4);      background: rgba(61,170,92,0.1); }
.badge-danger  { color: var(--color-danger);  border-color: rgba(192,57,43,0.4);      background: rgba(192,57,43,0.1); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  width: calc(100% - var(--space-xl));
  max-width: var(--max-width);
}

.toast {
  background: var(--color-felt-mid);
  border: 1px solid var(--color-felt-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  font-size: 14px;
  color: var(--color-cream);
  box-shadow: var(--shadow-deep);
  animation: toast-in 0.3s ease;
  text-align: center;
}

.toast.toast-success { border-color: rgba(61,170,92,0.5); }
.toast.toast-error   { border-color: rgba(192,57,43,0.5); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   LOADING STATES
   ============================================================ */
.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-felt-border);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg,
    var(--color-felt-mid) 25%,
    rgba(28,61,34,0.8) 50%,
    var(--color-felt-mid) 75%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ============================================================
   GHOST RUNOUT (folded hand continuation)
   ============================================================ */
.ghost-runout {
  opacity: 0.5;
  position: relative;
}

.ghost-runout::after {
  content: 'GHOST RUNOUT';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--color-cream-muted);
  border: 1px solid var(--color-cream-muted);
  padding: 2px 8px;
  border-radius: 2px;
  white-space: nowrap;
}

/* ============================================================
   ANIMATIONS — Utility
   ============================================================ */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fade-in     { animation: fade-in 0.3s ease both; }
.animate-fade-in-up  { animation: fade-in-up 0.4s ease both; }
.animate-scale-in    { animation: scale-in 0.3s ease both; }

/* Staggered children */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.10s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.20s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.30s; }

/* ============================================================
   RESPONSIVE — Larger screens
   ============================================================ */
@media (min-width: 600px) {
  :root {
    --max-width: 520px;
  }

  .display-xl { font-size: 88px; }
  .display-lg { font-size: 64px; }

  .card {
    width: 80px;
    height: 112px;
  }

  .card-rank { font-size: 22px; }
}

/* ============================================================
   UTILITY — Hide / Show
   ============================================================ */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
