/* Monopoly Rush design system (1.28.0). One stylesheet for the whole site: the game hub, account and admin
 * screens and every static page. The Go Board (src/go/go.css) uses the same tokens, type and colours.
 * Original artwork and styling only.
 *
 * Contents: 1 fonts and tokens  2 base  3 focus and motion  4 buttons  5 forms  6 surfaces
 *           7 toasts and bars  8 lists, tables, tabs  9 skeleton, empty, spinner  10 bottom nav and sheet
 *           11 hub shell  12 comfort settings */

/* ============ 1. fonts and tokens ============ */
@font-face { font-family: "Fredoka"; src: url("/fonts/fredoka-wght.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  /* colour: night base, game indigo, gold trim, candy accents */
  --ds-night: #0f1726;
  --ds-night-2: #151d38;
  --ds-indigo-900: #1b1650;
  --ds-indigo-800: #231a66;
  --ds-indigo-700: #2b1f74;
  --ds-indigo-600: #3a2c96;
  --ds-indigo-500: #4b3aa8;
  --ds-indigo-300: #a99dff;
  --ds-gold-100: #fff3b0;
  --ds-gold-300: #ffe27a;
  --ds-gold-400: #ffd23f;
  --ds-gold-500: #ffb800;
  --ds-gold-700: #a86400;
  --ds-gold-800: #8a5300;
  --ds-cream: #fff8e8;
  --ds-cream-2: #fdeecb;
  --ds-ink: #2a1a05;
  --ds-ink-2: #5a4529;
  --ds-green-300: #6ee79a;
  --ds-green-500: #22c55e;
  --ds-green-700: #15803d;
  --ds-green-900: #0b4a22;
  --ds-green-ink: #052e12;
  --ds-blue-400: #5a9bff;
  --ds-blue-600: #2563eb;
  --ds-sky: #3fa9ff;
  --ds-berry-400: #ff6b73;
  --ds-berry-600: #d92d3a;
  --ds-berry-800: #7d111a;
  --ds-pop: #ff4f81;
  --ds-orange: #ff8a3d;
  --ds-text: #f6f8ff;
  --ds-muted: #bcc6e2;
  --ds-line: rgba(255, 255, 255, 0.14);
  --ds-line-gold: rgba(255, 210, 63, 0.45);
  /* spacing (4px grid) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  /* radius */
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --r-pill: 999px;
  /* type scale */
  --fs-xs: 0.75rem; --fs-sm: 0.875rem; --fs-md: 1rem; --fs-lg: 1.125rem; --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.5rem, 4.2vw, 1.875rem); --fs-3xl: clamp(1.875rem, 6vw, 2.75rem); --fs-hero: clamp(2.25rem, 9vw, 3.75rem);
  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* elevation */
  --sh-1: 0 2px 6px rgba(0, 0, 0, 0.25);
  --sh-2: 0 8px 20px rgba(0, 0, 0, 0.32);
  --sh-3: 0 18px 44px rgba(0, 0, 0, 0.45);
  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-pop: cubic-bezier(0.3, 1.5, 0.5, 1);
  --t-fast: 0.12s; --t-med: 0.24s; --t-slow: 0.4s;
  /* layers */
  --z-bnav: 60; --z-sheet: 80; --z-toast: 120; --z-bar: 130;
  /* safe areas */
  --sa-t: env(safe-area-inset-top, 0px); --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px); --sa-r: env(safe-area-inset-right, 0px);
  --bnav-h: 0px;
  /* aliases the older markup still reads */
  --bg: var(--ds-night); --text: var(--ds-text); --muted: var(--ds-muted); --line: var(--ds-line);
  --gold: var(--ds-gold-400); --primary: var(--ds-gold-400); --primary-ink: var(--ds-ink); --danger: var(--ds-berry-600);
  --blue: var(--ds-blue-400); --glass: rgba(27, 22, 80, 0.94); --glass2: rgba(36, 28, 104, 0.97); --shadow: var(--sh-3);
  --link: var(--ds-gold-400); --link-hover: var(--ds-gold-100);
  font-family: var(--font-body);
  color-scheme: dark;
}
@media (max-width: 720px) and (pointer: coarse) and (min-height: 521px) { html:not(.go-on):not(.no-bnav) { --bnav-h: calc(66px + var(--sa-b)); } }

/* ============ 2. base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ds-night); }
body {
  margin: 0; color: var(--ds-text); font-family: var(--font-body); font-size: var(--fs-md); line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: var(--fs-3xl); } h2 { font-size: var(--fs-2xl); } h3 { font-size: var(--fs-xl); } h4 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--sp-3); text-wrap: pretty; }
a { color: var(--ds-gold-400); text-underline-offset: 3px; }
a:hover { color: var(--ds-gold-100); }
img { max-width: 100%; }
::selection { background: var(--ds-gold-400); color: var(--ds-ink); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--sp-3); top: 0; z-index: 300; transform: translateY(-120%); padding: 10px 16px; border-radius: 0 0 var(--r-sm) var(--r-sm);
  background: var(--ds-gold-400); color: var(--ds-ink); font: 700 var(--fs-sm) var(--font-display); text-decoration: none; transition: transform var(--t-med) var(--ease-out); }
.skip:focus { transform: none; }
/* the page backdrop shared by the hub and the static pages */
.ds-bg, body.site {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(75, 58, 168, 0.55), transparent 62%),
    radial-gradient(800px 480px at 105% 4%, rgba(63, 169, 255, 0.2), transparent 60%),
    radial-gradient(900px 600px at 50% 112%, rgba(255, 138, 61, 0.16), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1.2px, transparent 1.6px) 0 0 / 26px 26px,
    var(--ds-night);
}

/* ============ 3. focus and motion ============ */
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(75, 58, 168, 0.95); border-radius: var(--r-sm); }
:focus:not(:focus-visible) { outline: none; }
@keyframes ds-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes ds-fade { from { opacity: 0; } }
@keyframes ds-pop { from { opacity: 0; transform: scale(0.82) translateY(16px); } }
@keyframes ds-spin { to { transform: rotate(360deg); } }
@keyframes ds-shimmer { to { background-position: -200% 0; } }
@keyframes ds-shake { 20% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 80% { transform: translateX(-3px); } }
@keyframes ds-bob { 50% { transform: translateY(-6px) rotate(6deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
html[data-calm="1"] *, html[data-calm="1"] *::before, html[data-calm="1"] *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }

/* ============ 4. buttons ============ */
.btn, .btn-reset { font: inherit; color: inherit; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn {
  --b1: #6a58d6; --b2: #3a2c96; --edge: #1b1650; --ink: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 48px; padding: 10px 20px; border-radius: var(--r-md);
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-md); line-height: 1.1; letter-spacing: 0.2px; text-decoration: none; white-space: nowrap;
  color: var(--ink); background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.32), 0 4px 0 var(--edge), 0 10px 18px rgba(0, 0, 0, 0.3);
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-med);
  user-select: none; -webkit-user-select: none;
}
.btn:hover { color: var(--ink); filter: brightness(1.08); }
.btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.28), 0 1px 0 var(--edge), 0 3px 8px rgba(0, 0, 0, 0.3); filter: brightness(0.97); }
.btn:disabled, .btn[aria-disabled="true"] { filter: grayscale(0.7) brightness(0.8); opacity: 0.65; cursor: not-allowed; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.15), 0 2px 0 var(--edge); }
.btn.primary { --b1: var(--ds-gold-300); --b2: var(--ds-gold-500); --edge: var(--ds-gold-700); --ink: var(--ds-ink); }
.btn.play { --b1: var(--ds-green-300); --b2: #17a34a; --edge: var(--ds-green-900); --ink: var(--ds-green-ink); }
.btn.secondary { --b1: #6a58d6; --b2: #3a2c96; --edge: #1b1650; --ink: #fff; }
.btn.danger { --b1: var(--ds-berry-400); --b2: var(--ds-berry-600); --edge: var(--ds-berry-800); --ink: #fff; }
.btn.ghost {
  --ink: var(--ds-text); background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.15); filter: none; }
.btn.ghost:active:not(:disabled) { transform: translateY(1px) scale(0.985); background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3); }
.btn.big { min-height: 56px; padding: 12px 26px; font-size: var(--fs-lg); border-radius: var(--r-lg); }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: var(--fs-sm); border-radius: 14px; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 3px 0 var(--edge), 0 6px 12px rgba(0, 0, 0, 0.25); }
.btn.small.ghost { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2); }
@media (pointer: coarse) { .btn.small { min-height: 44px; } }
.btn.block { display: flex; width: 100%; }
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--ink); border-top-color: transparent; animation: ds-spin 0.7s linear infinite; }
.btn.ghost[aria-busy="true"]::after { border-color: #fff; border-top-color: transparent; }
.link { font: inherit; background: none; border: 0; padding: 4px 2px; color: var(--ds-gold-400); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.link:hover { color: var(--ds-gold-100); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.2); color: #fff; font-size: 20px; cursor: pointer; transition: transform var(--t-fast), background var(--t-med); }
.icon-btn:active { transform: scale(0.92); }

/* ============ 5. forms ============ */
input, select, textarea {
  font: inherit; font-size: 1rem; color: var(--ds-text); width: 100%; min-width: 0; min-height: 48px; padding: 11px 14px;
  border-radius: var(--r-md); border: 2px solid rgba(255, 255, 255, 0.18); background: rgba(8, 10, 32, 0.55);
  transition: border-color var(--t-med), box-shadow var(--t-med), background var(--t-med);
}
input::placeholder { color: #8d97b8; }
input:hover, select:hover { border-color: rgba(255, 255, 255, 0.32); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ds-gold-400); box-shadow: 0 0 0 4px rgba(255, 210, 63, 0.25); background: rgba(8, 10, 32, 0.8); }
input:user-invalid { border-color: var(--ds-berry-400); }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--ds-gold-400); flex: none; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffd23f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--ds-muted); }
.field > span { padding-left: 2px; }
.auth-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.agree { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); color: var(--ds-muted); line-height: 1.45; }
.hint { color: var(--ds-muted); font-size: var(--fs-sm); line-height: 1.5; margin: 0; }
.hint.center { text-align: center; }
.error { color: #ffb3b8; font-weight: 700; font-size: var(--fs-sm); min-height: 1.3em; }
.error:not(:empty)::before { content: "⚠ "; }
.error:not(:empty) { animation: ds-shake 0.4s; }
.auth-switch { margin: 0; font-size: var(--fs-sm); color: var(--ds-muted); text-align: center; }
.row { display: flex; gap: var(--sp-2); align-items: center; }
.row.foot { justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.grid2 > .btn { min-width: 0; white-space: normal; }

/* ============ 6. surfaces ============ */
.panel, .card {
  position: relative; background: linear-gradient(180deg, rgba(58, 44, 150, 0.9), rgba(32, 24, 98, 0.94));
  border: 2px solid var(--ds-line-gold); border-radius: var(--r-xl);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), 0 6px 0 rgba(10, 8, 40, 0.65), var(--sh-3);
}
.panel { width: min(480px, 100%); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); animation: ds-in var(--t-slow) var(--ease-out) both; }
.panel h2 { display: flex; align-items: center; gap: 10px; text-shadow: 0 2px 0 rgba(10, 8, 40, 0.5); }
.panel h3 { font-size: var(--fs-lg); margin-top: var(--sp-2); }
.card { padding: var(--sp-4) var(--sp-5); border-radius: var(--r-lg); transition: transform var(--t-med) var(--ease-out), border-color var(--t-med); }
.card h3 { margin-bottom: 6px; font-size: var(--fs-lg); color: #fff; }
.card p { margin: 0; color: var(--ds-muted); font-size: var(--fs-sm); }
@media (hover: hover) { a.card:hover, .card:hover { transform: translateY(-3px); border-color: var(--ds-gold-400); } }
.badge, .chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: var(--r-pill); font: 700 var(--fs-xs) var(--font-display); letter-spacing: 0.3px; background: rgba(255, 255, 255, 0.14); color: #fff; vertical-align: middle; }
.badge.you { background: var(--ds-blue-600); }
.badge.warn { background: rgba(255, 184, 0, 0.28); color: var(--ds-gold-100); }
.badge.good { background: rgba(34, 197, 94, 0.28); color: #c6f7d8; }
.divider { height: 2px; border: 0; background: linear-gradient(90deg, transparent, rgba(255, 210, 63, 0.4), transparent); margin: var(--sp-3) 0; }
/* modal and sheet */
#modal { position: fixed; inset: 0; z-index: var(--z-sheet); display: grid; place-items: center; padding: max(16px, var(--sa-t)) 16px max(16px, var(--sa-b)); background: rgba(6, 5, 28, 0.66); animation: ds-fade var(--t-med); overflow: auto; }
.modal-inner { width: min(420px, 100%); display: flex; flex-direction: column; gap: var(--sp-3); animation: ds-pop 0.34s var(--ease-pop) both; }
.modal-card {
  display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5); color: var(--ds-ink);
  background: linear-gradient(180deg, var(--ds-cream), var(--ds-cream-2)); border: 3px solid var(--ds-gold-400); border-radius: var(--r-xl);
  box-shadow: inset 0 3px 0 #fff, 0 6px 0 var(--ds-gold-800), 0 24px 56px rgba(0, 0, 0, 0.5);
}
.modal-card h2 { color: var(--ds-ink); font-size: var(--fs-2xl); }
.modal-card h3, .modal-card .set-h { color: var(--ds-ink-2); }
.modal-card.prose ul { margin: 0; padding-left: 20px; line-height: 1.55; color: var(--ds-ink); }
.modal-card .hint, .modal-card .setting > span { color: var(--ds-ink-2); }
.modal-actions { display: flex; gap: var(--sp-3); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--sp-2); }
.modal-actions .btn { flex: 1 1 auto; }
.modal-card .btn.ghost { --ink: var(--ds-ink); background: rgba(42, 26, 5, 0.08); box-shadow: inset 0 0 0 2px rgba(42, 26, 5, 0.25); }
.modal-card .btn.ghost:hover { background: rgba(42, 26, 5, 0.14); }
.modal-card a { color: #3a2c96; }
/* settings: segmented controls */
.setting { display: flex; flex-direction: column; gap: 6px; }
.setting > span { font-size: var(--fs-sm); font-weight: 700; color: var(--ds-muted); }
.set-h { margin: var(--sp-3) 0 0; font: 700 var(--fs-xs) var(--font-display); letter-spacing: 1px; text-transform: uppercase; color: var(--ds-muted); }
.segs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-md); background: rgba(42, 26, 5, 0.12); }
.seg { flex: 1; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 12px; font: 600 var(--fs-sm) var(--font-display); color: var(--ds-ink-2); background: transparent; cursor: pointer; transition: background var(--t-med), color var(--t-med), transform var(--t-fast); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.seg:active { transform: scale(0.96); }
.seg.on { background: var(--ds-indigo-600); color: #fff; box-shadow: 0 3px 0 var(--ds-indigo-900), inset 0 2px 0 rgba(255, 255, 255, 0.25); }
.panel .segs, .home .segs { background: rgba(8, 10, 32, 0.45); }
.panel .seg, .home .seg { color: var(--ds-muted); }
.panel .seg.on, .home .seg.on { background: var(--ds-gold-400); color: var(--ds-ink); box-shadow: 0 3px 0 var(--ds-gold-700), inset 0 2px 0 rgba(255, 255, 255, 0.5); }

/* ============ 7. toasts and bars ============ */
#toasts { position: fixed; z-index: var(--z-toast); left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 24px)); bottom: calc(var(--bnav-h) + max(12px, var(--sa-b))); display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: var(--sp-3); padding: 12px 16px; border-radius: var(--r-md); font: 600 var(--fs-sm)/1.35 var(--font-display); color: #fff;
  background: linear-gradient(180deg, var(--ds-indigo-500), var(--ds-indigo-700)); border: 2px solid var(--ds-line-gold);
  box-shadow: 0 4px 0 var(--ds-indigo-900), var(--sh-2); animation: ds-in 0.32s var(--ease-pop) both; pointer-events: auto;
}
.toast::before { content: "ℹ️"; font-size: 18px; }
.toast.good::before { content: "✅"; } .toast.err::before { content: "⚠️"; } .toast.big::before { content: "🎉"; }
.toast.good { border-color: rgba(110, 231, 154, 0.7); } .toast.err { background: linear-gradient(180deg, #8f2530, #5b1019); border-color: var(--ds-berry-400); }
.toast.out { opacity: 0; transform: translateY(10px); transition: opacity 0.3s, transform 0.3s; }
.site-banner { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-radius: var(--r-md); background: rgba(37, 99, 235, 0.3); border: 2px solid rgba(90, 155, 255, 0.55); color: #fff; }
.site-banner p { margin: 0; font-size: var(--fs-sm); font-weight: 700; }
.cookie-notice, .a2hs-tip {
  position: fixed; z-index: var(--z-bar); left: 12px; right: 12px; bottom: calc(var(--bnav-h) + max(12px, var(--sa-b))); margin: 0 auto; max-width: 480px;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 10px 12px 10px 16px;
  color: var(--ds-text); font: 600 var(--fs-sm)/1.35 var(--font-display); background: linear-gradient(180deg, var(--ds-indigo-600), var(--ds-indigo-800));
  border: 2px solid var(--ds-line-gold); border-radius: var(--r-md); box-shadow: 0 4px 0 var(--ds-indigo-900), var(--sh-3);
}
.cookie-notice[hidden], .a2hs-tip[hidden] { display: none; }
.cookie-notice p, .a2hs-tip p { margin: 0; flex: 1; font-size: var(--fs-sm); color: var(--ds-text); }
#update-bar { position: fixed; z-index: 200; left: 12px; right: 12px; margin: 0 auto; max-width: 520px; bottom: calc(var(--bnav-h) + max(12px, var(--sa-b)));
  display: flex; align-items: center; gap: var(--sp-3); padding: 10px 12px 10px 16px; border-radius: var(--r-md); color: #fff; font: 600 var(--fs-sm)/1.3 var(--font-display);
  background: linear-gradient(180deg, var(--ds-indigo-600), var(--ds-indigo-800)); border: 2px solid var(--ds-gold-400); box-shadow: 0 4px 0 var(--ds-indigo-900), var(--sh-3); animation: ds-in 0.4s var(--ease-pop) both; }
#update-bar .update-text { flex: 1 1 auto; min-width: 0; }
#update-bar button { font: 600 var(--fs-sm) var(--font-display); min-height: 44px; min-width: 72px; padding: 8px 16px; border-radius: 14px; border: 0; cursor: pointer; transition: transform var(--t-fast); }
#update-bar button:active { transform: scale(0.95); }
#update-bar .update-go { background: linear-gradient(180deg, var(--ds-gold-300), var(--ds-gold-500)); color: var(--ds-ink); box-shadow: 0 3px 0 var(--ds-gold-700); }
#update-bar .update-later { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3); }
.offline-indicator { position: fixed; z-index: var(--z-bar); top: max(8px, var(--sa-t)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: var(--sp-2); padding: 6px 14px; border-radius: var(--r-pill);
  font: 600 var(--fs-sm) var(--font-display); background: rgba(91, 16, 25, 0.95); border: 2px solid var(--ds-berry-400); color: #fff; box-shadow: var(--sh-2); }
.offline-indicator[hidden] { display: none; }
.offline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ds-berry-400); box-shadow: 0 0 0 4px rgba(255, 107, 115, 0.3); }
.offline-text b { color: var(--ds-gold-100); }
.offline-links { display: flex; gap: var(--sp-2); }
.offline-links a { color: var(--ds-gold-100); }
.pwa-modal-backdrop { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; background: rgba(6, 5, 28, 0.7); animation: ds-fade var(--t-med); }
.pwa-modal-backdrop[hidden] { display: none; }
.pwa-modal-card { position: relative; width: min(420px, 100%); padding: var(--sp-5); border-radius: var(--r-xl); color: var(--ds-ink); background: linear-gradient(180deg, var(--ds-cream), var(--ds-cream-2)); border: 3px solid var(--ds-gold-400); box-shadow: 0 6px 0 var(--ds-gold-800), 0 24px 56px rgba(0, 0, 0, 0.5); animation: ds-pop 0.34s var(--ease-pop) both; }
.pwa-modal-card h3 { color: var(--ds-ink); margin-bottom: 8px; } .pwa-modal-card p, .pwa-modal-card ol { color: var(--ds-ink); font-size: var(--fs-sm); }
.pwa-modal-close { position: absolute; top: 10px; right: 10px; }

/* ============ 8. lists, tables, tabs ============ */
.statgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.stat { padding: var(--sp-4) var(--sp-3); text-align: center; border-radius: var(--r-md); background: rgba(8, 10, 32, 0.45); border: 2px solid rgba(255, 255, 255, 0.12); }
.stat b { display: block; font: 700 1.75rem/1.1 var(--font-display); color: var(--ds-gold-300); margin-bottom: 2px; word-break: break-word; }
.stat span { font-size: var(--fs-xs); font-weight: 700; color: var(--ds-muted); letter-spacing: 0.3px; }
.profile-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.profile-list li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 8px 14px; border-radius: var(--r-md); background: rgba(8, 10, 32, 0.45); border: 2px solid rgba(255, 255, 255, 0.1); }
.profile-list li > span:first-child { color: var(--ds-muted); } .profile-list li b { overflow-wrap: anywhere; text-align: right; }
.table-wrap { overflow-x: auto; margin: var(--sp-2) 0; border-radius: var(--r-md); }
.admin-table, table.leaders { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.admin-table th, .admin-table td, table.leaders th, table.leaders td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); vertical-align: middle; }
.admin-table th, table.leaders th { color: var(--ds-muted); font: 700 var(--fs-xs) var(--font-display); letter-spacing: 0.8px; text-transform: uppercase; }
.admin-table tbody tr:hover, table.leaders tbody tr:hover { background: rgba(255, 255, 255, 0.05); }
.rank-table { min-width: 0; }
.rank-table td:first-child, .rank-table th:first-child { width: 2.6em; text-align: center; font-family: var(--font-display); font-weight: 700; color: var(--ds-gold-300); }
.rank-table tbody tr:nth-child(-n+3) td:first-child { font-size: 1.15rem; }
.rank-table td:nth-child(n+3), .rank-table th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.rank-table td a { color: #fff; font-weight: 700; }
.admin-page .panel.wide, .panel.wide { width: min(960px, 100%); }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--sp-2) 0 var(--sp-3); }
.admin-tabs .seg { flex: 0 0 auto; padding: 8px 16px; background: rgba(8, 10, 32, 0.45); color: var(--ds-muted); }
.admin-tabs .seg.on { background: var(--ds-gold-400); color: var(--ds-ink); }
.admin-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.admin-actions, .admin-actions .inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.admin-actions input, .admin-actions select, .inline input, .inline select { max-width: 150px; min-height: 40px; padding: 6px 10px; }
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); }
.tab-note { color: var(--ds-muted); }

/* ============ 9. skeleton, empty, spinner ============ */
.skel { position: relative; overflow: hidden; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.08); min-height: 16px; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.14) 50%, transparent 80%) 0 0 / 200% 100%; animation: ds-shimmer 1.3s linear infinite; }
.skel.line { height: 16px; } .skel.row { height: 52px; border-radius: var(--r-md); } .skel.tall { height: 96px; } .skel.title { height: 28px; width: 60%; }
.skel-stack { display: flex; flex-direction: column; gap: var(--sp-2); }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); text-align: center; border-radius: var(--r-lg); background: rgba(8, 10, 32, 0.35); border: 2px dashed rgba(255, 255, 255, 0.2); }
.empty .empty-ico { font-size: 48px; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.3)); animation: ds-bob 3.2s ease-in-out infinite; }
.empty h3 { font-size: var(--fs-lg); } .empty p { margin: 0; color: var(--ds-muted); font-size: var(--fs-sm); max-width: 32ch; }
.empty .btn { margin-top: var(--sp-2); }
.empty.error-state { border-color: rgba(255, 107, 115, 0.5); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.2); border-top-color: var(--ds-gold-400); animation: ds-spin 0.8s linear infinite; }

/* ============ 10. bottom nav and the "More" sheet ============ */
.bnav { display: none; }
@media (max-width: 720px) and (pointer: coarse) and (min-height: 521px) {
  html:not(.go-on):not(.no-bnav) .bnav {
    position: fixed; z-index: var(--z-bnav); left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px;
    padding: 6px max(6px, var(--sa-r)) calc(6px + var(--sa-b)) max(6px, var(--sa-l));
    background: linear-gradient(180deg, rgba(43, 31, 116, 0.97), rgba(27, 22, 80, 0.99)); border-top: 3px solid var(--ds-gold-400);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
  }
  html:not(.go-on) body { padding-bottom: var(--bnav-h); }
}
.bnav a, .bnav button { appearance: none; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 14px; font: 600 11px/1 var(--font-display); color: var(--ds-muted); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform var(--t-fast), background var(--t-med), color var(--t-med); }
.bnav a:active, .bnav button:active { transform: scale(0.92); }
.bnav .ico { font-size: 22px; line-height: 1; transition: transform var(--t-med) var(--ease-pop); }
.bnav [aria-current="page"] { color: var(--ds-ink); background: linear-gradient(180deg, var(--ds-gold-300), var(--ds-gold-500)); box-shadow: 0 3px 0 var(--ds-gold-700); }
.bnav [aria-current="page"] .ico { transform: translateY(-1px) scale(1.12); }
.more-sheet { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; align-items: flex-end; justify-content: center; background: rgba(6, 5, 28, 0.6); animation: ds-fade var(--t-med); }
.more-sheet[hidden] { display: none; }
.more-card { width: min(520px, 100%); padding: var(--sp-4) var(--sp-4) calc(var(--sp-4) + var(--sa-b)); border-radius: var(--r-xl) var(--r-xl) 0 0; background: linear-gradient(180deg, var(--ds-indigo-600), var(--ds-indigo-800)); border: 3px solid var(--ds-gold-400); border-bottom: 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5); animation: ds-sheet 0.3s var(--ease-out) both; }
@keyframes ds-sheet { from { transform: translateY(40px); opacity: 0; } }
.more-card h2 { font-size: var(--fs-xl); margin-bottom: var(--sp-3); display: flex; justify-content: space-between; align-items: center; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.more-grid a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; min-height: 76px; border-radius: var(--r-md); background: rgba(8, 10, 32, 0.45); border: 2px solid rgba(255, 255, 255, 0.12); color: #fff; font: 600 var(--fs-sm) var(--font-display); text-decoration: none; text-align: center; }
.more-grid a:active { transform: scale(0.95); }
.more-grid .ico { font-size: 26px; }

/* ============ 11. hub shell (home, auth, dashboard, ranks, friends, admin) ============ */
#overlay:empty { display: none; }
#overlay {
  position: fixed; inset: 0; z-index: 30; overflow: auto; overflow-x: clip; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: max(20px, var(--sa-t)) max(16px, var(--sa-r)) calc(max(20px, var(--sa-b)) + var(--bnav-h) + var(--kb, 0px)) max(16px, var(--sa-l));
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(75, 58, 168, 0.6), transparent 62%),
    radial-gradient(800px 480px at 105% 4%, rgba(63, 169, 255, 0.22), transparent 60%),
    radial-gradient(900px 600px at 50% 112%, rgba(255, 138, 61, 0.18), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1.2px, transparent 1.6px) 0 0 / 26px 26px,
    var(--ds-night);
}
body:has(.cookie-notice:not([hidden])) #overlay { padding-bottom: calc(max(20px, var(--sa-b)) + var(--bnav-h) + 76px); }
.home { width: min(1100px, 100%); min-height: 100%; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px); gap: var(--sp-5) var(--sp-7); align-items: center; align-content: center; animation: ds-fade var(--t-med); }
.home:not(:has(.hero)) { grid-template-columns: minmax(0, 560px); justify-content: center; align-content: start; padding-top: var(--sp-4); }
.home.admin-page:not(:has(.hero)) { grid-template-columns: minmax(0, 980px); }
.home:not(:has(.hero)) .panel { justify-self: center; width: 100%; }
.home > .home-footer { grid-column: 1 / -1; }
.hero { display: flex; flex-direction: column; gap: var(--sp-3); max-width: 520px; }
.logo { display: flex; align-items: center; gap: var(--sp-3); }
.logo .die { width: 64px; height: 64px; display: grid; place-items: center; font-size: 38px; border-radius: 18px; background: linear-gradient(180deg, #fffdf2, #f0e2bd); box-shadow: inset 0 -5px 0 rgba(150, 100, 30, 0.22), 0 5px 0 var(--ds-gold-800), 0 14px 24px rgba(0, 0, 0, 0.4); animation: ds-bob 3.6s ease-in-out infinite; }
.logo .mark { width: 64px; height: 64px; flex: none; border-radius: 18px; box-shadow: 0 5px 0 rgba(10, 8, 40, 0.5), 0 10px 20px rgba(0, 0, 0, 0.35); }
.logo h1 .wordmark { display: block; width: min(100%, 330px); height: auto; filter: drop-shadow(0 4px 0 rgba(10, 8, 40, 0.4)); }
.logo h1 { font-size: var(--fs-hero); line-height: 1; color: #fff; text-shadow: 0 4px 0 rgba(10, 8, 40, 0.55); }
.logo h1 em { font-style: normal; background: linear-gradient(180deg, var(--ds-gold-100), var(--ds-gold-500)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 3px 0 rgba(138, 83, 0, 0.7)); }
.tagline { margin: 0; font-size: var(--fs-lg); line-height: 1.5; color: #dfe5fb; max-width: 40ch; }
.features { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.features li { padding: 6px 14px; border-radius: var(--r-pill); font: 600 var(--fs-sm) var(--font-display); background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.14); color: #fff; }
.account-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-md); background: rgba(8, 10, 32, 0.45); border: 2px solid rgba(255, 255, 255, 0.1); }
.account-bar .who { font-size: var(--fs-sm); color: var(--ds-muted); }
.account-bar .who b { color: #fff; font-family: var(--font-display); }
.account-bar .row { flex-wrap: wrap; }
/* the big Play button */
.go-entry {
  position: relative; display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: 14px 20px 14px 16px; border: 0; border-radius: var(--r-lg); cursor: pointer; text-align: left; color: var(--ds-green-ink); font-family: var(--font-display);
  background: linear-gradient(180deg, var(--ds-green-300), #17a34a 70%, #129040); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), 0 6px 0 var(--ds-green-900), 0 16px 28px rgba(0, 0, 0, 0.4);
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-med); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.go-entry:hover { filter: brightness(1.06); }
.go-entry:active { transform: translateY(5px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.4), 0 1px 0 var(--ds-green-900), 0 4px 10px rgba(0, 0, 0, 0.4); }
.go-entry-dice { font-size: 44px; line-height: 1; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25)); animation: go-entry-roll 3.6s ease-in-out infinite; }
.go-entry-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.go-entry-t b { font-size: 1.5rem; font-weight: 700; line-height: 1.05; }
.go-entry-t small { font: 700 var(--fs-sm)/1.3 var(--font-body); color: #0a3d1b; }
.go-entry em { position: absolute; top: -10px; right: 14px; font: 700 var(--fs-xs) var(--font-display); font-style: normal; padding: 3px 10px; border-radius: var(--r-pill); background: var(--ds-pop); color: #fff; box-shadow: 0 3px 0 #9b1f4a; }
@keyframes go-entry-roll { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-22deg) scale(1.1); } 88% { transform: rotate(14deg); } }
html.lite .go-entry-dice, html[data-lite="1"] .go-entry-dice { animation: none; }
/* piece picker */
.picker { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.picker legend { padding: 0; font: 700 var(--fs-xs) var(--font-display); letter-spacing: 1px; text-transform: uppercase; color: var(--ds-muted); margin-bottom: var(--sp-2); }
.tokens { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-2); }
.tok { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px 6px; min-height: 64px; border: 2px solid rgba(255, 255, 255, 0.14); border-radius: var(--r-md); background: rgba(8, 10, 32, 0.45); color: #fff; cursor: pointer; transition: transform var(--t-fast), border-color var(--t-med), background var(--t-med); -webkit-tap-highlight-color: transparent; }
.tok span { font-size: 26px; line-height: 1.1; } .tok small { font: 600 11px var(--font-display); color: var(--ds-muted); white-space: nowrap; }
.tok:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); } .tok:active { transform: scale(0.94); }
.tok.on { border-color: var(--c, var(--ds-gold-400)); background: color-mix(in srgb, var(--c, #ffd23f) 24%, rgba(8, 10, 32, 0.6)); transform: translateY(-2px); box-shadow: 0 4px 0 color-mix(in srgb, var(--c, #ffd23f) 55%, #000); }
.tok.on small { color: #fff; }
.swatches { display: flex; justify-content: space-between; gap: var(--sp-2); padding: 4px 2px; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.35); transition: transform var(--t-fast) var(--ease-pop), box-shadow var(--t-med); -webkit-tap-highlight-color: transparent; }
.sw:active { transform: scale(0.9); }
.sw.on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--ds-indigo-800), 0 0 0 6px #fff; }
.hub .row.foot { padding-top: var(--sp-3); border-top: 2px solid rgba(255, 255, 255, 0.1); }
.app-ver { margin: 0; text-align: center; font-size: var(--fs-xs); color: var(--ds-muted); }
.home-footer { grid-column: 1 / -1; display: flex; justify-content: center; padding: var(--sp-3) 0 var(--sp-2); }
.home-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px var(--sp-4); }
.home-footer a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ds-muted); font: 600 var(--fs-sm) var(--font-display); text-decoration: none; }
.home-footer a:hover { color: #fff; text-decoration: underline; }
.hub-splash .hero { align-items: center; margin: 0 auto; text-align: center; } .hub-splash { grid-template-columns: 1fr !important; }
.panel .foot, .panel .row.foot { margin: 0; }
@media (max-width: 900px) {
  .home { grid-template-columns: minmax(0, 1fr) !important; justify-items: center; gap: var(--sp-4); align-content: start; }
  .hero { align-items: center; text-align: center; gap: var(--sp-2); }
  .logo { justify-content: center; } .logo .mark { width: 52px; height: 52px; border-radius: 15px; } .logo h1 .wordmark { width: min(100%, 280px); }
  .features { display: none; }
  .tagline { font-size: var(--fs-md); }
  .panel { padding: var(--sp-4); border-radius: var(--r-lg); gap: var(--sp-3); }
  .grid2 { grid-template-columns: 1fr; }
  .hub .row.foot .btn { flex: 1 1 auto; }
  .hub .row.foot [data-act="leaders"] { display: none; }
}
@media (max-width: 380px) { .tok small { display: none; } .tok { min-height: 52px; } }
@media (max-width: 720px) and (pointer: coarse) and (min-height: 521px) {
  .hub .panel > .go-entry { order: -2; }                    /* the Play button comes first on a phone */
  .hub .panel > #site-banner, .hub .panel > .site-banner { order: -3; }
  .hub .panel > .account-bar { order: 3; }
  /* the bottom bar already has Ranks, Friends and the account */
  html:not(.no-bnav) .account-bar [data-act="leaders"], html:not(.no-bnav) .account-bar [data-act="friends"], html:not(.no-bnav) .account-bar [data-act="dashboard"] { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #overlay { padding-top: max(10px, var(--sa-t)); padding-bottom: max(10px, var(--sa-b)); }
  .home { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) !important; gap: var(--sp-4); justify-items: stretch; }
  .home:not(:has(.hero)) { grid-template-columns: minmax(0, 640px) !important; justify-items: center; }
  .hero { text-align: left; align-items: flex-start; } .logo { justify-content: flex-start; gap: var(--sp-2); } .tagline { font-size: var(--fs-sm); }
  .logo .mark { width: 46px; height: 46px; border-radius: 14px; } .logo h1 .wordmark { width: 250px; }
  .panel { padding: var(--sp-3) var(--sp-4); gap: var(--sp-2); width: 100%; }
  .tokens .tok small { display: none; } .tok { min-height: 48px; padding: 6px 2px; } .sw { width: 32px; height: 32px; }
  .go-entry { padding: 8px 16px; } .go-entry-dice { font-size: 32px; } .go-entry-t b { font-size: 1.2rem; }
}
/* phones: admin tables become cards */
@media (max-width: 700px) {
  .admin-page .table-wrap { overflow: visible; }
  .admin-table:not(.rank-table) { display: block; }
  .admin-table:not(.rank-table) thead { display: none; }
  .admin-table:not(.rank-table) tbody, .admin-table:not(.rank-table) tr { display: block; }
  .admin-table:not(.rank-table) tr { margin-bottom: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: rgba(8, 10, 32, 0.45); border: 2px solid rgba(255, 255, 255, 0.12); }
  .admin-table:not(.rank-table) td { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); border: 0; padding: 6px 0; text-align: right; }
  .admin-table:not(.rank-table) td::before { content: attr(data-label); font: 700 var(--fs-xs) var(--font-display); color: var(--ds-muted); text-transform: uppercase; letter-spacing: 0.6px; text-align: left; }
  .admin-table td.admin-actions { flex-wrap: wrap; } .admin-table td.admin-actions::before { flex-basis: 100%; }
  .admin-actions .inline, .admin-actions form { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-actions select, .admin-actions input, .admin-actions .btn { min-height: 44px; max-width: none; }
}

/* ============ 12. comfort settings ============ */
html[data-big-text="1"] #overlay .panel, html[data-big-text="1"] #modal .modal-card, html[data-big-text="1"] #toasts .toast { zoom: 1.18; }
html[data-readable="1"] body, html[data-readable="1"] button, html[data-readable="1"] input, html[data-readable="1"] select, html[data-readable="1"] .btn, html[data-readable="1"] h1, html[data-readable="1"] h2, html[data-readable="1"] h3 { font-family: var(--font-body) !important; letter-spacing: 0.2px; }
html[data-lite="1"] .panel { box-shadow: 0 3px 0 rgba(10, 8, 40, 0.6); }
html[data-lite="1"] .logo .die, html[data-lite="1"] .empty .empty-ico { animation: none; }
