@font-face { font-family: "Outfit"; font-weight: 300; src: url("/lab/vendor/fonts/outfit/outfit-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 400; src: url("/lab/vendor/fonts/outfit/outfit-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; src: url("/lab/vendor/fonts/outfit/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; src: url("/lab/vendor/fonts/outfit/outfit-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 700; src: url("/lab/vendor/fonts/outfit/outfit-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 400; src: url("/lab/vendor/fonts/dm-mono/dm-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 500; src: url("/lab/vendor/fonts/dm-mono/dm-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #05080f; --panel: rgba(9, 20, 36, 0.72); --line: rgba(120, 200, 230, 0.16);
  --cyan: #5fe6e6; --amber: #ffab4a; --pink: #ff5aa8; --tx: #e3ecf6; --dim: #8ea3bc;
  --cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font: "Outfit", var(--cn); --mono: "DM Mono", var(--cn);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--tx); font-family: var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#nogl { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 32px; text-align: center; font-size: 17px; line-height: 1.7; color: var(--tx); }
#nogl[hidden] { display: none; }
#ui { position: fixed; inset: 0; pointer-events: none; transition: opacity .35s; }
#ui.off { opacity: 0; }
#ui.off * { pointer-events: none !important; }
#ui > * { pointer-events: auto; }

#hero { position: absolute; left: 28px; top: 24px; width: 318px; pointer-events: none; }
#hero .cards, #hero .narr { pointer-events: auto; }
.kicker { font: 600 11px/1 var(--font); letter-spacing: .2em; color: var(--cyan); opacity: .85; }
h1 { margin: 10px 0 8px; font: 700 31px/1.18 var(--font); letter-spacing: .02em; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
h1 span { display: block; }
h1 .acc { color: var(--amber); }
.hook { margin: 0 0 14px; font-size: 13px; line-height: 1.6; color: #c3d2e4; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px 7px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card .lab { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.card .val { margin-top: 4px; font: 500 19px/1 var(--mono); color: var(--cyan); white-space: nowrap; }
.card .val i { font-style: normal; font-size: 10px; color: var(--dim); margin-left: 2px; }
.narr { margin-top: 8px; background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--amber); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.65; color: #d6e2ef; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-height: 62px; }
.narr b { color: var(--amber); font-weight: 600; }

#panel { position: absolute; right: 18px; top: 18px; width: 256px; max-height: calc(100% - 90px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 2px 11px 6px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); scrollbar-width: none; }
.drawer-handle { display: none; }
.grp { border-bottom: 1px solid var(--line); padding: 6px 0 7px; }
.grp:last-child { border-bottom: 0; }
.grp h3 { margin: 0; font: 600 12px/1.6 var(--font); color: var(--tx); cursor: pointer; user-select: none; display: flex; align-items: baseline; gap: 6px; }
.grp h3::before { content: "▸"; color: var(--cyan); font-size: 10px; transition: transform .2s; display: inline-block; }
.grp.open h3::before { transform: rotate(90deg); }
.grp h3 em { font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--dim); }
.grp .body { display: none; margin-top: 5px; }
.grp.open .body { display: block; }
.seg { display: flex; background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { flex: 1; }
button { font: 500 12px/1 var(--font); color: #cfe0f0; background: transparent; border: 0; border-radius: 7px; padding: 6px 4px; cursor: pointer; transition: background .15s, color .15s; }
button:hover { background: rgba(95,230,230,.1); color: #fff; }
.seg button.on { background: rgba(95,230,230,.18); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(95,230,230,.35); }
.seg.small button { font-size: 11px; }
.sl { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin: 9px 0 2px; }
.sl b, .mono { font: 500 12px var(--mono); color: var(--amber); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--amber) var(--p, 50%), rgba(255,255,255,.12) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(255,171,74,.35), 0 0 10px rgba(255,171,74,.6); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row + .seg, .row + .row { margin-top: 8px; }
.play { width: 30px; height: 30px; flex: none; border-radius: 50%; background: rgba(255,171,74,.16); color: var(--amber); font-size: 11px; box-shadow: inset 0 0 0 1px rgba(255,171,74,.4); padding: 0; }
.play.on { background: var(--amber); color: #1a1006; }
#o-time { width: 50px; text-align: right; flex: none; }
.grp.open .body.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.presets button { background: rgba(0,0,0,.22); border: 1px solid var(--line); padding: 8px 4px; }
.presets button.on { border-color: rgba(255,171,74,.6); color: var(--amber); }
.tools { margin-top: 8px; }
.tools button { flex: 1; background: rgba(0,0,0,.22); border: 1px solid var(--line); }

#b-hide { position: absolute; right: 20px; bottom: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 8px 14px; font-size: 11.5px; color: var(--dim); backdrop-filter: blur(10px); }
#ui.off #b-hide { pointer-events: auto !important; opacity: 1; }

#help { position: absolute; inset: 0; background: rgba(2,6,12,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
#help[hidden] { display: none; }
.help-card { position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto; background: rgba(9,20,36,.94); border: 1px solid var(--line); border-radius: 16px; padding: 18px 24px 16px; font-size: 13px; line-height: 1.7; color: #cfdced; }
.help-card h2 { font: 600 15px var(--font); color: var(--amber); margin: 6px 0 4px; }
.help-card ul { margin: 0 0 10px; padding-left: 18px; }
.help-card .simp li { color: #b9c9dc; font-size: 12.5px; }
.help-card b { color: var(--cyan); font-weight: 600; }
.help-card .x { position: absolute; right: 10px; top: 8px; font-size: 20px; color: var(--dim); }

body.grab, body.grab #c { cursor: grab; }
body.grabbing, body.grabbing #c { cursor: grabbing; }

@media (max-width: 699px) {
  #hero { left: 14px; top: 12px; width: calc(100% - 28px); }
  .kicker { font-size: 9.5px; }
  h1 { font-size: 22px; margin: 6px 0 4px; }
  h1 span { display: inline; }
  h1 .acc { margin-left: 4px; }
  .hook { display: none; }
  .cards { gap: 5px; }
  .card { padding: 6px 7px 5px; }
  .card .lab { font-size: 9.5px; }
  .card .val { font-size: 15px; }
  .narr { font-size: 11.5px; padding: 7px 10px; min-height: 0; line-height: 1.55; }
  #panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 56%; border-radius: 16px 16px 0 0; padding: 0 14px 12px; transform: translateY(calc(100% - 44px)); transition: transform .3s; }
  #panel.open { transform: none; }
  .drawer-handle { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; font-size: 12px; color: var(--dim); cursor: pointer; flex-direction: column; }
  .drawer-handle span { width: 36px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
  #b-hide { bottom: 54px; right: 12px; padding: 6px 11px; font-size: 10.5px; }
}
