/* Holler Arcade design tokens (docs/brand/BRAND.md). One file, every page.
   Night is the default theme. Add data-theme="cream" on <html> for the light theme.
   The bottom block maps the site's older variable names onto the brand, so loading this
   file after public/shared/style.css re-skins every page at once (docs/brand/IMPLEMENTATION.md, step 2). */

/* One emoji font for every page (B-64): the --ha-font-* lists below start with 'GN Emoji', and pages that load this
   file without public/shared/style.css (the score pages, the front pages) had no picture for newer emoji on old TV
   browsers (Joel's LG, Nov 21: Poppy's avatar was a box on /scores). The same face as style.css: only emoji use it. */
@font-face {
  font-family: 'GN Emoji';
  src: url('/vendor/twemoji.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+200D, U+20E3, U+2300-23FF, U+2600-27BF, U+2934-2935, U+2B05-2B55, U+3030, U+303D, U+3297, U+3299, U+FE0F, U+1F000-1FAFF;
}

@font-face {
  font-family: 'Lilita One';
  src: url('/brand/next/fonts/lilita-one-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root, [data-theme="night"] {
  /* brand colors: the same in every theme */
  --ha-yellow: #FFC629;      /* Holler Yellow: bubble, primary action, room codes */
  --ha-yellow-hi: #FFE07A;
  --ha-yellow-lo: #F59E0B;
  --ha-red: #EE2D3F;         /* Joystick Red: hot moments, leave and danger */
  --ha-red-lo: #A3122A;
  --ha-purple: #6B2FD6;      /* Arcade Purple: second action, ARCADE on light */
  --ha-purple-hi: #8A55F0;
  --ha-purple-lo: #4A1E9E;
  --ha-cyan: #2CD4F0;        /* Signal Cyan: focus rings, links, "you" markers only */
  --ha-ink: #1B0F38;         /* Night Ink: every outline, text on yellow */
  --ha-white: #FFFFFF;
  --ha-cream: #FFF6E5;

  /* surfaces and text: change with the theme */
  --ha-bg: #24124A;          /* Night Purple */
  --ha-bg-deep: #160A33;     /* Deep Night */
  --ha-panel: #2E1A5E;
  --ha-panel-2: #3A2373;
  --ha-line: #4A3486;
  --ha-text: #FFFFFF;
  --ha-text-dim: #B9A8E6;    /* 7.8:1 on --ha-bg */
  --ha-good: #3DDC84;
  --ha-bad: #FF5468;
  --ha-on-yellow: #1B0F38;
  --ha-on-purple: #FFFFFF;
  --ha-on-red: #FFFFFF;      /* bold 18px and up only (4.1:1) */

  /* type */
  --ha-font-display: 'GN Emoji', 'Lilita One', 'Arial Black', system-ui, sans-serif;
  --ha-font-body: 'GN Emoji', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ha-font-retro: 'Press Start 2P', ui-monospace, monospace; /* old-school game modes only */
  --ha-lean: skewX(-9deg);   /* big titles and splash moments only */

  /* spacing, radius, borders */
  --ha-space-1: 4px; --ha-space-2: 8px; --ha-space-3: 12px; --ha-space-4: 16px;
  --ha-space-5: 24px; --ha-space-6: 32px; --ha-space-7: 48px; --ha-space-8: 64px;
  --ha-radius-sm: 8px; --ha-radius-md: 16px; --ha-radius-lg: 20px; --ha-radius-xl: 28px; --ha-radius-pill: 999px;
  --ha-border: 3px solid var(--ha-ink);

  /* shadows */
  --ha-shadow-pop: 0 4px 0 #1B0F38;            /* arcade buttons, tiles */
  --ha-shadow-pop-lg: 0 8px 0 #1B0F38;         /* TV-size buttons and tiles */
  --ha-shadow-lift: 0 10px 30px rgba(10, 4, 30, 0.45);
  --ha-focus: 0 0 0 3px var(--ha-bg), 0 0 0 7px var(--ha-cyan);

  /* the stage background */
  --ha-stage: radial-gradient(ellipse at 50% 42%, #3D1D80 0%, #24124A 55%, #160A33 100%);
  --ha-dots: radial-gradient(rgba(255, 255, 255, 0.06) 1.5px, transparent 1.6px) 0 0 / 48px 48px;
}

[data-theme="cream"] {
  --ha-bg: #FFF6E5;
  --ha-bg-deep: #F3E8D2;
  --ha-panel: #FFFFFF;
  --ha-panel-2: #FBEFD9;
  --ha-line: #E2D3B6;
  --ha-text: #1B0F38;
  --ha-text-dim: #5B4A7A;
  --ha-good: #13834A;
  --ha-bad: #C21A2B;
  --ha-stage: #FFF6E5;
  --ha-dots: none;
  --ha-focus: 0 0 0 3px var(--ha-bg), 0 0 0 7px var(--ha-purple);
}

/* ---- the pieces every page shares ---- */
.ha-btn {
  font: 400 20px/1 var(--ha-font-display); letter-spacing: 0.02em; text-transform: uppercase;
  min-height: 48px; padding: 0 var(--ha-space-5);
  color: var(--ha-on-yellow); background: var(--ha-yellow);
  border: var(--ha-border); border-radius: var(--ha-radius-md); box-shadow: var(--ha-shadow-pop);
  cursor: pointer; transition: transform .06s, box-shadow .06s;
}
.ha-btn:active { transform: translateY(4px); box-shadow: none; }
.ha-btn:focus-visible { outline: none; box-shadow: var(--ha-shadow-pop), var(--ha-focus); }
.ha-btn--second { background: var(--ha-purple); color: var(--ha-on-purple); }
.ha-btn--danger { background: var(--ha-red); color: var(--ha-on-red); }
.ha-panel { background: var(--ha-panel); border: 2px solid var(--ha-line); border-radius: var(--ha-radius-lg); }
.ha-code { display: inline-flex; gap: 0.12em; font: 400 1em/1 var(--ha-font-display); }
/* Each letter is drawn a little smaller than the code's size (0.86) so the widest code letters, M and W, fit
   inside their tile with room to spare at every size (they ran over the edge on the TV corner, Nov 20).
   The tile is 1.15 x 1.2 of the code's size: the sizes below are those divided by 0.86. */
.ha-code > span {
  display: grid; place-items: center; font-size: 0.86em; width: 1.337em; height: 1.395em;
  color: var(--ha-ink); background: var(--ha-yellow);
  border: var(--ha-border); border-radius: 0.163em; box-shadow: var(--ha-shadow-pop);
}
.ha-title { font-family: var(--ha-font-display); text-transform: uppercase; letter-spacing: 0.01em; }
/* on cream, yellow is a fill only, never text: use purple for the current or highlighted text */
[data-theme="cream"] .ha-current { color: var(--ha-purple); }
.ha-current { color: var(--ha-yellow); }
.ha-stage { background: var(--ha-dots), var(--ha-stage); color: var(--ha-text); }
@media (prefers-reduced-motion: reduce) { .ha-btn { transition: none; } }

/* ---- bridge: the site's current variable names (public/shared/style.css) mapped onto the brand ---- */
.ha-theme {
  --bg: var(--ha-bg-deep);
  --panel: var(--ha-panel);
  --line: var(--ha-line);
  --txt: var(--ha-text);
  --dim: var(--ha-text-dim);
  --accent: var(--ha-yellow);
  --hot: var(--ha-red);
  --gold: var(--ha-yellow);
  --good: var(--ha-good);
  --bad: var(--ha-bad);
}
