/* 12by styles. Fonts are bundled in fonts/ (SIL Open Font License, from Google Fonts); artwork is in art/. */
@font-face { font-family: 'Alegreya SC'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/AlegreyaSC-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya SC'; font-style: normal; font-weight: 900; font-display: swap; src: url(fonts/AlegreyaSC-900.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bungee'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/Bungee-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cascadia Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/CascadiaMono-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Chewy'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/Chewy-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 500 900; font-display: swap; src: url(fonts/Cinzel-500_900.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/EBGaramond-400i.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/EBGaramond-400_700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/Fredoka-400_700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IM Fell English'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/IMFellEnglish-400i.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IM Fell English'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/IMFellEnglish-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lilita One'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/LilitaOne-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/Lora-400i.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/Lora-400_700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Monoton'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/Monoton-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Mountains of Christmas'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/MountainsofChristmas-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Mr Dafoe'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/MrDafoe-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Orbitron'; font-style: normal; font-weight: 500 900; font-display: swap; src: url(fonts/Orbitron-500_900.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(fonts/Outfit-400_800.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Pirata One'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/PirataOne-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/Rajdhani-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rajdhani'; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/Rajdhani-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Righteous'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/Righteous-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'UnifrakturMaguntia'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/UnifrakturMaguntia-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* =====================================================================
   Shared style machinery. Every style sets html[data-theme] (there is no
   unstyled default any more). Background art lives in art/, drawn as
   layers on body plus body::before / body::after, so it sits behind every
   screen. Screens are lifted above it.
   ===================================================================== */
body { position: relative; overflow: hidden; }
.screen { position: relative; z-index: 2; }
body::before, body::after { content: none; position: fixed; pointer-events: none; z-index: 0; background-repeat: no-repeat; }
#home::before, #home::after { pointer-events: none; }

/* Tiles: dealt in when a puzzle opens, and a little landing animation whenever one moves.
   Each style swaps the animation via --deal / --place. */
.tile.dealt { animation: var(--deal, tile-deal) .42s cubic-bezier(.2, .9, .3, 1.25) both; animation-delay: calc(var(--i, 0) * 32ms); }
.tile.moved { animation: var(--place, tile-pop) .3s ease-out; }
.ghost, .ghost.dealt, .ghost.moved { animation: none !important; }
@keyframes tile-deal { from { opacity: 0; transform: translateY(14px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes tile-pop { 0% { transform: scale(.82); } 60% { transform: scale(1.08); } 100% { transform: none; } }

/* Home menu buttons ease in one after another */
#home.active > .bigbtn, #home.active > .stats, #home.active > .winner { animation: home-in .45s ease-out both; }
#home.active > :nth-child(5) { animation-delay: .03s; } #home.active > :nth-child(6) { animation-delay: .06s; }
#home.active > :nth-child(7) { animation-delay: .09s; } #home.active > :nth-child(8) { animation-delay: .12s; }
#home.active > :nth-child(9) { animation-delay: .15s; } #home.active > :nth-child(10) { animation-delay: .18s; }
#home.active > :nth-child(11) { animation-delay: .21s; } #home.active > :nth-child(12) { animation-delay: .24s; }
@keyframes home-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Game controls stay on one row in every style */
.controls { flex-wrap: nowrap; gap: 5px; } .controls .iconbtn { padding: 0 8px; min-width: 0; white-space: nowrap; }
.arrows { gap: 3px; } .arrows .iconbtn { min-width: 32px; }

/* Win celebration: themed things rain down over everything for a moment */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.burst i { position: absolute; top: -40px; font-style: normal; font-size: var(--sz, 26px); line-height: 1;
  animation: burst-fall var(--dur, 2.4s) cubic-bezier(.3, .1, .6, 1) var(--delay, 0s) both; }
@keyframes burst-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 8% { opacity: 1; }
  85% { opacity: 1; } 100% { transform: translate(var(--drift, 0), 110vh) rotate(var(--spin, 360deg)); opacity: 0; } }
.burst .flash { position: absolute; inset: 0; animation: burst-flash .7s ease-out both; background: var(--flash, transparent); }
@keyframes burst-flash { from { opacity: .55; } to { opacity: 0; } }

/* Style picker: each option shows a slice of its artwork */
.swatch { width: 64px; height: 44px; background-size: cover; background-position: center; overflow: hidden; }
.swatch span { box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.themeopt { transition: transform .12s; } .themeopt:active { transform: scale(.98); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; }
  .burst { display: none; }
}

/* Title screen fit steps, added by fitHome() one at a time until nothing scrolls (beats every style's own sizes) */
html[data-theme] #home.fit1 { gap: 3px; padding-top: max(6px, env(safe-area-inset-top, 0px)); }
html[data-theme] #home.fit1 .bigbtn { padding-top: 5px; padding-bottom: 5px; }
html[data-theme] #home.fit1 .bigbtn.primary::after { height: 6px; margin-top: 0; }
html[data-theme] #home.fit1 .tagline { margin: 0; }
html[data-theme] #home.fit1 .stat { padding-top: 3px; padding-bottom: 3px; }
html[data-theme] #home.fit1 .winner { padding-top: 4px; padding-bottom: 4px; }
html[data-theme] #home.fit1 .logo { grid-template-columns: repeat(4, 34px); margin-bottom: 0; }
html[data-theme] #home.fit1 .logo span { width: 34px; height: 34px; font-size: 21px; }
html[data-theme] #home.fit2 .tagline, html[data-theme] #home.fit2 h1, html[data-theme] #home.fit2 .winner .wmsg,
html[data-theme] #home.fit2 .term-banner .dim, html[data-theme] #home.fit2 .term-tabs { display: none; }
html[data-theme] #home.fit2 .bigbtn b { font-size: 16px; }
html[data-theme] #home.fit2 .bigbtn small { font-size: 12px; }
html[data-theme] #home.fit2 .ascii { font-size: 9px; }
html[data-theme] #home.fit3 .bigbtn:not(.primary):not(.nine) small, html[data-theme] #home.fit3 .bigbtn.nine small.mid,
html[data-theme] #home.fit3 .winner .wsub, html[data-theme] #home.fit3 .ascii { display: none; }
html[data-theme] #home.fit3 .stat small { font-size: 10px; }
html[data-theme] #home.fit4 .logo, html[data-theme] #home.fit4 .term-banner { display: none; }
html[data-theme] #home.fit4 .bigbtn { padding-top: 3px; padding-bottom: 3px; }

/* Sort toggle on the Greatest players screen sits on the background art, so give it a solid backing in every style */
html[data-theme] #hallSort, html[data-theme] #hallMode, html[data-theme] #leadersMode { background: rgba(8, 10, 18, .82); box-shadow: 0 2px 8px rgba(0,0,0,.25); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
html[data-theme] #hallSort button:not(.on), html[data-theme] #hallMode button:not(.on), html[data-theme] #leadersMode button:not(.on) { color: var(--ink); opacity: .85; }
html[data-theme="poop"] #hallSort, html[data-theme="hotdog"] #hallSort, html[data-theme="poop"] #hallMode, html[data-theme="hotdog"] #hallMode, html[data-theme="poop"] #leadersMode, html[data-theme="hotdog"] #leadersMode { background: rgba(255, 252, 244, .94); }

/* Leader card: one leader at a time (Blitz, then Max, then each tie), flipping every few seconds.
   Slides share one grid cell so the card never changes height. Each style sets --w-in / --w-out. */
.winner .wslides { position: relative; z-index: 1; display: grid; width: 100%; }
.winner .wslide { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; width: 100%; visibility: hidden; }
.winner .wslide.on, .winner .wslide.out { visibility: visible; }
.winner .wslide.in { animation: var(--w-in, w-in) .75s ease-out both; }
.winner .wslide.out { animation: var(--w-out, w-out) .6s ease-in both; pointer-events: none; }
@keyframes w-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes w-out { to { opacity: 0; transform: translateY(-14px); } }
.winner .wdots { position: absolute; right: 9px; top: 8px; display: flex; gap: 4px; z-index: 2; }
.winner .wdots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .3; transition: opacity .3s, background .3s; }
.winner .wdots i.on { opacity: 1; background: var(--accent); }

/* Practice picker (Blitz or Max) */
.pickmode { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pickmode .bigbtn { width: 100%; }
.modal .pickmode .bigbtn b { font-size: 18px; }

/* ----- each style's leader-card flip ----- */
/* Terminal: old line clears, new one types out */
html[data-theme="terminal"] .winner .wslide { align-items: flex-start; --w-in: wt-type; --w-out: wt-clear; }
html[data-theme="terminal"] .winner .wslide.in { animation-timing-function: steps(18, end); }
html[data-theme="terminal"] .winner .wslide.out { animation-timing-function: steps(4, end); }
@keyframes wt-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes wt-clear { to { opacity: 0; } }
html[data-theme="terminal"] .winner .wdots { right: 8px; } html[data-theme="terminal"] .winner .wdots i { border-radius: 0; }
/* Pirate: the card swings over like a flag in the wind */
html[data-theme="pirate"] .winner .wslide { --w-in: wp-flag-in; --w-out: wp-flag-out; }
@keyframes wp-flag-in { 0% { opacity: 0; transform: perspective(500px) rotateY(-80deg) skewY(8deg); transform-origin: left center; }
  45% { opacity: 1; transform: perspective(500px) rotateY(18deg) skewY(-4deg); transform-origin: left center; }
  70% { transform: perspective(500px) rotateY(-8deg) skewY(2deg); transform-origin: left center; }
  100% { opacity: 1; transform: none; transform-origin: left center; } }
@keyframes wp-flag-out { to { opacity: 0; transform: perspective(500px) rotateY(80deg) skewY(-6deg); transform-origin: right center; } }
/* Medieval: a scroll rolls up, the next one unrolls */
html[data-theme="medieval"] .winner .wslide { --w-in: wm-unroll; --w-out: wm-roll; }
@keyframes wm-unroll { 0% { opacity: 0; transform: scaleY(.05); transform-origin: top; } 60% { opacity: 1; transform: scaleY(1.06); transform-origin: top; } 100% { transform: none; transform-origin: top; } }
@keyframes wm-roll { to { opacity: 0; transform: scaleY(.05); transform-origin: bottom; } }
/* Cyberpunk: glitch cut */
html[data-theme="cyberpunk"] .winner .wslide { --w-in: wc-glitch-in; --w-out: wc-glitch-out; }
@keyframes wc-glitch-in { 0% { opacity: 0; clip-path: inset(40% 0 50% 0); transform: translateX(-12px); filter: hue-rotate(90deg); }
  20% { opacity: 1; clip-path: inset(10% 0 60% 0); transform: translateX(10px); } 40% { clip-path: inset(70% 0 5% 0); transform: translateX(-6px); filter: hue-rotate(-60deg); }
  60% { clip-path: inset(0 0 30% 0); transform: translateX(4px); } 80% { clip-path: inset(20% 0 0 0); transform: translateX(-2px); }
  100% { opacity: 1; clip-path: inset(0); transform: none; filter: none; } }
@keyframes wc-glitch-out { 0% { clip-path: inset(0); } 30% { clip-path: inset(30% 0 40% 0); transform: translateX(8px); filter: hue-rotate(90deg); }
  60% { clip-path: inset(60% 0 10% 0); transform: translateX(-10px); } 100% { opacity: 0; clip-path: inset(50% 0 50% 0); } }
html[data-theme="cyberpunk"] .winner .wslide.in, html[data-theme="cyberpunk"] .winner .wslide.out { animation-timing-function: steps(1, end); animation-duration: .5s; }
html[data-theme="cyberpunk"] .winner .wdots i { border-radius: 0; }
/* Miami Neon: one sign flickers off, the next buzzes on */
html[data-theme="neon"] .winner .wslide { --w-in: wn-on; --w-out: wn-off; }
@keyframes wn-on { 0%, 10% { opacity: 0; } 15% { opacity: 1; } 22% { opacity: .1; } 30% { opacity: 1; } 38% { opacity: .3; } 50%, 100% { opacity: 1; filter: drop-shadow(0 0 6px #ff3cac); } }
@keyframes wn-off { 0% { opacity: 1; } 20% { opacity: .2; } 30% { opacity: .9; } 45%, 100% { opacity: 0; } }
html[data-theme="neon"] .winner .wslide.in, html[data-theme="neon"] .winner .wslide.out { animation-timing-function: steps(1, end); }
/* Christmas: the old card falls away like snow, the new one drops in on a bounce */
html[data-theme="christmas"] .winner .wslide { --w-in: wx-drop; --w-out: wx-fall; }
@keyframes wx-drop { 0% { opacity: 0; transform: translateY(-110%) rotate(-4deg); } 60% { opacity: 1; transform: translateY(6%) rotate(1deg); }
  80% { transform: translateY(-3%); } 100% { opacity: 1; transform: none; } }
@keyframes wx-fall { to { opacity: 0; transform: translateY(110%) rotate(6deg); } }
/* Poop: flushed away in a swirl, the next one plops in */
html[data-theme="poop"] .winner .wslide { --w-in: wpo-plop; --w-out: wpo-flush; }
@keyframes wpo-flush { 0% { transform: none; } 100% { opacity: 0; transform: rotate(540deg) scale(0); } }
@keyframes wpo-plop { 0% { opacity: 0; transform: translateY(-70%) scale(.7, 1.3); } 55% { opacity: 1; transform: translateY(4%) scale(1.15, .8); }
  75% { transform: scale(.95, 1.05); } 100% { opacity: 1; transform: none; } }
/* Hot Dog: slides out of the bun, the next one slides in */
html[data-theme="hotdog"] .winner .wslide { --w-in: wd-in; --w-out: wd-out; }
@keyframes wd-in { 0% { opacity: 0; transform: translateX(110%) scaleX(1.3); } 65% { opacity: 1; transform: translateX(-6%) scaleX(.95); } 100% { opacity: 1; transform: none; } }
@keyframes wd-out { to { opacity: 0; transform: translateX(-110%) scaleX(1.3); } }
.modal .pickmode .bigbtn:not(.primary) { color: var(--ink); }
  /* =====================================================================
     Terminal theme: looks like a Windows Terminal window (Campbell colours).
     Everything is plain monospace text on near-black; no rounded corners or shadows.
     ===================================================================== */
  html[data-theme="terminal"] {
    --bg: #0c0c0c; --bg2: #0c0c0c; --panel: #0c0c0c;
    --ink: #cccccc; --muted: #767676;
    --tile: transparent; --tile-edge: transparent; --tile-ink: #cccccc;
    --accent: #f9f1a5; --good: #16c60c; --bad: #e74856; --line: #3b3b3b;
    --mono: "Cascadia Mono", "Cascadia Code", Consolas, "Roboto Mono", "Droid Sans Mono", monospace;
  }
  html[data-theme="terminal"] body { font-family: var(--mono); font-size: 14px; }
  html[data-theme="terminal"] * { border-radius: 0 !important; box-shadow: none !important; text-shadow: none; }
  html[data-theme="terminal"] .term-only { display: block; }
  html[data-theme="terminal"] .modern-only { display: none !important; }
  html[data-theme="terminal"] ::selection { background: #cccccc; color: #0c0c0c; }
  @keyframes blink { 50% { opacity: 0; } }
  html[data-theme="terminal"] .cursor { display: inline-block; width: .6em; height: 1.1em; vertical-align: text-bottom;
    background: #cccccc; animation: blink 1.06s steps(1) infinite; }

  /* home: a shell prompt instead of the tile logo */
  html[data-theme="terminal"] #home { align-items: stretch; justify-content: flex-start; text-align: left; padding: 14px 12px; gap: 2px; }
  html[data-theme="terminal"] #home > * { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }
  html[data-theme="terminal"] .term-banner { color: #cccccc; line-height: 1.45; margin-bottom: 10px; white-space: pre-wrap; }
  html[data-theme="terminal"] .term-banner .p { color: #cccccc; } html[data-theme="terminal"] .term-banner .c { color: #3a96dd; }
  html[data-theme="terminal"] .term-banner .dim { color: var(--muted); }
  html[data-theme="terminal"] .tagline { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
  html[data-theme="terminal"] .tagline::before { content: "# "; }
  html[data-theme="terminal"] .duo { flex-direction: column; gap: 0; width: 100%; } html[data-theme="terminal"] .duo .bigbtn { width: 100%; }
  html[data-theme="terminal"] .bigbtn { width: 100%; background: none; padding: 7px 0; flex-direction: row; align-items: baseline;
    gap: 0; flex-wrap: wrap; color: var(--ink); }
  html[data-theme="terminal"] .bigbtn::before { content: "> "; color: var(--muted); white-space: pre; }
  html[data-theme="terminal"] .bigbtn.primary { color: var(--good); background: none; }
  html[data-theme="terminal"] .bigbtn.primary::before { color: var(--good); }
  html[data-theme="terminal"] .bigbtn b { font-size: 15px; font-weight: 600; }
  html[data-theme="terminal"] .bigbtn small { flex-basis: 100%; padding-left: 2ch; font-size: 12px; color: var(--muted); opacity: 1; }
  html[data-theme="terminal"] .bigbtn:active, html[data-theme="terminal"] .bigbtn:active b,
  html[data-theme="terminal"] .bigbtn:active small { transform: none; background: #cccccc; color: #0c0c0c; }
  html[data-theme="terminal"] .stats { width: 100%; margin-top: 12px; gap: 0; border-top: 1px dashed var(--line); padding-top: 10px; }
  html[data-theme="terminal"] .stat { background: none; padding: 4px 0; text-align: left; }
  html[data-theme="terminal"] .stat b { font-size: 18px; color: var(--accent); }
  html[data-theme="terminal"] .stat small { font-size: 11px; text-transform: lowercase; letter-spacing: 0; }
  html[data-theme="terminal"] .linkbtn { color: var(--muted); text-decoration: none; padding: 6px 0; text-align: left; }
  html[data-theme="terminal"] .linkbtn::before { content: "> "; }
  html[data-theme="terminal"] #home > .topicons { width: auto; margin: 0; top: 8px; }
  html[data-theme="terminal"] .roundbtn { width: 30px; height: 30px; }
  html[data-theme="terminal"] .term-banner .dim { display: block; padding-right: 76px; }
  @media (max-height: 600px) { html[data-theme="terminal"] .term-banner .dim { display: none; } }
  html[data-theme="terminal"] .roundbtn { background: none; box-shadow: none; border: 1px solid var(--line); border-radius: 0; color: var(--muted); font-size: 15px; }
  html[data-theme="terminal"] .nextrace { width: 100%; background: none; border: 1px solid var(--accent); color: var(--accent); margin-bottom: 8px; }
  html[data-theme="terminal"] .nextrace.live { background: var(--accent); color: #0c0c0c; animation: none; }

  /* buttons look like [ bracketed ] commands */
  html[data-theme="terminal"] .iconbtn, html[data-theme="terminal"] .smallbtn,
  html[data-theme="terminal"] .modal .row button { background: none; color: var(--ink); font-weight: 400; }
  html[data-theme="terminal"] .iconbtn::before, html[data-theme="terminal"] .smallbtn::before,
  html[data-theme="terminal"] .modal .row button::before { content: "["; color: var(--muted); }
  html[data-theme="terminal"] .iconbtn::after, html[data-theme="terminal"] .smallbtn::after,
  html[data-theme="terminal"] .modal .row button::after { content: "]"; color: var(--muted); }
  html[data-theme="terminal"] .iconbtn:active, html[data-theme="terminal"] .smallbtn:active,
  html[data-theme="terminal"] .modal .row button:active { background: #cccccc; color: #0c0c0c; }
  html[data-theme="terminal"] .smallbtn.primary, html[data-theme="terminal"] .modal .row button.primary { background: none; color: var(--good); }
  html[data-theme="terminal"] .smallbtn.outline { border: 0; color: var(--muted); }
  html[data-theme="terminal"] .smallbtn.danger { color: var(--bad); }
  html[data-theme="terminal"] .controls .iconbtn { padding: 0 4px; }
  html[data-theme="terminal"] .arrows .iconbtn { min-width: 30px; }
  html[data-theme="terminal"] .arrows .iconbtn::before, html[data-theme="terminal"] .arrows .iconbtn::after { content: none; }

  /* game */
  html[data-theme="terminal"] .topbar { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  html[data-theme="terminal"] .title { font-weight: 400; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html[data-theme="terminal"] .title::before { content: "PS C:\\12by> "; color: var(--muted); }
  html[data-theme="terminal"] .timer { background: none; color: var(--accent); font-weight: 400; padding: 8px 0; min-width: 0; }
  html[data-theme="terminal"] #board { background: none; border: 1px solid var(--line); padding: 2px; }
  html[data-theme="terminal"] .cell { border: 0; }
  html[data-theme="terminal"] .cell::before { content: "·"; position: absolute; inset: 0; display: grid; place-items: center; color: #2e2e2e; }
  html[data-theme="terminal"] .cell:has(.tile)::before { content: none; }
  html[data-theme="terminal"] .cell.target { background: #2a2a2a; }
  html[data-theme="terminal"] .tile { background: none; color: var(--ink); font-weight: 600; transition: none; }
  html[data-theme="terminal"] .tile.good { background: none; color: var(--good); }
  html[data-theme="terminal"] .tile.bad { background: none; color: var(--bad); }
  html[data-theme="terminal"] .tile.selected { outline: 0; transform: none; background: #cccccc; color: #0c0c0c; }
  html[data-theme="terminal"] .ghost { background: #cccccc; color: #0c0c0c; }
  html[data-theme="terminal"] #tray { background: none; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
  html[data-theme="terminal"] #tray .slot { background: none; }
  html[data-theme="terminal"] #tray .slot:empty::before { content: "_"; color: #3b3b3b; }
  html[data-theme="terminal"] .status { text-align: left; width: 100%; max-width: 520px; }
  html[data-theme="terminal"] .status::after { content: ""; display: inline-block; width: .6em; height: 1.1em; margin-left: 4px;
    vertical-align: text-bottom; background: #cccccc; animation: blink 1.06s steps(1) infinite; }

  /* modal = a bordered text box */
  html[data-theme="terminal"] .modal-wrap { background: rgba(0,0,0,.75); }
  html[data-theme="terminal"] .modal { background: #0c0c0c; border: 1px solid #cccccc; text-align: left; padding: 16px 14px; }
  html[data-theme="terminal"] .modal h2 { font-size: 16px; font-weight: 600; }
  html[data-theme="terminal"] .modal h2::before { content: "== "; color: var(--muted); }
  html[data-theme="terminal"] .modal h2::after { content: " =="; color: var(--muted); }
  html[data-theme="terminal"] .modal p, html[data-theme="terminal"] .modal li { color: var(--ink); font-size: 14px; }
  html[data-theme="terminal"] .modal ul { list-style: none; padding-left: 0; }
  html[data-theme="terminal"] .modal li::before { content: "- "; color: var(--muted); }
  html[data-theme="terminal"] .modal .bigtime { font-size: 36px; font-weight: 600; }
  html[data-theme="terminal"] .modal .row { justify-content: flex-start; }
  html[data-theme="terminal"] .modal .row button { flex: 0 1 auto; padding: 10px 6px; }
  html[data-theme="terminal"] .modal input, html[data-theme="terminal"] .modal select { background: #0c0c0c; border: 1px solid var(--line);
    font-family: var(--mono); caret-color: #cccccc; }
  html[data-theme="terminal"] .modal input:focus { border-color: #cccccc; }
  html[data-theme="terminal"] .themeopt { background: none; border: 1px solid var(--line); }
  html[data-theme="terminal"] .themeopt.on { border-color: #cccccc; }
  html[data-theme="terminal"] .toast { background: #0c0c0c; border: 1px solid #cccccc; color: #cccccc; }

  /* leaderboard + friends: rows of text */
  html[data-theme="terminal"] .lrow { background: none; border-bottom: 1px dashed var(--line); font-size: 14px; padding: 7px 12px; }
  html[data-theme="terminal"] .lrow.me { background: none; color: var(--accent); font-weight: 600; }
  html[data-theme="terminal"] .lhead { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  html[data-theme="terminal"] .gcard, html[data-theme="terminal"] .rcard, html[data-theme="terminal"] .invite,
  html[data-theme="terminal"] .iou { background: none; border: 1px solid var(--line); }
  html[data-theme="terminal"] .rcard.finished { background: none; }
  html[data-theme="terminal"] .rcard.live { border-color: var(--accent); }
  html[data-theme="terminal"] .gnext { border-style: dashed; }
  html[data-theme="terminal"] .gnext.live, html[data-theme="terminal"] .badge { background: none; color: var(--accent); border: 1px solid var(--accent); }
  html[data-theme="terminal"] .rname { font-weight: 600; font-size: 22px; }
  html[data-theme="terminal"] .rcount { font-weight: 400; color: var(--accent); }
  html[data-theme="terminal"] .erow { background: none; border-left: 1px solid var(--line); }
  html[data-theme="terminal"] .eflag { color: #c19c00; }
  html[data-theme="terminal"] .iou.mine { border-left: 3px solid var(--accent); }
  html[data-theme="terminal"] #groupBody h3 { font-weight: 600; font-size: 15px; }
  html[data-theme="terminal"] #groupBody h3::before { content: "## "; color: var(--muted); }
  html[data-theme="terminal"] .mrow { border-bottom: 1px dashed var(--line); }

  /* Terminal, the deeper bits: a tab strip, an ASCII logo, a faint glow and a prompt that types itself */
  html[data-theme="terminal"] body { background: radial-gradient(120% 70% at 50% 0%, #161616, #0c0c0c 70%); }
  html[data-theme="terminal"] body::before { content: ""; inset: 0; z-index: 3; opacity: .5;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px); }
  html[data-theme="terminal"] .term-tabs { display: flex; align-items: flex-end; gap: 2px; margin: -14px -12px 10px; padding: 6px 90px 0 8px;
    background: #1f1f1f; border-bottom: 1px solid #2b2b2b; font-size: 12px; color: #bdbdbd; }
  html[data-theme="terminal"] .term-tabs span { padding: 6px 10px; background: #0c0c0c; border: 1px solid #2b2b2b; border-bottom: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html[data-theme="terminal"] .term-tabs span::before { content: "❯ "; color: #3a96dd; }
  html[data-theme="terminal"] .term-tabs span::after { content: "  ×"; color: #767676; }
  html[data-theme="terminal"] .term-tabs i { font-style: normal; padding: 6px 8px; color: #767676; }
  html[data-theme="terminal"] .ascii { margin: 0 0 6px; font: 700 14px/1.1 var(--mono); white-space: pre;
    background: linear-gradient(90deg, #3a96dd, #61d6d6 45%, #16c60c); -webkit-background-clip: text; background-clip: text; color: transparent;
    filter: drop-shadow(0 0 6px rgba(58,150,221,.35)); }
  html[data-theme="terminal"] .term-banner .c { color: #f9f1a5; }
  html[data-theme="terminal"] .term-banner .flag { color: #767676; }
  html[data-theme="terminal"] .term-banner .typed { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom;
    animation: term-type 1.1s steps(28, end) .2s both; }
  @keyframes term-type { from { max-width: 0; } to { max-width: 30ch; } }
  html[data-theme="terminal"] .bigbtn { transition: background .1s; }
  html[data-theme="terminal"] .bigbtn:hover b { text-decoration: underline; }
  html[data-theme="terminal"] .bigbtn.primary b::after { content: "  [ENTER]"; color: var(--muted); font-weight: 400; font-size: 12px; }
  html[data-theme="terminal"] .betabadge { border: 0; top: 9px; right: 0; font-weight: 400; color: #c19c00; padding: 0; }
  html[data-theme="terminal"] .betabadge::before { content: "["; } html[data-theme="terminal"] .betabadge::after { content: "]"; }
  html[data-theme="terminal"] .soonbadge { background: none; color: #c19c00; right: 0; font-weight: 400; padding: 0; top: 9px; }
  html[data-theme="terminal"] .soonbadge::before { content: "["; } html[data-theme="terminal"] .soonbadge::after { content: "]"; }
  html[data-theme="terminal"] .winner { background: none; border: 1px solid #16c60c; align-items: flex-start; text-align: left; }
  html[data-theme="terminal"] .winner .wname { color: #16c60c; } html[data-theme="terminal"] .winner .wname::before { content: "> "; color: var(--muted); }
  html[data-theme="terminal"] .winner .confetti i { border-radius: 0 !important; width: 6px; height: 6px; }
  html[data-theme="terminal"] .tile.moved { animation: term-blink .25s steps(2, end); }
  @keyframes term-blink { 0% { background: #cccccc; color: #0c0c0c; } 100% { background: none; } }
  html[data-theme="terminal"] .tile.dealt { animation: term-type-in .3s steps(3, end) both; animation-delay: calc(var(--i) * 40ms); }
  @keyframes term-type-in { from { opacity: 0; } to { opacity: 1; } }
  html[data-theme="terminal"] .timer::before { content: "⏱ "; color: var(--muted); }
  html[data-theme="terminal"] .burst i { font-family: var(--mono); color: #16c60c; text-shadow: 0 0 6px rgba(22,198,12,.6); font-weight: 700; }
  html[data-theme="terminal"] .themeopt b::before { content: "> "; color: var(--muted); }
  html[data-theme="terminal"] .seg { background: none; border: 1px solid var(--line); }
  html[data-theme="terminal"] .seg button.on { background: #cccccc; color: #0c0c0c; }
  html[data-theme="terminal"] .explain { background: none; border: 1px dashed var(--line); }
  html[data-theme="terminal"] .hrow { background: none; border-bottom: 1px dashed var(--line); }
  @media (max-height: 720px) { html[data-theme="terminal"] .ascii { font-size: 11px; } html[data-theme="terminal"] .term-banner .dim { display: none; }
    html[data-theme="terminal"] .term-banner { margin-bottom: 4px; } html[data-theme="terminal"] .bigbtn { padding: 5px 0; } }
  html[data-theme="terminal"] .controls { flex-wrap: nowrap; gap: 0; justify-content: space-between; }
  html[data-theme="terminal"] .controls .iconbtn { font-size: 13px; flex: 0 1 auto; }

/* =====================================================================
   Pirate: a galleon under a full moon. Ship's timber buttons, sea-chart
   board, parchment tiles with scorched edges, gold doubloons.
   ===================================================================== */
html[data-theme="pirate"] { --bg: #0b2230; --bg2: rgba(8, 30, 40, .78); --panel: #5b3a1f; --ink: #f6ead0; --muted: #b9cbbf;
  --tile: #f1dfb2; --tile-edge: #8a6430; --tile-ink: #3b2410; --accent: #e8b931; --accent-edge: #8a6512;
  --on-accent: #2a1a05; --shade: #23150a; --soft: #eedfbd; --good: #9be89f; --bad: #ff8f7a;
  --font: "IM Fell English", Georgia, serif; --head: "Pirata One", "IM Fell English", serif; --tilefont: "Alegreya SC", Georgia, serif;
  --deal: pirate-toss; --place: pirate-thud;
  --planks: repeating-linear-gradient(0deg, transparent 0 19px, rgba(0,0,0,.28) 19px 21px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#6d4626, #4b2f17); }
html[data-theme="pirate"] body { font-family: var(--font);
  background:
    url(art/pirate-moon.svg) left 4px top calc(env(safe-area-inset-top) + 4px) / 150px auto no-repeat,
    radial-gradient(1.5px 1.5px at 30% 12%, #fff, transparent), radial-gradient(1px 1px at 62% 8%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 80% 22%, #fffc, transparent), radial-gradient(1px 1px at 12% 30%, #fffa, transparent),
    radial-gradient(1px 1px at 92% 38%, #fff, transparent), radial-gradient(1.5px 1.5px at 48% 28%, #fff9, transparent),
    url(art/pirate-sea.svg) left bottom / 480px 110px repeat-x,
    linear-gradient(#06141d 0%, #0b2a3a 45%, #17506099 80%, #0f4a5a 100%); background-color: #0b2230; }
/* the ship rides the swell, with a wave in front of it */
html[data-theme="pirate"] body::after { content: ""; left: max(-14px, calc(50% - 280px)); bottom: 22px; width: min(66vw, 300px); aspect-ratio: 320 / 280;
  background: url(art/pirate-ship.svg) center / contain no-repeat; transform-origin: 50% 85%; animation: pirate-bob 7s ease-in-out infinite; }
html[data-theme="pirate"] body::before { content: ""; left: 0; right: 0; bottom: -6px; height: 62px; z-index: 1;
  background: url(art/pirate-sea.svg) 0 0 / 360px 62px repeat-x; animation: pirate-swell 14s linear infinite; opacity: .95; }
@keyframes pirate-bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(6px) rotate(1.8deg); } }
@keyframes pirate-swell { to { background-position: -360px 0; } }

html[data-theme="pirate"] h1, html[data-theme="pirate"] .modal h2, html[data-theme="pirate"] .bigbtn b, html[data-theme="pirate"] .title,
html[data-theme="pirate"] .winner .wname, html[data-theme="pirate"] .hrow .hname { font-family: var(--head); font-weight: 400; letter-spacing: .5px; }
html[data-theme="pirate"] h1 { font-size: clamp(30px, 4.6vh, 42px); color: var(--accent); text-shadow: 0 2px 0 #3a2208, 0 0 18px rgba(232,185,49,.35); }
html[data-theme="pirate"] h1::before { content: "☠ "; color: var(--ink); } html[data-theme="pirate"] h1::after { content: " ⚓"; color: var(--ink); font-size: .7em; }
html[data-theme="pirate"] .tagline { font-style: italic; color: var(--soft); text-shadow: 0 1px 2px #000; }

/* logo: two doubloons and two scraps of map */
html[data-theme="pirate"] .logo span { font-family: var(--tilefont); font-weight: 900; }
html[data-theme="pirate"] .logo span:not(.num) { background: radial-gradient(circle at 30% 25%, #fbf0cf, #e6cf98 70%, #c9a866);
  box-shadow: 0 3px 0 #7a5528, inset 0 0 8px rgba(120,70,20,.55); border-radius: 3px 6px 4px 7px; transform: rotate(-4deg); }
html[data-theme="pirate"] .logo span:nth-child(4) { transform: rotate(5deg); }
html[data-theme="pirate"] .logo span.num { border-radius: 50%; color: #5a3b06;
  background: radial-gradient(circle at 35% 30%, #fff2a8, #f1c84b 45%, #b8861c 100%);
  box-shadow: 0 3px 0 #6e4a0c, inset 0 0 0 3px rgba(110,74,12,.45), inset 0 0 0 5px rgba(255,240,180,.5); }

/* buttons are planks of ship's timber with brass nails; the main one is a gold plate */
html[data-theme="pirate"] .bigbtn, html[data-theme="pirate"] .iconbtn, html[data-theme="pirate"] .smallbtn,
html[data-theme="pirate"] .modal .row button, html[data-theme="pirate"] .roundbtn { background: var(--planks); border: 1px solid #2a180a;
  box-shadow: 0 3px 0 #23150a, inset 0 1px 0 rgba(255,220,160,.18); }
html[data-theme="pirate"] .bigbtn { border-radius: 6px; position: relative; }
html[data-theme="pirate"] .bigbtn::after { content: ""; position: absolute; inset: 6px 8px; pointer-events: none;
  background: radial-gradient(circle, #d7b46a 1.6px, transparent 2.2px) left top / 6px 6px no-repeat,
    radial-gradient(circle, #d7b46a 1.6px, transparent 2.2px) right top / 6px 6px no-repeat,
    radial-gradient(circle, #d7b46a 1.6px, transparent 2.2px) left bottom / 6px 6px no-repeat,
    radial-gradient(circle, #d7b46a 1.6px, transparent 2.2px) right bottom / 6px 6px no-repeat; }
html[data-theme="pirate"] .bigbtn.primary, html[data-theme="pirate"] .modal .row button.primary, html[data-theme="pirate"] .smallbtn.primary,
html[data-theme="pirate"] .seg button.on { background: linear-gradient(#f8dc7c, #e1b03a 55%, #b7861f); color: #2a1a05; border-color: #6e4a0c;
  box-shadow: 0 3px 0 #6e4a0c, inset 0 1px 0 #fff3c0; text-shadow: 0 1px 0 rgba(255,240,190,.6); }
html[data-theme="pirate"] .bigbtn.primary::after { background-image: radial-gradient(circle, #8a6512 1.6px, transparent 2.2px), radial-gradient(circle, #8a6512 1.6px, transparent 2.2px),
  radial-gradient(circle, #8a6512 1.6px, transparent 2.2px), radial-gradient(circle, #8a6512 1.6px, transparent 2.2px); }
html[data-theme="pirate"] .bigbtn b { font-size: clamp(19px, 2.7vh, 23px); line-height: 1.05; }
html[data-theme="pirate"] .bigbtn small { font-style: italic; }
html[data-theme="pirate"] .bigbtn:active { transform: translateY(2px) rotate(-.4deg); }
html[data-theme="pirate"] .betabadge { border-style: dashed; font-family: var(--font); }
html[data-theme="pirate"] .soonbadge { background: #1b120a; color: var(--accent); border: 1px dashed var(--accent); font-family: var(--font); }
html[data-theme="pirate"] .stat { background: rgba(8, 24, 32, .93); border: 1px solid rgba(232,185,49,.35); border-radius: 6px; }
html[data-theme="pirate"] .stat b { color: var(--accent); font-family: var(--tilefont); font-weight: 900; }
html[data-theme="pirate"] .roundbtn { border-radius: 50%; }
html[data-theme="pirate"] .winner { background: rgba(10,28,36,.85); border: 2px dashed var(--accent); border-radius: 8px; }
html[data-theme="pirate"] .winner .confetti i { border-radius: 50%; width: 9px; height: 9px; background: radial-gradient(circle at 35% 30%, #fff2a8, #e1b03a 60%, #8a6512) !important; }

/* game: a sea chart to lay your letters on. X marks the spot. */
html[data-theme="pirate"] .timer { background: rgba(10,28,36,.85); border: 1px solid rgba(232,185,49,.45); color: var(--accent); font-family: var(--tilefont); font-weight: 900; font-size: 20px; }
html[data-theme="pirate"] .title { font-size: 22px; color: var(--accent); text-shadow: 0 1px 2px #000; }
html[data-theme="pirate"] #board { border-radius: 4px; border: 2px solid #6b4a24;
  background: radial-gradient(circle at 85% 85%, transparent 34px, rgba(201,168,102,.18) 35px 36px, transparent 37px),
    rgba(10, 30, 38, .72); box-shadow: 0 0 0 4px rgba(35,21,10,.6), 0 10px 24px rgba(0,0,0,.4); }
html[data-theme="pirate"] .cell { border: 1px dashed rgba(201,168,102,.16); border-radius: 0; }
html[data-theme="pirate"] .cell.target { background: rgba(232,185,49,.15); }
html[data-theme="pirate"] .cell.target::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; color: #e04b3a; font-size: calc(var(--cell) * .7); font-weight: 900; }
html[data-theme="pirate"] .tile { font-family: var(--tilefont); font-weight: 900; border-radius: 3px 5px 4px 6px;
  background: radial-gradient(circle at 30% 25%, #fbf0cf, #ecd6a2 65%, #cfae6c); box-shadow: 0 2px 0 #7a5528, inset 0 0 6px rgba(120,70,20,.5); }
html[data-theme="pirate"] .tile.good { background: radial-gradient(circle at 30% 25%, #f3f8d8, #cfe6a6 65%, #9ec46c); box-shadow: 0 2px 0 #4e7a2a, inset 0 0 6px rgba(60,90,20,.45); }
html[data-theme="pirate"] .tile.bad { background: radial-gradient(circle at 30% 25%, #fde2d4, #f0b49c 65%, #d0805f); box-shadow: 0 2px 0 #8a2f1a, inset 0 0 6px rgba(120,30,10,.5); color: #5a1408; }
html[data-theme="pirate"] .tile.selected { outline: 3px solid var(--accent); }
html[data-theme="pirate"] #tray { background: var(--planks); border: 1px solid #2a180a; border-radius: 6px; box-shadow: 0 4px 0 #23150a; }
html[data-theme="pirate"] #tray .slot { background: rgba(0,0,0,.28); border-radius: 4px; box-shadow: inset 0 2px 4px rgba(0,0,0,.4); }
html[data-theme="pirate"] .status { text-shadow: 0 1px 2px #000; font-style: italic; }
@keyframes pirate-toss { from { opacity: 0; transform: translateY(-30px) rotate(-25deg) scale(.7); } to { opacity: 1; transform: none; } }
@keyframes pirate-thud { 0% { transform: translateY(-6px) rotate(-6deg); } 55% { transform: translateY(1px) rotate(2deg); } 100% { transform: none; } }

html[data-theme="pirate"] .modal { background: radial-gradient(circle at 30% 20%, #fbf0cf, #ead39c 70%, #c9a866); color: #3b2410;
  border-radius: 4px 10px 6px 12px; box-shadow: 0 0 0 3px #6b4a24, 0 20px 40px rgba(0,0,0,.6), inset 0 0 30px rgba(120,70,20,.45); }
html[data-theme="pirate"] .modal h2 { color: #7a1a10; font-size: 30px; }
html[data-theme="pirate"] .modal p, html[data-theme="pirate"] .modal li, html[data-theme="pirate"] .modal .rank { color: #3b2410; }
html[data-theme="pirate"] .modal .bigtime { color: #7a1a10; font-family: var(--tilefont); font-weight: 900; }
html[data-theme="pirate"] .modal .row button { color: var(--ink); }
html[data-theme="pirate"] .modal input, html[data-theme="pirate"] .modal select { background: #fbf3dc; color: #3b2410; border-color: #a07a3c; }
html[data-theme="pirate"] .modal .muted, html[data-theme="pirate"] .themeopt small, html[data-theme="pirate"] .modal .msgcount { color: #6b5232; }
html[data-theme="pirate"] .themeopt, html[data-theme="pirate"] .explain, html[data-theme="pirate"] .seg { background: rgba(120,80,30,.14); color: #3b2410; }
html[data-theme="pirate"] .seg button { color: #6b5232; }
html[data-theme="pirate"] .scoretbl td { border-color: rgba(120,80,30,.25); }
html[data-theme="pirate"] .modal .warnbox { background: rgba(255,255,255,.4); }
html[data-theme="pirate"] .toast { background: #23150a; border: 1px solid var(--accent); color: var(--accent); font-style: italic; }
html[data-theme="pirate"] .lrow, html[data-theme="pirate"] .hrow { background: rgba(10,28,36,.82); border: 1px solid rgba(232,185,49,.2); }
html[data-theme="pirate"] .lrow.me { background: linear-gradient(#f8dc7c, #e1b03a); color: #2a1a05; }
html[data-theme="pirate"] .stat b, html[data-theme="pirate"] .timer, html[data-theme="pirate"] .modal .bigtime, html[data-theme="pirate"] .bigbtn small { font-variant-numeric: lining-nums tabular-nums; }
html[data-theme="pirate"] .stat b, html[data-theme="pirate"] .timer, html[data-theme="pirate"] .modal .bigtime { font-family: "Lora", Georgia, serif; font-weight: 700; }

/* =====================================================================
   Medieval: a castle on a hill at dusk, with a dragon passing overhead.
   Carved stone buttons, a crimson royal banner, vellum tiles in Cinzel.
   ===================================================================== */
html[data-theme="medieval"] { --bg: #1a1430; --bg2: rgba(30, 25, 22, .86); --panel: #3b332c; --ink: #f3e8cf; --muted: #c2b293;
  --tile: #f4ead0; --tile-edge: #8c6d3f; --tile-ink: #7a1414; --accent: #d4ad2f; --accent-edge: #7d6214;
  --on-accent: #24180a; --shade: #120f0d; --soft: #e9dcbf; --good: #a5d66f; --bad: #ff7a6a;
  --font: "EB Garamond", Georgia, serif; --head: "Cinzel", "EB Garamond", serif; --black: "UnifrakturMaguntia", "Cinzel", serif;
  --deal: med-drop; --place: med-stamp;
  --stone: radial-gradient(circle at 20% 30%, rgba(255,255,255,.05) 0 2px, transparent 3px) 0 0 / 23px 19px,
    radial-gradient(circle at 70% 60%, rgba(0,0,0,.18) 0 2px, transparent 3px) 0 0 / 31px 27px,
    linear-gradient(#4b423a, #352e28); }
html[data-theme="medieval"] body { font-family: var(--font);
  background: radial-gradient(1.5px 1.5px at 18% 10%, #fff, transparent), radial-gradient(1px 1px at 46% 6%, #fffb, transparent),
    radial-gradient(1.5px 1.5px at 76% 14%, #fff, transparent), radial-gradient(1px 1px at 88% 30%, #fff9, transparent),
    radial-gradient(1px 1px at 8% 34%, #fffa, transparent), radial-gradient(1px 1px at 60% 24%, #fff8, transparent),
    linear-gradient(#0f0b1f 0%, #22183a 35%, #4b2541 62%, #9a4a3a 84%, #c9773e 100%); background-color: #1a1430; }
html[data-theme="medieval"] body::after { content: ""; left: 50%; bottom: 0; width: max(100vw, 400px); max-width: 560px; aspect-ratio: 400 / 280;
  transform: translateX(-50%); background: url(art/medieval-castle.svg) center bottom / 100% auto no-repeat; }
html[data-theme="medieval"] body::before { content: ""; top: calc(env(safe-area-inset-top) + 64px); left: 0; width: 130px; aspect-ratio: 200 / 120; z-index: 1;
  background: url(art/medieval-dragon.svg) center / contain no-repeat; animation: med-dragon 38s linear infinite; opacity: .9; }
@keyframes med-dragon { 0% { transform: translate(-160px, 30px) scale(.8); } 50% { transform: translate(50vw, -10px) scale(1); }
  100% { transform: translate(calc(100vw + 160px), 40px) scale(.85); } }

html[data-theme="medieval"] h1 { font-family: var(--black); font-weight: 400; font-size: clamp(34px, 5vh, 46px); letter-spacing: 1px; color: var(--accent);
  text-shadow: 0 2px 0 #3a1a08, 0 0 14px rgba(212,173,47,.35); }
html[data-theme="medieval"] h1::before, html[data-theme="medieval"] h1::after { content: " ⚜ "; font-family: var(--head); font-size: .55em; vertical-align: middle; }
html[data-theme="medieval"] .modal h2, html[data-theme="medieval"] .bigbtn b, html[data-theme="medieval"] .title, html[data-theme="medieval"] .timer,
html[data-theme="medieval"] .stat b, html[data-theme="medieval"] .winner .wname, html[data-theme="medieval"] .hrow .hname { font-family: var(--head); }
html[data-theme="medieval"] .tagline { font-style: italic; color: var(--soft); font-size: clamp(14px, 2vh, 16px); text-shadow: 0 1px 3px #000; }

/* logo: heraldic shields for the numbers, illuminated vellum for the letters */
html[data-theme="medieval"] .logo span { font-family: var(--head); font-weight: 900; }
html[data-theme="medieval"] .logo span.num { background: linear-gradient(135deg, #f0d062, #b8901d); color: #6a0f0f; box-shadow: none;
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); border-radius: 0; padding-bottom: 8px; }
html[data-theme="medieval"] .logo span:not(.num) { background: linear-gradient(#f8f0da, #e8d9b4); color: #7a1414; border-radius: 2px;
  box-shadow: 0 3px 0 #6b5230, inset 0 0 0 2px #f8f0da, inset 0 0 0 3px #c9a227; }

/* carved stone buttons, gold-inlaid; the main one is the royal banner */
html[data-theme="medieval"] .bigbtn, html[data-theme="medieval"] .iconbtn, html[data-theme="medieval"] .smallbtn,
html[data-theme="medieval"] .modal .row button, html[data-theme="medieval"] .roundbtn, html[data-theme="medieval"] .stat {
  background: var(--stone); border: 1px solid #1d1814; box-shadow: 0 3px 0 #120f0d, inset 0 1px 0 rgba(255,255,255,.08); border-radius: 3px; }
html[data-theme="medieval"] .bigbtn { box-shadow: 0 3px 0 #120f0d, inset 0 0 0 3px transparent, inset 0 0 0 4px rgba(201,162,39,.45); }
html[data-theme="medieval"] .bigbtn.primary, html[data-theme="medieval"] .modal .row button.primary, html[data-theme="medieval"] .smallbtn.primary,
html[data-theme="medieval"] .seg button.on, html[data-theme="medieval"] .lrow.me {
  background: radial-gradient(120% 90% at 50% 0%, #a51d1d, #6d0f0f 70%, #4a0909); color: #f7dc85; border: 1px solid #2a0505;
  box-shadow: 0 3px 0 #2a0505, inset 0 0 0 3px #6d0f0f, inset 0 0 0 4px #d4ad2f, inset 0 0 0 6px #6d0f0f, inset 0 0 0 7px rgba(212,173,47,.6); }
html[data-theme="medieval"] .bigbtn b { font-weight: 700; letter-spacing: .5px; font-size: clamp(16px, 2.3vh, 19px); }
html[data-theme="medieval"] .bigbtn small { font-style: italic; font-size: clamp(13px, 1.7vh, 15px); }
html[data-theme="medieval"] .bigbtn.primary b::before { content: "♛ "; }
html[data-theme="medieval"] .roundbtn { border-radius: 50%; }
html[data-theme="medieval"] .stat b { color: var(--accent); }
html[data-theme="medieval"] .betabadge { font-family: var(--head); border-radius: 2px; }
html[data-theme="medieval"] .soonbadge { font-family: var(--head); border-radius: 2px; background: #6d0f0f; color: #f7dc85; }
html[data-theme="medieval"] .winner { background: rgba(30,25,22,.9); border: 1px solid #d4ad2f; border-radius: 3px; box-shadow: inset 0 0 0 3px rgba(30,25,22,.9), inset 0 0 0 4px rgba(212,173,47,.5); }
html[data-theme="medieval"] .winner .wlabel::before { content: "⚜ "; }

/* game: flagstones, vellum tiles stamped in crimson */
html[data-theme="medieval"] .title { color: var(--accent); font-weight: 700; text-shadow: 0 1px 3px #000; }
html[data-theme="medieval"] .timer { color: var(--accent); font-weight: 700; }
html[data-theme="medieval"] #board { border-radius: 3px; border: 2px solid #1d1814;
  background: linear-gradient(rgba(0,0,0,.35) 1px, transparent 1px) 0 0 / 100% calc(var(--cell) * 2),
    linear-gradient(90deg, rgba(0,0,0,.25) 1px, transparent 1px) 0 0 / calc(var(--cell) * 3) 100%,
    rgba(53, 46, 40, .82); box-shadow: 0 0 0 3px rgba(212,173,47,.35), 0 12px 26px rgba(0,0,0,.5); }
html[data-theme="medieval"] .cell { border: 1px solid rgba(255,255,255,.04); border-radius: 0; }
html[data-theme="medieval"] .cell.target { background: radial-gradient(circle, rgba(212,173,47,.45), transparent 70%); }
html[data-theme="medieval"] .tile { font-family: var(--head); font-weight: 900; border-radius: 2px; border: 0;
  background: linear-gradient(#fbf4e1, #eadcb8); box-shadow: 0 2px 0 #6b5230, inset 0 0 0 2px #fbf4e1, inset 0 0 0 3px rgba(201,162,39,.8); }
html[data-theme="medieval"] .tile.good { background: linear-gradient(#f3f8de, #d4e6aa); color: #2f5a12; box-shadow: 0 2px 0 #4e6a20, inset 0 0 0 2px #f3f8de, inset 0 0 0 3px #7a9a3a; }
html[data-theme="medieval"] .tile.bad { background: linear-gradient(#fde6dc, #f0b9a6); color: #8a1010; box-shadow: 0 2px 0 #7a1414, inset 0 0 0 2px #fde6dc, inset 0 0 0 3px #b83a2a; }
html[data-theme="medieval"] .tile.selected { outline: 3px solid var(--accent); }
html[data-theme="medieval"] #tray { background: var(--stone); border: 1px solid #1d1814; border-radius: 3px; box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px rgba(201,162,39,.35); }
html[data-theme="medieval"] #tray .slot { background: rgba(0,0,0,.3); border-radius: 2px; box-shadow: inset 0 2px 5px rgba(0,0,0,.5); }
html[data-theme="medieval"] .status { font-style: italic; font-size: 15px; text-shadow: 0 1px 3px #000; }
@keyframes med-drop { from { opacity: 0; transform: translateY(-24px); } 70% { transform: translateY(2px); } to { opacity: 1; transform: none; } }
@keyframes med-stamp { 0% { transform: scale(1.35); filter: brightness(1.2); } 60% { transform: scale(.95); } 100% { transform: none; } }

/* modals are vellum scrolls with a wax seal */
html[data-theme="medieval"] .modal { position: relative; background: linear-gradient(#fbf4e1, #ecdfbf); color: #3a2a18; border-radius: 2px;
  box-shadow: 0 0 0 2px #8c6d3f, 0 0 0 5px #fbf4e1, 0 0 0 6px #c9a227, 0 22px 44px rgba(0,0,0,.6); }
html[data-theme="medieval"] .modal::after { content: "⚜"; position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: #f3c0b0; font-size: 16px; background: radial-gradient(circle at 35% 30%, #c0392b, #7a1414 70%);
  box-shadow: 0 2px 3px rgba(0,0,0,.4), inset 0 0 0 3px rgba(0,0,0,.15); transform: rotate(-12deg); }
html[data-theme="medieval"] .modal h2 { color: #7a1414; font-weight: 700; font-size: 24px; }
html[data-theme="medieval"] .modal p, html[data-theme="medieval"] .modal li, html[data-theme="medieval"] .modal .rank { color: #3a2a18; font-size: 16px; }
html[data-theme="medieval"] .modal p:first-of-type::first-letter { font-family: var(--black); font-size: 1.7em; color: #7a1414; }
html[data-theme="medieval"] .modal .bigtime { color: #7a1414; font-family: var(--head); }
html[data-theme="medieval"] .modal .row button { color: var(--ink); font-family: var(--head); font-weight: 700; }
html[data-theme="medieval"] .modal input, html[data-theme="medieval"] .modal select { background: #fffaf0; color: #3a2a18; border-color: #c9a227; }
html[data-theme="medieval"] .modal .muted, html[data-theme="medieval"] .themeopt small, html[data-theme="medieval"] .modal .msgcount { color: #6a5638; }
html[data-theme="medieval"] .themeopt, html[data-theme="medieval"] .explain, html[data-theme="medieval"] .seg { background: rgba(140,109,63,.14); color: #3a2a18; }
html[data-theme="medieval"] .seg button { color: #6a5638; }
html[data-theme="medieval"] .scoretbl td { border-color: rgba(140,109,63,.3); }
html[data-theme="medieval"] .toast { background: #6d0f0f; color: #f7dc85; border: 1px solid #d4ad2f; font-family: var(--head); }
html[data-theme="medieval"] .lrow, html[data-theme="medieval"] .hrow { background: rgba(30,25,22,.88); border: 1px solid rgba(212,173,47,.2); border-radius: 2px; }
html[data-theme="medieval"] .burst .flash { --flash: radial-gradient(circle, rgba(255,220,120,.5), transparent 70%); }

/* =====================================================================
   Cyberpunk: a rain-soaked neon city. HUD panels with cut corners,
   glass tiles with neon edges, glitchy title and glitchy landings.
   ===================================================================== */
html[data-theme="cyberpunk"] { --bg: #05050b; --bg2: rgba(12, 12, 26, .88); --panel: rgba(16, 16, 34, .92); --ink: #e8f7ff; --muted: #8b98c2;
  --tile: #0b1020; --tile-edge: #00f0ff; --tile-ink: #7ff8ff; --accent: #fcee0a; --accent-edge: #9b9200;
  --on-accent: #0a0a0a; --shade: #000; --soft: #c9d6f0; --good: #39ff88; --bad: #ff2a6d;
  --font: "Rajdhani", "Roboto Condensed", "Arial Narrow", sans-serif; --head: "Orbitron", "Rajdhani", sans-serif;
  --cut: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  --cut-s: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 7px 100%, 0 calc(100% - 7px));
  --deal: cy-boot; --place: cy-glitch; }
html[data-theme="cyberpunk"] body { font-family: var(--font); font-weight: 500;
  background: linear-gradient(rgba(0,240,255,.05) 1px, transparent 1px) 0 0 / 26px 26px, linear-gradient(90deg, rgba(0,240,255,.05) 1px, transparent 1px) 0 0 / 26px 26px,
    radial-gradient(90% 50% at 50% 100%, rgba(255,42,109,.28), transparent 70%), linear-gradient(#03030a, #0b0820 60%, #1a0a2a); background-color: #05050b; }
html[data-theme="cyberpunk"] body::after { content: ""; left: 50%; bottom: 0; width: max(100vw, 420px); max-width: 640px; aspect-ratio: 400 / 300;
  transform: translateX(-50%); background: url(art/cyber-city.svg) center bottom / 100% auto no-repeat; opacity: .95; }
/* rain */
html[data-theme="cyberpunk"] body::before { content: ""; inset: -40px 0 0; z-index: 1; opacity: .55;
  background: repeating-linear-gradient(103deg, transparent 0 11px, rgba(160,220,255,.22) 11px 12px, transparent 12px 37px) 0 0 / 200px 120px,
    repeating-linear-gradient(98deg, transparent 0 23px, rgba(160,220,255,.14) 23px 24px, transparent 24px 61px) 0 0 / 260px 180px;
  animation: cy-rain .6s linear infinite; }
@keyframes cy-rain { to { background-position: -27px 120px, -38px 180px; } }

html[data-theme="cyberpunk"] h1, html[data-theme="cyberpunk"] .modal h2, html[data-theme="cyberpunk"] .bigbtn b, html[data-theme="cyberpunk"] .title,
html[data-theme="cyberpunk"] .timer, html[data-theme="cyberpunk"] .stat b, html[data-theme="cyberpunk"] .winner .wname, html[data-theme="cyberpunk"] .iconbtn,
html[data-theme="cyberpunk"] .modal .row button, html[data-theme="cyberpunk"] .smallbtn, html[data-theme="cyberpunk"] .hrow .hname {
  font-family: var(--head); text-transform: uppercase; letter-spacing: 1.5px; }
html[data-theme="cyberpunk"] h1 { font-weight: 900; font-size: clamp(26px, 4.2vh, 38px); color: var(--accent); position: relative;
  text-shadow: 2px 0 #ff2a6d, -2px 0 #00f0ff; animation: cy-title 4s steps(1) infinite; }
@keyframes cy-title { 0%, 86%, 100% { text-shadow: 2px 0 #ff2a6d, -2px 0 #00f0ff; transform: none; }
  88% { text-shadow: -4px 0 #ff2a6d, 4px 0 #00f0ff; transform: translateX(3px) skewX(-8deg); }
  90% { text-shadow: 5px 1px #ff2a6d, -3px -1px #00f0ff; transform: translateX(-2px); clip-path: inset(10% 0 35% 0); }
  92% { text-shadow: 2px 0 #ff2a6d, -2px 0 #00f0ff; transform: none; clip-path: none; } }
html[data-theme="cyberpunk"] .tagline { color: #00f0ff; font-family: var(--font); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: clamp(13px, 1.9vh, 15px); }
html[data-theme="cyberpunk"] .tagline::before { content: "// "; color: #ff2a6d; }

html[data-theme="cyberpunk"] .logo span { font-family: var(--head); font-weight: 900; border-radius: 0; clip-path: var(--cut-s); }
html[data-theme="cyberpunk"] .logo span:not(.num) { background: linear-gradient(#0f1830, #070b18); color: #00f0ff; box-shadow: inset 0 0 0 1px #00f0ff, inset 0 0 14px rgba(0,240,255,.35);
  text-shadow: 0 0 8px #00f0ff; }
html[data-theme="cyberpunk"] .logo span.num { background: var(--accent); color: #000; box-shadow: none; }

/* HUD panels */
html[data-theme="cyberpunk"] .bigbtn, html[data-theme="cyberpunk"] .modal, html[data-theme="cyberpunk"] .iconbtn, html[data-theme="cyberpunk"] .smallbtn,
html[data-theme="cyberpunk"] .gcard, html[data-theme="cyberpunk"] .rcard, html[data-theme="cyberpunk"] .modal .row button, html[data-theme="cyberpunk"] .stat,
html[data-theme="cyberpunk"] .timer, html[data-theme="cyberpunk"] #tray, html[data-theme="cyberpunk"] .winner, html[data-theme="cyberpunk"] .lrow, html[data-theme="cyberpunk"] .hrow {
  clip-path: var(--cut); border-radius: 0; box-shadow: none; }
html[data-theme="cyberpunk"] .bigbtn:not(.primary), html[data-theme="cyberpunk"] .iconbtn, html[data-theme="cyberpunk"] .smallbtn:not(.primary),
html[data-theme="cyberpunk"] .modal .row button:not(.primary), html[data-theme="cyberpunk"] .stat, html[data-theme="cyberpunk"] .timer {
  background: linear-gradient(90deg, rgba(0,240,255,.14), rgba(0,240,255,0) 40%), linear-gradient(#141432f0, #0b0b1ef0);
  border-left: 3px solid #ff2a6d; }
html[data-theme="cyberpunk"] .bigbtn { position: relative; }
html[data-theme="cyberpunk"] .bigbtn::after { content: ""; position: absolute; right: 0; bottom: 0; width: 40%; height: 2px; background: linear-gradient(90deg, transparent, #00f0ff); }
html[data-theme="cyberpunk"] .bigbtn.primary, html[data-theme="cyberpunk"] .smallbtn.primary, html[data-theme="cyberpunk"] .modal .row button.primary,
html[data-theme="cyberpunk"] .seg button.on, html[data-theme="cyberpunk"] .lrow.me {
  background: repeating-linear-gradient(-45deg, #0000 0 8px, rgba(0,0,0,.85) 8px 14px) right top / 56px 100% no-repeat, var(--accent); color: #000; }
html[data-theme="cyberpunk"] .bigbtn.primary::after { background: #000; }
html[data-theme="cyberpunk"] .bigbtn b { font-weight: 800; font-size: clamp(14px, 2.1vh, 17px); }
html[data-theme="cyberpunk"] .bigbtn small { font-size: clamp(13px, 1.8vh, 15px); letter-spacing: .3px; }
html[data-theme="cyberpunk"] .bigbtn:active { transform: translateX(3px); filter: hue-rotate(40deg) brightness(1.3); }
html[data-theme="cyberpunk"] .betabadge, html[data-theme="cyberpunk"] .soonbadge { border-radius: 0; font-family: var(--head); letter-spacing: 1px; }
html[data-theme="cyberpunk"] .soonbadge { background: #ff2a6d; color: #fff; }
html[data-theme="cyberpunk"] .stat b { color: var(--accent); font-weight: 700; }
html[data-theme="cyberpunk"] .roundbtn { background: rgba(10,10,24,.9); border: 1px solid #00f0ff; border-radius: 0; box-shadow: 0 0 10px rgba(0,240,255,.3); clip-path: var(--cut-s); }
html[data-theme="cyberpunk"] .winner { background: rgba(10,10,24,.92); border: 1px solid #fcee0a; }
html[data-theme="cyberpunk"] .winner .confetti i { border-radius: 0 !important; }

/* game */
html[data-theme="cyberpunk"] .title { color: #00f0ff; font-weight: 700; font-size: 15px; text-shadow: 0 0 8px rgba(0,240,255,.6); }
html[data-theme="cyberpunk"] .timer { color: var(--accent); }
html[data-theme="cyberpunk"] #board { border-radius: 0; background: rgba(5,6,16,.82); border: 1px solid rgba(0,240,255,.45);
  box-shadow: 0 0 22px rgba(0,240,255,.18), inset 0 0 30px rgba(0,240,255,.08); }
html[data-theme="cyberpunk"] .cell { border: 1px solid rgba(0,240,255,.07); border-radius: 0; }
html[data-theme="cyberpunk"] .cell.target { background: rgba(252,238,10,.22); box-shadow: inset 0 0 0 1px #fcee0a; }
html[data-theme="cyberpunk"] .tile { font-family: var(--head); font-weight: 800; border-radius: 0; clip-path: var(--cut-s);
  background: linear-gradient(160deg, #14203e, #070b18); color: #7ff8ff; text-shadow: 0 0 8px rgba(0,240,255,.9);
  box-shadow: inset 0 0 0 1px #00f0ff, inset 0 0 12px rgba(0,240,255,.3); font-size: calc(var(--cell) * .5); }
html[data-theme="cyberpunk"] .tile.good { background: linear-gradient(160deg, #0b3a24, #04160e); color: #8dffbd; box-shadow: inset 0 0 0 1px #39ff88, inset 0 0 12px rgba(57,255,136,.35); text-shadow: 0 0 8px #39ff88; }
html[data-theme="cyberpunk"] .tile.bad { background: linear-gradient(160deg, #3a0a1e, #16040b); color: #ff7aa6; box-shadow: inset 0 0 0 1px #ff2a6d, inset 0 0 12px rgba(255,42,109,.4); text-shadow: 0 0 8px #ff2a6d; }
html[data-theme="cyberpunk"] .tile.selected { background: var(--accent); color: #000; text-shadow: none; outline: 0; box-shadow: none; }
html[data-theme="cyberpunk"] #tray { background: rgba(8,8,20,.9); border-top: 1px solid #ff2a6d; }
html[data-theme="cyberpunk"] #tray .slot { background: rgba(0,240,255,.05); border-radius: 0; box-shadow: inset 0 0 0 1px rgba(0,240,255,.15); }
html[data-theme="cyberpunk"] .status { font-family: var(--head); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
@keyframes cy-boot { 0% { opacity: 0; transform: scaleY(.05); filter: brightness(3); } 50% { opacity: 1; transform: scaleY(1.1); } 100% { transform: none; filter: none; } }
@keyframes cy-glitch { 0% { transform: translate(-4px, 0) skewX(12deg); filter: hue-rotate(90deg); } 25% { transform: translate(3px, 1px); }
  50% { transform: translate(-2px, -1px) skewX(-6deg); filter: hue-rotate(-60deg); } 100% { transform: none; filter: none; } }

html[data-theme="cyberpunk"] .modal { background: linear-gradient(#11112a, #08081a); border-top: 3px solid var(--accent); position: relative; padding-top: 30px; }
html[data-theme="cyberpunk"] .modal::before { content: "// SYS.MSG ▮▮▮"; position: absolute; top: 8px; left: 14px; font: 700 10px var(--head); letter-spacing: 2px; color: #ff2a6d; }
html[data-theme="cyberpunk"] .modal h2 { color: var(--accent); font-size: 20px; }
html[data-theme="cyberpunk"] .modal p, html[data-theme="cyberpunk"] .modal li { font-size: 16px; }
html[data-theme="cyberpunk"] .modal .bigtime { font-family: var(--head); color: #00f0ff; text-shadow: 0 0 12px rgba(0,240,255,.7); }
html[data-theme="cyberpunk"] .modal input, html[data-theme="cyberpunk"] .modal select { border-radius: 0; background: #05050b; border-color: #00f0ff; }
html[data-theme="cyberpunk"] .themeopt, html[data-theme="cyberpunk"] .explain, html[data-theme="cyberpunk"] .seg { border-radius: 0; background: rgba(0,240,255,.06); }
html[data-theme="cyberpunk"] .seg button { border-radius: 0; }
html[data-theme="cyberpunk"] .toast { background: #000; color: var(--accent); border: 1px solid var(--accent); border-radius: 0; font-family: var(--head); font-size: 12px; letter-spacing: 1px; }
html[data-theme="cyberpunk"] .lrow, html[data-theme="cyberpunk"] .hrow { background: rgba(12,12,30,.9); }
html[data-theme="cyberpunk"] .burst .flash { --flash: linear-gradient(transparent 0 30%, rgba(0,240,255,.35) 30% 34%, transparent 34% 62%, rgba(255,42,109,.35) 62% 66%, transparent 66%); }
html[data-theme="cyberpunk"] .burst i { font-family: var(--head); color: #00f0ff; text-shadow: 0 0 8px #00f0ff; font-weight: 900; }
html[data-theme="cyberpunk"] .burst i:nth-child(3n) { color: #fcee0a; text-shadow: 0 0 8px #fcee0a; }
html[data-theme="cyberpunk"] .burst i:nth-child(3n+1) { color: #ff2a6d; text-shadow: 0 0 8px #ff2a6d; }
html[data-theme="cyberpunk"] .controls .iconbtn { font-size: 11px; letter-spacing: .5px; padding: 0 7px; }

/* =====================================================================
   Miami Neon: a synthwave sunset with palms. Neon-tube buttons that
   flicker on, a chrome logo, glowing tiles.
   ===================================================================== */
html[data-theme="neon"] { --bg: #14072a; --bg2: rgba(32, 10, 58, .86); --panel: rgba(44, 14, 78, .9); --ink: #fff4fb; --muted: #d7b2e6;
  --tile: #fff0f8; --tile-edge: #ff3cac; --tile-ink: #2b0b3f; --accent: #ff3cac; --accent-edge: #a3166a;
  --on-accent: #fff; --shade: #0c0318; --soft: #f6dcf0; --good: #2de2e6; --bad: #ffb15c;
  --font: "Outfit", "Trebuchet MS", sans-serif; --head: "Righteous", "Outfit", sans-serif; --script: "Mr Dafoe", cursive; --tube: "Monoton", "Righteous", sans-serif;
  --deal: neon-flicker-in; --place: neon-pulse; }
html[data-theme="neon"] body { font-family: var(--font);
  background: radial-gradient(1.5px 1.5px at 15% 8%, #fff, transparent), radial-gradient(1px 1px at 40% 14%, #fffc, transparent),
    radial-gradient(1.5px 1.5px at 70% 6%, #fff, transparent), radial-gradient(1px 1px at 88% 18%, #fffb, transparent),
    radial-gradient(1px 1px at 55% 26%, #fff9, transparent), radial-gradient(1px 1px at 8% 28%, #fffa, transparent),
    linear-gradient(#0d0420 0%, #24093f 40%, #5a1458 68%, #b8325a 88%, #ff7a59 100%); background-color: #14072a; }
html[data-theme="neon"] body::after { content: ""; left: 50%; bottom: 0; width: max(100vw, 420px); max-width: 640px; aspect-ratio: 400 / 320;
  transform: translateX(-50%); background: url(art/neon-sunset.svg) center bottom / 100% auto no-repeat; }
/* the grid floor rolls towards you */
html[data-theme="neon"] body::before { content: ""; left: 50%; bottom: 0; width: max(100vw, 420px); max-width: 640px; height: calc(min(max(100vw, 420px), 640px) * 130 / 400 - 2px);
  transform: translateX(-50%); z-index: 1; opacity: .45;
  background: linear-gradient(rgba(45,226,230,.9) 1.5px, transparent 1.5px) 0 0 / 100% 22px;
  -webkit-mask-image: linear-gradient(transparent, #000 40%); mask-image: linear-gradient(transparent, #000 40%); animation: neon-roll 1.4s linear infinite; }
@keyframes neon-roll { to { background-position: 0 22px; } }

html[data-theme="neon"] h1 { font-family: var(--tube); font-weight: 400; font-size: clamp(34px, 5.4vh, 50px); color: #fff; letter-spacing: 4px;
  text-shadow: 0 0 4px #fff, 0 0 10px #ff3cac, 0 0 22px #ff3cac, 0 0 40px #ff3cac; animation: neon-flicker 6s infinite; }
@keyframes neon-flicker { 0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; } 20%, 24%, 55% { opacity: .55; } }
html[data-theme="neon"] .tagline { font-family: var(--script); font-size: clamp(22px, 3.2vh, 28px); color: #2de2e6; transform: rotate(-4deg);
  text-shadow: 0 0 8px rgba(45,226,230,.8); margin-top: 2px; line-height: 1.05; }

/* logo: chrome */
html[data-theme="neon"] .logo span { font-family: var(--head); border-radius: 6px; }
html[data-theme="neon"] .logo span:not(.num) { background: linear-gradient(#ffffff 0%, #c9d6ff 45%, #3a2a6a 50%, #a58bff 60%, #fff 100%); color: #2b0b3f;
  box-shadow: 0 0 0 2px #2de2e6, 0 0 14px rgba(45,226,230,.9); }
html[data-theme="neon"] .logo span.num { background: linear-gradient(#ffd319, #ff8c2a 50%, #ff2975); color: #fff; text-shadow: 0 1px 2px #7a0b3c;
  box-shadow: 0 0 0 2px #ff3cac, 0 0 14px rgba(255,60,172,.9); }

/* neon tube buttons */
html[data-theme="neon"] .bigbtn, html[data-theme="neon"] .iconbtn, html[data-theme="neon"] .smallbtn, html[data-theme="neon"] .modal .row button,
html[data-theme="neon"] .stat, html[data-theme="neon"] .timer, html[data-theme="neon"] .roundbtn {
  background: rgba(22, 6, 42, .82); border: 2px solid #2de2e6; box-shadow: 0 0 10px rgba(45,226,230,.55), inset 0 0 10px rgba(45,226,230,.25); }
html[data-theme="neon"] .bigbtn { border-radius: 14px; animation: neon-on .9s steps(1) both; }
html[data-theme="neon"] #home.active > .bigbtn, html[data-theme="neon"] #home.active > .duo { animation: neon-on .9s steps(1) both; }
@keyframes neon-on { 0% { opacity: .2; } 10% { opacity: 1; } 15% { opacity: .3; } 25% { opacity: 1; } 30% { opacity: .5; } 40%, 100% { opacity: 1; } }
html[data-theme="neon"] .bigbtn:nth-of-type(even), html[data-theme="neon"] .duo .bigbtn + .bigbtn { border-color: #ff3cac; box-shadow: 0 0 10px rgba(255,60,172,.55), inset 0 0 10px rgba(255,60,172,.25); }
html[data-theme="neon"] .bigbtn.primary, html[data-theme="neon"] .modal .row button.primary, html[data-theme="neon"] .smallbtn.primary,
html[data-theme="neon"] .seg button.on, html[data-theme="neon"] .lrow.me {
  background: linear-gradient(90deg, #ff3cac, #ff8c2a); border-color: #ffd0ec; color: #fff; box-shadow: 0 0 16px rgba(255,60,172,.8), inset 0 1px 0 rgba(255,255,255,.5);
  text-shadow: 0 1px 2px rgba(120,0,60,.6); }
html[data-theme="neon"] .bigbtn b, html[data-theme="neon"] .modal h2, html[data-theme="neon"] .title, html[data-theme="neon"] .timer,
html[data-theme="neon"] .stat b, html[data-theme="neon"] .winner .wname, html[data-theme="neon"] .hrow .hname { font-family: var(--head); font-weight: 400; letter-spacing: .5px; }
html[data-theme="neon"] .bigbtn b { font-size: clamp(17px, 2.4vh, 20px); }
html[data-theme="neon"] .bigbtn:active { transform: scale(.98); filter: brightness(1.3); }
html[data-theme="neon"] .roundbtn { border-radius: 50%; }
html[data-theme="neon"] .stat b, html[data-theme="neon"] .timer { color: #2de2e6; text-shadow: 0 0 8px rgba(45,226,230,.8); }
html[data-theme="neon"] .stat:nth-child(2) { border-color: #ff3cac; box-shadow: 0 0 10px rgba(255,60,172,.55), inset 0 0 10px rgba(255,60,172,.25); }
html[data-theme="neon"] .stat:nth-child(2) b { color: #ff7ccc; text-shadow: 0 0 8px rgba(255,60,172,.8); }
html[data-theme="neon"] .betabadge { border-color: #ffd319; color: #ffd319; box-shadow: 0 0 8px rgba(255,211,25,.6); opacity: 1; }
html[data-theme="neon"] .bigbtn.nine small.count { color: #ffd319; text-shadow: 0 0 6px rgba(255,211,25,.7); }
html[data-theme="neon"] .winner { background: rgba(22,6,42,.88); border: 2px solid #ffd319; box-shadow: 0 0 14px rgba(255,211,25,.5); }

/* game */
html[data-theme="neon"] .title { color: #fff; text-shadow: 0 0 8px #ff3cac; font-size: 19px; }
html[data-theme="neon"] #board { border-radius: 12px; background: rgba(18, 5, 36, .78); border: 2px solid rgba(255,60,172,.6);
  box-shadow: 0 0 18px rgba(255,60,172,.35), inset 0 0 24px rgba(45,226,230,.08); }
html[data-theme="neon"] .cell { border: 1px solid rgba(45,226,230,.1); }
html[data-theme="neon"] .cell.target { background: rgba(45,226,230,.25); box-shadow: inset 0 0 10px rgba(45,226,230,.8); }
html[data-theme="neon"] .tile { font-family: var(--head); font-weight: 400; border-radius: 7px; background: linear-gradient(#fff6fb, #ffd3ec); color: #3a0b52;
  box-shadow: 0 2px 0 #ff3cac, 0 0 10px rgba(255,60,172,.55); }
html[data-theme="neon"] .tile.good { background: linear-gradient(#f1ffff, #b8f6f7); color: #063c46; box-shadow: 0 2px 0 #1bb0b4, 0 0 12px rgba(45,226,230,.75); }
html[data-theme="neon"] .tile.bad { background: linear-gradient(#fff6ea, #ffd0a0); color: #6a2400; box-shadow: 0 2px 0 #ff7a2a, 0 0 12px rgba(255,140,42,.75); }
html[data-theme="neon"] .tile.selected { outline: 3px solid #2de2e6; outline-offset: 1px; }
html[data-theme="neon"] #tray { background: rgba(22, 6, 42, .85); border: 2px solid #2de2e6; border-radius: 14px; box-shadow: 0 0 12px rgba(45,226,230,.45); }
html[data-theme="neon"] #tray .slot { background: rgba(255,60,172,.08); box-shadow: inset 0 0 0 1px rgba(255,60,172,.25); }
html[data-theme="neon"] .status { text-shadow: 0 1px 3px #000; }
@keyframes neon-flicker-in { 0% { opacity: 0; } 30% { opacity: 1; } 45% { opacity: .2; } 60%, 100% { opacity: 1; } }
@keyframes neon-pulse { 0% { transform: scale(1.18); box-shadow: 0 0 26px #ff3cac; } 100% { transform: none; } }

html[data-theme="neon"] .modal { background: linear-gradient(#2a0d4a, #170630); border: 2px solid #ff3cac; border-radius: 18px;
  box-shadow: 0 0 24px rgba(255,60,172,.6), inset 0 0 24px rgba(255,60,172,.15); }
html[data-theme="neon"] .modal h2 { color: #fff; text-shadow: 0 0 10px #ff3cac; font-size: 26px; }
html[data-theme="neon"] .modal .bigtime { color: #2de2e6; font-family: var(--head); font-weight: 400; text-shadow: 0 0 14px rgba(45,226,230,.8); }
html[data-theme="neon"] .themeopt, html[data-theme="neon"] .explain, html[data-theme="neon"] .seg { background: rgba(255,255,255,.06); }
html[data-theme="neon"] .toast { background: #170630; border: 2px solid #2de2e6; color: #fff; box-shadow: 0 0 14px rgba(45,226,230,.6); border-radius: 999px; }
html[data-theme="neon"] .lrow, html[data-theme="neon"] .hrow { background: rgba(22,6,42,.85); border: 1px solid rgba(45,226,230,.35); }
html[data-theme="neon"] .burst .flash { --flash: radial-gradient(circle at 50% 100%, rgba(255,140,42,.5), rgba(255,60,172,.25) 50%, transparent 75%); }

/* =====================================================================
   Christmas: a snowy village at night, Santa crossing the moon, fairy
   lights along the top. Buttons are wrapped presents with snow on top.
   ===================================================================== */
html[data-theme="christmas"] { --bg: #0a1f33; --bg2: rgba(10, 40, 30, .88); --panel: #13452f; --ink: #fffaf0; --muted: #c4dccb;
  --tile: #fffdf7; --tile-edge: #c9b48a; --tile-ink: #a3121f; --accent: #f4c542; --accent-edge: #a67c00;
  --on-accent: #3a1f00; --shade: #061710; --soft: #f3e9d6; --good: #a5f0b4; --bad: #ff9a9a;
  --font: "Lora", Georgia, serif; --head: "Mountains of Christmas", "Lora", serif;
  --deal: xmas-drop; --place: xmas-jingle;
  --snowcap: radial-gradient(circle at 10px 0, #fff 9px, transparent 10px) 0 0 / 26px 10px repeat-x,
    radial-gradient(circle at 4px 0, #fff 6px, transparent 7px) 13px 0 / 26px 8px repeat-x; }
html[data-theme="christmas"] body { font-family: var(--font);
  background: url(art/xmas-sleigh.svg) left 0 top calc(env(safe-area-inset-top) + 30px) / 170px auto no-repeat,
    radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(2px 2px at 90px 120px, #fffc, transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, #fff, transparent), radial-gradient(2.5px 2.5px at 230px 180px, #fffb, transparent),
    radial-gradient(1.5px 1.5px at 60px 210px, #fff, transparent), radial-gradient(2px 2px at 200px 260px, #fffd, transparent),
    linear-gradient(#050f1f, #0b2240 55%, #1d4a6b); background-color: #0a1f33;
  background-size: 170px auto, 260px 280px, 260px 280px, 260px 280px, 260px 280px, 260px 280px, 260px 280px, auto;
  background-repeat: no-repeat, repeat, repeat, repeat, repeat, repeat, repeat, no-repeat;
  animation: xmas-snow 26s linear infinite; }
@keyframes xmas-snow { from { background-position: left 0 top 30px, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: left 0 top 30px, 40px 560px, 40px 560px, 40px 560px, 40px 560px, 40px 560px, 40px 560px, 0 0; } }
html[data-theme="christmas"] body::after { content: ""; left: 50%; bottom: 0; width: max(100vw, 400px); max-width: 600px; aspect-ratio: 400 / 240;
  transform: translateX(-50%); background: url(art/xmas-village.svg) center bottom / 100% auto no-repeat; }
/* fairy lights along the top, twinkling */
html[data-theme="christmas"] body::before { content: ""; left: 0; right: 0; top: env(safe-area-inset-top); height: 34px; z-index: 3;
  background: url(art/xmas-lights.svg) 0 0 / 120px 30px repeat-x; animation: xmas-twinkle 1.6s steps(2) infinite; }
@keyframes xmas-twinkle { 50% { filter: brightness(1.5) saturate(1.3) drop-shadow(0 0 4px #ffd54f); } }
html[data-theme="christmas"] #home { padding-top: calc(clamp(8px, 1.6vh, 24px) + 18px); }
html[data-theme="christmas"] .topicons { top: 28px; }

html[data-theme="christmas"] h1, html[data-theme="christmas"] .modal h2, html[data-theme="christmas"] .bigbtn b, html[data-theme="christmas"] .title,
html[data-theme="christmas"] .winner .wname, html[data-theme="christmas"] .hrow .hname { font-family: var(--head); font-weight: 700; }
html[data-theme="christmas"] h1 { font-size: clamp(32px, 5vh, 44px); color: #fff; text-shadow: 0 2px 0 #a3121f, 0 0 16px rgba(255,255,255,.4); }
html[data-theme="christmas"] h1::before { content: "🎄 "; font-size: .7em; } html[data-theme="christmas"] h1::after { content: " 🎁"; font-size: .7em; }
html[data-theme="christmas"] .tagline { font-style: italic; color: var(--soft); text-shadow: 0 1px 3px #000; }

/* logo: candy-cane numbers, snow-capped letters */
html[data-theme="christmas"] .logo span { font-family: var(--head); font-weight: 700; font-size: clamp(22px, 3.6vh, 36px); position: relative; }
html[data-theme="christmas"] .logo span.num { background: repeating-linear-gradient(135deg, #e53945 0 5px, #ffe9ec 5px 11px); color: #8e1b24;
  -webkit-text-stroke: 4px #fff; paint-order: stroke fill; box-shadow: 0 3px 0 #6e0f17; }
html[data-theme="christmas"] .logo span:not(.num) { background: linear-gradient(#fff, #e8f1f6); color: #a3121f; box-shadow: 0 3px 0 #9cb6c4; }
html[data-theme="christmas"] .logo span:not(.num)::before { content: ""; position: absolute; left: -2px; right: -2px; top: -5px; height: 10px;
  background: radial-gradient(ellipse at 50% 100%, #fff 60%, transparent 62%) 0 0 / 14px 10px repeat-x; }

/* presents: green velvet with a gold ribbon, red for the main one, snow on top */
html[data-theme="christmas"] .bigbtn { position: relative; border-radius: 10px; overflow: visible;
  background: linear-gradient(90deg, transparent calc(100% - 46px), #f4c542 calc(100% - 46px) calc(100% - 36px), transparent calc(100% - 36px)),
    linear-gradient(#1b5a3d, #0f3d29); border: 1px solid #072417; box-shadow: 0 3px 0 #061710; }
html[data-theme="christmas"] .bigbtn::before { content: ""; position: absolute; left: 4px; right: 4px; top: -6px; height: 12px; pointer-events: none;
  background: radial-gradient(ellipse 9px 6px at 50% 100%, #fff 96%, transparent) 0 0 / 15px 12px repeat-x; filter: drop-shadow(0 1px 0 #c9dde8); }
html[data-theme="christmas"] .bigbtn.primary { background: linear-gradient(90deg, transparent calc(100% - 46px), #f4c542 calc(100% - 46px) calc(100% - 36px), transparent calc(100% - 36px)),
  linear-gradient(transparent 46%, rgba(244,197,66,.0) 46%), linear-gradient(#d62839, #9e1824); color: #fff; }
html[data-theme="christmas"] .bigbtn.primary::after { content: "🎀"; position: absolute; right: 26px; top: -10px; font-size: 22px; }
html[data-theme="christmas"] .bigbtn b { font-size: clamp(19px, 2.8vh, 24px); line-height: 1.05; }
html[data-theme="christmas"] .bigbtn small { color: inherit; padding-right: 40px; }
html[data-theme="christmas"] .duo .bigbtn small { padding-right: 0; }
html[data-theme="christmas"] .duo .bigbtn { background: linear-gradient(#1b5a3d, #0f3d29); }
html[data-theme="christmas"] .bigbtn.nine small.count { color: #ffd54f; }
html[data-theme="christmas"] .betabadge { right: 54px; }
html[data-theme="christmas"] .iconbtn, html[data-theme="christmas"] .smallbtn, html[data-theme="christmas"] .modal .row button, html[data-theme="christmas"] .roundbtn {
  background: linear-gradient(#1b5a3d, #0f3d29); border: 1px solid #072417; box-shadow: 0 2px 0 #061710; }
html[data-theme="christmas"] .modal .row button.primary, html[data-theme="christmas"] .smallbtn.primary, html[data-theme="christmas"] .seg button.on, html[data-theme="christmas"] .lrow.me {
  background: linear-gradient(#d62839, #9e1824); color: #fff; border-color: #5a0a10; }
html[data-theme="christmas"] .stat { background: rgba(255,255,255,.92); color: #0f3d29; border-radius: 10px; box-shadow: 0 3px 0 #9cb6c4; }
html[data-theme="christmas"] .stat b { color: #a3121f; font-family: var(--font); font-weight: 700; }
html[data-theme="christmas"] .stat small { color: #35614a; }
html[data-theme="christmas"] .winner { background: rgba(10,40,30,.92); border: 2px dashed var(--accent); }
html[data-theme="christmas"] .winner .confetti i { border-radius: 50% !important; background: #fff !important; width: 6px; height: 6px; }

/* game */
html[data-theme="christmas"] #game { padding-top: 26px; }
html[data-theme="christmas"] .title { color: #fff; font-size: 24px; text-shadow: 0 2px 0 #a3121f; }
html[data-theme="christmas"] .timer { background: rgba(255,255,255,.92); color: #a3121f; }
html[data-theme="christmas"] #board { border-radius: 12px; background: rgba(8, 28, 48, .74); border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 0 0 4px rgba(244,197,66,.25), 0 12px 24px rgba(0,0,0,.4); }
html[data-theme="christmas"] .cell { border: 1px dotted rgba(255,255,255,.12); }
html[data-theme="christmas"] .cell.target { background: rgba(244,197,66,.35); box-shadow: inset 0 0 8px #ffd54f; }
html[data-theme="christmas"] .tile { font-family: var(--font); font-weight: 700; border-radius: 7px; background: linear-gradient(#fff, #edf4f8);
  box-shadow: 0 2px 0 #9cb6c4, inset 0 3px 0 #fff; }
html[data-theme="christmas"] .tile.good { background: linear-gradient(#f0fff3, #c6f0d0); color: #0f5a2a; box-shadow: 0 2px 0 #2e8b57; }
html[data-theme="christmas"] .tile.bad { background: linear-gradient(#fff0f0, #ffd0d0); color: #a3121f; box-shadow: 0 2px 0 #c62828; }
html[data-theme="christmas"] .tile.selected { outline: 3px solid var(--accent); }
html[data-theme="christmas"] #tray { background: linear-gradient(90deg, transparent 48%, rgba(244,197,66,.85) 48% 52%, transparent 52%), linear-gradient(#d62839, #9e1824);
  border-radius: 10px; box-shadow: 0 3px 0 #5a0a10; }
html[data-theme="christmas"] #tray .slot { background: rgba(0,0,0,.22); }
html[data-theme="christmas"] .status { text-shadow: 0 1px 3px #000; font-style: italic; }
@keyframes xmas-drop { from { opacity: 0; transform: translateY(-40px) rotate(-12deg); } 70% { transform: translateY(3px) rotate(2deg); } to { opacity: 1; transform: none; } }
@keyframes xmas-jingle { 0% { transform: rotate(-12deg) scale(1.1); } 25% { transform: rotate(10deg); } 50% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } 100% { transform: none; } }

html[data-theme="christmas"] .modal { background: linear-gradient(#fffdf6, #f3ead6); color: #2a1a10; border-radius: 14px; position: relative; overflow: visible;
  box-shadow: 0 0 0 6px #d62839, 0 0 0 8px #f4c542, 0 22px 44px rgba(0,0,0,.5); }
html[data-theme="christmas"] .modal-wrap .modal { max-height: 84vh; overflow: auto; }
html[data-theme="christmas"] .modal h2 { color: #a3121f; font-size: 30px; }
html[data-theme="christmas"] .modal p, html[data-theme="christmas"] .modal li, html[data-theme="christmas"] .modal .rank { color: #2a1a10; }
html[data-theme="christmas"] .modal .bigtime { color: #0f5a2a; font-family: var(--head); }
html[data-theme="christmas"] .modal .row button { color: #fff; }
html[data-theme="christmas"] .modal input, html[data-theme="christmas"] .modal select { background: #fff; color: #2a1a10; border-color: #c9b48a; }
html[data-theme="christmas"] .modal .muted, html[data-theme="christmas"] .themeopt small, html[data-theme="christmas"] .modal .msgcount { color: #6a5a48; }
html[data-theme="christmas"] .themeopt, html[data-theme="christmas"] .explain, html[data-theme="christmas"] .seg { background: rgba(15,61,41,.08); color: #2a1a10; }
html[data-theme="christmas"] .seg button { color: #35614a; }
html[data-theme="christmas"] .scoretbl td { border-color: rgba(15,61,41,.18); }
html[data-theme="christmas"] .toast { background: #9e1824; color: #fff; border: 2px solid #f4c542; }
html[data-theme="christmas"] .lrow, html[data-theme="christmas"] .hrow { background: rgba(10,40,30,.9); }
html[data-theme="christmas"] .burst .flash { --flash: rgba(255,255,255,.35); }

/* =====================================================================
   Poop: a slightly grim bathroom stall. Tiled wall, a toilet with a
   cheerful resident, flies, toilet-paper buttons and turd tiles.
   ===================================================================== */
html[data-theme="poop"] { --bg: #e9dcc0; --bg2: rgba(255, 250, 238, .9); --panel: #fffaf0; --ink: #3a2416; --muted: #7a5a3e;
  --tile: #8b5a2b; --tile-edge: #4a2a10; --tile-ink: #fff3e0; --accent: #8b5a2b; --accent-edge: #4a2a10;
  --on-accent: #fff3e0; --shade: #b8a27c; --soft: #5a3a22; --good: #3f8f2a; --bad: #c62828;
  --font: "Fredoka", "Comic Sans MS", system-ui, sans-serif; --head: "Chewy", "Fredoka", cursive;
  --deal: poop-plop; --place: poop-splat; }
html[data-theme="poop"] body { font-family: var(--font); color: var(--ink);
  background:
    url(art/poop-tp.svg) left 14px top calc(env(safe-area-inset-top) + 6px) / 46px auto no-repeat,
    linear-gradient(rgba(120, 90, 40, .0) 70%, rgba(120, 90, 40, .12)),
    radial-gradient(ellipse 40px 18px at 30% 22%, rgba(140,110,50,.14), transparent), radial-gradient(ellipse 30px 50px at 82% 70%, rgba(140,110,50,.12), transparent),
    linear-gradient(#cdbb97 2px, transparent 2px) 0 0 / 44px 44px, linear-gradient(90deg, #cdbb97 2px, transparent 2px) 0 0 / 44px 44px,
    linear-gradient(#efe4cb, #e4d4b2); background-color: #e9dcc0; }
/* the toilet, and the floor it stands on */
html[data-theme="poop"] body::after { content: ""; left: -6px; right: 0; bottom: 0; height: 190px;
  background: url(art/poop-toilet.svg) left 2px bottom 6px / 150px auto no-repeat,
    repeating-conic-gradient(#5a3a22 0 25%, #d9c7a2 0 50%) 0 100% / 36px 36px;
  -webkit-mask-image: linear-gradient(transparent 0 calc(100% - 48px), #000 calc(100% - 48px)), linear-gradient(#000, #000);
  -webkit-mask-composite: source-over; }
/* flies */
html[data-theme="poop"] body::before { content: ""; left: 74px; bottom: 150px; width: 26px; height: 20px; z-index: 3;
  background: url(art/poop-fly.svg) center / contain no-repeat; animation: poop-fly 5s ease-in-out infinite; }
@keyframes poop-fly { 0% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(40px, -30px) rotate(20deg); }
  40% { transform: translate(-20px, -60px) rotate(-30deg); } 60% { transform: translate(60px, -20px) rotate(15deg); }
  80% { transform: translate(-30px, 10px) rotate(-10deg); } 100% { transform: translate(0, 0) rotate(0); } }

html[data-theme="poop"] h1, html[data-theme="poop"] .modal h2, html[data-theme="poop"] .bigbtn b, html[data-theme="poop"] .title,
html[data-theme="poop"] .stat b, html[data-theme="poop"] .timer, html[data-theme="poop"] .winner .wname, html[data-theme="poop"] .hrow .hname { font-family: var(--head); font-weight: 400; letter-spacing: .5px; }
html[data-theme="poop"] h1 { font-size: clamp(32px, 5vh, 44px); color: #6b3f1d; text-shadow: 0 3px 0 #c9a77a; }
html[data-theme="poop"] h1::before { content: "💩 "; } html[data-theme="poop"] h1::after { content: " 💩"; }
html[data-theme="poop"] .tagline { color: #5a3a22; font-weight: 600; }
html[data-theme="poop"] .tagline::after { content: " 💨"; }

/* logo: soft-serve swirls */
html[data-theme="poop"] .logo span { font-family: var(--head); font-weight: 400; font-size: clamp(22px, 3.6vh, 34px);
  border-radius: 50% 50% 42% 42% / 62% 62% 38% 38%; background: radial-gradient(circle at 35% 28%, #b07a45, #7a4a22 55%, #4a2a10); color: #fff3e0;
  box-shadow: 0 3px 0 #3a2010, inset 0 -6px 0 rgba(0,0,0,.18), inset 0 -12px 0 rgba(255,255,255,.06); animation: poop-wobble 3s ease-in-out infinite; }
html[data-theme="poop"] .logo span:nth-child(2) { animation-delay: .2s; } html[data-theme="poop"] .logo span:nth-child(3) { animation-delay: .4s; }
html[data-theme="poop"] .logo span:nth-child(4) { animation-delay: .6s; }
html[data-theme="poop"] .logo span.num { background: radial-gradient(circle at 35% 28%, #fff3a0, #f2c230 55%, #b8861c); color: #5a3a06; box-shadow: 0 3px 0 #7a5a0c; }
@keyframes poop-wobble { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.06, .94) translateY(2px); } }

/* toilet paper buttons: perforated, quilted, slightly crumpled */
html[data-theme="poop"] .bigbtn, html[data-theme="poop"] .iconbtn, html[data-theme="poop"] .smallbtn, html[data-theme="poop"] .modal .row button,
html[data-theme="poop"] .stat, html[data-theme="poop"] .roundbtn, html[data-theme="poop"] .timer {
  background: radial-gradient(circle, rgba(200,185,150,.45) 1.2px, transparent 1.8px) 0 0 / 12px 12px, linear-gradient(#fffdf6, #f3ecdc);
  color: #3a2416; border: 0; box-shadow: 0 3px 0 #c9b893, 0 4px 10px rgba(90,60,20,.18); }
html[data-theme="poop"] .bigbtn { border-radius: 4px; position: relative;
  background: linear-gradient(90deg, #d8cdb5 50%, transparent 50%) 0 0 / 8px 1.5px repeat-x, linear-gradient(90deg, #d8cdb5 50%, transparent 50%) 0 100% / 8px 1.5px repeat-x,
    radial-gradient(circle, rgba(200,185,150,.45) 1.2px, transparent 1.8px) 0 0 / 12px 12px, linear-gradient(#fffdf6, #f3ecdc); }
html[data-theme="poop"] .bigbtn:nth-of-type(odd) { transform: rotate(-.6deg); } html[data-theme="poop"] .bigbtn:nth-of-type(even) { transform: rotate(.5deg); }
html[data-theme="poop"] .bigbtn.primary, html[data-theme="poop"] .modal .row button.primary, html[data-theme="poop"] .smallbtn.primary,
html[data-theme="poop"] .seg button.on, html[data-theme="poop"] .lrow.me {
  background: radial-gradient(120% 140% at 30% 10%, #a56a35, #7a4a22 55%, #4a2a10); color: #fff3e0; box-shadow: 0 3px 0 #3a2010, inset 0 2px 0 rgba(255,255,255,.18); border-radius: 22px; }
html[data-theme="poop"] .bigbtn.primary b::after { content: " 💩"; }
html[data-theme="poop"] .bigbtn b { font-size: clamp(19px, 2.8vh, 24px); line-height: 1.05; }
html[data-theme="poop"] .bigbtn small { opacity: .85; font-weight: 500; }
html[data-theme="poop"] .bigbtn:active { transform: scale(.97, .93); }
html[data-theme="poop"] .betabadge { color: #8b5a2b; }
html[data-theme="poop"] .bigbtn.nine small.count { color: #8b5a2b; }
html[data-theme="poop"] .roundbtn { border-radius: 50%; }
html[data-theme="poop"] .stat { border-radius: 4px; } html[data-theme="poop"] .stat b { color: #6b3f1d; }
html[data-theme="poop"] .stat small { color: #7a5a3e; }
html[data-theme="poop"] .winner { background: #fffdf6; border: 3px dashed #8b5a2b; }
html[data-theme="poop"] .winner .wlabel::after { content: " 💩"; }
html[data-theme="poop"] .winner .wsub, html[data-theme="poop"] .winner .wmsg { color: var(--ink); }

/* game: turd tiles, squished onto the board */
html[data-theme="poop"] .title { color: #6b3f1d; font-size: 23px; }
html[data-theme="poop"] #board { border-radius: 18px; background: rgba(255, 252, 244, .78); border: 3px solid #c9b893; box-shadow: 0 6px 16px rgba(90,60,20,.2); }
html[data-theme="poop"] .cell { border: 1px solid rgba(139,90,43,.12); border-radius: 6px; }
html[data-theme="poop"] .cell.target { background: rgba(139,90,43,.25); }
html[data-theme="poop"] .tile { font-family: var(--font); font-weight: 700; border-radius: 46% 46% 38% 38% / 52% 52% 40% 40%;
  background: radial-gradient(circle at 35% 25%, #b07a45, #7a4a22 60%, #5a3216); color: #fff3e0;
  box-shadow: 0 2px 0 #3a2010, inset 0 -4px 0 rgba(0,0,0,.18); text-shadow: 0 1px 0 rgba(0,0,0,.35); }
html[data-theme="poop"] .tile.good { background: radial-gradient(circle at 35% 25%, #9ccf6a, #5d9a35 60%, #3c6e1e); box-shadow: 0 2px 0 #2a4e12, inset 0 -4px 0 rgba(0,0,0,.15); }
html[data-theme="poop"] .tile.bad { background: radial-gradient(circle at 35% 25%, #f07a6a, #c62828 60%, #8a1414); box-shadow: 0 2px 0 #5a0a0a, inset 0 -4px 0 rgba(0,0,0,.15); }
html[data-theme="poop"] .tile.selected { outline: 3px solid #f2c230; outline-offset: 1px; }
html[data-theme="poop"] #tray { background: rgba(255, 252, 244, .9); border-radius: 18px; box-shadow: 0 3px 0 #c9b893; }
html[data-theme="poop"] #tray .slot { background: rgba(139,90,43,.1); border-radius: 50%; }
html[data-theme="poop"] .status { color: #5a3a22; font-weight: 600; }
@keyframes poop-plop { 0% { opacity: 0; transform: translateY(-34px) scale(.7, 1.2); } 60% { opacity: 1; transform: translateY(2px) scale(1.25, .75); }
  80% { transform: scale(.92, 1.08); } 100% { transform: none; } }
@keyframes poop-splat { 0% { transform: scale(1.35, .6); } 40% { transform: scale(.85, 1.15); } 70% { transform: scale(1.06, .94); } 100% { transform: none; } }

html[data-theme="poop"] .modal { background: radial-gradient(circle, rgba(200,185,150,.4) 1.2px, transparent 1.8px) 0 0 / 12px 12px, #fffdf6; color: #3a2416;
  border-radius: 6px; box-shadow: 0 0 0 3px #c9b893, 0 20px 40px rgba(60,40,10,.4); }
html[data-theme="poop"] .modal-wrap { background: rgba(70, 45, 20, .6); }
html[data-theme="poop"] .modal h2 { color: #6b3f1d; font-size: 30px; }
html[data-theme="poop"] .modal p, html[data-theme="poop"] .modal li { color: #3a2416; }
html[data-theme="poop"] .modal .bigtime { color: #8b5a2b; font-family: var(--head); font-weight: 400; }
html[data-theme="poop"] .modal input, html[data-theme="poop"] .modal select { background: #fff; color: #3a2416; border-color: #c9b893; }
html[data-theme="poop"] .themeopt, html[data-theme="poop"] .explain, html[data-theme="poop"] .seg { background: rgba(139,90,43,.08); }
html[data-theme="poop"] .lrow, html[data-theme="poop"] .hrow { background: rgba(255,252,244,.92); }
html[data-theme="poop"] .lhead, html[data-theme="poop"] #leadersMe { color: #5a3a22; }
html[data-theme="poop"] .toast { background: #5a3216; color: #fff3e0; }
html[data-theme="poop"] .smallbtn.outline { border-color: rgba(90,58,34,.3); }
html[data-theme="poop"] .modal input[type=datetime-local] { color-scheme: light; }
html[data-theme="poop"] .burst .flash { --flash: rgba(156, 204, 101, .35); }

/* =====================================================================
   Hot Dog: a sunny ballpark stand. Striped awning, a hot dog cart and a
   very confident wiener. Bun buttons, ketchup and mustard everywhere.
   ===================================================================== */
html[data-theme="hotdog"] { --bg: #8ed1fc; --bg2: rgba(255, 248, 232, .92); --panel: #fff8e8; --ink: #3b1d0e; --muted: #7a4a2a;
  --tile: #ffd23f; --tile-edge: #c98a00; --tile-ink: #5a1a0a; --accent: #e63b2e; --accent-edge: #8f1d14;
  --on-accent: #fff; --shade: #b57530; --soft: #5a2e16; --good: #2e7d32; --bad: #c62828;
  --font: "Fredoka", "Trebuchet MS", sans-serif; --head: "Bungee", "Lilita One", sans-serif; --chunky: "Lilita One", "Fredoka", sans-serif;
  --deal: dog-squirt; --place: dog-bounce;
  --bun: linear-gradient(#f7cf8f, #e8a85a 55%, #c98236); }
html[data-theme="hotdog"] body { font-family: var(--font); color: var(--ink);
  background:
    url(art/hotdog-mascot.svg) right 4px bottom 26px / 92px auto no-repeat,
    url(art/hotdog-cart.svg) left 2px bottom 22px / 140px auto no-repeat,
    linear-gradient(90deg, rgba(230,59,46,.55) 50%, transparent 50%) 0 100% / 36px 40px repeat-x,
    linear-gradient(rgba(230,59,46,.55) 50%, transparent 50%) 0 100% / 36px 36px repeat-x,
    linear-gradient(#fff6e5, #fff6e5) 0 100% / 100% 40px no-repeat,
    radial-gradient(ellipse 60px 20px at 18% 22%, #fff, transparent), radial-gradient(ellipse 80px 24px at 78% 34%, #fffe, transparent),
    radial-gradient(ellipse 50px 16px at 60% 14%, #fffd, transparent),
    linear-gradient(#6cc3f7, #a9dcfb 55%, #d8f0fd); background-color: #8ed1fc; }
/* striped awning across the top, gently flapping */
html[data-theme="hotdog"] body::before { content: ""; left: -10px; right: -10px; top: 0; height: calc(env(safe-area-inset-top) + 30px); z-index: 3;
  background: url(art/hotdog-awning.svg) 0 bottom / 48px 26px repeat-x, #e63b2e; transform-origin: top; animation: dog-flap 3.5s ease-in-out infinite; }
@keyframes dog-flap { 50% { transform: scaleY(1.06) skewX(-1deg); } }
html[data-theme="hotdog"] #home { padding-top: calc(clamp(8px, 1.6vh, 24px) + 22px); }
html[data-theme="hotdog"] .topicons { top: 36px; }
html[data-theme="hotdog"] #game, html[data-theme="hotdog"] #leaders, html[data-theme="hotdog"] #hall { padding-top: 32px; }

html[data-theme="hotdog"] h1, html[data-theme="hotdog"] .bigbtn b, html[data-theme="hotdog"] .modal h2, html[data-theme="hotdog"] .title,
html[data-theme="hotdog"] .winner .wname, html[data-theme="hotdog"] .hrow .hname { font-family: var(--head); font-weight: 400; letter-spacing: .3px; }
html[data-theme="hotdog"] h1 { font-size: clamp(30px, 4.6vh, 42px); color: #ffd23f; -webkit-text-stroke: 2px #8f1d14; text-shadow: 3px 3px 0 #8f1d14; }
html[data-theme="hotdog"] h1::before { content: "🌭 "; -webkit-text-stroke: 0; } html[data-theme="hotdog"] h1::after { content: " 🌭"; -webkit-text-stroke: 0; }
html[data-theme="hotdog"] .tagline { font-family: var(--chunky); font-size: clamp(15px, 2.2vh, 18px); color: #8f1d14; text-shadow: 0 1px 0 #fff; }

/* logo: four hot dogs, mustard on the numbers */
html[data-theme="hotdog"] .logo span { font-family: var(--chunky); font-weight: 400; font-size: clamp(22px, 3.6vh, 34px); border-radius: 40% / 50%;
  background: var(--bun); color: #5a1a0a; box-shadow: 0 3px 0 #a5662a, inset 0 0 0 3px rgba(255,255,255,.25); position: relative; }
html[data-theme="hotdog"] .logo span.num { background: radial-gradient(ellipse at 50% 30%, #e8734e, #b5442c 60%, #8f2f1c); color: #ffd23f;
  -webkit-text-stroke: 1px #5a1a0a; box-shadow: 0 3px 0 #6e2212, 0 0 0 4px #e8a85a; }

/* buns for buttons; the main one is a wiener with mustard */
html[data-theme="hotdog"] .bigbtn, html[data-theme="hotdog"] .iconbtn, html[data-theme="hotdog"] .smallbtn, html[data-theme="hotdog"] .modal .row button,
html[data-theme="hotdog"] .roundbtn { background: var(--bun); color: #3b1d0e; border: 0; box-shadow: 0 3px 0 #a5662a, inset 0 2px 0 rgba(255,255,255,.4); }
html[data-theme="hotdog"] .bigbtn { border-radius: 26px; }
html[data-theme="hotdog"] .bigbtn.primary, html[data-theme="hotdog"] .modal .row button.primary, html[data-theme="hotdog"] .smallbtn.primary,
html[data-theme="hotdog"] .seg button.on, html[data-theme="hotdog"] .lrow.me {
  background: linear-gradient(#e0643f, #b5442c 55%, #8f2f1c); color: #fff; box-shadow: 0 3px 0 #5a1a0a, 0 0 0 3px #e8a85a, inset 0 2px 0 rgba(255,255,255,.3); }
html[data-theme="hotdog"] .bigbtn.primary::after { content: ""; height: 10px; margin: 2px -4px -2px; flex: 0 0 auto;
  background: radial-gradient(circle at 50% 0, transparent 5px, #ffd400 5.5px 8px, transparent 8.5px) 0 0 / 20px 10px repeat-x,
    radial-gradient(circle at 50% 100%, transparent 5px, #ffd400 5.5px 8px, transparent 8.5px) 10px 0 / 20px 10px repeat-x; }
html[data-theme="hotdog"] .bigbtn b { font-size: clamp(15px, 2.2vh, 18px); }
html[data-theme="hotdog"] .bigbtn small { font-weight: 500; }
html[data-theme="hotdog"] .bigbtn:active { transform: scale(.97); }
html[data-theme="hotdog"] .betabadge { color: #8f1d14; }
html[data-theme="hotdog"] .bigbtn.nine small.count { color: #8f1d14; }
html[data-theme="hotdog"] .roundbtn { border-radius: 50%; }
html[data-theme="hotdog"] .stat { background: #fff; border-radius: 14px; box-shadow: 0 3px 0 #e63b2e; }
html[data-theme="hotdog"] .stat b { font-family: var(--chunky); font-weight: 400; color: #e63b2e; }
html[data-theme="hotdog"] .stat small { color: #7a4a2a; }
html[data-theme="hotdog"] .winner { background: #fff; border: 3px solid #e63b2e; }
html[data-theme="hotdog"] .winner .wsub, html[data-theme="hotdog"] .winner .wmsg { color: var(--ink); }

/* game */
html[data-theme="hotdog"] .title { color: #8f1d14; font-size: 17px; text-shadow: 0 1px 0 #fff; }
html[data-theme="hotdog"] .timer { background: #fff; color: #e63b2e; font-family: var(--chunky); font-weight: 400; font-size: 20px; box-shadow: 0 3px 0 #e63b2e; }
html[data-theme="hotdog"] #board { border-radius: 14px; background: linear-gradient(90deg, rgba(230,59,46,.08) 50%, transparent 50%) 0 0 / calc(var(--cell) * 2) 100%,
    linear-gradient(rgba(230,59,46,.08) 50%, transparent 50%) 0 0 / 100% calc(var(--cell) * 2), rgba(255,255,255,.86);
  border: 2px solid #e63b2e; box-shadow: 0 4px 0 rgba(143,29,20,.25); }
html[data-theme="hotdog"] .cell { border: 1px solid rgba(230,59,46,.12); }
html[data-theme="hotdog"] .cell.target { background: rgba(255,210,63,.6); }
html[data-theme="hotdog"] .tile { font-family: var(--chunky); font-weight: 400; border-radius: 10px; background: linear-gradient(#ffe07a, #ffd23f 60%, #f2b800);
  color: #5a1a0a; box-shadow: 0 2px 0 #b8860b, inset 0 2px 0 rgba(255,255,255,.55); }
html[data-theme="hotdog"] .tile.good { background: linear-gradient(#c5e8a0, #8bc34a 60%, #6a9e2e); color: #1e3d0a; box-shadow: 0 2px 0 #3f6a15; }
html[data-theme="hotdog"] .tile.bad { background: linear-gradient(#ff8a7a, #e63b2e 60%, #b5271c); color: #fff; box-shadow: 0 2px 0 #7c1a12; }
html[data-theme="hotdog"] .tile.selected { outline: 3px solid #8f1d14; outline-offset: 1px; }
html[data-theme="hotdog"] #tray { background: var(--bun); border-radius: 40px; box-shadow: 0 4px 0 #a5662a, inset 0 3px 0 rgba(255,255,255,.35); }
html[data-theme="hotdog"] #tray .slot { background: rgba(120, 60, 10, .18); border-radius: 12px; }
html[data-theme="hotdog"] .status { color: #5a1a0a; font-weight: 600; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
@keyframes dog-squirt { 0% { opacity: 0; transform: scale(.2, 1.4); } 60% { opacity: 1; transform: scale(1.15, .85); } 100% { transform: none; } }
@keyframes dog-bounce { 0% { transform: translateY(-8px); } 50% { transform: translateY(2px) scale(1.08, .92); } 100% { transform: none; } }

html[data-theme="hotdog"] .modal { background: #fff8e8; color: #3b1d0e; border-radius: 18px; box-shadow: 0 0 0 4px #e63b2e, 0 0 0 8px #ffd23f, 0 20px 40px rgba(0,0,0,.35); }
html[data-theme="hotdog"] .modal-wrap { background: rgba(60, 20, 10, .55); }
html[data-theme="hotdog"] .modal h2 { color: #e63b2e; font-size: 22px; }
html[data-theme="hotdog"] .modal p, html[data-theme="hotdog"] .modal li { color: #3b1d0e; }
html[data-theme="hotdog"] .modal .bigtime { color: #e63b2e; font-family: var(--chunky); font-weight: 400; }
html[data-theme="hotdog"] .modal input, html[data-theme="hotdog"] .modal select { background: #fff; color: #3b1d0e; border-color: #e8a85a; }
html[data-theme="hotdog"] .themeopt, html[data-theme="hotdog"] .explain, html[data-theme="hotdog"] .seg { background: rgba(230,59,46,.07); }
html[data-theme="hotdog"] .lrow, html[data-theme="hotdog"] .hrow { background: rgba(255,255,255,.92); }
html[data-theme="hotdog"] .lhead, html[data-theme="hotdog"] #leadersMe { color: #5a1a0a; }
html[data-theme="hotdog"] .toast { background: #e63b2e; color: #fff; border: 3px solid #ffd23f; }
html[data-theme="hotdog"] .modal input[type=datetime-local] { color-scheme: light; }
html[data-theme="hotdog"] .burst .flash { --flash: rgba(255, 210, 63, .4); }

/* =====================================================================
   Style picker swatches: a slice of each style's artwork
   ===================================================================== */
.sw-terminal { background: #0c0c0c; color: #16c60c; font-family: "Cascadia Mono", monospace; }
.sw-terminal span { background: none !important; box-shadow: none !important; }
.sw-pirate { background: url(art/pirate-ship.svg) 50% 30% / 120% auto no-repeat, linear-gradient(#0b2a3a, #0f4a5a); }
.sw-medieval { background: url(art/medieval-castle.svg) 50% 60% / 140% auto no-repeat, linear-gradient(#22183a, #9a4a3a); }
.sw-cyberpunk { background: url(art/cyber-city.svg) 50% 40% / 160% auto no-repeat, #05050b; }
.sw-neon { background: url(art/neon-sunset.svg) 50% 50% / 150% auto no-repeat, #24093f; }
.sw-christmas { background: url(art/xmas-village.svg) 40% 70% / 170% auto no-repeat, #0b2240; }
.sw-poop { background: url(art/poop-toilet.svg) 50% 45% / 90% auto no-repeat, #e9dcc0; }
.sw-hotdog { background: url(art/hotdog-mascot.svg) 50% 30% / 80% auto no-repeat, #8ed1fc; }
.swatch[class*="sw-"] span { background: rgba(0,0,0,.45); color: #fff; font-size: 15px; }
.sw-poop span, .sw-hotdog span, .sw-christmas span { background: none !important; box-shadow: none !important; font-size: 0 !important; }

/* Keep every screen's bottom ~64px clear: the "Powered by Netlify" badge sits there on the web version.
   (Home has its own, larger rule.) Pop-ups get the same space so their buttons stay tappable. */
html[data-theme] .screen:not(#home) { padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
html[data-theme] .modal-wrap { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
html[data-theme] .modal { max-height: calc(100% - 8px); }

/* ---------- Daily rules prompt ("Are you ready?") ---------- */
/* light parchment / paper modals: the warning box needs a light fill so its dark text stays readable */
html[data-theme="medieval"] .modal .warnbox, html[data-theme="christmas"] .modal .warnbox { background: rgba(255,255,255,.55); }
html[data-theme="medieval"] .modal .ready { font-family: var(--head); font-size: 21px; font-weight: 700; color: #7a1414; }
html[data-theme="christmas"] .modal .ready { font-size: 22px; color: #a3121f; }
html[data-theme="pirate"] .modal .ready { color: #7a1a10; }
/* cyberpunk's hazard stripes sit on the right of the primary button: keep "I'm ready" clear of them */
html[data-theme="cyberpunk"] .dailyrules .row button.primary { padding-right: 58px; }
html[data-theme="cyberpunk"] .modal .ready { color: var(--accent); font-family: var(--head); letter-spacing: 1px; }
