/* ═══════════════════════════════════════════════════════════════════════════
   Arcade — the app's design system.

   A dark ink ground, flat raised surfaces, brass as the reward colour and
   violet as the second side. Rounded, chunky and touch-first: the game feel
   comes from progress, stakes and feedback rather than from ornament.

   Same token names as the earlier Studio and Classical themes, so every screen
   follows this file. Never hard-code a value a token below already carries.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500;12..96,700;12..96,800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;

  /* The ground and the surfaces raised off it. */
  --color-bg: #0E1016;
  --color-surface: #1A1D27;
  --color-surface-2: #242836;
  --color-line: #2C3040;
  --color-text: #F2F0EA;
  --color-muted: #A3A7B5;
  --color-faint: #6E7386;

  /* Brass is the reward colour; violet is the second side and the ladder. */
  --color-accent: #F2B544;
  --color-accent-ink: #1A1306;
  --color-accent-2: #8B7CF6;
  --color-accent-2-ink: #120F2A;
  --color-accent-2-text: #B1A6FF;
  --color-divider: #2C3040;

  /* Heat (streaks, blitz) and the mystery colour. */
  --color-heat: #FF9F5A;
  --color-mystery: #FF7AB6;

  /* Ramps run light→dark: "100" is the palest step, "900" the deepest. */
  --color-neutral-100: #F2F0EA;
  --color-neutral-200: #D3D5DD;
  --color-neutral-300: #A3A7B5;
  --color-neutral-400: #868A99;
  --color-neutral-500: #6E7386;
  --color-neutral-600: #4A4F63;
  --color-neutral-700: #2C3040;
  --color-neutral-800: #1A1D27;
  --color-neutral-900: #13151C;

  --color-accent-100: #FFF4DC;
  --color-accent-200: #FFE2A3;
  --color-accent-300: #FFD27A;
  --color-accent-400: #F7C35E;
  --color-accent-500: #F2B544;
  --color-accent-600: #D99B2B;
  --color-accent-700: #A87A22;
  --color-accent-800: #5A4A1E;
  --color-accent-900: #2A2414;

  --color-accent-2-100: #EDEAFF;
  --color-accent-2-200: #D4CDFF;
  --color-accent-2-300: #B1A6FF;
  --color-accent-2-400: #9D90FA;
  --color-accent-2-500: #8B7CF6;
  --color-accent-2-600: #6F5FE0;
  --color-accent-2-700: #4F43A8;
  --color-accent-2-800: #3A3370;
  --color-accent-2-900: #1E1B33;

  /* Verdicts. Right and wrong also differ in lightness and carry an icon or
     word, so they never rely on hue alone. */
  --color-correct: #4FD1A5;
  --color-correct-ink: #06231A;
  --color-correct-soft: #123227;
  --color-chosen: #8B7CF6;
  --color-wrong: #FF6B5A;
  --color-wrong-ink: #2A0A06;
  --color-wrong-soft: #3A1512;
  --color-wrong-text: #FF8A7C;

  --font-heading: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-heading-weight: 800;
  --font-body: "Inter", system-ui, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --glow: 0 0 0 0 transparent;

  /* Flat surfaces — the old gradient panels collapse to these. */
  --panel: var(--color-surface-2);
  --panel-quiet: var(--color-surface);

  --color-colophon: #0E1016;
  --color-plate-ink: #F2F0EA;
}

/* ── base ────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 var(--space-2);
}
h1 { font-size: 34px; letter-spacing: -0.03em; }
h2 { font-size: 26px; letter-spacing: -0.02em; }
h3 { font-size: 19px; font-weight: 700; }
h4 { font-size: 16px; font-weight: 700; }
h5 { font-size: 15px; font-weight: 700; }
h6 { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }

.text-muted { color: var(--color-muted); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 40%, transparent); }

.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }

/* ── rules ───────────────────────────────────────────────────────────────── */

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

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-body); font-weight: 700;
  font-size: 14px; line-height: 1.2;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease,
              transform 0.08s ease;
}
.btn:hover:not(:disabled) { background: var(--color-surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  border-color: transparent;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 800;
}
.btn-primary:hover:not(:disabled) { background: var(--color-accent-400); }
.btn-secondary:hover:not(:disabled) { border-color: var(--color-neutral-600); }
.btn-ghost {
  background: transparent; border-color: transparent;
  color: var(--color-muted);
  padding-inline: var(--space-3);
  min-height: 40px;
}
.btn-ghost:hover:not(:disabled) { color: var(--color-text); background: var(--color-surface); }
.btn-small { min-height: 36px; padding: var(--space-1) var(--space-3); font-size: 13px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* ── forms ───────────────────────────────────────────────────────────────── */

.field > label {
  display: block;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-muted);
}
.input {
  width: 100%; min-height: 40px; padding: 8px 12px; font: inherit;
  font-size: 15px; font-weight: 500; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-bg);
  border: 1px solid var(--color-line); border-radius: var(--radius-sm);
}
.input::placeholder { color: var(--color-faint); }
.input:hover { border-color: var(--color-neutral-600); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; outline: 2px solid color-mix(in srgb, var(--color-accent) 35%, transparent); }
select.input {
  appearance: none; 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 d='M1 1l5 5 5-5' fill='none' stroke='%23A3A7B5' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
select.input option { background: #1A1D27; color: #F2F0EA; }

/* ── cards ───────────────────────────────────────────────────────────────── */

.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.card-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-accent); }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* ── tags ────────────────────────────────────────────────────────────────── */

.tag {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.tag-accent { background: var(--color-accent-900); color: var(--color-accent); }
.tag-neutral { background: var(--color-surface-2); color: var(--color-muted); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
