/* ============================================================================
   WG-Ämtli — "Chilbi Royale" design system (SPEC §6, §12.2)
   One committed dark look. Tokens, fonts, title, background layers, lever,
   booths, tickets, boards, tab bar, ticker, toasts, banners, modals, layout,
   reduced motion, accessibility.
   ========================================================================== */

/* ---------------------------------------------------------------- 6.1 tokens */
:root {
  --night: #12002b;
  --night-2: #2a0b5e;
  --tent-red: #e6002d;
  --red-deep: #9b0020;
  --cream: #fff3d6;
  --gold: #ffc21a;
  --gold-hi: #fff0a8;
  --gold-deep: #b8860b;
  --bulb-on: #ffe08a;
  --bulb-off: #5a3b12;
  --neon-pink: #ff2e93;
  --neon-cyan: #19e6ff;
  --ink: #2a0a3a;
  --wood: #3b2314;
  --wood-2: #2a1810;

  --font-title: 'Rye', 'Alfa Slab One', Georgia, serif;
  --font-marquee: 'Bungee', Impact, 'Arial Black', sans-serif;
  --font-body: 'Barlow Condensed', 'Arial Narrow', sans-serif;

  /* 6.8 layout (vh fallback first, dvh override) */
  --canopy-h: max(56px, 9vh);
  --canopy-h: max(56px, 9dvh);
  --tabbar-h: 64px;
  --sign-h: 12vh;
  --sign-h: 12dvh;
  --ticker-h: 26px;
  /* 6.6 fixed phone lever (width also reserves space in #spin-hint / #mine / #last-spin) */
  --lever-w: clamp(64px, 18vw, 90px);
  --lever-h: clamp(112px, 28vw, 220px);
  /* Portrait stage: 96vw / 58dvh (§6.8), additionally capped on short viewports so that NO seat
     plate's 48 px tap box (§6.10) ever reaches the fixed lever's box at scroll 0.
     Worst case is N = 8: the 4-5 o'clock plate centre sits 0.802 * stage below the wheel's top
     edge and its rotated 48 px tap box adds 34 px, so
        wheelTop + 0.802 * stage + 34  <=  100dvh - safe-b - tabbar - ticker - 2 - lever-h
     with wheelTop = safe-t + canopy + 30 (body padding) + sign + #top-actions.
     --stage-reserve folds everything that is not canopy/lever/stage into one number:
        92 (tabbar+ticker+dock) + 30 (body padding) + 34 (tap box) + sign (~113) + actions (56).
     1.22 is used instead of 1/0.802 = 1.247 to keep a couple of px of slack.
     Floor min(60vw, 56dvh) so tiny viewports still get a usable wheel (the page scrolls) without
     the floor exploding on a rotated phone that is too narrow for the landscape grid. */
  --stage-reserve: 330px;
  --stage: max(min(60vw, 56vh), min(96vw, 58vh, (100vh - var(--canopy-h) - var(--lever-h) - var(--stage-reserve)) * 1.22));
  --stage: max(min(60vw, 56dvh), min(96vw, 58dvh, (100dvh - var(--canopy-h) - var(--lever-h) - var(--stage-reserve)) * 1.22));
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  /* motion knobs driven by app.js / fx.js */
  --ray-dur: 90s;
  --ticker-dur: 40s;

  /* shared recipes */
  --stripes: repeating-linear-gradient(90deg, #e6002d 0 44px, #fff3d6 44px 88px);
  --wood-grain: repeating-linear-gradient(0deg, #3b2314 0 6px, #2a1810 6px 8px);
  --gold-metal: linear-gradient(180deg, #fff0a8 0%, #ffc21a 45%, #b8860b 100%);
  --chrome: linear-gradient(180deg, #e8e8e8, #8f8f8f);
  --shadow-deep: 0 12px 28px rgba(0, 0, 0, .55);
  --paper: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0) 40%),
           repeating-linear-gradient(45deg, rgba(120,80,20,.04) 0 2px, transparent 2px 6px);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--night);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  color-scheme: dark;
  font: 500 16px/1.35 var(--font-body);
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--canopy-h) + 30px + var(--safe-t)) var(--safe-r)
           calc(var(--tabbar-h) + var(--ticker-h) + var(--safe-b) + 28px) var(--safe-l);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
body::before {                                   /* 6.4 layer 1: radial ground */
  content: '';
  position: fixed;
  inset: 0;
  z-index: -5;
  background: radial-gradient(circle at 50% 42%, var(--night-2) 0, var(--night) 70%);
  pointer-events: none;
}
/* Portrait: the page scrolls under the fixed ticker. A soft scrim right above it turns the cut
   into "there is more below" instead of a slice. Stays under the lever (z 35) and the ticker (40)
   so the chrome plate and the neon crawl keep their full punch. */
body::after {
  content: '';
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--ticker-h) + var(--safe-b) + 2px);
  height: 30px;
  z-index: 34;
  background: linear-gradient(180deg, rgba(18, 0, 43, 0), rgba(18, 0, 43, .88));
  pointer-events: none;
}
/* The tab bar is a row of torn tickets (8 px zigzag clip, §6.7). Without a backdrop the notches
   between the teeth are transparent, so scrolled tiles show through the tear and the bar looks
   grubby. Paint the tab bar's own box night-dark just underneath it (z 44 < tabbar 45), which is
   exactly what the teeth show at scroll 0 anyway. Hidden where the bar is (landscape / kiosk). */
html::before {
  content: '';
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-b));
  z-index: 44;
  background: var(--night);
  pointer-events: none;
}
html.kiosk::before { display: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--gold); }
img, canvas, svg { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--neon-cyan);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(25, 230, 255, .35), 0 0 18px var(--neon-cyan);
}
::selection { background: var(--neon-pink); color: #fff; }
.noscript {
  position: fixed; inset: 40% 16px auto;
  z-index: 999;
  background: var(--cream); color: var(--ink);
  padding: 16px; border-radius: 12px; text-align: center;
  font-weight: 700;
}

/* ---------------------------------------------------------------- shared keyframes */
@keyframes spin { to { transform: rotate(360deg); } }
@property --col-fade-t { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --col-fade-b { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes col-fade {                                 /* landscape #wheel-col scroll fade */
  0%   { --col-fade-t: 0px;  --col-fade-b: 64px; }
  12%  { --col-fade-t: 28px; --col-fade-b: 64px; }
  88%  { --col-fade-t: 28px; --col-fade-b: 64px; }
  100% { --col-fade-t: 28px; --col-fade-b: 0px; }
}
@keyframes chase { to { background-position-x: 64px; } }
@keyframes chase-marquee { to { background-position-x: 32px; } }
@keyframes halo {
  from { filter: drop-shadow(1px 1px 0 #7a5200) drop-shadow(1px 1px 0 #5a3b00) drop-shadow(0 0 6px rgba(255, 46, 147, .6)); }
  to   { filter: drop-shadow(1px 1px 0 #7a5200) drop-shadow(1px 1px 0 #5a3b00) drop-shadow(0 0 10px rgba(255, 46, 147, 1)); }
}
@keyframes flicker {                                     /* bad ballast, twice every 7 s */
  0%, 41%, 42.2%, 43%, 44.2%, 100% { opacity: 1; }
  41.4%, 41.8% { opacity: .4; }
  43.4%, 43.8% { opacity: .4; }
}
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes sweep { from { transform: rotate(-25deg); } to { transform: rotate(25deg); } }
@keyframes ticker { to { transform: translateX(-100%); } }
@keyframes pulse-hint {
  0%, 100% { transform: scale(1); text-shadow: 0 0 8px rgba(255, 194, 26, .6); }
  50% { transform: scale(1.06); text-shadow: 0 0 18px rgba(255, 194, 26, 1), 0 0 34px rgba(255, 46, 147, .7); }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes neon-breathe {
  0%, 100% { text-shadow: 0 0 8px var(--neon-cyan), 0 0 24px var(--neon-cyan); }
  50% { text-shadow: 0 0 10px var(--neon-cyan), 0 0 32px var(--neon-cyan), 0 0 48px rgba(25, 230, 255, .6); }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes card-in { from { transform: translateY(24px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes booth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-12px) rotate(-1deg); }
  40% { transform: translateX(10px) rotate(1deg); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(6px); }
}
@keyframes toast-in { from { transform: translate(120%, -16px) rotate(4deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translate(120%, 0); opacity: 0; } }
@keyframes banner-in { from { transform: translateY(-120%); } to { transform: translateY(0); } }
@keyframes banner-text { 0% { transform: scale(.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes banner-out { to { transform: translateY(-120%); opacity: 0; } }
@keyframes reveal-pop { from { transform: translateX(-24px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stamp-in { from { transform: rotate(-12deg) scale(3); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
@keyframes glow-ring {
  0%, 100% { box-shadow: 0 0 0 3px var(--gold), 0 0 16px 2px rgba(255, 194, 26, .5); }
  50% { box-shadow: 0 0 0 3px var(--gold-hi), 0 0 28px 6px rgba(255, 194, 26, .8); }
}
@keyframes bulb-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes tag-swing { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(-3deg); } }
@keyframes hardest-shiver {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* ============================================================================
   6.4 BACKGROUND LAYERS (fixed, back to front)
   ========================================================================== */
.rays, .canopy, .bunting, .spot, .ferris, .vignette { pointer-events: none; }

.rays {                                               /* 2: 24 rotating spokes */
  position: fixed;
  left: 50%; top: 42%;
  width: 200vmax; height: 200vmax;
  margin: -100vmax 0 0 -100vmax;
  z-index: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 194, 26, .10) 0 7.5deg, transparent 7.5deg 15deg);
  animation: spin var(--ray-dur, 90s) linear infinite;
  will-change: transform;
}
.ferris {                                             /* 6: silhouette, bottom-left */
  position: fixed;
  left: -5vw;
  bottom: calc(var(--tabbar-h) + var(--ticker-h) - 20px);
  width: 32vw;
  z-index: 0;
  color: #0a0018;
  opacity: .18;
}
.ferris svg { display: block; width: 100%; height: auto; overflow: visible; }
.ferris circle, .ferris g, .ferris use {
  transform-box: view-box;
  transform-origin: 100px 100px;
  animation: spin 120s linear infinite;
}
@media (max-width: 479px) { .ferris { display: none; } }
.vignette {                                           /* 7 */
  position: fixed; inset: 0;
  z-index: 0;
  box-shadow: inset 0 0 40vmax rgba(0, 0, 0, .65);
}
.canopy {                                             /* 3: scalloped striped awning */
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--canopy-h) + var(--safe-t));
  z-index: 20;
  background: var(--stripes);
  /* scalloped hem: solid body + a row of hanging semicircles (44 px pitch, r 20) */
  -webkit-mask:
    linear-gradient(#000, #000) 0 0 / 100% calc(100% - 20px) no-repeat,
    radial-gradient(circle at 22px 0, #000 20px, transparent 21px) 0 100% / 44px 21px repeat-x;
          mask:
    linear-gradient(#000, #000) 0 0 / 100% calc(100% - 20px) no-repeat,
    radial-gradient(circle at 22px 0, #000 20px, transparent 21px) 0 100% / 44px 21px repeat-x;
}
.canopy::before {                                     /* gold ridge pole */
  content: '';
  position: absolute; top: var(--safe-t); left: 0; right: 0;
  height: 7px;
  background: var(--gold-metal);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5);
}
.canopy::after {                                      /* fabric shading */
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .22) 100%);
}
.bunting {                                            /* 4: two rows of swaying flags */
  position: fixed;
  left: 0; right: 0;
  z-index: 21;
  height: 34px;
  pointer-events: none;
}
/* Both rows end above the body's top padding (canopy + 30px), so at scroll 0 no flag is drawn over
   content. Once the page scrolls, this scrim — under the canopy (20) and the flags (21), over the
   page — swallows the content just below the scalloped hem, so it slides *under* the tent instead
   of being criss-crossed by bunting. Portrait only; landscape does not scroll. */
html::after {
  content: '';
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--canopy-h) + var(--safe-t) - 24px);
  height: 50px;                                      /* solid through the scalloped hem, gone before the sign */
  z-index: 19;
  background: linear-gradient(180deg, var(--night) 0 48%, rgba(18, 0, 43, .6) 74%, rgba(18, 0, 43, 0));
  pointer-events: none;
}
#bunting-1 { top: calc(var(--canopy-h) + var(--safe-t) - 10px); }
#bunting-2 { top: calc(var(--canopy-h) + var(--safe-t) + 4px); padding: 0 6vw; }
#bunting-2 .flag { width: 20px; height: 22px; }
#bunting-2 .flag:nth-child(even) { width: 18px; height: 18px; margin-top: 4px; }
.bunting-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 1vw;
}
.bunting-row::before {                                /* the rope */
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 240, 168, .1), rgba(255, 240, 168, .6) 20%, rgba(255, 240, 168, .6) 80%, rgba(255, 240, 168, .1));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
#bunting-2 .bunting-row::before { top: 2px; }
.flag {
  --flag: #e6002d;
  flex: 0 0 auto;
  width: 26px; height: 30px;
  margin-top: 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--flag) 80%, #fff) 0 15%, var(--flag) 15%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  animation: sway 3s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -.3s);
}
.flag:nth-child(even) { margin-top: 6px; height: 26px; width: 24px; }
.spot {                                               /* 5: spotlight cones */
  position: fixed;
  bottom: -22vh;
  width: 60vw; height: 140vh;
  z-index: 30;
  background: linear-gradient(to top, rgba(255, 240, 168, .28), rgba(255, 240, 168, .12) 40%, transparent 70%);
  clip-path: polygon(46% 100%, 54% 100%, 100% 0, 0 0);
  transform-origin: 50% 100%;
  mix-blend-mode: screen;
  animation: sweep 7s ease-in-out infinite alternate;
  transition: transform .6s ease-in-out;
  will-change: transform;
}
#spot-l { left: -22vw; }
#spot-r { right: -22vw; animation-delay: -3.5s; animation-direction: alternate-reverse; }
/* FX.spotlight sets --spot-l / --spot-r inline → sweep pauses, cone aims (600 ms) */
#spot-l[style*="--spot-l"], html[style*="--spot-l"] #spot-l, #spot-l.aimed {
  animation: none;
  transform: rotate(var(--spot-l, 0deg));
}
#spot-r[style*="--spot-r"], html[style*="--spot-r"] #spot-r, #spot-r.aimed {
  animation: none;
  transform: rotate(var(--spot-r, 0deg));
}

/* ============================================================================
   STAGE + 6.3 TITLE TREATMENT
   ========================================================================== */
#stage { position: relative; }

#sign {
  padding: 0 14px 4px;
  display: grid;
  justify-items: center;
}
.sign-board {
  position: relative;
  min-width: min(100%, 560px);
  max-width: 100%;
  padding: 13px 18px 13px;                             /* compact (§6.8): keeps the wheel + #spin-hint above the fixed ticker on phones */
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, .18), transparent 60%),
    linear-gradient(180deg, #9b0020, #e6002d);
  border: 6px solid var(--cream);
  border-radius: 50% 50% 8px 8px / 40% 40% 8px 8px;
  box-shadow:
    inset 0 0 0 3px var(--red-deep),
    inset 0 0 0 5px var(--gold-deep),
    0 0 0 2px var(--ink),
    0 0 28px rgba(255, 46, 147, .45),
    var(--shadow-deep);
}
.sign-board::before, .sign-board::after {            /* bulb rows top + bottom */
  content: '';
  position: absolute;
  left: 22px; right: 22px;
  height: 16px;
  background: radial-gradient(circle, var(--bulb-on) 0 3px, transparent 4px) 0 0 / 16px 16px repeat-x;
  filter: drop-shadow(0 0 3px var(--bulb-on));
  animation: chase 1s steps(4) infinite;
  pointer-events: none;
}
.sign-board::before { top: 4px; }
.sign-board::after { bottom: 2px; animation-direction: reverse; }
.sign-strap {
  display: inline-block;
  font-family: var(--font-marquee);
  font-size: clamp(10px, 2.4vw, 14px);
  letter-spacing: .28em;
  color: var(--gold);
  text-shadow: 0 1px 0 #5a3b00, 0 0 6px rgba(255, 194, 26, .5);
  padding: 2px 10px;
  border-top: 1px solid rgba(255, 240, 168, .5);
  border-bottom: 1px solid rgba(255, 240, 168, .5);
  margin-bottom: 2px;
}
h1#house-name {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(26px, 7vw, 76px);
  line-height: 1.05;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, #fff0a8 0%, #ffc21a 50%, #b8860b 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  /* bevel + neon halo as drop-shadows (text-shadow would paint over clipped text) */
  filter: drop-shadow(1px 1px 0 #7a5200) drop-shadow(1px 1px 0 #5a3b00) drop-shadow(0 0 6px #ff2e93);
  animation: halo 2.4s ease-in-out infinite alternate;
}
#sign-sub {
  margin-top: 3px;
  font-family: var(--font-marquee);
  font-size: clamp(11px, 2.8vw, 18px);
  letter-spacing: .06em;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px #19e6ff, 0 0 24px #19e6ff;
  animation: flicker 7s linear infinite, neon-breathe 3s ease-in-out infinite;
}

/* ---------------------------------------------------------------- top actions */
/* Portrait: ONE 48 px row (two rows of pills pushed the wheel under the fixed lever/ticker on
   phones). Labels come from app.js and may wrap onto 2-3 lines inside the pill. */
#top-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px 4px;
}
#top-actions button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 2px solid var(--gold-deep);
  background: linear-gradient(180deg, rgba(60, 20, 110, .9), rgba(18, 0, 43, .95));
  color: var(--gold-hi);
  font-weight: 700;
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: anywhere;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 3px 0 #3a2000, 0 6px 12px rgba(0, 0, 0, .4);
  transition: transform .08s, box-shadow .08s;
}
#top-actions button:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 0 #3a2000; }
#btn-calm[aria-pressed="true"] { border-color: var(--neon-cyan); color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan); }
#btn-identity { border-color: var(--neon-pink); }

#sound-pill {
  position: fixed;
  left: calc(12px + var(--safe-l));
  bottom: calc(var(--safe-b) + var(--tabbar-h) + var(--ticker-h) + 14px);
  z-index: 36;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--gold-metal);
  color: var(--red-deep);
  font-family: var(--font-marquee);
  font-size: 12px;
  box-shadow: 0 4px 0 var(--gold-deep), 0 8px 16px rgba(0, 0, 0, .5), 0 0 18px rgba(255, 194, 26, .5);
  animation: bob 1.4s ease-in-out infinite;
}

/* ---------------------------------------------------------------- short phones (<= 780 px tall)
   The marquee keeps every bulb, the gradient, the bevel and the neon — it just loses ~26 px of
   padding and type so the wheel starts higher. That headroom buys the seat plates their clearance
   from the fixed lever instead of shrinking the wheel (see --stage-reserve above). */
@media (orientation: portrait) and (max-height: 780px) {
  :root { --stage-reserve: 306px; }
  #sign { padding-bottom: 2px; }
  .sign-board { padding: 8px 14px 9px; border-width: 5px; }
  .sign-board::before { top: 3px; }
  .sign-strap { font-size: clamp(9px, 2.2vw, 12px); letter-spacing: .24em; padding: 1px 8px; margin-bottom: 1px; }
  h1#house-name { font-size: clamp(23px, 6.4vw, 44px); }
  #sign-sub { margin-top: 2px; font-size: clamp(10px, 2.6vw, 15px); }
  #top-actions { padding: 2px 8px; }
}

/* ============================================================================
   MIDWAY: wheel column
   ========================================================================== */
#midway { display: block; }
#wheel-col { display: flex; flex-direction: column; align-items: center; }

#wheel-wrap {
  width: var(--stage);
  max-width: 100%;
  margin-inline: auto;
  position: relative;
}
canvas#wheel {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .6));
  touch-action: manipulation;
}
#spin-hint {
  margin: 2px auto 0;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 0 8px rgba(255, 194, 26, .6);
  /* right padding = fixed lever width (§6.6) so the hint never runs under the lever base on phones */
  padding: 2px calc(12px + var(--lever-w)) 2px 12px;
}
#spin-hint.ready, #spin-hint.pulse {
  color: var(--gold);
  animation: pulse-hint 1.6s ease-in-out infinite;
}
#spin-hint.ready::before, #spin-hint.pulse::before { content: '👉 '; }
#spin-hint.ready::after, #spin-hint.pulse::after { content: ' 👈'; }

/* Tribüne chips */
#tribune {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px 8px 0;
}
#tribune:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 4px 16px 4px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffaf0, #f3e4bd);
  color: var(--ink);
  border: 2px dashed var(--red-deep);
  box-shadow: 0 3px 0 var(--red-deep), 0 6px 12px rgba(0, 0, 0, .4);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  transition: transform .08s;
}
.chip:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-deep); }
.chip-emoji { font-size: 22px; line-height: 1; }
.chip-text { white-space: nowrap; }

/* Legend (M > 14) */
#legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  width: 100%;
  padding: 10px 8px 0;
}
.legend-item {
  --tile: #ffc21a;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 243, 214, .08);
  border: 1px solid rgba(255, 240, 168, .25);
  font-size: 14px;
  font-weight: 700;
  color: var(--cream);
  overflow: hidden;
}
.legend-item > span:first-child {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--tile);
  border: 2px solid var(--ink);
  font-size: 14px;
}
.legend-item > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Meine Ämtli strip */
#mine {
  width: 100%;
  max-width: 720px;
  padding: 12px 0 0;
}
#mine-title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 20px;
  color: var(--gold);
  text-shadow: 1px 1px 0 #7a5200, 0 0 12px rgba(255, 194, 26, .5);
  padding: 0 14px 6px;
  display: flex; align-items: center; gap: 10px;
}
#mine-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-deep), transparent);
}
#mine-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 14px 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent;
}
#mine-list .tile { flex: 0 0 min(82vw, 320px); scroll-snap-align: start; }
/* Rad tab (portrait): the lever is fixed bottom-right → the strip and the last-spin line stop
   at the lever's left edge and the tiles shrink to the visible strip width (2-row tile layout <480px). */
body[data-tab="rad"] #mine { padding-right: calc(12px + var(--lever-w) + var(--safe-r)); }
body[data-tab="rad"] #mine-list .tile { flex-basis: min(320px, calc(100vw - var(--lever-w) - 40px - var(--safe-r))); }
body[data-tab="rad"] #last-spin { padding-right: calc(26px + var(--lever-w) + var(--safe-r)); }
/* Woche tab (portrait) shows the identical line as #woche-title right below → no duplicate (finding 7). */
body[data-tab="woche"] #last-spin { display: none; }
#mine-list:empty { display: none; }
#mine-list > p, #mine > p {                        /* identity.tribune line */
  padding: 0 14px 12px;
  color: var(--cream);
  opacity: .85;
}
#last-spin {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 243, 214, .7);
  padding: 4px 14px 10px;
}
#last-spin:empty { display: none; }

/* ============================================================================
   6.6 THE LEVER
   ========================================================================== */
#lever {
  position: fixed;
  right: calc(12px + var(--safe-r));
  /* docked right above the ticker so the knob sits below the wheel's lower-right seat plates */
  bottom: calc(var(--safe-b) + var(--tabbar-h) + var(--ticker-h) + 2px);
  width: var(--lever-w);
  height: var(--lever-h);
  z-index: 35;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6));
}
#lever:active, #lever.pulling { cursor: grabbing; }
.lever-base {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  border-radius: 10px;
  background:
    radial-gradient(circle at 12% 12%, #333 0 3px, #ddd 3.5px 4.5px, transparent 5px),
    radial-gradient(circle at 88% 12%, #333 0 3px, #ddd 3.5px 4.5px, transparent 5px),
    radial-gradient(circle at 12% 88%, #333 0 3px, #ddd 3.5px 4.5px, transparent 5px),
    radial-gradient(circle at 88% 88%, #333 0 3px, #ddd 3.5px 4.5px, transparent 5px),
    var(--chrome);
  border: 2px solid #4a4a4a;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .8),
    inset 0 -3px 0 rgba(0, 0, 0, .35),
    inset 0 0 12px rgba(0, 0, 0, .25),
    0 6px 0 #3d3d3d;
  display: grid;
  place-items: end center;
  padding-bottom: 8px;
}
.lever-base::before {                                /* slot the rod sits in */
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  width: 22px; height: 14px;
  margin-left: -11px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #111, #3a3a3a);
  box-shadow: inset 0 2px 3px #000, 0 1px 0 rgba(255, 255, 255, .5);
}
.lever-label {
  font-family: var(--font-marquee);
  font-size: clamp(9px, 2.2vw, 12px);
  color: var(--tent-red);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
  letter-spacing: .02em;
  background: rgba(255, 255, 255, .55);
  border: 1px solid #777;
  border-radius: 4px;
  padding: 2px 5px;
  white-space: nowrap;
}
.lever-arm {
  position: absolute;
  left: 50%;
  bottom: 36%;
  width: 44px;
  height: 66%;
  margin-left: -22px;
  transform-origin: 50% 100%;
  transform: perspective(280px) rotateX(calc(var(--pull, 0deg) * -1));
  will-change: transform;
}
#lever.snap .lever-arm { transition: transform .32s cubic-bezier(.2, 1.8, .4, 1); }
.lever-rod {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 12px;
  height: 100%;
  margin-left: -6px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(90deg, #666, #fff 45%, #777);
  box-shadow: 0 0 2px rgba(0, 0, 0, .8), 2px 0 6px rgba(0, 0, 0, .35);
}
.lever-knob {
  position: absolute;
  top: -22px; left: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8aa0, #e6002d 45%, #7a0018);
  box-shadow:
    inset -3px -4px 8px rgba(0, 0, 0, .4),
    0 3px 6px rgba(0, 0, 0, .6),
    0 0 18px rgba(230, 0, 45, .5);
}
.lever-knob::after {                                 /* specular */
  content: '';
  position: absolute;
  top: 7px; left: 10px;
  width: 12px; height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  filter: blur(1px);
}
#lever-tag {                                         /* BESETZT cardboard tag (hangs on the base plate) */
  display: none;
  position: absolute;
  bottom: 30%; left: 50%;
  margin-left: -38px;
  padding: 6px 8px 5px;
  background: linear-gradient(180deg, #fff9e8, #eddcb5);
  color: var(--tent-red);
  font-family: var(--font-marquee);
  font-size: 11px;
  letter-spacing: .04em;
  border: 2px solid var(--ink);
  border-radius: 4px 12px 4px 4px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .5);
  transform-origin: 50% 0;
  animation: tag-swing 2.4s ease-in-out infinite;
  z-index: 3;
}
#lever-tag::before {                                 /* string up to the rod */
  content: '';
  position: absolute;
  top: -12px; left: 50%;
  width: 2px; height: 12px;
  margin-left: -1px;
  background: #d9c8a0;
}
#lever-tag::after {                                  /* punched hole */
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--night);
  box-shadow: 0 0 0 2px var(--gold-deep);
}
/* Portrait: the fixed lever would cover the Woche/Chronik/Ruhm pages → only on the Rad tab. */
body:not([data-tab="rad"]) #lever { display: none; }
/* Portrait Rad tab shows nothing but the wheel, Meine Ämtli and the last-spin line (§6.8);
   the board pages belong to their own tabs (kiosk keeps the board for its auto-cycle). */
body[data-tab="rad"]:not(.kiosk) #board { display: none; }
#lever.locked { cursor: not-allowed; }
#lever.locked .lever-base { filter: saturate(.6) brightness(.85); }
#lever.locked .lever-label { color: #777; }
#lever.locked #lever-tag { display: block; }
#lever.locked .lever-knob { box-shadow: inset -3px -4px 8px rgba(0, 0, 0, .4), 0 3px 6px rgba(0, 0, 0, .6); }

/* ============================================================================
   6.7 BUTTONS
   ========================================================================== */
.btn {
  --btn-shadow: var(--red-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  font-family: var(--font-marquee);
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 0 var(--btn-shadow), 0 10px 16px rgba(0, 0, 0, .45);
  transform: translateY(0);
  transition: transform .08s ease-out, box-shadow .08s ease-out, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--btn-shadow), 0 4px 8px rgba(0, 0, 0, .45); }
.btn:disabled, .btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(.5);
  transform: translateY(3px);
  box-shadow: 0 3px 0 var(--btn-shadow);
}
.btn-primary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 45%),
    linear-gradient(180deg, #ff3d5e, #e6002d 55%, #c40026);
  color: var(--gold);
  text-shadow: 0 1px 0 #7a0018, 0 0 8px rgba(255, 194, 26, .35);
}
.btn-secondary {
  --btn-shadow: var(--red-deep);
  background: var(--paper), linear-gradient(180deg, #fffaf0, #f3e4bd);
  color: var(--tent-red);
  text-shadow: 0 1px 0 #fff;
}
.btn-danger {
  --btn-shadow: #4a0010;
  background: linear-gradient(180deg, #b6112f, #9b0020 55%, #6f0018);
  color: var(--cream);
  text-shadow: 0 1px 0 #3a0008;
}
.btn-stamp {
  --btn-shadow: #5a0012;
  min-height: 56px;
  min-width: 56px;
  padding: 6px 12px;
  border: 3px double var(--gold-hi);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 30%, #ff5c78, #e6002d 60%, #9b0020);
  color: var(--cream);
  font-size: 13px;
  letter-spacing: .06em;
  text-shadow: 0 1px 0 #5a0012;
  box-shadow: 0 0 0 2px var(--red-deep), 0 6px 0 var(--btn-shadow), 0 10px 16px rgba(0, 0, 0, .45);
}
.btn-stamp:active { box-shadow: 0 0 0 2px var(--red-deep), 0 2px 0 var(--btn-shadow); }
.btn-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 4px 8px;
  background: none;
  border: 0;
  color: var(--tent-red);
  font-weight: 700;
  font-size: 15px;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-link:hover { text-decoration-style: solid; }
.btn-link:active { transform: translateY(1px); }

/* ============================================================================
   TILES — ticket stubs (tpl-tile)
   ========================================================================== */
.tile {
  --tile: #ffc21a;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 24px 48px minmax(0, 1fr) auto;
  grid-template-areas:
    "perf emoji body  stamp"
    "perf emoji links stamp";
  align-items: center;
  column-gap: 8px;
  min-height: 84px;
  padding: 10px 12px 10px 0;
  color: var(--ink);
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .45)) drop-shadow(0 10px 14px rgba(0, 0, 0, .4));
}
.tile::before {                                      /* ticket paper + coloured stub, punched left edge */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 6px 14px 14px 6px;
  background:
    linear-gradient(90deg, var(--tile) 0 24px, transparent 24px),
    var(--paper),
    var(--cream);
  -webkit-mask: radial-gradient(circle at 0 50%, transparent 4px, #000 4.5px) 0 0 / 100% 14px repeat-y;
          mask: radial-gradient(circle at 0 50%, transparent 4px, #000 4.5px) 0 0 / 100% 14px repeat-y;
}
.tile-perf {                                         /* perforation between stub and body */
  grid-area: perf;
  align-self: stretch;
  border-right: 2px dashed rgba(42, 10, 58, .4);
  margin: 2px 0;
}
.tile-emoji {
  grid-area: emoji;
  justify-self: center;
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
}
.tile-body { grid-area: body; min-width: 0; }
.tile-name {
  display: block;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 3px;
}
.tile-weight {
  color: var(--gold-deep);
  font-size: 12px;
  letter-spacing: .15em;
  text-shadow: 0 1px 0 #fff;
}
.tile-weight:empty { display: none; }
.tile-age {
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(42, 10, 58, .1);
  border: 1px solid rgba(42, 10, 58, .25);
  white-space: nowrap;
}
.tile-age:empty { display: none; }
.tile-actions { display: contents; }
.tile-actions .btn-stamp { grid-area: stamp; align-self: center; z-index: 2; }
/* 48 px hit box (§6.10) while the row keeps its 36 px rhythm: the extra 6 px each side overlap
   the non-interactive meta chips above / the tile padding below. */
.tile-actions .btn-link { grid-area: links; justify-self: start; z-index: 2; min-height: 48px; margin: -6px 0; padding: 2px 0; font-size: 14px; }
.tile-actions .btn-link[data-action="adopt"] { justify-self: end; }
/* The stamp lands on the ticket body only (grid columns perf/emoji/body), never on the
   ERLEDIGT/RÜCKGÄNGIG button — an absolutely positioned grid child is boxed by its grid area. */
.tile-stamp-host {
  position: absolute;
  grid-column: 1 / 4;
  grid-row: 1 / 3;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.tile .stamp, .tile .tile-stamp { font-size: 16px; padding: 3px 10px 2px; }
/* Narrow tiles (phones): name + meta on the first row, Tauschen + stamp button on the second,
   so chore names are not truncated and the tile can shrink beside the fixed lever. */
@media (max-width: 479px) {
  .tile {
    grid-template-areas:
      "perf emoji body  body"
      "perf emoji links stamp";
    row-gap: 6px;
  }
  .tile-actions .btn-stamp { align-self: end; }
  .tile-actions .btn-link { align-self: center; margin: 0; }
}
/* done: stamp + 65 % cream overlay */
.tile.done::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 6px 14px 14px 6px;
  background: rgba(255, 243, 214, .65);
  pointer-events: none;
}
.tile.done .tile-name { text-decoration: line-through; text-decoration-color: rgba(230, 0, 45, .6); }
.tile.done .btn-stamp { filter: saturate(.5); }
/* Frei! */
.tile.free { --tile: #2ee6a6; }
.tile.free::before {
  background:
    linear-gradient(90deg, var(--tile) 0 24px, transparent 24px),
    repeating-linear-gradient(45deg, rgba(230, 0, 45, .12) 0 10px, transparent 10px 20px),
    var(--cream);
}
.tile.free .tile-name { color: #0f7a54; }
/* orphan: dashed border + Herrenlos */
.tile.orphan::before {
  outline: 3px dashed var(--tent-red);
  outline-offset: -5px;
  background:
    linear-gradient(90deg, #8a8a8a 0 24px, transparent 24px),
    var(--paper),
    #f0e6d0;
}
.tile.orphan .tile-name { color: var(--red-deep); }
/* mine: gold glow ring */
.tile.mine::before { box-shadow: inset 0 0 0 3px var(--gold); }
.tile.mine { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .45)) drop-shadow(0 0 10px rgba(255, 194, 26, .8)); }
/* rubber stamp (FX.stamp appends it; also usable statically) */
.stamp, .tile-stamp {
  display: inline-block;
  padding: 4px 12px 2px;
  font-family: var(--font-marquee);
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--tent-red);
  border: 4px double var(--tent-red);
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  transform: rotate(-12deg);
  filter: blur(.3px);
  mix-blend-mode: multiply;
  opacity: .92;
  -webkit-mask-image: repeating-radial-gradient(circle at 30% 40%, #000 0 2px, rgba(0, 0, 0, .7) 2px 3px);
          mask-image: repeating-radial-gradient(circle at 30% 40%, #000 0 2px, rgba(0, 0, 0, .7) 2px 3px);
}
/* The static .tile-stamp animates via CSS; div.stamp is animated by FX.stamp (WAAPI) — never both. */
.tile-stamp { animation: stamp-in .2s cubic-bezier(.2, 1.4, .3, 1) both; }
.tile-stamp.out { animation: stamp-in .2s ease-in reverse both; }

/* ============================================================================
   PERSON CARDS (tpl-person-card) + Woche board
   ========================================================================== */
#woche-cards {
  display: grid;
  gap: 16px;
}
.person-card {
  --person: #ffc21a;
  position: relative;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .25)),
    var(--night-2);
  border: 2px solid color-mix(in srgb, var(--person) 65%, #000);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .5),
    0 0 26px -6px var(--person),
    var(--shadow-deep);
  overflow: hidden;
}
.person-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 14px;
  background:
    radial-gradient(circle at 100% 50%, rgba(255, 255, 255, .25), transparent 50%),
    linear-gradient(90deg, var(--person), color-mix(in srgb, var(--person) 55%, #12002b) 100%);
  color: var(--ink);
  border-bottom: 2px solid rgba(0, 0, 0, .35);
}
.person-head::after {                                /* little bulb row along the head */
  content: '';
  position: absolute;
  left: 10px; right: 10px;
  top: 2px;
  height: 4px;
  background: radial-gradient(circle, rgba(255, 255, 255, .9) 0 1px, transparent 2px) 0 0 / 10px 4px repeat-x;
  opacity: .7;
}
.person-emoji {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--ink);
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}
.person-name {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-marquee);
  font-size: 17px;
  letter-spacing: .03em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}
.person-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--gold-hi);
  white-space: nowrap;
}
.person-badge:empty { display: none; }
.person-tiles {
  display: grid;
  gap: 14px;
  padding: 14px 14px 16px 18px;
}
.person-tiles:empty { padding: 8px; }
.person-card.me { border-color: var(--gold); animation: glow-ring 2.4s ease-in-out infinite; }
.person-card.me .person-head::before {
  content: '★ DU';
  order: 99;
  font-family: var(--font-marquee);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--gold);
  color: var(--red-deep);
  border: 1px solid var(--ink);
}

/* ============================================================================
   BOARD + PAGES
   ========================================================================== */
#board { width: 100%; }
#board-tabs { display: none; }
.page {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
  padding: 10px 12px 24px;
}
.page > h2 {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(18px, 5vw, 26px);
  line-height: 1.15;
  text-align: center;
  color: var(--gold);
  text-shadow: 1px 1px 0 #7a5200, 2px 2px 0 #5a3b00, 0 0 14px rgba(255, 46, 147, .5);
  padding: 4px 8px 12px;
  overflow-wrap: anywhere;
}
.page > h2:empty { display: none; }
.page-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .25);
  border: 1px dashed rgba(255, 240, 168, .35);
}
#woche-open {
  font-family: var(--font-marquee);
  font-size: 13px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
}
.page .empty, .page > p.empty, #woche-cards > p, #chronik-list > p, #ruhm-podium > p {
  text-align: center;
  padding: 24px 16px;
  color: var(--cream);
  opacity: .85;
  font-size: 17px;
  border: 2px dashed rgba(255, 240, 168, .3);
  border-radius: 12px;
}

/* ---------------------------------------------------------------- Chronik */
#chronik-list { display: grid; gap: 10px; }
.chronik-round {
  position: relative;
  border-radius: 10px;
  background: var(--paper), var(--cream);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--red-deep), 0 8px 18px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.chronik-round::before {                             /* red poster band */
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 8px;
  background: repeating-linear-gradient(180deg, var(--tent-red) 0 12px, var(--cream) 12px 16px);
}
.chronik-head {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title caret" "sub caret";
  align-items: center;
  column-gap: 10px;
  padding: 10px 14px 10px 20px;
  background: none;
  border: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.chronik-title {
  grid-area: title;
  font-family: var(--font-marquee);
  font-size: 14px;
  color: var(--tent-red);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chronik-sub { grid-area: sub; font-size: 14px; opacity: .75; }
.chronik-caret {
  grid-area: caret;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tent-red);
  color: var(--cream);
  font-size: 16px;
  transition: transform .25s;
}
.chronik-head[aria-expanded="true"] .chronik-caret { transform: rotate(180deg); }
.chronik-body {
  padding: 4px 14px 14px 20px;
  border-top: 2px dashed rgba(42, 10, 58, .25);
}
.chronik-lines { display: grid; gap: 4px; padding-top: 8px; }
.chronik-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 4px 0;
  border-bottom: 1px dotted rgba(42, 10, 58, .2);
  font-size: 15px;
}
.cl-emoji { font-size: 18px; width: 24px; text-align: center; }
.cl-chore { font-weight: 700; }
.cl-arrow { color: var(--tent-red); font-family: var(--font-marquee); font-size: 12px; }
.cl-name { font-weight: 700; }
.cl-status { margin-left: auto; font-size: 13px; opacity: .85; white-space: nowrap; }
.chronik-line.done .cl-status { color: #0f7a54; font-weight: 700; }
.chronik-line.missed { opacity: .75; }
.chronik-line.missed .cl-chore { text-decoration: line-through; }
.chronik-line.missed .cl-status { color: var(--red-deep); font-weight: 700; }
.chronik-line.free .cl-chore { color: #0f7a54; }
.chronik-events { padding-top: 8px; display: grid; gap: 2px; }
.chronik-events li { font-size: 13px; font-style: italic; opacity: .8; }
#btn-chronik-more { width: 100%; margin-top: 14px; }

/* ---------------------------------------------------------------- Ruhm */
#ruhm-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 0 auto 14px;
  max-width: 420px;
  border: 2px solid var(--gold-deep);
  border-radius: 999px;
  padding: 3px;
  background: rgba(0, 0, 0, .35);
}
#ruhm-toggle button {
  flex: 1 1 0;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gold-hi);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
#ruhm-toggle button.active, #ruhm-toggle button[aria-selected="true"] {
  background: var(--gold-metal);
  color: var(--red-deep);
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, .4);
}
#ruhm-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 10px 6px 0;
  margin-bottom: 18px;
}
#ruhm-podium:empty { display: none; }
.podium-step {
  --h: 48px;
  --block: linear-gradient(180deg, #d99a4a, #8a4b1a);
  flex: 1 1 0;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.podium-step[data-rank="1"] { order: 2; --h: 96px; --block: var(--gold-metal); }
.podium-step[data-rank="2"] { order: 1; --h: 68px; --block: linear-gradient(180deg, #f2f2f2, #8f8f8f); }
.podium-step[data-rank="3"] { order: 3; --h: 48px; }
.podium-emoji {
  font-size: 40px;
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6));
  animation: bob 2s ease-in-out infinite;
}
.podium-step[data-rank="1"] .podium-emoji { font-size: 52px; position: relative; }
.podium-step[data-rank="1"] .podium-emoji::before {
  content: '👑';
  position: absolute;
  top: -22px; left: 50%;
  font-size: 26px;
  transform: translateX(-50%) rotate(-10deg);
}
.podium-name {
  width: 100%;
  margin-top: 6px;
  font-family: var(--font-marquee);
  font-size: 12px;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-points {
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 194, 26, .6);
  margin-bottom: 4px;
}
.podium-block {
  position: relative;
  width: 100%;
  height: var(--h);
  border-radius: 8px 8px 0 0;
  background: var(--block);
  border: 2px solid var(--ink);
  border-bottom: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 30px;
  color: var(--red-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .5), inset 0 -8px 12px rgba(0, 0, 0, .25);
}
.podium-block::before {                              /* bulbs along the top edge */
  content: '';
  position: absolute;
  left: 4px; right: 4px; top: -5px;
  height: 10px;
  background: radial-gradient(circle, var(--bulb-on) 0 2.5px, transparent 3.5px) 0 0 / 14px 10px repeat-x;
  filter: drop-shadow(0 0 3px var(--bulb-on));
  animation: chase 1s steps(4) infinite;
}
#ruhm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper), var(--cream);
  color: var(--ink);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 0 var(--red-deep), 0 8px 18px rgba(0, 0, 0, .45);
  table-layout: auto;
}
#ruhm-table th {
  padding: 8px 6px;
  background: var(--tent-red);
  color: var(--cream);
  font-family: var(--font-marquee);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .04em;
  text-align: left;
}
#ruhm-table th:nth-child(n+3), #ruhm-table td:nth-child(n+3) { text-align: right; }
#ruhm-table td {
  padding: 8px 6px;
  border-bottom: 1px dashed rgba(42, 10, 58, .2);
  font-size: 15px;
  vertical-align: middle;
}
#ruhm-table tbody tr:last-child td { border-bottom: 0; }
.rr-rank { font-family: var(--font-title); color: var(--tent-red); width: 32px; text-align: center; }
.rr-who { width: 99%; }
.rr-emoji { font-size: 20px; margin-right: 6px; vertical-align: middle; }
.rr-name {
  display: inline-block;
  max-width: 34vw;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.rr-titles { margin-left: 4px; font-size: 14px; letter-spacing: .04em; vertical-align: middle; }
.rr-points { font-weight: 700; white-space: nowrap; }
.rr-rate, .rr-streak { white-space: nowrap; }
.ruhm-row.me td { background: rgba(255, 194, 26, .28); }
.ruhm-row.me .rr-rank { color: var(--red-deep); }
#ruhm-titles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 4px;
}
.title-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: var(--gold-metal);
  color: var(--red-deep);
  border: 2px solid var(--red-deep);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 0 var(--red-deep), 0 0 12px rgba(255, 194, 26, .5);
}
.tb-icon { font-size: 18px; line-height: 1; }
#ruhm-shame {
  margin: 14px 0 6px;
  padding: 10px 14px 12px;
  border: 3px dashed var(--tent-red);
  border-radius: 12px;
  background: repeating-linear-gradient(-45deg, rgba(230, 0, 45, .12) 0 8px, rgba(230, 0, 45, .04) 8px 16px);
}
#ruhm-shame h3 {
  font-family: var(--font-marquee);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 46, 147, .6);
  margin-bottom: 6px;
}
.shame-item { padding: 4px 0; font-size: 15px; border-bottom: 1px dotted rgba(255, 243, 214, .25); }
.shame-item:last-child { border-bottom: 0; }
#ruhm-respins {
  text-align: center;
  padding: 12px 0 0;
  font-size: 14px;
  opacity: .75;
}
#ruhm-respins:empty { display: none; }

/* ============================================================================
   6.7 TAB BAR (portrait) — four torn tickets
   ========================================================================== */
#tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: flex;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 8px var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--cream);
  clip-path: polygon(
    0 8px, 2.08% 0, 4.17% 8px, 6.25% 0, 8.33% 8px, 10.42% 0, 12.5% 8px, 14.58% 0, 16.67% 8px, 18.75% 0,
    20.83% 8px, 22.92% 0, 25% 8px, 27.08% 0, 29.17% 8px, 31.25% 0, 33.33% 8px, 35.42% 0, 37.5% 8px, 39.58% 0,
    41.67% 8px, 43.75% 0, 45.83% 8px, 47.92% 0, 50% 8px, 52.08% 0, 54.17% 8px, 56.25% 0, 58.33% 8px, 60.42% 0,
    62.5% 8px, 64.58% 0, 66.67% 8px, 68.75% 0, 70.83% 8px, 72.92% 0, 75% 8px, 77.08% 0, 79.17% 8px, 81.25% 0,
    83.33% 8px, 85.42% 0, 87.5% 8px, 89.58% 0, 91.67% 8px, 93.75% 0, 95.83% 8px, 97.92% 0, 100% 8px,
    100% 100%, 0 100%);
}
#tabbar a {
  position: relative;
  flex: 1 1 0;
  display: block;
  min-width: 0;
  min-height: 48px;
  padding: 14px 2px 0;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  font-family: var(--font-marquee);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .02em;
  color: var(--tent-red);
  border-left: 2px dashed rgba(42, 10, 58, .3);
  background: var(--paper);
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
#tabbar a:first-child { border-left: 0; }
#tabbar a::first-letter { font-size: 20px; }
#tabbar a.active, #tabbar a[aria-current="page"] {
  background: var(--gold-metal);
  color: var(--red-deep);
  text-shadow: 0 1px 0 #fff0a8;
}
#tabbar a.active::before, #tabbar a[aria-current="page"]::before {  /* bulb dots */
  content: '';
  position: absolute;
  left: 8px; right: 8px; top: 3px;
  height: 6px;
  background: radial-gradient(circle, #fff 0 1.5px, var(--tent-red) 1.5px 2.5px, transparent 3px) 0 0 / 10px 6px repeat-x;
  animation: bulb-twinkle 1s steps(2) infinite;
}
#tabbar a.active::after, #tabbar a[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px; bottom: 3px;
  height: 6px;
  background: radial-gradient(circle, #fff 0 1.5px, var(--tent-red) 1.5px 2.5px, transparent 3px) 5px 0 / 10px 6px repeat-x;
  animation: bulb-twinkle 1s steps(2) infinite reverse;
}

/* ============================================================================
   TICKER (fixed, above the tab bar)
   ========================================================================== */
#ticker {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  height: var(--ticker-h);
  z-index: 40;
  background: var(--night);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 0 12px rgba(255, 194, 26, .45), inset 0 0 12px rgba(25, 230, 255, .15);
  overflow: hidden;
  font-family: var(--font-marquee);
  font-size: 13px;
  line-height: calc(var(--ticker-h) - 4px);
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan), 0 0 14px rgba(25, 230, 255, .6);
  white-space: nowrap;
}
.ticker-track { width: 100%; overflow: hidden; }
#ticker-text {
  display: inline-block;
  padding-left: 100%;
  animation: ticker var(--ticker-dur, 40s) linear infinite;
  will-change: transform;
}

/* ============================================================================
   FX canvas, banners, toasts
   ========================================================================== */
#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
}
#banner-host {
  position: fixed;
  top: calc(var(--canopy-h) + var(--safe-t));
  left: 0; right: 0;
  z-index: 95;
  display: grid;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
}
.banner {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100%, 760px);
  padding: 12px 48px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 50%),
    var(--gold-metal);
  color: var(--red-deep);
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 50%, 100% 100%, 0 100%, 26px 50%);
  text-align: center;
  animation: banner-in .35s cubic-bezier(.34, 1.56, .64, 1) both;
}
.banner::before, .banner::after {                    /* bulb rows */
  content: '';
  position: absolute;
  left: 34px; right: 34px;
  height: 8px;
  background: radial-gradient(circle, #fff 0 2px, transparent 3px) 0 0 / 12px 8px repeat-x;
  animation: chase 1s steps(4) infinite;
  opacity: .9;
}
.banner::before { top: 3px; }
.banner::after { bottom: 3px; animation-direction: reverse; }
.banner-text {
  display: block;
  font-family: var(--font-marquee);
  font-size: clamp(18px, 4.6vw, 34px);
  line-height: 1.1;
  letter-spacing: .02em;
  text-shadow: 0 2px 0 var(--gold-hi), 0 3px 0 #7a5200;
  animation: banner-text .5s cubic-bezier(.34, 1.56, .64, 1) both;
  overflow-wrap: anywhere;
}
.banner-sub { display: block; font-weight: 700; font-size: clamp(13px, 3vw, 18px); margin-top: 2px; }
.banner-sub:empty { display: none; }
.banner.red {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .25), rgba(255, 255, 255, 0) 50%),
    linear-gradient(180deg, #ff3d5e, #e6002d 55%, #9b0020);
  color: var(--cream);
  border-color: var(--gold);
}
.banner.red .banner-text { text-shadow: 0 2px 0 #7a0018, 0 0 12px rgba(255, 46, 147, .8); }
.banner.cyan {
  background: linear-gradient(180deg, #24106a, #12002b);
  color: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 18px var(--neon-cyan);
}
.banner.cyan .banner-text { text-shadow: 0 0 8px var(--neon-cyan), 0 0 24px var(--neon-cyan); }
.banner.cyan::before, .banner.cyan::after { background-image: radial-gradient(circle, var(--neon-cyan) 0 2px, transparent 3px); }
.banner.out, .banner.exit { animation: banner-out .25s ease-in forwards; }

#toast-host {
  position: fixed;
  top: calc(var(--canopy-h) + var(--safe-t) + 96px);
  right: calc(12px + var(--safe-r));
  left: calc(12px + var(--safe-l));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: min(100%, 440px);
  padding: 10px 16px 10px 14px;
  border-radius: 8px 12px 12px 8px;
  border-left: 10px solid var(--tent-red);
  background: var(--paper), var(--cream);
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  box-shadow: 0 4px 0 var(--red-deep), 0 10px 20px rgba(0, 0, 0, .5);
  animation: toast-in .35s cubic-bezier(.2, 1.2, .3, 1) both;
}
.toast.error { border-left-color: var(--red-deep); background: linear-gradient(180deg, #ffd9d9, #ffb8c2); color: var(--red-deep); }
.toast.gold { border-left-color: var(--red-deep); background: var(--gold-metal); color: var(--red-deep); box-shadow: 0 4px 0 var(--red-deep), 0 0 16px rgba(255, 194, 26, .6); }
.toast.out, .toast.hide { animation: toast-out .3s ease-in forwards; }

/* ============================================================================
   6.7 MODALS & TICKET BOOTHS
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8, 0, 20, .72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: modal-fade .2s ease-out both;
}
.booth {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  border-radius: 20px 20px 0 0;
  background: var(--wood-grain);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .7), inset 0 0 0 2px rgba(0, 0, 0, .4);
  overflow: hidden;
  animation: sheet-up .3s cubic-bezier(.2, .9, .3, 1.05) both;
}
.booth::before {                                     /* vertical grain */
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .12) 0 2px, transparent 2px 11px);
  pointer-events: none;
}
.booth.shake { animation: booth-shake .3s ease-in-out; }
.booth-awning {
  position: relative;
  z-index: 2;
  flex: none;
  height: 28px;
  background: var(--stripes);
  -webkit-mask:
    linear-gradient(#000, #000) 0 0 / 100% calc(100% - 12px) no-repeat,
    radial-gradient(circle at 22px 0, #000 12px, transparent 13px) 0 100% / 44px 13px repeat-x;
          mask:
    linear-gradient(#000, #000) 0 0 / 100% calc(100% - 12px) no-repeat,
    radial-gradient(circle at 22px 0, #000 12px, transparent 13px) 0 100% / 44px 13px repeat-x;
}
.booth-marquee {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 18px 40px 12px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 6px, var(--bulb-on) 0 3.5px, rgba(255, 224, 138, .35) 4.5px, transparent 7px) 0 0 / 12.5% 14px repeat-x,
    radial-gradient(circle at 50% 8px, var(--bulb-on) 0 3.5px, rgba(255, 224, 138, .35) 4.5px, transparent 7px) 0 100% / 12.5% 14px repeat-x,
    linear-gradient(180deg, #3a1470, #1d0745);
  border-bottom: 3px solid var(--gold-deep);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 168, .2), 0 4px 10px rgba(0, 0, 0, .5);
  animation: chase-marquee 1s steps(4) infinite;
}
.booth-marquee h2, .booth-marquee h3 {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(18px, 5vw, 26px);
  line-height: 1.15;
  color: var(--gold);
  text-shadow: 1px 1px 0 #7a5200, 2px 2px 0 #5a3b00, 0 0 14px rgba(255, 46, 147, .6);
  overflow-wrap: anywhere;
}
.booth-body {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px 18px calc(18px + var(--safe-b));
  color: var(--cream);
  scrollbar-width: thin;
  scrollbar-color: var(--gold-deep) transparent;
}
.booth-body h3 {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 19px;
  color: var(--gold);
  text-shadow: 1px 1px 0 #7a5200;
  margin: 8px 0 10px;
}
.booth-body > p, .booth-body section > p { margin-bottom: 12px; }
.booth-sub { font-size: 16px; opacity: .9; text-align: center; margin-bottom: 14px; }
.porthole {
  width: 88px; height: 88px;
  margin: 2px auto 12px;
  display: grid;
  place-items: center;
  font-size: 44px;
  line-height: 1;
  border: 6px solid var(--gold-deep);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a1a7a, var(--night) 70%);
  box-shadow:
    inset 0 0 14px rgba(0, 0, 0, .7),
    0 0 0 2px var(--gold-hi),
    0 0 0 4px #6a4400,
    0 6px 12px rgba(0, 0, 0, .55);
}
.booth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 12px;
  margin-top: 18px;
}
.booth-actions .btn { flex: 1 1 auto; }
.booth-actions .btn-primary { flex-basis: 100%; order: -1; }
.booth-foot {                                        /* sticky action row under a scrolling booth-body (reveal sheet) */
  position: relative;
  z-index: 1;
  flex: none;
  padding: 12px 18px calc(14px + var(--safe-b));
  border-top: 2px solid var(--gold-deep);
  background: rgba(0, 0, 0, .28);
  box-shadow: 0 -8px 16px rgba(0, 0, 0, .35);
}
.booth-foot .booth-actions { margin-top: 0; }
#gate-error {
  min-height: 0;
  margin: 0 0 12px;
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 46, 147, .6);
  font-weight: 700;
}
#gate-error:empty { display: none; }
#gate-form .btn { width: 100%; }
#confirm-text { font-size: 18px; line-height: 1.4; text-align: center; }
#identity-guest, #swap-cancel, #bs-close { width: 100%; margin-top: 12px; }

/* luggage-tag fields */
.tag-field {
  position: relative;
  margin: 0 0 14px 14px;
  padding: 8px 14px 10px 38px;
  border: 2px solid var(--ink);
  border-radius: 6px 16px 16px 6px;
  background:
    radial-gradient(circle at 18px 50%, var(--wood-2) 5px, var(--gold-deep) 5.5px 8px, transparent 8.5px),
    var(--paper),
    var(--cream);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 6px 12px rgba(0, 0, 0, .35);
}
.tag-field::before {                                 /* string */
  content: '';
  position: absolute;
  left: -16px; top: calc(50% - 10px);
  width: 16px; height: 6px;
  border-top: 2px solid #e9d7a8;
  border-radius: 8px 0 0 0;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, .4);
}
.tag-field label {
  display: block;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .8;
}
.tag-field input:not([type="checkbox"]), .tag-field select {
  display: block;
  width: 100%;
  min-height: 48px;                                  /* §6.10 tap target */
  padding: 2px 0;
  border: 0;
  border-bottom: 2px dashed rgba(42, 10, 58, .5);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  font-size: 19px;
  outline: none;
}
.tag-field input:focus-visible, .tag-field select:focus-visible { box-shadow: none; outline: none; border-bottom-color: var(--tent-red); border-bottom-style: solid; }
.tag-field:focus-within { box-shadow: 0 0 0 3px var(--neon-cyan), 0 3px 0 rgba(0, 0, 0, .45); }
.tag-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%23e6002d' stroke-width='2.5'/%3E%3C/svg%3E") right 4px center / 16px no-repeat;
  cursor: pointer;
}
.tag-field select option { color: var(--ink); background: var(--cream); }
.tag-field.tag-check {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  padding-bottom: 6px;
  min-height: 56px;
}
.tag-field.tag-check label { font-size: 15px; text-transform: none; letter-spacing: 0; opacity: 1; flex: 1; }
/* 48 px hit box drawn as a 30 px ticket check (§6.10) — same recipe as .ob-row */
.tag-field input[type="checkbox"] {
  -webkit-appearance: none;
          appearance: none;
  flex: none;
  width: 48px; height: 48px;
  margin: 0 -9px 0 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  accent-color: var(--tent-red);
  cursor: pointer;
}
.tag-field input[type="checkbox"]::before {
  content: '';
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .08);
  color: var(--cream);
  font: 700 20px/1 var(--font-body);
  transition: background .12s, transform .12s;
}
.tag-field input[type="checkbox"]:checked::before {
  content: '✔';
  background: var(--tent-red);
  border-color: var(--red-deep);
}
.tag-field input[type="checkbox"]:active::before { transform: scale(.92); }
.tag-field input[type="checkbox"]:focus-visible { outline-offset: -6px; box-shadow: none; }
.tag-field input[type="password"] { letter-spacing: .2em; }
.tag-input {                                         /* standalone cream input (ob rows, confirm) */
  min-height: 48px;                                  /* §6.10 tap target */
  padding: 4px 8px;
  border: 0;
  border-bottom: 2px dashed rgba(42, 10, 58, .5);
  border-radius: 4px 4px 0 0;
  background: rgba(255, 255, 255, .5);
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  outline: none;
}
.tag-input:focus-visible { box-shadow: none; border-bottom: 2px solid var(--tent-red); }
#confirm-input {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 8px;
  min-height: 48px;                                  /* §6.10 tap target */
  padding: 8px 12px;
  text-align: center;
  font-family: var(--font-marquee);
  font-size: 16px;
}
form .btn[type="submit"] { width: 100%; margin-top: 4px; }

/* emoji + colour pickers */
.emoji-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
  margin: -4px 0 14px 14px;
}
.emoji-option {
  min-height: 48px;
  font-size: 26px;
  line-height: 1;
  border-radius: 10px;
  border: 2px solid rgba(255, 240, 168, .25);
  background: rgba(255, 243, 214, .08);
  transition: transform .1s, background .15s;
}
.emoji-option:hover { background: rgba(255, 243, 214, .18); transform: scale(1.08); }
.emoji-option.selected, .emoji-option[aria-pressed="true"] {
  border-color: var(--gold);
  background: rgba(255, 194, 26, .3);
  box-shadow: 0 0 12px rgba(255, 194, 26, .7);
}
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px 14px;
}
.color-option {
  --c: #ffc21a;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid var(--cream);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .6), transparent 40%), var(--c);
  box-shadow: 0 0 0 2px var(--ink), 0 0 14px -2px var(--c);
  transition: transform .1s;
}
.color-option:hover { transform: scale(1.1); }
.color-option.selected, .color-option[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 5px var(--gold), 0 0 16px var(--c);
}
.color-option.selected::after, .color-option[aria-pressed="true"]::after {
  content: '✔';
  color: var(--ink);
  font-weight: 700;
  font-size: 20px;
  text-shadow: 0 0 3px #fff, 0 0 6px #fff;
}
.emoji-btn {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #fff;
  font-size: 26px;
  line-height: 1;
}

/* onboarding rows */
.ob-list { display: grid; gap: 8px; margin: 0 0 12px; }
.ob-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 10px;
  border-radius: 8px 14px 14px 8px;
  background: var(--paper), var(--cream);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}
.ob-row .tag-input { flex: 1 1 auto; min-width: 0; }
/* 48 px hit box drawn as a 30 px ticket check (the native 28 px box was the only toggle in the row) */
.ob-row input[type="checkbox"] {
  -webkit-appearance: none;
          appearance: none;
  flex: none;
  width: 48px; height: 48px;
  margin: -4px -8px;
  padding: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  accent-color: var(--tent-red);
}
.ob-row input[type="checkbox"]::before {
  content: '';
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .08);
  color: var(--cream);
  font: 700 20px/1 var(--font-body);
  transition: background .12s, transform .12s;
}
.ob-row input[type="checkbox"]:checked::before {
  content: '✔';
  background: var(--tent-red);
  border-color: var(--red-deep);
}
.ob-row input[type="checkbox"]:active::before { transform: scale(.92); }
.ob-row input[type="checkbox"]:focus-visible { outline-offset: -6px; box-shadow: none; }
.ob-emoji { flex: none; font-size: 24px; }
.ob-name { flex: 1 1 auto; min-width: 0; font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-weight { flex: none; color: var(--gold-deep); font-size: 12px; letter-spacing: .15em; }
.ob-rhythm { flex: none; font-size: 12px; opacity: .75; }
.ob-row .btn-link[data-action="remove"] { flex: none; min-width: 48px; justify-content: center; text-decoration: none; font-size: 20px; }
#ob-steps section > h3 { text-align: center; font-size: 22px; }
#ob-add-person, #ob-add-chore { width: 100%; }
#ob-steps .ob-list + .btn { margin-bottom: 12px; }

/* identity + swap options */
.identity-list, #swap-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.identity-option .btn, .swap-option .btn {
  width: 100%;
  min-height: 72px;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.identity-option .btn > span:first-child, .swap-option .btn > span:first-child { font-size: 30px; line-height: 1; }
.identity-option .btn > span:last-child, .swap-option .btn > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-option.selected .btn, .identity-option .btn[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--gold), 0 6px 0 var(--red-deep); }
#swap-list { grid-template-columns: 1fr; }
.swap-option .btn { flex-direction: row; justify-content: flex-start; min-height: 60px; text-align: left; }
.swap-option .btn > span:last-child { flex: 1 1 auto; white-space: normal; }

/* seat popover */
#seat-chores { display: grid; gap: 8px; margin-bottom: 12px; }
.seat-chore {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 6px 6px 12px;
  border-radius: 8px 14px 14px 8px;
  background: var(--paper), var(--cream);
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
}
.seat-chore > span:first-child { font-size: 24px; }
.seat-chore > span:nth-child(2) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-chore .btn-stamp { min-height: 48px; padding: 4px 10px; font-size: 11px; }
.seat-chore.done { opacity: .75; }
.seat-chore.done > span:nth-child(2) { text-decoration: line-through; }
#seat-last { font-size: 15px; opacity: .9; text-align: center; margin-bottom: 4px; }
#seat-last:empty { display: none; }

/* reveal sheet */
#reveal-list { display: grid; gap: 8px; margin-bottom: 14px; }
.reveal-item {
  --person: #ffc21a;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr);
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 12px;
  border-left: 10px solid var(--person);
  border-radius: 8px 14px 14px 8px;
  background: var(--paper), var(--cream);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 0 14px -4px var(--person);
  animation: reveal-pop .4s cubic-bezier(.2, 1.2, .3, 1) both;
}
.reveal-item:nth-child(1) { animation-delay: .05s; }
.reveal-item:nth-child(2) { animation-delay: .12s; }
.reveal-item:nth-child(3) { animation-delay: .19s; }
.reveal-item:nth-child(4) { animation-delay: .26s; }
.reveal-item:nth-child(5) { animation-delay: .33s; }
.reveal-item:nth-child(6) { animation-delay: .40s; }
.reveal-item:nth-child(7) { animation-delay: .47s; }
.reveal-item:nth-child(8) { animation-delay: .54s; }
.reveal-item:nth-child(9) { animation-delay: .61s; }
.reveal-item:nth-child(10) { animation-delay: .68s; }
.reveal-item:nth-child(11) { animation-delay: .75s; }
.reveal-item:nth-child(n+12) { animation-delay: .82s; }
.ri-person, .ri-chore { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ri-person > span:first-child, .ri-chore > span:first-child { font-size: 24px; line-height: 1; flex: none; }
.ri-person > span:last-child { font-family: var(--font-marquee); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-chore { justify-content: flex-end; text-align: right; }
.ri-chore > span:last-child { font-weight: 700; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ri-arrow { font-family: var(--font-marquee); color: var(--tent-red); font-size: 14px; }
.reveal-item.free {
  background:
    repeating-linear-gradient(45deg, rgba(46, 230, 166, .18) 0 10px, transparent 10px 20px),
    var(--cream);
}
.reveal-item.free .ri-chore > span:last-child { color: #0f7a54; }
.reveal-item.hardest {
  outline: 3px solid var(--tent-red);
  outline-offset: -3px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .45), 0 0 18px rgba(230, 0, 45, .7);
  animation: reveal-pop .4s cubic-bezier(.2, 1.2, .3, 1) both, hardest-shiver .3s ease-in-out 1s 3;
}
.reveal-item.hardest .ri-chore > span:last-child { color: var(--tent-red); }
#reveal-fair { text-align: center; font-size: 15px; opacity: .85; font-style: italic; }
#reveal-fair:empty { display: none; }

/* backstage */
#bs-tabs {
  display: flex;
  gap: 4px;
  margin: -4px 0 16px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(255, 240, 168, .2);
}
#bs-tabs button {
  flex: 1 1 0;
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--gold-hi);
  font-family: var(--font-marquee);
  font-size: 13px;
}
#bs-tabs button.active, #bs-tabs button[aria-selected="true"] {
  background: var(--gold-metal);
  color: var(--red-deep);
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, .4);
}
.bs-list { display: grid; gap: 8px; margin-bottom: 18px; }
.bs-item {
  --person: #ffc21a;
  display: grid;
  grid-template-columns: 10px 40px minmax(0, 1fr);
  grid-template-areas: "swatch emoji name" "swatch emoji sub" "swatch emoji actions";
  align-items: center;
  column-gap: 10px;
  padding: 8px 12px 6px 8px;
  border-radius: 8px 14px 14px 8px;
  background: var(--paper), var(--cream);
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, .4), 0 6px 12px rgba(0, 0, 0, .3);
}
#bs-chores .bs-item { grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "emoji name" "emoji sub" "emoji actions"; }
.bs-swatch {
  grid-area: swatch;
  align-self: stretch;
  border-radius: 4px;
  background: var(--person);
  box-shadow: 0 0 0 1px var(--ink), 0 0 8px var(--person);
}
.bs-emoji { grid-area: emoji; text-align: center; font-size: 28px; line-height: 1; }
.bs-name { grid-area: name; font-weight: 700; font-size: 18px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-sub { grid-area: sub; font-size: 13px; opacity: .8; }
.bs-sub:empty { display: none; }
.bs-actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 0 14px; }
.bs-actions .btn-link { min-height: 48px; padding: 2px 0; font-size: 14px; }
.bs-item.absent { opacity: .7; }
.bs-item.absent .bs-name::after { content: ' 🏝️'; }
.bs-item.editing { box-shadow: 0 0 0 3px var(--gold), 0 3px 0 rgba(0, 0, 0, .4); }
.bs-danger {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 3px dashed var(--tent-red);
  border-radius: 12px;
  background: repeating-linear-gradient(-45deg, rgba(230, 0, 45, .16) 0 10px, rgba(0, 0, 0, .2) 10px 20px);
}
.bs-danger .btn { width: 100%; font-size: 13px; }
#btn-defaults { width: 100%; margin-top: 12px; }
#form-person, #form-chore, #form-house { margin-top: 6px; }

/* ============================================================================
   6.8 LAYOUT — landscape ≥ 900px
   ========================================================================== */
@media (min-width: 900px) and (orientation: landscape) {
  :root {
    /* §6.8 says 78dvh; 64dvh keeps the seat plates, #spin-hint AND the "Meine Ämtli" heading
       (with the first tile peeking) inside the column, above the fixed ticker */
    --stage: min(64vh, 50vw);
    --stage: min(64dvh, 50vw);
    /* 12dvh, but never less than the two 48 px rows of #top-actions parked in the sign band
       (4 + 48 + 8 + 48 = 108) — otherwise the pills sit on top of #board-tabs */
    --sign-h: max(116px, 12vh);
    --sign-h: max(116px, 12dvh);
  }
  html, body { height: 100%; overflow: hidden; }
  body { padding: var(--safe-t) var(--safe-r) 0 var(--safe-l); }
  body::after, html::after, html::before { display: none; }   /* no page scroll here — #wheel-col has its own fade */
  .canopy { z-index: 1; }
  .bunting { z-index: 1; }
  #stage { z-index: 2; }
  #sign {
    position: relative;
    z-index: 25;
    height: var(--sign-h);
    padding: 0 16px;
    align-items: center;
  }
  .sign-board {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-width: 0;
    padding: 12px 40px;
    border-radius: 22px;
  }
  .sign-board::before, .sign-board::after { left: 14px; right: 14px; }
  .sign-board::before { top: 2px; }
  .sign-board::after { bottom: 1px; }
  .sign-strap { margin: 0; }
  h1#house-name { font-size: clamp(22px, 4.6vh, 44px); }
  #sign-sub { margin: 0; }
  #top-actions {
    position: absolute;
    top: 4px;
    right: 12px;
    z-index: 26;
    max-width: 290px;
    padding: 0;
    flex-wrap: wrap;
    gap: 8px 6px;                                    /* row pitch 48 px = the buttons' hit boxes */
    justify-content: flex-end;
  }
  #top-actions button {
    flex: 0 1 auto;
    min-height: 48px;                                /* §6.10 tap target */
    font-size: 11px;
    padding: 0 10px;
    white-space: nowrap;
  }
  #midway {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 96px minmax(320px, .8fr);
    grid-template-areas: "wheel lever board";
    height: calc(100vh - var(--sign-h) - 28px);
    height: calc(100dvh - var(--sign-h) - 28px);
    gap: 0 12px;
    padding: 0 16px 6px;
    align-items: stretch;
  }
  #wheel-col {
    grid-area: wheel;
    min-height: 0;
    overflow: auto;
    justify-content: flex-start;
    padding-top: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-deep) transparent;
    /* scroll fade: the "Meine Ämtli" tiles peeking under the column bottom read as a scroll
       affordance instead of a clipping bug. Scroll-driven (fade only while there is overflow,
       top fade once scrolled) where supported, static bottom fade elsewhere. */
    --col-fade-t: 0px;
    --col-fade-b: 64px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--col-fade-t), #000 calc(100% - var(--col-fade-b)), transparent 100%);
            mask-image: linear-gradient(to bottom, transparent 0, #000 var(--col-fade-t), #000 calc(100% - var(--col-fade-b)), transparent 100%);
  }
  @supports (animation-timeline: scroll()) {
    #wheel-col {
      --col-fade-b: 0px;
      animation: col-fade linear both;
      animation-timeline: scroll(self block);
    }
  }
  #wheel-wrap { flex: none; }
  #spin-hint { font-size: 17px; letter-spacing: .12em; padding: 2px 12px; }   /* lever is static here */
  #mine { padding: 6px 0 0; }
  #mine-list .tile { flex-basis: min(82vw, 320px); }
  #last-spin { padding: 4px 14px 10px; }
  body[data-tab="woche"] #last-spin:not(:empty) { display: block; }
  #lever {
    grid-area: lever;
    position: static;
    width: 90px;
    height: 220px;
    align-self: center;
    justify-self: center;
  }
  body:not([data-tab="rad"]) #lever:not([hidden]) { display: block; }
  #board, body[data-tab="rad"]:not(.kiosk) #board {
    grid-area: board;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    border-radius: 16px;
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(255, 240, 168, .18);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, .35);
  }
  #board-tabs {
    display: flex;
    flex: none;
    gap: 4px;
    padding: 8px 8px 0;
  }
  #board-tabs button {
    flex: 1 1 0;
    min-height: 48px;
    border: 0;
    border-radius: 10px 10px 0 0;
    background: var(--paper), var(--cream);
    color: var(--tent-red);
    font-family: var(--font-marquee);
    font-size: 12px;
    clip-path: polygon(0 6px, 6% 0, 12% 6px, 18% 0, 24% 6px, 30% 0, 36% 6px, 42% 0, 48% 6px, 54% 0, 60% 6px, 66% 0, 72% 6px, 78% 0, 84% 6px, 90% 0, 96% 6px, 100% 0, 100% 100%, 0 100%);
    padding-top: 6px;
  }
  #board-tabs button.active, #board-tabs button[aria-selected="true"] {
    background: var(--gold-metal);
    color: var(--red-deep);
  }
  .page {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    max-width: none;
    padding: 12px 14px 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--gold-deep) transparent;
  }
  #tabbar { display: none; }
  #ticker { bottom: 0; }
  #sound-pill { bottom: calc(var(--ticker-h) + 14px); }
  .ferris { bottom: calc(var(--ticker-h) - 20px); }
  .modal { align-items: center; padding: 24px; }
  .booth {
    max-width: 520px;
    border-radius: 20px;
    animation: card-in .25s cubic-bezier(.2, 1.1, .3, 1) both;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .8), 0 0 0 2px var(--gold-deep);
  }
  .booth-body { padding-bottom: 20px; }
  #toast-host { top: calc(var(--sign-h) + 96px); left: auto; max-width: 460px; }
  #banner-host { top: var(--sign-h); }
}

/* ---------------------------------------------------------------- TV ≥ 1600 px */
@media (min-width: 1600px) and (orientation: landscape) {
  body { font-size: 18px; }
  .tile-name { font-size: 22px; }
  .tile-emoji { font-size: 40px; }
  .person-name { font-size: 20px; }
  #ticker { --ticker-h: 34px; font-size: 18px; }
  #board-tabs button { font-size: 14px; min-height: 52px; }
  .btn { font-size: 17px; }
  #midway { grid-template-columns: minmax(0, 1.2fr) 120px minmax(380px, .8fr); }
  #lever { width: 110px; height: 260px; }
}

/* ---------------------------------------------------------------- kiosk (?kiosk=1) */
html.kiosk, body.kiosk { --stage: min(86vh, 50vw); --stage: min(86dvh, 50vw); }
html.kiosk #lever, body.kiosk #lever,
html.kiosk #top-actions, body.kiosk #top-actions,
html.kiosk #tabbar, body.kiosk #tabbar,
html.kiosk #mine, body.kiosk #mine,
html.kiosk #sound-pill, body.kiosk #sound-pill { display: none !important; }
html.kiosk #ticker, body.kiosk #ticker { bottom: 0; }
html.kiosk body::after, body.kiosk::after { bottom: calc(var(--ticker-h) + var(--safe-b)); }
@media (min-width: 900px) and (orientation: landscape) {
  html.kiosk #midway, body.kiosk #midway { grid-template-columns: minmax(0, 1.3fr) 0 minmax(320px, .7fr); }
}

/* ============================================================================
   6.9 REDUCED MOTION — html.calm and the OS preference
   ========================================================================== */
html.calm .rays,
html.calm .flag,
html.calm .spot,
html.calm .ferris circle, html.calm .ferris g, html.calm .ferris use,
html.calm .sign-board::before, html.calm .sign-board::after,
html.calm h1#house-name,
html.calm #sign-sub,
html.calm #spin-hint,
html.calm #sound-pill,
html.calm .booth-marquee,
html.calm .podium-emoji,
html.calm .podium-block::before,
html.calm .banner::before, html.calm .banner::after,
html.calm #tabbar a::before, html.calm #tabbar a::after,
html.calm .person-card.me,
html.calm #lever-tag,
html.calm .chip { animation: none !important; }
html.calm .spot { transform: rotate(0deg); transition: none; opacity: .6; }
html.calm #ticker-text { animation: none !important; padding-left: 0; }
html.calm .ticker-track { text-align: center; text-overflow: ellipsis; }
html.calm canvas#wheel { filter: none; }
html.calm h1#house-name { filter: drop-shadow(1px 1px 0 #7a5200) drop-shadow(1px 1px 0 #5a3b00) drop-shadow(0 0 6px #ff2e93); }
html.calm .banner, html.calm .banner-text { animation: modal-fade .2s ease-out both; }
html.calm .banner.out, html.calm .banner.exit { animation: modal-fade .2s ease-in reverse forwards; }
html.calm .toast { animation: modal-fade .2s ease-out both; }
html.calm .toast.out, html.calm .toast.hide { animation: modal-fade .25s ease-in reverse forwards; }
html.calm .booth { animation: modal-fade .2s ease-out both; }
html.calm .reveal-item { animation: none; }
html.calm .tile-stamp { animation: modal-fade .2s ease-out both; }
html.calm .lever-arm { transition: transform .2s ease-out; }
html.calm .person-card.me { box-shadow: 0 0 0 3px var(--gold), var(--shadow-deep); }

@media (prefers-reduced-motion: reduce) {
  .rays, .flag, .spot,
  .ferris circle, .ferris g, .ferris use,
  .sign-board::before, .sign-board::after,
  h1#house-name, #sign-sub, #spin-hint, #sound-pill,
  .booth-marquee, .podium-emoji, .podium-block::before,
  .banner::before, .banner::after,
  #tabbar a::before, #tabbar a::after,
  .person-card.me, #lever-tag, .chip { animation: none !important; }
  .spot { transform: rotate(0deg); transition: none; opacity: .6; }
  #ticker-text { animation: none !important; padding-left: 0; }
  .ticker-track { text-align: center; text-overflow: ellipsis; }
  canvas#wheel { filter: none; }
  .banner, .banner-text, .toast, .booth, .tile-stamp { animation: modal-fade .2s ease-out both; }
  .banner.out, .banner.exit, .toast.out, .toast.hide { animation: modal-fade .2s ease-in reverse forwards; }
  .reveal-item { animation: none; }
  .person-card.me { box-shadow: 0 0 0 3px var(--gold), var(--shadow-deep); }
}

/* ---------------------------------------------------------------- print (why not) */
@media print {
  .rays, .canopy, .bunting, .spot, .ferris, .vignette, #lever, #tabbar, #ticker, #top-actions, #sound-pill, #fx { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
}
