:root {
  color-scheme: dark;
  --bg: #0e0b16; --panel: #151020; --inset: #100c19; --line: #2b213b; --line-strong: #403055;
  --text: #f3eefb; --muted: #b0a5c3; --faint: #978aa9; --violet: #cda7ff;
  --mint: #7ee6d3; --amber: #f4c882; --danger: #ff9db5;
  --heading: "Space Grotesk", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", sans-serif;
  --mono: "Cascadia Code", Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; min-width: 280px; background: radial-gradient(ellipse at 61% 3%, #1e102c 0%, transparent 40rem), var(--bg); font: 500 14px/1.6 var(--body); color: var(--text); }
body::before { content: ""; position: absolute; top: 68px; left: 0; right: 0; height: 600px; background: linear-gradient(#b87bff12 1px, transparent 1px), linear-gradient(90deg, #b87bff12 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 62% 0%, #000 0%, transparent 76%); pointer-events: none; opacity: .42; z-index: -1; }
body { position: relative; isolation: isolate; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #e6ceff; outline-offset: 4px; }
::selection { color: #1a0b29; background: #d5b2ff; }
[hidden], .icon-library { display: none !important; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; vertical-align: -.16em; }
.wrap { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.skip { position: absolute; z-index: 5; left: 12px; top: 12px; color: #130b21; background: #d8b5ff; border-radius: 8px; padding: 10px 16px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.site-header { border-bottom: 1px solid #251a34; background: #100c19e0; }
.header-content { min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; font: 700 22px/1 var(--heading); letter-spacing: -.045em; }
.brand-mark { height: 36px; width: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid #55397a; color: #d9b5ff; background: linear-gradient(145deg, #34224e, #201533); box-shadow: inset 0 1px #a66af52a, 0 0 19px #8f49ff24; font-size: 19px; }
.brand-accent { color: #caa1fd; }
nav { display: flex; gap: 8px; }
nav a { display: flex; align-items: center; gap: 7px; color: var(--muted); border: 1px solid transparent; padding: 7px 12px; border-radius: 7px; font-weight: 700; font-size: 12px; white-space: nowrap; }
nav a:hover, nav a:focus-visible { color: var(--text); background: #20152f; }
nav .nav-train { background: #241736; border-color: #3b2853; color: #dab9ff; }
.header-badge { justify-self: end; display: inline-flex; align-items: center; gap: 8px; color: var(--mint); border: 1px solid #24413e; border-radius: 30px; padding: 5px 10px; background: #111d22; font: 600 10px/1.5 var(--mono); letter-spacing: .11em; white-space: nowrap; }
.status-dot, .art-right i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px #73efcb90; }
.hero { display: grid; grid-template-columns: 1.04fr 1fr; gap: 28px; align-items: center; min-height: 389px; padding-block: 29px 35px; }
.hero-copy { position: relative; z-index: 1; padding: 8px 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--violet); font: 600 11px/1.5 var(--mono); letter-spacing: .15em; }
.hero .eyebrow { border: 1px solid #50356f; background: #261738; border-radius: 5px; padding: 5px 9px; }
.hero h1 { margin: 15px 0 10px; font: 700 clamp(55px, 7.5vw, 104px)/.99 var(--heading); letter-spacing: -.086em; white-space: nowrap; }
.hero h1 > span { color: #c195fa; background: linear-gradient(158deg, #ecd5ff 3%, #bd8cf6 53%, #9f72ea 100%); background-clip: text; -webkit-text-fill-color: transparent; }
.title-period { color: #f4c685; -webkit-text-fill-color: #f4c685; }
.hero p { max-width: 440px; margin: 0; color: #bfb3cf; font-size: 16px; line-height: 1.72; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 21px; margin-top: 24px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; gap: 8px; padding: 9px 15px; border-radius: 8px; border: 1px solid transparent; font: 800 13px/1.35 var(--body); transition: background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.button .icon { font-size: 16px; }
.primary { background: linear-gradient(105deg, #a66bf2, #c798ff); border-color: #d6aaff9c; color: #160a23; box-shadow: 0 4px 24px #ac68f833, inset 0 1px #f6daff73; }
.primary:hover:not(:disabled) { background: linear-gradient(105deg, #ba88fc, #ddbbff); box-shadow: 0 4px 26px #ac68f86b; }
.primary:disabled { background: #2b2140; border-color: #423256; color: #b0a1c5; box-shadow: none; }
.action-arrow { margin-left: 6px; }
.text-link { color: #d7c8e7; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 800; }
.text-link:hover { color: #fff; }
.text-link .icon { color: var(--violet); }
.hero-meta { display: flex; align-items: center; gap: 9px; margin-top: 19px; color: var(--faint); font: 600 10px/1.5 var(--mono); letter-spacing: .09em; }
.hero-meta .icon { color: var(--violet); font-size: 13px; }
.hero-meta span { width: 3px; height: 3px; margin-inline: 4px; background: #6f567e; transform: rotate(45deg); }
.hero-art { min-height: 310px; position: relative; display: grid; place-items: center; align-self: stretch; }
.hero-art::before { content: ""; position: absolute; inset: 18px 6px; background: radial-gradient(ellipse, #9f52f02a, #5f2f8f12 43%, transparent 72%); pointer-events: none; }
.hero-art img { width: min(100%, 493px); height: auto; display: block; position: relative; z-index: 1; filter: drop-shadow(0 0 27px #a65efe25); }
.art-frame { position: absolute; inset: 12px 0 7px; border: 1px solid #36244c; border-radius: 13px; background: linear-gradient(155deg, #1b102895, #17102023 62%, #24153b65); }
.art-frame::before, .art-frame::after { position: absolute; content: ""; width: 15px; height: 15px; border: solid #7753a0; }
.art-frame::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-radius: 11px 0 0; }
.art-frame::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-radius: 0 0 11px; }
.art-tag, .art-index, .art-cross { position: absolute; z-index: 2; color: #a391ba; font: 500 9px/1.5 var(--mono); letter-spacing: .09em; }
.art-left { top: 25px; left: 15px; }
.art-left b { color: #d3a6ff; font-weight: 500; }
.art-right { right: 15px; top: 25px; display: flex; gap: 6px; align-items: center; }
.art-right i { width: 4px; height: 4px; }
.art-index { left: 15px; bottom: 19px; }
.art-cross { right: 15px; bottom: 17px; color: #cfa5fa; font-size: 16px; }
.section-kicker { display: flex; align-items: center; gap: 10px; color: #bfafcf; font: 600 11px/1.5 var(--mono); letter-spacing: .18em; margin-bottom: 13px; }
.section-kicker span { display: inline-grid; place-items: center; min-width: 27px; height: 22px; background: #251735; border: 1px solid #47335e; border-radius: 5px; color: #cca7fd; letter-spacing: .01em; }
.section-kicker i { flex: 1; height: 1px; margin-left: 5px; background: linear-gradient(90deg, #3d2d52, #271c3a77); }
.lab-layout { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr); align-items: start; gap: 17px; }
.panel { border-radius: 13px; border: 1px solid var(--line); background: linear-gradient(145deg, #181122, #140f1e 72%); box-shadow: 0 10px 30px #05030c33; }
.lab-panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 19px; border-bottom: 1px solid var(--line); background: linear-gradient(100deg, #20142f, #181122 68%); }
.panel-title, .side-heading { display: flex; align-items: center; gap: 11px; }
.panel-icon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; border: 1px solid #533772; border-radius: 9px; color: #d7adff; background: #2d1d43; font-size: 20px; }
.panel-icon.amber { color: #f4c882; background: #2c221e; border-color: #56402f; }
.panel-icon.cyan { color: #81e7da; background: #172b32; border-color: #294d54; }
.panel h2, .panel h3 { margin: 0; font-family: var(--heading); letter-spacing: -.035em; line-height: 1.15; }
.panel-heading h2 { font-size: 24px; }
.panel-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #3f2a56; background: #271938; color: #d4b2fa; border-radius: 6px; padding: 4px 7px; font: 600 10px/1.5 var(--mono); letter-spacing: .05em; white-space: nowrap; }
.chip .icon { font-size: 13px; }
.lab-body { padding: 17px 19px 19px; }
.settings { display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: 13px; }
.settings fieldset { margin: 0; padding: 0; min-width: 0; border: 0; }
.settings legend, .deck-label { margin-bottom: 7px; color: #b9a7cd; font: 600 10px/1.5 var(--mono); letter-spacing: .10em; }
.segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #100b18; }
.segments.levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segments button { display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 34px; padding: 4px; border: 1px solid transparent; border-radius: 5px; background: none; color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.segments button .icon { font-size: 13px; }
.segments button[aria-pressed="true"] { color: #e9d6ff; background: #34204d; border-color: #614382; box-shadow: inset 0 1px #c895ff23; }
.segments button:hover:not([aria-pressed="true"]):not(:disabled) { background: #221531; color: #f1e4fc; }
.difficulty-note { margin: 8px 0 13px; color: var(--muted); font-size: 11px; }
.arena { overflow: hidden; background: #100c18; border: 1px solid #35264a; border-radius: 9px; }
.hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #191123; }
.hud > div { display: grid; gap: 2px; padding: 9px 10px 7px; min-width: 0; text-align: center; }
.hud > div + div { border-left: 1px solid #2a2038; }
.hud span, .target span { font: 600 9px/1.5 var(--mono); letter-spacing: .08em; color: #ad9bc0; }
.hud strong { font: 700 21px/1.15 var(--heading); font-variant-numeric: tabular-nums; }
.hud > div:first-child strong { color: #dfbbff; }
.time-track { height: 2px; background: #2d1d40; }
#timer-fill { height: 100%; background: linear-gradient(90deg, #8552d5, #d9a6ff); transform-origin: left; }
.arena-body { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
.rune-deck, .signal-deck { min-width: 0; padding: 12px; }
.signal-deck { border-left: 1px solid var(--line); }
.deck-label { display: flex; align-items: center; gap: 5px; }
.deck-label .icon { color: var(--violet); font-size: 13px; }
.signal-deck .deck-label .icon { color: var(--mint); }
.target { display: flex; align-items: center; min-height: 53px; gap: 9px; padding: 5px 8px; border-radius: 6px; background: #1f142e; border: 1px solid #3c2853; }
.target > div + div { display: grid; gap: 1px; }
#target-rune { width: 36px; flex: 0 0 36px; text-align: center; color: #dfb7ff; font: 700 29px/1.2 var(--heading); text-shadow: 0 0 14px #a769ff80; }
#target-name { font: 700 15px/1.2 var(--heading); }
.rune-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.rune-options button { display: grid; position: relative; min-width: 0; min-height: 61px; align-content: center; justify-items: center; border-radius: 6px; border: 1px solid #3a2a51; background: #1b1328; color: #e1befc; padding: 5px 3px; }
.rune-options button:not(:disabled):hover { border-color: #ae7ef1; background: #312047; }
.rune-options button[data-feedback="correct"] { border-color: #7ee6d3; background: #193332; }
.rune-options button[data-feedback="incorrect"], .rune-options button[data-feedback="missed"] { border-color: #eb83a4; background: #352031; }
.rune-options button:disabled:not([data-feedback]) { opacity: .64; }
[data-rune-glyph] { font: 600 23px/1.05 var(--heading); }
[data-rune-name] { margin-top: 2px; font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
kbd { display: inline-block; min-width: 17px; border: 1px solid #483858; background: #231a2d; border-radius: 4px; padding: 1px 4px; color: #e2d2ef; font: 500 10px/1.35 var(--mono); text-align: center; }
.rune-options kbd { position: absolute; top: 4px; left: 4px; padding-inline: 2px; min-width: 13px; font-size: 9px; }
[data-rune="ember"] { color: #ffb28f !important; }
[data-rune="nova"] { color: #ffe08d !important; }
[data-rune="orbit"] { color: #88deff !important; }
[data-rune="prism"] { color: #8de6ca !important; }
[data-rune="void"] { color: #e7b0e9 !important; }
#signal-button { display: grid; align-content: center; justify-items: center; gap: 6px; min-height: 120px; width: 100%; border: 1px dashed #375456; border-radius: 7px; color: #a3c5c3; background: #131c24; padding: 6px 4px; text-align: center; font: 700 12px/1.25 var(--body); }
.signal-emblem { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #3d6666; background: #1c3439; color: #8bead9; font-size: 19px; }
#signal-button[data-signal-state="offline"], #signal-button[data-signal-state="paused"] { color: #b7a9c6; border-color: #443750; background: #191322; }
#signal-button[data-signal-state="active"] { color: #c5fff1; border-style: solid; border-color: #7ff0d5; background: #1d504a; box-shadow: 0 0 20px #54ffbf43, inset 0 0 18px #80e9d627; }
#signal-button[data-signal-state="active"] .signal-emblem { background: #82ead2; color: #0a3531; box-shadow: 0 0 15px #63e8cd90; }
#signal-button[data-signal-state="caught"] { color: #c5fff1; border-color: #7ee6d3; }
#signal-button[data-signal-state="missed"], #signal-button[data-signal-state="early"] { color: #ffd0dd; border-color: #a7607e; }
#game-status { min-height: 1.6em; margin: 9px 0; color: var(--muted); font-size: 12px; }
#game-status[data-tone="good"] { color: var(--mint); }
#game-status[data-tone="bad"] { color: var(--danger); }
.trial-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.secondary { border-color: #4b395e; background: #271c36; color: #e8d8f8; }
.secondary:hover:not(:disabled) { background: #362449; }
.secondary:disabled { color: #9d8daf; background: #1b1425; border-color: #322741; }
.text-button { color: #d5c0e7; background: transparent; }
.text-button:hover { background: #261a34; }
.round-summary { margin-top: 14px; border: 1px solid #5b3b7d; background: #251737; border-radius: 8px; padding: 12px; }
.round-summary h3 { margin-top: 4px; font-size: 21px; }
.round-summary p { margin: 5px 0 0; color: #d8c8e6; font-size: 12px; }
.sidebar { display: grid; gap: 13px; }
.side-panel { padding: 15px; }
.side-heading h2 { font-size: 21px; }
.tiny-label { margin-bottom: 2px; color: #bcabd0; font: 600 9px/1.3 var(--mono); letter-spacing: .11em; }
.side-intro { margin: 11px 0 8px; color: #cebbdf; font-size: 12px; }
.guide-steps { list-style: none; display: grid; padding: 0; margin: 0; }
.guide-steps li { display: grid; grid-template-columns: 25px 1fr; gap: 8px; padding: 9px 0; border-top: 1px solid #30233f; }
.guide-steps li:last-child { padding-bottom: 0; }
.step-index { width: 24px; height: 22px; display: grid; place-items: center; border: 1px solid #443250; background: #261b32; border-radius: 5px; color: #d2a9f4; font: 600 10px/1 var(--mono); }
.guide-steps h3 { margin: 2px 0 3px; font-size: 14px; letter-spacing: -.015em; }
.guide-steps p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.record { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 8px; border: 1px solid #352744; background: #120d1c; border-radius: 7px; }
.record > div { padding: 7px 3px; text-align: center; }
.record > div + div { border-left: 1px solid #352744; }
.record dt { color: #c4b4d2; font-size: 10px; }
.record dd { margin: 1px 0 0; color: #e3c2ff; font: 700 19px/1.3 var(--heading); }
.comparison { margin: 0; color: var(--muted); font-size: 11px; }
.history { list-style: none; display: grid; gap: 3px; margin: 7px 0; padding: 0; color: #c5b3d8; font-size: 10px; }
.history:empty { display: none; }
.history-item { display: flex; justify-content: space-between; align-items: start; gap: 5px; padding: 5px 0; border-top: 1px solid #322442; }
.history-result { text-align: right; color: #e7cef9; }
.local-note { display: flex; gap: 5px; align-items: center; margin-top: 9px; color: var(--faint); font-size: 10px; }
.local-note .icon { color: var(--mint); font-size: 12px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; border-top: 1px solid #312441; padding: 13px 0 23px; color: var(--faint); font: 500 10px/1.6 var(--mono); letter-spacing: .04em; }
.site-footer .icon { color: var(--violet); font-size: 14px; margin-right: 3px; }
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }
.footer-divider { color: #aa76e0; margin-inline: 4px; }

@media (max-width: 1050px) {
  .wrap { width: calc(100% - 52px); }
  .hero { min-height: 352px; }
  .hero-art { min-height: 280px; }
  .hero h1 { font-size: clamp(49px, 8.5vw, 88px); }
}
@media (max-width: 805px) {
  .lab-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .hero { min-height: 330px; gap: 16px; }
  .hero-art { min-height: 253px; }
  .hero p { font-size: 14px; }
  .hero-actions { gap: 11px; }
  .hero h1 { font-size: clamp(40px, 8.8vw, 72px); }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 28px); }
  .header-content { grid-template-columns: 1fr auto; min-height: 59px; gap: 5px; }
  .brand { font-size: 20px; gap: 6px; }
  .brand-mark { width: 31px; height: 31px; font-size: 16px; }
  .header-badge { display: none; }
  nav { gap: 2px; }
  nav a { gap: 4px; font-size: 10px; padding: 7px 5px; }
  nav .icon { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 15px; padding: 20px 0 19px; }
  .hero-copy { padding-top: 0; }
  .hero h1 { font-size: clamp(42px, 13.5vw, 78px); margin-top: 10px; }
  .hero p { max-width: 360px; }
  .hero-actions { margin-top: 15px; }
  .hero-meta { margin-top: 12px; }
  .hero-art { min-height: 0; }
  .hero-art img { width: min(72%, 290px); }
  .art-frame { inset: 0; }
  .art-tag { top: 8px; }
  .art-left, .art-index { left: 8px; }
  .art-right, .art-cross { right: 8px; }
  .art-index, .art-cross { bottom: 8px; }
  .panel-heading { padding: 12px; }
  .lab-body { padding: 11px; }
  .settings { gap: 8px; }
  .segments button { font-size: 10px; }
  .segments button .icon { display: none; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .site-footer { flex-wrap: wrap; }
}
@media (max-width: 415px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .segments button { font-size: 11px; }
  .segments button .icon { display: block; }
  .rune-deck, .signal-deck { padding: 8px; }
  .hud > div { padding-inline: 3px; }
  .hud span, .deck-label { letter-spacing: 0; }
  .art-index { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
