/* Coil Escape - full-window canvases + floating HUD + menus / cards. Everything scales with rem from phones to 4K. Two layouts: .port (HUD on top, buttons below the board)
   and .land (HUD column left, buttons column right, board in the middle). */
:root { --ce-ink: #0F0C22; --ce-glass: rgba(15, 12, 34, .68); --ce-line: rgba(255, 255, 255, .14); --wc: #9CFF5B; --wc2: #E2FFB8; }
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; }

.ce { 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); }
.ce-probe { position: absolute; width: 0; height: 0; visibility: hidden; 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); pointer-events: none; }
.ce-bg, .ce-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ce-bg { z-index: 0; }
.ce-cv { z-index: 5; touch-action: none; cursor: pointer; }
.ce.is-menu .ce-cv, .ce.is-pause .ce-cv, .ce.is-final .ce-cv, .ce.is-win .ce-cv { pointer-events: none; }

/* ---------- top tools ---------- */
.ce-top { position: absolute; z-index: 45; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: max(10px, var(--safe-t)) max(12px, var(--safe-r)) 0 max(12px, var(--safe-l)); pointer-events: none; }
.ce-tools { display: flex; gap: 8px; pointer-events: auto; }
.ce-tool { width: 3.2rem; height: 3.2rem; border: 0; padding: 0; display: grid; place-items: center; border-radius: 14px; background: rgba(15, 12, 34, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 0 1.5px var(--ce-line) inset; transition: background .15s, transform .12s; text-decoration: none; color: #fff; flex: none; cursor: pointer; }
.ce-tool:hover { background: rgba(15, 12, 34, .88); transform: translateY(-1px); }
.ce-tool svg { width: 1.5rem; height: 1.5rem; }
.ce-tool[hidden] { display: none; }
@media (pointer: coarse) { .ce-tool--full { display: none; } }
.ce.is-menu .ce-tool[data-act="pause"] { display: none; }
.ce.land.short .ce-tool { width: 2.9rem; height: 2.9rem; }

/* ---------- HUD ---------- */
.ce-hud { position: absolute; z-index: 12; display: flex; gap: .5rem; align-items: stretch; justify-content: center; pointer-events: none; color: #fff; font-size: 1rem; }
.ce-hud[hidden] { display: none; }
.ce.port .ce-hud { left: 0; right: 0; top: calc(max(10px, var(--safe-t)) + 3.2rem + 8px); padding: 0 max(8px, var(--safe-r)) 0 max(8px, var(--safe-l)); }
.ce.land .ce-hud { left: max(10px, var(--safe-l)); top: calc(max(10px, var(--safe-t)) + 3.2rem + 10px); flex-direction: column; width: 6.9rem; gap: .42rem; }
.ce.land.short .ce-hud { top: calc(max(10px, var(--safe-t)) + 2.9rem + 6px); gap: .3rem; width: 6.4rem; }
.ce-chip, .ce-pill { display: grid; align-content: center; justify-items: center; gap: .1em; min-width: 4.4rem; padding: .34em .8em .38em; border-radius: 15px; background: var(--ce-glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 0 0 1.5px var(--ce-line) inset; line-height: 1; text-align: center; position: relative; }
.ce-chip { background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 34%, rgba(15, 12, 34, .7)), rgba(15, 12, 34, .72)); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--wc) 65%, transparent) inset; }
.ce-chip small, .ce-pill small { font-size: .54rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: #CFC9F5; white-space: nowrap; }
.ce-chip b, .ce-pill b { font-family: var(--font-d); font-weight: 400; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.ce-pill em { font-style: normal; font-size: .56rem; font-weight: 800; color: #FFE08A; margin-top: -.05em; white-space: nowrap; min-height: .6rem; }
.ce-pill.bump b { animation: cebump .26s var(--ease, ease); }
@keyframes cebump { 0% { transform: scale(1.3); } 100% { transform: none; } }
.ce-pill--fruit .fr { display: flex; align-items: center; gap: .15em; }
.ce-pill--fruit canvas { width: 1.5rem; height: 1.5rem; display: block; }
.ce-pill--stars { grid-auto-flow: column; gap: .12em; align-items: center; padding: .3em .7em; min-width: 0; }
.ce-pill--stars svg, .ce-bigstars 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; }
.ce-pill--stars svg.on, .ce-bigstars svg.on { fill: #FFD23F; stroke: #B67A00; }
.ce-pill--stars svg.on { filter: drop-shadow(0 0 5px rgba(255, 210, 63, .7)); }
.ce.port .ce-chip, .ce.port .ce-pill { min-width: 0; flex: 1 1 0; padding: .3em .35em .34em; max-width: 6.6rem; }
.ce.port .ce-chip b, .ce.port .ce-pill b { font-size: 1.2rem; }
.ce.port .ce-chip small, .ce.port .ce-pill small { font-size: .5rem; letter-spacing: .1em; }
.ce.port .ce-pill--stars { flex: 0 0 auto; }
.ce.port .ce-pill--stars svg { width: 1.15rem; height: 1.15rem; }
.ce.land .ce-chip, .ce.land .ce-pill { width: 100%; }
.ce.land.short .ce-chip b, .ce.land.short .ce-pill b { font-size: 1.05rem; }
.ce.land.short .ce-chip, .ce.land.short .ce-pill { padding: .22em .5em .26em; }
.ce.land.short .ce-pill--stars { display: none; }

/* ---------- action bar (undo / restart / hint) ---------- */
.ce-bar { position: absolute; z-index: 30; display: flex; gap: .6rem; }
.ce-bar[hidden] { display: none; }
.ce.port .ce-bar { left: 50%; transform: translateX(-50%); bottom: max(14px, var(--safe-b)); }
.ce.land .ce-bar { right: max(12px, var(--safe-r)); top: 50%; transform: translateY(-46%); flex-direction: column; width: 4.6rem; }
.ce.land.short .ce-bar { top: calc(max(10px, var(--safe-t)) + 3.4rem); transform: none; gap: .4rem; width: 4.1rem; }
.ce-act { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em; height: 3.6rem; padding: 0 1.1rem 0 .9rem; border: 0; border-radius: 17px; 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: .82rem; text-transform: uppercase; cursor: pointer; transition: transform .12s var(--ease, ease), filter .2s; }
.ce-act:hover { transform: translateY(-2px); filter: brightness(1.1); }
.ce-act:active { transform: translateY(3px); box-shadow: 0 0 0 #1D1560, 0 0 0 2px rgba(255, 255, 255, .16) inset; }
.ce-act svg { width: 1.6rem; height: 1.6rem; flex: none; }
.ce-act--hint { background: linear-gradient(180deg, #E8A21C, #B76A00); box-shadow: 0 .2em 0 #6B3A00, 0 0 0 2px rgba(255, 255, 255, .2) inset; }
.ce-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; }
.ce-act[disabled] { filter: grayscale(.8) brightness(.62); cursor: default; pointer-events: none; }
.ce-act.pulse { animation: cepulse .7s ease 3; }
@keyframes cepulse { 50% { transform: scale(1.12); filter: brightness(1.4); } }
.ce-act .k { font-style: normal; font-family: var(--font-b); font-weight: 800; font-size: .6rem; padding: .05em .45em; border-radius: 6px; background: rgba(0, 0, 0, .3); display: none; }
@media (hover: hover) and (pointer: fine) { .ce-act .k { display: inline-block; } }
.ce.port.touch .ce-bar { gap: .7rem; }
.ce.port.touch .ce-act { min-width: 5.2rem; }
.ce.land .ce-act { flex-direction: column; height: 4.4rem; padding: 0; gap: .15em; font-size: .62rem; }
.ce.land .ce-act svg { width: 1.5rem; height: 1.5rem; }
.ce.land .ce-act .k { display: none !important; }
.ce.land.short .ce-act { height: 3.3rem; border-radius: 14px; font-size: .55rem; }
.ce.land.short .ce-act svg { width: 1.25rem; height: 1.25rem; }
.ce.land.short .ce-act span { display: none; }

/* ---------- tip bubble, dead-end sheet, skip ---------- */
.ce-tip { position: absolute; z-index: 20; left: 50%; transform: translate(-50%, 10px); max-width: min(92vw, 30rem); padding: .6em 1.2em; border-radius: 18px; text-align: center; font-weight: 800; font-size: clamp(.82rem, .65rem + .5vw, 1.08rem); line-height: 1.35; background: rgba(15, 12, 34, .88); box-shadow: 0 0 0 2px color-mix(in srgb, var(--wc) 70%, transparent) inset, 0 .6em 1.6em rgba(0, 0, 0, .4); pointer-events: none; opacity: 0; transition: opacity .35s, transform .35s var(--ease, ease); }
.ce-tip.show { opacity: 1; transform: translate(-50%, 0); }
.ce.port .ce-tip { bottom: calc(max(14px, var(--safe-b)) + 3.6rem + 16px); }
.ce.land .ce-tip { bottom: max(10px, var(--safe-b)); max-width: min(56vw, 30rem); }
.ce-dead { position: absolute; z-index: 35; left: 50%; transform: translate(-50%, 16px); display: grid; justify-items: center; gap: .3rem; padding: .7rem 1rem .8rem; border-radius: 20px; text-align: center; background: linear-gradient(180deg, rgba(70, 30, 70, .96), rgba(30, 14, 50, .97)); box-shadow: 0 0 0 2px #FF6B8B inset, 0 .8em 2em rgba(0, 0, 0, .5); opacity: 0; transition: opacity .3s, transform .3s var(--ease, ease); max-width: min(92vw, 24rem); }
.ce-dead[hidden] { display: none; }
.ce-dead.show { opacity: 1; transform: translate(-50%, 0); }
.ce-dead b { font-family: var(--font-d); font-weight: 400; text-transform: uppercase; font-size: 1.1rem; color: #FF9EB5; }
.ce-dead span { font-weight: 700; font-size: .82rem; color: #F0E8FF; }
.ce-dead > div { display: flex; gap: .5rem; margin-top: .25rem; }
.ce.port .ce-dead { bottom: calc(max(14px, var(--safe-b)) + 3.6rem + 20px); }
.ce.land .ce-dead { bottom: max(14px, var(--safe-b)); }
.ce-skip { position: absolute; z-index: 31; display: inline-flex; align-items: center; gap: .4em; border: 0; border-radius: 99px; padding: .45em 1em; font-family: var(--font-d); font-size: .7rem; text-transform: uppercase; color: #fff; background: rgba(15, 12, 34, .75); box-shadow: 0 0 0 1.5px var(--ce-line) inset; cursor: pointer; }
.ce-skip[hidden] { display: none; }
.ce-skip svg { width: 1.1rem; height: 1.1rem; }
.ce.port .ce-skip { left: 50%; transform: translateX(-50%); bottom: calc(max(14px, var(--safe-b)) + 3.6rem + 66px); }
.ce.land .ce-skip { right: max(12px, var(--safe-r)); bottom: max(10px, var(--safe-b)); }

/* ---------- banner / toast / fade ---------- */
.ce-banner { --bc: #9CFF5B; position: absolute; z-index: 20; left: 50%; top: 17%; width: min(92vw, 40em); transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; }
.ce.port .ce-banner { top: calc(max(10px, var(--safe-t)) + 3.2rem + 8px + 3.6rem + 22px); }
.ce.land .ce-banner { top: 5%; } .ce.land .ce-banner h2 { font-size: clamp(1.5rem, .8rem + 2.4vw, 3rem); } .ce.land .ce-banner p { font-size: .8rem; padding: .25em .9em; }
.ce-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); }
.ce-banner h2 { margin: .1em 0 .12em; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; line-height: .95; font-size: clamp(1.9rem, 1rem + 3.4vw, 4rem); 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; }
.ce-banner p { display: inline-block; margin: .2em 0 0; padding: .35em 1.1em; border-radius: 99px; background: rgba(15, 12, 34, .72); font-weight: 800; font-size: clamp(.8rem, .6rem + .6vw, 1.15rem); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; }
.ce-banner.show { animation: cebanner 2.4s var(--ease, ease) forwards; }
@keyframes cebanner { 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); } }
.ce-toast { position: absolute; z-index: 40; left: 50%; transform: translate(-50%, 12px); max-width: min(92vw, 34em); padding: .55em 1.2em; border-radius: 20px; text-align: center; font-weight: 800; font-size: clamp(.82rem, .6rem + .6vw, 1.12rem); background: rgba(15, 12, 34, .92); 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); }
.ce.port .ce-toast { top: calc(max(10px, var(--safe-t)) + 3.2rem + 8px + 3.6rem + 14px); }
.ce.land .ce-toast { top: max(14px, var(--safe-t)); }
.ce-toast.show { opacity: 1; transform: translate(-50%, 0); }
.ce-toast.tip { box-shadow: 0 0 0 2px var(--wc) inset, 0 .6em 1.6em rgba(0, 0, 0, .4); }
.ce-toast.warn { box-shadow: 0 0 0 2px #FF6B6B inset, 0 .6em 1.6em rgba(0, 0, 0, .4); }
.ce-fade { position: absolute; inset: 0; z-index: 60; background: #0F0C22; opacity: 0; pointer-events: none; transition: opacity .17s; }
.ce-fade.on { opacity: 1; }

/* ---------- overlays ---------- */
.ce-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; }
.ce-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: cefade .25s ease; }
.ce-ov.ce-ov--menu.show { background: radial-gradient(ellipse at 50% 45%, rgba(10, 6, 30, .12), rgba(8, 4, 26, .5) 95%); }
.ce-ov.ce-ov--win.show { background: radial-gradient(ellipse at 50% 40%, rgba(15, 12, 34, .3), rgba(8, 5, 24, .7)); }
.ce-ov.ce-ov--final.show { background: radial-gradient(ellipse at 50% 45%, rgba(15, 12, 34, .35), rgba(8, 5, 24, .78)); }
@keyframes cefade { from { opacity: 0; } to { opacity: 1; } }

.ce-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: 16px; padding: .75em 1.3em; 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; touch-action: manipulation; }
.ce-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.ce-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--sh), 0 0 0 2px rgba(255, 255, 255, .14) inset; }
.ce-btn svg { width: 1.3em; height: 1.3em; flex: none; }
.ce-btn svg.f { fill: currentColor; stroke: none; }
.ce-btn em { font-style: normal; color: inherit; opacity: .8; font-size: .82em; margin-left: .2em; }
.ce-btn--big { --bg: var(--wc); --fg: #14102F; --sh: color-mix(in srgb, var(--wc) 45%, #000); font-size: 1.55rem; padding: .62em 1.5em; border-radius: 20px; min-height: 4.2rem; }
.ce-btn--ghost { --bg: #2B2266; --sh: #150F40; }
.ce-btn--sm { font-size: .78rem; padding: .5em .95em; min-height: 2.5rem; border-radius: 12px; }

/* main menu */
.ce-menu { display: grid; justify-items: center; align-content: center; gap: 1.2rem; width: min(92vw, 26rem); text-align: center; animation: cepop .5s var(--ease, ease); }
.ce-logo-sup, .ce-sup { display: block; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; font-size: .72rem; color: var(--wc2); text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.ce-logo h1 { margin: .2rem 0 0; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; line-height: .84; font-size: clamp(3.4rem, 2rem + 7vw, 7.6rem); }
.ce-logo h1 span { display: block; filter: drop-shadow(.03em .05em 0 #0A2A10) drop-shadow(-.012em -.012em 0 #0A2A10) drop-shadow(.012em -.012em 0 #0A2A10) drop-shadow(0 .12em .24em rgba(0, 0, 0, .55)); }
.ce-logo h1 .a { background: linear-gradient(180deg, #F4FFD0, var(--wc) 62%, color-mix(in srgb, var(--wc) 55%, #064)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: .06em; }
.ce-logo h1 .b { background: linear-gradient(180deg, #FFFFFF, #FFC8EC 55%, #FF5BA8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-size: .74em; letter-spacing: .02em; margin-top: .06em; }
.ce-logo p { margin: .8rem 0 0; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; color: #E8E4FF; text-shadow: 0 2px 8px rgba(0, 0, 0, .7); }
.ce-mbtns { display: grid; gap: .7rem; width: 100%; }
.ce-mrow { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ce-mrow .ce-btn { font-size: .78rem; padding: .6em .5em; min-height: 3.2rem; }
.ce-mfoot { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; font-weight: 800; font-size: .82rem; color: #E8E4FF; }
.ce-mfoot > span { display: inline-flex; align-items: center; gap: .4em; padding: .3em .9em; border-radius: 99px; background: rgba(15, 12, 34, .6); box-shadow: 0 0 0 1.5px var(--ce-line) inset; }
.ce-mfoot svg { width: 1.2em; height: 1.2em; fill: #FFD23F; stroke: #B67A00; stroke-width: 1.4; }
.ce-mfoot b { font-family: var(--font-d); font-weight: 400; }
@media (orientation: landscape) and (max-height: 540px) {
  .ce-menu { gap: .6rem; } .ce-logo h1 { font-size: clamp(2.4rem, 12vh, 4.2rem); } .ce-logo p { margin-top: .4rem; } .ce-btn--big { min-height: 3.4rem; font-size: 1.25rem; } .ce-mrow .ce-btn { min-height: 2.6rem; }
}

/* panels (levels, skins, how, settings) */
.ce.port .ce-ov--panel.show { padding-top: calc(max(10px, var(--safe-t)) + 3.4rem + 10px); }
.ce-ov--panel.show { align-items: flex-start; overflow-y: auto; touch-action: pan-y; background: radial-gradient(ellipse at 50% 20%, rgba(15, 12, 34, .55), rgba(8, 5, 24, .92)); }
.ce-panel { width: min(100%, 52rem); margin: auto; animation: cepop .3s var(--ease, ease); display: grid; gap: .8rem; }
.ce-ph { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem; }
.ce-ph > :first-child { justify-self: start; } .ce-ph > :last-child { justify-self: end; }
.ce-ph h2 { margin: 0; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; font-size: clamp(1.5rem, 1rem + 2vw, 2.4rem); color: #fff; text-shadow: 0 .06em 0 rgba(0, 0, 0, .4); }
.ce-tot { display: inline-flex; align-items: center; gap: .3em; padding: .35em .9em; border-radius: 99px; background: rgba(15, 12, 34, .6); font-weight: 700; box-shadow: 0 0 0 1.5px var(--ce-line) inset; }
.ce-tot b { font-family: var(--font-d); font-weight: 400; } .ce-tot em { font-style: normal; opacity: .65; font-size: .8em; }
.ce-tot svg { width: 1.3em; height: 1.3em; fill: #FFD23F; stroke: #B67A00; stroke-width: 1.4; }
.ce-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; }
.ce-tab { display: grid; justify-items: center; gap: .25em; padding: .5em .2em .55em; border: 0; border-radius: 15px; color: #fff; background: rgba(15, 12, 34, .6); box-shadow: 0 0 0 1.5px var(--ce-line) inset; cursor: pointer; transition: transform .12s, background .15s; touch-action: manipulation; }
.ce-tab i { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 11px; font-style: normal; font-family: var(--font-d); font-size: 1.05rem; color: #14102F; background: linear-gradient(180deg, var(--wc2), var(--wc)); }
.ce-tab span { font-family: var(--font-d); font-size: .6rem; text-transform: uppercase; line-height: 1.05; text-align: center; opacity: .85; }
.ce-tab.on { background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 36%, #1b1240), rgba(15, 12, 34, .85)); box-shadow: 0 0 0 2.5px var(--wc) inset, 0 0 1.4em color-mix(in srgb, var(--wc) 40%, transparent); }
.ce-tab.on span { opacity: 1; }
.ce-wban { display: grid; gap: .1rem; padding: .8rem 1rem; border-radius: 20px; background: linear-gradient(100deg, color-mix(in srgb, var(--wc) 26%, rgba(22, 16, 60, .95)), rgba(22, 16, 60, .92)); box-shadow: 0 0 0 1.5px var(--ce-line) inset; position: relative; }
.ce-wban h3 { margin: 0; font-family: var(--font-d); font-weight: 400; font-size: 1.4rem; text-transform: uppercase; color: var(--wc); line-height: 1.05; }
.ce-wban p { margin: .15em 6.5rem .1em 0; font-weight: 600; color: #E4E0FF; font-size: .84rem; line-height: 1.35; }
.ce-wst { position: absolute; right: .9rem; top: .8rem; display: inline-flex; align-items: center; gap: .3em; font-family: var(--font-d); font-size: .9rem; }
.ce-wst svg { width: 1.2em; height: 1.2em; fill: #FFD23F; stroke: #B67A00; stroke-width: 1.4; }
.ce-lgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .65rem; padding-bottom: .4rem; }
.ce-lvl { position: relative; display: grid; align-content: center; justify-items: center; gap: .15em; min-height: 5.2rem; padding: .4rem .2rem .45rem; border: 0; border-radius: 18px; color: #fff; cursor: pointer; background: linear-gradient(180deg, rgba(60, 48, 130, .92), rgba(30, 22, 80, .96)); box-shadow: 0 .24em 0 rgba(10, 6, 40, .8), 0 0 0 1.5px var(--ce-line) inset; transition: transform .12s var(--ease, ease), filter .15s; touch-action: manipulation; }
.ce-lvl b { font-family: var(--font-d); font-weight: 400; font-size: 1.7rem; line-height: 1; }
.ce-lvl > svg { width: 1.5rem; height: 1.5rem; opacity: .6; }
.ce-lvl small { font-weight: 800; font-size: .6rem; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.ce-lstars { display: flex; gap: 1px; }
.ce-lstars svg { width: 1.05rem; height: 1.05rem; fill: rgba(255, 255, 255, .14); stroke: rgba(255, 255, 255, .25); stroke-width: 1.4; }
.ce-lstars svg.on { fill: #FFD23F; stroke: #B67A00; }
.ce-lvl:not(.lock):hover { transform: translateY(-3px); filter: brightness(1.12); }
.ce-lvl:not(.lock):active { transform: translateY(3px); }
.ce-lvl.done { background: linear-gradient(180deg, color-mix(in srgb, var(--wc) 78%, #fff), color-mix(in srgb, var(--wc) 52%, #1b1240)); color: #14102F; box-shadow: 0 .24em 0 color-mix(in srgb, var(--wc) 35%, #000), 0 0 0 1.5px rgba(255, 255, 255, .35) inset; }
.ce-lvl.cur { animation: cecur 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 cecur { 50% { transform: translateY(-4px); filter: brightness(1.2); } }
.ce-lvl.lock { opacity: .5; cursor: default; }
@media (min-width: 760px) { .ce-lgrid { grid-template-columns: repeat(6, 1fr); } .ce-tab span { font-size: .72rem; } }
@media (orientation: landscape) and (max-height: 520px) { .ce-ov--panel.show { padding-top: 8px; padding-bottom: 8px; } .ce-panel { gap: .45rem; } .ce-wban { display: none; } .ce-lgrid { grid-template-columns: repeat(6, 1fr); gap: .4rem; } .ce-lvl { min-height: 3.9rem; } .ce-lvl b { font-size: 1.2rem; } .ce-tab { padding: .3em .2em .35em; } .ce-tab span { display: none; } }

/* skins */
.ce-note { margin: 0; text-align: center; color: #CFC9F5; font-weight: 700; font-size: .85rem; }
.ce-sgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
@media (min-width: 700px) { .ce-sgrid { grid-template-columns: repeat(3, 1fr); } }
.ce-skin { display: grid; justify-items: center; gap: .15em; padding: .6rem .6rem .7rem; border: 0; border-radius: 20px; color: #fff; cursor: pointer; background: rgba(15, 12, 34, .6); box-shadow: 0 0 0 1.5px var(--ce-line) inset; transition: transform .12s; touch-action: manipulation; }
.ce-skin:hover { transform: translateY(-2px); }
.ce-skin canvas { width: 100%; height: auto; border-radius: 14px; display: block; }
.ce-skin b { font-family: var(--font-d); font-weight: 400; text-transform: uppercase; font-size: .95rem; margin-top: .35em; }
.ce-skin small { font-weight: 800; font-size: .72rem; color: #CFC9F5; display: inline-flex; align-items: center; gap: .3em; }
.ce-skin small svg { width: 1em; height: 1em; }
.ce-skin.on { box-shadow: 0 0 0 3px #9CFF5B inset, 0 0 1.4em rgba(156, 255, 91, .35); } .ce-skin.on small { color: #C6FF3D; }
.ce-skin.lock canvas { filter: grayscale(.9) brightness(.55); }

/* how to play */
.ce-hlist { display: grid; grid-template-columns: 1fr; gap: .55rem; }
@media (min-width: 760px) { .ce-hlist { grid-template-columns: 1fr 1fr; } }
.ce-hrow { display: flex; gap: .8rem; align-items: center; padding: .55rem .7rem; border-radius: 18px; background: rgba(15, 12, 34, .62); box-shadow: 0 0 0 1.5px var(--ce-line) inset; text-align: left; }
.ce-hrow canvas { width: 3.8rem; height: 3.8rem; flex: none; border-radius: 14px; }
.ce-hrow h4 { margin: 0 0 .15em; font-family: var(--font-d); font-weight: 400; font-size: .92rem; text-transform: uppercase; color: #FFE08A; }
.ce-hrow p { margin: 0; font-size: .8rem; font-weight: 600; color: #E4E0FF; line-height: 1.38; }

/* settings */
.ce-set { max-width: 34rem; }
.ce-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; border: 0; border-radius: 16px; color: #fff; background: rgba(15, 12, 34, .62); box-shadow: 0 0 0 1.5px var(--ce-line) inset; cursor: pointer; font-family: var(--font-d); font-size: .92rem; text-transform: uppercase; text-align: left; touch-action: manipulation; }
.ce-row--q { cursor: default; }
.ce-row--danger .rl { color: #FF8F8F; }
.sw { position: relative; flex: none; width: 3rem; height: 1.7rem; border-radius: 99px; background: #4A4378; transition: background .2s; }
.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); }
.sw.on { background: #3FD27D; } .sw.on::after { transform: translateX(1.3rem); }
.segs { display: flex; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .18) inset; }
.ce-seg { border: 0; background: transparent; color: #CFC9F5; padding: .45em .85em; font-family: var(--font-b); font-weight: 800; font-size: .76rem; cursor: pointer; }
.ce-seg.on { background: var(--wc); color: #14102F; }

/* cards (pause, level clear) */
.ce-card { width: min(94vw, 30rem); max-height: calc(100dvh - 28px); overflow: auto; padding: 1.4rem 1.3rem 1.3rem; border-radius: 28px; 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: cepop .35s var(--ease, ease); scrollbar-width: thin; touch-action: pan-y; }
@keyframes cepop { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
.ce-card h2 { margin: .1em 0 .3em; font-family: var(--font-d); font-weight: 400; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.2rem); text-transform: uppercase; line-height: 1; color: var(--wc); text-shadow: 0 .06em 0 rgba(0, 0, 0, .4), 0 0 .6em color-mix(in srgb, var(--wc) 40%, transparent); }
.ce-sub { margin: .2em 0 .6em; color: #E4E0FF; font-weight: 700; font-size: .95rem; line-height: 1.4; }
.ce-bigstars { display: flex; justify-content: center; gap: .3rem; margin: .2rem 0 .3rem; }
.ce-bigstars svg { width: 4.2rem; height: 4.2rem; stroke-width: 1.2; margin: 0 -.1rem; }
.ce-bigstars svg.pop { animation: cestar .6s var(--ease, ease) both; filter: drop-shadow(0 0 .5em rgba(255, 210, 63, .85)); }
@keyframes cestar { 0% { transform: scale(.2) rotate(-40deg); } 60% { transform: scale(1.35) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
.ce-bigstars.big { align-items: center; gap: .5rem; } .ce-bigstars.big svg { animation: cestar .8s var(--ease, ease) both; fill: #FFD23F; stroke: #B67A00; filter: drop-shadow(0 0 .6em rgba(255, 210, 63, .8)); }
.ce-bigstars.big b { font-family: var(--font-d); font-weight: 400; font-size: 3rem; } .ce-bigstars.big em { font-style: normal; font-weight: 800; opacity: .75; }
.ce-stats { display: flex; justify-content: center; gap: .6rem; margin: .6rem 0 .2rem; }
.ce-stats > 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; }
.ce-stats small { display: block; font-size: .56rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: #CFC9F5; }
.ce-stats b { font-family: var(--font-d); font-weight: 400; font-size: 1.5rem; }
.ce-flag { display: inline-block; margin-top: .5em; padding: .3em 1em; border-radius: 99px; background: rgba(255, 210, 63, .18); color: #FFE066; font-weight: 800; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.ce-unlock { margin: .6em 0 0; padding: .45em 1em; border-radius: 99px; display: flex; align-items: center; justify-content: center; gap: .5em; background: rgba(198, 255, 61, .16); color: #D9FF7A; font-weight: 800; font-size: .85rem; }
.ce-unlock i { width: .9em; height: .9em; border-radius: 50%; background: linear-gradient(135deg, #9CFF5B, #2FD6FF); }
.ce-cbtns { display: grid; gap: .6rem; margin-top: 1rem; }
.ce-cbtns .ce-btn { width: 100%; }
.ce-ov--win.show { align-items: center; }
.ce-final { display: grid; justify-items: center; gap: .3rem; text-align: center; max-width: min(92vw, 38rem); animation: cepop .6s var(--ease, ease); }
.ce-final h1 { margin: .1em 0; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; line-height: .95; font-size: clamp(2.8rem, 1.4rem + 7vw, 6.4rem); }
.ce-final h1 .a { background: linear-gradient(180deg, #F4FFD0, #9CFF5B 62%, #1CA85A); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ce-final h1 .b { background: linear-gradient(180deg, #FFFFFF, #FFC8EC 55%, #FF5BA8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ce-final h1 span { filter: drop-shadow(.03em .05em 0 #0A2A10) drop-shadow(0 .12em .24em rgba(0, 0, 0, .55)); }
.ce-final .ce-cbtns { width: min(100%, 24rem); } .ce-final .ce-btn--big { font-size: 1.2rem; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .ce-banner.show, .ce-lvl.cur, .ce-bigstars svg.pop, .ce-act.pulse { animation-duration: .01s; } }
.ce .ce-bar[hidden], .ce .ce-hud[hidden], .ce .ce-dead[hidden], .ce .ce-skip[hidden] { display: none !important; }
.ce-ov, .ce-card, .ce-panel { overscroll-behavior: contain; }

/* short landscape (phones): compact win card + finale + pause */
@media (orientation: landscape) and (max-height: 520px) {
  .ce-card.ce-win { width: min(96vw, 40rem); display: grid; grid-template-columns: 1.1fr 1fr; column-gap: 1rem; align-items: center; padding: .9rem 1.1rem; }
  .ce-card.ce-win h2 { font-size: 1.9rem; margin-bottom: .1em; }
  .ce-card.ce-win .ce-bigstars svg { width: 3rem; height: 3rem; }
  .ce-card.ce-win .ce-sub { font-size: .8rem; margin: .1em 0 .3em; }
  .ce-card.ce-win .ce-stats { margin: .3rem 0 0; } .ce-card.ce-win .ce-stats > div { min-width: 4rem; padding: .3em .5em; } .ce-card.ce-win .ce-stats b { font-size: 1.15rem; }
  .ce-card.ce-win .ce-cbtns { margin-top: 0; gap: .45rem; } .ce-card.ce-win .ce-btn--big { font-size: 1.15rem; min-height: 3.2rem; }
  .ce-card.ce-win .ce-flag { margin-top: .3em; font-size: .7rem; }
  .ce-final h1 { font-size: clamp(2rem, 17vh, 3.4rem); } .ce-final h1 span { display: inline; } .ce-final .ce-sub { font-size: .8rem; margin: .1em 0; }
  .ce-final .ce-bigstars.big svg { width: 2.4rem; height: 2.4rem; } .ce-final .ce-bigstars.big b { font-size: 2rem; }
  .ce-final .ce-cbtns { grid-template-columns: 1fr 1fr; width: min(100%, 34rem); margin-top: .5rem; } .ce-final .ce-btn--big { font-size: .95rem; min-height: 3rem; }
  .ce-card:not(.ce-win) .ce-cbtns { grid-template-columns: 1fr 1fr; } .ce-card:not(.ce-win) .ce-cbtns .ce-btn--big { grid-column: 1 / -1; }
  .ce-card:not(.ce-win) h2 { font-size: 2rem; }
}
