/* ===================================================================
   base.css, design tokens, reset, boot screen, a11y helpers
   Palettes from BOTH original projects are preserved verbatim so no
   existing component changes color.
   =================================================================== */
:root {
  /* Lore site identity */
  --ink: #3a3226;
  --gold: #B8860B;
  --moss: #5b7a45;
  --parchment: #fbf8f1;

  /* Game identity */
  --pickle-green: #22c55e;
  --pickle-dark: #166534;
  --brine-gold: #fbbf24;
  --brine-gold-dark: #b45309;
  --bg-light: #f8fafc;
  --panel-bg: rgba(255, 255, 255, 0.85);
  --panel-border: rgba(251, 191, 36, 0.4);
  --text-main: #0f172a;
  --text-sub: #64748b;

  /* Unified app tokens (derived, non-destructive) */
  --app-bg: radial-gradient(circle at 50% 0%, #ffffff 0%, var(--parchment) 60%, #f3ede0 100%);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --hairline: rgba(184, 134, 11, 0.22);
  --shadow-sm: 0 6px 18px -8px rgba(58, 50, 38, 0.25);
  --shadow-md: 0 20px 40px -18px rgba(58, 50, 38, 0.35);
  --radius: 20px;
  --radius-sm: 12px;
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 68px;
  --font-display: 'Cinzel Decorative', serif;
  --font-head: 'Cinzel', serif;
  --font-body: 'EB Garamond', serif;
  --font-ui: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; min-height: 100%;
  background: var(--app-bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow-x: hidden; }
img { -webkit-user-drag: none; user-select: none; }
button { font-family: inherit; }
a { color: inherit; }

/* Respect reduced-motion + a manual toggle (body.reduced-motion) */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body.reduced-motion * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }

/* ============ BOOT SCREEN ============ */
.boot {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--app-bg);
  transition: opacity 0.6s var(--ease-out);
}
.boot.hidden { opacity: 0; pointer-events: none; }
.boot-crest { position: relative; width: 130px; height: 130px; display: grid; place-items: center; }
.boot-king { width: 92px; height: auto; filter: drop-shadow(0 16px 20px rgba(58,50,38,.25)); animation: bootBob 1.8s ease-in-out infinite; }
.boot-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(184,134,11,.18); border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}
.boot-title { font-family: var(--font-display); font-size: 2rem; letter-spacing: 2px; color: var(--gold); }
.boot-sub { font-family: var(--font-head); color: var(--moss); letter-spacing: .18em; text-transform: uppercase; font-size: .75rem; }
.boot-bar { width: 200px; height: 5px; border-radius: 999px; background: rgba(184,134,11,.15); overflow: hidden; }
.boot-bar span { display: block; height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brine-gold), var(--gold)); animation: bootLoad 1.1s var(--ease-out) infinite; }

@keyframes bootBob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-10px)} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bootLoad { 0%{transform:translateX(-120%)} 100%{transform:translateX(320%)} }

/* ============ A11Y ============ */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sr-skip {
  position: fixed; top: -60px; left: 12px; z-index: 10000; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-family: var(--font-ui); text-decoration: none;
  transition: top .2s var(--ease-out);
}
.sr-skip:focus { top: 12px; }

:focus-visible { outline: 3px solid rgba(91,122,69,.55); outline-offset: 2px; border-radius: 6px; }
