/* Luck Gauge on the web: the look of the app, noir and champagne gold (ivory, ink and dark gold in the light
   theme), Inter for text, DM Serif Display for titles. */

:root {
  --sky: #0b0c10; --sky-top: #221e16; --surface: #15171d; --surface-high: #1f222a; --button: rgba(255, 255, 255, .063);
  --button-hover: rgba(255, 255, 255, .1); --primary: #d8b56b; --on-primary: #16130c; --fg: #eeebe4; --muted: #8d8e98;
  --accent: #d8b56b; --accent-soft: rgba(216, 181, 107, .42); --chart: #b48c38; --lucky: #3ecf8e; --unlucky: #ef5b67; --on-danger: #16130c; --line: #2a2d36;
  --input: #101216; --shadow: 0 18px 50px rgba(0, 0, 0, .45); --glow-lucky: rgba(216, 181, 107, .22);
  --glow-unlucky: rgba(190, 40, 60, .26); --lucky-soft: rgba(62, 207, 142, .14); --unlucky-soft: rgba(239, 91, 103, .14);
  --scrim: rgba(5, 6, 8, .72); --mono: #b9b6ae; --ok: #3ecf8e;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* how long a reveal takes at the player's speed, in parts of the long one (settings.speed, paced in state.js) */
  --reveal: calc(2 / 3);
  --monofont: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 18px; --radius-small: 12px;
  --tabbar: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --sky: #f4f0e6; --sky-top: #fffdf6; --surface: #fffdf8; --surface-high: #f0eadd; --button: rgba(27, 29, 35, .045);
    --button-hover: rgba(27, 29, 35, .08); --primary: #1b1d23; --on-primary: #f0dcaa; --fg: #1b1d23; --muted: #67635a;
    --accent: #735b1f; --accent-soft: rgba(128, 101, 35, .4); --chart: #9a7a2e; --lucky: #0c704c; --unlucky: #c62f3d; --on-danger: #ffffff; --line: #e2dbcb;
    --input: #ffffff; --shadow: 0 16px 40px rgba(60, 45, 20, .14); --glow-lucky: rgba(214, 170, 70, .3);
    --glow-unlucky: rgba(198, 47, 61, .16); --lucky-soft: rgba(17, 134, 92, .1); --unlucky-soft: rgba(198, 47, 61, .1);
    --scrim: rgba(40, 34, 22, .45); --mono: #4b4840; --ok: #0c704c;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --sky: #f4f0e6; --sky-top: #fffdf6; --surface: #fffdf8; --surface-high: #f0eadd; --button: rgba(27, 29, 35, .045);
  --button-hover: rgba(27, 29, 35, .08); --primary: #1b1d23; --on-primary: #f0dcaa; --fg: #1b1d23; --muted: #67635a;
  --accent: #735b1f; --accent-soft: rgba(128, 101, 35, .4); --chart: #9a7a2e; --lucky: #0c704c; --unlucky: #c62f3d; --on-danger: #ffffff; --line: #e2dbcb;
  --input: #ffffff; --shadow: 0 16px 40px rgba(60, 45, 20, .14); --glow-lucky: rgba(214, 170, 70, .3);
  --glow-unlucky: rgba(198, 47, 61, .16); --lucky-soft: rgba(17, 134, 92, .1); --unlucky-soft: rgba(198, 47, 61, .1);
  --scrim: rgba(40, 34, 22, .45); --mono: #4b4840; --ok: #0c704c;
  color-scheme: light;
}

/* hidden means hidden, whatever display a class gives */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--sky); color: var(--fg);
  font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.15; letter-spacing: .2px; }
h1 { font-size: clamp(30px, 6vw, 40px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.lucky-text { color: var(--lucky); }
.unlucky-text { color: var(--unlucky); }
.figure { font-family: var(--sans); font-optical-sizing: auto; font-variation-settings: "opsz" 32; font-weight: 650;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .15s; }
.skip:focus { top: 12px; }

/* the light of the backdrop: gold from above in a lucky streak, crimson from below in an unlucky one */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 90% 55% at 50% -8%, var(--sky-top), transparent 72%), var(--sky); }
.backdrop::before, .backdrop::after { content: ""; position: absolute; inset: 0; opacity: 0;
  transition: opacity 1.2s ease; }
.backdrop::before { background: radial-gradient(ellipse 80% 60% at 50% -5%, var(--glow-lucky), transparent 70%); }
.backdrop::after { background: radial-gradient(ellipse 90% 55% at 50% 108%, var(--glow-unlucky), transparent 70%); }
.backdrop[data-mood="lucky"]::before { opacity: .75; }
.backdrop[data-mood="very-lucky"]::before { opacity: 1; animation: breathe 3.2s ease-in-out infinite; }
.backdrop[data-mood="record"]::before { opacity: 1; animation: flare 1.6s ease-out; }
.backdrop[data-mood="unlucky"]::after { opacity: .75; }
.backdrop[data-mood="very-unlucky"]::after { opacity: 1; animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
@keyframes flare { 0% { opacity: 1; filter: brightness(2.2); } 100% { filter: none; } }

/* top bar: the brand, the main pages on a wide screen, the settings */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); min-height: 60px;
  background: linear-gradient(var(--sky) 30%, transparent); }
.topbar.scrolled { background: color-mix(in srgb, var(--sky) 86%, transparent); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); margin-right: auto; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); }
.brand span { font: 400 22px var(--serif); color: var(--accent); letter-spacing: .3px; }
.topnav { display: none; gap: 4px; }
.topnav a { color: var(--muted); text-decoration: none; padding: 9px 14px; border-radius: 999px; font-weight: 500;
  font-size: 15px; transition: color .15s, background .15s; }
.topnav a:hover { color: var(--fg); background: var(--button); }
.topnav a[aria-current="page"] { color: var(--fg); background: var(--button-hover); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; color: var(--fg); background: none; border: 0; cursor: pointer; text-decoration: none;
  transition: background .15s; flex: none; }
.icon-button:hover { background: var(--button); }
.icon-button svg { width: 24px; height: 24px; }
.icon-button[aria-current="page"] { color: var(--accent); }

/* tab bar at the bottom on phones, like the app */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar) + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--sky) 88%, transparent); backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 500; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
body.playing .tabbar { display: none; }
@media (max-width: 759px) {
  body.playing .topbar { display: none; }
  body.playing main { padding-top: 8px; }
  body.playing .game { min-height: calc(100dvh - 16px - var(--safe-bottom)); }
}

main { display: block; outline: none; padding: 4px 16px calc(var(--tabbar) + var(--safe-bottom) + 28px); }
body.playing main { padding-bottom: calc(var(--safe-bottom) + 24px); }
@media (max-width: 759px) { body.playing main { padding-bottom: calc(var(--safe-bottom) + 8px); } }
.page { width: 100%; max-width: 560px; margin: 0 auto; animation: page-in .28s ease-out; }
.page.wide { max-width: 980px; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: center; gap: 12px; margin: 10px 0 18px; }
.page-head h1 { flex: 1; }
.back { margin-left: -10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.section-title { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted);
  margin: 26px 2px 10px; }

@media (min-width: 760px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  main { padding: 8px 32px 64px; }
  .topbar { padding-left: 32px; padding-right: 32px; }
}

/* the text of the home page for search engines, replaced by the page when its scripts run */
.seo { max-width: 560px; margin: 24px auto; text-align: center; color: var(--muted); }
.seo h1 { color: var(--accent); margin: 12px 0 4px; }
.seo .tagline { font-style: italic; margin-bottom: 18px; }
.seo p + p { margin-top: 10px; }
.seo-coin { margin: 0 auto; }
.noscript { text-align: center; margin: 32px auto; max-width: 420px; color: var(--muted); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.tight { padding: 14px 16px; }
.card.accent { border-color: var(--accent-soft); background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface) 60%); }
.card.link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.card.link:hover { border-color: var(--accent-soft); }
.card.link.row, .card.link.player-card { display: flex; }
.card h2 { font-size: 21px; }
.card p + p { margin-top: 8px; }

/* buttons: the main one gold, the rest quieter */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 14px; border: 0; cursor: pointer; font-weight: 600; font-size: 16px; text-decoration: none;
  background: var(--button); color: var(--fg); transition: background .15s, transform .1s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent; user-select: none; text-align: center; }
.btn:hover { background: var(--button-hover); }
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: default; transform: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 92%, #fff), var(--primary));
  color: var(--on-primary); box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 26%, transparent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { min-height: 60px; font-size: 19px; border-radius: 16px; width: 100%; }
.btn.block { width: 100%; }
.btn.quiet { background: none; color: var(--accent); padding: 0 12px; }
.btn.quiet:hover { background: var(--button); }
.btn.outline { background: none; border: 1px solid var(--line); }
.btn.outline:hover { border-color: var(--accent-soft); }
.btn.danger { background: var(--unlucky); color: var(--on-danger); }
.btn.danger.quiet { background: none; color: var(--unlucky); }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 14px; border-radius: 11px; }
.btn.inline { padding: 0; min-height: auto; vertical-align: baseline; }
.btn .spinner { width: 18px; height: 18px; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.buttons > .btn { flex: 1 1 auto; padding: 0 16px; white-space: nowrap; }
@media (max-width: 360px) { .buttons > .btn { white-space: normal; } }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--accent-soft);
  border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 40px 0; color: var(--muted); }

/* segmented control, like the periods of the leaderboard */
.segmented { display: flex; background: var(--button); border-radius: 13px; padding: 4px; gap: 4px; overflow-x: auto;
  scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { flex: 1; min-height: 40px; border: 0; background: none; border-radius: 10px; cursor: pointer;
  color: var(--muted); font-weight: 600; font-size: 14px; padding: 0 12px; white-space: nowrap; transition: background .15s, color .15s; }
.segmented button:hover { color: var(--fg); }
.segmented button[aria-pressed="true"] { background: var(--surface-high); color: var(--fg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }

/* the style switch: a row of tiles, the icon over the name */
.styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.styles button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 66px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  color: var(--fg); font-weight: 600; font-size: 13.5px; transition: border-color .15s, background .15s; }
.styles button:hover { border-color: var(--accent-soft); }
.styles button[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.styles button svg { width: 24px; height: 24px; color: var(--accent); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12.5px;
  font-weight: 600; background: var(--button); color: var(--muted); white-space: nowrap; }
.pill svg { width: 14px; height: 14px; }
.pill.gold { color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.pill.lucky { color: var(--lucky); background: var(--lucky-soft); }
.pill.unlucky { color: var(--unlucky); background: var(--unlucky-soft); }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* avatars: initials in a gold ring */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  flex: none; font: 400 17px var(--serif); color: var(--accent); border: 1.5px solid var(--accent-soft);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-high)); }
.avatar.big { width: 64px; height: 64px; font-size: 25px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 13px; }
.field .error { color: var(--unlucky); font-size: 13.5px; font-weight: 500; }
.input, textarea.input { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--input); color: var(--fg); font-size: 16px; transition: border-color .15s; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--accent); }
.input[aria-invalid="true"] { border-color: var(--unlucky); }
.form-error { color: var(--unlucky); background: var(--unlucky-soft); border-radius: 12px; padding: 10px 14px;
  font-size: 14.5px; font-weight: 500; }
.form-ok { color: var(--lucky); background: var(--lucky-soft); border-radius: 12px; padding: 10px 14px; font-size: 14.5px; font-weight: 500; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 6px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; appearance: none; -webkit-appearance: none;
  border-radius: 999px; background: var(--line); cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* sign-in buttons, built as Google's and Apple's guidelines describe: logo and "Continue with", same size */
.provider { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px;
  border-radius: 6px; cursor: pointer; font: 500 16px/1 var(--sans); padding: 0 16px; }
.provider.google { background: #fff; color: #1f1f1f; border: 1px solid #747775; font-family: "Google Sans", Roboto, var(--sans); }
.provider.google img { width: 20px; height: 20px; }
.provider.apple { background: #000; color: #fff; border: 1px solid #000; }
.provider.apple img { width: 15px; height: 28px; object-fit: cover; object-position: center; transform: scale(1.65); }
:root[data-theme="light"] .provider.google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .provider.google { background: #131314; color: #e3e3e3; border-color: #8e918f; } }
:root[data-theme="light"] .provider.apple { background: #000; }
.providers { display: flex; flex-direction: column; gap: 10px; }

/* dialogs */
dialog.sheet { border: 0; padding: 0; background: transparent; color: var(--fg); max-width: min(480px, calc(100vw - 24px));
  width: 100%; max-height: calc(100dvh - 24px); }
dialog.sheet::backdrop { background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: sheet-in .22s ease-out; }
dialog.sheet[open]::backdrop { animation: fade-in .22s ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-body { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px 22px 20px;
  box-shadow: var(--shadow); max-height: calc(100dvh - 24px); overflow-y: auto; }
.sheet-body h2 { margin-bottom: 8px; }
.sheet-body > p { color: var(--muted); }
.sheet-body .buttons { margin-top: 20px; }
.sheet-body .form { margin-top: 16px; }
.sheet-close { float: right; margin: -12px -10px 0 0; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-bottom) + 16px); transform: translateX(-50%);
  z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content;
  max-width: calc(100vw - 32px); }
.toast { background: var(--fg); color: var(--sky); padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px;
  box-shadow: var(--shadow); animation: toast-in .25s ease-out; text-align: center; }
.toast.out { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@media (min-width: 760px) { .toasts { bottom: 28px; } }
body.playing .toasts { bottom: calc(var(--safe-bottom) + 20px); }

/* home */
.home { display: grid; gap: 14px; }
.hero { text-align: center; padding: 12px 0 6px; }
.hero .logo { width: 112px; height: 112px; margin: 0 auto 14px; cursor: pointer; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45));
  animation: pop-in .6s cubic-bezier(.2, 1.4, .4, 1); transition: transform .3s; }
.hero .logo:hover { transform: translateY(-4px) rotate(-6deg); }
.hero .logo.hop { animation: hop .7s cubic-bezier(.3, .7, .4, 1); }
@keyframes pop-in { from { transform: scale(.6); opacity: 0; } }
@keyframes hop { 40% { transform: translateY(-26px) rotateY(180deg); } 100% { transform: rotateY(360deg); } }
.hero h1 { color: var(--accent); font-size: clamp(38px, 9vw, 52px); }
.hero .tagline { color: var(--muted); font-style: italic; font-size: 19px; margin-top: 6px; }
.player-card { display: flex; align-items: center; gap: 14px; }
.player-card .name { font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.player-card a.status { font-size: 14px; }
.streak-card { display: flex; align-items: center; gap: 14px; }
.streak-flame { width: 48px; height: 48px; flex: none; border-radius: 14px; display: flex; align-items: center;
  justify-content: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.streak-flame svg { width: 26px; height: 26px; }
.streak-flame.cold { color: var(--muted); background: var(--button); }
.streak-card .big-number { font-size: 28px; line-height: 1; }
.moons { display: inline-flex; gap: 3px; vertical-align: -2px; margin-left: 6px; }
.moons svg { width: 14px; height: 14px; color: var(--accent); }
.moons svg.spent { color: var(--line); }
.home-actions { display: grid; gap: 12px; }
.hint-line { text-align: center; color: var(--muted); font-size: 14px; }
.home-intro { margin-top: 26px; }
.steps { display: grid; gap: 12px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .num { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; }
.step b { display: block; margin-bottom: 2px; }
.step p { color: var(--muted); font-size: 15px; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
/* a short phone: a smaller coin, so the button to play is in sight */
@media (max-width: 759px) and (max-height: 760px) {
  .hero { padding: 0; }
  .hero .logo { width: 72px; height: 72px; margin-bottom: 8px; }
  .hero h1 { font-size: 34px; }
  .hero .tagline { font-size: 16px; margin-top: 2px; }
  .home { gap: 10px; }
  .player-card { padding: 12px 14px; }
}
@media (max-width: 759px) and (max-height: 600px) {
  .hero .tagline { display: none; }
  .hero .logo { width: 56px; height: 56px; }
  .hero h1 { font-size: 28px; }
}
@media (min-width: 900px) {
  .home.wide { grid-template-columns: 1fr 1fr; align-items: center; column-gap: 48px; }
  .home.wide .hero { grid-row: span 4; }
  .home.wide .hero .logo { width: 180px; height: 180px; }
}

:root[data-speed="quick"] { --reveal: calc(1 / 3); }
:root[data-speed="long"] { --reveal: 1; }

/* the dial: a half circle of segments from -8 to 8 and a needle */
.dial { position: relative; width: 100%; max-width: 360px; margin: 0 auto; touch-action: manipulation; }
.dial svg { width: 100%; height: auto; overflow: visible; }
.dial .seg { transition: fill calc(.35s * var(--reveal)) ease, opacity calc(.35s * var(--reveal)); }
.dial .needle { transform-origin: 160px 168px; transition: transform calc(.55s * var(--reveal)) cubic-bezier(.3, 1.5, .5, 1); }
.dial-labels { display: flex; justify-content: space-between; font-weight: 600; font-size: 14.5px; margin-top: -4px; padding: 0 4px; }
.dial-labels .lo { color: var(--unlucky); }
.dial-labels .hi { color: var(--lucky); }
.dots { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; min-height: 12px; margin-top: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--lucky); animation: dot-in .3s cubic-bezier(.2, 1.6, .4, 1); }
.dots i.miss { background: var(--unlucky); }
@keyframes dot-in { from { transform: scale(0); } }
.dial.glow .needle-line { filter: drop-shadow(0 0 6px var(--accent)); }

/* the game */
.game { display: flex; flex-direction: column; gap: 10px; min-height: calc(100dvh - 92px); max-width: 560px; margin: 0 auto; }
.game-head { text-align: center; }
.game-head .title { font-weight: 650; font-size: 20px; min-height: 30px; }
.game-head .sub { color: var(--muted); font-size: 15px; min-height: 23px; margin-top: 2px; }
.fair-line { display: inline-flex; align-items: center; gap: 6px; margin: 6px auto 0; padding: 6px 12px; border-radius: 999px;
  color: var(--muted); font-size: 12.5px; background: none; border: 0; cursor: pointer; min-height: 32px; }
.fair-line:hover { color: var(--fg); background: var(--button); }
.fair-line svg { width: 14px; height: 14px; }
.fair-line.bad { color: var(--unlucky); }
.game-top { display: flex; flex-direction: column; gap: 10px; }
.stage { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
  min-height: 0; padding-bottom: 6px; }
/* the dial gives way on a short screen, the choices stay in sight */
.game .dial { max-width: min(360px, 50vh); }
@media (max-width: 759px) { .game .dial { max-width: min(360px, 40dvh); } }
/* a phone on its side: the dial beside the choices */
@media (max-height: 560px) and (min-width: 560px) {
  body.playing .topbar { display: none; }
  body.playing main { padding-top: 6px; padding-bottom: calc(8px + var(--safe-bottom)); }
  .game { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; align-items: center; max-width: 980px;
    min-height: calc(100dvh - 20px); }
  .game .dial { max-width: min(300px, 62vh); }
  .game-top { gap: 4px; }
  .game-top .row h1 { font-size: 22px !important; }
  .stage { justify-content: center; }
}
.prompt { text-align: center; color: var(--muted); font-size: 15px; min-height: 22px; }
.calls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.call { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; font-size: 17px;
  color: var(--fg); transition: border-color .15s, background .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.call:hover:not([disabled]) { border-color: var(--accent-soft); }
.call:active:not([disabled]) { transform: scale(.98); }
.call[disabled] { cursor: default; }
.call.chosen { border-color: var(--accent); }
.call.right { border-color: var(--lucky); box-shadow: 0 0 0 3px var(--lucky-soft); }
.call.wrong { border-color: var(--unlucky); box-shadow: 0 0 0 3px var(--unlucky-soft); }
.call img { width: 34px; height: 34px; border-radius: 50%; }
/* the suits on the card's paper, as on the card: a black spade on the dark theme's button was out of sight */
.call .suit { width: 30px; height: 30px; border-radius: 50%; background: #fbf7ee; padding: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
kbd { font: 600 11px var(--sans); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.call kbd { display: none; }
@media (hover: hover) and (min-width: 760px) { .call kbd { display: inline-block; } }

/* the coin: two faces back to back, it flips in 3D */
.coin-stage { position: relative; height: 230px; perspective: 900px; display: flex; align-items: flex-end; justify-content: center; }
.coin { position: relative; width: 170px; height: 170px; transform-style: preserve-3d; margin-bottom: 26px; }
.coin .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 50%; }
.coin .face img { width: 100%; height: 100%; }
.coin .face.back { transform: rotateX(180deg); }
.coin-shadow { position: absolute; bottom: 14px; left: 50%; width: 150px; height: 22px; margin-left: -75px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .5), transparent); }
.coin-wrap { will-change: transform; }

/* the card: dealt face down, turned to show its color */
.card-stage { position: relative; height: 250px; perspective: 1000px; display: flex; align-items: center; justify-content: center; }
.playing-card { position: relative; width: 150px; height: 210px; transform-style: preserve-3d; will-change: transform; }
.playing-card .side { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 11px; box-shadow: 0 14px 30px rgba(0, 0, 0, .45); overflow: hidden; }
.playing-card .side img { width: 100%; height: 100%; }
.playing-card .front { transform: rotateY(180deg); background: #fbf7ee; color: #1b1d23; }
.playing-card .front.red { color: #c3283f; }
.playing-card .corner { position: absolute; display: flex; flex-direction: column; align-items: center; font: 400 26px/1 var(--serif); }
.playing-card .corner img { width: 16px; height: 16px; margin-top: 3px; }
.playing-card .corner.tl { left: 9px; top: 9px; }
.playing-card .corner.br { right: 9px; bottom: 9px; transform: rotate(180deg); }
.playing-card .pip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.playing-card .pip img { width: 64px; height: 64px; }
.playing-card .court { position: absolute; inset: 30px 26px; border: 1.5px solid #c9a65a; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(160deg, #fff, #f3ead6); }
.playing-card .court span { font: 400 46px/1 var(--serif); }
.playing-card .court img { width: 26px; height: 26px; }

/* the boxes: lacquered, side by side; the one picked opens */
.boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; padding: 0 4px; }
.box { position: relative; width: 100%; max-width: 190px; justify-self: center; aspect-ratio: 1.1 / .9; background: none; border: 0;
  padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .2s; }
.box:hover:not([disabled]) { transform: translateY(-4px); }
.box[disabled] { cursor: default; }
.box .body { position: absolute; left: 4.55%; right: 4.55%; bottom: 0; height: 66.7%; }
.box .lid { position: absolute; left: 0; right: 0; top: 0; height: 48.9%;
  transition: transform calc(.5s * var(--reveal)) cubic-bezier(.3, .7, .3, 1), opacity calc(.5s * var(--reveal)); }
.box .body img, .box .lid img { width: 100%; height: 100%; }
.box .shadow { position: absolute; left: 10%; right: 10%; bottom: -8px; height: 16px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent); }
.box.trembling { animation: tremble .12s linear infinite; }
@keyframes tremble { 25% { transform: translate(-1.5px, 0) rotate(-1deg); } 75% { transform: translate(1.5px, 0) rotate(1deg); } }
.box.open .lid { transform: translateY(-70%) rotate(-12deg); opacity: 0; }
.box.open .body { animation: sink calc(.5s * var(--reveal)) calc(.15s * var(--reveal)) ease-in forwards; }
@keyframes sink { to { transform: translateY(12%) scale(.92); opacity: 0; } }
.box .label { position: absolute; left: 0; right: 0; bottom: -30px; text-align: center; font-weight: 600; font-size: 14px; color: var(--muted); }

/* the scratch ticket: two foil panels on card stock, as wide as the boxes, so it fits a laptop's screen with its
   prompt like the other styles */
.ticket { background: linear-gradient(160deg, #fbf6e9, #efe5cc); border-radius: 14px; padding: 12px; color: #2a2418;
  width: 100%; max-width: 400px; margin: 0 auto;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .4), inset 0 0 0 1.5px #d9c48f; }
.ticket-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 10px; }
.ticket-head b { font: 400 17px var(--serif); letter-spacing: .5px; }
.ticket-head span { font-size: 11px; letter-spacing: 1px; color: #6b6150; }
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel { position: relative; aspect-ratio: 100 / 125; border-radius: 6px; overflow: hidden; touch-action: none; cursor: crosshair;
  background: #fffaf0; }
.panel .under { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: url("img/stock.svg") center / cover; }
.panel .under img { width: 62%; }
.panel .under b { font: 400 22px var(--serif); }
.panel canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.panel.done { cursor: default; }
.panel.lucky-panel { box-shadow: 0 0 0 3px var(--lucky); }
.panel.unlucky-panel { box-shadow: 0 0 0 3px var(--unlucky); }
.panel-hint { position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; font: 400 20px var(--serif);
  color: #646a78; pointer-events: none; transition: opacity .3s; }

/* the whole game fits on a phone's screen with the browser's bars showing (an iPhone 13 Pro's Safari leaves 390x664).
   After the rules of the styles, or those win */
.prompt:empty { display: none; }
@media (max-height: 760px) {
  .coin-stage { height: 180px; }
  .coin { width: 128px; height: 128px; margin-bottom: 18px; }
  .coin-shadow { width: 116px; margin-left: -58px; bottom: 8px; }
  .card-stage { height: 190px; }
  .playing-card { width: 118px; height: 165px; }
  .playing-card .pip img { width: 48px; height: 48px; }
  .playing-card .court { inset: 24px 20px; }
  .playing-card .court span { font-size: 36px; }
  .boxes .box { max-width: 150px; }
  .call { min-height: 54px; }
  .game-head .sub { font-size: 14px; }
  .ticket { max-width: 320px; }
}
@media (max-height: 760px) and (max-width: 759px) { .ticket { max-width: 270px; } }
/* a small phone upright: what's at stake gives way, like in the app */
@media (max-height: 600px) and (max-width: 559px) {
  .game-head .sub { display: none; }
  .game, .game-top { gap: 6px; }
  .coin-stage { height: 128px; }
  .coin { width: 104px; height: 104px; margin-bottom: 10px; }
  .coin-shadow { width: 94px; margin-left: -47px; bottom: 4px; }
  .card-stage { height: 142px; }
  .playing-card { width: 96px; height: 134px; }
  .playing-card .pip img { width: 38px; height: 38px; }
  .playing-card .court { inset: 18px 14px; }
  .playing-card .court span { font-size: 28px; }
  .boxes .box { max-width: 130px; }
  .ticket { max-width: 215px; padding: 8px; }
  .ticket-head { margin-bottom: 6px; }
  /* no room for the name and the number, the number goes, like in the app */
  .ticket-head span { display: none; }
  .call { min-height: 48px; }
}
@media (max-height: 500px) and (max-width: 559px) {
  .game .dial { max-width: 32dvh; }
  .ticket { max-width: 190px; }
}

/* the result of a guess: a glow and two outlines rippling out in the color of the guess, behind and around the coin,
   card, box or panel (placed by game.js), and the new reading in the color of its sign */
.burst-glow { position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, currentColor, transparent); animation: burst-glow calc(1.4s * var(--reveal)) ease-out forwards; }
@keyframes burst-glow { 12% { opacity: .47; } 78% { opacity: .47; } 100% { opacity: 0; } }
.ripple { position: fixed; z-index: 3; pointer-events: none; }
.ripple .ring { position: absolute; inset: 0; border-radius: var(--radius); border: 2.5px solid currentColor; opacity: 0;
  animation: ring calc(1.1s * var(--reveal)) ease-out forwards; }
.ripple .ring + .ring { animation-delay: calc(.12s * var(--reveal)); }
.ripple.right, .burst-glow.right, .edge-pulse.right { color: var(--lucky); }
.ripple.wrong, .burst-glow.wrong, .edge-pulse.wrong { color: var(--unlucky); }
/* the edges of the screen when a guess opens: clear at the very edges, strongest just inside, gone before the text */
.edge-pulse { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0;
  background: linear-gradient(to right, transparent, currentColor 1.5vmin, transparent 9vmin),
    linear-gradient(to left, transparent, currentColor 1.5vmin, transparent 9vmin),
    linear-gradient(to bottom, transparent, currentColor 1.5vmin, transparent 9vmin),
    linear-gradient(to top, transparent, currentColor 1.5vmin, transparent 9vmin);
  animation: edge-pulse calc(.7s * var(--reveal)) linear forwards; }
@keyframes edge-pulse { 12% { opacity: .45; } 45% { opacity: .2; } 100% { opacity: 0; } }
/* fainter on ivory, where the colors wash the page (like the app's light theme) */
:root[data-theme="light"] .edge-pulse { filter: opacity(.55); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .edge-pulse { filter: opacity(.55); } }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.burst .value { position: absolute; left: -120px; width: 240px; top: -48px; text-align: center; font-size: 74px; line-height: 1;
  animation: value-pop calc(.7s * var(--reveal)) cubic-bezier(.2, 1.5, .4, 1) forwards; text-shadow: 0 4px 24px rgba(0, 0, 0, .45); }
.burst.above .value { top: -64px; font-size: 64px; animation: value-rise calc(1.5s * var(--reveal)) cubic-bezier(.2, 1.3, .4, 1) forwards; }
@keyframes value-rise { 0% { transform: translateY(24px) scale(.5); opacity: 0; } 25% { transform: translateY(0) scale(1); opacity: 1; }
  80% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }
.burst.lucky { color: var(--lucky); }
.burst.unlucky { color: var(--unlucky); }
@keyframes ring { 0% { transform: scale(1.04); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes value-pop { 0% { transform: scale(.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* sparks of a new best */
.sparks { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* the result */
.result { text-align: center; display: flex; flex-direction: column; gap: 14px; animation: page-in .35s ease-out; }
.result .medal { width: 120px; height: 120px; margin: 4px auto 0; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .45));
  animation: pop-in .6s cubic-bezier(.2, 1.4, .4, 1); }
.result .kicker { color: var(--muted); text-transform: uppercase; letter-spacing: 2.4px; font-size: 11.5px; font-weight: 600; }
.result .reading { font-size: clamp(84px, 24vw, 112px); line-height: 1; }
.result .reading.lucky { color: var(--lucky); }
.result .reading.unlucky { color: var(--unlucky); }
.result .rating { font: 400 30px var(--serif); }
.result .story { color: var(--muted); }
.result .compared { color: var(--muted); font-style: italic; font-size: 15px; }
.result .facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.fact { background: var(--surface-high); border-radius: 12px; padding: 10px 14px; }
.fact b { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.fact span { font-weight: 600; }
.nudge { text-align: left; }
.nudge h3 { margin-bottom: 4px; }
.nudge p { color: var(--muted); font-size: 15px; }
.nudge .buttons { margin-top: 12px; }
.result { max-width: 560px; margin: 0 auto; outline: none; }
.result-score, .result-more { display: flex; flex-direction: column; gap: 14px; }
/* a wide, short screen: the score beside what to do next */
@media (min-width: 900px), (min-width: 640px) and (max-height: 560px) {
  .result { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; align-items: start; max-width: 980px; padding-top: 12px; }
  .result-score { position: sticky; top: 76px; }
}
@media (max-height: 560px) {
  .result .medal { width: 72px; height: 72px; }
  .result .reading { font-size: 76px; }
  .result-score { top: 8px; }
}
@media (max-height: 520px) { .result .medal { display: none; } }

/* leaderboards */
.board { display: flex; flex-direction: column; }
ol.board { list-style: none; margin: 0; padding: 0; }
.board .empty { padding: 14px; color: var(--muted); text-align: center; }
.board-row .who > span { display: block; }
.board-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: inherit;
  text-decoration: none; min-height: 60px; transition: background .15s; }
.board-row:hover { background: var(--button); }
.board-row + .board-row { border-top: 1px solid var(--line); }
.board-row:hover + .board-row { border-top-color: transparent; }
.board-row .rank { width: 34px; text-align: center; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.board-row .rank.top { color: var(--accent); font-family: var(--serif); font-size: 20px; font-weight: 400; }
.board-row .who { flex: 1; min-width: 0; }
/* a long name gives way, the pill that marks the player's own row doesn't */
.board-row .who .name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.board-row .who .name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.board-row .who .name .pill { flex: none; padding: 1px 7px; font-size: 11px; }
.board-row .who .when { color: var(--muted); font-size: 13px; }
.board-row .value { font-size: 24px; min-width: 52px; text-align: right; }
/* the player's own row has a gold ring, not a fill: a tint under its monogram, pill and chips took their text below
   AA in both themes */
.board-row.mine { box-shadow: inset 0 0 0 1.5px var(--accent-soft); }
.board-row .value.lucky { color: var(--lucky); }
.board-row .value.unlucky { color: var(--unlucky); }
.board-row .readings { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.board-row .readings span { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--button); }
.board-row .readings span.lucky { color: var(--lucky); background: var(--lucky-soft); }
.board-row .readings span.unlucky { color: var(--unlucky); background: var(--unlucky-soft); }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty h1, .empty h2 { color: var(--fg); }
.avatar svg { width: 52%; height: 52%; }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--accent); opacity: .8; }
.skeleton { background: linear-gradient(90deg, var(--surface-high), var(--button), var(--surface-high)); background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton.row-sk { height: 52px; margin: 6px 0; }

/* profile */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; text-align: center; }
.stat .v { font-size: 26px; line-height: 1.1; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }
.luck-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.luck-score { font-size: 34px; line-height: 1; }
.chart { width: 100%; height: auto; margin-top: 12px; }
.chart .cone { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.chart .cone-edge { stroke: var(--accent-soft); stroke-dasharray: 3 4; fill: none; }
.chart .zero { stroke: var(--line); }
.chart .walk { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .end { fill: var(--accent); }
.chart text { fill: var(--muted); font: 600 10.5px var(--sans); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar .dow { text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 600; padding-bottom: 2px; }
.calendar .day { aspect-ratio: 1; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 13.5px; color: var(--muted); background: var(--button); text-decoration: none; min-height: 40px; }
.calendar .day.future { background: none; }
.calendar .day.today { box-shadow: inset 0 0 0 1.5px var(--accent-soft); }
.calendar a.day.lucky { color: var(--lucky); background: var(--lucky-soft); }
.calendar a.day.unlucky { color: var(--unlucky); background: var(--unlucky-soft); }
.calendar a.day:hover { filter: brightness(1.2); }
.history { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; color: inherit; text-decoration: none; min-height: 56px; border-radius: 12px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row:hover { background: var(--button); }
.list-row .value { font-size: 22px; min-width: 48px; text-align: right; }
.list-row .value.lucky { color: var(--lucky); }
.list-row .value.unlucky { color: var(--unlucky); }
svg.chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.list-row > svg:first-child { width: 22px; height: 22px; color: var(--accent); flex: none; }
.list-row.danger > svg:first-child { color: var(--unlucky); }
.settings-list { display: flex; flex-direction: column; }
.settings-list > * + * { border-top: 1px solid var(--line); }
.settings-list a.list-row, .settings-list button.list-row { width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
  font-size: 16px; border-radius: 0; }
.settings-list button.list-row.danger { color: var(--unlucky); }

/* leagues */
.league-code { display: inline-flex; align-items: center; gap: 8px; font: 600 20px var(--monofont); letter-spacing: 3px;
  padding: 8px 14px; border-radius: 12px; background: var(--surface-high); }
.code-input { text-transform: uppercase; letter-spacing: 4px; font: 600 22px var(--monofont); text-align: center; }

/* the checks of a game: the answer, then a receipt per guess */
.checks { display: flex; flex-direction: column; gap: 10px; }
.verdict { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--unlucky); }
.verdict svg { width: 20px; height: 20px; flex: none; }
details.receipt { background: var(--surface-high); border-radius: 12px; padding: 0 14px; }
details.receipt summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px;
  cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; }
details.receipt summary::-webkit-details-marker { display: none; }
details.receipt .mark.ok { color: var(--ok); }
details.receipt .mark.bad { color: var(--unlucky); }
details.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
details.receipt dt { color: var(--muted); font-size: 12.5px; padding-top: 2px; }
details.receipt dd { margin: 0; min-width: 0; }
details.receipt dd.line { display: flex; align-items: flex-start; gap: 4px; }
details.receipt dd.line code { flex: 1; min-width: 0; padding-top: 2px; }
details.receipt .copy { width: 34px; height: 34px; margin: -6px -6px 0 0; color: var(--accent); }
details.receipt .copy svg { width: 17px; height: 17px; }
details.receipt summary .mark { white-space: nowrap; font-size: 13px; }
details.receipt code { font: 12.5px/1.45 var(--monofont); color: var(--mono); word-break: break-all; }
details.receipt .luck { margin: 0 0 8px; font-weight: 500; }
details.receipt a { display: inline-block; margin-bottom: 12px; font-size: 14px; font-weight: 500; }

/* how to play */
.prose { max-width: 680px; }
.prose h2 { margin: 30px 0 10px; }
.prose p, .prose li { color: var(--muted); }
.prose p + p { margin-top: 10px; }
.prose b, .prose strong { color: var(--fg); font-weight: 600; }
.prose ul, .prose ol { padding-left: 22px; margin: 10px 0; }
.prose li + li { margin-top: 6px; }
.prose code { font: 14px var(--monofont); color: var(--fg); }

footer.site { text-align: center; color: var(--muted); font-size: 13px; margin: 40px auto 0; max-width: 560px; }
footer.site a { color: var(--muted); }
footer.site nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-bottom: 8px; }

/* motion off: the player's setting, or the system's */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="on"]) *, :root:not([data-motion="on"]) *::before, :root:not([data-motion="on"]) *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
  }
}
/* without motion the result still shows, still: the reading's rise would end it faded out, the glow too */
:root[data-motion="off"] .burst .value, :root[data-motion="off"] .burst-glow { animation: none !important; opacity: 1; }
:root[data-motion="off"] .burst-glow { opacity: .3; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="on"]) .burst .value, :root:not([data-motion="on"]) .burst-glow { animation: none !important; opacity: 1; }
  :root:not([data-motion="on"]) .burst-glow { opacity: .3; }
}

@media (max-width: 360px) {
  main { padding-left: 12px; padding-right: 12px; }
  .styles button { font-size: 12.5px; }
  .btn.big { font-size: 17px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* the admin section (pages/admin.js) */
.admin-nav { display: flex; gap: 6px; margin: -6px 0 18px; flex-wrap: wrap; }
.admin-nav a { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.admin-nav a:hover { background: var(--button); color: var(--fg); }
.admin-nav a[aria-current="page"] { background: var(--surface-high); color: var(--fg); }
.admin-stats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 8px; }
.admin-stats .stat .v { font-family: var(--sans); font-weight: 650; font-size: 24px; font-variant-numeric: tabular-nums; }
.admin-stats a.stat { color: inherit; text-decoration: none; }
.admin-stats a.stat:hover { border-color: var(--accent-soft); }
.admin-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.chart { margin: 0; }
.chart figcaption { margin-bottom: 8px; }
.chart-title { font-weight: 650; }
.chart-plot { position: relative; }
.chart-svg { display: block; max-width: 100%; height: auto; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--chart); }
.chart-hit { fill: transparent; }
.chart-hit.on { fill: color-mix(in srgb, var(--fg) 6%, transparent); }
.chart-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: var(--surface-high); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; font-size: 13px; white-space: nowrap; pointer-events: none;
  box-shadow: var(--shadow); }
.chart details { margin-top: 8px; }
.chart summary { cursor: pointer; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.admin-table th, .admin-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.admin-table td:last-child, .admin-table th:last-child { text-align: right; }
.admin-pre { white-space: pre; overflow-x: auto; font: 12.5px/1.45 var(--monofont); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-small); padding: 14px; margin-top: 12px; color: var(--mono); }
.admin-search { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.admin-search .input { flex: 1; }
.admin-search label { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
.admin-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.admin-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 14px 0; font-size: 14px; }
.admin-facts dt { color: var(--muted); }
.admin-facts dd { margin: 0; overflow-wrap: anywhere; }
.admin-actions { justify-content: flex-start; }
.admin-note { font-style: italic; overflow-wrap: anywhere; }
.admin-message { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 4px; }
.admin-feedback { align-items: flex-start; }
.admin-empty { padding: 14px; text-align: center; }
