/* Thomson-Leng look, night edition: deep night-sky background with stars, gold ink lines, royal-blue title bars, lemon, scarlet, grass green, black ink lines.
   Fonts (all SIL Open Font License): Josefin Sans (titles/bars), Libre Caslon Text (body), Limelight (headline), Yesteryear (script). */
@font-face { font-family: "Josefin Sans"; src: url(/fonts/josefin.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url(/fonts/caslon.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url(/fonts/caslon-b.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Libre Caslon Text"; src: url(/fonts/caslon-i.woff2) format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Limelight"; src: url(/fonts/limelight.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Yesteryear"; src: url(/fonts/yesteryear.woff2) format("woff2"); font-display: swap; }

:root {
  --paper: #0b0c1a; --card: #161a33; --ink: #f3e6c6; --soft: #c8b994; --blue: #2546b0; --blue-d: #a9bcff;
  --line: #d8b45c; --shade: #000; --dark: #1b1611; --blue-t: #9fb6ff;
  --lemon: #f6d12e; --scarlet: #d1281f; --green: #3d963a; --sky: rgba(246, 209, 46, .16);
  --sans: "Josefin Sans", "Futura", "Century Gothic", system-ui, sans-serif; --serif: "Libre Caslon Text", Georgia, serif;
  --car: 1.748; /* card height / width; app.js sets it from the deck's back image */
  --st: env(safe-area-inset-top, 0px); --sr: env(safe-area-inset-right, 0px);
  --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); }
body {
  font: 18px/1.45 var(--serif); overflow: hidden; overscroll-behavior: none;
  touch-action: manipulation; -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; touch-action: manipulation; }

/* ---------- night sky, frame, stars ---------- */
.paper { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(70% 50% at 50% 38%, rgba(60, 70, 150, .28), transparent 70%),
    radial-gradient(120% 90% at 50% 40%, transparent 50%, rgba(0, 0, 0, .55) 100%),
    var(--paper); }
.paper::before, .paper::after { content: ""; position: absolute; border-radius: 16px; }
.paper::before { inset: calc(7px + var(--st)) calc(7px + var(--sr)) calc(7px + var(--sb)) calc(7px + var(--sl)); border: 2px solid var(--line); opacity: .75; }
.paper::after { inset: calc(13px + var(--st)) calc(13px + var(--sr)) calc(13px + var(--sb)) calc(13px + var(--sl)); border: 1px solid var(--line); border-radius: 11px; opacity: .4; }
.stars { position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='380' height='380'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop offset='0' stop-color='%23fff3c8' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%23fff3c8' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='123' cy='57' r='5.4' fill='url%28%23g%29'/%3E%3Ccircle cx='123' cy='57' r='1.8' fill='%23fff6dc' fill-opacity='0.57'/%3E%3Ccircle cx='312' cy='36' r='1.5' fill='%23fff6dc' fill-opacity='0.58'/%3E%3Ccircle cx='193' cy='14' r='1.3' fill='%23fff6dc' fill-opacity='0.74'/%3E%3Ccircle cx='91' cy='209' r='0.9' fill='%23fff6dc' fill-opacity='0.92'/%3E%3Ccircle cx='47' cy='85' r='5.4' fill='url%28%23g%29'/%3E%3Ccircle cx='47' cy='85' r='1.8' fill='%23fff6dc' fill-opacity='0.81'/%3E%3Ccircle cx='24' cy='223' r='0.9' fill='%23fff6dc' fill-opacity='0.99'/%3E%3Ccircle cx='18' cy='326' r='1.1' fill='%23fff6dc' fill-opacity='0.74'/%3E%3Ccircle cx='205' cy='217' r='1.5' fill='%23fff6dc' fill-opacity='0.92'/%3E%3Ccircle cx='69' cy='221' r='5.4' fill='url%28%23g%29'/%3E%3Ccircle cx='69' cy='221' r='1.8' fill='%23fff6dc' fill-opacity='0.63'/%3E%3Ccircle cx='37' cy='271' r='1.5' fill='%23fff6dc' fill-opacity='0.58'/%3E%3Ccircle cx='78' cy='259' r='1.3' fill='%23fff6dc' fill-opacity='0.90'/%3E%3Ccircle cx='177' cy='351' r='1.1' fill='%23fff6dc' fill-opacity='0.68'/%3E%3Ccircle cx='302' cy='266' r='1.1' fill='%23fff6dc' fill-opacity='0.59'/%3E%3Ccircle cx='114' cy='188' r='1.1' fill='%23fff6dc' fill-opacity='0.88'/%3E%3Ccircle cx='109' cy='372' r='0.9' fill='%23fff6dc' fill-opacity='0.78'/%3E%3Ccircle cx='63' cy='130' r='1.3' fill='%23fff6dc' fill-opacity='0.74'/%3E%3Ccircle cx='366' cy='29' r='1.5' fill='%23fff6dc' fill-opacity='0.81'/%3E%3Ccircle cx='333' cy='119' r='5.4' fill='url%28%23g%29'/%3E%3Ccircle cx='333' cy='119' r='1.8' fill='%23fff6dc' fill-opacity='0.71'/%3E%3Ccircle cx='189' cy='303' r='0.9' fill='%23fff6dc' fill-opacity='0.93'/%3E%3Ccircle cx='359' cy='180' r='5.4' fill='url%28%23g%29'/%3E%3Ccircle cx='359' cy='180' r='1.8' fill='%23fff6dc' fill-opacity='0.58'/%3E%3Ccircle cx='278' cy='118' r='1.5' fill='%23fff6dc' fill-opacity='1.00'/%3E%3Ccircle cx='312' cy='108' r='1.3' fill='%23fff6dc' fill-opacity='0.95'/%3E%3Ccircle cx='132' cy='357' r='1.1' fill='%23fff6dc' fill-opacity='0.63'/%3E%3Ccircle cx='44' cy='22' r='6.6' fill='url%28%23g%29'/%3E%3Ccircle cx='44' cy='22' r='2.2' fill='%23fff6dc' fill-opacity='0.68'/%3E%3Ccircle cx='281' cy='151' r='6.6' fill='url%28%23g%29'/%3E%3Ccircle cx='281' cy='151' r='2.2' fill='%23fff6dc' fill-opacity='0.77'/%3E%3Ccircle cx='63' cy='153' r='1.1' fill='%23fff6dc' fill-opacity='0.95'/%3E%3Ccircle cx='311' cy='328' r='1.1' fill='%23fff6dc' fill-opacity='0.87'/%3E%3Ccircle cx='375' cy='259' r='1.3' fill='%23fff6dc' fill-opacity='0.98'/%3E%3Ccircle cx='57' cy='67' r='1.1' fill='%23fff6dc' fill-opacity='0.85'/%3E%3Ccircle cx='5' cy='316' r='1.1' fill='%23fff6dc' fill-opacity='0.67'/%3E%3Ccircle cx='2' cy='159' r='1.1' fill='%23fff6dc' fill-opacity='0.82'/%3E%3Ccircle cx='121' cy='48' r='6.6' fill='url%28%23g%29'/%3E%3Ccircle cx='121' cy='48' r='2.2' fill='%23fff6dc' fill-opacity='0.78'/%3E%3Ccircle cx='235' cy='257' r='0.9' fill='%23fff6dc' fill-opacity='0.76'/%3E%3Ccircle cx='331' cy='362' r='5.4' fill='url%28%23g%29'/%3E%3Ccircle cx='331' cy='362' r='1.8' fill='%23fff6dc' fill-opacity='0.91'/%3E%3Ccircle cx='149' cy='152' r='0.9' fill='%23fff6dc' fill-opacity='0.77'/%3E%3Ccircle cx='152' cy='72' r='1.1' fill='%23fff6dc' fill-opacity='0.75'/%3E%3Ccircle cx='42' cy='228' r='0.9' fill='%23fff6dc' fill-opacity='0.55'/%3E%3Ccircle cx='57' cy='39' r='1.1' fill='%23fff6dc' fill-opacity='0.83'/%3E%3Ccircle cx='27' cy='79' r='1.3' fill='%23fff6dc' fill-opacity='0.62'/%3E%3Ccircle cx='96' cy='132' r='1.1' fill='%23fff6dc' fill-opacity='0.76'/%3E%3Ccircle cx='44' cy='185' r='1.3' fill='%23fff6dc' fill-opacity='0.77'/%3E%3Ccircle cx='119' cy='55' r='5.4' fill='url%28%23g%29'/%3E%3Ccircle cx='119' cy='55' r='1.8' fill='%23fff6dc' fill-opacity='0.70'/%3E%3Ccircle cx='101' cy='315' r='1.1' fill='%23fff6dc' fill-opacity='0.78'/%3E%3Ccircle cx='78' cy='362' r='1.1' fill='%23fff6dc' fill-opacity='0.62'/%3E%3Ccircle cx='206' cy='10' r='1.5' fill='%23fff6dc' fill-opacity='0.68'/%3E%3Ccircle cx='244' cy='35' r='6.6' fill='url%28%23g%29'/%3E%3Ccircle cx='244' cy='35' r='2.2' fill='%23fff6dc' fill-opacity='0.67'/%3E%3Ccircle cx='144.7' cy='76.8' r='8.9' fill='url%28%23g%29'/%3E%3Cpath d='M144.7 66.9L146.3 75.2L154.5 76.8L146.3 78.4L144.7 86.7L143.1 78.4L134.8 76.8L143.1 75.2Z' fill='%23f8dd8e'/%3E%3Ccircle cx='201.1' cy='284.9' r='6.9' fill='url%28%23g%29'/%3E%3Cpath d='M201.1 277.2L202.3 283.7L208.7 284.9L202.3 286.1L201.1 292.5L199.9 286.1L193.4 284.9L199.9 283.7Z' fill='%23f8dd8e'/%3E%3Ccircle cx='95.8' cy='295.9' r='9.8' fill='url%28%23g%29'/%3E%3Cpath d='M95.8 285.0L97.6 294.2L106.8 295.9L97.6 297.7L95.8 306.8L94.1 297.7L84.9 295.9L94.1 294.2Z' fill='%23f8dd8e'/%3E%3C/svg%3E"); background-size: 380px 380px; }
.stars.s2 { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='520'%3E%3Cdefs%3E%3CradialGradient id='g'%3E%3Cstop offset='0' stop-color='%23fff3c8' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%23fff3c8' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='481' cy='493' r='6.6' fill='url%28%23g%29'/%3E%3Ccircle cx='481' cy='493' r='2.2' fill='%23fff6dc' fill-opacity='0.59'/%3E%3Ccircle cx='308' cy='220' r='1.5' fill='%23fff6dc' fill-opacity='0.71'/%3E%3Ccircle cx='377' cy='139' r='0.9' fill='%23fff6dc' fill-opacity='0.65'/%3E%3Ccircle cx='237' cy='13' r='0.9' fill='%23fff6dc' fill-opacity='0.99'/%3E%3Ccircle cx='259' cy='10' r='5.4' fill='url%28%23g%29'/%3E%3Ccircle cx='259' cy='10' r='1.8' fill='%23fff6dc' fill-opacity='0.88'/%3E%3Ccircle cx='187' cy='30' r='6.6' fill='url%28%23g%29'/%3E%3Ccircle cx='187' cy='30' r='2.2' fill='%23fff6dc' fill-opacity='0.57'/%3E%3Ccircle cx='192' cy='89' r='1.1' fill='%23fff6dc' fill-opacity='0.99'/%3E%3Ccircle cx='189' cy='395' r='1.1' fill='%23fff6dc' fill-opacity='0.99'/%3E%3Ccircle cx='146' cy='507' r='1.5' fill='%23fff6dc' fill-opacity='0.59'/%3E%3Ccircle cx='247' cy='373' r='1.5' fill='%23fff6dc' fill-opacity='0.91'/%3E%3Ccircle cx='351' cy='85' r='6.6' fill='url%28%23g%29'/%3E%3Ccircle cx='351' cy='85' r='2.2' fill='%23fff6dc' fill-opacity='0.63'/%3E%3Ccircle cx='168' cy='424' r='1.1' fill='%23fff6dc' fill-opacity='0.81'/%3E%3Ccircle cx='43' cy='222' r='1.5' fill='%23fff6dc' fill-opacity='0.67'/%3E%3Ccircle cx='298' cy='427' r='1.1' fill='%23fff6dc' fill-opacity='0.60'/%3E%3Ccircle cx='468' cy='282' r='6.6' fill='url%28%23g%29'/%3E%3Ccircle cx='468' cy='282' r='2.2' fill='%23fff6dc' fill-opacity='0.75'/%3E%3Ccircle cx='114' cy='78' r='1.5' fill='%23fff6dc' fill-opacity='0.90'/%3E%3Ccircle cx='368' cy='431' r='1.1' fill='%23fff6dc' fill-opacity='0.70'/%3E%3Ccircle cx='74' cy='388' r='0.9' fill='%23fff6dc' fill-opacity='0.98'/%3E%3Ccircle cx='87' cy='507' r='0.9' fill='%23fff6dc' fill-opacity='0.83'/%3E%3Ccircle cx='205' cy='85' r='1.1' fill='%23fff6dc' fill-opacity='0.86'/%3E%3Ccircle cx='506' cy='419' r='0.9' fill='%23fff6dc' fill-opacity='0.79'/%3E%3Ccircle cx='514' cy='389' r='1.1' fill='%23fff6dc' fill-opacity='0.56'/%3E%3Ccircle cx='410' cy='255' r='0.9' fill='%23fff6dc' fill-opacity='0.58'/%3E%3Ccircle cx='242' cy='102' r='1.3' fill='%23fff6dc' fill-opacity='0.98'/%3E%3Ccircle cx='112' cy='54' r='1.5' fill='%23fff6dc' fill-opacity='0.84'/%3E%3Ccircle cx='359' cy='290' r='1.1' fill='%23fff6dc' fill-opacity='0.66'/%3E%3Ccircle cx='222.4' cy='452.4' r='7.4' fill='url%28%23g%29'/%3E%3Cpath d='M222.4 444.2L223.8 451.1L230.7 452.4L223.8 453.7L222.4 460.6L221.1 453.7L214.2 452.4L221.1 451.1Z' fill='%23f8dd8e'/%3E%3Ccircle cx='184.5' cy='448.3' r='9.1' fill='url%28%23g%29'/%3E%3Cpath d='M184.5 438.2L186.1 446.7L194.6 448.3L186.1 449.9L184.5 458.4L182.9 449.9L174.5 448.3L182.9 446.7Z' fill='%23f8dd8e'/%3E%3Ccircle cx='449.7' cy='350.1' r='7.3' fill='url%28%23g%29'/%3E%3Cpath d='M449.7 342.1L451.0 348.8L457.8 350.1L451.0 351.4L449.7 358.2L448.4 351.4L441.6 350.1L448.4 348.8Z' fill='%23f8dd8e'/%3E%3Ccircle cx='352.7' cy='418.3' r='8.3' fill='url%28%23g%29'/%3E%3Cpath d='M352.7 409.1L354.1 416.8L361.8 418.3L354.1 419.8L352.7 427.5L351.2 419.8L343.5 418.3L351.2 416.8Z' fill='%23f8dd8e'/%3E%3C/svg%3E"); background-size: 520px 520px; background-position: 130px 70px; animation: twinkle 5s ease-in-out infinite alternate; }

.stars { opacity: .5; -webkit-mask-image: radial-gradient(60% 55% at 50% 50%, rgba(0,0,0,.25), #000 85%); mask-image: radial-gradient(60% 55% at 50% 50%, rgba(0,0,0,.25), #000 85%); }
.stars.s1 { background-position: 40px 210px; }
@keyframes twinkle { from { opacity: .55; } to { opacity: .2; } }
body:has(#s-card.on) .stars { opacity: .3; animation: none; }

/* ---------- screens ---------- */
#app { position: relative; z-index: 1; height: 100%; }
.screen { position: fixed; inset: 0; display: none; padding: calc(22px + var(--st)) calc(22px + var(--sr)) calc(22px + var(--sb)) calc(22px + var(--sl));
  overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.on { display: flex; animation: fadein .45s ease both; }
@keyframes fadein { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
.center { margin: auto; width: 100%; max-width: 460px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }

.neon { font: 400 clamp(32px, 9.6vw, 56px)/1.08 "Limelight", var(--sans); margin: 4px 0 6px; letter-spacing: .02em; color: var(--lemon); overflow-wrap: anywhere;
  text-shadow: 2px 2px 0 var(--blue), 4px 4px 0 var(--shade), 0 0 22px rgba(246, 209, 46, .35); }
.neon.small { font-size: clamp(30px, 9vw, 46px); }
.neon-sub { font: 700 clamp(22px, 6vw, 28px)/1.22 var(--sans); margin: 0; color: var(--blue-d); }
.script { font: 400 clamp(28px, 8.4vw, 38px)/1 "Yesteryear", cursive; margin: 0; color: #ff5a48; text-shadow: 0 0 14px rgba(209, 40, 31, .45); }
.lede { margin: 0; color: var(--soft); font-size: 18px; }
.closed-only { display: none; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; margin-top: 10px; }
.big { min-height: 62px; width: 100%; border-radius: 12px; border: 2.5px solid var(--line); background: var(--card); color: var(--ink);
  font: 700 19px/1.1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 4px 18px 0;
  box-shadow: 4px 4px 0 var(--shade); transition: transform .12s ease, box-shadow .12s ease, opacity .15s ease; }
.big:active { transform: translate3d(3px, 3px, 0); box-shadow: 1px 1px 0 var(--shade); }
.big:disabled { opacity: .55; }
.big.pink { background: var(--scarlet); color: #fffaf0; }
.big.cyan { background: var(--blue); color: #fffaf0; }
.big.gold { background: var(--lemon); color: var(--dark); }
.choice .big { min-height: 96px; font-size: 22px; }
.link { background: none; border: 0; color: var(--blue-t); font: 700 15px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: 12px; }

input, textarea, select { width: 100%; font-size: 18px; padding: 14px 16px; border-radius: 10px; border: 2px solid var(--line);
  background: #0e1026; color: var(--ink); outline: none; box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .35); }
input:focus, textarea:focus, select:focus { border-color: var(--lemon); box-shadow: 0 0 0 3px rgba(246, 209, 46, .25); }
textarea { resize: none; line-height: 1.35; }
select { -webkit-appearance: none; appearance: none; padding: 14px 8px; text-align: center; text-align-last: center; }
::placeholder { color: #7f7660; }
select option { background: #161a33; color: var(--ink); }
.err { min-height: 1.3em; margin: 0; color: #ff6b5a; font-size: 16px; font-weight: 700; }

/* ---------- pop-ups (same look for everyone): a cream card with a blue frame line ---------- */
.pop { background: rgba(3, 4, 12, .6); }
.popup { margin: auto; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 14px; text-align: center;
  padding: 26px 22px 24px; border-radius: 18px; border: 2.5px solid var(--line); background: var(--card);
  box-shadow: inset 0 0 0 6px var(--card), inset 0 0 0 7.5px rgba(216, 180, 92, .45), 6px 6px 0 var(--shade), 0 0 40px rgba(60, 80, 200, .25); }
.fld { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.fld > span { font: 700 15px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--blue-t); }
#t-q { font: italic 400 clamp(21px, 5.6vw, 25px)/1.35 var(--serif); letter-spacing: 0; text-transform: none; color: #3a2410; overflow-wrap: anywhere; text-align: center; margin: 2px 0 6px; }

/* ---------- the paper (specials: birthday + question), burnt into the Universe ---------- */
.burnwrap { margin: auto; width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.burnwrap > .script, .burnwrap > .err, .burnwrap > .big { transition: opacity .6s ease; }
#s-extra.burning .burnwrap > .script, #s-extra.burning .burnwrap > .err, #s-extra.burning .burnwrap > .big { opacity: 0; }
.sheet-sh { width: 100%; filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .65)) drop-shadow(0 0 30px rgba(255, 170, 80, .14)); transform: rotate(-.7deg); }
#s-extra.burning .sheet-sh { filter: none; }
.sheet { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 30px 24px 28px; color: #2b1d0e;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .22 0 0 0 0 .08 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(40% 30% at 82% 88%, rgba(150, 95, 35, .18), transparent 70%),
    radial-gradient(35% 25% at 12% 14%, rgba(150, 95, 35, .14), transparent 70%),
    radial-gradient(120% 95% at 50% 42%, #f6ecd2 0%, #ecdcb2 58%, #d2b47c 100%); }
.sheet .fld > span { color: #7a5426; }
.sheet input, .sheet select, .sheet textarea { background: transparent; border: 0; border-bottom: 2px solid rgba(70, 45, 15, .5); border-radius: 0;
  box-shadow: none; color: #2b1d0e; }
.sheet select { padding: 10px 4px; }
.sheet input:focus, .sheet select:focus, .sheet textarea:focus { border-color: #c0561c; box-shadow: none; }
.sheet textarea { border: 0; padding: 0 4px; line-height: 34px; height: 103px; background-attachment: local;
  background-image: repeating-linear-gradient(transparent 0 33px, rgba(70, 45, 15, .34) 33px 34px); }
.sheet ::placeholder { color: rgba(70, 45, 15, .45); }
.big.fire { position: relative; font-size: 17px; line-height: 1.2; background: linear-gradient(180deg, #ffb347, #ff5e1a 55%, #c2185b); color: #fff8ec;
  border-color: #ffd27a; text-shadow: 0 1px 0 rgba(0, 0, 0, .35); box-shadow: 4px 4px 0 var(--shade), 0 0 22px rgba(255, 110, 40, .45); }
.big.fire::after { content: ""; position: absolute; inset: -3px; border-radius: 14px; pointer-events: none; box-shadow: 0 0 34px rgba(255, 140, 50, .7);
  animation: flick 1.6s ease-in-out infinite alternate; }
@keyframes flick { 0% { opacity: .25; } 40% { opacity: .8; } 55% { opacity: .45; } 100% { opacity: 1; } }
#burn { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: none; transition: opacity .8s ease; --bw: min(40vw, 24vh, 190px); }
#burn.on { display: block; }
#burn.fade { opacity: 0; }
#burn canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#burn .bt { position: absolute; left: 0; right: 0; margin: 0 auto; max-width: 540px; padding: 0 28px; text-align: center;
  font: italic 400 clamp(20px, 5.4vw, 25px)/1.38 var(--serif); color: #ffe9bf; text-shadow: 0 0 18px rgba(255, 150, 60, .55), 0 2px 4px #000;
  opacity: 0; transition: opacity .8s ease; }
#burn .bt.on { opacity: 1; }
#bt1 { top: calc(7vh + var(--st)); }
#bt2 { bottom: calc(9vh + var(--sb)); }
#burn .bcard { position: absolute; left: 50%; top: 50%; width: var(--bw); height: calc(var(--bw) * var(--car));
  margin: calc(var(--bw) * var(--car) * -.5) 0 0 calc(var(--bw) * -.5); border-radius: calc(var(--bw) * .06); opacity: 0; transform: scale(.8);
  transition: opacity 1.1s ease, transform 1.5s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 40px rgba(255, 205, 130, .5), 0 0 90px rgba(190, 120, 255, .3); }
#burn .bcard.on { opacity: 1; transform: none; }
#burn .bcard img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.dob { display: grid; grid-template-columns: 1fr 1.6fr 1.2fr; gap: 8px; }
.hide { display: none !important; }
.cat-q, .ready-q { font-size: clamp(20px, 5.4vw, 24px); }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
.cats button { min-height: 72px; border-radius: 12px; border: 2.5px solid var(--line); background: var(--blue); color: #fffaf0;
  font: 700 17px/1.15 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 12px 8px 8px; overflow-wrap: anywhere;
  box-shadow: 4px 4px 0 var(--shade); transition: transform .12s ease, box-shadow .12s ease; }
.cats button:nth-child(4n+1) { background: var(--scarlet); }
.cats button:nth-child(4n+3) { background: var(--green); }
.cats button:nth-child(4n+4) { background: var(--lemon); color: var(--dark); }
.cats button:active, .cats button.picked { transform: translate3d(3px, 3px, 0); box-shadow: 1px 1px 0 var(--shade), inset 0 0 0 3px var(--card); }
.cats button:disabled { opacity: .55; }

/* ---------- the table: shuffle + spread ---------- */
#s-stage { padding: 0; overflow: hidden; }
.whisper { position: absolute; left: 0; right: 0; top: calc(6vh + var(--st)); margin: 0 auto; padding: 0 28px; max-width: 560px; text-align: center;
  font: italic 400 clamp(20px, 5.4vw, 25px)/1.35 var(--serif); color: var(--blue-d); min-height: 3em; transition: opacity .6s ease; z-index: 2; }
.whisper.out { opacity: 0; }
.table { position: absolute; inset: 0; perspective: 1200px; }
.tc, .tf { position: absolute; left: 50%; top: 50%; width: var(--cw); height: calc(var(--cw) * var(--car)); margin: calc(var(--cw) * var(--car) * -.5) 0 0 calc(var(--cw) * -.5);
  border-radius: calc(var(--cw) * .06); will-change: transform, opacity; transform-style: preserve-3d; }
.tc img, .tf img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; pointer-events: none; }
.tc::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; transition: box-shadow .35s ease;
  box-shadow: inset 0 0 0 1px rgba(27, 22, 17, .7), 0 1px 1px rgba(0, 0, 0, .6), 0 3px 8px rgba(0, 0, 0, .5); }
/* while shuffling: no outer shadows, just a paper-edge ring, so the stacked edges read as one thick deck */
.tf::after, .table.shuf .tc::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; transition: none;
  box-shadow: inset 0 0 0 1px var(--edge, rgba(230, 214, 180, .55)), inset 0 -1px 0 1px rgba(27, 22, 17, .35); }
.tf { pointer-events: none; }
.table.pick .tc { cursor: pointer; }
.table.pick .tc::after { box-shadow: inset 0 0 0 1px rgba(27, 22, 17, .75), 0 1px 1px rgba(0, 0, 0, .6), 0 4px 10px rgba(0, 0, 0, .55); }
.tc.pulled::after { box-shadow: inset 0 0 0 1.5px var(--shade), 0 10px 20px rgba(0, 0, 0, .55), 0 24px 44px rgba(0, 0, 0, .45), 0 0 30px rgba(246, 209, 46, .18); }
.hold-q { position: absolute; left: 0; right: 0; bottom: calc(24px + var(--sb)); margin: 0 auto; padding: 0 30px; max-width: 520px; text-align: center;
  font: italic 400 clamp(15px, 4.2vw, 18px)/1.4 var(--serif); color: var(--ink); z-index: 2; pointer-events: none;
  opacity: 0; transition: opacity 1s ease; }
.hold-q.on { opacity: 1; }
.table { --cw: min(22vw, 112px); }

/* ---------- the reveal: borderless face, ink outline, deck-style blue title bar ---------- */
#s-card { padding: 0; overflow: hidden; }
.reveal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: calc(24px + var(--st)) calc(24px + var(--sr)) calc(24px + var(--sb)) calc(24px + var(--sl)); }
.big-card { position: relative; height: min(64vh, 150vw); aspect-ratio: 1 / var(--car); max-width: 88vw; border-radius: 4% / calc(4% / var(--car));
  background: var(--card); box-shadow: 0 0 0 2.5px var(--line), 7px 7px 0 2.5px var(--shade), 0 0 40px rgba(246, 209, 46, .12); }
.reveal.in > .big-card { animation: inkin .5s ease-out both; }
@keyframes inkin { from { box-shadow: 0 0 0 0 var(--shade), 0 0 0 0 var(--shade); } }
.big-card img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; pointer-events: none; -webkit-user-drag: none; }
.card-title { margin: 4px 0 0; max-width: 92vw; padding: 9px 20px 5px; text-align: center; font: 700 clamp(20px, 6vw, 28px)/1.15 var(--sans);
  letter-spacing: .07em; text-transform: uppercase; color: #fffaf0; background: var(--blue); border: 2.5px solid var(--line); border-radius: 6px;
  box-shadow: 4px 4px 0 var(--shade); overflow-wrap: anywhere; }
.card-title:empty { visibility: hidden; }
.of { font-size: .62em; font-weight: 700; letter-spacing: .02em; text-transform: none; }
.reveal .big { max-width: 420px; min-height: 56px; font-size: 16px; }
.reveal > .card-title, .reveal > .big { opacity: 0; }
.reveal.in > .card-title, .reveal.in > .big { animation: fadein .6s ease both; animation-delay: .15s; }
.reveal.in > .big { animation-delay: .55s; }
.screen.on.still { animation: none; }
.reveal > .big.gone { visibility: hidden; }
.screen.measure { display: flex; visibility: hidden; }

.meaning { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 620px; max-height: 70vh; overflow-y: auto;
  padding: 22px 22px calc(26px + var(--sb)); border-radius: 18px 18px 0 0; z-index: 5;
  border: 2.5px solid var(--line); border-bottom: 0; background: var(--card);
  box-shadow: inset 0 0 0 6px var(--card), inset 0 0 0 7.5px rgba(216, 180, 92, .45), 0 -8px 30px rgba(0, 0, 0, .5);
  transform: translate3d(0, 110%, 0); opacity: 0; transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .4s ease; }
.meaning.open { transform: none; opacity: 1; }
.meaning h3 { margin: 4px 52px 14px; padding: 8px 14px 4px; text-align: center; font: 700 20px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase;
  color: #fffaf0; background: var(--blue); border: 2px solid var(--line); border-radius: 6px; }
.meaning p { white-space: pre-line; overflow-wrap: anywhere; margin: 0; font-size: 19px; line-height: 1.6; color: var(--ink); -webkit-user-select: text; user-select: text; }
.m-min { position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--line);
  background: var(--lemon); color: var(--dark); font: 700 26px/1 var(--sans); box-shadow: 2px 2px 0 var(--shade); }
.m-tab { position: absolute; left: 50%; bottom: calc(18px + var(--sb)); z-index: 4; min-height: 50px; padding: 4px 22px 0; border-radius: 26px;
  border: 2.5px solid var(--line); background: var(--blue); color: #fffaf0; font: 700 15px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--shade); transform: translate3d(-50%, 0, 0); display: none; white-space: nowrap; }
.m-tab.on { display: block; }

/* ---------- secret corner, top-right (hold 3 s) + faint info inside the card ---------- */
.corner { position: fixed; top: calc(var(--st) + 10px); right: calc(var(--sr) + 4px); width: 64px; height: 64px; z-index: 20; display: none;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.corner.on { display: block; }
body[data-phase="meaning"] .corner { display: none; }
.peek { position: absolute; inset: 0; z-index: 2; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 18% 12%; text-align: center; pointer-events: none; opacity: .82; color: #ffffff;
  text-shadow: 0 0 2px #000, 0 2px 3px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .8); overflow-wrap: anywhere; }
.peek.on { display: flex; }
/* Text 3x the old 15/14/13 px (same opacity). --pk shrinks it only if a very long question would not fit the card. */
.peek { --pk: 1; padding: 10% 7%; gap: 10px; overflow: hidden; }
.peek .pn { font: 700 calc(42px * var(--pk))/1.15 var(--sans); letter-spacing: .03em; }
.peek .pq { font: 700 calc(40px * var(--pk))/1.18 var(--sans); }
.peek .pd { font: 700 calc(37px * var(--pk))/1.2 var(--sans); }
/* second hold zone: the top-right corner of the card itself */
.ccorner { position: absolute; top: 0; right: 0; width: 30%; height: 20%; z-index: 3; display: none; border-top-right-radius: inherit;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body:has(#corner.on) .ccorner { display: block; }
body[data-phase="meaning"] .ccorner { display: none; }

/* ---------- fan spread ---------- */
.table.pick { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* ---------- closed page ---------- */
html.closed .screen { display: none !important; }
html.closed #s-closed { display: flex !important; }

@media (orientation: landscape) and (max-height: 520px) {
  .big-card { height: 62vh; }
  .reveal { flex-direction: row; flex-wrap: wrap; align-content: center; gap: 10px 24px; }
  .reveal .card-title { flex-basis: auto; }
  .whisper { top: calc(3vh + var(--st)); font-size: 19px; }
  .table { --cw: 15vh; }
  .choice .big { min-height: 70px; }
  }

/* ---------- front page ---------- */
.landing { gap: 10px; }
.tagline { margin: 0; padding: 7px 16px 3px; font: 700 14px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #fffaf0;
  background: var(--blue); border: 2px solid var(--line); border-radius: 5px; box-shadow: 3px 3px 0 var(--shade); white-space: nowrap; }
.deck { position: relative; height: clamp(120px, 27vh, 230px); aspect-ratio: 1 / var(--car); margin: 14px 0 8px; }
.deck img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 6% / calc(6% / var(--car)); display: block; pointer-events: none;
  box-shadow: 0 0 0 2px var(--line), 4px 5px 0 2px rgba(0, 0, 0, .85); }
.deck img:nth-of-type(1) { transform: rotate(-9deg) translate3d(-16%, 3%, 0); }
.deck img:nth-of-type(2) { transform: rotate(8deg) translate3d(16%, 3%, 0); }
.deck img:nth-of-type(3) { transform: translate3d(0, 0, 0); animation: hover 4.5s ease-in-out infinite alternate; }
@keyframes hover { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -7px, 0); } }
/* lemon sunburst behind the deck, turning slowly */
.deck-glow { position: absolute; left: 50%; top: 50%; width: 330%; aspect-ratio: 1; margin: -165% 0 0 -165%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--sky) 0deg 7.5deg, transparent 7.5deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 100%); mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
  will-change: transform; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.headline { font-size: clamp(27px, 8vw, 44px); line-height: 1.1; margin: 4px 0 2px; }
.landing .lede { font-size: clamp(16px, 4.6vw, 19px); line-height: 1.4; max-width: 400px; }
.fine { margin: 0; font: 700 13px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #74c96e; }
.tiny { margin: 0; font-size: 14px; color: var(--soft); font-style: italic; }
#b-reveal { white-space: nowrap; font-size: clamp(18px, 5.4vw, 22px); letter-spacing: .08em; margin-top: 6px; max-width: 360px; min-height: 64px; }
.pulse { position: relative; }
.pulse::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 2.5px solid rgba(209, 40, 31, .6);
  pointer-events: none; will-change: transform, opacity; animation: ring 2.2s ease-out infinite; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.1, 1.35); opacity: 0; } }
@media (max-height: 600px) {
  .big-card { height: min(54vh, 150vw); }
  .reveal { gap: 10px; }
  .deck { height: clamp(90px, 22vh, 160px); margin: 6px 0 4px; }
  .landing { gap: 7px; }
  .landing .tiny { display: none; }
  }
@media (orientation: landscape) and (max-height: 520px) {
  .landing { max-width: 640px; }
  .deck { height: 26vh; }
  .headline { font-size: clamp(24px, 6vh, 36px); }
}
@media (prefers-reduced-motion: reduce) { .deck-glow, .pulse::after, .deck img { animation: none !important; } }

/* Backstage test spectator only (never shown to real guests) */
.test-tag { position: fixed; top: calc(var(--st) + 8px); left: calc(var(--sl, 0px) + 8px); z-index: 30; padding: 2px 6px; border-radius: 6px;
  font: 700 10px/1.3 system-ui, sans-serif; letter-spacing: .12em; color: rgba(243, 230, 198, .7); background: rgba(22, 26, 51, .8);
  border: 1px solid rgba(243, 230, 198, .3); pointer-events: none; }
.test-tag[hidden] { display: none; }

/* "Daily limit reached" pop-up after a special guest sends their question (the question IS saved). */
#limit { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 22px;
  background: rgba(4,4,12,.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: limIn .25s ease; }
#limit[hidden] { display: none; }
#limit .lim-box { width: 100%; max-width: 380px; background: #15151f; color: #eee; border: 1px solid rgba(255,255,255,.14); border-radius: 16px;
  padding: 26px 22px 22px; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.6); font-family: var(--sans); }
#limit .lim-ic { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; background: #d93025; color: #fff;
  font: 800 28px/46px var(--sans); }
#limit h3 { margin: 0 0 10px; font: 700 21px/1.25 var(--sans); color: #fff; }
#limit p { margin: 0 0 12px; font-size: 16px; line-height: 1.45; color: #cfcfd8; }
#limit .lim-skip { color: #fff; font-weight: 600; margin-bottom: 18px; }
#limit .big { min-height: 58px; font-size: 17px; line-height: 1.25; padding: 10px 14px; }
@keyframes limIn { from { opacity: 0; } to { opacity: 1; } }

/* Fake "not accepted" state: fields go red like a declined card form, text is wiped, inline error shows. */
#f-extra .fld.bad > span { color: #ff5a4f; }
#f-extra .fld.bad > span::after { content: "!"; display: inline-block; width: 18px; height: 18px; margin-left: 8px; border-radius: 50%;
  background: #d93025; color: #fff; font: 800 13px/18px var(--sans); text-align: center; letter-spacing: 0; vertical-align: 1px; }
#f-extra .fld.bad select { border-color: #ff4433; color: #ff5a4f; box-shadow: 0 0 0 1px #ff4433; }
#f-extra .fld.bad textarea { color: #ff5a4f; border-color: #ff4433; box-shadow: 0 0 0 2px #ff4433; }
#sheet.locked { pointer-events: none; }
#sheet.shake { animation: shakeX .45s ease; }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
#e-extra.limit { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 10px;
  background: rgba(217,48,37,.14); border: 1px solid rgba(255,107,90,.55); font-weight: 600; line-height: 1.4; }
#e-extra.limit b { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #d93025; color: #fff; font: 800 15px/22px var(--sans); text-align: center; }
.skipline { margin: 4px 0 0; color: #fff; font: 600 16px/1.4 var(--sans); }
#b-skip { min-height: 58px; font-size: 17px; line-height: 1.25; padding: 10px 14px; }
