/* Eleveight AI HGX B300 build challenge. Layout concept: a fixed 1920x1080 stage, scaled to fit any screen.
   Center column is an assembly bench (parts trays above and below a blueprint),
   flanked by the build sheet on the left and the assembly rules on the right. */
@font-face { font-family: 'Montserrat'; font-weight: 400; font-style: normal; font-display: block; src: url('../assets/fonts/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 500; font-style: normal; font-display: block; src: url('../assets/fonts/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-style: normal; font-display: block; src: url('../assets/fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-style: normal; font-display: block; src: url('../assets/fonts/montserrat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-style: normal; font-display: block; src: url('../assets/fonts/montserrat-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-style: normal; font-display: block; src: url('../assets/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 600; font-style: normal; font-display: block; src: url('../assets/fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 700; font-style: normal; font-display: block; src: url('../assets/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); }

:root {
  --ink: #000000;          /* background */
  --paper: #ffffff;        /* text */
  --lime: #D6FD9C;         /* Eleveight AI accent */
  --lime-08: rgba(214, 253, 156, .08);
  --lime-16: rgba(214, 253, 156, .16);
  --lime-35: rgba(214, 253, 156, .35);
  --panel: #0a0c08;        /* near-black, biased toward the accent */
  --panel-2: #12150f;
  --line: rgba(255, 255, 255, .13);
  --muted: rgba(255, 255, 255, .66);
  --dim: rgba(255, 255, 255, .42);
  --font-display: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  color-scheme: dark;
}

html, body {
  height: 100%; margin: 0; background: var(--ink); color: var(--paper);
  overflow: hidden; overscroll-behavior: none;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
#viewport { position: fixed; inset: 0; overflow: hidden; background: var(--ink); }
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: hidden;
  transform-origin: 0 0; background: var(--ink); color: var(--paper);
  font-family: var(--font-body); font-size: 22px; line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
#stage * { box-sizing: border-box; }
#screen { position: absolute; inset: 0; }
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: none; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; }

/* ---------- shared ---------- */
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(214, 253, 156, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 253, 156, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 80%);
}
.btn-lime {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--lime); color: #000; border: 0; border-radius: 16px;
  font-weight: 800; font-size: 32px; letter-spacing: -.01em; padding: 0 44px; height: 100px;
}
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  background: transparent; color: var(--paper); border: 2px solid rgba(255, 255, 255, .35); border-radius: 16px;
  font-weight: 700; font-size: 28px; padding: 0 40px; height: 100px;
}
.btn-lime:active, .btn-outline:active { transform: scale(.97); }
.mono { font-family: var(--font-mono); }

/* ---------- header ---------- */
.hdr { position: absolute; left: 0; top: 0; width: 1920px; height: 92px; }
.hdr-logo { position: absolute; left: 28px; top: 26px; height: 42px; width: auto; }
.hdr-title { position: absolute; right: 28px; top: 30px; font-weight: 700; font-size: 24px; letter-spacing: -.01em; }
.hdr-center { position: absolute; left: 0; right: 0; top: 14px; display: flex; justify-content: center; }
.timer {
  width: 300px; height: 72px; border: 1.5px solid var(--lime-35); border-radius: 14px; background: #040503;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  box-shadow: inset 0 0 22px rgba(214, 253, 156, .07);
}
.timer-label { font-family: var(--font-mono); font-size: 12px; color: var(--dim); letter-spacing: .08em; line-height: 1; margin-bottom: 4px; }
.timer-digits { font-family: var(--font-mono); font-weight: 700; font-size: 44px; color: var(--lime); line-height: 1; }
.timer-digits small { font-size: 22px; font-weight: 600; opacity: .8; }
.timer.low { border-color: #fff; animation: lowPulse .5s ease-in-out infinite alternate; }
.timer.low .timer-digits { color: #fff; }
@keyframes lowPulse { from { box-shadow: 0 0 0 rgba(255, 255, 255, 0); } to { box-shadow: 0 0 26px rgba(255, 255, 255, .35); } }
.hdr-pill { font-family: var(--font-mono); font-size: 20px; color: var(--muted); }
.hdr-pill b { color: var(--lime); font-weight: 700; }
.learn-title { font-weight: 800; font-size: 30px; letter-spacing: -.01em; padding-top: 14px; }

/* ---------- side panels ---------- */
.panel {
  position: absolute; top: 102px; height: 848px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
}
.panel-left { left: 20px; width: 362px; transition: width .25s ease; }
.panel-right { left: 1498px; width: 402px; }

.sheet { padding: 22px 22px 18px; height: 100%; display: flex; flex-direction: column; }
.sheet-top { display: flex; gap: 14px; align-items: center; }
.sheet-badge {
  width: 52px; height: 52px; border-radius: 12px; background: var(--lime); color: #000;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700; font-size: 15px; flex: none;
}
.sheet-eyebrow { font-family: var(--font-mono); font-size: 14px; color: var(--dim); }
.sheet-title { font-weight: 700; font-size: 23px; line-height: 1.15; margin-top: 2px; }
.sheet-toggle {
  position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.sheet-rows { margin-top: 18px; border-top: 1px solid var(--line); }
.sheet-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.sheet-row span { font-size: 16px; color: var(--muted); white-space: nowrap; }
.sheet-row b { font-family: var(--font-mono); font-weight: 600; font-size: 15px; text-align: right; }
.sheet-progress { margin-top: auto; padding-top: 16px; }
.prog-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; color: var(--muted); padding: 6px 0; }
.prog-row b { font-family: var(--font-mono); color: var(--paper); font-size: 20px; }
.prog-row b.lime { color: var(--lime); }
.prog-bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 4px 0 8px; }
.prog-bar i { display: block; height: 100%; width: 0; background: var(--lime); border-radius: 6px; transition: width .3s ease; }
.sheet-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.sheet-foot svg { height: 30px; width: 92px; flex: none; }
.sheet-foot span { font-family: var(--font-mono); font-size: 12px; color: var(--dim); line-height: 1.3; }
.panel-left.collapsed { width: 64px; }
.panel-left.collapsed .sheet > *:not(.sheet-toggle) { display: none; }
.panel-left .sheet-vert { display: none; }
.panel-left.collapsed .sheet-vert {
  display: block; position: absolute; left: 18px; top: 80px; writing-mode: vertical-rl;
  font-family: var(--font-mono); font-size: 16px; color: var(--muted);
}

.rules-head { display: flex; justify-content: space-between; align-items: baseline; padding: 20px 22px 12px 24px; }
.rules-title { font-weight: 700; font-size: 25px; }
.rules-count { font-family: var(--font-mono); font-weight: 700; font-size: 24px; color: var(--lime); }
.rule {
  display: grid; grid-template-columns: 1fr 26px; gap: 12px; align-items: start;
  padding: 9px 20px 9px 24px; border-top: 1px solid var(--line); font-size: 17px; line-height: 1.3;
  transition: background .3s;
}
.rule-code { display: inline-block; min-width: 38px; font-family: var(--font-mono); font-size: 13.5px; font-weight: 600; color: var(--dim); }
.rule-dot { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .32); margin-top: 1px; position: relative; transition: all .25s; }
.rule.done .rule-dot { background: var(--lime); border-color: var(--lime); }
.rule.done .rule-dot::after {
  content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px;
  border: solid #000; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.rule.done .rule-code { color: var(--lime); }
.rule.pulse { animation: rulePulse .45s ease 3; }
@keyframes rulePulse {
  0%, 100% { background: transparent; transform: translateX(0); }
  30% { background: var(--lime-16); transform: translateX(-6px); }
  60% { background: var(--lime-16); transform: translateX(5px); }
}

/* ---------- trays and tiles ---------- */
.tray { position: absolute; left: 400px; width: 1080px; height: 132px; display: flex; justify-content: center; gap: 24px; }
.tray-top { top: 100px; }
.tray-bottom { top: 818px; }
.tile {
  position: relative; width: 160px; height: 132px; border-radius: 16px; flex: none;
  background: linear-gradient(180deg, #171a1c 0%, #0d0f10 100%);
  border: 1px solid #2b3035; box-shadow: 0 10px 22px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  touch-action: none; transition: opacity .25s, transform .15s;
}
.tile::after {
  content: ''; position: absolute; left: 22%; right: 22%; bottom: 7px; height: 3px; border-radius: 3px;
  background: rgba(255, 255, 255, .22);
}
.tile-art { position: absolute; left: 10px; top: 8px; width: 140px; height: 82px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tile-art svg { width: 100%; height: 100%; overflow: hidden; transition: transform .2s ease; }
.tile-name { position: absolute; left: 6px; right: 6px; top: 92px; text-align: center; font-size: 15px; font-weight: 600; color: var(--muted); line-height: 1.15; pointer-events: none; }
.tile-count {
  position: absolute; top: 8px; right: 10px; font-family: var(--font-mono); font-weight: 700; font-size: 17px; color: var(--lime);
  background: rgba(0, 0, 0, .7); border-radius: 8px; padding: 1px 7px; pointer-events: none;
}
.tile-rot {
  position: absolute; top: 8px; left: 9px; width: 30px; height: 30px; border-radius: 50%; pointer-events: none;
  border: 1.5px solid var(--lime); color: var(--lime); display: flex; align-items: center; justify-content: center; font-size: 18px; background: rgba(0, 0, 0, .7);
}
.tile.lifting { transform: scale(.95); }
.tile.empty { opacity: .45; }
.tile.empty .tile-art, .tile.empty .tile-count, .tile.empty .tile-rot { visibility: hidden; }
.tile.empty .tile-name { top: 52px; color: var(--dim); font-family: var(--font-mono); font-weight: 400; }
.tile.hint { animation: tileHint .7s ease-in-out 4; }
@keyframes tileHint { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 253, 156, 0); border-color: #2b3035; } 50% { box-shadow: 0 0 0 4px var(--lime), 0 0 30px var(--lime-35); border-color: var(--lime); } }
.tile.shake { animation: shake .4s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

/* ---------- field / blueprint ---------- */
.field { position: absolute; left: 400px; top: 245px; width: 1080px; height: 560px; }
.field-grid {
  position: absolute; inset: 0; border-radius: 6px;
  background-color: #020302;
  background-image:
    linear-gradient(rgba(214, 253, 156, .11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 253, 156, .11) 1px, transparent 1px),
    linear-gradient(rgba(214, 253, 156, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 253, 156, .05) 1px, transparent 1px);
  background-size: 200px 200px, 200px 200px, 40px 40px, 40px 40px;
  background-position: -1px -1px;
}
.corner { position: absolute; width: 34px; height: 34px; border: 3px solid var(--lime); pointer-events: none; }
.corner.tl { left: -6px; top: -6px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.corner.tr { right: -6px; top: -6px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.corner.bl { left: -6px; bottom: -6px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.corner.br { right: -6px; bottom: -6px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.blueprint-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.slots { position: absolute; inset: 0; }
.slot { position: absolute; color: rgba(255, 255, 255, .42); transition: color .15s; pointer-events: none; }
.slot .outline-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.slot .outline-svg .socket-mark { opacity: .9; }
.slot .art { position: absolute; inset: 0; }
.slot .art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.slot.filled .outline-svg, .slot.concealed .outline-svg { display: none; }
.slot.candidate { color: rgba(214, 253, 156, .7); }
.slot.candidate .outline-svg { display: block; }
.slot.target { color: var(--lime); filter: drop-shadow(0 0 10px rgba(214, 253, 156, .75)); }
.slot.target .outline-svg { display: block; }
.slot.hinted { animation: slotHint .7s ease-in-out 4; }
.slot.hinted .outline-svg { display: block; }
@keyframes slotHint { 0%, 100% { color: rgba(255, 255, 255, .42); } 50% { color: var(--lime); filter: drop-shadow(0 0 12px var(--lime)); } }
.art.snap { animation: snap .32s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes snap { from { transform: scale(1.07); opacity: .5; } to { transform: scale(1); opacity: 1; } }
.slot.focus::after {
  content: ''; position: absolute; inset: -6px; border: 2.5px solid var(--lime); border-radius: 8px;
  box-shadow: 0 0 22px var(--lime-35); animation: focusIn .3s ease;
}
.focus-box {
  position: absolute; border: 2.5px solid var(--lime); border-radius: 8px; pointer-events: none; z-index: 9;
  box-shadow: 0 0 22px var(--lime-35), inset 0 0 14px var(--lime-16); animation: focusIn .3s ease;
}
@keyframes focusIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }

.bb-glow { stroke: var(--lime); stroke-width: 3; opacity: 0; }
.glow-chips .bb-glow { animation: chipGlow 1.6s ease 1; }
@keyframes chipGlow { 0%, 100% { opacity: 0; } 25%, 70% { opacity: 1; } }

/* power-on effects */
.fan-blades { transform-origin: 0 0; }
.powered .fan-blades { animation: spin .32s linear infinite; }
.idle-spin .fan-blades { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.psu-led, .gpu-led, .dpu-led, .nvme-led { transition: fill .2s; }
.powered .psu-led, .powered .gpu-led, .powered .dpu-led, .powered .nvme-led,
.idle-spin .psu-led, .idle-spin .gpu-led, .idle-spin .dpu-led, .idle-spin .nvme-led {
  fill: #3be36b; filter: drop-shadow(0 0 3px #3be36b);
}
.hbm-hl { stroke: var(--lime); stroke-width: 1.4; }

/* ghost while dragging */
.ghost { position: absolute; left: 0; top: 0; z-index: 70; pointer-events: none; will-change: transform; }
.ghost .art { width: 100%; height: 100%; filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .7)); }
.ghost .art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ghost.returning { transition: transform .32s cubic-bezier(.3, .7, .3, 1), opacity .32s; opacity: 0; }

/* hotspots (learn) */
.hotspot {
  position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; z-index: 12;
  background: #000; border: 2.5px solid var(--lime); color: var(--lime); font-family: var(--font-mono); font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 4px rgba(0, 0, 0, .55), 0 0 18px var(--lime-35);
  padding: 0;
}
.hotspot::before { content: ''; position: absolute; inset: -18px; border-radius: 50%; }
.hotspot.viewed { background: var(--lime); color: #000; }
.hotspot.active { transform: scale(1.18); box-shadow: 0 0 0 5px rgba(0, 0, 0, .6), 0 0 28px var(--lime); }

/* ---------- build screen extras ---------- */
.ruler {
  position: absolute; left: 400px; top: 966px; width: 1080px; height: 24px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .45) 0 1px, transparent 1px 54px) bottom / 100% 18px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .22) 0 1px, transparent 1px 10.8px) bottom / 100% 9px no-repeat;
  border-bottom: 1px solid rgba(255, 255, 255, .3);
}
.instr { position: absolute; left: 400px; top: 1004px; width: 1080px; text-align: center; font-size: 21px; color: var(--muted); }
.note { position: absolute; left: 28px; top: 1018px; font-family: var(--font-mono); font-size: 14px; color: var(--dim); }
.hint-btn {
  position: absolute; left: 1498px; top: 964px; width: 402px; height: 92px; border-radius: 18px;
  border: 2px solid var(--lime); background: #040503; color: var(--lime);
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.hint-btn b { font-weight: 800; font-size: 30px; }
.hint-btn span { font-family: var(--font-mono); font-size: 16px; color: var(--dim); }
.hint-btn svg { width: 30px; height: 30px; }
.hint-btn:disabled { opacity: .4; }
.toast-wrap { position: absolute; left: 400px; width: 1080px; top: 732px; display: flex; justify-content: center; pointer-events: none; z-index: 65; }
.toast {
  display: flex; align-items: center; gap: 14px; max-width: 980px;
  background: #0b0d09; border: 2px solid var(--lime); border-radius: 14px; padding: 14px 24px;
  font-size: 22px; font-weight: 600; box-shadow: 0 16px 40px rgba(0, 0, 0, .7);
  animation: toastIn .22s ease;
}
.toast .code { font-family: var(--font-mono); font-weight: 700; font-size: 16px; background: var(--lime); color: #000; border-radius: 8px; padding: 3px 9px; flex: none; }
.toast .cost { font-family: var(--font-mono); font-weight: 700; color: var(--lime); flex: none; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
.flash {
  position: absolute; z-index: 40; pointer-events: none; transform: translate(-50%, -50%);
  font-family: var(--font-mono); font-weight: 700; font-size: 17px; color: var(--lime); white-space: nowrap;
  background: rgba(0, 0, 0, .82); border: 1px solid var(--lime-35); border-radius: 8px; padding: 6px 12px;
  animation: floatUp 1.9s ease forwards;
}
@keyframes floatUp { 0% { opacity: 0; margin-top: 10px; } 12% { opacity: 1; margin-top: 0; } 75% { opacity: 1; } 100% { opacity: 0; margin-top: -26px; } }
.pen { position: absolute; left: 1124px; top: 26px; font-family: var(--font-mono); font-weight: 700; font-size: 32px; color: #fff; pointer-events: none; animation: penFly 1.2s ease forwards; z-index: 66; }
@keyframes penFly { 0% { opacity: 0; transform: translateY(8px) scale(.9); } 15% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }

.power-btn {
  position: absolute; left: 540px; top: 280px; width: 210px; height: 210px; margin: -105px 0 0 -105px; z-index: 30;
  border-radius: 50%; border: 0; background: var(--lime); color: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 26px; animation: ring 1.3s ease-out infinite, popIn .35s cubic-bezier(.2, 1.5, .4, 1);
}
.power-btn svg { width: 64px; height: 64px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(214, 253, 156, .65), 0 0 40px rgba(214, 253, 156, .5); } 100% { box-shadow: 0 0 0 44px rgba(214, 253, 156, 0), 0 0 40px rgba(214, 253, 156, .5); } }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.readout {
  position: absolute; left: 290px; top: 150px; width: 500px; min-height: 260px; z-index: 31;
  background: rgba(0, 0, 0, .9); border: 2px solid var(--lime); border-radius: 16px; padding: 26px 30px;
  font-family: var(--font-mono); font-size: 25px; line-height: 1.75; box-shadow: 0 20px 60px rgba(0, 0, 0, .8);
}
.readout div { white-space: nowrap; overflow: hidden; width: 0; animation: type .45s steps(24) forwards; }
.readout div::before { content: '> '; color: var(--lime); }
.readout div.ok { color: var(--lime); }
@keyframes type { to { width: 100%; } }

.countdown { position: absolute; inset: 0; z-index: 90; background: rgba(0, 0, 0, .62); display: flex; align-items: center; justify-content: center; }
.cd-num { font-family: var(--font-mono); font-weight: 700; font-size: 300px; color: var(--lime); line-height: 1; animation: cdPop .9s ease forwards; text-shadow: 0 0 60px rgba(214, 253, 156, .5); }
@keyframes cdPop { 0% { transform: scale(1.5); opacity: 0; } 20% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.85); opacity: 0; } }

/* ---------- start screen ---------- */
.start-logo { position: absolute; left: 120px; top: 96px; height: 70px; }
.start-copy { position: absolute; left: 120px; top: 250px; width: 880px; }
.eyebrow { font-family: var(--font-mono); font-size: 22px; color: var(--lime); }
.start-title { font-family: var(--font-display); font-weight: 800; font-size: 80px; line-height: 1; letter-spacing: -.035em; margin: 22px 0 0; text-wrap: balance; }
.start-title em { font-style: normal; color: var(--lime); display: block; }
.start-body { font-size: 30px; line-height: 1.35; color: var(--muted); margin: 30px 0 0; max-width: 760px; }
.start-cta { margin-top: 48px; height: 116px; font-size: 38px; padding: 0 56px; animation: ctaGlow 1.8s ease-in-out infinite; }
@keyframes ctaGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 253, 156, 0); } 50% { box-shadow: 0 0 0 10px rgba(214, 253, 156, .12), 0 0 50px rgba(214, 253, 156, .35); } }
.start-best { margin-top: 30px; font-family: var(--font-mono); font-size: 24px; color: var(--paper); }
.start-best i { font-style: normal; color: var(--dim); }
.start-facts { position: absolute; left: 120px; bottom: 74px; display: flex; gap: 0; font-family: var(--font-mono); font-size: 20px; color: var(--dim); }
.start-facts span + span::before { content: '/'; margin: 0 18px; color: var(--lime-35); }
.start-hero { position: absolute; left: 1010px; top: 230px; width: 1080px; height: 560px; transform: scale(.8); transform-origin: 0 0; }
.start-hero .field { left: 0; top: 0; }

/* ---------- learn screen ---------- */
.learn-top { position: absolute; left: 400px; top: 108px; width: 1080px; }
.learn-top h2 { margin: 0; font-weight: 800; font-size: 36px; letter-spacing: -.015em; }
.learn-top p { margin: 8px 0 0; font-size: 22px; color: var(--muted); }
.card { padding: 24px; height: 100%; display: flex; flex-direction: column; }
.card-art {
  height: 236px; border-radius: 14px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 40%, #171b14, #070806 75%);
  display: flex; align-items: center; justify-content: center; padding: 22px; position: relative;
}
.card-art svg { max-width: 100%; max-height: 100%; width: 100%; height: 100%; }
.card-num { position: absolute; left: 14px; top: 12px; font-family: var(--font-mono); font-weight: 700; font-size: 18px; color: var(--lime); }
.card h3 { margin: 22px 0 0; font-weight: 800; font-size: 29px; line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.card p { margin: 14px 0 0; font-size: 21px; color: var(--muted); line-height: 1.4; }
.card-spec { margin-top: 20px; padding: 14px 16px; border-radius: 12px; background: var(--lime-08); border: 1px solid var(--lime-35); font-family: var(--font-mono); font-weight: 600; font-size: 19px; color: var(--lime); line-height: 1.4; }
.card-nav { margin-top: auto; display: flex; gap: 12px; }
.card-nav button { flex: 1; height: 72px; font-size: 22px; border-radius: 14px; padding: 0 12px; white-space: nowrap; }
.chips { position: absolute; left: 400px; top: 820px; width: 1080px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.chip {
  height: 58px; border-radius: 12px; border: 1px solid #2b3035; background: linear-gradient(180deg, #15181a, #0d0f10);
  display: flex; align-items: center; gap: 8px; padding: 0 10px; font-size: 15px; font-weight: 600; color: var(--muted); text-align: left;
  white-space: nowrap; overflow: hidden; min-width: 0;
}
.chip i { font-style: normal; font-family: var(--font-mono); font-weight: 700; font-size: 14px; color: var(--lime); flex: none; width: 22px; }
.chip.viewed { color: var(--paper); border-color: var(--lime-35); }
.chip.active { border-color: var(--lime); background: var(--lime-08); color: var(--paper); }
.learn-cta { position: absolute; left: 1498px; top: 964px; width: 402px; height: 92px; font-size: 28px; }
.learn-cta.locked { background: transparent; color: var(--muted); border: 2px dashed rgba(255, 255, 255, .28); justify-content: center; gap: 16px; padding: 0 24px; }
.learn-cta.locked svg { flex: none; color: var(--dim); }
.learn-cta .cta-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.learn-cta .cta-txt b { font-weight: 800; font-size: 26px; }
.learn-cta .cta-txt small { font-family: var(--font-mono); font-weight: 600; font-size: 16px; color: var(--lime); margin-top: 4px; }
.learn-cta.shake { animation: shake .4s ease; }
.learn-cta.unlocked-pop { animation: unlockPop .6s cubic-bezier(.2, 1.5, .4, 1), ctaGlow 1.8s ease-in-out .6s infinite; }
@keyframes unlockPop { from { transform: scale(.9); } to { transform: scale(1); } }
.chip.nudge { animation: nudge .5s ease 3; }
.hotspot.nudge { animation: nudge .5s ease 3; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 253, 156, 0); } 50% { box-shadow: 0 0 0 5px var(--lime), 0 0 26px var(--lime-35); } }
.learn-hint { position: absolute; left: 400px; top: 1000px; width: 1080px; text-align: center; font-size: 20px; color: var(--dim); }

/* ---------- how to play ---------- */
.howto-title { position: absolute; left: 120px; top: 150px; margin: 0; font-weight: 800; font-size: 84px; letter-spacing: -.03em; }
.steps { position: absolute; left: 120px; top: 300px; width: 1680px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px; min-height: 440px; display: flex; flex-direction: column; }
.step-num { font-family: var(--font-mono); font-weight: 700; font-size: 26px; color: var(--lime); }
.step-art { height: 150px; margin: 18px 0 8px; display: flex; align-items: center; justify-content: center; position: relative; }
.step-art svg { height: 100%; width: auto; max-width: 100%; overflow: visible; }
.step h3 { margin: 16px 0 0; font-weight: 800; font-size: 30px; line-height: 1.15; letter-spacing: -.01em; }
.step p { margin: 12px 0 0; font-size: 22px; color: var(--muted); line-height: 1.4; }
.howto-foot { position: absolute; left: 120px; top: 830px; width: 1680px; display: flex; align-items: center; justify-content: space-between; }
.howto-foot p { margin: 0; font-size: 24px; color: var(--muted); max-width: 980px; }
.howto-foot small { display: block; margin-top: 10px; font-family: var(--font-mono); font-size: 15px; color: var(--dim); }

/* ---------- result ---------- */
.res-left { position: absolute; left: 120px; top: 190px; width: 1000px; }
.res-title { margin: 18px 0 0; font-weight: 800; font-size: 64px; letter-spacing: -.025em; line-height: 1.05; }
.res-time { font-family: var(--font-mono); font-weight: 700; font-size: 190px; line-height: 1; color: var(--lime); letter-spacing: -.04em; margin-top: 8px; }
.res-time small { font-size: 80px; letter-spacing: 0; }
.res-prize { margin-top: 26px; display: inline-flex; align-items: center; gap: 16px; padding: 18px 26px; border-radius: 16px; border: 2px solid var(--lime); background: var(--lime-08); font-size: 28px; font-weight: 700; }
.res-prize svg { width: 36px; height: 36px; flex: none; }
.res-sub { margin-top: 22px; font-size: 26px; color: var(--muted); }
.res-stats { margin-top: 22px; display: flex; gap: 14px; }
.res-stats span { font-family: var(--font-mono); font-size: 20px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.res-factory { margin-top: 34px; font-size: 26px; line-height: 1.4; max-width: 900px; }
.res-btns { position: absolute; left: 120px; top: 900px; display: flex; gap: 18px; }
.res-right { position: absolute; left: 1300px; top: 190px; width: 500px; display: flex; flex-direction: column; align-items: center; }
.qr-card { display: block; width: 400px; height: 400px; background: #fff; border-radius: 22px; padding: 26px; box-shadow: 0 0 0 3px var(--lime), 0 0 60px rgba(214, 253, 156, .25); }
.qr-card svg, .qr-card img { width: 100%; height: 100%; display: block; }
.qr-caption { margin-top: 22px; font-family: var(--font-mono); font-size: 22px; color: var(--muted); }
.slogan { margin-top: 36px; font-weight: 800; font-size: 46px; letter-spacing: -.025em; text-align: center; white-space: nowrap; }
.res-logo { position: absolute; right: 120px; top: 900px; height: 60px; }

/* ---------- name entry ---------- */
.name-wrap { position: absolute; left: 0; right: 0; top: 104px; display: flex; flex-direction: column; align-items: center; }
.name-wrap h2 { margin: 0; font-weight: 800; font-size: 64px; letter-spacing: -.025em; }
.name-wrap > p { margin: 10px 0 0; font-size: 24px; color: var(--muted); }
.name-field {
  margin-top: 30px; width: 900px; height: 110px; border-radius: 18px; border: 2px solid var(--lime); background: #040503;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-weight: 700; font-size: 58px; letter-spacing: .04em;
}
.name-field .ph { color: var(--dim); font-weight: 400; }
.name-field .caret { display: inline-block; width: 4px; height: 60px; background: var(--lime); margin-left: 6px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.name-msg { height: 40px; margin-top: 12px; font-size: 22px; color: var(--lime); }
.keys { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; }
.krow { display: flex; gap: 12px; }
.key { width: 100px; height: 92px; border-radius: 14px; border: 1px solid #2f343a; background: linear-gradient(180deg, #1a1d20, #111315); font-size: 32px; font-weight: 700; }
.key:active, .key.down { background: var(--lime); color: #000; }
.key.wide { width: 436px; font-size: 24px; }
.key.save { width: 212px; font-size: 26px; font-weight: 800; background: var(--lime); color: #000; border-color: var(--lime); }
.key.skip { width: 212px; font-size: 24px; background: transparent; border: 2px solid rgba(255, 255, 255, .35); }
.key.mid { width: 212px; font-size: 24px; }
.name-btns { display: flex; gap: 18px; margin-top: 26px; }

/* ---------- leaderboard ---------- */
.board-wrap { position: absolute; left: 360px; top: 110px; width: 1200px; }
.board-wrap h2 { margin: 0; font-weight: 800; font-size: 64px; letter-spacing: -.025em; display: flex; align-items: baseline; justify-content: space-between; }
.board-wrap h2 span { font-family: var(--font-mono); font-weight: 400; font-size: 22px; color: var(--dim); letter-spacing: 0; }
.board { margin-top: 26px; border-top: 1px solid var(--line); }
.brow { display: grid; grid-template-columns: 90px 1fr 220px; align-items: center; height: 64px; border-bottom: 1px solid var(--line); padding: 0 22px; font-size: 30px; }
.brow .rank { font-family: var(--font-mono); font-weight: 700; color: var(--dim); font-size: 24px; }
.brow .nm { font-weight: 700; }
.brow .tm { font-family: var(--font-mono); font-weight: 700; text-align: right; }
.brow.me { background: var(--lime); color: #000; border-radius: 12px; border-bottom-color: transparent; }
.brow.first .rank { color: var(--lime); }
.brow.me .rank, .brow.me.first .rank { color: #000; }
.board-empty { padding: 60px 0; font-size: 30px; color: var(--muted); }
.board-btn { position: absolute; left: 360px; top: 930px; }

/* ---------- staff panel ---------- */
.staff-hot { position: absolute; left: 0; top: 0; width: 170px; height: 100px; z-index: 200; }
.modal { position: absolute; inset: 0; z-index: 300; background: rgba(0, 0, 0, .78); display: flex; align-items: center; justify-content: center; }
.modal-box { width: 760px; background: var(--panel); border: 1.5px solid var(--lime-35); border-radius: 22px; padding: 34px 38px; }
.modal-box h2 { margin: 0 0 20px; font-weight: 800; font-size: 36px; }
.pin-dots { display: flex; gap: 18px; justify-content: center; margin: 10px 0 22px; }
.pin-dots i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--lime); }
.pin-dots i.on { background: var(--lime); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-pad .key { width: auto; }
.pin-msg { height: 30px; text-align: center; font-size: 20px; color: var(--lime); margin-top: 12px; }
.srow { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 24px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 64px; height: 56px; border-radius: 12px; border: 1px solid #2f343a; background: #15181a; font-size: 30px; font-weight: 700; }
.stepper b { font-family: var(--font-mono); font-size: 26px; min-width: 90px; text-align: center; }
.staff-stat { margin: 16px 0 6px; font-family: var(--font-mono); font-size: 19px; color: var(--muted); }
.staff-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.staff-btns button { height: 70px; font-size: 21px; padding: 0 22px; border-radius: 14px; }

@media (prefers-reduced-motion: reduce) {
  .start-cta, .power-btn, .timer.low { animation: none; }
  .idle-spin .fan-blades { animation: none; }
}
