/* ===================== DailyD — simple header, sheets, and the roomy phone layout =====================
   Loaded after themes.css + features.css. Phone rules (<=480px) use !important on purpose: each decade theme styles the
   same elements with high-specificity selectors, and the phone layout must win in all 8 themes. Colours still come from
   each theme's variables (--edge, --form-bg, --form-ink, --accent, --field-bg ...), so every decade keeps its look. */

/* ---------- header: logo block (DailyD + tagline) · How to play · Stats · Settings (phones: one menu button) ---------- */
header.top .logo .logo-mark{white-space:nowrap}
header.top .logo .logo-mark .lm2{margin-left:.02em}
header.top .logo small.tagline{display:block !important;text-transform:none !important;font-variant:normal !important;letter-spacing:.01em !important;
  font-family:var(--font-body) !important;font-weight:600 !important;font-style:normal !important;font-size:.74rem !important;line-height:1.2 !important;margin-top:4px;opacity:.9;white-space:nowrap}
.top-nav{display:flex;align-items:center;gap:4px;flex:none}
.top-nav .menu-btn{display:none}
.top-nav .nav-lab{display:none}
@media (min-width:1000px){
  .top-nav{gap:8px}
  .top-nav .nav-btn{width:auto !important;height:40px;padding:0 14px 0 10px;border-radius:999px;gap:7px;display:inline-flex;align-items:center;border:1.5px solid color-mix(in srgb,currentColor 35%,transparent)}
  .top-nav .nav-lab{display:inline;font:700 .9rem/1 var(--font-body);white-space:nowrap}
  header.top .logo .logo-mark{font-size:calc(var(--logo-size,1.45rem) * 1.25)}
}

/* ---------- sheets: Stats tabs, Settings / Menu lists, result image ---------- */
.sheet-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;margin:0 0 14px;overflow:hidden;width:100%;box-sizing:border-box}
.sheet-tabs button{min-width:0;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;padding:6px 4px;border-radius:999px;border:2px solid var(--edge,#111);background:var(--form-bg,#fff);color:var(--form-ink,#111);font:700 .76rem/1.1 var(--font-body);cursor:pointer;white-space:nowrap;text-align:center}
.sheet-tabs button[aria-selected="true"]{background:var(--accent);color:#fff;border-color:var(--edge,#111)}
.sheet-list{list-style:none;margin:0;padding:0}
.sheet-list li{border-bottom:1px solid var(--line,#ddd)}
.sheet-list button,.sheet-list a{all:unset;box-sizing:border-box;width:100%;min-height:52px;display:grid;grid-template-columns:30px minmax(0,1fr);grid-template-areas:"icon title" "icon sub";align-items:start;column-gap:10px;row-gap:2px;padding:10px 4px;cursor:pointer;color:inherit}
.sheet-list button > span[aria-hidden],.sheet-list a > span[aria-hidden]{grid-area:icon;align-self:start;padding-top:2px}
.sheet-list b{grid-area:title;font-weight:700;min-width:0;white-space:normal}
.sheet-list small{grid-area:sub;font-size:.8rem;opacity:.72;text-align:left;justify-self:start;max-width:100%}
@media (min-width:1000px){
  .sheet-list button,.sheet-list a{grid-template-columns:30px max-content minmax(0,1fr);grid-template-areas:"icon title sub";align-items:center}
  .sheet-list small{text-align:right;justify-self:end}
}
.sheet-list button:focus-visible,.sheet-list a:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:8px}
.card-prev{margin:6px 0 10px;text-align:center}
.card-prev img{width:100%;max-width:340px;height:auto;border-radius:12px;border:2px solid var(--edge,#111);box-shadow:var(--edge-shadow)}
#cardAct{margin:0 0 16px}
#cardAct .btn{text-decoration:none;flex:1 1 auto}

/* ---------- reveal tiles + step UI: phone only ---------- */
.photo-dots .tx,.step-lbl,.step-chips,.step-mult,.step-bar,.field .lab-q{display:none}
.field .lab-std{display:inline}

@media (max-width:480px){
  body.has-stepbar{--bar-h:calc(84px + env(safe-area-inset-bottom))}
  #game.wrap{padding:0 0 8px !important;max-width:none !important}
  /* a fixed cushion under the question (never changes while typing/advancing): iOS has room to lift the box above the
     keyboard by itself, and a few px of height change between steps can't clamp the scroll position */
  #game.wrap:has(#guessForm){padding-bottom:128px !important}
  /* room under the footer so the pinned bar never covers the photo credit */
  body.has-stepbar footer.foot{margin-bottom:calc(var(--bar-h,0px) + 16px) !important}
  /* slim header: logo block + menu */
  #game header.top{margin:0 !important;padding-top:8px !important;padding-left:14px !important;padding-right:10px !important;min-height:58px !important;border-radius:0 !important;box-sizing:border-box;gap:6px !important}
  #game header.top .logo{overflow:visible !important;min-width:0}
  #game header.top .logo svg{width:30px;height:30px}
  #game header.top .logo-mark{font-size:1.5rem !important}
  #game header.top .logo small.tagline{font-size:11.5px !important;margin-top:3px}
  .top-nav .nav-btn{display:none !important}
  .top-nav .menu-btn{display:grid !important;place-items:center;width:44px !important;height:44px !important}
  .top-nav .menu-btn svg{width:24px;height:24px}
  /* notices (first-visit how-to, Saturday teaser, streak save, Monday recap) keep side margins */
  .notices{margin:10px 12px 0 !important}
  .notices > *{margin-top:0 !important}
  .notices:not(:has(> :not([hidden]))){display:none !important}
  .era-strip,.reveal-bar,.reveal-done,#game > .install-hint{display:none !important}
  #game > .install-hint:not([hidden]){display:flex !important;margin:10px 12px 0 !important}
  #main{padding:0 !important;margin:0 !important}
  .puzzle-grid{display:block !important;gap:0 !important}
  .stage{position:static !important;margin:0 !important;padding:0 !important;background:none !important;border:0 !important;box-shadow:none !important;border-radius:0 !important}
  /* no puzzle number / date on phones: only a Trim Sunday or Archive pill if there is one */
  .daybar{display:none !important}
  .daybar:has(.badge-tt,.archive-pill,.preview-pill){display:flex !important;justify-content:center !important;gap:6px;margin:8px 12px 0 !important;padding:0 !important;background:none !important;border:0 !important;box-shadow:none !important}
  .daybar:has(.badge-tt,.archive-pill,.preview-pill) > span:last-child,.daybar b,.daybar .mode-pill{display:none !important}
  /* first-visit how-to: one compact strip so the photo and the first question still fit */
  .intro{margin:8px 12px 0 !important;padding:7px 10px !important;font-size:.8rem !important;line-height:1.3 !important;gap:4px 10px !important;flex-wrap:nowrap !important}
  .intro .intro-x{display:none}
  .intro-tx{flex:1 1 auto !important}
  .intro-act{flex-direction:column;gap:2px !important;margin-left:0 !important}
  .intro .intro-ok{min-height:32px !important;padding:0 12px !important;font-size:.82rem !important}
  .intro .link-btn{font-size:.74rem;white-space:nowrap}
  #dayNote{margin:8px 12px 0 !important;font-size:.85rem !important;padding:6px 10px !important}
  /* photo edge to edge, solid outline top and bottom */
  .stage .viewer{width:100vw !important;max-width:none !important;max-height:none !important;aspect-ratio:4/3 !important;margin:0 !important;border-radius:0 !important;
    border-left:0 !important;border-right:0 !important;border-top:3px solid var(--edge,#111) !important;border-bottom:3px solid var(--edge,#111) !important;box-shadow:none !important;outline:0 !important}
  .zoom-ctl{right:8px !important;bottom:8px !important;gap:6px !important}
  .zoom-ctl button{width:36px !important;height:36px !important;min-height:36px !important;font-size:16px !important;opacity:.85}
  .stage .photo-credit{display:none !important}
  /* three reveal tiles under the photo: 60px tap targets with their points multiplier */
  .stage .photo-dots{display:flex !important;gap:10px !important;justify-content:stretch !important;margin:0 !important;padding:12px 14px 4px !important}
  .stage .photo-dots button{flex:1 1 0 !important;width:auto !important;min-width:0 !important;height:60px !important;min-height:60px !important;opacity:1 !important;margin:0 !important;position:relative;
    display:flex !important;align-items:center !important;gap:6px !important;padding:4px 6px 4px 4px !important;box-sizing:border-box !important;border-radius:14px !important;
    border:2px solid var(--edge,#111) !important;background:var(--field-bg,#fff) !important;color:var(--field-ink,#111) !important;box-shadow:none !important;outline:0 !important;overflow:hidden;filter:none !important;transform:none !important}
  .stage .photo-dots button img{flex:0 0 36px !important;width:36px !important;height:48px !important;border-radius:10px !important;object-fit:cover;position:static !important}
  .stage .photo-dots button.locked > .lk{flex:0 0 36px;width:36px;height:48px;border-radius:10px;display:grid;place-items:center;font-size:20px;
    background:repeating-linear-gradient(135deg,rgba(0,0,0,.07) 0 6px,rgba(0,0,0,.15) 6px 12px)}
  .stage .photo-dots button[aria-pressed="true"]{border-color:var(--accent) !important;box-shadow:inset 0 0 0 1px var(--accent) !important}
  .stage .photo-dots button::before,.stage .photo-dots button::after{display:none !important}
  .photo-dots .tx{flex:1 1 auto;min-width:0;align-self:stretch;display:flex !important;flex-direction:column;justify-content:center;align-items:flex-start;text-align:left;margin:0;padding:0}
  .photo-dots .tx b{display:flex;align-items:baseline;gap:3px;margin:0;font:800 15px/18px var(--font-body);letter-spacing:-.2px;white-space:nowrap;color:inherit}
  .photo-dots .tx b i{font-style:normal;font-weight:700;font-size:12px;line-height:18px;letter-spacing:0}
  .photo-dots .tx b.spent{text-decoration:line-through;text-decoration-thickness:2px;opacity:.55}
  .photo-dots .tx small{display:block;margin:2px 0 0 -.5px;font:600 12px/14px var(--font-body);opacity:.75;white-space:nowrap;color:inherit}
  .stage .photo-dots button[aria-pressed="true"] .tx small{display:none}
  .stage .photo-dots button.locked .tx{opacity:.8}
  .photo-dots.done .tx b{display:none}
  .stage .photo-dots.done button[aria-pressed="true"] .tx small{display:block}
  /* tapping a locked tile shows the usual Reveal / Keep confirm right under the tiles */
  .reveal-bar:has(.reveal-confirm),.reveal-bar:has(.err){display:block !important;margin:8px 14px 0 !important}
  /* credit lives in the footer only: small, muted, legible */
  footer.foot{margin:24px 12px 0 !important;padding:12px 14px !important;font-size:12px !important;background:var(--form-bg,var(--card,#fff)) !important;color:color-mix(in srgb,var(--form-ink,var(--ink)) 75%,transparent) !important}
  footer.foot a{color:inherit !important}
  footer.foot .foot-links a,footer.foot .foot-links button{display:inline-block;min-height:44px;padding:12px 8px;line-height:1.2;box-sizing:border-box;vertical-align:middle}
  html[data-theme="1980s"] footer.foot{background:#1d1046 !important;color:color-mix(in srgb,#f3e9ff 78%,transparent) !important}
  html[data-theme="1980s"] footer.foot .foot-credit{color:color-mix(in srgb,#f3e9ff 78%,transparent) !important}
  footer.foot .foot-credit{display:block !important;font-size:12px !important;line-height:1.45 !important;margin:0 0 8px !important;color:color-mix(in srgb,var(--form-ink,var(--ink)) 70%,transparent) !important}
  footer.foot .foot-credit:empty{display:none !important}
  footer.foot .foot-credit a{color:inherit !important;text-decoration:underline;text-underline-offset:2px}
  /* form: one large field at a time */
  #play{margin:0 !important;padding:0 !important;background:transparent !important}
  form.guess{position:relative !important;margin:14px 12px 0 !important;padding:16px 18px 22px !important;border:var(--edge-w,2px) solid var(--edge,#111) !important;box-shadow:var(--edge-shadow) !important;border-radius:22px !important;
    background:var(--form-bg,#fff) !important;color:var(--form-ink,var(--ink)) !important;display:block !important}
  form.guess .field{display:none !important;margin:0 !important;padding:0 !important}
  form.guess .field.step-on{display:block !important}
  form.guess .field label{display:block !important;font-size:22px !important;line-height:1.2 !important;margin:0 0 14px !important;padding:0 !important;
    background:none !important;color:var(--form-ink,var(--ink)) !important;border:0 !important;box-shadow:none !important;transform:none !important;text-transform:none !important;letter-spacing:0 !important}
  form.guess .field .lab-std{display:none}
  /* 1980s: on phones the single big field sits straight on the dark panel (no sticky note behind the question) */
  [data-theme="1980s"] form.guess .field{background:none !important;border:0 !important;box-shadow:none !important;transform:none !important}
  [data-theme="1980s"] form.guess .field::before,[data-theme="1980s"] form.guess .field::after{display:none !important}
  form.guess .field .lab-q{display:inline}
  form.guess .field input{height:60px !important;min-height:60px !important;font-size:20px !important;padding:0 48px 0 16px !important}
  form.guess .field .toggle{width:44px !important;height:44px !important;top:8px !important;right:6px !important}
  form.guess, #play, #main, #game.wrap{overflow:visible !important}
  form.guess .listbox{max-height:var(--list-max,236px) !important;font-size:17px;z-index:30;contain:none;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;touch-action:pan-y}
  form.guess .submit-row{display:none !important}
  /* Step X of Y removed Nov 10, 2026. Card top padding is compact (16px) so the heading ink sits where the 22px corner finishes curving
     so "Which make?" sits near the top. Answered-field chips share the heading row on the right,
     sized to that row, so they do not add a blank reserve on step 1 or shove the field down. */
  .step-lbl{position:absolute !important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  .step-head{display:flex !important;align-items:center;justify-content:flex-end;gap:8px;position:absolute !important;z-index:40;top:16px;right:18px;left:auto;box-sizing:border-box;width:auto;max-width:58%;min-height:36px;height:auto;margin:0 !important}
  .step-head:not(:has(button)){display:none !important}
  form.guess:has(.step-head button) .field.step-on label{max-width:50%;box-sizing:border-box}
  .step-chips{display:flex !important;flex:1 1 auto;min-width:0;flex-wrap:nowrap;gap:6px;margin:0;min-height:36px;overflow-x:hidden;overflow-y:hidden;justify-content:flex-end;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .step-chips::-webkit-scrollbar{display:none}
  .step-chips button{flex:0 0 auto}
  .step-chips button{min-height:36px;padding:0 8px;border-radius:999px;border:2px solid var(--edge,#111);background:var(--field-bg,#fff);color:var(--field-ink,#111);font:700 13px/1 var(--font-body);cursor:pointer;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .step-chips button span{color:#1e8e3e;margin-left:5px}
  .step-mult{display:block;font:500 15px/1.4 var(--font-body);opacity:.85;margin:14px 0 0}
  .step-mult b{font-weight:800}
  .step-miss{font-weight:700;color:var(--red,#c0392b)}
  /* pinned Next / Submit bar, clear of the iPhone home bar; lifted above the keyboard by app.js (visualViewport) */
  .step-bar{position:fixed;left:0;right:0;bottom:0;z-index:40;box-sizing:border-box;padding:12px 14px max(14px, env(safe-area-inset-bottom));
    background:var(--form-bg,#fff);color:var(--form-ink,var(--ink));border-top:2px solid var(--edge,#111);display:flex !important;gap:10px;box-shadow:0 -6px 20px rgba(0,0,0,.12);
    -webkit-backdrop-filter:blur(16px) saturate(1.4);backdrop-filter:blur(16px) saturate(1.4);transition:transform .12s ease-out}
  .step-bar.kb{padding-bottom:10px}
  .step-bar button{flex:1;min-height:56px !important;margin:0 !important;font-size:19px !important}
  .step-bar #stepBack{flex:0 0 auto;min-width:56px;padding:0 16px !important}
  /* results: card with side margins */
  .results{margin:14px 12px 0 !important}
  .ended{margin:14px 12px 0 !important}
  .share .btn{flex:1 1 auto}
}
@media (max-width:360px){
  #game header.top .logo-mark{font-size:1.3rem !important}
  #game header.top .logo small.tagline{font-size:10.5px !important}
  .stage .photo-dots{gap:8px !important;padding:10px 10px 4px !important}
  .stage .photo-dots button{gap:4px !important;padding:4px 4px 4px 3px !important}
  .stage .photo-dots button img,.stage .photo-dots button.locked > .lk{flex-basis:30px !important;width:30px !important;height:44px !important}
  .photo-dots .tx b{font-size:14px}
  .photo-dots .tx small{font-size:11px}
  form.guess{padding:16px 14px 18px !important}
  form.guess .field label{font-size:20px !important;margin-bottom:10px !important}
  .step-head{top:16px;right:14px;min-height:32px;height:auto}
  .step-chips{min-height:32px}
  .step-chips button{min-height:32px;padding:0 8px;font-size:13px}
  form.guess .field input{height:54px !important;min-height:54px !important;font-size:18px !important}
  .step-bar{padding:10px 12px max(12px, env(safe-area-inset-bottom))}
  .step-bar button{min-height:52px !important;font-size:17px !important}
}
/* short phones (e.g. 360x640): let the photo give up a little height so the first question sits above the pinned bar */
@media (max-width:480px) and (max-height:700px){
  .stage .viewer{aspect-ratio:auto !important;height:min(75vw,calc(100svh - 390px)) !important;min-height:220px}
}
@media (max-width:480px) and (prefers-color-scheme:dark){
  html[data-theme="2020s"] footer.foot{background:rgb(22,23,30) !important;color:color-mix(in srgb,#f5f5f7 76%,transparent) !important}
  html[data-theme="2020s"] footer.foot .foot-credit{color:color-mix(in srgb,#f5f5f7 76%,transparent) !important}
}

/* Stats · Medals · Leagues · Archive tabs: always 4 equal tabs, fully visible, no sideways swipe (down to 320px wide).
   Narrow phones put the icon above the label. The sheet itself never scrolls sideways. */
.modal .sheet{box-sizing:border-box;max-width:100%;overflow-wrap:anywhere}
@media (max-width:480px){
  .modal{padding-left:max(8px,env(safe-area-inset-left)) !important;padding-right:max(8px,env(safe-area-inset-right)) !important;overflow-x:hidden}
  .modal #modalBody{padding-left:14px;padding-right:14px}
  .modal .sheet table.lb{width:100%;table-layout:auto}
}
@media (max-width:400px){
  .sheet-tabs{gap:3px}
  .sheet-tabs button{display:flex;flex-direction:column;align-items:center;gap:1px;padding:5px 2px;font-size:.72rem;letter-spacing:0;border-radius:14px}
  .sheet-tabs button > span{font-size:1rem;line-height:1}
}

/* Nov 2, 2026: no keyboard-pinned bar. Back / Next / Submit sit in the card under the field (in-flow). */
@media (max-width:480px){
  .step-bar{position:static !important;transform:none !important;display:flex !important;gap:10px;margin:14px 0 0;padding:0 !important;background:none !important;border:0 !important;box-shadow:none !important;-webkit-backdrop-filter:none !important;backdrop-filter:none !important}
  .step-bar button{min-height:54px !important;font-size:18px !important}
}

/* Nov 2, 2026 header: six buttons (Stats, Medals, Leagues, Archive, How to play, Settings); compact so 1024px fits with the logo */
@media (min-width:1000px){
  .top-nav{gap:5px}
  .top-nav .nav-btn{height:36px;padding:0 10px 0 8px;gap:5px}
  .top-nav .nav-btn svg{width:18px;height:18px;flex:none}
  .top-nav .nav-lab{font-size:.82rem}
  header.top{flex-wrap:nowrap}
}
@media (min-width:1200px){ .top-nav{gap:7px} .top-nav .nav-btn{padding:0 12px 0 9px;gap:6px} .top-nav .nav-lab{font-size:.88rem} }
.link-btn{background:none;border:0;padding:6px 4px;color:inherit;font:600 .95rem var(--font-body);text-decoration:underline;cursor:pointer}
.sheet-tabs{display:none !important}
#archJoin{text-decoration:none}
/* Nov 2, 2026: Home Screen app (standalone, edge to edge): the header starts below the status bar (notch / Dynamic
   Island inset + 12px) and the status-bar zone gets a solid strip in the header's colour (set by js/pwa.js), so the
   clock never sits over the logo or a see-through fade. In a Safari tab the inset is 0, so nothing changes there. */
@media (display-mode: standalone){
  header.top, #game header.top{padding-top:12px !important;border-top:env(safe-area-inset-top, 0px) solid var(--sb-bg, #fff) !important;background-origin:padding-box !important;background-clip:padding-box !important}
  body::before{content:'';position:fixed;left:0;right:0;top:0;height:env(safe-area-inset-top, 0px);background:var(--sb-bg, #fff);z-index:1000;pointer-events:none}
}
html.standalone header.top, html.standalone #game header.top{padding-top:12px !important;border-top:env(safe-area-inset-top, 0px) solid var(--sb-bg, #fff) !important;background-origin:padding-box !important;background-clip:padding-box !important}
html.standalone body::before{content:'';position:fixed;left:0;right:0;top:0;height:env(safe-area-inset-top, 0px);background:var(--sb-bg, #fff);z-index:1000;pointer-events:none}
/* non-member Archive pop-up (Nov 2, 2026) */
.arch-gate{text-align:center;padding:4px 4px 2px}
.ag-badge{width:64px;height:64px;margin:4px auto 14px;border-radius:50%;display:grid;place-items:center;color:#fff;
  background:radial-gradient(circle at 30% 25%, #ffe08a, #f5b301 55%, #c98a00);box-shadow:0 6px 18px rgba(201,138,0,.35), inset 0 -3px 0 rgba(0,0,0,.12)}
.ag-badge svg{width:34px;height:34px}
.arch-gate .ag-h{font-size:1.3rem;line-height:1.3;margin:0 auto 8px;max-width:22em}
.arch-gate .ag-sub{margin:0 0 18px;opacity:.8}
.ag-btns{display:grid;grid-template-columns:1fr;gap:10px}
.ag-btns .btn{display:flex;align-items:center;justify-content:center;min-height:52px;margin:0 !important;width:100%;box-sizing:border-box;text-decoration:none;font-size:1.05rem}
@media (min-width:560px){ .ag-btns{grid-template-columns:1fr 1fr} }

/* ===== Visibility pass (Nov 2, 2026): every text node >= 4.5:1 (3:1 large) on its rendered background — tools/visibility_audit.py ===== */
/* primary buttons: a thin solid outline round white button text, in each era's dark ink (paint-order keeps the glyph full weight) */
html{--btn-ol:rgba(0,0,0,.6)}
html[data-theme="1950s"]{--btn-ol:#6b0f1c}
html[data-theme="1960s"]{--btn-ol:#1d3640}
html[data-theme="1970s"]{--btn-ol:#111}
html[data-theme="1980s"]{--btn-ol:#4a0430}
html[data-theme="1990s"]{--btn-ol:#3d0f63}
html[data-theme="2000s"]{--btn-ol:#053d66}
html[data-theme="2010s"]{--btn-ol:#7a1630}
html[data-theme="2020s"]{--btn-ol:#4b1361}
.btn:not(.secondary):not(:disabled),.seg button[aria-pressed="true"]{-webkit-text-stroke:2.5px var(--btn-ol);paint-order:stroke fill}
/* segmented tabs + archive rows: never paint the page colour behind light text (1980s showed white-on-white) */
.seg button:not([aria-pressed="true"]),.arch-list button{background:transparent;color:inherit}
/* stats distribution: dark text on a light tint of the accent instead of white on a mid tint */
.dist i{background:color-mix(in srgb,var(--accent) 32%,var(--card));color:var(--ink);font-weight:700}
/* results rows: the "correct / close" note takes the row's own ink */
.row .v small{color:inherit;opacity:.9}
/* photo strip labels on phone */
@media (max-width:899px){ .photo-dots .tx small{opacity:1} .stage .photo-dots button.locked .tx{opacity:.95} }
/* pills */
html[data-theme="1980s"]:not(:where([data-preview])) .reveal-btn .drop{background:#c8136c}
html[data-theme="2010s"]:not(:where([data-preview])) .reveal-btn .drop{background:linear-gradient(45deg,#a8401c 0%,#b8302a 30%,#a81e5f 58%,#6d23a0 80%,#3b2fb0 100%)}
html[data-theme="2010s"]:not(:where([data-preview])) #multPill.mode-pill,html[data-theme="2010s"]:not(:where([data-preview])) .mode-pill{background:linear-gradient(90deg,#b8302a,#a81e5f)}
/* 1950s: teal header — cream bubbles with cherry ink, dark tagline */
html[data-theme="1950s"] .top-nav .nav-btn,html[data-theme="1950s"] .top-nav .menu-btn{background:#fffaf0;color:#6b0f1c;border:2px solid #6b0f1c !important;box-shadow:0 2px 0 #6b0f1c}
html[data-theme="1950s"] .top-nav .nav-btn:hover{background:#ffe9e0}
html[data-theme="1950s"] header.top .logo small{color:#06302c;text-shadow:none;opacity:1}
/* 1970s: orange header — cream bubbles, black outline + hard drop shadow; logo outlined in black */
html[data-theme="1970s"] .top-nav{position:relative;z-index:2}
html[data-theme="1970s"] .top-nav .nav-btn,html[data-theme="1970s"] .top-nav .menu-btn{background:#fff3d6;color:#111;border:2.5px solid #111 !important;box-shadow:3px 3px 0 #111;font-weight:700}
html[data-theme="1970s"] .top-nav .nav-btn .nav-lab{font-family:'Oswald',sans-serif;text-transform:uppercase;letter-spacing:.06em;font-weight:700}
html[data-theme="1970s"] .top-nav .nav-btn:hover,html[data-theme="1970s"] .top-nav .menu-btn:hover{background:#ffd23f}
html[data-theme="1970s"] .top-nav .nav-btn:active{transform:translate(2px,2px);box-shadow:1px 1px 0 #111}
html[data-theme="1970s"]:not(:where([data-preview])) .logo-mark{text-shadow:-1.5px -1.5px 0 #111,1.5px -1.5px 0 #111,-1.5px 1.5px 0 #111,1.5px 1.5px 0 #111,3px 3px 0 #111}
@media (min-width:900px){
  /* the centre twin stripes sat right behind the new nav: on desktop they become a stripe band along the header's bottom edge */
  html[data-theme="1970s"]:not(:where([data-preview])) header.top{background-image:none;box-shadow:inset 0 -6px 0 #fff3d6,inset 0 -12px 0 #111}
}
html[data-theme="2010s"]:not(:where([data-preview])) .mult-now b{background:linear-gradient(90deg,#b8302a,#a81e5f)}
html[data-theme="2000s"]:not(:where([data-preview])) .logo-mark .lm2{color:#2a7d1a}
html[data-theme="1980s"]:not(:where([data-preview])) #ad{background:#14062e}

/* Nov 13, 2026: pinned sheet header keeps Back / title / Close visible while How and FAQ scroll */
.modal .sheet-head .back,.modal .sheet-head .close{position:relative !important;top:auto !important;left:auto !important;right:auto !important;width:44px !important;height:44px !important;flex:0 0 44px}
.modal .back svg,.modal .close svg{width:24px;height:24px}
.modal .back[hidden]{display:none !important}
.modal .sheet.has-back > #modalBody > .arch-gate{padding-top:0}

/* Nov 9, 2026 (Jordan's Home Screen app recording: the screen flashed white on every keystroke). The era background used to
   be painted on the whole page (body -> the canvas, as tall as the page plus its scroll room). On phones it now sits on ONE
   fixed, screen-sized layer that never has to be redrawn while typing or scrolling, and the page behind it is a solid colour
   from the same era, so if iOS ever drops a tile for a frame it shows that colour, never white. */
@media (max-width:899px){
  html{background-color:var(--page-base,#f7f7f5)}
  html body{background:transparent !important}
  html body::after{content:"";position:fixed;left:0;right:0;top:0;height:100vh;height:100lvh;z-index:-1;pointer-events:none;background:var(--page)}
  html[data-theme="1950s"]{--page-base:#f6f0e2} html[data-theme="1960s"]{--page-base:#fff6e0} html[data-theme="1970s"]{--page-base:#ff6a13}
  html[data-theme="1980s"]{--page-base:#14062e} html[data-theme="1990s"]{--page-base:#f4fbfb} html[data-theme="2000s"]{--page-base:#8fd3ff}
  html[data-theme="2010s"]{--page-base:#d42e7b} html[data-theme="2020s"]{--page-base:#eef0ff}
}
@media (max-width:899px) and (prefers-color-scheme:dark){ html[data-theme="2020s"]{--page-base:#07080f} }
/* the guess card swaps fields in place: no browser scroll anchoring (Chrome would scroll the page on each advance) */
@media (max-width:899px){ html{overflow-anchor:none} }
/* Home Screen app: no rubber-band at the top/bottom edge (it fought the one placement move as a bounce) */
@media (max-width:899px){ html.standalone,html.standalone body{overscroll-behavior-y:none} }
@media (display-mode:standalone) and (max-width:899px){ html,body{overscroll-behavior-y:none} }
/* suggestion list opens upward when the box sits just above the keyboard (no page scrolling needed to see it) */
@media (max-width:899px){
  /* height:auto + max-height: a short list hugs the field; a long list scrolls inside the box (the old flex + margin-top:auto layout could not) */
  #guessForm.list-up .listbox{top:auto !important;bottom:calc(100% + 4px) !important;height:auto;max-height:var(--list-max,236px) !important;display:block;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;touch-action:pan-y}
  /* empty space under the guess card so the photo credit and footer sit below the keyboard when the list is open (attribution stays on the page, reachable by scrolling) */
  #play:has(#guessForm)::after{content:"";display:block;height:max(420px,70dvh);pointer-events:none;visibility:hidden}
}
