/*
 * styles-base.css — shared tokens, reset, interaction contract, nav, buttons.
 * Extracted from styles.css so lightweight pages (play.html) skip the
 * analytics-shell CSS (~60 KB).  The full styles.css loads this via the
 * browser's normal cascade (index.html still loads styles.css which
 * contains everything).
 */

:root {
  /* Surfaces */
  --bg: #0b0d10;
  --panel: #11141a;
  --panel-strong: #161a21;
  --panel-soft: rgba(255,255,255,0.03);

  /* Glass (frosted chrome surfaces) */
  --glass-bg: rgba(15, 18, 23, 0.65);
  --glass-bg-strong: rgba(11, 13, 16, 0.8);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: 16px;

  /* Borders (hairline) */
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(226, 180, 91, 0.32);

  /* Text */
  --text: #f5f1e8;
  --text-soft: #cdd3dd;
  --muted: #8a92a0;
  --muted-strong: #a9b0bd;

  /* Accents (flat, no gradients) */
  --gold: #e2b45b;
  --gold-soft: rgba(226, 180, 91, 0.12);
  --gold-press: #c89a44;
  --rose: #f06d79;
  --rose-soft: rgba(240, 109, 121, 0.12);
  --blue: #87b7ff;

  /* Elevation — overlays only */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-overlay: 0 8px 24px rgba(0,0,0,0.4);

  /* Radius — sharp, no pills */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* ── Z-index stacking order ───────────────────────────────────────────────
   * 0–10   : base / static
   * 10–30  : seat-internal layering (avatar, badges, bets, hole cards)
   * 50     : table-level overlays (paused overlay, host controls, timer)
   * 100    : fixed page chrome (toast container, sticky bars)
   * 1000   : modal backdrop
   * 1010   : modal dialog
   * 1100   : nested / topmost modal (room controls when stacked over ledger)
   * --------------------------------------------------------------------- */
  --z-seat-base:        10;
  --z-seat-elevated:    20;
  --z-seat-overlay:     30;
  --z-table-overlay:    50;
  --z-fixed:            100;
  --z-drawer-panel:     85;   /* slide-in drawer panel, below its backdrop */
  --z-drawer-backdrop:  90;   /* drawer scrim, below --z-fixed FAB */
  --z-modal-backdrop:   1000;
  --z-modal:            1010;
  --z-modal-stacked:    1100;

  /* Nav height — grows to cover the iOS status bar on notched devices.
     env(safe-area-inset-top) resolves to 0 on non-notched browsers.
     Requires viewport-fit=cover in the <meta name="viewport"> tag. */
  --nav-height: calc(56px + env(safe-area-inset-top));

  /* Motion */
  --dur-fast: 80ms;
  --dur-mid: 140ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Motion scale: 1.0 = normal, 0.5 = fast, 0 = instant.
     User-pref-driven; OS prefers-reduced-motion forces 0 below. */
  --motion-scale: 1;
  --dur-fast-scaled: calc(var(--dur-fast) * var(--motion-scale));
  --dur-mid-scaled:  calc(var(--dur-mid)  * var(--motion-scale));

  /* Surfaces (extended) */
  --surface2: #1e2130;

  /* Text on gold */
  --text-on-gold: #17120b;

  /* Suit colors (4-color deck) */
  --suit-spades: #111;
  --suit-hearts: #cc2222;
  --suit-diamonds: #1d6fc0;
  --suit-clubs: #1f8a4a;

  /* Position badge colors */
  --sb-color: #4a90d9;
  --bb-color: #c0392b;

  /* Typography */
  --font-sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-display: "Avenir Next Condensed", "Avenir Next", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-sans);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; }

/* ──────────────────────────────────────────────────────────────────
   GLOBAL MOTION + INTERACTION CONTRACT
   All interactive elements inherit these defaults.
   - Hover: color/border shift only — never translateY.
   - Press: scale(0.97) on :active only — feels like a real button.
   - Focus: sharp 2px gold outline with offset — no fuzzy glow.
   - Timing: --dur-fast (80ms) for hover/press, --dur-mid (140ms) for panels.
   ────────────────────────────────────────────────────────────────── */

button, a, input, select, textarea, [role="button"], [tabindex] {
  transition:
    color var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease),
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

button:active, a:active, [role="button"]:active {
  transform: scale(0.97);
}

button:focus, a:focus, input:focus, select:focus, textarea:focus, [role="button"]:focus {
  outline: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button:disabled, [aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Tabular monospace numerics — apply to any stat/number value */
.num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0;
}

/* Skeleton loader — matches the shape of what's coming.
   Apply to a placeholder block; it inherits the panel color and shimmers. */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--panel) 0%,
    var(--panel-strong) 50%,
    var(--panel) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: transparent;
  user-select: none;
  pointer-events: none;
}

/* Editorial rule divider — use between content blocks when a card border isn't needed */
.section-rule {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 24px 0;
}

/* --- Top Navigation (always visible) --- */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-modal);
  display: flex; align-items: flex-end;
  height: var(--nav-height);
  padding: env(safe-area-inset-top) 24px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: "Avenir Next Condensed", "Avenir Next", sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}
.nav-logo span { color: var(--gold); font-weight: 600; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 14px;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.nav-link:hover { color: var(--text); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background var(--dur-fast) var(--ease);
}
.nav-link.active { color: var(--text); }
.nav-link.active::after { background: var(--gold); }

/* --- Page containers --- */
.page { margin-top: var(--nav-height); min-height: calc(100vh - var(--nav-height)); }
.page-content { max-width: 1220px; margin: 0 auto; padding: 36px 32px 96px; }
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px;
}
.page-heading { max-width: 760px; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 36px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--gold);
  color: #17120b;
  border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: none;
  text-decoration: none;
}
.btn-primary:hover { background: var(--gold-press); border-color: var(--gold-press); filter: none; transform: none; box-shadow: none; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: none;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--panel-soft); color: var(--text); border-color: var(--border-strong); transform: none; }

/* --- Empty state --- */
.empty-msg { color: var(--muted); font-size: 14px; text-align: center; line-height: 1.65; }
.link-btn { color: #f1cf87; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-scale: 0 !important;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
