/* Trivia Quiz. Every class is prefixed tq-. The root is sized here; everything inside lays out against it. */
.tq { position: relative; height: min(calc(100svh - 150px), 720px); min-height: 540px; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: #050817; color: #dfe9ff; font-size: 16px; line-height: 1.35; isolation: isolate; outline: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; --tq-cat: #55d6ff; --tq-gold: #ffd166; --tq-ok: #3ddc84; --tq-bad: #ff6b81; --tq-line: #24365f; --tq-panel: #0b1328; --tq-muted: #8aa3c4; }
.stage.is-immersive .tq { flex: 1 1 auto; height: auto; max-height: none; min-height: 0; border-radius: 0; }
@media (max-height: 520px) and (orientation: landscape) { .tq { height: calc(100svh - 56px); min-height: 320px; } }
.tq *, .tq *::before, .tq *::after { box-sizing: border-box; }
.tq [hidden] { display: none !important; }
:where(.tq) button { font: inherit; color: inherit; cursor: pointer; -webkit-appearance: none; appearance: none; margin: 0; }
:where(.tq) button:disabled { cursor: default; }
.tq :focus-visible { outline: 3px solid #55d6ff; outline-offset: 2px; }
.tq p, .tq h3, .tq h4, .tq ul { margin: 0; }
.tq kbd { display: inline-block; min-width: 1.5em; padding: 0 5px; border: 1px solid #36507f; border-bottom-width: 2px; border-radius: 6px; background: #0e1a38; font: 600 .86em/1.5 ui-monospace, Menlo, Consolas, monospace; text-align: center; color: #dfe9ff; }

/* ---- the studio: slow spotlights drawn with gradients ---- */
.tq-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(120% 80% at 50% -10%, #142456 0%, #0a1230 42%, #050817 100%); }
.tq-cone { position: absolute; top: -8%; width: 46%; height: 125%; transform-origin: 50% 0; clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); opacity: .5; mix-blend-mode: screen; will-change: transform; }
.tq-cone-a { left: -8%; background: linear-gradient(#55d6ff55, #55d6ff00 82%); animation: tq-sway-a 13s ease-in-out infinite alternate; }
.tq-cone-b { left: 27%; background: linear-gradient(color-mix(in srgb, var(--tq-cat) 40%, transparent), transparent 80%); animation: tq-sway-b 17s ease-in-out infinite alternate; transition: background .6s; }
.tq-cone-c { left: 62%; background: linear-gradient(#a78bfa4d, #a78bfa00 82%); animation: tq-sway-c 15s ease-in-out infinite alternate; }
@keyframes tq-sway-a { from { transform: rotate(-16deg); } to { transform: rotate(-2deg); } }
@keyframes tq-sway-b { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes tq-sway-c { from { transform: rotate(3deg); } to { transform: rotate(17deg); } }
.tq-glow { position: absolute; left: 50%; top: 34%; width: 90%; height: 70%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, color-mix(in srgb, var(--tq-cat) 22%, transparent), transparent); transition: background .6s; }
.tq-floor { position: absolute; left: -10%; right: -10%; bottom: -34%; height: 60%; border-radius: 50%; background: radial-gradient(closest-side, #1b2c66aa, transparent); }
.tq-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }

/* ---- top bar ---- */
.tq-top { position: relative; z-index: 2; flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px 6px; }
.tq-where { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; font-size: 15px; color: #a9bfe3; letter-spacing: .02em; padding-left: 4px; }
.tq-ib { flex: none; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 1px solid var(--tq-line); border-radius: 12px; background: #0b1328cc; transition: background .15s, border-color .15s, transform .1s; }
.tq-ib svg, .tq-mode svg, .tq-rank svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tq-ib:active { transform: scale(.94); }
.tq-ib .tq-off { display: none; }
.tq-ib[aria-pressed="true"] .tq-on { display: none; }
.tq-ib[aria-pressed="true"] .tq-off { display: inline; }
.tq-ib[aria-pressed="true"] { color: var(--tq-muted); }
@media (hover: hover) { .tq-ib:hover, .tq-btn:hover, .tq-seg button:hover, .tq-chip:hover { border-color: #4b6aa8; background: #12204a; } }

/* ---- screens ---- */
.tq-screens { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; }
.tq-s { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 4px 14px 14px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2b4172 transparent; }
.tq-s > * { flex: none; }
.tq-s.tq-in { animation: tq-in .28s ease-out both; }
@keyframes tq-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- buttons ---- */
.tq-btn { min-height: 46px; padding: 0 18px; border: 1px solid var(--tq-line); border-radius: 13px; background: #0e1936; font-weight: 700; font-size: 15.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, border-color .15s, transform .1s, filter .15s; }
.tq-btn:active, .tq-playbtn:active, .tq-mode:active, .tq-next:active { transform: scale(.975); }
.tq-btn-main, .tq-playbtn, .tq-next { border: 0; color: #1c1300; background: linear-gradient(180deg, #ffe08a, #ffc23d); box-shadow: 0 6px 22px #ffb7003d, inset 0 1px 0 #fff6; }
@media (hover: hover) { .tq .tq-btn-main:hover, .tq-playbtn:hover, .tq-next:hover { filter: brightness(1.07); background: linear-gradient(180deg, #ffe08a, #ffc23d); } }
.tq-btn-big { min-height: 56px; font-size: 18px; padding: 0 30px; }

/* ---- menu ---- */
.tq-menu { align-items: center; gap: 12px; }
.tq-menu > * { width: 100%; max-width: 640px; }
.tq-menu::before, .tq-menu::after, .tq-setup::before, .tq-setup::after, .tq-end::before, .tq-end::after, .tq-hand::before, .tq-hand::after { content: ''; flex: 1 1 0; }
.tq-hero { display: flex; align-items: center; gap: 14px; justify-content: center; }
.tq-logo { flex: none; width: 62px; height: 62px; filter: drop-shadow(0 0 14px #ffd16655); }
.tq-logo svg { width: 100%; height: 100%; }
.tq-logo-ring { fill: #101c40; stroke: #ffd166; stroke-width: 3; }
.tq-logo-q { fill: none; stroke: #ffd166; stroke-width: 5.500; stroke-linecap: round; }
.tq-logo-dot { fill: #ffd166; }
.tq-hero-t { min-width: 0; }
.tq-title { font-size: 30px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; color: #fff; text-shadow: 0 2px 18px #55d6ff44; }
.tq-tag { margin-top: 4px !important; font-size: 14px; color: #a9bfe3; }
.tq-playbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 92px; border-radius: 20px; padding: 8px 20px; transition: transform .1s, filter .15s; position: relative; overflow: hidden; }
.tq-playbtn b { font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: .01em; }
.tq-playbtn span { font-size: 14px; font-weight: 600; opacity: .8; }
.tq-playbtn::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, #ffffff66, transparent); transform: skewX(-18deg); animation: tq-sheen 4.200s ease-in-out infinite; }
@keyframes tq-sheen { 0%, 62% { left: -40%; } 100% { left: 120%; } }
.tq-resume { min-height: 46px; border: 1px dashed #ffd16688; border-radius: 13px; background: #2a210a99; color: #ffe3a1; font-weight: 700; font-size: 14.500px; padding: 4px 14px; }
.tq-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tq-mode { position: relative; display: grid; grid-template-columns: 26px 1fr; grid-template-rows: auto auto; align-content: center; row-gap: 3px; column-gap: 9px; align-items: center; text-align: left; min-height: 74px; padding: 9px 11px; border: 1px solid var(--tq-line); border-radius: 14px; background: linear-gradient(180deg, #101c3fdd, #0a1330dd); transition: transform .1s, border-color .15s, background .15s; }
.tq-mode svg { grid-row: 1; color: var(--tq-cat); width: 24px; height: 24px; }
.tq-mode b { grid-row: 1; font-size: 16px; }
.tq-mode span { grid-column: 1 / -1; font-size: 12.500px; color: var(--tq-muted); line-height: 1.3; }
.tq-mode .tq-mode-meta { color: #ffd166; font-weight: 600; }
.tq-mode .tq-mode-meta:empty { display: none; }
.tq-mode-daily svg { color: #ffd166; }
.tq-mode-daily { border-color: #6b5a26; }
@media (hover: hover) { .tq-mode:hover { border-color: #4b6aa8; background: linear-gradient(180deg, #16265299, #0e1a3f); } }
.tq-rank { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 12px; border: 1px solid var(--tq-line); border-radius: 14px; background: #0b1328cc; text-align: left; }
.tq-rank-badge { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe9a8, #f0a92a); color: #2a1a00; font-weight: 800; font-size: 17px; box-shadow: 0 0 0 3px #ffd16633; }
.tq-rank-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tq-rank-mid b { font-size: 15px; }
.tq-rank-mid small { font-size: 12px; color: var(--tq-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-xpbar { display: block; height: 7px; border-radius: 4px; background: #17254d; overflow: hidden; }
.tq-xpbar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #55d6ff, #a78bfa); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.tq-rank-go { flex: none; display: flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: #a9bfe3; }
.tq-rank-go svg { width: 18px; height: 18px; }

/* ---- sheets: round options, help, stats, review ---- */
.tq-setup { align-items: center; scroll-padding-bottom: 92px; }
.tq-sheet { width: 100%; max-width: 660px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--tq-line); border-radius: 18px; background: #0a1230e6; box-shadow: 0 18px 50px #0008; }
.tq-sheet h3 { font-size: 22px; line-height: 1.2; display: flex; align-items: center; gap: 10px; }
.tq-sheet h4 { font-size: 12.500px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tq-muted); }
.tq-sheet p, .tq-sheet li { font-size: 14.500px; color: #c5d4f2; line-height: 1.45; }
.tq-sheet ul { padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.tq-sheet b { color: #fff; }
.tq-opt { display: flex; flex-direction: column; gap: 7px; }
.tq-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.tq-seg button, .tq-chip { min-height: 44px; padding: 0 14px; border: 1px solid var(--tq-line); border-radius: 12px; background: #0e1936; font-weight: 600; font-size: 14.500px; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, border-color .15s; }
.tq-seg button { flex: 1 1 0; justify-content: center; white-space: nowrap; }
.tq-seg button[aria-pressed="true"], .tq-chip[aria-pressed="true"] { border-color: #ffd166; background: #2c2408; color: #ffe6a6; box-shadow: inset 0 0 0 1px #ffd166; }
.tq-seg small { font-weight: 500; color: var(--tq-muted); font-size: 12px; }
.tq-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.tq-chip { justify-content: flex-start; padding: 0 10px; min-width: 0; }
.tq-chip i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #55d6ff); box-shadow: 0 0 8px var(--c, #55d6ff); }
.tq-chip span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.tq-chip em { margin-left: auto; flex: none; font-style: normal; font-size: 11px; font-weight: 700; color: #ffd166; }
.tq-chip em[data-m="1"] { color: #e0a070; }
.tq-chip em[data-m="2"] { color: #dfe9ff; }
.tq-chip em[data-m="4"] { color: #8fe6ff; }
/* The start button stays in view while a long list of options scrolls under it. */
.tq-setup .tq-sheet > .tq-row:last-child { position: sticky; bottom: -14px; z-index: 2; margin: -4px -16px -16px; padding: 12px 16px 16px; border-radius: 0 0 17px 17px; background: linear-gradient(#0a123000, #0a1230f5 26%); }
.tq-note { font-size: 13px !important; color: var(--tq-muted) !important; }
.tq-note b { color: #ffe6a6 !important; }
.tq-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tq-row .tq-btn-main { flex: 1 1 200px; }
.tq-names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tq-name { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 46px; padding: 0 10px; border: 1px solid var(--tq-line); border-radius: 12px; background: #0e1936; }
.tq-name i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.tq-name input { flex: 1 1 0; width: 0; min-width: 0; height: 42px; border: 0; background: none; color: #fff; font: inherit; font-weight: 600; outline: none; -webkit-user-select: text; user-select: text; }
.tq-name:focus-within { border-color: #55d6ff; }

/* ---- the quiz ---- */
.tq-play { padding: 0 12px 12px; overflow: hidden; touch-action: none; }
.tq-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 2px 8px; min-height: 60px; }
.tq-hud-l { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tq-prog { font-size: 12.500px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #a9bfe3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the dots share one row: they keep their size while there is room and shrink together when there is not */
.tq-dots { display: flex; align-items: center; gap: 4px; min-height: 9px; }
.tq-dots i { flex: 1 1 0; min-width: 0; max-width: 9px; aspect-ratio: 1; border-radius: 50%; background: #33487f; }
.tq-dots i.is-ok { background: var(--tq-ok); }
.tq-dots i.is-no { background: var(--tq-bad); }
.tq-dots i.is-now { background: #fff; box-shadow: 0 0 8px #fff; }
.tq-ring { position: relative; width: 52px; height: 52px; }
.tq-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tq-ring circle { fill: none; stroke-width: 4.500; }
.tq-ring-bg { stroke: #1a2a55; fill: #070d22cc !important; }
.tq-ring-fg { stroke: var(--tq-cat); stroke-linecap: round; stroke-dasharray: 125.660; stroke-dashoffset: 0; transition: stroke .3s; }
.tq-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tq-ring.is-low .tq-ring-fg { stroke: var(--tq-bad); }
.tq-ring.is-low b { color: var(--tq-bad); animation: tq-beat .5s ease-in-out infinite alternate; }
.tq-ring.is-off { visibility: hidden; }
.tq-ring.is-wide { width: 64px; height: 64px; }
.tq-ring.is-wide b { font-size: 21px; }
@keyframes tq-beat { to { transform: scale(1.18); } }
.tq-hud-r { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.tq-streak { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 9px; border-radius: 14px; background: #3a1d0a; border: 1px solid #ff9f5a88; color: #ffcf9a; font-size: 13px; font-weight: 800; white-space: nowrap; }
.tq-streak.is-pop { animation: tq-pop .4s ease-out; }
.tq-lives { display: inline-flex; gap: 3px; }
.tq-lives svg { width: 20px; height: 20px; fill: var(--tq-bad); stroke: none; filter: drop-shadow(0 0 5px #ff6b8188); transition: opacity .3s, transform .3s; }
.tq-lives svg.is-lost { fill: #2a3558; filter: none; transform: scale(.85); }
.tq-score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.tq-score small { font-size: 10.500px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tq-muted); }
.tq-score b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.tq-score b.is-pop { animation: tq-pop .35s ease-out; }
@keyframes tq-pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

.tq-main { flex: 1 1 auto !important; min-height: 0; display: flex; gap: 14px; justify-content: center; }
.tq-col { flex: 1 1 auto; min-width: 0; max-width: 820px; min-height: 0; display: flex; flex-direction: column; gap: 9px; }
.tq-card { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 10px 14px 12px; border: 1px solid color-mix(in srgb, var(--tq-cat) 45%, #24365f); border-top: 3px solid var(--tq-cat); border-radius: 18px; background: linear-gradient(180deg, #111e45f2, #0a1330f2); box-shadow: 0 14px 40px #0007, 0 0 34px color-mix(in srgb, var(--tq-cat) 16%, transparent); overflow: hidden; transition: border-color .4s, box-shadow .4s; }
.tq-card.is-in { animation: tq-card-in .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes tq-card-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.tq-card-top { flex: none; display: flex; align-items: center; gap: 9px; min-height: 24px; }
.tq-cat { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: color-mix(in srgb, var(--tq-cat) 20%, #0a1330); color: color-mix(in srgb, var(--tq-cat) 78%, #fff); font-size: 12.500px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.tq-pips { display: inline-flex; gap: 3px; }
.tq-pips i { width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: #263865; }
.tq-pips i.is-on { background: var(--tq-gold); }
.tq-worth { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--tq-gold); white-space: nowrap; }
.tq-cat, .tq-pips, .tq-worth { flex: none; }
/* a long category beside a long prize on a narrow card: first everything tightens, then the difficulty pips step aside */
.tq-card-top.is-tight { gap: 7px; }
.tq-card-top.is-tight .tq-cat { font-size: 11.500px; padding: 0 8px; letter-spacing: .02em; }
.tq-card-top.is-tight .tq-pips { gap: 2px; }
.tq-card-top.is-tight .tq-pips i { width: 6px; height: 6px; }
.tq-card-top.is-tight .tq-worth { font-size: 12.500px; }
.tq-card-top.is-tighter .tq-pips { display: none; }
.tq-q { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 700; font-size: var(--tq-qfs, 21px); line-height: 1.28; color: #fff; text-wrap: balance; padding: 4px 2px 0; overflow: hidden; }
.tq-veil { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #0a1330; text-align: center; padding: 10px; }
.tq-veil b { font-size: 22px; }
.tq-veil span { font-size: 13.500px; color: var(--tq-muted); }

.tq-answers { flex: none; display: grid; grid-template-columns: 1fr; gap: 8px; }
.tq-a { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 5px 12px 5px 9px; border: 1.500px solid #2a4172; border-radius: 15px; background: linear-gradient(180deg, #13214a, #0c1634); text-align: left; font-size: 16px; font-weight: 600; line-height: 1.2; overflow: hidden; touch-action: none; transition: transform .1s, border-color .15s, background .2s, opacity .25s; }
.tq-a i { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 1.500px solid #3b5a99; background: #0a1230; color: #8fd9ff; font-style: normal; font-weight: 800; font-size: 14.500px; transition: background .2s, color .2s, border-color .2s; }
.tq-a-t { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.tq-a-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #55d6ff2e, #55d6ff14); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.tq-a-pct { position: relative; z-index: 1; flex: none; font-size: 13.500px; font-weight: 800; color: #8fd9ff; font-variant-numeric: tabular-nums; }
.tq-a-pct:empty { display: none; }
@media (hover: hover) { .tq-a:not(:disabled):hover { border-color: #55d6ff; background: linear-gradient(180deg, #182a5e, #0f1b40); } }
.tq-a:not(:disabled):active { transform: scale(.98); }
.tq-a:disabled { opacity: 1; }
.tq-a.is-dim { opacity: .5; }
.tq-a.is-gone { opacity: .22; }
.tq-a.is-gone .tq-a-t { text-decoration: line-through; }
.tq-a.is-right { border-color: var(--tq-ok); background: linear-gradient(180deg, #14553a, #0d3a28); box-shadow: 0 0 22px #3ddc8455; }
.tq-a.is-right i { background: var(--tq-ok); border-color: var(--tq-ok); color: #04210f; }
.tq-a.is-wrong { border-color: var(--tq-bad); background: linear-gradient(180deg, #5a1a2a, #3c101c); animation: tq-shake .36s ease-in-out; }
.tq-a.is-wrong i { background: var(--tq-bad); border-color: var(--tq-bad); color: #2b0510; }
.tq-a.is-right.is-mine { animation: tq-yes .42s ease-out; }
@keyframes tq-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes tq-yes { 0% { transform: scale(1); } 45% { transform: scale(1.035); } 100% { transform: scale(1); } }
.tq-answers.is-in .tq-a { animation: tq-a-in .3s cubic-bezier(.2, .8, .2, 1) both; }
.tq-answers.is-in .tq-a:nth-child(2) { animation-delay: .04s; }
.tq-answers.is-in .tq-a:nth-child(3) { animation-delay: .08s; }
.tq-answers.is-in .tq-a:nth-child(4) { animation-delay: .12s; }
@keyframes tq-a-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.tq-foot { flex: none; height: 142px; position: relative; }
.tq-life { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tq-lb { min-height: 48px; padding: 4px 14px; display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; border: 1px solid #3b5a99; border-radius: 13px; background: #0e1b40; line-height: 1.15; transition: background .15s, border-color .15s, opacity .2s; }
.tq-lb b { font-size: 15px; color: #8fd9ff; }
.tq-lb span { font-size: 11.500px; color: var(--tq-muted); }
.tq-lb:disabled { opacity: .35; }
.tq-bank { border-color: #6b5a26; background: #241c06; }
.tq-bank b { color: #ffe6a6; }
@media (hover: hover) { .tq-lb:not(:disabled):hover { border-color: #55d6ff; background: #14265a; } }
.tq-hint { flex: 1 1 140px; min-width: 0; font-size: 12.500px; color: var(--tq-muted); line-height: 1.35; }
.tq-reveal { display: flex; flex-direction: column; gap: 7px; height: 100%; animation: tq-in .22s ease-out both; }
.tq-reveal-row { display: flex; align-items: center; gap: 10px; }
.tq-verdict { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 9px; font-size: 19px; font-weight: 800; line-height: 1.15; }
.tq-verdict.is-right { color: var(--tq-ok); }
.tq-verdict.is-wrong { color: var(--tq-bad); }
.tq-verdict span { color: var(--tq-gold); font-variant-numeric: tabular-nums; }
.tq-verdict small { flex-basis: 100%; margin-top: 2px; font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--tq-muted); }
.tq-next { flex: none; min-height: 48px; min-width: 124px; padding: 0 18px; border-radius: 14px; font-weight: 800; font-size: 16px; }
.tq-fact { flex: 1 1 auto; min-height: 0; font-size: var(--tq-ffs, 14.500px); line-height: 1.38; color: #cfdcf7; overflow: hidden; }
.tq-fact b { color: #8fd9ff; }

/* ---- the ladder ---- */
.tq-ladder { flex: none; width: 196px; display: flex; flex-direction: column-reverse; gap: 2px; padding: 8px; border: 1px solid var(--tq-line); border-radius: 16px; background: #0a1230cc; overflow: hidden; }
.tq-rung { flex: 1 1 0; min-height: 0; display: flex; align-items: center; gap: 8px; padding: 0 9px; border-radius: 8px; font-size: 13.500px; font-weight: 700; color: #7d93bd; font-variant-numeric: tabular-nums; }
.tq-rung em { flex: none; width: 20px; font-style: normal; font-size: 11.500px; color: #53679a; text-align: right; }
.tq-rung.is-safe { color: #ffe6a6; }
.tq-rung.is-done { color: var(--tq-ok); }
.tq-rung.is-now { background: linear-gradient(90deg, #ffd166, #ffb93d); color: #201500; box-shadow: 0 0 18px #ffd16655; }
.tq-rung.is-now em { color: #5a4100; }
.tq-rung u { margin-left: auto; text-decoration: none; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }

/* ---- party hand-over ---- */
.tq-hand { align-items: center; }
.tq-handbox { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 16px; border: 1px solid var(--tq-line); border-top: 4px solid var(--c, #55d6ff); border-radius: 20px; background: #0a1230ee; text-align: center; box-shadow: 0 18px 50px #0008; }
.tq-hand-round { font-size: 12.500px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tq-muted); }
.tq-hand-name { font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--c, #fff); text-shadow: 0 0 24px color-mix(in srgb, var(--c, #fff) 45%, transparent); overflow-wrap: anywhere; }
.tq-hand-sub { font-size: 15px; color: #c5d4f2; }
.tq-board { width: 100%; display: flex; flex-direction: column; gap: 5px; }
.tq-board-row { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 10px; border-radius: 10px; background: #0e1936; font-weight: 700; font-size: 14.500px; }
.tq-board-row i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.tq-board-row span { flex: 1 1 auto; min-width: 0; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tq-board-row b { font-variant-numeric: tabular-nums; }
.tq-board-row.is-turn { outline: 2px solid var(--c); background: #13214a; }

/* ---- results ---- */
.tq-end { align-items: center; }
.tq-endbox { width: 100%; max-width: 620px; display: flex; flex-direction: column; align-items: center; gap: 11px; padding: 18px 16px; border: 1px solid var(--tq-line); border-radius: 20px; background: #0a1230ee; text-align: center; box-shadow: 0 18px 50px #0008; }
/* the results box steps aside for the site's reward card (game.js sets left / top / max-width) */
.tq-endbox { position: relative; transition: left .25s ease, top .25s ease; }
.tq-end-kicker { font-size: 12.500px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tq-muted); }
.tq-end-title { font-size: 27px; font-weight: 800; line-height: 1.15; color: #fff; }
.tq-end-score { font-size: 54px; font-weight: 800; line-height: 1; color: var(--tq-gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 30px #ffd16655; }
.tq-end-score small { display: block; margin-top: 5px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tq-muted); text-shadow: none; }
.tq-end-best { font-size: 14.500px; color: #c5d4f2; }
.tq-end-best b { color: #fff; }
.tq-end-best.is-new { color: var(--tq-ok); font-weight: 800; }
.tq-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.tq-stat { min-width: 84px; padding: 7px 10px; border: 1px solid var(--tq-line); border-radius: 12px; background: #0e1936; display: flex; flex-direction: column; gap: 1px; }
.tq-stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.tq-stat small { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--tq-muted); }
.tq-xp { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #c5d4f2; }
.tq-xp div { display: flex; justify-content: space-between; gap: 8px; }
.tq-xp b { color: #fff; }
.tq-earned { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tq-earned span { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 14px; background: #2c2408; border: 1px solid #ffd16677; color: #ffe6a6; font-size: 12.500px; font-weight: 700; }
.tq-end-btns { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.tq-end-btns .tq-btn-main { flex: 1 1 100%; max-width: 380px; }
.tq-end-daily { font-size: 14px; color: #ffe6a6; font-weight: 600; }
.tq-end-daily:empty { display: none; }
.tq-table { width: 100%; border-collapse: collapse; font-size: 14.500px; }
.tq-table th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tq-muted); padding: 4px 9px; text-align: right; white-space: nowrap; }
.tq-table td { padding: 8px 9px; text-align: right; white-space: nowrap; border-top: 1px solid #1a2850; font-variant-numeric: tabular-nums; font-weight: 600; }
.tq-table th:nth-child(2), .tq-table td:nth-child(2) { text-align: left; }
.tq-table td:nth-child(2) { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tq-table td:first-child, .tq-table th:first-child { text-align: center; }
.tq-table td i { display: inline-block; width: 11px; height: 11px; margin-right: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.tq-table tr.is-win td { color: #ffe6a6; background: #2c240855; }
.tq-table tr.is-win td:nth-child(3) { font-size: 17px; font-weight: 800; }

/* ---- stats, medals, review ---- */
.tq-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tq-grid .tq-stat { min-width: 0; }
.tq-medals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.tq-medal { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 6px 10px; border: 1px solid var(--tq-line); border-radius: 12px; background: #0e1936; }
.tq-medal-ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #17254d; border: 2px solid #2b3f72; color: #53679a; font-size: 13px; font-weight: 800; }
.tq-medal-ic[data-m="1"] { background: radial-gradient(circle at 35% 30%, #f3c6a0, #b06a35); border-color: #e0a070; color: #3a1c06; }
.tq-medal-ic[data-m="2"] { background: radial-gradient(circle at 35% 30%, #f4f8ff, #9aa9c4); border-color: #dfe9ff; color: #1c2740; }
.tq-medal-ic[data-m="3"] { background: radial-gradient(circle at 35% 30%, #fff0b8, #f0a92a); border-color: #ffd166; color: #3a2500; }
.tq-medal-ic[data-m="4"] { background: radial-gradient(circle at 35% 30%, #d9fbff, #55d6ff 60%, #a78bfa); border-color: #b9f0ff; color: #06243a; box-shadow: 0 0 12px #55d6ff88; }
.tq-medal-ic svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.tq-nw { white-space: nowrap; }
.tq-medal-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tq-medal-t b { font-size: 13.500px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tq-medal-t small { font-size: 11.500px; color: var(--tq-muted); }
.tq-medal .tq-xpbar { height: 5px; }
.tq-medal .tq-xpbar i { background: var(--c, #55d6ff); }
.tq-achs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.tq-ach { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--tq-line); border-radius: 12px; background: #0e1936; opacity: .55; }
.tq-ach b { font-size: 13.500px; }
.tq-ach small { font-size: 12px; color: var(--tq-muted); line-height: 1.3; }
.tq-ach.is-got { opacity: 1; border-color: #ffd16677; background: #2c240877; }
.tq-ach.is-got b { color: #ffe6a6; }
.tq-rev { display: flex; flex-direction: column; gap: 3px; padding: 9px 11px; border: 1px solid var(--tq-line); border-left: 4px solid var(--tq-bad); border-radius: 12px; background: #0e1936; -webkit-user-select: text; user-select: text; }
.tq-rev.is-ok { border-left-color: var(--tq-ok); }
.tq-rev b { font-size: 14.500px; line-height: 1.3; }
.tq-rev span { font-size: 13.500px; color: #c5d4f2; }
.tq-rev span.is-ok { color: var(--tq-ok); font-weight: 700; }
.tq-rev span.is-no { color: var(--tq-bad); font-weight: 700; }
.tq-rev small { font-size: 12.500px; color: var(--tq-muted); line-height: 1.35; }
.tq-helps .tq-sheet, .tq-stats .tq-sheet, .tq-review .tq-sheet { margin-bottom: 4px; }

/* ---- dialog, toasts, live region ---- */
.tq-dlg { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: #04060fc7; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.tq-dlg-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; padding: 20px 18px; border: 1px solid var(--tq-line); border-radius: 18px; background: #0b1328; text-align: center; box-shadow: 0 20px 60px #000a; animation: tq-in .2s ease-out both; }
.tq-dlg-t { font-size: 22px; font-weight: 800; color: #fff; }
.tq-dlg-s { font-size: 14.500px; color: #c5d4f2; }
.tq-dlg-s:empty { display: none; }
.tq-dlg-b { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tq-toasts { position: absolute; z-index: 5; top: 58px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.tq-toast { max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 16px; border: 1px solid #ffd16699; background: #241c06f2; color: #ffe6a6; font-size: 13.500px; font-weight: 700; box-shadow: 0 8px 26px #0009; animation: tq-toast 3.400s ease both; }
.tq-toast b { color: #fff; }
.tq-toast { min-width: min(var(--tq-toast-w, 0px), calc(100% - 24px)); text-align: center; }
@keyframes tq-toast { 0% { opacity: 0; transform: translateY(-10px) scale(.96); } 8%, 86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
.tq-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- sizes: data-w is set from the root's own width (s under 620, l from 980), data-h="short" under 470 tall ---- */
.tq[data-w="m"] .tq-answers, .tq[data-w="l"] .tq-answers { grid-template-columns: 1fr 1fr; gap: 10px; }
.tq[data-w="m"] .tq-a, .tq[data-w="l"] .tq-a { min-height: 66px; font-size: 17px; padding-left: 12px; }
.tq[data-w="m"] .tq-a i, .tq[data-w="l"] .tq-a i { width: 36px; height: 36px; font-size: 16px; }
.tq[data-w="m"] .tq-foot, .tq[data-w="l"] .tq-foot { height: 122px; }
.tq[data-w="m"] .tq-play, .tq[data-w="l"] .tq-play { padding: 0 18px 16px; }
.tq[data-w="m"] .tq-card, .tq[data-w="l"] .tq-card { padding: 14px 22px 16px; }
.tq[data-w="l"] .tq-col { gap: 12px; }
.tq[data-w="s"] .tq-modes { grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tq[data-w="s"] .tq-menu { gap: 10px; }
.tq[data-w="s"] .tq-title { font-size: 26px; }
.tq[data-w="s"] .tq-tag { font-size: 13px; }
.tq[data-w="s"] .tq-logo { width: 54px; height: 54px; }
.tq[data-w="s"] .tq-rank-go { font-size: 0; }
.tq[data-w="s"] .tq-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tq[data-w="s"] .tq-chip { font-size: 14px; }
.tq[data-w="s"] .tq-chip span { white-space: normal; line-height: 1.12; }
.tq[data-w="s"] .tq-chip em { width: 12px; height: 12px; border-radius: 50%; font-size: 0; background: currentColor; box-shadow: 0 0 0 2px #0e1936, 0 0 0 3px currentColor; }
.tq[data-w="s"] .tq-setup .tq-sheet > .tq-row:last-child { bottom: -12px; margin: -4px -12px -13px; padding: 12px 12px 13px; }
.tq[data-w="s"] .tq-sheet { padding: 13px 12px; gap: 10px; }
.tq[data-w="s"] .tq-grid { grid-template-columns: repeat(2, 1fr); }
.tq[data-w="s"] .tq-medals, .tq[data-w="s"] .tq-achs { grid-template-columns: 1fr; }
.tq[data-w="s"] .tq-ladder, .tq[data-w="m"] .tq-ladder { display: none; }
.tq[data-w="s"] .tq-end-score { font-size: 46px; }
/* a low, wide stage (a short desktop window): the results tighten and the buttons share one row, so nothing scrolls */
.tq[data-h="mid"]:not([data-w="s"]) .tq-endbox { gap: 9px; padding: 14px 16px; }
.tq[data-h="mid"]:not([data-w="s"]) .tq-end-score { font-size: 48px; }
.tq[data-h="mid"]:not([data-w="s"]) .tq-end-btns { flex-wrap: nowrap; }
.tq[data-h="mid"]:not([data-w="s"]) .tq-end-btns .tq-btn-main { flex: 1 1 auto; max-width: none; }
.tq[data-w="s"] .tq-s { padding: 4px 10px 12px; }
/* the narrowest phones (a root under 340 px) */
.tq[data-xs] .tq-top { gap: 6px; }
.tq[data-xs] .tq-ib { width: 40px; height: 40px; }
.tq[data-xs] .tq-mode { grid-template-columns: 24px 1fr; column-gap: 7px; }
.tq[data-xs] .tq-mode b { font-size: 15px; }
.tq[data-xs] .tq-mode span { font-size: 12px; }
.tq[data-xs] .tq-names { grid-template-columns: minmax(0, 1fr); }
.tq[data-xs] .tq-verdict { font-size: 17.500px; column-gap: 7px; }
.tq[data-xs] .tq-dots { gap: 3px; }
.tq[data-xs] .tq-dots.is-many { gap: 2px; }
.tq[data-xs] .tq-next { min-width: 104px; padding-left: 14px; padding-right: 14px; }
.tq[data-w="s"] .tq-play { padding: 0 10px 10px; }
.tq[data-w="s"] .tq-streak { padding: 0 7px; font-size: 12px; }
.tq[data-h="short"] .tq-col { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; gap: 8px 12px; max-width: none; }
.tq[data-h="short"] .tq-card { grid-column: 1; grid-row: 1; padding: 8px 14px 10px; }
.tq[data-h="short"] .tq-answers { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: 1fr; gap: 6px; align-content: center; }
.tq[data-h="short"] .tq-a { min-height: 42px; font-size: 15px; }
.tq[data-h="short"] .tq-a i { width: 28px; height: 28px; font-size: 13px; }
.tq[data-h="short"] .tq-foot { grid-column: 1; grid-row: 2; height: 90px; }
.tq[data-h="short"] .tq-fact { line-height: 1.3; }
.tq[data-h="short"] .tq-top { padding: 4px 10px 4px; }
.tq[data-h="short"] .tq-ib { width: 40px; height: 40px; }
.tq[data-h="short"] .tq-play { padding: 0 12px 8px; }
.tq[data-h="short"] .tq-hud { min-height: 46px; padding-bottom: 4px; }
.tq[data-h="short"] .tq-ring.is-wide { width: 46px; height: 46px; }
.tq[data-h="short"] .tq-ring b { font-size: 15.500px; }
.tq[data-h="short"] .tq-lb { min-height: 42px; padding: 2px 11px; }
.tq[data-h="short"] .tq-ring { width: 44px; height: 44px; }
.tq[data-h="short"] .tq-ladder { display: none; }
.tq[data-h="short"] .tq-next { min-height: 42px; }
.tq[data-h="short"] .tq-verdict small { display: none; }
/* hand-over on a low, wide screen: the name and the button on the left, the scores on the right */
.tq[data-h="short"] .tq-handbox { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(4, auto); align-content: center; align-items: center; justify-items: center; gap: 6px 20px; max-width: 700px; padding: 12px 18px 14px; }
.tq[data-h="short"] .tq-handbox > * { grid-column: 1; }
.tq[data-h="short"] .tq-handbox .tq-board { grid-column: 2; grid-row: 1 / span 4; }
.tq[data-h="short"] .tq-hand-name { font-size: 28px; }
.tq[data-h="short"] .tq-board-row { min-height: 31px; }

/* a phone held upright with the browser bars showing: the stage is 540 tall, so the quiz tightens up */
.tq[data-w="s"][data-h="mid"] .tq-top { padding: 6px 10px 4px; }
.tq[data-w="s"][data-h="mid"] .tq-ib { width: 40px; height: 40px; }
.tq[data-w="s"][data-h="mid"] .tq-hud { min-height: 46px; padding-bottom: 5px; }
.tq[data-w="s"][data-h="mid"] .tq-ring { width: 42px; height: 42px; }
.tq[data-w="s"][data-h="mid"] .tq-ring.is-wide { width: 46px; height: 46px; }
.tq[data-w="s"][data-h="mid"] .tq-ring b { font-size: 15.500px; }
.tq[data-w="s"][data-h="mid"] .tq-score b { font-size: 19px; }
.tq[data-w="s"][data-h="mid"] .tq-col { gap: 6px; }
.tq[data-w="s"][data-h="mid"] .tq-card { padding: 8px 12px 9px; border-radius: 15px; }
.tq[data-w="s"][data-h="mid"] .tq-answers { gap: 6px; }
.tq[data-w="s"][data-h="mid"] .tq-a { min-height: 46px; font-size: 15.500px; padding-top: 3px; padding-bottom: 3px; border-radius: 13px; }
.tq[data-w="s"][data-h="mid"] .tq-a i { width: 30px; height: 30px; font-size: 13.500px; }
.tq[data-w="s"][data-h="mid"] .tq-foot { height: 100px; }
.tq[data-w="s"][data-h="mid"] .tq-next, .tq[data-w="s"][data-h="mid"] .tq-lb { min-height: 44px; }
.tq[data-w="s"][data-h="mid"] .tq-play { padding-bottom: 8px; }
.tq[data-w="s"][data-h="mid"] .tq-menu { gap: 8px; }
.tq[data-w="s"][data-h="mid"] .tq-playbtn { min-height: 76px; }
.tq[data-w="s"][data-h="mid"] .tq-playbtn b { font-size: 28px; }
.tq[data-w="s"][data-h="mid"] .tq-mode { min-height: 62px; padding: 6px 10px; }
.tq[data-w="s"][data-h="mid"] .tq-rank { min-height: 50px; padding: 5px 12px; }
.tq[data-w="s"][data-h="mid"] .tq-logo { width: 46px; height: 46px; }
.tq[data-w="s"][data-h="mid"] .tq-title { font-size: 24px; }
/* a saved Ladder climb adds a button: on a short phone the menu tightens so it all still fits without scrolling */
.tq[data-w="s"][data-h="mid"] .tq-menu.has-resume { gap: 6px; }
.tq[data-w="s"][data-h="mid"] .tq-menu.has-resume .tq-tag { display: none; }
.tq[data-w="s"][data-h="mid"] .tq-menu.has-resume .tq-logo { width: 38px; height: 38px; }
.tq[data-w="s"][data-h="mid"] .tq-menu.has-resume .tq-playbtn { min-height: 60px; }
.tq[data-w="s"][data-h="mid"] .tq-menu.has-resume .tq-playbtn b { font-size: 24px; }
.tq[data-w="s"][data-h="mid"] .tq-menu.has-resume .tq-resume { min-height: 42px; }
.tq[data-w="s"][data-h="mid"] .tq-menu.has-resume .tq-modes { gap: 6px; }
.tq[data-w="s"][data-h="mid"] .tq-menu.has-resume .tq-mode { min-height: 58px; padding: 4px 10px; row-gap: 1px; }
.tq[data-w="s"][data-h="mid"] .tq-tag { margin-top: 2px !important; font-size: 12.500px; line-height: 1.3; }

/* a phone on its side: the menu splits in two, Play on the left and the six modes on the right */
.tq[data-h="short"] .tq-menu { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.300fr); grid-template-rows: auto auto auto auto; gap: 8px 14px; align-content: center; align-items: center; }
.tq[data-h="short"] .tq-menu::before, .tq[data-h="short"] .tq-menu::after { display: none; }
.tq[data-h="short"] .tq-menu > * { max-width: none; grid-column: 1; }
.tq[data-h="short"] .tq-modes { grid-column: 2; grid-row: 1 / span 4; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tq[data-h="short"] .tq-mode { min-height: 62px; padding: 6px 10px; }
.tq[data-h="short"] .tq-hero { justify-content: flex-start; gap: 10px; }
.tq[data-h="short"] .tq-logo { width: 44px; height: 44px; }
.tq[data-h="short"] .tq-title { font-size: 23px; }
.tq[data-h="short"] .tq-tag { margin-top: 1px !important; font-size: 12.500px; line-height: 1.25; }
.tq[data-h="short"] .tq-playbtn { min-height: 68px; }
.tq[data-h="short"] .tq-playbtn b { font-size: 26px; }
.tq[data-h="short"] .tq-rank { min-height: 50px; padding: 5px 12px; }
.tq[data-h="short"] .tq-rank-go { font-size: 0; }
.tq[data-h="short"] .tq-s { padding: 2px 12px 8px; }

/* a wide, tall stage has room for a bigger welcome */
.tq[data-w="l"][data-h="tall"] .tq-menu > * { max-width: 720px; }
.tq[data-w="l"][data-h="tall"] .tq-menu { gap: 14px; }
.tq[data-w="l"][data-h="tall"] .tq-logo { width: 74px; height: 74px; }
.tq[data-w="l"][data-h="tall"] .tq-title { font-size: 38px; }
.tq[data-w="l"][data-h="tall"] .tq-tag { font-size: 15.500px; }
.tq[data-w="l"][data-h="tall"] .tq-playbtn { min-height: 104px; }
.tq[data-w="l"][data-h="tall"] .tq-playbtn b { font-size: 38px; }
.tq[data-w="l"][data-h="tall"] .tq-playbtn span { font-size: 15px; }
.tq[data-w="l"][data-h="tall"] .tq-mode { min-height: 86px; padding: 11px 14px; }
.tq[data-w="l"][data-h="tall"] .tq-mode b { font-size: 17.500px; }
.tq[data-w="l"][data-h="tall"] .tq-mode span { font-size: 13.500px; }
.tq[data-w="l"][data-h="tall"] .tq-rank { min-height: 64px; padding: 9px 14px; }

/* ---- small states ---- */
.tq-seg-2 button { flex-direction: column; gap: 1px; min-height: 52px; padding: 4px 8px; line-height: 1.15; }
.tq[data-busy] .tq-playbtn, .tq[data-busy] #tq-set-go, .tq[data-busy] .tq-end-btns .tq-btn-main { cursor: progress; animation: tq-wait .7s ease-in-out infinite alternate; }
@keyframes tq-wait { to { filter: brightness(.82); } }
.tq[data-veil="1"] .tq-a-t, .tq[data-veil="1"] .tq-a-pct, .tq[data-veil="1"] .tq-a-bar { visibility: hidden; }
.tq-dots.is-many { gap: 3px; }
.tq-dots.is-many i { max-width: 6px; }
.tq-dots i.is-safe { border-radius: 2px; box-shadow: 0 0 0 1px #ffd166; }
.tq-dots i.is-now.is-safe { box-shadow: 0 0 0 1px #ffd166, 0 0 8px #fff; }
.tq-hint.is-flash { font-size: 16.500px; font-weight: 800; text-align: center; }
.tq-hint.is-flash.is-ok { color: var(--tq-ok); }
.tq-hint.is-flash.is-no { color: var(--tq-bad); }
.tq[data-mode="party"] .tq-prog { color: var(--tq-player, #a9bfe3); }
.tq[data-mode="speed"] .tq-life { height: 100%; justify-content: center; align-content: center; }
.tq[data-mode="speed"] .tq-hint { flex: 0 1 auto; text-align: center; font-size: 14px; }
/* the speed round has no lifelines and no fact to show, so on a small phone its footer gives the room to the question */
.tq[data-mode="speed"][data-w="s"][data-h="mid"] .tq-foot { height: 56px; }
.tq[data-w="s"] .tq-table th:nth-child(n+5), .tq[data-w="s"] .tq-table td:nth-child(n+5) { display: none; }
.tq[data-w="s"] .tq-table { font-size: 13.500px; }
.tq[data-w="s"] .tq-table th, .tq[data-w="s"] .tq-table td { padding-left: 5px; padding-right: 5px; }
.tq[data-w="s"] .tq-table td i { margin-right: 6px; }

@media (prefers-reduced-motion: reduce) {
  .tq-cone, .tq-playbtn::after, .tq-ring.is-low b { animation: none !important; }
  .tq-s.tq-in, .tq-card.is-in, .tq-answers.is-in .tq-a, .tq-a.is-wrong, .tq-a.is-right.is-mine, .tq-reveal, .tq-dlg-box, .tq-streak.is-pop, .tq-score b.is-pop { animation: none !important; }
  .tq-a-bar, .tq-xpbar i, .tq-endbox { transition: none; }
}
