/* Snake Quest - two canvases (baked ground + live scene), a HUD that is a top bar on tall screens and a left column on wide screens, menus and cards.
   Scales with rem from phones to 4K. Touch UI (the optional d-pad) only exists on touch devices. */
:root { --acc: #7CE04A; --hot: #FF4D6A; --gold: #FFD23F; --ink: #0F0C22; --glass: rgba(15, 12, 34, .68); }
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; }
.sq { 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); --pw: clamp(190px, 22vw, 320px); }
.sq-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; will-change: transform; }
#sqGround { z-index: 0; pointer-events: none; }
#sqMain { z-index: 2; touch-action: none; }
.sq-probe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
svg { flex: none; }

/* ---------- buttons ---------- */
.sq-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font-family: var(--font-d); font-weight: 400; font-size: 1rem; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; color: #fff; border: 0; border-radius: 16px; padding: .78em 1.3em; cursor: pointer; background: linear-gradient(180deg, #4A3F8F, #2E2660); box-shadow: 0 .24em 0 #130E34, 0 0 0 2px rgba(255, 255, 255, .12) inset, 0 .5em 1em rgba(0, 0, 0, .25); transition: transform .12s var(--ease), box-shadow .12s var(--ease), filter .15s; }
.sq-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.sq-btn:active { transform: translateY(.2em); box-shadow: 0 0 0 #130E34, 0 0 0 2px rgba(255, 255, 255, .12) inset; }
.sq-btn svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sq-btn em { font-style: normal; opacity: .8; font-size: .8em; margin-left: .2em; }
.sq-btn--hot { background: linear-gradient(180deg, #7EE85A, #2FB33B); color: #0E2A10; box-shadow: 0 .24em 0 #14661E, 0 0 0 2px rgba(255, 255, 255, .35) inset, 0 .5em 1em rgba(47, 179, 59, .35); }
.sq-btn--big { font-size: 1.3rem; padding: .8em 1.7em; border-radius: 20px; }
.sq-btn--sm { font-size: .78rem; padding: .62em 1em; border-radius: 12px; }
.sq-btn.on { background: linear-gradient(180deg, #FF6B79, #E0243D); }
.sq-btn[disabled] { filter: grayscale(.7) brightness(.7); pointer-events: none; }

/* ---------- HUD ---------- */
.sq-hud { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.sq-hud[hidden] { display: none; }
.sq-panel { position: absolute; left: 0; right: 0; top: 0; padding: max(8px, var(--safe-t)) max(10px, var(--safe-r)) 0 max(10px, var(--safe-l)); display: grid; gap: .45rem; }
.sq-panel > * { pointer-events: auto; }
.sq-tools { display: flex; gap: .45rem; align-items: center; }
.sq-tool { width: 44px; height: 44px; border: 0; padding: 0; display: grid; place-items: center; border-radius: 14px; background: var(--glass); 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; }
.sq-tool:hover { background: rgba(15, 12, 34, .9); transform: translateY(-1px); }
.sq-tool svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sq-tool--r { margin-left: auto; }
.sq-ttl { flex: 1; min-width: 0; text-align: center; line-height: 1.05; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); padding: .3rem .6rem .34rem; border-radius: 14px; background: rgba(15, 12, 34, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); order: 0; }
.sq-ttl small { display: block; font-weight: 800; font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: var(--acc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-ttl b { display: block; font-family: var(--font-d); font-weight: 400; font-size: 1.05rem; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-info { display: grid; gap: .4rem; pointer-events: none; }
.sq-info > * { pointer-events: auto; }
.sq-goal { display: flex; align-items: center; gap: .6rem; padding: .35rem .7rem .4rem .45rem; border-radius: 16px; background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; }
.sq-goal-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.sq-goal-ic canvas { width: 100%; height: 100%; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.sq-goal-ic svg { width: 28px; height: 28px; fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; color: var(--gold); }
.sq-goal-main { flex: 1; min-width: 0; display: grid; gap: .28rem; }
.sq-goal-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; line-height: 1; }
.sq-goal-top span { font-size: .6rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #CFC9F5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-goal-top b { font-family: var(--font-d); font-weight: 400; font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sq-bar { position: relative; height: 9px; border-radius: 9px; background: rgba(255, 255, 255, .14); overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25) inset; }
.sq-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 9px; background: linear-gradient(90deg, #7EE85A, #D6FF5A); transition: width .25s var(--ease); }
.sq-bar i.rv { display: none; top: auto; height: 4px; bottom: 0; background: linear-gradient(90deg, #FF6A8A, #FF9A5A); }
.sq-goal.rival .sq-bar { height: 12px; } .sq-goal.rival .sq-bar i:not(.rv) { height: 8px; bottom: auto; } .sq-goal.rival .sq-bar i.rv { display: block; }
.sq-bump, .bump { animation: sqbump .26s var(--ease); }
@keyframes sqbump { 0% { transform: scale(1.18); } 100% { transform: none; } }
.sq-stats { display: flex; gap: .4rem; align-items: stretch; }
.sq-pill { flex: 1; display: grid; align-content: center; justify-items: center; gap: .12em; min-width: 3.6rem; padding: .3em .6em .34em; border-radius: 14px; background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; line-height: 1; text-align: center; }
.sq-pill small { font-size: .52rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: #CFC9F5; }
.sq-pill b { font-family: var(--font-d); font-weight: 400; font-size: 1.1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sq-pill.timed b { color: #9CE8FF; } .sq-pill.low b { color: #FF6A6A; animation: sqblink .5s steps(2) infinite; }
@keyframes sqblink { 50% { opacity: .45; } }
.sq-rate { flex: 0 0 auto; display: flex; gap: .08rem; align-items: center; padding: .25em .5em; min-width: 0; }
.sq-rate svg { width: 1.2rem; height: 1.2rem; fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .32); stroke-width: 1.4; transition: fill .25s, transform .25s; }
.sq-rate svg.on { fill: #FFD23F; stroke: #B67A00; transform: scale(1.1); filter: drop-shadow(0 0 5px rgba(255, 210, 63, .7)); }
.sq-rate svg.ok { fill: rgba(255, 210, 63, .55); stroke: #FFD23F; }
.sq-rate svg.lost { fill: rgba(255, 70, 70, .22); stroke: rgba(255, 110, 110, .55); }
.sq-chips { display: flex; gap: .4rem; flex-wrap: wrap; pointer-events: none; min-height: 0; }
.sq-chip { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: .45rem; align-items: center; padding: .25rem .6rem .3rem .3rem; border-radius: 14px; background: var(--glass); box-shadow: 0 0 0 1.5px var(--c) inset; animation: sqchip .3s var(--ease); min-width: 6rem; }
@keyframes sqchip { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.sq-chip span { grid-row: 1 / 3; width: 30px; height: 30px; } .sq-chip canvas { width: 100%; height: 100%; }
.sq-chip b { font-family: var(--font-d); font-weight: 400; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; }
.sq-chip i { height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .15); overflow: hidden; display: block; margin-top: .2rem; } .sq-chip u { display: block; height: 100%; background: var(--c); transform-origin: left; text-decoration: none; }
.sq-combo { position: absolute; z-index: 14; left: 50%; bottom: calc(max(14px, var(--safe-b)) + 6px); transform: translate(-50%, 20px) scale(.8); opacity: 0; transition: transform .2s var(--ease), opacity .2s; display: grid; justify-items: center; gap: .25rem; pointer-events: none; }
.sq-combo.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.sq-combo b { font-family: var(--font-d); font-weight: 400; font-size: 1.6rem; color: #FFD23F; text-shadow: 0 2px 0 #8A4B00, 0 0 18px rgba(255, 210, 63, .6); }
.sq-combo i { width: 5.5rem; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .18); overflow: hidden; display: block; } .sq-combo u { display: block; height: 100%; background: linear-gradient(90deg, #FFD23F, #FF8A3D); transform-origin: left; text-decoration: none; }
.sq.has-pad .sq-combo { bottom: auto; top: 50%; }
.sq-pad { position: absolute; z-index: 13; left: 50%; bottom: calc(max(10px, var(--safe-b)) + 6px); transform: translateX(-50%); width: min(260px, 62vw); aspect-ratio: 1.45; display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; pointer-events: none; }
.sq-pad[hidden] { display: none; }
.sq-pad button { pointer-events: auto; border: 0; border-radius: 18px; background: var(--glass); box-shadow: 0 0 0 2px rgba(255, 255, 255, .18) inset; display: grid; place-items: center; touch-action: none; }
.sq-pad button:active { background: rgba(124, 224, 74, .5); }
.sq-pad svg { width: 38%; height: 38%; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sq-pad button[data-d="3"] { grid-column: 2; grid-row: 1; } .sq-pad button[data-d="2"] { grid-column: 1; grid-row: 2; } .sq-pad button[data-d="1"] { grid-column: 2; grid-row: 2; } .sq-pad button[data-d="0"] { grid-column: 3; grid-row: 2; }

/* wide screens: HUD is a left column */
.sq.wide .sq-panel { right: auto; bottom: 0; width: var(--pw); padding-bottom: max(12px, var(--safe-b)); align-content: start; gap: .6rem; grid-template-rows: none; }
.sq.wide .sq-tools { flex-wrap: wrap; } .sq.wide .sq-ttl { order: 5; flex-basis: 100%; padding: .5rem .8rem .55rem; } .sq.wide .sq-ttl b { font-size: 1.35rem; white-space: normal; }
.sq.wide .sq-info { gap: .6rem; min-width: 0; } .sq.wide .sq-panel > * { min-width: 0; } .sq.wide .sq-stats { flex-wrap: wrap; } .sq.wide .sq-pill { flex: 1 1 0; min-width: 0; padding: .45em .6em .5em; } .sq.wide .sq-pill b { font-size: 1.35rem; } .sq.wide .sq-rate { flex-basis: 100%; justify-content: center; padding: .4em .6em; } .sq.wide .sq-rate svg { width: 1.6rem; height: 1.6rem; }
.sq.wide .sq-goal { padding: .5rem .8rem .55rem .55rem; } .sq.wide .sq-goal-ic { width: 46px; height: 46px; } .sq.wide .sq-goal-top b { font-size: 1.35rem; }
.sq.wide .sq-chips { flex-direction: column; } .sq.wide .sq-combo { left: calc(var(--pw) + (100% - var(--pw)) / 2); bottom: auto; top: calc(max(8px, var(--safe-t)) + 4px); transform: translate(-50%, -14px) scale(.8); } .sq.wide .sq-combo.on { transform: translate(-50%, 0) scale(1); }
.sq.wide .sq-pad { left: auto; right: calc(max(12px, var(--safe-r)) + 6px); transform: none; bottom: calc(max(10px, var(--safe-b)) + 6px); width: min(230px, 28vh * 1.45 + 40px); }
@media (max-height: 460px) { .sq.wide .sq-panel { --pw: clamp(162px, 25vw, 230px); gap: .35rem; } .sq.wide .sq-tools { gap: .25rem; flex-wrap: wrap; } .sq.wide .sq-tool { width: 30px; height: 30px; border-radius: 11px; } .sq.wide .sq-tool svg { width: 17px; height: 17px; } .sq.wide .sq-ttl small { display: none; } .sq.wide .sq-ttl b { font-size: .8rem; white-space: normal; line-height: 1.1; } .sq.wide .sq-ttl { padding: .3rem .6rem; } .sq.wide .sq-rate { padding: .2em .4em; } .sq.wide .sq-goal { padding: .3rem .5rem .35rem .4rem; gap: .4rem; } .sq.wide .sq-goal-top span { font-size: .5rem; } .sq.wide .sq-pill small { font-size: .45rem; } .sq.wide .sq-pill { padding: .25em .4em .3em; } .sq.wide .sq-pill b { font-size: 1rem; } .sq.wide .sq-ttl b { font-size: 1rem; } .sq.wide .sq-rate svg { width: 1.2rem; height: 1.2rem; } .sq.wide .sq-goal-top b { font-size: 1rem; } .sq.wide .sq-goal-ic { width: 34px; height: 34px; } .sq.wide .sq-info { gap: .35rem; } }
@media (max-width: 460px) { .sq:not(.wide) .sq-pill b { font-size: .98rem; } .sq:not(.wide) .sq-tool { width: 40px; height: 40px; } .sq:not(.wide) .sq-goal { padding: .25rem .6rem .3rem .35rem; } .sq:not(.wide) .sq-goal-ic { width: 32px; height: 32px; } .sq:not(.wide) .sq-info { gap: .3rem; } .sq:not(.wide) .sq-panel { gap: .35rem; } .sq:not(.wide) .sq-pill small { font-size: .5rem; } .sq:not(.wide) .sq-chip { min-width: 5rem; } }

/* ---------- ready card, banner, toast ---------- */
.sq-ready { position: absolute; z-index: 11; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .25s; padding: 0 1rem; }
.sq-ready.on { opacity: 1; }
.sq-rd-card { text-align: center; max-width: min(23rem, 88vw); padding: .9rem 1.2rem 1rem; border-radius: 22px; background: rgba(15, 12, 34, .74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 0 2px rgba(255, 255, 255, .14) inset, 0 12px 40px rgba(0, 0, 0, .45); animation: sqrise .45s var(--ease); }
@keyframes sqrise { from { transform: translateY(14px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.sq-rd-card small { font-weight: 800; font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--acc); }
.sq-rd-card h2 { margin: .1rem 0 .25rem; font-family: var(--font-d); font-weight: 400; font-size: 1.45rem; line-height: 1.05; }
.sq-rd-card .g { margin: 0 0 .5rem; font-weight: 800; font-size: .95rem; color: #fff; }
.sq-rd-card .h { margin: .55rem 0 0; font-size: .8rem; line-height: 1.35; color: #D6D1FF; font-weight: 600; }
.sq-rd-card .go { margin-top: .65rem; font-family: var(--font-d); font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: #0E2A10; background: linear-gradient(180deg, #8CF06A, #3DC447); border-radius: 12px; padding: .5em .9em; display: inline-block; animation: sqpulse 1.1s ease-in-out infinite; }
@keyframes sqpulse { 50% { transform: scale(1.06); } }
.sq-crit { list-style: none; margin: 0; padding: 0; display: grid; gap: .22rem; text-align: left; font-size: .8rem; font-weight: 700; color: #E4E0FF; }
.sq-crit li { display: flex; align-items: center; gap: .5rem; } .sq-crit li span { width: 1.15rem; height: 1.15rem; display: grid; place-items: center; flex: none; } .sq-crit svg { width: 100%; height: 100%; fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .4); stroke-width: 1.4; } .sq-crit svg.on { fill: #FFD23F; stroke: #B67A00; }
.sq-crit.lg { font-size: .9rem; gap: .35rem; margin: .5rem 0 .2rem; } .sq-crit.lg li { opacity: 0; transform: translateX(-10px); animation: sqin .4s var(--ease) forwards; animation-delay: var(--d); } .sq-crit.lg li.ok { color: #B8FFA0; } .sq-crit.lg li.ok svg { stroke: #8CF06A; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; } .sq-crit.lg li:not(.ok) { color: #A9A3D8; }
@keyframes sqin { to { opacity: 1; transform: none; } }
.sq-banner { position: absolute; z-index: 15; left: 50%; top: 13%; transform: translate(-50%, 10px) scale(.9); opacity: 0; pointer-events: none; text-align: center; transition: none; }
.sq-banner.show { animation: sqban 2s var(--ease) forwards; }
.sq-banner b { display: block; font-family: var(--font-d); font-weight: 400; font-size: 1.9rem; color: var(--bc); text-shadow: 0 3px 0 rgba(0, 0, 0, .5), 0 0 24px rgba(0, 0, 0, .6); white-space: nowrap; } .sq-banner small { display: block; margin-top: .2rem; font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .8); }
@media (max-aspect-ratio: 11/10) { .sq-banner { top: 24%; } }
@keyframes sqban { 0% { opacity: 0; transform: translate(-50%, 14px) scale(.8); } 14% { opacity: 1; transform: translate(-50%, 0) scale(1.06); } 22% { transform: translate(-50%, 0) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -16px) scale(1); } }
.sq-toast { position: absolute; z-index: 16; left: 50%; bottom: calc(max(18px, var(--safe-b)) + 10px); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; max-width: min(28rem, 90vw); text-align: center; font-weight: 700; font-size: .85rem; line-height: 1.35; padding: .6rem 1rem; border-radius: 14px; background: rgba(15, 12, 34, .88); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .18) inset, 0 10px 30px rgba(0, 0, 0, .4); transition: opacity .25s, transform .25s var(--ease); }
.sq-toast.show { opacity: 1; transform: translate(-50%, 0); } .sq-toast.new { box-shadow: 0 0 0 2px var(--acc) inset, 0 10px 30px rgba(0, 0, 0, .4); } .sq-toast.warn { box-shadow: 0 0 0 2px #FF6A5A inset, 0 10px 30px rgba(0, 0, 0, .4); }
.sq-fade { position: absolute; inset: 0; z-index: 30; background: #0F0C22; opacity: 0; pointer-events: none; transition: opacity .16s; } .sq-fade.on { opacity: 1; pointer-events: auto; }

/* ---------- overlays ---------- */
.sq-ov { position: absolute; inset: 0; z-index: 20; display: none; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: max(14px, var(--safe-t)) max(14px, var(--safe-r)) max(14px, var(--safe-b)) max(14px, var(--safe-l)); }
.sq-ov.on { display: flex; flex-direction: column; align-items: center; justify-content: safe center; animation: sqfade .3s ease; }
@keyframes sqfade { from { opacity: 0; } to { opacity: 1; } }
.sq-ov.menu { background: radial-gradient(ellipse at 50% 45%, rgba(15, 12, 34, .5), rgba(15, 12, 34, .86) 80%); }
.sq-ov.levels, .sq-ov.skins, .sq-ov.how, .sq-ov.settings { background: linear-gradient(180deg, rgba(15, 12, 34, .94), rgba(24, 19, 56, .97)); }
.sq-ov.pause, .sq-ov.result, .sq-ov.fail { background: rgba(10, 8, 28, .66); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.sq-ov.final { background: radial-gradient(ellipse at 50% 50%, rgba(10, 8, 28, .45), rgba(10, 8, 28, .1) 80%); }
.sq-menu { display: grid; justify-items: center; gap: 1rem; text-align: center; width: min(26rem, 100%); }
.sq-logo { display: grid; line-height: .86; font-family: var(--font-d); text-transform: uppercase; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .35)); }
.sq-logo .a { font-size: clamp(3.2rem, 15vw, 7rem); background: linear-gradient(180deg, #E6FF7A, #7CE04A 55%, #2FA14B); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 2px rgba(10, 60, 20, .55); }
.sq-logo .b { font-size: clamp(2.5rem, 11.5vw, 5.4rem); background: linear-gradient(180deg, #FFF0A0, #FFB62A 60%, #FF7A2E); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 2px rgba(110, 50, 0, .55); letter-spacing: .04em; }
.sq-tag { margin: -.2rem 0 .2rem; font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #E4E0FF; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.sq-main-btns { display: grid; gap: .8rem; width: 100%; justify-items: center; }
.sq-row { display: flex; gap: .7rem; flex-wrap: wrap; justify-content: center; width: 100%; } .sq-row > .sq-btn { flex: 1 1 auto; }
.sq-col { display: grid; gap: .8rem; justify-items: center; width: 100%; } .sq-col > .sq-btn--big { width: 100%; }
.sq-total { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .9rem; color: #CFC9F5; padding: .4rem .9rem; border-radius: 99px; background: rgba(15, 12, 34, .6); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; }
.sq-total b { color: #fff; font-family: var(--font-d); font-weight: 400; } .sq-total svg { width: 1.2rem; height: 1.2rem; fill: rgba(255, 255, 255, .15); stroke: rgba(255, 255, 255, .35); } .sq-total svg.on, .sq-ws svg.on { fill: #FFD23F; stroke: #B67A00; } .sq-total.sm { padding: .3rem .7rem; font-size: .8rem; }
.sq-sheet { width: min(46rem, 100%); display: grid; gap: .8rem; align-content: start; } .sq-sheet.sm { width: min(30rem, 100%); }
.sq-sh-top { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; } .sq-sh-top h2 { margin: 0; font-family: var(--font-d); font-weight: 400; font-size: 1.4rem; text-align: center; }
.sq-note { margin: 0; text-align: center; color: #CFC9F5; font-weight: 700; font-size: .85rem; }
.sq-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.sq-tab { position: relative; height: 2.6rem; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .08); color: #fff; font-family: var(--font-d); font-size: 1.1rem; cursor: pointer; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; overflow: hidden; }
.sq-tab i { position: absolute; inset: auto 0 0 0; height: 4px; background: var(--c); opacity: .5; } .sq-tab.on { background: color-mix(in srgb, var(--c) 28%, #1B1545); box-shadow: 0 0 0 2px var(--c) inset; } .sq-tab.on i { opacity: 1; height: 6px; } .sq-tab.lk { opacity: .45; }
.sq-world { border-radius: 24px; padding: 1rem; background: linear-gradient(160deg, color-mix(in srgb, var(--o0) 80%, #000), var(--o1)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent) inset, 0 12px 40px rgba(0, 0, 0, .35); }
.sq-world-h { display: grid; gap: .1rem; margin-bottom: .8rem; position: relative; } .sq-world-h small { font-weight: 800; font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--c); } .sq-world-h h3 { margin: 0; font-family: var(--font-d); font-weight: 400; font-size: 1.6rem; line-height: 1.05; } .sq-world-h p { margin: 0; color: #E4E0FF; font-weight: 600; font-size: .85rem; }
.sq-ws { position: absolute; right: 0; top: 0; display: inline-flex; align-items: center; gap: .3rem; font-family: var(--font-d); font-size: .9rem; } .sq-ws svg { width: 1.2rem; height: 1.2rem; stroke: #B67A00; }
.sq-lv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.sq-lv { position: relative; display: grid; justify-items: center; align-content: center; gap: .15rem; padding: .7rem .3rem .6rem; min-height: 6.4rem; border: 0; border-radius: 18px; color: #fff; cursor: pointer; background: linear-gradient(180deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .06)); box-shadow: 0 .2em 0 rgba(0, 0, 0, .35), 0 0 0 1.5px rgba(255, 255, 255, .16) inset; transition: transform .12s var(--ease), filter .15s; }
.sq-lv:hover { transform: translateY(-2px); filter: brightness(1.12); } .sq-lv:active { transform: translateY(2px); }
.sq-lv b { font-family: var(--font-d); font-weight: 400; font-size: 1.6rem; line-height: 1; } .sq-lv .st { display: flex; gap: 1px; height: .95rem; } .sq-lv .st svg { width: .95rem; height: .95rem; fill: rgba(255, 255, 255, .16); stroke: rgba(255, 255, 255, .3); stroke-width: 1.4; } .sq-lv .st svg.on { fill: #FFD23F; stroke: #B67A00; } .sq-lv .st .lk { width: 1rem; height: 1rem; fill: none; stroke: #fff; stroke-width: 2; opacity: .7; }
.sq-lv em { font-style: normal; font-weight: 800; font-size: .62rem; color: #E8E4FF; text-align: center; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .2rem; } .sq-lv small { font-weight: 700; font-size: .58rem; color: #B9B3E8; }
.sq-lv.cur { box-shadow: 0 .2em 0 rgba(0, 0, 0, .35), 0 0 0 2.5px var(--c) inset, 0 0 22px color-mix(in srgb, var(--c) 55%, transparent); animation: sqglow 1.8s ease-in-out infinite; }
@keyframes sqglow { 50% { filter: brightness(1.18); } }
.sq-lv.gold { background: linear-gradient(180deg, rgba(255, 210, 63, .32), rgba(255, 210, 63, .1)); } .sq-lv.lk { opacity: .5; filter: grayscale(.4); cursor: default; }
.sq-lv.boss { background: linear-gradient(180deg, rgba(255, 90, 110, .38), rgba(255, 90, 110, .1)); box-shadow: 0 .2em 0 rgba(0, 0, 0, .35), 0 0 0 2px rgba(255, 110, 130, .7) inset; } .sq-lv .crown { position: absolute; top: .3rem; right: .35rem; width: 1.1rem; height: 1.1rem; color: #FFD23F; } .sq-lv .crown svg { width: 100%; height: 100%; }
.sq-skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .7rem; }
.sq-skin { display: grid; justify-items: center; gap: .15rem; padding: .6rem .5rem .6rem; border: 0; border-radius: 20px; color: #fff; cursor: pointer; background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05)); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; transition: transform .12s var(--ease); }
.sq-skin:hover { transform: translateY(-2px); } .sq-skin canvas { width: 100%; height: auto; aspect-ratio: 240 / 130; border-radius: 14px; background: radial-gradient(circle at 40% 30%, #49B561, #1E6A3A); } .sq-skin b { font-family: var(--font-d); font-weight: 400; font-size: .95rem; } .sq-skin small { font-weight: 700; font-size: .72rem; color: #B9B3E8; display: inline-flex; gap: .25rem; align-items: center; } .sq-skin small svg { width: .8rem; height: .8rem; fill: none; stroke: currentColor; stroke-width: 2.2; }
.sq-skin.on { box-shadow: 0 0 0 3px #8CF06A inset, 0 0 22px rgba(140, 240, 106, .4); } .sq-skin.on small { color: #8CF06A; } .sq-skin.lk { opacity: .55; cursor: default; } .sq-skin.lk canvas { filter: grayscale(1) brightness(.5); }
.sq-how { display: grid; gap: .6rem; } .sq-how-i { display: grid; grid-template-columns: 4.2rem 1fr; gap: .8rem; align-items: center; padding: .65rem .8rem; border-radius: 18px; background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; }
.sq-how-i .ic { display: grid; place-items: center; min-height: 3.2rem; } .sq-how-i .ic img, .sq-how-i .ic canvas { width: 3.2rem; height: 3.2rem; } .sq-how-i .ic svg { width: 2.2rem; height: 2.2rem; fill: none; stroke: #FFD23F; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; color: #FFD23F; } .sq-how-i .ic.pw { grid-template-columns: 1fr 1fr; gap: 2px; } .sq-how-i .ic.pw img { width: 1.9rem; height: 1.9rem; } .sq-how-i .ic.stars { display: flex; } .sq-how-i .ic.stars svg { width: 1.3rem; height: 1.3rem; fill: #FFD23F; stroke: #B67A00; stroke-width: 1.4; }
.sq-how-i b { font-family: var(--font-d); font-weight: 400; font-size: 1rem; } .sq-how-i p { margin: .15rem 0 0; font-size: .85rem; line-height: 1.4; color: #D6D1FF; font-weight: 600; }
.sq-sets { display: grid; gap: .6rem; } .sq-set { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem .8rem; border-radius: 16px; background: rgba(255, 255, 255, .07); font-weight: 800; }
.sq-seg { display: inline-flex; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .16) inset; } .sq-seg button { border: 0; background: transparent; color: #CFC9F5; padding: .5em .9em; font-weight: 800; font-size: .85rem; cursor: pointer; } .sq-seg button.on { background: linear-gradient(180deg, #7EE85A, #2FB33B); color: #0E2A10; }
.sq-reset { justify-self: center; margin-top: .4rem; }
.sq-card { width: min(24rem, 100%); display: grid; gap: .55rem; justify-items: center; text-align: center; padding: 1.2rem 1.2rem 1.3rem; border-radius: 28px; background: linear-gradient(180deg, #2A2260, #1A1445); box-shadow: 0 0 0 2px rgba(255, 255, 255, .14) inset, 0 20px 60px rgba(0, 0, 0, .55); animation: sqrise .4s var(--ease); }
.sq-card small { font-weight: 800; font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--acc); } .sq-card h2 { margin: 0; font-family: var(--font-d); font-weight: 400; font-size: 1.9rem; line-height: 1.05; }
.sq-big-stars { display: flex; gap: .3rem; margin: .3rem 0 .1rem; } .sq-big-stars svg { width: 3.8rem; height: 3.8rem; fill: rgba(255, 255, 255, .1); stroke: rgba(255, 255, 255, .25); stroke-width: 1.2; } .sq-big-stars svg:nth-child(2) { transform: translateY(-.6rem); } .sq-big-stars svg.on { fill: #FFD23F; stroke: #B67A00; filter: drop-shadow(0 0 12px rgba(255, 210, 63, .8)); } .sq-big-stars svg.pop { animation: sqstar .6s var(--ease); } .sq-big-stars.gold svg { fill: #FFD23F; stroke: #B67A00; filter: drop-shadow(0 0 12px rgba(255, 210, 63, .8)); animation: sqstar .8s var(--ease) both; }
@keyframes sqstar { 0% { transform: scale(.2) rotate(-40deg); } 60% { transform: scale(1.35) rotate(8deg); } 100% { transform: none; } }
.sq-stat-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; width: 100%; margin: .3rem 0; } .sq-stat-g > div { padding: .45rem .3rem; border-radius: 14px; background: rgba(255, 255, 255, .08); display: grid; gap: .1rem; position: relative; } .sq-stat-g small { font-size: .54rem; letter-spacing: .12em; color: #B9B3E8; } .sq-stat-g b { font-family: var(--font-d); font-weight: 400; font-size: 1.15rem; font-variant-numeric: tabular-nums; } .sq-stat-g em { position: absolute; top: -.55rem; left: 50%; transform: translateX(-50%); font-style: normal; font-weight: 800; font-size: .58rem; background: #FF3D8B; border-radius: 99px; padding: .15em .6em; white-space: nowrap; }
.sq-unl { margin: 0; font-weight: 800; color: #8CF06A; font-size: .85rem; }
.sq-res.boss h2 { color: #FFD23F; } .sq-fail h2 { color: #FF8A8A; } .sq-fail .tip, .sq-final .tip { margin: 0; color: #D6D1FF; font-weight: 600; font-size: .85rem; line-height: 1.4; } .sq-fail .pg { margin: 0; font-family: var(--font-d); font-size: .95rem; }
.sq-prog { width: 100%; height: 12px; border-radius: 12px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: .2rem; } .sq-prog i { display: block; height: 100%; background: linear-gradient(90deg, #FF8A5A, #FFD23F); border-radius: 12px; }
.sq-final h2 { font-size: 2.3rem; background: linear-gradient(180deg, #FFF0A0, #FFB62A); -webkit-background-clip: text; background-clip: text; color: transparent; } .sq-fin-t { margin: 0; font-weight: 800; line-height: 1.5; } .sq-fin-t b { font-family: var(--font-d); font-weight: 400; font-size: 1.4rem; color: #FFD23F; }

/* tall narrow phones / short wide phones */
@media (max-height: 460px) {
  .sq-logo .a { font-size: clamp(2.2rem, 12vh, 4rem); } .sq-logo .b { font-size: clamp(1.8rem, 9.5vh, 3.2rem); } .sq-menu { gap: .6rem; } .sq-btn--big { font-size: 1.05rem; padding: .6em 1.4em; } .sq-tag { display: none; }
  .sq-ov.on { padding-top: max(8px, var(--safe-t)); padding-bottom: max(8px, var(--safe-b)); } .sq-card { padding: .8rem 1rem 1rem; gap: .35rem; } .sq-card h2 { font-size: 1.4rem; } .sq-big-stars svg { width: 2.6rem; height: 2.6rem; } .sq-stat-g b { font-size: .95rem; } .sq-crit.lg { font-size: .8rem; gap: .2rem; margin: .2rem 0; }
  .sq-lv { min-height: 4.8rem; padding: .4rem .2rem .4rem; } .sq-lv b { font-size: 1.2rem; } .sq-lv small { display: none; } .sq-world { padding: .7rem; } .sq-world-h { margin-bottom: .5rem; } .sq-world-h h3 { font-size: 1.2rem; } .sq-sheet { gap: .5rem; } .sq-rd-card { padding: .6rem 1rem .7rem; } .sq-rd-card h2 { font-size: 1.2rem; } .sq-rd-card .h { font-size: .68rem; margin-top: .3rem; }
  .sq-banner b { font-size: 1.4rem; }
}
@media (max-width: 380px) { .sq-lv-grid { gap: .4rem; } .sq-lv em { font-size: .56rem; } .sq-big-stars svg { width: 3.2rem; height: 3.2rem; } }
@media (min-width: 900px) and (min-height: 600px) { .sq-lv-grid { gap: .8rem; } .sq-lv { min-height: 7.2rem; } .sq-sheet { width: min(52rem, 100%); } }
@media (prefers-reduced-motion: reduce) { .sq-ready, .sq-card, .sq-rd-card, .sq-banner.show, .sq-lv.cur, .sq-rd-card .go { animation: none !important; } .sq-banner.show { opacity: 1; } }
