/* Smarty Party — a neon game-show stage. Everything colourful comes from the theme tokens below,
   so a seasonal theme (Halloween, Christmas…) only has to override them and the decorations. */

:where(:root), [data-theme="classic"] {   /* (:where: no weight, so a theme file always wins whatever order the phone loads them in) */
  --bg-0: #07051a;
  --bg-1: #140c3a;
  --bg-2: #2a0f5e;
  --panel: rgba(23, 16, 62, .82);
  --panel-edge: rgba(140, 120, 255, .28);
  --ink: #f5f3ff;
  --ink-dim: #a9a3d6;
  --hot: #ff3d8b;          /* main accent */
  --hot-2: #ff8a3d;
  --cool: #33e1ff;
  --zest: #b6ff3b;
  --gold: #ffd23d;
  --opt-0: #ff4f6d;  --opt-1: #4f7dff;  --opt-2: #2fd59a;  --opt-3: #ffb829;
  --logo-a: #ffd23d; --logo-b: #ff3d8b; --logo-c: #8b5cff;
  --beam: rgba(255, 61, 139, .16);
  --beam-2: rgba(51, 225, 255, .13);
  --floor: rgba(139, 92, 255, .35);
  --display: 'Lilita One', 'Outfit', system-ui, sans-serif;
  --body: 'Outfit', system-ui, sans-serif;
  --radius: 18px;
  --sunk: rgba(0, 0, 0, .3);
  --raise: rgba(255, 255, 255, .07);
}

/* ---- themes: pick in ⚙️ Settings. Each only changes the tokens. ---- */
[data-theme="studio"] {     /* TV game-show set: deep blue and gold */
  --bg-0: #040b1f; --bg-1: #0a1e4a; --bg-2: #123a8a; --panel: rgba(8, 24, 64, .85); --panel-edge: rgba(255, 210, 80, .3);
  --ink: #fffaf0; --ink-dim: #a9b8dc; --hot: #ffc93d; --hot-2: #ff8a3d; --cool: #4fd1ff; --zest: #7dffa0; --gold: #ffd84d;
  --opt-0: #ff5a5a; --opt-1: #3d8bff; --opt-2: #24c98a; --opt-3: #ffb020;
  --logo-a: #fff3b0; --logo-b: #ffc93d; --logo-c: #ff8a3d; --beam: rgba(255, 220, 120, .14); --beam-2: rgba(80, 180, 255, .12); --floor: rgba(255, 210, 80, .22);
}
[data-theme="daylight"] {   /* bright and clean, like a modern board game */
  --sunk: rgba(20, 20, 40, .05); --raise: rgba(20, 20, 40, .04);
  --bg-0: #f3efe6; --bg-1: #faf7f0; --bg-2: #ffffff; --panel: #ffffff; --panel-edge: rgba(20, 20, 40, .14);
  --ink: #17172b; --ink-dim: #6b6a80; --hot: #ff5a3d; --hot-2: #ffb02e; --cool: #2f7dff; --zest: #12a36b; --gold: #e09a00;
  --opt-0: #ff5a5a; --opt-1: #2f7dff; --opt-2: #16b879; --opt-3: #ffae1a;
  --logo-a: #ff5a3d; --logo-b: #ff2f6d; --logo-c: #2f7dff; --beam: rgba(255, 180, 80, .18); --beam-2: rgba(47, 125, 255, .1); --floor: rgba(20, 20, 40, .07);
}
[data-theme="midnight"] {   /* charcoal with teal and orange */
  --bg-0: #08090b; --bg-1: #12151a; --bg-2: #1d2530; --panel: rgba(24, 28, 34, .9); --panel-edge: rgba(255, 255, 255, .1);
  --ink: #f2f4f7; --ink-dim: #96a0ae; --hot: #ff8a2b; --hot-2: #ffb02e; --cool: #22d3c5; --zest: #9be15d; --gold: #ffc23d;
  --opt-0: #ff6058; --opt-1: #3b9dff; --opt-2: #22c58b; --opt-3: #f5b02a;
  --logo-a: #ffd27a; --logo-b: #ff8a2b; --logo-c: #22d3c5; --beam: rgba(34, 211, 197, .08); --beam-2: rgba(255, 138, 43, .07); --floor: var(--raise);
}
[data-theme="pitch"] {      /* floodlit green */
  --bg-0: #03140c; --bg-1: #062a18; --bg-2: #0c4a2a; --panel: rgba(4, 30, 18, .86); --panel-edge: rgba(255, 255, 255, .16);
  --ink: #f4fff8; --ink-dim: #9cc7ae; --hot: #e9ff4d; --hot-2: #ffd23d; --cool: #4de3ff; --zest: #7dff9e; --gold: #ffe14d;
  --opt-0: #ff5a5a; --opt-1: #3d8bff; --opt-2: #e9ff4d; --opt-3: #ffffff;
  --logo-a: #ffffff; --logo-b: #e9ff4d; --logo-c: #7dff9e; --beam: rgba(255, 255, 255, .1); --beam-2: var(--raise); --floor: rgba(255, 255, 255, .12);
}
[data-theme="crimson"] {    /* deep red and white */
  --bg-0: #1a0003; --bg-1: #4a000a; --bg-2: #9e0d1b; --panel: rgba(40, 0, 6, .82); --panel-edge: rgba(255, 255, 255, .2);
  --ink: #ffffff; --ink-dim: #f2b6bb; --hot: #ffffff; --hot-2: #ffd23d; --cool: #ffd23d; --zest: #8dff9a; --gold: #ffd23d;
  --opt-0: #ff4a5a; --opt-1: #ffffff; --opt-2: #2fc98a; --opt-3: #ffd23d;
  --logo-a: #ffffff; --logo-b: #ffd9dc; --logo-c: #ffd23d; --beam: rgba(255, 255, 255, .1); --beam-2: rgba(255, 210, 60, .08); --floor: rgba(255, 255, 255, .14);
}
[data-theme="royal"] {      /* royal blue and white */
  --bg-0: #000a24; --bg-1: #00205b; --bg-2: #0a3fa8; --panel: rgba(0, 20, 60, .84); --panel-edge: rgba(255, 255, 255, .2);
  --ink: #ffffff; --ink-dim: #b6c6ec; --hot: #ffffff; --hot-2: #ffd23d; --cool: #7fc8ff; --zest: #8dff9a; --gold: #ffd23d;
  --opt-0: #ff5a5a; --opt-1: #7fc8ff; --opt-2: #2fc98a; --opt-3: #ffd23d;
  --logo-a: #ffffff; --logo-b: #d6e4ff; --logo-c: #7fc8ff; --beam: rgba(255, 255, 255, .1); --beam-2: rgba(127, 200, 255, .1); --floor: rgba(255, 255, 255, .14);
}
[data-theme="neon"] {       /* the original neon arcade (purple) */ }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
html.is-tv { font-size: clamp(16px, 1.9vmin, 34px); }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(120% 80% at 50% -10%, var(--bg-2) 0%, var(--bg-1) 40%, var(--bg-0) 85%) fixed var(--bg-0);
  color: var(--ink); font-family: var(--body); font-weight: 600; overflow-x: clip;   /* clip, not hidden: hidden made body a scroll box and broke sticky buttons */
}
button { font-family: inherit; }

/* ---------------------------------------------------------------- the stage behind everything */
body { isolation: isolate; }
/* the scenery's ground sits on the tab bar when there is one, else on the bottom of the screen (a page without it,
   like Single Player, showed a blank band there) */
body { --tabh: 0px; } body.with-tabs { --tabh: 4.4rem; }
#stage-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.beams::before, .beams::after {
  content: ''; position: absolute; top: -20%; width: 40vmax; height: 140vh;
  background: radial-gradient(60% 100% at 50% 0%, var(--beam), transparent 75%); transform-origin: top center;
}
.beams::before { left: 5%; transform: rotate(18deg); }
.beams::after { right: 5%; background: radial-gradient(60% 100% at 50% 0%, var(--beam-2), transparent 75%); transform: rotate(-18deg); animation-delay: -4.5s; }
@keyframes sweep { from { rotate: -8deg; } to { rotate: 8deg; } }
/* a flat neon grid glowing up from the bottom (no 3D transforms: some phones draw them over the page) */
.floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38vh;
  background-image:
    linear-gradient(to bottom, var(--bg-0), transparent 75%),
    linear-gradient(var(--floor) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--floor) 1.5px, transparent 1.5px);
  background-size: 100% 100%, 44px 44px, 44px 44px;
}
.floaters span { position: absolute; font-family: var(--display); font-size: 3rem; opacity: .045; animation: drift 22s linear infinite; }
@keyframes drift { from { transform: translateY(110vh) rotate(0); } to { transform: translateY(-20vh) rotate(360deg); } }

#app { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
html.is-tv #app { max-width: none; padding: 2vmin 3vmin; height: 100vh; }

/* ---------------------------------------------------------------- logo */
.logo { font-family: var(--display); line-height: .9; text-align: center; letter-spacing: .01em; user-select: none; }
.logo .l1, .logo .l2 { display: block; background: linear-gradient(180deg, var(--logo-a), var(--logo-b) 60%, var(--logo-c));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.55)) drop-shadow(0 0 18px color-mix(in srgb, var(--logo-b) 55%, transparent)); }
.logo .l1 { font-size: 3.6rem; transform: rotate(-3deg); }
.logo .l2 { font-size: 4.4rem; transform: rotate(-3deg) translateX(.6rem); margin-top: -.2rem; }
.logo.small .l1, .logo.small .l2 { font-size: 1.25rem; display: inline; transform: none; margin: 0; filter: drop-shadow(0 2px 0 rgba(0,0,0,.5)); }
.logo.small .l2 { margin-left: .25rem; }
.logo { position: relative; }
.logo .spark { position: absolute; right: 12%; top: -.4rem; font-size: 2.2rem; color: var(--gold); animation: twinkle 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 10px var(--gold)); }
/* "Beta" tag until the app is finished */
.logo .beta { display: block; width: max-content; margin: .5rem auto 0; font: 900 .75rem var(--body); letter-spacing: .25em;
  text-transform: uppercase; color: var(--cool); padding: .2em .4em .2em .65em; border: 1.5px solid var(--cool); border-radius: 99px;
  box-shadow: 0 0 12px color-mix(in srgb, var(--cool) 35%, transparent); }
.logo.small .beta { display: inline-block; margin: 0 0 0 .4rem; font-size: .55rem; vertical-align: middle; letter-spacing: .15em;
  padding: .1em .3em .1em .45em; }
/* Head to Head: back to all subjects */
.crumb { align-self: flex-start; display: inline-flex; align-items: center; gap: .3rem; font: 800 .9rem var(--body); color: var(--cool);
  background: none; border: 0; padding: .2rem 0; cursor: pointer; }
.crumb .ic { width: 1rem; height: 1rem; }
@keyframes twinkle { 50% { transform: scale(1.3) rotate(20deg); opacity: .6; } }

/* ---------------------------------------------------------------- shared bits */
.panel { background: var(--panel); border: 1.5px solid var(--panel-edge); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.45), inset 0 1px 0 var(--raise); backdrop-filter: blur(6px); }
.btn { font: 900 1.1rem var(--body); letter-spacing: .02em; text-transform: uppercase; border: 0; border-radius: 14px;
  padding: .95em 1.2em; cursor: pointer; color: #1a0b12; touch-action: manipulation;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hot) 70%, white), var(--hot));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--hot) 55%, black), 0 10px 24px color-mix(in srgb, var(--hot) 35%, transparent);
  transition: transform .08s, box-shadow .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--hot) 55%, black); }
.btn.alt { --hot: var(--cool); }
.btn.gold { --hot: var(--gold); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--panel-edge); }
.btn.small { font-size: .85rem; padding: .6em .9em; }
.btn:disabled { opacity: .45; box-shadow: none; }   /* greying the pink made it look brown */
.btn.wide { width: 100%; }
.field { width: 100%; font: 800 1.25rem var(--body); color: var(--ink); background: var(--sunk); border: 2px solid var(--panel-edge);
  border-radius: 14px; padding: .75em .9em; outline: none; }
.field:focus { border-color: var(--cool); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cool) 25%, transparent); }
.label { font-weight: 800; color: var(--ink-dim); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: .9rem .2rem .4rem; }
.title { font-family: var(--display); font-weight: 400; letter-spacing: .02em; margin: 0; text-shadow: 0 3px 0 rgba(0,0,0,.5); }
.dim { color: var(--ink-dim); }
.center { text-align: center; }
.row { display: flex; gap: .6rem; align-items: center; }
.grow { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: .35em; font-weight: 800; font-size: .8rem; padding: .35em .75em; border-radius: 99px;
  background: var(--raise); border: 1px solid var(--panel-edge); }
.pop { animation: pop .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.rise { animation: rise .4s ease-out both; }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------------------------------------------------------------- home & setup */
.home { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1rem; padding: 2rem 0; }
.home .logo { margin-bottom: 1.4rem; }
.tag { text-align: center; color: var(--ink-dim); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; margin-top: -.6rem; margin-bottom: 1.2rem; }
.choicegrid { display: grid; gap: .6rem; }
.choicegrid.two { grid-template-columns: 1fr 1fr; }
.pick { text-align: left; color: var(--ink); background: var(--sunk); border: 2px solid var(--panel-edge); border-radius: 14px; padding: .8rem .9rem; cursor: pointer; font: 800 1rem var(--body); }
.pick small { display: block; font-weight: 600; color: var(--ink-dim); margin-top: .15rem; font-size: .8rem; }
.pick:disabled { opacity: .45; cursor: not-allowed; }
select.field { appearance: none; -webkit-appearance: none; cursor: pointer; }
.pick.on { border-color: var(--cool); background: color-mix(in srgb, var(--cool) 16%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cool) 20%, transparent); }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: .35rem; }
.avatars button { font-size: 1.6rem; background: var(--sunk); border: 2px solid transparent; border-radius: 12px; padding: .3rem 0; cursor: pointer; }
.avatars button.on { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 18%, transparent); transform: scale(1.08); }
.err { color: var(--opt-0); font-weight: 800; text-align: center; min-height: 1.3em; margin: .4rem 0; }
.steps { display: flex; justify-content: center; gap: .4rem; margin-bottom: .6rem; }
.steps i { width: 2rem; height: .35rem; border-radius: 99px; background: rgba(255,255,255,.15); }
.steps i.on { background: var(--hot); }

/* ---------------------------------------------------------------- in a room */
.topbar { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.codechip { font-family: var(--display); font-size: 1.15rem; letter-spacing: .18em; padding: .25em .7em; border-radius: 12px;
  background: var(--sunk); border: 1.5px solid var(--panel-edge); cursor: pointer; color: var(--gold); }
.me { display: flex; align-items: center; gap: .35rem; font-weight: 900; }
.me .av { font-size: 1.5rem; }
.mebtn { font: 900 1rem var(--body); color: var(--ink); background: var(--sunk); border: 1.5px solid var(--panel-edge); border-radius: 99px; padding: .25rem .8rem .25rem .3rem; cursor: pointer; }
.me .pts { color: var(--gold); font-size: .9rem; }

.screen { position: relative; border-radius: var(--radius); padding: 1rem; min-height: 9rem; display: flex; flex-direction: column; gap: .8rem; overflow: hidden; }
.is-tv .screen { flex: 1; padding: 2rem 3rem; }
.controls { margin-top: .8rem; display: flex; flex-direction: column; gap: .7rem; }
.hostbar { display: flex; gap: .5rem; justify-content: center; margin-top: .6rem; }
.screen-toggle { align-self: center; }

/* timer ring */
.timer { position: absolute; top: .7rem; right: .7rem; width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center;
  font: 900 1.1rem var(--body); background: conic-gradient(var(--cool) calc(var(--p) * 1%), rgba(255,255,255,.1) 0); }
.timer::before { content: ''; position: absolute; inset: .3rem; border-radius: 50%; background: var(--bg-1); }
.timer span { position: relative; }
.timer.low { --cool: var(--opt-0); animation: shake .5s infinite; }

/* question screens */
.qhead { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-right: 3.4rem; }
.qtext { font-size: 1.45rem; font-weight: 900; line-height: 1.22; text-wrap: balance; }
.is-tv .qtext { font-size: 2.6rem; }
.opts { display: grid; gap: .55rem; }
.is-tv .opts { grid-template-columns: 1fr 1fr; gap: 1rem; }
.opt { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 14px; font-weight: 800; font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; hyphens: auto;
  background: var(--sunk); border: 2px solid color-mix(in srgb, var(--c) 55%, transparent); transition: opacity .4s, transform .4s, filter .4s; position: relative; }
.is-tv .opt { font-size: 1.6rem; padding: 1.1rem 1.3rem; }
.badge { flex: none; width: 2rem; height: 2rem; display: grid; place-items: center; font-family: var(--display); font-size: 1.15rem;
  color: #fff; background: var(--c); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.is-tv .badge { width: 3rem; height: 3rem; font-size: 1.7rem; }
/* On a phone the answers only appear as the big buttons (and in the reveal), so the layout never jumps.
   The TV always shows them on screen. */
html:not(.is-tv) .screen .opts:not(.revealed), html:not(.is-tv) .screen .votes.picking { display: none; }
.opt.right { background: color-mix(in srgb, var(--c) 35%, transparent); border-color: var(--c); transform: scale(1.02);
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 55%, transparent); }
.opt.wrong { opacity: .32; filter: grayscale(1); }   /* part-grey turned the yellow option brown */
.opt .who { margin-left: auto; display: flex; gap: .15rem; font-size: 1.1rem; flex-wrap: wrap; justify-content: flex-end; }
.c0 { --c: var(--opt-0); } .c1 { --c: var(--opt-1); } .c2 { --c: var(--opt-2); } .c3 { --c: var(--opt-3); }
.fact { font-weight: 700; color: var(--gold); background: var(--sunk); border-radius: 12px; padding: .6rem .8rem; }
.is-tv .fact { font-size: 1.4rem; }
.double { color: var(--gold); }

/* banner / winner */
.banner { text-align: center; padding: 1.4rem .4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; }
.banner .em { font-size: 4.5rem; line-height: 1; }
.banner .title { font-size: 2.6rem; margin-top: .4rem;
  /* same colours as the Smarty Party logo; no text-shadow, which shows through the clear letters and turns them brown */
  background: linear-gradient(180deg, var(--logo-a), var(--logo-b) 60%, var(--logo-c)); -webkit-background-clip: text; background-clip: text;
  color: transparent; text-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(0,0,0,.5)) drop-shadow(0 0 14px color-mix(in srgb, var(--logo-b) 50%, transparent)); }
.is-tv .banner .em { font-size: 10rem; } .is-tv .banner .title { font-size: 6rem; }
.confetti i { position: absolute; top: -10%; width: .6rem; height: 1rem; border-radius: 2px; animation: fall 3.2s linear infinite; }
@keyframes fall { to { transform: translateY(130vh) rotate(720deg); } }

/* lobby */
.bigcode { font-family: var(--display); font-size: 3.4rem; letter-spacing: .2em; color: var(--gold); text-align: center; line-height: 1;
  text-shadow: 0 4px 0 rgba(0,0,0,.5), 0 0 22px color-mix(in srgb, var(--gold) 40%, transparent); }
.is-tv .bigcode { font-size: 9rem; }
.players { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.pl { display: flex; flex-direction: column; align-items: center; width: 4.6rem; position: relative; }
.pl .av { font-size: 2.2rem; width: 3.4rem; height: 3.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--raise); border: 2px solid var(--panel-edge); }
.is-tv .pl { width: 8rem; } .is-tv .pl .av { font-size: 4rem; width: 6rem; height: 6rem; }
.pl .nm { font-weight: 800; font-size: .8rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .sc { font-size: .75rem; color: var(--gold); font-weight: 900; }
.pl.off { opacity: .35; }
.pl.answered .av { border-color: var(--zest); box-shadow: 0 0 12px color-mix(in srgb, var(--zest) 60%, transparent); }
.pl.thinking .av { animation: think 1.2s ease-in-out infinite; }
@keyframes think { 50% { transform: translateY(-4px); } }
.pl .crown { position: absolute; top: -.7rem; font-size: 1rem; }
.qr { background: #fff; padding: .6rem; border-radius: 14px; align-self: center; }
.qr img, .qr canvas { width: 11rem !important; height: 11rem !important; display: block; }
.is-tv .qr img, .is-tv .qr canvas { width: 18rem !important; height: 18rem !important; }
.lobby-tv { display: grid; grid-template-columns: auto 1fr; gap: 3rem; align-items: center; flex: 1; }

/* game picker (host) */
/* every game card the same size, with the icon, name and description in the same places */
.games { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: .55rem; }
.gcard { text-align: left; color: var(--ink); border: 2px solid var(--panel-edge); background: var(--sunk); border-radius: 14px; padding: .75rem; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; }
.gcard .em { font-size: 1.8rem; line-height: 1; height: 2rem; }
.gcard b { display: flex; align-items: flex-end; min-height: 2.3em; line-height: 1.15; font-family: var(--display); font-weight: 400; font-size: 1.15rem;
  margin: .35rem 0 .25rem; letter-spacing: .02em; }
.gcard small { color: var(--ink-dim); font-size: .78rem; font-weight: 600; line-height: 1.3; }
.gcard.on { border-color: var(--hot); background: color-mix(in srgb, var(--hot) 15%, transparent); }
.optrow { display: flex; flex-wrap: wrap; gap: .35rem; }
.optrow button { font: 800 .85rem var(--body); color: var(--ink); background: var(--sunk); border: 1.5px solid var(--panel-edge); border-radius: 99px; padding: .45em .8em; cursor: pointer; }
.optrow button.on { border-color: var(--cool); background: color-mix(in srgb, var(--cool) 18%, transparent); }

/* controls */
.ans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.abtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 6.2rem; padding: .7rem; min-width: 0; overflow-wrap: anywhere; hyphens: auto;
  border: 0; border-radius: 16px; color: #fff; font: 900 1rem var(--body); cursor: pointer; touch-action: manipulation; text-shadow: 0 2px 0 var(--sunk);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 78%, white), var(--c)); box-shadow: 0 6px 0 color-mix(in srgb, var(--c) 50%, black); }
.abtn:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 50%, black); }
.abtn .badge { background: var(--sunk); }
.vbtn { text-align: left; color: var(--ink); background: var(--sunk); border: 2px solid var(--panel-edge); border-radius: 14px; padding: .8rem .9rem; font: 800 1rem var(--body); cursor: pointer; }
.vbtn:disabled { opacity: .35; }
.waitbox { text-align: center; padding: 1.1rem .6rem; }
.waitbox .em { font-size: 2.6rem; }
.waitbox h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: .3rem 0 .2rem; letter-spacing: .02em; }
.result.good h3 { color: var(--zest); } .result.bad h3 { color: var(--opt-0); }

/* vote / prompt / board / numbers */
.promptcard { font-size: 1.5rem; font-weight: 900; line-height: 1.25; text-align: center; padding: 1rem .4rem; text-wrap: balance; }
.is-tv .promptcard { font-size: 3rem; }
.votes { display: grid; gap: .5rem; }
.is-tv .votes { grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
.vcard { position: relative; padding: .8rem .9rem; border-radius: 14px; background: var(--raise); border: 1.5px solid var(--panel-edge); font-weight: 800; font-size: 1.1rem; }
.is-tv .vcard { font-size: 1.7rem; }
.vcard.best { border-color: var(--gold); box-shadow: 0 0 20px color-mix(in srgb, var(--gold) 45%, transparent); }
.vcard .by { display: block; margin-top: .3rem; font-size: .85rem; color: var(--ink-dim); }
.vcard .hide { position: absolute; top: .3rem; right: .3rem; border: 0; background: rgba(0,0,0,.4); color: var(--ink); border-radius: 8px; cursor: pointer; padding: .2em .5em; }
.slots { display: grid; gap: .45rem; }
.is-tv .slots { grid-template-columns: 1fr 1fr; gap: 1rem; }
.slot { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 12px; font-weight: 900; font-size: 1.1rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--opt-1) 35%, transparent), var(--sunk)); border: 1.5px solid var(--panel-edge); min-height: 3.2rem; }
.is-tv .slot { font-size: 1.8rem; min-height: 5rem; }
.slot .n { font-family: var(--display); color: var(--gold); width: 1.6rem; }
.slot .cnt { margin-left: auto; font-family: var(--display); color: var(--gold); }
.slot.found { animation: pop .45s; background: linear-gradient(90deg, color-mix(in srgb, var(--opt-2) 45%, transparent), var(--sunk)); }
.slot .by { font-size: .75rem; color: var(--ink-dim); font-weight: 700; }
.rank { display: grid; grid-template-columns: 2rem 2.4rem 1fr auto; align-items: center; gap: .5rem; padding: .55rem .8rem; border-radius: 12px; background: var(--raise); font-weight: 800; }
.is-tv .rank { font-size: 1.8rem; grid-template-columns: 3rem 4rem 1fr auto; padding: 1rem 1.4rem; }
.rank .av { font-size: 1.6rem; } .is-tv .rank .av { font-size: 3rem; }
.rank .pos { font-family: var(--display); color: var(--ink-dim); }
.rank .pt { font-family: var(--display); color: var(--gold); }
.rank .gain { color: var(--zest); font-size: .8em; margin-left: .4rem; }
.rank.first { background: color-mix(in srgb, var(--gold) 16%, transparent); border: 1.5px solid var(--gold); }
.bignum { font-family: var(--display); font-size: 3rem; text-align: center; color: var(--zest); }

/* wheel */
.wheelwrap { position: relative; width: min(78vw, 18rem); aspect-ratio: 1; margin: 0 auto; }
.is-tv .wheelwrap { width: 34rem; }
.wheel { width: 100%; height: 100%; border-radius: 50%; border: 6px solid rgba(255,255,255,.85); box-shadow: 0 0 40px color-mix(in srgb, var(--hot) 40%, transparent);
  transition: transform 3.6s cubic-bezier(.12,.75,.15,1); position: relative; }
.wheel .seg { position: absolute; inset: 0; display: flex; justify-content: center; padding-top: 6%; font-size: 1.7rem; }
.is-tv .wheel .seg { font-size: 3.4rem; }
.pointer { position: absolute; top: -.6rem; left: 50%; transform: translateX(-50%); font-size: 2rem; z-index: 2; filter: drop-shadow(0 3px 0 rgba(0,0,0,.5)); }
.crowns { display: grid; gap: .4rem; }
.crowns .cr { display: flex; align-items: center; gap: .5rem; font-weight: 800; padding: .45rem .7rem; border-radius: 12px; background: var(--raise); }
.crowns .got { margin-left: auto; letter-spacing: .1em; }
.crowns .got .no { opacity: .2; filter: grayscale(1); }
.is-tv .crowns .cr { font-size: 1.7rem; padding: .8rem 1.2rem; }

/* own icons and characters */
.ic { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.btn .ic { margin-right: .25em; }
.glyph { width: 1em; height: 1em; color: var(--hot); }
.waitbox .em .glyph { width: 2.6rem; height: 2.6rem; }
.banner .em .glyph { width: 5rem; height: 5rem; } .is-tv .banner .em .glyph { width: 11rem; height: 11rem; }
.result.good .glyph { color: var(--zest); } .result.bad .glyph { color: var(--opt-0); }
.gcard .em .ic { width: 2rem; height: 2rem; color: var(--hot); }
.chip .ic { color: var(--hot); }
.wheel .seg .ic { width: 2rem; height: 2rem; color: #fff; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.is-tv .wheel .seg .ic { width: 4rem; height: 4rem; }
.crowns .got .ic { width: 1.3rem; height: 1.3rem; color: var(--gold); }
.crowns .got .no .ic { color: var(--ink-dim); }
.avsvg { width: 100%; height: 100%; display: block; overflow: visible; }
.av .avsvg { width: 86%; height: 86%; }
.me .av { width: 2rem; height: 2rem; display: inline-grid; place-items: center; }
.avatars button { aspect-ratio: 1; display: grid; place-items: center; padding: .25rem; }
.avatars button .avsvg { width: 100%; height: 100%; }
.rank .av, .opt .who > span, .vcard .by .avsvg, .slot .by .avsvg { display: inline-grid; width: 1.6em; height: 1.6em; vertical-align: middle; }
.opt .who .avsvg { width: 1.5rem; height: 1.5rem; }
.banner .em .avsvg { width: 5rem; height: 5rem; display: inline-block; }
.crowns .cr > span:first-child, .cr .avsvg { width: 2rem; height: 2rem; display: inline-block; }
.iconbtn { background: var(--sunk); color: var(--ink); border: 1.5px solid var(--panel-edge); border-radius: 12px; padding: .35rem .45rem; cursor: pointer; }
.iconbtn .ic { width: 1.3rem; height: 1.3rem; vertical-align: middle; }

/* settings sheet */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheetbox { width: min(560px, 100%); padding: 1.1rem; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--bg-1);
  max-height: 88dvh; overflow-y: auto; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.theme { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .6rem .3rem; border-radius: 14px; cursor: pointer;
  background: var(--sunk); border: 2px solid var(--panel-edge); color: var(--ink); font: 800 .85rem var(--body); }
.theme.on { border-color: var(--hot); }
.theme .sw { width: 3.2rem; height: 2.2rem; border-radius: 10px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 3px; padding: 4px; border: 1px solid rgba(128,128,128,.4); }
.theme .sw i { width: .8rem; height: .8rem; border-radius: 50%; }

.steps-ios { margin: .8rem 0; padding-left: 1.3rem; display: grid; gap: .7rem; font-weight: 700; line-height: 1.35; }
.shareic { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: var(--sunk); vertical-align: middle; color: var(--cool); }

.dropbtn { font: 700 .95rem var(--body); color: var(--ink); background: var(--sunk); border: 1.5px solid var(--panel-edge); border-radius: 12px; padding: .6em .9em; cursor: pointer; }
.dropbtn b { color: var(--cool); }
.droplist { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-top: .8rem; max-height: 60vh; overflow-y: auto; }
.droplist button { display: flex; align-items: center; gap: .5rem; text-align: left; font: 800 .95rem var(--body); color: var(--ink);
  background: var(--sunk); border: 2px solid var(--panel-edge); border-radius: 12px; padding: .65rem .7rem; cursor: pointer; }
.droplist button .ic { color: var(--hot); width: 1.3rem; height: 1.3rem; }
.droplist button.on { border-color: var(--cool); }

.blank { display: inline-block; min-width: 4.5em; padding: 0 .4em; border-bottom: 3px solid var(--cool); color: var(--cool); text-align: center; }
.blank.truth { color: var(--zest); border-color: var(--zest); animation: pop .5s; }
.reportbtn { align-self: flex-end; font: 700 .8rem var(--body); color: var(--ink-dim); background: none; border: 0; cursor: pointer; padding: .2rem .4rem; }
.reportbtn .ic { width: 1rem; height: 1rem; }

.frow { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 12px; background: var(--sunk); margin-bottom: .4rem; font-weight: 800; }
.frow .av { width: 2.2rem; height: 2.2rem; flex: none; }
.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--zest); margin-left: .35rem; box-shadow: 0 0 8px var(--zest); }

/* Head to Head */
.topicgrid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.topic { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; text-align: left; padding: .75rem; border-radius: 14px;
  background: var(--sunk); border: 2px solid var(--panel-edge); color: var(--ink); font: 800 .95rem var(--body); cursor: pointer; }
.topic .ic { width: 1.6rem; height: 1.6rem; color: var(--hot); }
.topic small { color: var(--ink-dim); font-weight: 600; font-size: .72rem; }
.lvl { --c: var(--rc, var(--lc)); display: inline-flex; align-items: center; gap: .25em; font-weight: 900; font-size: .75rem; padding: .2em .6em;
  border-radius: 99px; white-space: nowrap; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 50%, transparent); }
.lvl.r-legendary, .lvl.r-mythic { box-shadow: inset 0 0 0 1.5px var(--c), 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.lvl .ic { width: 1em; height: 1em; }
.spinner { width: 4rem; height: 4rem; margin: 0 auto 1rem; border-radius: 50%; border: 6px solid var(--sunk); border-top-color: var(--hot); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* bottom tab bar */
#tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--bg-0) 92%, transparent); border-top: 1px solid var(--panel-edge); backdrop-filter: blur(8px);
  padding: .35rem .4rem max(.45rem, env(safe-area-inset-bottom)); }
#tabbar button { flex: 1; max-width: 9rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; position: relative;
  background: none; border: 0; color: var(--ink-dim); font: 800 .7rem var(--body); cursor: pointer; padding: .3rem 0; }
#tabbar button .ic { width: 1.45rem; height: 1.45rem; }
#tabbar button.on { color: var(--hot); }
.badge-dot { position: absolute; top: 0; right: 28%; min-width: 1.1rem; height: 1.1rem; border-radius: 99px; background: var(--opt-0); color: #fff;
  font: 900 .65rem/1.1rem var(--body); font-style: normal; }
body.with-tabs #app { padding-bottom: 5.5rem; }

/* profile */
.bigav { position: relative; width: 6.5rem; height: 6.5rem; border-radius: 50%; background: var(--sunk); border: 3px solid var(--panel-edge); cursor: pointer; padding: .4rem; }
.editdot { position: absolute; right: -.2rem; bottom: -.2rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--hot); color: #1a0b12; font-weight: 900; border: 3px solid var(--bg-1); }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.stat { display: flex; flex-direction: column; align-items: center; padding: .65rem .2rem; border-radius: 14px; background: var(--sunk); border: 1.5px solid var(--panel-edge); }
.stat b { font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--gold); }
.stat span { font-size: .72rem; color: var(--ink-dim); font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  text-align: center; line-height: 1.25; }

/* settings */
.setgroup { border-radius: 16px; overflow: hidden; border: 1.5px solid var(--panel-edge); background: var(--sunk); }
.setrow { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .85rem .9rem; background: none; border: 0; border-top: 1px solid var(--panel-edge);
  color: var(--ink); font: 800 1rem var(--body); text-align: left; cursor: pointer; }
.setgroup > .setrow:first-child { border-top: 0; }
.setrow .ic { width: 1.25rem; height: 1.25rem; color: var(--hot); }
.setrow .dim { font-size: .85rem; max-width: 50%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setrow .chev { color: var(--ink-dim); font-size: 1.3rem; line-height: 1; }
.setrow.static { cursor: default; }
.setrow.danger, .setrow.danger .ic { color: var(--opt-0); }
.toggle { width: 2.8rem; height: 1.6rem; border-radius: 99px; background: rgba(128,128,128,.35); position: relative; transition: background .2s; }
.toggle i { position: absolute; top: .2rem; left: .2rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle.on { background: var(--zest); } .toggle.on i { left: 1.4rem; }

#toast { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translate(-50%, -160%); z-index: 20; transition: transform .25s;
  background: var(--bg-1); border: 2px solid var(--panel-edge); border-radius: 14px; padding: .65rem 1.1rem; font-weight: 900; max-width: 90vw; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
#toast.show { transform: translate(-50%, 0); }
#toast.good { border-color: var(--zest); } #toast.bad { border-color: var(--opt-0); }
#conn { color: #fff; white-space: nowrap; position: fixed; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: #000c; padding: .5rem 1rem; border-radius: 99px; font-weight: 900; z-index: 20; }

/* ---------------------------------------------------------------- notifications and chat */
.home .bell { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; z-index: 2; }
.home { position: relative; }
.bell .badge-dot, .badge-dot.static { position: absolute; top: -.35rem; right: -.35rem; }
.badge-dot.static { position: static; margin-left: .2rem; }
button.frow { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.frow.note.new { border-color: var(--cool); }
.frow.note.new b::after { content: ''; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--cool); margin-left: .4rem; vertical-align: middle; }
.noteic .ic { width: 1.4rem; height: 1.4rem; color: var(--hot); }
.chatrow .preview { display: block; font-size: .8rem; color: var(--ink-dim); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.chatrow .preview.new { color: var(--ink); font-weight: 800; }
.chatrow > .ic { width: 1.2rem; height: 1.2rem; color: var(--ink-dim); }
.chatview { display: flex; flex-direction: column; height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(14px, env(safe-area-inset-bottom))); }
.chathead { align-items: center; gap: .5rem; padding-bottom: .6rem; border-bottom: 1.5px solid var(--panel-edge); }
.chathead .av { width: 2.2rem; height: 2.2rem; }
.chatlog { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; padding: .8rem .1rem; }
.chatday { align-self: center; font-size: .75rem; font-weight: 800; color: var(--ink-dim); margin: .4rem 0; }
.bubble { align-self: flex-start; max-width: 78%; background: var(--panel); border: 1.5px solid var(--panel-edge); border-radius: 16px 16px 16px 4px;
  padding: .5rem .75rem; font-weight: 600; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: color-mix(in srgb, var(--hot) 28%, var(--bg-1)); border-color: color-mix(in srgb, var(--hot) 45%, transparent);
  border-radius: 16px 16px 4px 16px; }
.bubble small { display: block; font-size: .65rem; color: var(--ink-dim); text-align: right; margin-top: .15rem; }
.chatbar { gap: .5rem; padding-top: .5rem; }
.chatbar .field { font-size: 1rem; padding: .6em .8em; }
.reportlog { background: var(--sunk); border-radius: 10px; padding: .5rem .7rem; margin: .4rem 0; font-size: .85rem; max-height: 14rem; overflow-y: auto; }

/* advert banner on the home screen */
.adslot { width: 100%; min-height: 0; margin-top: .4rem; }
.adslot:empty { display: none; }
/* Head to Head "View answers" */
.reviewq { padding: .7rem 0; border-top: 1px solid var(--panel-edge); }
.reviewopt { display: flex; gap: .3rem; align-items: center; padding: .35rem .6rem; margin: .2rem 0; border-radius: 10px;
  background: var(--sunk); font-size: .9rem; }
.reviewopt.right { background: color-mix(in srgb, var(--good, var(--zest)) 24%, transparent); outline: 2px solid var(--good, var(--zest)); outline-offset: -2px; }
.reviewopt.wrong { outline: 2px solid var(--bad, var(--opt-0)); outline-offset: -2px; }
.reviewopt .chip { font-size: .7rem; padding: .1rem .45rem; }
/* Head to Head: the advert sits at the very bottom of the screen */
.adslot.adbottom { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 5; padding: .4rem 16px calc(.4rem + env(safe-area-inset-bottom));
  background: var(--bg-0); }
#host:has(~ .adbottom:not(:empty)) { margin-bottom: 7rem; }   /* room to scroll past it */
.adph { border: 1.5px dashed var(--panel-edge); border-radius: 12px; padding: 1.1rem .8rem; text-align: center;
  font-size: .8rem; font-weight: 800; color: var(--ink-dim); }

/* room top bar: logo shrinks first so the code, cog and score always fit */
.topbar { gap: .4rem; }
.topbar .logo.small { min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; }
.topbar .logo.small .l1, .topbar .logo.small .l2 { font-size: 1.1rem; }
.topbar .logo.small .beta { display: block; width: max-content; margin: .1rem 0 0; }
.topbar .codechip { font-size: 1rem; letter-spacing: .12em; padding: .25em .5em; flex-shrink: 0; }
.topbar .iconbtn, .topbar .me { flex-shrink: 0; }
.topbar .me .av { font-size: 1.3rem; }

/* chat ticks */
.ticks { display: inline-flex; vertical-align: middle; margin-left: .25rem; color: var(--ink-dim); }
.ticks .ic { width: 1.15rem; height: 1.15rem; stroke-width: 2.6; }
.ticks.seen { color: var(--cool); }
.chatrow .preview .ticks { margin: 0 .1rem 0 0; }

/* profile: the 3 chosen crowns */
.crownrow { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem; }
.crownpick { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; max-height: 50vh; overflow-y: auto; }
.crownpick .pick { font-weight: 800; font-size: .9rem; padding: .6rem .7rem; }

/* two buttons side by side: always the same size, on one line */
.pairbtns { align-items: stretch; }
.pairbtns .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: .3rem;
  font-size: clamp(.72rem, 3.4vw, .85rem); padding-left: .5em; padding-right: .5em; }
.pairbtns .btn .ic { margin-right: 0; }

/* five tabs: labels stay on one line on narrow phones */
#tabbar button span { white-space: nowrap; font-size: clamp(.64rem, 2.9vw, .8rem); letter-spacing: -.01em; }

/* Profile tab shows your own character */
#tabbar .tabav { width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border-radius: 50%; font-style: normal;
  box-shadow: 0 0 0 2px transparent; }
#tabbar button.on .tabav { box-shadow: 0 0 0 2px var(--hot); }
#tabbar .tabav .avsvg { width: 100%; height: 100%; }

/* red count bubbles: the number always sits centred inside, and the bubble never gets squashed in a row */
.badge-dot { display: inline-grid; place-items: center; box-sizing: border-box; padding: 0 .3rem; line-height: 1; text-align: center; flex: none; }
.badge-dot.static { position: static; min-width: 1.35rem; height: 1.35rem; font-size: .75rem; margin: 0 .2rem 0 .3rem; }

/* chat header: their picture and name open their profile */
.chatwho { display: flex; align-items: center; gap: .5rem; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; text-align: left; }
.chatwho .av { width: 2.2rem; height: 2.2rem; }
.chatrow .av { cursor: pointer; }

/* Friends: Chat (with unread count) and View buttons on each row */
.chatrow { gap: .45rem; }
.chatrow .grow { min-width: 0; }
.chatrow .preview { max-width: 100%; }
.chatrow .btn.small { flex: none; padding: .55em .7em; font-size: .78rem; }
.chatbtn { position: relative; display: inline-flex; align-items: center; gap: .25rem; }
.chatbtn .ic { margin-right: 0; }
.chatbtn .badge-dot { top: -.5rem; right: -.45rem; min-width: 1.25rem; height: 1.25rem; font-size: .7rem; box-shadow: 0 0 0 2px var(--bg-0); }

/* topic tiles: every tile the same size (rows as tall as the tallest, names up to 2 lines) */
.topicgrid { grid-auto-rows: 1fr; }
.topic { height: 100%; min-height: 7.6rem; justify-content: flex-start; }
.topic span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.2; }
.topic small { margin-top: auto; }

/* theme picker */
.themelist { display: grid; gap: .45rem; margin-top: .6rem; }
.themelist .pick { display: flex; align-items: center; gap: .7rem; }
.themelist .sw { width: 3rem; height: 2rem; border-radius: 9px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 3px; padding: 4px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .3); }
.themelist .sw i { width: .7rem; height: .7rem; border-radius: 50%; }
/* each theme's own little picture (THEME_ART in art.js) */
.thpic { flex: none; width: 5.6rem; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 1px solid var(--panel-edge); }
.thpic svg { display: block; width: 100%; height: 100%; }

/* ---------------------------------------------------------------- splash / loading screen */
#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg-0);
  transition: opacity .45s ease, visibility .45s; }
[data-theme="bonfire"] #splash { background: radial-gradient(120% 60% at 50% 110%, rgba(255, 110, 30, .35), transparent 60%), linear-gradient(#060918, #1c1a3f); }
[data-theme="christmas"] #splash { background: linear-gradient(#040a1c, #183063); }
[data-theme="classic"] #splash { background: radial-gradient(120% 80% at 50% -10%, var(--bg-2), var(--bg-0) 85%); }
#splash.out { opacity: 0; visibility: hidden; }
.splash-in { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; animation: splash-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes splash-pop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#splash .logo { margin: 0; }
.splash-dots { display: flex; gap: .55rem; }
.splash-dots i { width: .8rem; height: .8rem; border-radius: 50%; background: var(--hot); animation: splash-dot 1s ease-in-out infinite; }
.splash-dots i:nth-child(2) { background: var(--cool, var(--hot)); animation-delay: .15s; }
.splash-dots i:nth-child(3) { background: var(--gold, var(--hot)); animation-delay: .3s; }
@keyframes splash-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-.6rem); opacity: 1; } }
.splash-tag { font-weight: 800; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
@media (prefers-reduced-motion: reduce) { .splash-in, .splash-dots i { animation: none; } }

.splash-icon { width: 6.5rem; height: 6.5rem; border-radius: 1.6rem; background: url(/icons/icon-v2-512.png) center / cover;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .08); margin-bottom: .2rem; }
[data-theme="bonfire"] .splash-icon { background-image: url(/icons/icon-bonfire-512.png); box-shadow: 0 0 40px rgba(255, 120, 40, .45); }
/* every theme's splash shows its own icon (Halloween's is in theme-halloween.css) */
[data-theme="jungle"] .splash-icon { background-image: url(/icons/icon-jungle-512.png); box-shadow: 0 0 40px rgba(255, 207, 46, .35); }
[data-theme="blossom"] .splash-icon { background-image: url(/icons/icon-blossom-512.png); box-shadow: 0 0 40px rgba(240, 85, 155, .35); }
[data-theme="christmas"] .splash-icon { background-image: url(/icons/icon-christmas-512.png); box-shadow: 0 0 40px rgba(230, 57, 70, .4); }
:is([data-theme="classic"], [data-theme="neon"]) .splash-icon { background-image: url(/icons/icon-neon-512.png); box-shadow: 0 0 40px rgba(255, 61, 139, .45); }
[data-theme="arcade"] .splash-icon { background-image: url(/icons/icon-arcade-512.png); box-shadow: 0 0 40px rgba(57, 230, 255, .4); }
[data-theme="wonderland"] .splash-icon { background-image: url(/icons/icon-wonderland-512.png); box-shadow: 0 0 40px rgba(90, 180, 255, .45); }
[data-theme="workshop"] .splash-icon { background-image: url(/icons/icon-workshop-512.png); box-shadow: 0 0 40px rgba(255, 190, 90, .4); }
[data-theme="newyear"] .splash-icon { background-image: url(/icons/icon-newyear-512.png); box-shadow: 0 0 40px rgba(242, 199, 92, .45); }
[data-theme="starfall"] .splash-icon { background-image: url(/icons/icon-starfall-512.png); box-shadow: 0 0 40px rgba(190, 170, 255, .5); }
[data-theme="themepark"] .splash-icon { background-image: url(/icons/icon-themepark-512.png); box-shadow: 0 0 40px rgba(255, 158, 199, .5); }
[data-theme="spacestation"] .splash-icon { background-image: url(/icons/icon-spacestation-512.png); box-shadow: 0 0 40px rgba(255, 122, 26, .45); }
[data-theme="dinovalley"] .splash-icon { background-image: url(/icons/icon-dinovalley-512.png); box-shadow: 0 0 40px rgba(255, 160, 80, .5); }
[data-theme="medieval"] .splash-icon { background-image: url(/icons/icon-medieval-512.png); box-shadow: 0 0 40px rgba(240, 200, 90, .5); }
[data-theme="mansion"] .splash-icon { background-image: url(/icons/icon-mansion-512.png); box-shadow: 0 0 40px rgba(160, 190, 255, .5); }
[data-theme="dungeon"] .splash-icon { background-image: url(/icons/icon-dungeon-512.png); box-shadow: 0 0 40px rgba(255, 170, 80, .5); }
[data-theme="grandprix"] .splash-icon { background-image: url(/icons/icon-grandprix-512.png); box-shadow: 0 0 40px rgba(255, 255, 255, .5); }
[data-theme="toytown"] .splash-icon { background-image: url(/icons/icon-toytown-512.png); box-shadow: 0 0 40px rgba(255, 198, 26, .5); }
[data-theme="bigcity"] .splash-icon { background-image: url(/icons/icon-bigcity-512.png); box-shadow: 0 0 40px rgba(255, 150, 110, .5); }
#splash .logo .l1, #splash .logo .l2 { font-size: 2.6rem; }
.flat #splash .logo .l1, .flat #splash .logo .l2 { display: inline; }

/* ---------------------------------------------------------------- Style (cosmetics) */
.pname { font-weight: inherit; }
/* the bright name colours were made for dark themes: on the light ones they get a thin dark edge to stay readable */
:is([data-theme="clean"], [data-theme="daylight"], [data-theme="blossom"]) .pname[style] {
  filter: drop-shadow(0 0 .6px rgba(43, 26, 34, .95)) drop-shadow(0 1px 0 rgba(43, 26, 34, .45)); }
.ptitle { display: block; font: 800 .72rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--rc, var(--ink-dim));
  -webkit-text-fill-color: currentColor; margin-top: .15rem; }
.title .ptitle { font-size: .8rem; }

/* Rarity colours (RARITY in cosmetics.js): titles now, Season Pass items later. Bright for the dark themes
   (Neon included), deeper for the light ones so they still read on white. A class sets --rc for its element. */
:root {
  --r-common: #c4cad6; --r-uncommon: #4ade80; --r-rare: #4da3ff;
  --r-epic: #b884ff; --r-legendary: #ffb23d; --r-mythic: #e6eef9;
}
[data-theme="clean"], [data-theme="daylight"], [data-theme="blossom"] {
  --r-common: #6b7186; --r-uncommon: #15803d; --r-rare: #1d63d8;
  --r-epic: #7c3aed; --r-legendary: #c2620a; --r-mythic: #4b5d78;
}
.r-common { --rc: var(--r-common); } .r-uncommon { --rc: var(--r-uncommon); } .r-rare { --rc: var(--r-rare); }
.r-epic { --rc: var(--r-epic); } .r-legendary { --rc: var(--r-legendary); } .r-mythic { --rc: var(--r-mythic); }
/* only the top two get a soft glow */
.ptitle:is(.r-legendary, .r-mythic) { text-shadow: 0 0 8px color-mix(in srgb, var(--rc) 45%, transparent); }
:is([data-theme="clean"], [data-theme="daylight"], [data-theme="blossom"]) .ptitle:is(.r-legendary, .r-mythic) { text-shadow: 0 0 6px color-mix(in srgb, var(--rc) 25%, transparent); }
/* Mythic is platinum: a cool silver with a sheen across the letters */
.ptitle.r-mythic { background: linear-gradient(100deg, var(--rc) 30%, #fff 50%, var(--rc) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
:is([data-theme="clean"], [data-theme="daylight"], [data-theme="blossom"]) .ptitle.r-mythic { background-image: linear-gradient(100deg, var(--rc) 30%, #9fb1cc 50%, var(--rc) 70%); }
/* the rarity name on a Style tile, and the title name in its colour */
.rtag { font: 900 .6rem var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--rc); padding: .15em .55em;
  border-radius: 99px; background: color-mix(in srgb, var(--rc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); }
.styletile.rar > span, .styletile.rar .ic { color: var(--rc); }
.stylepreview .bigav { margin: 0 auto; }
.stylerow { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem .1rem .6rem; scrollbar-width: none; }
.stylerow::-webkit-scrollbar { display: none; }
.styletile { flex: none; min-width: 5.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  padding: .55rem .45rem; border-radius: 14px; background: var(--sunk); border: 2px solid var(--panel-edge); color: var(--ink); cursor: pointer;
  font: 800 .72rem var(--body); text-align: center; }
.styletile.on { border-color: var(--hot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hot) 25%, transparent); }
.styletile > span { max-width: 6rem; }
.styletile .ic { width: 1.6rem; height: 1.6rem; color: var(--hot); }
.styletile .sav { width: 3.6rem; height: 3.6rem; display: grid; place-items: center; font-style: normal; }
.styletile .sav .avsvg { width: 100%; height: 100%; }
.styletile .snm { font-size: 1rem; font-weight: 900; }
.sbub { font-style: normal; font-size: .8rem; padding: .3rem .6rem; max-width: none; }
.sbtn { font-style: normal; display: grid; place-items: center; width: 2.6rem; height: 2.2rem; border-radius: 10px; background: var(--card); border: 1.5px solid var(--panel-edge);
  font-weight: 900; color: var(--ink); --c: #3b82f6; }

/* chat bubble styles (what friends see on your messages) */
html body .bubble.bub-pm.bub-pm { background: linear-gradient(#ff9a3d, #ff7b1f); border-color: #d9551f; color: #2b1405; }
html body .bubble.bub-gh.bub-gh { background: #ffffff; border-color: #d9dce5; color: #1b1033; border-radius: 18px 18px 18px 18px / 18px 18px 6px 6px; }
html body .bubble.bub-sl.bub-sl { background: linear-gradient(#7be04a, #3fb54a); border-color: #2a8a35; color: #0d2a10; }
html body .bubble.bub-nt.bub-nt { background: linear-gradient(#2b2f6b, #171a3d); border-color: #4b4f9a; color: #e8e9ff; }
html body .bubble.bub-gd.bub-gd { background: linear-gradient(#ffe38a, #f2b83a); border-color: #c98a12; color: #3b2600; }
html body .bubble.bub-lf.bub-lf { background: linear-gradient(#6cc65a, #3f9a3c); border-color: #1e5a1c; color: #082a08; border-radius: 4px 22px 4px 22px; }
html body .bubble.bub-bn.bub-bn { background: linear-gradient(#fff08a, #ffd23d); border-color: #e0a800; color: #3b2a00; border-radius: 22px 22px 22px 6px; }
/* Single Player Festive Event prizes (owner, 8 Nov): Gift Tag (Santa's Workshop) and Snow Globe (North Star); trims from art3d/render.gd */
html body .bubble.bub-eb1.bub-eb1 { position: relative; overflow: visible; color: #3b2410; border: 2px solid #8a5a2e; border-radius: 6px 16px 16px 6px; padding-left: 1.6rem;
  background: radial-gradient(circle at .7rem 50%, #3b2410 0 .22rem, #f3dcb6 .23rem .34rem, transparent .35rem), repeating-linear-gradient(135deg, rgba(255, 255, 255, .08) 0 4px, transparent 4px 8px), linear-gradient(#efcf9f, #d9ae78); }
html body .bubble.bub-eb1.bub-eb1::after { content: ''; position: absolute; left: -10px; top: -14px; width: 34px; height: 34px; pointer-events: none;
  background: url(/art3d/ui/deco-tagbow.webp) center / contain no-repeat; }
html body .bubble.bub-eb1.bub-eb1 small { color: #6b4228; opacity: 1; }
html body .bubble.bub-eb2.bub-eb2 { position: relative; overflow: visible; color: #13294b; border: 2px solid #7fb7e3; border-radius: 20px; padding-right: 2rem;
  background: radial-gradient(circle at 18% 30%, #fff 0 1.5px, transparent 2px), radial-gradient(circle at 46% 70%, #fff 0 1.5px, transparent 2px),
    radial-gradient(circle at 72% 25%, #fff 0 1.2px, transparent 1.7px), radial-gradient(circle at 88% 65%, #fff 0 1.5px, transparent 2px),
    radial-gradient(120% 140% at 30% 0%, #ffffff, #dff1ff 45%, #a9d6f5); }
html body .bubble.bub-eb2.bub-eb2::after { content: ''; position: absolute; right: -8px; bottom: -8px; width: 34px; height: 34px; pointer-events: none;
  background: url(/art3d/ui/deco-snowglobe.webp) center / contain no-repeat; }
html body .bubble.bub-eb2.bub-eb2 small { color: #4a6a92; opacity: 1; }
html body .bubble[class*="bub-"] small { color: inherit; opacity: .7; }
html body .bubble.sticker.sticker { background: none !important; border: 0 !important; box-shadow: none; padding: 0; width: 7rem; }
.bubble.sticker .avsvg { width: 7rem; height: 7rem; }
.stickers button { padding: .15rem; }

/* answer-button skins (only you see these) */
body.btns-pill .abtn, .btns-pill-demo { border-radius: 999px !important; }
body.btns-glow .abtn, .btns-glow-demo { border: 2px solid var(--c) !important; box-shadow: 0 0 14px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 10px color-mix(in srgb, var(--c) 25%, transparent) !important; }
body.btns-candy .abtn, .btns-candy-demo { background: repeating-linear-gradient(135deg, #fff 0 10px, color-mix(in srgb, var(--c) 30%, #fff) 10px 20px) !important; color: #1b1033 !important; }
body.btns-pumpkin .abtn, .btns-pumpkin-demo { background: radial-gradient(circle at 50% 30%, #ffb065, #ff7b1f) !important; color: #2b1405 !important;
  border: 2px solid #d9551f !important; border-radius: 40% 40% 34% 34% / 46% 46% 30% 30% !important; }
/* the usual dark under-shadow smudges dark text on these light skins, so give it a soft light edge instead */
body.btns-banana .abtn, .btns-banana-demo { background: linear-gradient(170deg, #fff6a8, #ffd23d 55%, #e9b400) !important; color: #3b2a00 !important;
  border: 2px solid #c99700 !important; border-radius: 60% 22% 60% 22% / 40% 30% 40% 30% !important; }
body.btns-wood .abtn, .btns-wood-demo { color: #fff4dc !important; border: 2px solid #3e2410 !important;
  background: repeating-linear-gradient(0deg, transparent 0 14px, rgba(0, 0, 0, .16) 14px 16px), linear-gradient(90deg, #7a4a24, #946032 40%, #7a4a24) !important; }
body:is(.btns-candy, .btns-pumpkin, .btns-banana) .abtn, .btns-candy-demo, .btns-pumpkin-demo, .btns-banana-demo { text-shadow: 0 1px 0 rgba(255, 255, 255, .45); }
body.btns-wood .abtn, .btns-wood-demo { text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }

/* win celebrations */
.celebrate { position: fixed; inset: 0; z-index: 60; pointer-events: none; transition: opacity .5s; }
.celebrate.out { opacity: 0; }
.celebrate .confetti { position: absolute; inset: 0; overflow: hidden; }
.confetti.fx-fall i, .confetti.fx-ws i, .confetti.fx-ny i, .confetti.fx-bats i, .confetti.fx-pumpkins i, .confetti.fx-monkeys i, .confetti.fx-bananas i { position: absolute; top: -12%; width: calc(2.4rem * var(--s, 1)); height: auto; background: none;
  animation: fall 3.4s linear infinite; }
.confetti.fx-bats i { top: auto; bottom: -10%; animation: batfly 3s ease-in-out infinite; }
@keyframes batfly { 0% { transform: translate(0, 0); } 25% { transform: translate(-2rem, -30vh); } 50% { transform: translate(2rem, -60vh); }
  100% { transform: translate(-1rem, -125vh); } }
.confetti.fx-stars i { position: absolute; width: calc(1.6rem * var(--s, 1)); height: auto; background: none; animation: starpop 1.6s ease-in-out infinite; }
/* monkeys leap up from the bottom, somersaulting */
.confetti.fx-monkeys i { top: auto; bottom: -14%; width: calc(3rem * var(--s, 1)); animation: monkeyleap 2.6s cubic-bezier(.3, .7, .4, 1) infinite; }
@keyframes monkeyleap { 0% { transform: translate(0, 0) rotate(0); } 55% { transform: translate(var(--dx, 2rem), -70vh) rotate(300deg); }
  100% { transform: translate(calc(var(--dx, 2rem) * 2), -10vh) rotate(380deg); } }
@keyframes starpop { 0%, 100% { transform: scale(0) rotate(0); opacity: 0; } 50% { transform: scale(1) rotate(40deg); opacity: 1; } }
.confetti i svg { width: 100%; height: auto; display: block; }
.confetti.scene { position: absolute; inset: 0; }

/* bigger text (Settings → Bigger text): everything is sized in rem, so this scales the whole app */
html.bigtext:not(.is-tv) { font-size: 18.5px; }

/* "Did you know?" after an answer */
.fact b { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin-bottom: .15rem; }

/* how to play, the first time you play each game */
.howto { padding: .8rem 1rem; }
.howto ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; font-weight: 700; line-height: 1.35; }

/* Daily Quiz */
.dailybtn { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.dailybtn small { font: 800 .72rem var(--body); text-transform: none; letter-spacing: 0; opacity: .8; }
.dailygrid { display: flex; justify-content: center; gap: .3rem; margin-top: .5rem; }
.dailygrid i { width: 1.3rem; height: 1.3rem; border-radius: 5px; background: var(--opt-0); }
.dailygrid i.y { background: var(--good, var(--zest)); }

/* playing on your own (Daily Quiz, play-later Head to Head, Pass the phone) */
.solo .screen { min-height: 0; }
.solo .screen .qtext { padding-right: 3.2rem; }
.soloverdict { font: 400 1.6rem var(--display); }
.soloverdict.good { color: var(--good, var(--zest)); } .soloverdict.bad { color: var(--bad, var(--opt-0)); }
.opt.wrong.picked { opacity: .8; outline: 2px dashed var(--bad, var(--opt-0)); outline-offset: 2px; }
.abtn.chosen { outline: 3px solid var(--ink); outline-offset: 3px; }
.passrow { align-items: center; gap: .5rem; }
.passrow .av { width: 2.8rem; height: 2.8rem; flex: none; padding: .15rem; border-radius: 50%; background: var(--sunk); border: 2px solid var(--panel-edge); cursor: pointer; }
.passhand { padding: 1.2rem; }

/* topic of the week */
.featured { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; color: var(--ink); text-align: left; cursor: pointer; font: inherit;
  border: 1.5px solid var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--panel)); }
.featured .ic { width: 2.4rem; height: 2.4rem; padding: .45rem; border-radius: 50%; background: var(--gold); color: #1a1205; flex: none; }
.featured small { display: block; font-size: .72rem; font-weight: 800; color: var(--ink-dim); }
.featured small:first-child { text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.featured b { display: block; font-size: 1.15rem; }
.featured .chev { font-size: 1.6rem; color: var(--ink-dim); }

/* the friends league */
.leaguebox { padding: .8rem; display: grid; gap: .4rem; }
/* room for the leaf the jungle themes tuck into the top corner of cards */
:is([data-theme="jungle"], [data-theme="blossom"]) .leaguebox > .row:first-child { padding-right: 2rem; }
.rank.mine { box-shadow: inset 0 0 0 2px var(--cool); }

/* theme preview */
.themeprev { display: flex; gap: .6rem; margin-top: .8rem; }
.stylepreview-ans { margin: .2rem 0 .4rem; }
.stylepreview-ans .abtn { min-height: 4.2rem; }

/* leagues */
.leaguerow { width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.leaguerow b { font-size: 1.05rem; }
.leaguerow .chev { font-size: 1.4rem; color: var(--ink-dim); }
.rank .lgkick { width: 1.8rem; height: 1.8rem; padding: .3rem; margin-left: .3rem; }
.leaguebox .rank:has(.lgkick) { grid-template-columns: 2rem 2.4rem 1fr auto auto; }

/* in-app pop-ups (Are you sure? / type a name) */
.sheet.popup { align-items: center; z-index: 80; }
.popbox { width: min(26rem, calc(100% - 2rem)); display: flex; flex-direction: column; gap: .9rem; padding: 1.2rem; }
.poptext { font-weight: 800; font-size: 1.1rem; line-height: 1.35; }
.popbtns { gap: .6rem; }
.btn.danger { --hot: var(--bad, #e5484d); color: #fff; }

/* Quiz Royale button on Home */
.btn.royalebtn { --hot: var(--cool); }

/* achievements */
.badgegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .5rem; }
.badgetile { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .6rem .3rem; border-radius: 14px; cursor: pointer;
  background: var(--sunk); border: 1.5px solid var(--panel-edge); color: var(--ink-dim); font: 800 .72rem var(--body); text-align: center; opacity: .55; }
.badgetile .ic { width: 1.7rem; height: 1.7rem; }
.badgetile.on { opacity: 1; color: var(--ink); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--sunk)); }
.badgetile.on .ic { color: var(--gold); }
.badgepop { position: fixed; left: 50%; top: max(1rem, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 90; display: flex; gap: .7rem;
  align-items: center; width: min(24rem, calc(100% - 2rem)); padding: .8rem 1rem; border-radius: 16px; cursor: pointer;
  background: var(--card); color: var(--ink); border: 2px solid var(--gold); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transition: opacity .5s; }
.badgepop.out { opacity: 0; }
.badgepop .ic { width: 2.6rem; height: 2.6rem; padding: .5rem; border-radius: 50%; background: var(--gold); color: #1a1205; flex: none; }
.badgepop small { display: block; font-size: .72rem; font-weight: 800; color: var(--ink-dim); }
.badgepop small:first-child { text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }
.badgepop b { display: block; font-size: 1.1rem; }

/* Quiz Royale hub */
.royalecard { padding: .9rem; display: grid; gap: .5rem; }
.topicpick { max-height: 14rem; overflow-y: auto; padding: .1rem; }

/* Quiz Royale crown streaks */
.crownnews { display: inline-flex; align-items: center; gap: .4rem; margin-top: .6rem; padding: .45rem .9rem; border-radius: 99px; font-weight: 900;
  background: color-mix(in srgb, var(--gold) 16%, transparent); border: 1.5px solid var(--gold); color: var(--ink); }
.crownnews .ic { color: var(--gold); width: 1.2rem; height: 1.2rem; }
.crownnews.lost { background: none; border-color: var(--panel-edge); color: var(--ink-dim); }

/* parent consent */
.parentask { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; text-align: left; font: inherit; color: var(--ink); cursor: pointer;
  border: 1.5px solid var(--cool); }
.parentask .ic { width: 1.6rem; height: 1.6rem; color: var(--cool); flex: none; }
.parentask b { display: block; } .parentask small { display: block; color: var(--ink-dim); font-weight: 700; }
.parentask .chev { font-size: 1.5rem; color: var(--ink-dim); }
.agree { display: flex; gap: .6rem; align-items: flex-start; margin-top: .8rem; font-weight: 700; line-height: 1.35; }
.agree input { width: 1.3rem; height: 1.3rem; flex: none; margin-top: .1rem; }
.agree a { color: var(--hot); }
.setrow.parentsw { white-space: normal; text-align: left; align-items: center; }
.setrow.parentsw .grow { min-width: 0; }
.setrow.parentsw small { white-space: normal; overflow: visible; text-overflow: clip; margin-top: .15rem; }
.setrow.parentsw .toggle { flex: none; }
.setrow.parentsw small.dim { max-width: none; text-align: left; white-space: normal; overflow: visible; }

/* ---- bottom bar: Home is the big round button in the middle (user, 1 Nov) ---- */
#tabbar button.homebtn { overflow: visible; }
#tabbar .homeic { display: grid; place-items: center; width: 3.3rem; height: 3.3rem; margin-top: -1.55rem; border-radius: 50%;
  background: var(--hot); color: var(--on-hot, #1b0f05); box-shadow: 0 4px 0 color-mix(in srgb, var(--hot) 60%, black), 0 0 0 4px var(--bg-0); font-style: normal; }
#tabbar .homeic .ic { width: 1.6rem; height: 1.6rem; }
#tabbar button.homebtn.on { color: var(--hot); }
#tabbar button.homebtn .badge-dot { top: -1.6rem; right: calc(50% - 1.9rem); }
/* Alerts bell in the top corner of Home */
.bellbtn { position: absolute; top: .4rem; right: .2rem; z-index: 2; background: var(--card); color: var(--ink); border: 1.5px solid var(--panel-edge);
  border-radius: 50%; width: 2.6rem; height: 2.6rem; display: grid; place-items: center; cursor: pointer; }
.bellbtn .ic { width: 1.3rem; height: 1.3rem; }
.bellbtn .badge-dot { top: -.3rem; right: -.3rem; }
.home:has(> .bellbtn) { position: relative; }
#duelBtn { position: relative; }
#duelBtn .badge-dot { top: -.4rem; right: .6rem; }
/* Social: Friends / Chats / Leagues along the top */
.segtabs { display: flex; gap: .15rem; overflow-x: auto; padding: .25rem; border-radius: 14px; background: var(--sunk); border: 1.5px solid var(--panel-edge); }
.segtabs button { flex: 1 0 auto; position: relative; padding: .55rem .45rem; border: 0; border-radius: 10px; background: none; color: var(--ink-dim);
  font: inherit; font-size: clamp(.7rem, 3.3vw, .9rem); font-weight: 900; cursor: pointer; white-space: nowrap; }
.segtabs button.on { background: var(--hot); color: var(--on-hot, #1b0f05); }
.segtabs .badge-dot { top: -.35rem; right: .2rem; }
button.chatrow { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
/* Season Pass: a header card, then one column of tiers on a track line. A tier's colour comes from its reward's
   rarity (--rc); Free tiers carry a tag; locked ones (no pass) are dimmed with a padlock. */
.passpage { justify-content: flex-start; padding-top: 1rem; gap: .9rem; --ok: var(--good, var(--opt-2)); }   /* Neon has no --good */
.passhead { padding: 1rem; display: grid; gap: .7rem; }
.passhead .title { font-size: 1.7rem; line-height: 1.1; }
.passhead small { display: block; font-weight: 800; }
.passmeta { flex-wrap: wrap; gap: .4rem; }
.chip .ic { width: 1em; height: 1em; }
.chip.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.chip.coins { color: var(--ink); font-size: .95rem; } .passpage .passhead .chip.coins .ic { color: var(--gold); }   /* beats theme-flat's chip icon colour */
.passlvl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; }
.passlvl b { font-weight: 900; }
.xpbar { height: .7rem; border-radius: 99px; background: var(--sunk); overflow: hidden; box-shadow: inset 0 0 0 1px var(--panel-edge); }
.xpbar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hot), var(--gold)); }
.passon { display: flex; gap: .45rem; align-items: center; font-weight: 800; color: var(--ok); }
.passon .ic { width: 1.2rem; height: 1.2rem; flex: none; }
.passpv { display: flex; align-items: center; justify-content: space-between; gap: .6rem; border-top: 1px dashed var(--panel-edge); padding-top: .6rem; }
.pvseg { display: flex; background: var(--sunk); border-radius: 99px; padding: 3px; box-shadow: inset 0 0 0 1px var(--panel-edge); }
.pvseg button { font: 800 .8rem var(--body); color: var(--ink-dim); background: none; border: 0; border-radius: 99px; padding: .4em .9em; cursor: pointer; }
.pvseg button.on { background: var(--hot); color: var(--on-hot, #fff); }

.ptrack { position: relative; display: grid; gap: .55rem; }
.ptrack::before { content: ''; position: absolute; left: 1.45rem; top: .5rem; bottom: .5rem; width: 4px; margin-left: -2px;
  border-radius: 4px; background: var(--panel-edge); }
.ptier { position: relative; display: grid; grid-template-columns: 2.9rem 1fr; gap: .6rem; align-items: center; }
.pnum { position: relative; z-index: 1; display: grid; place-items: center; }
.pnum span { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; transform: rotate(45deg); border-radius: 8px;
  background: var(--panel); border: 2px solid var(--panel-edge); font: 900 .95rem var(--body); color: var(--ink-dim); }
.pnum em { font-style: normal; transform: rotate(-45deg); }
.ptier.reached .pnum span { background: var(--gold); border-color: var(--gold); color: #1a1205; }
.ptier.next .pnum span { border-color: var(--gold); color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent); }
.preward { position: relative; display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 16px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--rc) 16%, var(--panel)), var(--panel) 70%);
  border: 1.5px solid color-mix(in srgb, var(--rc) 40%, var(--panel-edge)); box-shadow: var(--shadow, 0 6px 20px rgba(0,0,0,.3)); }
.preward b { display: block; font-weight: 900; line-height: 1.15; }
.preward small { display: block; color: var(--ink-dim); font-weight: 700; font-size: .75rem; margin: .1rem 0 .3rem; }
.preward .rtag { display: inline-block; }
.pthumb { flex: none; display: grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 14px; color: var(--rc);
  background: color-mix(in srgb, var(--rc) 14%, var(--sunk)); border: 1.5px dashed color-mix(in srgb, var(--rc) 55%, transparent); }
.pthumb .ic { width: 1.9rem; height: 1.9rem; }
.pfree { position: absolute; top: -.55rem; right: .7rem; font: 900 .65rem var(--body); letter-spacing: .1em; text-transform: uppercase;
  padding: .25em .7em; border-radius: 99px; background: var(--ok); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.pstate { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--ink-dim); background: var(--sunk); }
.pstate .ic { width: 1.05rem; height: 1.05rem; }
.pstate.ok { background: var(--ok); color: #fff; }
.ptier:has(.pstate:not(.ok)) .preward > :not(.pstate):not(.pfree):not(.part) { opacity: .6; }
.ptier:has(.pstate:not(.ok)) .preward > .part { opacity: .85; }   /* a locked picture still shows what you'd get */
/* every tier is the same size (user, 2 Nov): a reward with a picture (a theme) shows it in the thumbnail */
.pthumb.part { overflow: hidden; border-style: solid; }
.part svg { display: block; width: 100%; height: 100%; }
.pthumb.part:has(svg[viewBox="0 0 100 100"]) { padding: .25rem; }   /* a record keeps a little room round it */
/* the Mythic finale stands out by colour only */
.ptier.finale .preward {
  background: linear-gradient(100deg, color-mix(in srgb, var(--rc) 28%, var(--panel)), var(--panel) 60%, color-mix(in srgb, var(--rc) 18%, var(--panel))); }
.pbonus { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; }
.pbonus .glyph { width: 2rem; height: 2rem; flex: none; }
.pbonus b, .pbonus small { display: block; }

/* the Get now pop-up: pay with coins (or get more) or buy outright */
.passbuy ul { margin: .5rem 0 .8rem; padding-left: 1.2rem; line-height: 1.6; font-weight: 700; }
.buyopt { display: grid; gap: .5rem; padding: .8rem; border-radius: 14px; background: var(--sunk); border: 1px solid var(--panel-edge); }
.buyopt b, .buyopt small { display: block; }
.buyopt small .ic, .price .ic { width: 1em; height: 1em; color: var(--gold); vertical-align: -.12em; }
.price { font: 900 1.2rem var(--body); white-space: nowrap; }
.or { display: flex; align-items: center; gap: .6rem; margin: .5rem 0; color: var(--ink-dim); font-weight: 800; font-size: .8rem; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--panel-edge); }

/* Store: coming soon */
.passsoon { display: grid; gap: .5rem; width: 100%; color: var(--ink); font: inherit; }
.passsoon ul { margin: 0; padding-left: 1.2rem; line-height: 1.7; font-weight: 700; }
.passsoon p { margin: 0; }

/* a screen's main button (Create room…) stays in view just above the bottom bar, so nobody has to scroll to find it
   (user, 2 Nov); it settles into its own place once you scroll to the end */
html body .btn.stickgo.stickgo.stickgo.stickgo { position: sticky; z-index: 5; bottom: calc(1rem + env(safe-area-inset-bottom)); }   /* beats the themes' position: relative */
html body.with-tabs .btn.stickgo.stickgo.stickgo.stickgo { bottom: calc(6.2rem + env(safe-area-inset-bottom)); }
/* the chat box: a textarea that grows with each line (viewChat sets its height), font a touch smaller than other fields */
#chatIn { resize: none; overflow-y: auto; min-height: 0; line-height: 1.3; font-size: 1.05rem; padding: .6em .8em; font-family: var(--body); }
.chatbar { align-items: flex-end; }
/* a costume that clashes with what this character already has on its head (cosmetics.js costumeFits) */
.styletile.nofit { cursor: default; }
.styletile.nofit > .sav { opacity: .35; filter: grayscale(1); }
.styletile.nofit > span { opacity: .55; }
.styletile.nofit > small { font: 800 .62rem var(--body); opacity: .6; margin-top: -.25rem; }
/* Settings > Report a bug */
#bugText { width: 100%; resize: vertical; line-height: 1.35; font-size: 1rem; padding: .6em .8em; font-family: var(--body); }

/* Party games added 7 Nov: In Order's tap buttons, Sabotage's tricks, Bank It's board */
.ordbtn { display: flex; align-items: center; gap: .5rem; }
.ordbtn .ordn { width: 1.6rem; height: 1.6rem; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--panel-edge); font-family: var(--display); }
.ordbtn.on { border-color: var(--hot); }
.ordbtn.on .ordn { background: var(--hot); color: #fff; border-color: var(--hot); }
.sabhit { color: var(--hot); font-size: 1.3rem; margin-bottom: .3rem; }
.ans.fogged .abtn { color: transparent; filter: blur(7px); pointer-events: none; }
.rank.bust { opacity: .55; }

/* The Achievements page: bosses */
.bossgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: .5rem; }
.bosstile { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .6rem .3rem; border-radius: 14px; text-align: center; border: 2px solid var(--panel-edge); background: var(--sunk); opacity: .7; }
.bosstile b { font-size: .9rem; line-height: 1.1; }
.bosstile small { font-size: .7rem; line-height: 1.15; display: flex; align-items: center; gap: .2rem; }
.bosstile small .ic { width: .9rem; height: .9rem; }
.bosstile .av { width: 3.4rem; height: 3.4rem; display: grid; place-items: center; }
.bosstile .av svg, .bosstile .av img { width: 100%; height: 100%; }
.bosstile:not(.on) .av .ic { width: 1.8rem; height: 1.8rem; }
.bosstile.on { opacity: 1; border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--sunk)); }

/* Season Pass challenges */
.passpage .chal { padding: .6rem .8rem; margin-bottom: .45rem; display: flex; flex-direction: column; gap: .3rem; }
.passpage .chal b { font-size: .95rem; line-height: 1.2; }
.passpage .chal.on { opacity: .75; }

/* Home: the Challenges button */
.hub .hubchal { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .8rem; text-align: left; cursor: pointer; margin: .2rem 0 .1rem; font: inherit; color: var(--ink); }
.hub .hubchal b { display: block; font-size: 1.05rem; line-height: 1.1; }
.hub .hubchal small { display: block; font-weight: 800; color: var(--ink-dim); font-size: .78rem; }
.hub .hubchal .ic { width: 1.8rem; height: 1.8rem; }
.hub .hubchal .chev { font-size: 1.6rem; font-weight: 900; opacity: .7; }

/* Style: the theme tiles */
.styletile.themetile { width: 7.6rem; min-width: 7.6rem; flex: none; }
.styletile.themetile .thpic { display: block; width: 100%; height: 4.6rem; border-radius: 10px; overflow: hidden; }
.styletile.themetile .thpic svg { width: 100%; height: 100%; display: block; }
.hbub .hbub-ball .badge-dot { position: absolute; top: -.1rem; right: -.1rem; }
/* Single Player prizes (owner, 8 Nov): where a locked one is won, and the trophy cabinet on Achievements */
.styletile.locked > small { font: 800 .6rem var(--body); opacity: .75; margin-top: -.25rem; max-width: 6rem; line-height: 1.1; }
.cabinet { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.4rem, 1fr)); gap: .5rem; padding: .6rem; border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--sunk) 70%, #000), var(--sunk)); border: 2px solid var(--panel-edge); }
.cabshelf { display: flex; flex-direction: column; align-items: center; gap: .15rem; text-align: center; padding: .4rem .2rem .5rem;
  border-bottom: 5px solid color-mix(in srgb, var(--panel-edge) 80%, #000); }
.cabshelf img { width: 4.6rem; height: 4.6rem; object-fit: contain; filter: brightness(0) opacity(.35); }
.cabshelf.on img { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.cabshelf b { font-size: .85rem; line-height: 1.1; }
.cabshelf small { font-size: .66rem; line-height: 1.15; }

/* the back button above a subject's topics: a proper button in every theme (user, 8 Nov) */
.topicback { align-self: flex-start; margin: .2rem 0 .1rem; }

/* page titles and the line under them, over busy moving scenes: a soft halo in the theme's own background colour so
   they read in every theme (user, 8 Nov: "can barely read Head to Head") */
.home > h2.title, .home > .title, .home > h2.title + .center.dim, .home > h2.title + .dim {
  text-shadow: 0 0 3px var(--bg-0), 0 0 8px var(--bg-0), 0 0 14px var(--bg-0), 0 2px 0 color-mix(in srgb, var(--bg-0) 80%, transparent); }

/* 12 Nov check-up: on phones held upright the answer buttons are taller, so they fill the empty lower half of the
   screen and sit nearer the thumb */
@media (max-width: 600px) and (orientation: portrait) {
  .ans .abtn { min-height: max(6.2rem, 21vh); font-size: 1.15rem; }
}
/* a visible ring when moving around with a keyboard or switch control (not on taps) */
:focus-visible { outline: 3px solid var(--ink, #222); outline-offset: 2px; }

/* Calmer motion (Settings, 12 Nov): no looping animations or slides; the scenery stands still */
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
  animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
/* Colour-blind help (Settings, 12 Nov): a shape next to each answer's letter */
html.cbsafe .ans .abtn .badge { width: auto; min-width: 2.4em; padding: 0 .45em; gap: .2em; display: inline-flex; align-items: center; justify-content: center; }
html.cbsafe .ans .abtn .badge::after { content: ''; width: .8em; height: .8em; background: currentColor; display: inline-block; }
html.cbsafe .ans .abtn.c0 .badge::after { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
html.cbsafe .ans .abtn.c1 .badge::after { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
html.cbsafe .ans .abtn.c2 .badge::after { border-radius: 50%; }
html.cbsafe .ans .abtn.c3 .badge::after { width: .72em; height: .72em; }

/* Quick reactions in a room (12 Nov) */
#emotebar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(.5rem + env(safe-area-inset-bottom)); z-index: 15;
  display: flex; gap: .15rem; padding: .25rem .4rem; border-radius: 99px; background: var(--panel, #fff); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
#emotebar button { font-size: 1.35rem; line-height: 1; padding: .3rem .32rem; background: none; border: 0; border-radius: 50%; cursor: pointer; }
#emotebar button:active { transform: scale(1.25); }
.emotefly { position: fixed; bottom: 4.5rem; z-index: 30; pointer-events: none; display: flex; flex-direction: column; align-items: center;
  animation: emotefly 2.6s ease-out forwards; }
.emotefly b { font-size: 2.6rem; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.emotefly small { font-weight: 900; font-size: .75rem; background: #000a; color: #fff; padding: .1rem .45rem; border-radius: 99px; }
@keyframes emotefly { 0% { transform: translateY(0) scale(.6); opacity: 0; } 12% { transform: translateY(-20px) scale(1.1); opacity: 1; }
  80% { opacity: 1; } 100% { transform: translateY(-260px) scale(1); opacity: 0; } }
html.calm .emotefly { animation: none; transform: translateY(-120px); }
body.tv .emotefly b { font-size: 4rem; }

/* Daily Quiz streak strip (12 Nov) */
.streakrow { display: flex; justify-content: center; gap: .3rem; margin: .7rem 0 .3rem; }
.streakrow span { width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; background: var(--sunk, #eee); font-size: 1.1rem; font-weight: 900; opacity: .6; }
.streakrow span.lit { background: color-mix(in srgb, #ff8a1f 25%, var(--panel, #fff)); opacity: 1; }

/* (15 Nov, owner: names that can't be read are bugs) a gradient name colour is see-through text with the gradient
   behind it, so a theme's dark title shadow (Dino Valley, Space Station...) was painted OVER it and the name came out
   as a dark blur: no text shadow on those, a crisp dark edge round the letters instead (the light themes keep theirs) */
.pname[style*="background-clip"] { text-shadow: none !important;
  filter: drop-shadow(0 0 1px rgba(10, 8, 20, .9)) drop-shadow(0 0 1px rgba(10, 8, 20, .9)) drop-shadow(0 2px 2px rgba(10, 8, 20, .5)); }
:is([data-theme="clean"], [data-theme="daylight"], [data-theme="blossom"]) .pname[style*="background-clip"] {
  filter: drop-shadow(0 0 .8px #2b1a22) drop-shadow(0 0 .8px #2b1a22) drop-shadow(0 1.5px 0 rgba(43, 26, 34, .5)); }
/* (15 Nov) words standing straight on a 3D scene (no panel behind them) got lost over the busy scenery: the title under
   a name (Home, Profile), "+3 more" and "Choose which to show" sit on a small dark pill in the scene themes */
html.art3d:is([data-theme="arcade"], [data-theme="wonderland"], [data-theme="workshop"], [data-theme="newyear"], [data-theme="starfall"],
  [data-theme="themepark"], [data-theme="spacestation"], [data-theme="dinovalley"], [data-theme="medieval"], [data-theme="mansion"],
  [data-theme="dungeon"], [data-theme="grandprix"], [data-theme="toytown"], [data-theme="bigcity"], [data-theme="christmas"])
  :is(.hname .ptitle, .title .ptitle, .crownrow > span.dim, .crownrow #pickCrowns) {
  width: fit-content; margin-inline: auto; padding: .12rem .6rem; border-radius: 99px; background: rgba(14, 12, 28, .62);
  text-shadow: none; -webkit-text-stroke: 0; }
html.art3d:is([data-theme="arcade"], [data-theme="wonderland"], [data-theme="workshop"], [data-theme="newyear"], [data-theme="starfall"],
  [data-theme="themepark"], [data-theme="spacestation"], [data-theme="dinovalley"], [data-theme="medieval"], [data-theme="mansion"],
  [data-theme="dungeon"], [data-theme="grandprix"], [data-theme="toytown"], [data-theme="bigcity"], [data-theme="christmas"])
  :is(.crownrow > span.dim, .crownrow #pickCrowns) { color: #fff; opacity: 1; }
html.art3d .crownrow #pickCrowns .ic { color: #ffd23d; }
/* on the dark pill the title takes the bright rarity colours (the light themes' deeper ones vanished on it) */
html.art3d:is([data-theme="arcade"], [data-theme="wonderland"], [data-theme="workshop"], [data-theme="newyear"], [data-theme="starfall"],
  [data-theme="themepark"], [data-theme="spacestation"], [data-theme="dinovalley"], [data-theme="medieval"], [data-theme="mansion"],
  [data-theme="dungeon"], [data-theme="grandprix"], [data-theme="toytown"], [data-theme="bigcity"], [data-theme="christmas"])
  :is(.hname .ptitle, .title .ptitle) {
  --r-common: #c4cad6; --r-uncommon: #4ade80; --r-rare: #4da3ff; --r-epic: #b884ff; --r-legendary: #ffb23d; --r-mythic: #e6eef9;
  color: var(--rc, #c4cad6); -webkit-text-fill-color: currentColor; filter: none; -webkit-background-clip: border-box; background-clip: border-box; }
