/* Crate Quest - full-window canvases + floating HUD + touch pad + menus / cards. Everything scales with rem / clamp from phones to 4K. */
:root { --cq-acc: #FFB02E; --cq-ink: #0F0C22; --cq-glass: rgba(15, 12, 34, .66); --cq-line: rgba(255, 255, 255, .14); --wc: #FFB02E; --wc2: #FFE08A; }
html { font-size: clamp(14px, calc(9px + .45vw), 26px); height: 100%; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; background: #0F0C22; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.cq { position: fixed; inset: 0; height: 100vh; height: 100dvh; overflow: hidden; background: #0F0C22; color: #fff; --safe-t: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); }
.cq-bg, .cq-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cq-bg { z-index: 0; }
.cq-cv { z-index: 5; touch-action: none; cursor: pointer; }
.cq.is-menu .cq-cv, .cq.is-pause .cq-cv, .cq.is-final .cq-cv { pointer-events: none; }

/* ---------- top tools ---------- */
.cq-top { position: absolute; z-index: 45; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: max(12px, var(--safe-t)) max(14px, var(--safe-r)) 0 max(14px, var(--safe-l)); pointer-events: none; }
.cq-tools { display: flex; gap: 8px; pointer-events: auto; }
.cq-tool { width: 46px; height: 46px; border: 0; padding: 0; display: grid; place-items: center; border-radius: 13px; background: rgba(15, 12, 34, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; transition: background .15s, transform .12s; text-decoration: none; color: #fff; flex: none; cursor: pointer; }
.cq-tool:hover { background: rgba(15, 12, 34, .85); transform: translateY(-1px); }
.cq-tool svg { width: 21px; height: 21px; }
.cq-tool[hidden] { display: none; }
@media (pointer: coarse) { .cq-tool { width: 48px; height: 48px; } .cq-tool--full { display: none; } }

/* ---------- HUD ---------- */
.cq-hud { position: absolute; z-index: 12; left: 50%; transform: translateX(-50%); top: max(12px, var(--safe-t)); display: flex; gap: .5rem; align-items: stretch; justify-content: center; pointer-events: none; color: #fff; font-size: 1rem; }
.cq-hud[hidden] { display: none; }
.cq-chip, .cq-pill { display: grid; align-content: center; justify-items: center; gap: .1em; min-width: 4.2rem; padding: .32em .85em .36em; border-radius: 14px; background: var(--cq-glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 0 0 1.5px var(--cq-line) inset; line-height: 1; text-align: center; }
.cq-chip { background: linear-gradient(180deg, rgba(255, 176, 46, .3), rgba(15, 12, 34, .7)); box-shadow: 0 0 0 1.5px rgba(255, 190, 80, .5) inset; }
.cq-chip small, .cq-pill small { font-size: .54rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: #CFC9F5; max-width: 9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cq-chip b, .cq-pill b { font-family: var(--font-d); font-weight: 400; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.cq-pill em { font-style: normal; position: absolute; }
.cq-pill { position: relative; }
.cq-pill em { position: static; font-size: .58rem; font-weight: 800; color: #FFD88A; margin-top: -.05em; min-height: .6rem; }
.cq-pill.bump b { animation: cqbump .26s var(--ease, ease); }
@keyframes cqbump { 0% { transform: scale(1.25); } 100% { transform: none; } }
.cq-pill--stars { grid-auto-flow: column; gap: .12em; align-items: center; padding: .3em .7em; min-width: 0; }
.cq-pill--stars svg, .cq-stars svg { width: 1.45rem; height: 1.45rem; fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .32); stroke-width: 1.4; transition: fill .25s, transform .25s; }
.cq-pill--stars svg.on, .cq-stars svg.on, .on svg, svg.on { fill: #FFD23F; stroke: #B67A00; }
.cq-pill--stars svg.on { filter: drop-shadow(0 0 5px rgba(255, 210, 63, .7)); }
@media (max-width: 640px) and (orientation: portrait) {
  .cq-hud { top: calc(max(12px, var(--safe-t)) + 56px); gap: .35rem; }
  .cq-chip, .cq-pill { min-width: 3.4rem; padding: .3em .55em .34em; }
  .cq-chip small, .cq-pill small { font-size: .5rem; max-width: 6.5em; }
  .cq-chip b, .cq-pill b { font-size: 1.15rem; }
  .cq-pill--stars svg { width: 1.2rem; height: 1.2rem; }
}

/* ---------- action bar (undo / redo / restart / hint) ---------- */
.cq-bar { position: absolute; z-index: 30; left: 50%; transform: translateX(-50%); bottom: max(14px, var(--safe-b)); display: flex; gap: .6rem; }
.cq-bar[hidden] { display: none; }
.cq-act { position: relative; display: inline-flex; align-items: center; gap: .5em; height: 3.2rem; padding: 0 1rem 0 .8rem; border: 0; border-radius: 16px; color: #fff; background: linear-gradient(180deg, #5B49C8, #3A2C96); box-shadow: 0 .2em 0 #1D1560, 0 0 0 2px rgba(255, 255, 255, .16) inset; font-family: var(--font-d); font-size: .86rem; text-transform: uppercase; cursor: pointer; transition: transform .12s var(--ease, ease), filter .2s; }
.cq-act:hover { transform: translateY(-2px); filter: brightness(1.1); }
.cq-act:active { transform: translateY(3px); box-shadow: 0 0 0 #1D1560, 0 0 0 2px rgba(255, 255, 255, .16) inset; }
.cq-act svg { width: 1.6rem; height: 1.6rem; }
.cq-act--hint { background: linear-gradient(180deg, #E8A21C, #B76A00); box-shadow: 0 .2em 0 #6B3A00, 0 0 0 2px rgba(255, 255, 255, .2) inset; }
.cq-act b { position: absolute; top: -.55rem; right: -.35rem; min-width: 1.5rem; height: 1.5rem; display: grid; place-items: center; padding: 0 .3em; border-radius: 99px; background: #FF3D8B; color: #fff; font-weight: 400; font-size: .8rem; box-shadow: 0 0 0 2px #fff; }
.cq-act[disabled] { filter: grayscale(.8) brightness(.65); cursor: default; pointer-events: none; }
.cq-act .k { font-style: normal; font-family: var(--font-b); font-weight: 800; font-size: .6rem; letter-spacing: 0; padding: .05em .45em; border-radius: 6px; background: rgba(0, 0, 0, .3); display: none; }
@media (hover: hover) and (pointer: fine) { .cq-act .k { display: inline-block; } }

/* ---------- touch slide pad ---------- */
.cq-pad { position: absolute; z-index: 32; right: max(14px, var(--safe-r)); bottom: max(16px, var(--safe-b)); width: min(176px, 34vw); aspect-ratio: 1; touch-action: none; }
.cq-pad[hidden] { display: none; }
.cq-pad-ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(60, 46, 130, .78), rgba(15, 12, 34, .85)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .18) inset, 0 .35em 0 rgba(0, 0, 0, .35), 0 .8em 1.6em rgba(0, 0, 0, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.cq-pad .d { position: absolute; width: 34%; height: 34%; display: grid; place-items: center; color: rgba(255, 255, 255, .8); border-radius: 50%; transition: background .1s, transform .1s, color .1s; }
.cq-pad .d svg { width: 62%; height: 62%; stroke-width: 3; }
.cq-pad .d0 { left: 33%; top: 3%; } .cq-pad .d2 { left: 33%; bottom: 3%; transform: rotate(180deg); } .cq-pad .d1 { right: 3%; top: 33%; transform: rotate(90deg); } .cq-pad .d3 { left: 3%; top: 33%; transform: rotate(-90deg); }
.cq-pad .d.on { background: var(--cq-acc); color: #1b1230; box-shadow: 0 0 1.2em rgba(255, 176, 46, .75); }
.cq-pad .hub { position: absolute; left: 36%; top: 36%; width: 28%; height: 28%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #6B58E0, #2B1F78); box-shadow: 0 0 0 2px rgba(255, 255, 255, .2) inset; }
.cq.pad-left .cq-pad { right: auto; left: max(14px, var(--safe-l)); }
.cq.pad-off .cq-pad { display: none; }
/* touch layout of the action bar: compact icon buttons in a corner */
.cq.touch .cq-bar { left: max(12px, var(--safe-l)); transform: none; bottom: max(16px, var(--safe-b)); display: grid; grid-template-columns: repeat(2, 3.7rem); gap: .5rem; }
.cq.touch.pad-left .cq-bar { left: auto; right: max(12px, var(--safe-r)); }
.cq.touch .cq-act { height: 3.7rem; padding: 0; justify-content: center; }
.cq.touch .cq-act span, .cq.touch .cq-act .k { display: none; }
.cq.touch .cq-act svg { width: 1.9rem; height: 1.9rem; }
@media (orientation: landscape) and (max-height: 520px) {
  .cq.touch .cq-bar { grid-template-columns: repeat(2, 3.1rem); }
  .cq.touch .cq-act { height: 3.1rem; border-radius: 14px; }
  .cq.touch .cq-act svg { width: 1.6rem; height: 1.6rem; }
  .cq-tool { width: 42px; height: 42px; }
}

/* ---------- banner / toast / fade ---------- */
.cq-banner { --bc: #FFB02E; position: absolute; z-index: 20; left: 50%; top: 38%; width: min(92vw, 40em); transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; }
.cq-banner small { display: block; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; font-size: clamp(.7rem, .6rem + .5vw, 1rem); color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .75); }
.cq-banner h2 { margin: .1em 0 .12em; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; line-height: .95; font-size: clamp(2rem, 1rem + 4.6vw, 5rem); color: var(--bc); text-shadow: 0 .05em 0 rgba(20, 10, 50, .7), 0 0 .5em color-mix(in srgb, var(--bc) 55%, transparent), 0 .1em .4em rgba(0, 0, 0, .5); -webkit-text-stroke: .03em rgba(20, 10, 50, .6); paint-order: stroke fill; }
.cq-banner p { display: inline-block; margin: .2em 0 0; padding: .35em 1.1em; border-radius: 99px; background: rgba(15, 12, 34, .7); font-weight: 800; font-size: clamp(.8rem, .6rem + .6vw, 1.15rem); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; }
.cq-banner.show { animation: cqbanner 2.6s var(--ease, ease) forwards; }
@keyframes cqbanner { 0% { opacity: 0; transform: translate(-50%, 24px) scale(.82); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 20% { transform: translate(-50%, 0) scale(1); } 76% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px) scale(1); } }
.cq-toast { position: absolute; z-index: 40; left: 50%; bottom: max(110px, calc(var(--safe-b) + 100px)); transform: translate(-50%, 12px); max-width: min(92vw, 34em); padding: .6em 1.3em; border-radius: 20px; text-align: center; font-weight: 800; font-size: clamp(.85rem, .6rem + .6vw, 1.15rem); background: rgba(15, 12, 34, .9); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .16) inset, 0 .6em 1.6em rgba(0, 0, 0, .4); pointer-events: none; opacity: 0; transition: opacity .3s, transform .3s var(--ease, ease); }
.cq-toast.show { opacity: 1; transform: translate(-50%, 0); }
.cq-toast.new { box-shadow: 0 0 0 2px #FFB02E inset, 0 .6em 1.6em rgba(0, 0, 0, .4); }
.cq-toast.warn { box-shadow: 0 0 0 2px #FF6B6B inset, 0 .6em 1.6em rgba(0, 0, 0, .4); }
.cq.touch .cq-toast { bottom: auto; top: calc(max(12px, var(--safe-t)) + 118px); }
@media (orientation: landscape) { .cq.touch .cq-toast { top: auto; left: max(12px, var(--safe-l)); bottom: calc(max(12px, var(--safe-b)) + 150px); transform: translateY(12px); width: min(240px, 27vw); max-width: none; font-size: .74rem; text-align: left; border-radius: 16px; padding: .5em .8em; } .cq.touch .cq-toast.show { transform: none; } .cq.touch.pad-left .cq-toast { left: auto; right: max(12px, var(--safe-r)); } }
.cq-fade { position: absolute; inset: 0; z-index: 60; background: #0F0C22; opacity: 0; pointer-events: none; transition: opacity .17s; }
.cq-fade.on { opacity: 1; }

/* ---------- overlays ---------- */
.cq-ov { position: absolute; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: max(14px, var(--safe-t)) max(14px, var(--safe-r)) max(14px, var(--safe-b)) max(14px, var(--safe-l)); pointer-events: none; }
.cq-ov.show { display: flex; pointer-events: auto; background: radial-gradient(ellipse at 50% 40%, rgba(15, 12, 34, .5), rgba(8, 5, 24, .82)); animation: cqfade .25s ease; }
.cq-ov.cq-ov--main.show { background: linear-gradient(90deg, rgba(10, 6, 30, .78), rgba(10, 6, 30, .3) 55%, rgba(10, 6, 30, 0)); justify-content: flex-start; padding-left: max(5vw, var(--safe-l)); }
@keyframes cqfade { from { opacity: 0; } to { opacity: 1; } }
.cq-ov--win.show { background: radial-gradient(ellipse at 50% 40%, rgba(15, 12, 34, .35), rgba(8, 5, 24, .7)); }

.cq-btn { --bg: #3A2C96; --fg: #fff; --sh: #1D1560; display: inline-flex; align-items: center; justify-content: center; gap: .55em; font-family: var(--font-d); font-size: 1rem; letter-spacing: .02em; text-transform: uppercase; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 82%, #fff), var(--bg)); color: var(--fg); border: 0; border-radius: 15px; padding: .78em 1.35em; box-shadow: 0 .26em 0 var(--sh), 0 0 0 2px rgba(255, 255, 255, .14) inset; cursor: pointer; transition: transform .12s var(--ease, ease), box-shadow .12s, filter .15s; text-decoration: none; min-height: 3rem; }
.cq-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.cq-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--sh), 0 0 0 2px rgba(255, 255, 255, .14) inset; }
.cq-btn svg { width: 1.3em; height: 1.3em; flex: none; }
.cq-btn svg.f { fill: currentColor; stroke: none; }
.cq-btn--lime { --bg: #C6FF3D; --fg: #0F0C22; --sh: #6F9A00; }
.cq-btn--play { --bg: #FFB02E; --fg: #1b1230; --sh: #B36A00; font-size: 1.6rem; padding: .7em 1.6em; border-radius: 20px; min-height: 4.2rem; }
.cq-btn--sm { font-size: .8rem; padding: .55em 1em; min-height: 2.6rem; border-radius: 12px; }

.cq-card { width: min(94vw, 34rem); max-height: calc(100dvh - 28px); overflow: auto; padding: 1.5rem 1.4rem 1.3rem; border-radius: 26px; text-align: center; background: linear-gradient(180deg, rgba(48, 36, 110, .96), rgba(22, 16, 60, .97)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .14) inset, 0 1.2em 3em rgba(0, 0, 0, .55); animation: cqpop .35s var(--ease, ease); scrollbar-width: thin; }
@keyframes cqpop { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
.cq-card h2 { margin: .1em 0 .4em; font-family: var(--font-d); font-weight: 400; font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem); text-transform: uppercase; line-height: 1; color: var(--wc, #FFB02E); text-shadow: 0 .06em 0 rgba(0, 0, 0, .4), 0 0 .6em color-mix(in srgb, var(--wc, #FFB02E) 40%, transparent); }
.cq-card .kick { display: block; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; font-size: .7rem; color: #CFC9F5; }
.cq-card .lead { margin: 0 0 .9em; color: #E4E0FF; font-weight: 600; font-size: .95rem; line-height: 1.45; }
.cq-card .note { margin: .8em 0 .2em; color: #CFC9F5; font-weight: 700; font-size: .85rem; }
.cq-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1rem; }
.cq-stack { display: grid; gap: .6rem; margin-top: .9rem; }
.cq-stack .cq-btn { width: 100%; }
.cq-stars { display: flex; justify-content: center; gap: .25rem; }
.cq-stars.big svg { width: 4rem; height: 4rem; margin: 0 -.1rem; stroke-width: 1.2; }
.cq-stars svg.pop { animation: cqstar .6s var(--ease, ease) both; filter: drop-shadow(0 0 .5em rgba(255, 210, 63, .85)); }
.cq-stars svg.miss { animation: cqmiss .5s ease both; }
@keyframes cqstar { 0% { transform: scale(.2) rotate(-40deg); } 60% { transform: scale(1.35) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes cqmiss { 0% { opacity: 1; } 100% { opacity: .55; } }
.cq-rows { display: flex; justify-content: center; gap: .6rem; margin-top: .7rem; }
.cq-rows > div { min-width: 5.2rem; padding: .5em .8em; border-radius: 14px; background: rgba(0, 0, 0, .25); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; }
.cq-rows small { display: block; font-size: .56rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: #CFC9F5; }
.cq-rows b { font-family: var(--font-d); font-weight: 400; font-size: 1.5rem; }
.cq-unlock { margin: .6em 0 0; padding: .45em 1em; border-radius: 99px; display: inline-flex; align-items: center; gap: .5em; background: rgba(198, 255, 61, .16); color: #D9FF7A; font-weight: 800; font-size: .85rem; }
.cq-unlock svg { width: 1.1em; height: 1.1em; }
.cq-card--final { width: min(94vw, 38rem); }
.cq-card--final canvas { width: min(100%, 360px); height: auto; margin: -.6rem auto 0; display: block; }

/* main menu */
.cq-main { width: min(92vw, 27rem); animation: cqpop .45s var(--ease, ease); }
.cq-title small { display: block; font-weight: 800; letter-spacing: .26em; text-transform: uppercase; font-size: .7rem; color: #FFE08A; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); margin-bottom: .5rem; }
.cq-title h1 { margin: 0; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; line-height: .86; font-size: clamp(3.4rem, 2rem + 6vw, 7rem); }
.cq-title h1 span { display: block; }
.cq-title h1 span:first-child { color: #FFD27A; background: linear-gradient(180deg, #FFF0B8, #FFB02E 70%, #E07A12); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.cq-title h1 span:last-child { background: linear-gradient(180deg, #FFFFFF, #9FE8FF 60%, #3DB4F0); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-left: .35em; }
.cq-title h1 span { filter: drop-shadow(.025em .045em 0 #3A1F08) drop-shadow(-.012em -.012em 0 #3A1F08) drop-shadow(.012em -.012em 0 #3A1F08) drop-shadow(0 .1em .2em rgba(0, 0, 0, .5)); }
.cq-main-btns { display: grid; gap: .8rem; margin-top: 1.4rem; justify-items: stretch; }
.cq-cont { margin: -.2rem 0 0; text-align: center; font-weight: 800; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #E4E0FF; }
.cq-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.cq-row .cq-btn { font-size: .72rem; padding: .6em .4em; flex-direction: column; gap: .25em; min-height: 3.6rem; }
.cq-row .cq-btn svg { width: 1.5em; height: 1.5em; }
.cq-meta { display: flex; gap: 1rem; margin-top: 1.1rem; font-weight: 700; font-size: .85rem; color: #E4E0FF; }
.cq-meta span { display: inline-flex; align-items: center; gap: .35em; padding: .3em .8em; border-radius: 99px; background: rgba(15, 12, 34, .55); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; }
.cq-meta svg { width: 1.2em; height: 1.2em; fill: #FFD23F; stroke: #B67A00; }
@media (orientation: portrait) and (max-width: 700px) {
  .cq-ov.cq-ov--main.show { align-items: flex-start; background: linear-gradient(180deg, rgba(10, 6, 30, .8), rgba(10, 6, 30, .3) 60%, rgba(10, 6, 30, 0)); justify-content: center; padding-top: calc(max(14px, var(--safe-t)) + 52px); padding-left: max(14px, var(--safe-l)); }
  .cq-main { text-align: center; } .cq-title h1 { font-size: clamp(2.8rem, 14vw, 4.2rem); } .cq-title h1 span:last-child { margin-left: 0; }
  .cq-main-btns { margin-top: .9rem; gap: .55rem; } .cq-btn--play { min-height: 3.4rem; font-size: 1.3rem; } .cq-meta { justify-content: center; margin-top: .7rem; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .cq-title h1 { font-size: clamp(2.6rem, 11vh, 4rem); } .cq-main-btns { margin-top: .8rem; gap: .5rem; } .cq-btn--play { min-height: 3.4rem; font-size: 1.3rem; } .cq-row .cq-btn { min-height: 3rem; flex-direction: row; font-size: .62rem; } .cq-meta { margin-top: .6rem; }
}

/* level map */
.cq-ov--levels.show { align-items: stretch; background: radial-gradient(ellipse at 50% 20%, rgba(15, 12, 34, .55), rgba(8, 5, 24, .9)); overflow: auto; }
.cq-map { width: min(100%, 58rem); margin: auto; animation: cqpop .3s var(--ease, ease); }
.cq-map-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 .2rem .6rem; }
.cq-map-top h2 { margin: 0; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; font-size: clamp(1.6rem, 1rem + 2vw, 2.4rem); }
.cq-tot { display: inline-flex; align-items: center; gap: .35em; padding: .35em .9em; border-radius: 99px; background: rgba(15, 12, 34, .6); font-weight: 700; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; }
.cq-tot b { font-family: var(--font-d); font-weight: 400; } .cq-tot svg { width: 1.3em; height: 1.3em; fill: #FFD23F; stroke: #B67A00; }
.cq-wtabs { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem .2rem .7rem; scrollbar-width: none; scroll-snap-type: x proximity; touch-action: pan-x; }
.cq-wtabs::-webkit-scrollbar { display: none; }
.cq-wt { flex: none; scroll-snap-align: center; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .55em; align-items: center; text-align: left; min-width: 9.5rem; padding: .5em .9em .5em .55em; border: 0; border-radius: 16px; color: #fff; background: rgba(15, 12, 34, .6); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; cursor: pointer; transition: transform .12s, background .15s; }
.cq-wt i { grid-row: 1 / 3; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 12px; font-style: normal; font-family: var(--font-d); font-size: 1.2rem; color: #1b1230; background: linear-gradient(180deg, var(--wc), color-mix(in srgb, var(--wc) 60%, #000)); }
.cq-wt i svg { width: 1.2rem; height: 1.2rem; color: #fff; }
.cq-wt span { font-family: var(--font-d); font-size: .78rem; text-transform: uppercase; line-height: 1.1; }
.cq-wt em { font-style: normal; font-weight: 800; font-size: .7rem; color: #CFC9F5; }
.cq-wt.on { background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 38%, #1b1240), rgba(15, 12, 34, .8)); box-shadow: 0 0 0 2.5px var(--wc) inset, 0 0 1.4em color-mix(in srgb, var(--wc) 40%, transparent); }
.cq-wt.lock { opacity: .6; }
.cq-wcard { display: flex; gap: 1rem; align-items: center; padding: .9rem 1.1rem; border-radius: 22px; background: linear-gradient(100deg, color-mix(in srgb, var(--wc) 30%, rgba(22, 16, 60, .95)), rgba(22, 16, 60, .92)); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; margin: .2rem 0 .9rem; }
.cq-wart canvas { width: 5.4rem; height: 5.4rem; display: block; border-radius: 16px; background: rgba(0, 0, 0, .22); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; }
.cq-wtxt small { font-weight: 800; letter-spacing: .18em; text-transform: uppercase; font-size: .62rem; color: var(--wc2); }
.cq-wtxt h3 { margin: .1em 0 .1em; font-family: var(--font-d); font-weight: 400; font-size: 1.5rem; text-transform: uppercase; color: var(--wc); line-height: 1; }
.cq-wtxt p { margin: 0 0 .25em; font-weight: 700; color: #fff; font-size: .9rem; }
.cq-wtxt em { font-style: normal; font-weight: 600; color: #D6D1F5; font-size: .8rem; line-height: 1.35; display: block; }
.cq-lockmsg { display: flex; gap: .5em; align-items: center; justify-content: center; margin: 0 0 .7rem; color: #FFD88A; font-weight: 800; font-size: .85rem; }
.cq-lockmsg svg { width: 1.1em; height: 1.1em; }
.cq-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .65rem; padding-bottom: .5rem; }
.cq-lv { position: relative; aspect-ratio: 1 / .92; display: grid; align-content: center; justify-items: center; gap: .2em; border: 0; border-radius: 18px; color: #fff; cursor: pointer; background: linear-gradient(180deg, rgba(60, 48, 130, .9), rgba(30, 22, 80, .95)); box-shadow: 0 .24em 0 rgba(10, 6, 40, .8), 0 0 0 1.5px rgba(255, 255, 255, .14) inset; transition: transform .12s var(--ease, ease), filter .15s; min-height: 4.2rem; }
.cq-lv b { font-family: var(--font-d); font-weight: 400; font-size: 1.7rem; line-height: 1; }
.cq-lv b svg { width: 1.3rem; height: 1.3rem; opacity: .6; }
.cq-lv .st { display: flex; gap: 1px; }
.cq-lv .st svg { width: 1rem; height: 1rem; fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .25); stroke-width: 1.4; }
.cq-lv .st svg.on { fill: #FFD23F; stroke: #B67A00; }
.cq-lv.open:hover { transform: translateY(-3px); filter: brightness(1.12); }
.cq-lv.open:active { transform: translateY(3px); }
.cq-lv.done { background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 75%, #fff), color-mix(in srgb, var(--wc) 55%, #1b1240)); color: #1b1230; box-shadow: 0 .24em 0 color-mix(in srgb, var(--wc) 35%, #000), 0 0 0 1.5px rgba(255, 255, 255, .35) inset; }
.cq-lv.cur { animation: cqcur 1.3s ease-in-out infinite; background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 55%, #3a2c96), color-mix(in srgb, var(--wc) 30%, #1b1240)); box-shadow: 0 .24em 0 rgba(10, 6, 40, .8), 0 0 0 2.5px var(--wc) inset; }
@keyframes cqcur { 50% { transform: translateY(-4px); filter: brightness(1.2); } }
.cq-lv.skip::after { content: 'skipped'; position: absolute; top: .25rem; font-size: .5rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; opacity: .75; }
.cq-lv.lock { opacity: .55; cursor: default; }
@media (max-width: 560px) { .cq-grid { grid-template-columns: repeat(5, 1fr); gap: .4rem; } .cq-lv b { font-size: 1.25rem; } .cq-lv .st svg { width: .72rem; height: .72rem; } .cq-wcard { flex-direction: row; padding: .7rem; gap: .7rem; } .cq-wart canvas { width: 4rem; height: 4rem; } .cq-wtxt h3 { font-size: 1.15rem; } .cq-wtxt em { font-size: .72rem; } }
@media (orientation: landscape) and (max-height: 520px) { .cq-ov--levels.show { padding-top: 6px; padding-bottom: 6px; } .cq-map-top { padding-bottom: .2rem; } .cq-wcard { display: none; } .cq-wtabs { padding-bottom: .4rem; } .cq-lv { aspect-ratio: auto; min-height: 3.1rem; } .cq-lv b { font-size: 1.2rem; } }

/* how to play + settings + pause */
.cq-card--how { width: min(94vw, 44rem); }
.cq-how { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem .8rem; text-align: left; margin: .2rem 0 .8rem; }
.cq-how-i { display: flex; gap: .7rem; align-items: center; padding: .45rem .6rem; border-radius: 14px; background: rgba(0, 0, 0, .22); }
.cq-how-i canvas { width: 3rem; height: 3rem; flex: none; border-radius: 10px; }
.cq-how-i b { font-family: var(--font-d); font-weight: 400; font-size: .85rem; text-transform: uppercase; color: #FFD88A; }
.cq-how-i p { margin: .1em 0 0; font-size: .78rem; font-weight: 600; color: #E4E0FF; line-height: 1.3; }
.cq-keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; text-align: left; }
.cq-keys > div { padding: .6rem .8rem; border-radius: 14px; background: rgba(0, 0, 0, .22); }
.cq-keys b { font-family: var(--font-d); font-weight: 400; font-size: .85rem; text-transform: uppercase; color: #9FE8FF; }
.cq-keys p { margin: .2em 0 0; font-size: .8rem; font-weight: 600; color: #E4E0FF; line-height: 1.45; }
kbd { font-family: var(--font-b); font-weight: 800; font-size: .72rem; padding: .08em .45em; border-radius: 6px; background: rgba(255, 255, 255, .16); box-shadow: 0 .1em 0 rgba(0, 0, 0, .35); }
@media (max-width: 600px) { .cq-how, .cq-keys { grid-template-columns: 1fr; } }
.cq-sets { display: grid; gap: .5rem; text-align: left; }
.cq-set { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem .9rem; border: 0; border-radius: 15px; color: #fff; background: rgba(0, 0, 0, .25); cursor: pointer; font-family: var(--font-b); text-align: left; }
.cq-set b { display: block; font-family: var(--font-d); font-weight: 400; font-size: .9rem; text-transform: uppercase; }
.cq-set small { display: block; font-weight: 600; color: #CFC9F5; font-size: .74rem; }
.cq-sw { position: relative; flex: none; width: 3rem; height: 1.7rem; border-radius: 99px; background: #4A4378; transition: background .2s; }
.cq-sw::after { content: ''; position: absolute; left: .2rem; top: .2rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: #fff; transition: transform .2s var(--ease, ease); box-shadow: 0 .1em .3em rgba(0, 0, 0, .4); }
.cq-sw.on { background: #3FD27D; } .cq-sw.on::after { transform: translateX(1.3rem); }
.cq-seg { display: flex; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .18) inset; }
.cq-seg button { border: 0; background: transparent; color: #CFC9F5; padding: .45em .8em; font-weight: 800; font-size: .75rem; cursor: pointer; }
.cq-seg button.on { background: #FFB02E; color: #1b1230; }
.cq-set--q { cursor: default; } .cq-set--danger b { color: #FF8F8F; }

@media (prefers-reduced-motion: reduce) { .cq-banner.show, .cq-lv.cur, .cq-stars svg.pop { animation-duration: .01s; } }

/* hidden must always win over the layout rules above */
.cq .cq-bar[hidden], .cq .cq-pad[hidden], .cq .cq-hud[hidden] { display: none !important; }
@media (orientation: portrait) { .cq-ov--levels.show { align-items: flex-start; padding-top: calc(max(14px, var(--safe-t)) + 52px); } }
.cq-ov, .cq-card, .cq-map { touch-action: pan-y; overscroll-behavior: contain; }
.cq-wtabs { touch-action: pan-x; }
.cq-ov .cq-btn, .cq-ov .cq-lv, .cq-ov .cq-wt, .cq-ov .cq-set, .cq-ov .cq-seg button { touch-action: manipulation; }
