@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: #05080d; --panel: rgba(10, 20, 36, 0.72); --line: rgba(120, 190, 255, 0.16);
  --tx: #e6eef8; --dim: #8fa4bd; --cy: #46e4ff; --am: #ffb04a; --gr: #46ff9a; --rd: #ff5a5a;
  --sans: 'Outfit', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--tx); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
#stage, #c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#c { touch-action: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }

#ui { position: fixed; inset: 0; pointer-events: none; transition: opacity .35s; }
#ui.hidden { opacity: 0; }
#ui.hidden #b-hide { opacity: 1; pointer-events: auto; }
#ui > * { pointer-events: auto; }

/* ---------- intro ---------- */
#intro { position: absolute; left: 26px; top: 22px; width: 326px; pointer-events: none; }
#intro > * { pointer-events: auto; }
.kicker { font: 600 11px/1 var(--sans); letter-spacing: .22em; color: var(--cy); opacity: .85; }
h1 { margin: 10px 0 8px; font-weight: 700; font-size: 31px; line-height: 1.16; letter-spacing: .01em; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
h1 span { display: block; }
h1 em { display: block; font-style: normal; color: var(--am); text-shadow: 0 0 22px rgba(255,160,60,.35); }
.hook { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: #c3d0df; text-shadow: 0 1px 10px rgba(0,0,0,.8); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px 6px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cl { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv { margin-top: 3px; white-space: nowrap; }
.cv b { font: 500 19px/1 var(--mono); color: var(--cy); }
.card:nth-child(3) .cv b { color: var(--am); }
.cv i { font-style: normal; font-size: 11px; color: var(--dim); margin-left: 3px; }
.narr { background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--am); border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.62; color: #d2dceb; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.narr b { color: #fff; font-weight: 600; }
.narr b.g { color: var(--gr); } .narr b.r { color: var(--rd); }

/* ---------- panel ---------- */
#panel { position: absolute; right: 18px; top: 18px; width: 280px; max-height: calc(100% - 80px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px 8px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); scrollbar-width: none; }
#drawer-handle { display: none; }
.group { border-top: 1px solid var(--line); padding: 6px 0 6px; }
.group summary { list-style: none; font-size: 10.5px; letter-spacing: .16em; color: var(--dim); cursor: pointer; padding: 2px 0 5px; user-select: none; }
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: '▾'; float: right; opacity: .6; }
.group:not([open]) summary::after { content: '▸'; }
.seg { display: flex; background: rgba(0,0,0,.28); border: 1px solid var(--line); border-radius: 9px; padding: 2px; margin-bottom: 6px; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 0; border-radius: 7px; font-size: 13px; color: var(--dim); transition: background .2s, color .2s; }
.seg button.on { background: rgba(70,228,255,.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(70,228,255,.45); }
.seg.small button { font-size: 11.5px; padding: 4px 0; }
.seg.grow { flex: 1; margin: 0; }
.ctl { margin: 2px 0 5px; }
.ctl label { display: flex; justify-content: space-between; font-size: 12px; color: #c6d3e3; margin-bottom: 2px; }
.ctl label span { font: 500 12px var(--mono); color: var(--cy); }
.ctl .seg { margin: 2px 0 0; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, rgba(70,228,255,.7) 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(70,228,255,.35), 0 0 12px rgba(70,228,255,.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: 0; border-radius: 50%; background: #fff; }
body.m-single .ctl:not(.m-single), body.m-wave .ctl:not(.m-wave), body.m-push .ctl:not(.m-push) { display: none; }
.row { display: flex; align-items: center; gap: 6px; }
.row input[type=range] { flex: 1; }
.mono { font: 500 12px var(--mono); color: var(--cy); min-width: 48px; text-align: right; }
.ico { width: 30px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.25); font-size: 12px; color: #d8e4f2; flex: none; }
.ico:hover, .chips button:hover, .wide:hover { border-color: rgba(70,228,255,.6); }
.wide { width: 100%; margin-top: 6px; padding: 5px 0; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,176,74,.08); color: #ffd9a8; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { border: 1px solid var(--line); background: rgba(0,0,0,.25); border-radius: 999px; padding: 4px 9px; font-size: 11.5px; color: #cfdbea; }
.chips button.on { border-color: var(--am); color: #fff; background: rgba(255,176,74,.14); }

#b-hide { position: absolute; right: 18px; bottom: 18px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-size: 11.5px; color: var(--dim); backdrop-filter: blur(8px); }

/* ---------- help ---------- */
#help { position: fixed; inset: 0; background: rgba(2,6,12,.55); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
#help[hidden] { display: none; }
.help-card { position: relative; width: min(560px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow: auto; background: rgba(10,20,36,.95); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; font-size: 13.5px; line-height: 1.65; color: #cfdbea; }
.help-card h2 { font-size: 15px; color: #fff; margin: 6px 0 6px; }
.help-card ul { margin: 0 0 10px; padding-left: 18px; }
.help-card kbd { font: 500 12px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.close { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 22px; color: var(--dim); }

/* ---------- 3D labels ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; transition: opacity .35s; }
#labels.hidden { opacity: 0; }
#leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lab { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; padding: 4px 10px 4px 8px; border-radius: 999px; background: rgba(8,16,30,.78); border: 1px solid rgba(70,228,255,.35); color: #e8f2ff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; gap: 6px; will-change: transform; }
.lab::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--cy); box-shadow: 0 0 8px var(--cy); }
.lab b { font: 500 12px var(--mono); color: var(--cy); font-weight: 500; }
.lab em { font-style: normal; font-size: 10.5px; color: var(--am); border: 1px solid rgba(255,176,74,.5); border-radius: 999px; padding: 0 6px; }
.lab.amber { border-color: rgba(255,176,74,.45); } .lab.amber::before { background: var(--am); box-shadow: 0 0 8px var(--am); }
.lab.part { font-size: 11px; background: rgba(8,16,30,.7); }

#nogl { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; text-align: center; line-height: 1.7; }
#nogl[hidden] { display: none; }

/* ---------- phone ---------- */
@media (max-width: 699px) {
  #intro { left: 14px; top: 12px; width: calc(100% - 28px); }
  .kicker { font-size: 9.5px; }
  h1 { font-size: 21px; margin: 6px 0 4px; }
  h1 span, h1 em { display: inline; } h1 em { margin-left: 6px; }
  .hook { display: none; }
  .cards { gap: 5px; margin-bottom: 6px; }
  .card { padding: 5px 7px; }
  .cv b { font-size: 15px; }
  .narr { font-size: 11.5px; line-height: 1.5; padding: 6px 9px; }
  #panel { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 62%; border-radius: 16px 16px 0 0; padding: 4px 14px 12px; transform: translateY(calc(100% - 64px)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
  #panel.open { transform: none; }
  #drawer-handle { display: block; width: 100%; height: 16px; border: 0; background: none; padding: 0; }
  #drawer-handle span { display: block; width: 40px; height: 4px; margin: 5px auto; border-radius: 2px; background: rgba(255,255,255,.3); }
  #b-hide { bottom: auto; top: 12px; right: 12px; padding: 4px 9px; font-size: 10px; display: none; }
}
