:root { --teal: #39e6c1; --ink: #e8eefc; --muted: #8e9bbd; --panel: rgba(10, 14, 28, 0.72); --line: rgba(160, 180, 230, 0.16); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070a14; color: var(--ink); font-family: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, "Segoe UI", sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
canvas#gl, canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#scene { background: transparent; }
body.no-gl canvas#scene { background: radial-gradient(ellipse at 40% 30%, #1b2140, #070a14 70%); }
body.has-gl canvas#scene { visibility: hidden; }
.layer { position: fixed; inset: 0; }
.hidden { display: none !important; }
.screen { display: grid; place-items: center; padding: 24px; background: rgba(4, 6, 14, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadein .35s ease; overflow: auto; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px 32px; max-width: 560px; width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.panel.wide { max-width: 980px; } .panel.small { max-width: 380px; }
h1, h2 { margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 26px; }
p { line-height: 1.5; color: var(--ink); }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); font-weight: 700; margin-bottom: 10px; }
.title-wrap { text-align: center; max-width: 720px; }
.logo { font-size: clamp(64px, 14vw, 150px); line-height: .88; font-weight: 900; letter-spacing: -0.05em; margin: 8px 0 18px; display: flex; flex-direction: column; align-items: center; }
.logo span:first-child { color: #fff; text-shadow: 0 0 40px rgba(57,230,193,.55), 0 0 2px #fff; }
.logo span:last-child { background: linear-gradient(180deg, #7dfbe0, #39e6c1 60%, #1aa889); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 28px rgba(57,230,193,.45)); }
.tag { color: var(--muted); font-size: 18px; margin: 0 0 28px; }
.menu { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.btn { font: inherit; font-weight: 700; font-size: 17px; color: var(--ink); background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: 14px; padding: 13px 22px; cursor: pointer; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; }
.btn:hover { background: rgba(255,255,255,.13); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: linear-gradient(180deg, #5cf3d1, #2fd3ae); color: #062a22; border-color: transparent; box-shadow: 0 8px 30px rgba(57,230,193,.35); }
.btn.primary:hover { box-shadow: 0 10px 40px rgba(57,230,193,.5); }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.link { background: none; border: 0; color: var(--teal); font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.foot { margin-top: 26px; color: var(--muted); font-size: 14px; display: flex; gap: 18px; justify-content: center; align-items: center; flex-wrap: wrap; }
.toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.sep { width: 1px; height: 16px; background: var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row.gap { justify-content: flex-start; }
table.keys { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: 15px; }
table.keys td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.keys td:first-child { color: var(--muted); width: 130px; font-weight: 600; }
kbd { display: inline-block; font: 600 12px ui-monospace, Menlo, monospace; background: rgba(255,255,255,.1); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; margin-right: 3px; }
.legend { list-style: none; padding: 0; margin: 0 0 18px; font-size: 15px; line-height: 1.6; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 4px; }
.sw.pill { background: linear-gradient(90deg, #ff4d6d 50%, #fff 50%); border-radius: 7px; width: 22px; }
.sw.exit { background: #7dff8e; box-shadow: 0 0 10px #7dff8e; }
.sw.bump { background: #3a4460; border: 2px solid #aab8dd; border-radius: 4px; width: 22px; height: 10px; }
.sw.zap { background: #7df9ff; box-shadow: 0 0 8px #7df9ff; border-radius: 4px; width: 22px; height: 6px; }
.sw.gate { background: #ffb347; border-radius: 4px; width: 22px; height: 8px; }
.sw.switch { background: #ffd166; }
.sw.tele { background: conic-gradient(#c084fc, #f472b6, #c084fc); }
.sw.crumble { background: #c8b8a8; }
.sw.nasty { background: #ff2d55; box-shadow: 0 0 8px #ff2d55; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.level-card { text-align: left; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; color: var(--ink); font: inherit; transition: transform .12s, background .15s; }
.level-card:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); }
.level-card .n { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.level-card .t { font-weight: 800; font-size: 15px; margin: 3px 0; }
.level-card .b { font-size: 12px; color: var(--teal); }
.level-card.done { border-color: rgba(57,230,193,.5); }
.stats { display: flex; gap: 26px; margin: 8px 0 14px; }
.stats div { display: flex; flex-direction: column; } .stats span { font-size: 12px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; } .stats b { font-size: 28px; font-variant-numeric: tabular-nums; }
.board { border-top: 1px solid var(--line); padding-top: 10px; min-height: 40px; font-size: 14px; }
.board .r { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.board .r.me { color: var(--teal); font-weight: 700; }
.board .empty { color: var(--muted); }
.input { width: 100%; font: inherit; color: var(--ink); background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.input:focus { border-color: var(--teal); }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.3; }
textarea.input { resize: vertical; white-space: pre; margin-top: 8px; letter-spacing: .05em; }
.editor-body { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
@media (max-width: 800px) { .editor-body { grid-template-columns: 1fr; } }
.editor-preview { width: 100%; aspect-ratio: 4 / 3; background: radial-gradient(ellipse at 40% 30%, #161c36, #070a14 70%); border-radius: 14px; border: 1px solid var(--line); cursor: crosshair; }
.editor-legend { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; } .editor-legend code { color: var(--ink); }
.report { margin-top: 8px; font-size: 12px; color: var(--teal); white-space: pre-wrap; } .report.bad { color: #ff6b81; }
/* HUD */
#hud { pointer-events: none; }
#hud > div { position: absolute; }
.hud-left { top: 22px; left: 26px; } .hud-right { top: 22px; right: 26px; text-align: right; } .hud-center { top: 22px; left: 50%; transform: translateX(-50%); }
.hud-level { font-size: 12px; letter-spacing: .2em; color: var(--teal); font-weight: 800; }
.hud-name { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.hud-time { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.hud-deaths { font-size: 13px; color: var(--muted); }
.hud-pills { display: flex; gap: 6px; }
.hud-pills i { display: block; width: 22px; height: 11px; border-radius: 6px; background: rgba(255,255,255,.12); border: 1px solid var(--line); transition: all .25s; }
.hud-pills i.on { background: linear-gradient(90deg, #ff4d6d 50%, #fff 50%); box-shadow: 0 0 12px rgba(255,77,109,.7); border-color: transparent; }
.hud-hint { bottom: 30px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 15px; text-align: center; padding: 8px 16px; background: rgba(6,8,16,.5); border-radius: 12px; transition: opacity .6s; white-space: nowrap; max-width: 92vw; white-space: normal; }
.banner { left: 0; right: 0; top: 40%; text-align: center; font-size: clamp(36px, 8vw, 84px); font-weight: 900; letter-spacing: -0.04em; opacity: 0; transform: scale(.9); transition: opacity .3s, transform .3s; text-shadow: 0 0 40px rgba(57,230,193,.6); }
.banner.show { opacity: 1; transform: scale(1); }
.banner.red { color: #ff4d6d; text-shadow: 0 0 40px rgba(255,77,109,.7); }
.touch-controls { display: none; bottom: 0; left: 0; right: 0; height: 30vh; pointer-events: none; }
@media (hover: none) and (pointer: coarse) { .touch-controls { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 18px 24px; } .hud-hint { bottom: 32vh; } }
.touch-btn { pointer-events: auto; width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--line); background: rgba(20,26,48,.55); color: var(--ink); font-size: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; backdrop-filter: blur(8px); }
.touch-btn span { font-size: 10px; letter-spacing: .15em; font-weight: 800; }
.touch-btn:active { background: rgba(57,230,193,.35); }
#btn-grab { width: 120px; height: 120px; border-color: rgba(57,230,193,.6); }
