/* Eye Chart: a darkroom. Near-black paper, warm safelight red, film-strip guess slots. */
:root {
  --bg: #0d0b0b;
  --panel: #171313;
  --panel-2: #201a19;
  --line: #2e2625;
  --ink: #f3ece4;
  --muted: #9c8f86;
  --safe: #e8402f;       /* safelight red: accents */
  --safe-dim: #e8402f33;
  --close: #e9a23b;
  --good: #57c27a;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: radial-gradient(120% 60% at 50% -10%, #2a0f0c 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }

/* ---------- header ---------- */
/* Same width on both sides so the logo stays centred: help on the left, board + account on the right. */
.top {
  display: grid; grid-template-columns: 86px 1fr 86px; align-items: center;
  max-width: 640px; margin: 0 auto; padding: 14px 16px 6px;
}
.top .icons { display: flex; gap: 6px; justify-content: flex-end; }
#acctBtn { position: relative; }
#acctBtn .dot { position: absolute; right: 1px; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--good); border: 2px solid var(--bg); }
#acctBtn.in { color: var(--ink); }
.brand { text-align: center; }
.logo {
  margin: 0; font: italic 400 44px/1 var(--serif); letter-spacing: .01em; position: relative; display: inline-block;
}
/* Hangs off the top right of the logo so the name itself stays centred. */
.logo .beta {
  position: absolute; left: 100%; top: 2px; margin-left: 6px;
  font: 600 9px/1 var(--mono); font-style: normal; letter-spacing: .14em; text-transform: uppercase;
  color: var(--safe); border: 1px solid #e8402f88; border-radius: 99px; padding: 3px 6px 2px;
}
.logo span { display: inline-block; }
/* Out of focus at the start, sharp at the end. */
.logo span:nth-child(1) { filter: blur(1.8px); opacity: 0.6; }
.logo span:nth-child(2) { filter: blur(1.5px); opacity: 0.68; }
.logo span:nth-child(3) { filter: blur(1.2px); opacity: 0.76; }
.logo span:nth-child(4) { filter: blur(0.9px); opacity: 0.82; }
.logo span:nth-child(5) { filter: blur(0.6px); opacity: 0.88; }
.logo span:nth-child(6) { filter: blur(0.35px); opacity: 0.94; }
.logo span:nth-child(7) { filter: blur(0.15px); }
.logo span:nth-child(8) { color: var(--safe); }
.logo .sp { margin-left: .22em; }
.meta { font: 12px var(--mono); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }
.icon {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--panel); display: grid; place-items: center; cursor: pointer;
  font: 600 17px var(--sans); color: var(--muted); transition: color .15s, border-color .15s;
}
.icon:hover { color: var(--ink); border-color: var(--muted); }

main { max-width: 640px; margin: 0 auto; padding: 8px 16px 48px; }

.preview-bar {
  margin: 6px 0 4px; padding: 8px 12px; border-radius: 6px; border: 1px dashed var(--close);
  background: #e9a23b14; color: var(--close); font: 12px var(--mono); text-align: center;
}
.preview-bar b { color: var(--ink); }
.preview-bar button { margin-left: 8px; background: none; border: 1px solid var(--close); color: var(--close); border-radius: 99px; padding: 2px 10px; cursor: pointer; font: inherit; }

/* ---------- photo ---------- */
.frame {
  position: relative; background: #000; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px #e8402f40, 0 0 0 6px var(--panel);
  margin-top: 10px;
}
.photo { position: relative; aspect-ratio: 4 / 3; display: grid; }
.photo img {
  grid-area: 1 / 1; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: opacity .7s ease, filter .9s ease, transform .9s ease;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
/* Each new blur level pulls into focus over the last one. */
.photo img.in { opacity: 0; filter: blur(12px); }
/* Solved: a quick lens snap. Missed: a slow, dim settle. */
.photo img.snap { transition: opacity .35s ease, filter .55s cubic-bezier(.2, .9, .3, 1), transform .7s cubic-bezier(.2, .9, .3, 1); }
.photo img.in.snap { filter: blur(22px) brightness(1.3); transform: scale(1.07); }
.photo img.slow { transition: opacity 1.4s ease, filter 1.8s ease; }
.photo img.in.slow { filter: blur(16px) brightness(.4) saturate(.4); }
/* The aperture between photos. */
.photo { clip-path: circle(75% at 50% 50%); transition: clip-path .5s cubic-bezier(.2, .8, .2, 1); }
.photo.shut { clip-path: circle(0% at 50% 50%); transition-duration: .22s; transition-timing-function: ease-in; }
/* Shutter flash and a green glow when it's solved. */
.frame::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 2; }
.frame.flash::after { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: .55 } to { opacity: 0 } }
.frame.locked { animation: locked 1.1s ease-out; }
@keyframes locked {
  0% { box-shadow: 0 30px 80px -30px #e8402f40, 0 0 0 6px var(--panel), 0 0 0 6px #57c27a00; }
  25% { box-shadow: 0 30px 80px -30px #57c27a66, 0 0 0 6px var(--panel), 0 0 0 10px #57c27acc; }
  100% { box-shadow: 0 30px 80px -30px #e8402f40, 0 0 0 6px var(--panel), 0 0 0 16px #57c27a00; }
}
.photo.contain img { object-fit: contain; }
.loading { grid-area: 1 / 1; place-self: center; font: 13px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.focus {
  position: absolute; left: 12px; bottom: 12px; display: flex; gap: 4px; align-items: center;
  padding: 6px 9px; background: #0d0b0bcc; border-radius: 99px; backdrop-filter: blur(6px);
  font: 11px var(--mono); color: var(--muted); letter-spacing: .08em;
}
.focus i { width: 14px; height: 4px; border-radius: 2px; background: #ffffff22; }
.focus i.on { background: var(--safe); }
.focus.clear i { background: var(--good); }
.focus i { transition: background .3s; }
.focus i.glow { animation: notch .9s ease-out; }
@keyframes notch { 0% { transform: scaleY(1); box-shadow: 0 0 0 0 #e8402f00 } 30% { transform: scaleY(2); box-shadow: 0 0 10px 2px #e8402fcc } 100% { transform: scaleY(1); box-shadow: 0 0 0 0 #e8402f00 } }

/* ---------- hint ---------- */
section.hint {
  margin: 18px 0 14px; padding: 12px 14px 12px 16px; background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--safe); border-radius: 6px;
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
}
.tag { font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--safe); flex: none; }
.hint p { margin: 0; font: 400 22px/1.25 var(--serif); }
.hint .cat { display: flex; gap: 14px; align-items: baseline; flex: 1 0 auto; }
.hint-btn {
  flex: none; height: 38px; padding: 0 14px; border-radius: 99px; cursor: pointer;
  background: transparent; border: 1px dashed var(--muted); color: var(--ink); font-weight: 600; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.hint-btn small { font: 400 11px var(--mono); color: var(--muted); margin-left: 6px; letter-spacing: .04em; }
.hint-btn:hover:not(:disabled) { border-color: var(--close); background: #e9a23b14; }
.hint-btn:disabled { opacity: .45; cursor: default; }
.hint .clue {
  flex-basis: 100%; display: flex; gap: 14px; align-items: baseline;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.hint .clue .tag { color: var(--close); }

/* ---------- guesses: a strip of film frames ---------- */
.slots {
  list-style: none; margin: 0 0 14px; padding: 8px 10px; display: grid; gap: 6px;
  background: #090707; border-radius: 6px; border: 1px solid var(--line);
  position: relative;
}
.slots li {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px;
  background: var(--panel); border-radius: 3px; border: 1px solid transparent;
  font: 15px var(--sans); color: var(--muted);
}
.slots li .n { font: 11px var(--mono); color: #5a4f4a; width: 1.4em; }
.slots li .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slots li .r { font: 600 10px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.slots li.wrong { color: var(--ink); border-color: #e8402f44; }
.slots li.wrong .r { color: var(--safe); }
.slots li.close { color: var(--ink); border-color: #e9a23b55; background: #e9a23b14; }
.slots li.close .r { color: var(--close); }
.slots li.correct { color: var(--ink); border-color: #57c27a77; background: #57c27a1c; }
.slots li.correct .r { color: var(--good); }
.slots li.hint { color: var(--muted); border-color: #e9a23b33; border-style: dashed; }
.slots li.hint .r { color: var(--close); }
.slots li.sharpen { color: var(--muted); border-color: #e8402f33; border-style: dashed; }
.slots li.sharpen .r { color: var(--safe); }
.slots li.new { animation: drop .35s ease; }
@keyframes drop { from { transform: translateY(-6px); opacity: 0 } }
/* The result word stamps onto the frame. */
.slots li.new .r { animation: stamp .4s cubic-bezier(.2, .9, .3, 1.4) .1s backwards; }
@keyframes stamp { from { transform: scale(2.4) rotate(-10deg); opacity: 0 } }
.slots li.correct.new { animation: pop .5s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { 0% { transform: scale(.96); box-shadow: 0 0 0 0 #57c27a00 } 40% { transform: scale(1.03); box-shadow: 0 0 0 4px #57c27a55 } 100% { transform: scale(1); box-shadow: 0 0 0 8px #57c27a00 } }
.slots li.close.new { animation: drop .35s ease, amber 1s ease-out; }
@keyframes amber { 0%, 100% { box-shadow: 0 0 0 0 #e9a23b00 } 35% { box-shadow: 0 0 0 4px #e9a23b66 } }

/* ---------- input ---------- */
.guess { display: flex; gap: 8px; }
.guess input, .namer input {
  flex: 1; min-width: 0; height: 50px; padding: 0 16px; border-radius: 6px;
  background: var(--panel-2); border: 1px solid var(--line); outline: none; font-size: 17px;
}
.guess input:focus, .namer input:focus { border-color: var(--safe); box-shadow: 0 0 0 3px var(--safe-dim); }
.guess button, .namer button, .actions button, dialog .primary {
  height: 50px; padding: 0 22px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel-2); cursor: pointer; font-weight: 600;
}
.guess button, .primary { background: var(--safe) !important; border-color: var(--safe) !important; color: #fff; }
.guess button:disabled { opacity: .5; cursor: default; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px) } 40%, 80% { transform: translateX(6px) } }
.toast { min-height: 24px; margin-top: 8px; text-align: center; font: 13px var(--mono); color: var(--muted); }
.toast.close { color: var(--close); }
.toast.pulse { animation: tpulse .6s ease-out; }
@keyframes tpulse { 0% { transform: scale(1) } 30% { transform: scale(1.12); text-shadow: 0 0 12px #e9a23baa } 100% { transform: scale(1) } }
.toast.good { color: var(--good); }

/* ---------- result ---------- */
.result, .empty {
  margin-top: 6px; padding: 22px 20px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; text-align: center;
}
.verdict { font: 600 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.verdict.won { color: var(--good); }
.verdict.lost { color: var(--safe); }
.answer { font: italic 400 42px/1.1 var(--serif); margin: 6px 0 10px; }
.answer::first-letter, .recap .a::first-letter { text-transform: uppercase; }
.stats { display: flex; justify-content: center; gap: 26px; margin: 4px 0 8px; }
.stats div { display: grid; }
.stats b { font: 400 30px/1 var(--serif); }
.stats span { font: 10px var(--mono); color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; }
.credit { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.credit:empty { display: none; }
.credit a { color: var(--muted); }
.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.namer { margin-top: 18px; text-align: left; }
.namer label { display: block; font: 11px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 6px; }
.namer .row { display: flex; gap: 8px; }
.next { margin-top: 18px; font: 12px var(--mono); color: var(--muted); letter-spacing: .06em; }
.next span { color: var(--ink); }

/* ---------- dialogs ---------- */
dialog {
  width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 22px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
}
dialog::backdrop { background: #000a; backdrop-filter: blur(4px); }
dialog h2 { margin: 0 0 10px; font: italic 400 32px/1 var(--serif); }
dialog ol { padding-left: 20px; margin: 0 0 12px; }
dialog li { margin-bottom: 6px; }
dialog .small { font-size: 13px; color: var(--muted); }
dialog .primary { width: 100%; margin-top: 6px; }
.board-head { display: flex; justify-content: space-between; align-items: center; }

/* ---------- account ---------- */
#account { max-width: 420px; }
.google-btn {
  width: 100%; height: 46px; margin-top: 8px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font: 600 15px var(--sans);
}
.google-btn:hover { background: #f4f4f4; }
.google-btn:disabled { opacity: .6; cursor: default; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 2px; font: 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#emailForm { margin-top: 10px; }
.acct-msg { min-height: 1.2em; margin: 10px 0 0; }
.acct-msg.good { color: var(--good); }
.signed { margin: 4px 0 6px; }
.signed b { word-break: break-all; }
.ghost { width: 100%; height: 42px; margin-top: 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 600; }
.ghost:hover { border-color: var(--muted); }
.acct-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.acct-foot a, .help-foot a { color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font: inherit; text-decoration: underline; }
.linkish:hover, .acct-foot a:hover, .help-foot a:hover { color: var(--safe); }
.help-foot { text-align: center; margin: 12px 0 0; }
.save-prompt {
  display: block; width: 100%; margin-top: 16px; padding: 12px 14px; border-radius: 8px; cursor: pointer; text-align: left;
  background: #57c27a14; border: 1px dashed #57c27a88; color: var(--good); font: 600 14px var(--sans);
}
.save-prompt:hover { background: #57c27a22; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 8px; margin: 6px 0 10px; }
.tabs button { flex: 1; height: 34px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--ink); }
.board-sub { font: 11px var(--mono); color: var(--muted); letter-spacing: .06em; margin-bottom: 8px; }
.rows { list-style: none; padding: 0; margin: 0; max-height: 52vh; overflow: auto; }
.rows li {
  display: grid; grid-template-columns: 2.4em 1fr auto auto; gap: 10px; align-items: center;
  padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: 15px;
}
.rows li.you { background: var(--safe-dim); border-radius: 4px; }
.rows li.gap { display: block; text-align: center; color: var(--muted); border: 0; padding: 2px; }
.rows .rk { font: 12px var(--mono); color: var(--muted); }
.rows li:nth-child(-n+3) .rk { color: var(--safe); font-weight: 600; }
.rows .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .sc { font: 600 13px var(--mono); }
.rows .tm { font: 12px var(--mono); color: var(--muted); min-width: 4.5em; text-align: right; }
.rows .none { display: block; color: var(--muted); text-align: center; padding: 24px 0; border: 0; }

@media (max-width: 420px) {
  .top { grid-template-columns: 76px 1fr 76px; padding-left: 12px; padding-right: 12px; }
  .top .icon { width: 35px; height: 35px; }
  .top .icons { gap: 5px; }
  .logo .beta { top: -9px; margin-left: -12px; font-size: 8px; padding: 2px 5px 1px; background: var(--bg); }
  .logo { font-size: 38px; }
  .hint p { font-size: 19px; }
  .answer { font-size: 34px; }
  .guess button { padding: 0 16px; }
}
@media (max-width: 360px) {
  .logo { font-size: 32px; }
}
@media (max-width: 330px) {
  .logo { font-size: 28px; }
}
/* Reduce motion: nothing moves, shakes or zooms; fades stay. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-property: opacity !important; }
  .photo img.in { filter: none; }
}

/* ---------- five photos a day ---------- */
.rounds {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0 4px;
  padding: 6px; background: #090707; border: 1px solid var(--line); border-radius: 6px;
}
.rd {
  height: 40px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel);
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: 600 12px var(--mono); color: var(--muted); transition: border-color .15s, background .15s;
}
.rd .no { opacity: .7; }
.rd .st { font-size: 13px; }
.rd.locked { cursor: default; opacity: .45; }
.rd.live { color: var(--ink); border-color: var(--safe); }
.rd.live .st { color: var(--safe); }
.rd.won { background: #57c27a14; border-color: #57c27a55; color: var(--ink); }
.rd.won .st { color: var(--good); }
.rd.lost { background: #e8402f14; border-color: #e8402f55; color: var(--ink); }
.rd.lost .st { color: var(--safe); }
.rd[aria-current="true"] { box-shadow: 0 0 0 2px var(--ink) inset; }
.rd.pop { animation: bounce .6s cubic-bezier(.2, .9, .3, 1.5) .25s backwards; }
.rd.pop .st { animation: stamp .4s cubic-bezier(.2, .9, .3, 1.4) .4s backwards; }
@keyframes bounce { 0% { transform: scale(1) } 35% { transform: scale(1.15) translateY(-3px) } 100% { transform: scale(1) } }
.rd:not(:disabled):hover { border-color: var(--muted); }

.reveal {
  margin-top: 2px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; text-align: center;
}
.reveal .answer { margin: 4px 0 6px; }
.reveal .primary {
  height: 48px; padding: 0 22px; border-radius: 6px; border: 1px solid var(--safe); background: var(--safe);
  color: #fff; font-weight: 600; cursor: pointer;
}
.result { margin-top: 14px; }
.big { display: grid; justify-items: center; margin: 4px 0 10px; }
.big b { font: italic 400 72px/1 var(--serif); }
.big span { font: 10px var(--mono); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.recap { list-style: none; padding: 0; margin: 14px 0 16px; display: grid; gap: 4px; text-align: left; }
.recap button {
  width: 100%; display: grid; grid-template-columns: 1.6em 1fr auto; gap: 10px; align-items: center;
  padding: 8px 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-align: left;
}
.recap .n { font: 11px var(--mono); color: var(--muted); }
.recap .a { font: italic 400 20px/1.1 var(--serif); display: block; }
.recap .m { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.recap .won .m { color: var(--good); }
.recap .lost .m { color: var(--safe); }

/* ---------- effects ---------- */
/* A finished photo: the answer card rises in and its verdict stamps down. */
.reveal.rise { animation: rise .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(14px); opacity: 0 } }
.verdict.stamp { display: inline-block; animation: stamp .45s cubic-bezier(.2, .9, .3, 1.4) .15s backwards; }
.reveal .answer { animation: none; }
.reveal.rise .answer { animation: rise .5s cubic-bezier(.2, .8, .2, 1) .1s backwards; }

/* The hint card flips over. */
.hint .clue { transform-origin: top center; }
.hint .clue.flip { animation: flip .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes flip { from { transform: perspective(600px) rotateX(-90deg); opacity: 0 } }

/* Day complete: score counts up, recap rows slide in one after another, focus rings burst. */
.big { position: relative; }
.result.celebrate { animation: rise .5s cubic-bezier(.2, .8, .2, 1); }
.result.celebrate .recap li { animation: rowIn .4s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(.9s + var(--i, 0) * .09s); }
@keyframes rowIn { from { transform: translateX(-14px); opacity: 0 } }
.ring {
  position: absolute; left: 50%; top: 36px; width: 90px; height: 90px; margin: -45px 0 0 -45px;
  border-radius: 50%; border: 2px solid var(--good); pointer-events: none;
  animation: ring 1.5s cubic-bezier(.1, .7, .3, 1) backwards;
}
.ring.alt { border-color: var(--safe); }
@keyframes ring { from { transform: scale(.3); opacity: .9 } to { transform: scale(4); opacity: 0 } }
.rank-badge {
  display: inline-block; margin: 0 0 6px; padding: 5px 12px; border-radius: 99px;
  background: var(--safe-dim); border: 1px solid #e8402f66; color: var(--ink);
  font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.result.celebrate .rank-badge { animation: stamp .5s cubic-bezier(.2, .9, .3, 1.4) 1.3s backwards; }

/* Buttons press in, and lift a little under a mouse. */
button { transition: transform .12s ease; }
.icon { transition: color .15s, border-color .15s, transform .12s ease; }
.hint-btn { transition: border-color .15s, background .15s, transform .12s ease; }
.rd { transition: border-color .15s, background .15s, transform .12s ease; }
button:not(:disabled):active { transform: scale(.95); }
.rd:not(:disabled):active, .recap button:active, .tabs button:active { transform: scale(.98); }
@media (hover: hover) {
  .primary:not(:disabled):hover, .guess button:not(:disabled):hover, .actions button:hover,
  .google-btn:not(:disabled):hover, .ghost:hover, .hint-btn:not(:disabled):hover { transform: translateY(-1px); }
  .primary:not(:disabled):hover, .guess button:not(:disabled):hover { box-shadow: 0 6px 18px -6px #e8402f99; }
  .primary:not(:disabled):active, .guess button:not(:disabled):active { transform: scale(.96); }
}

/* Dialogs rise in over a fading backdrop. */
dialog[open] { animation: dlg .25s cubic-bezier(.2, .8, .2, 1); }
dialog[open]::backdrop { animation: fade .25s ease; }
@keyframes dlg { from { transform: translateY(16px) scale(.97); opacity: 0 } }
@keyframes fade { from { opacity: 0 } }

/* Sound and vibration switches in How to play. */
.prefs { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 14px; }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--muted); }
.switch input {
  appearance: none; -webkit-appearance: none; margin: 0; width: 34px; height: 20px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .2s;
}
.switch input::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted); transition: transform .2s, background .2s;
}
.switch input:checked { background: var(--safe); border-color: var(--safe); }
.switch input:checked::after { transform: translateX(14px); background: #fff; }
.switch input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch input:checked + span { color: var(--ink); }
