:root {
  --ink: #f6f8ff;
  --muted: #aeb8dc;
  --night: #0a0f26;
  --panel: #111735;
  --panel-2: #171f43;
  --line: rgba(173, 189, 255, .18);
  --calc: #ff6e8a;
  --calc-soft: #ffb3c1;
  --visual: #a879ff;
  --visual-soft: #d3baff;
  --signal: #35d6d0;
  --signal-soft: #a2ffef;
  --gold: #ffd66b;
  --shadow: 0 24px 70px rgba(2, 7, 24, .42);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--night);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 13%, rgba(168, 121, 255, .22), transparent 25rem),
    radial-gradient(circle at 92% 80%, rgba(53, 214, 208, .15), transparent 28rem),
    linear-gradient(145deg, #090d20 0%, #101632 48%, #070b1b 100%);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  touch-action: manipulation;
}

button, a { -webkit-tap-highlight-color: transparent; }

button {
  color: inherit;
  font: inherit;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 32px));
  min-height: 58px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #eaf2ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .13em;
  text-decoration: none;
}

.brand-chip {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 2px solid var(--signal);
  border-radius: 7px;
  background: #131c3d;
  box-shadow: 0 0 18px rgba(53, 214, 208, .45);
}

.brand-chip::before, .brand-chip::after {
  position: absolute;
  width: 37px;
  height: 16px;
  border-right: 2px solid var(--signal);
  border-left: 2px solid var(--signal);
  content: "";
}

.brand-chip::after { transform: rotate(90deg); }
.brand-chip b { font-size: 13px; }

.top-actions { display: flex; gap: 8px; }

.top-button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(16, 22, 50, .7);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.top-button:hover, .top-button[aria-pressed="true"] {
  border-color: rgba(53, 214, 208, .6);
  color: #fff;
  background: rgba(53, 214, 208, .12);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 42px);
  align-items: center;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 22px;
}

.intro { min-width: 0; padding: 8px 0; }

.eyebrow, .screen-kicker {
  margin: 0 0 8px;
  color: var(--signal);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .18em;
}

.intro h1 {
  margin: 0;
  font-size: clamp(34px, 4.25vw, 58px);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.intro h1 em {
  display: inline-block;
  padding: 4px 0 8px;
  color: transparent;
  background: linear-gradient(90deg, #fff 5%, var(--signal-soft) 42%, var(--visual-soft));
  -webkit-background-clip: text;
  background-clip: text;
  font-style: normal;
}

.lead {
  margin: 12px 0 14px;
  color: #cdd5f1;
  font-size: clamp(14px, 1.45vw, 17px);
  font-weight: 700;
  line-height: 1.75;
}

.hero-machine {
  position: relative;
  display: grid;
  width: 170px;
  height: 160px;
  margin: 0 auto 6px;
  place-items: center;
}

.orbit {
  position: absolute;
  width: 162px;
  height: 82px;
  border: 1px solid rgba(53, 214, 208, .35);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.orbit-b {
  width: 138px;
  transform: rotate(52deg);
  border-color: rgba(168, 121, 255, .4);
}

.hero-chip {
  position: relative;
  display: grid;
  width: 98px;
  height: 98px;
  place-items: center;
  border: 4px solid #c7fff7;
  border-radius: 25px;
  background: linear-gradient(145deg, #203168, #101735);
  box-shadow: inset 0 0 22px rgba(53, 214, 208, .25), 0 0 32px rgba(53, 214, 208, .2);
}

.hero-chip::before, .hero-chip::after {
  position: absolute;
  width: 126px;
  height: 62px;
  border-right: 7px dotted #9cefe6;
  border-left: 7px dotted #9cefe6;
  content: "";
}

.hero-chip::after { transform: rotate(90deg); }

.hero-chip span {
  position: absolute;
  top: 22px;
  width: 45px;
  height: 24px;
  border: 3px solid var(--signal);
  border-top: 0;
  border-radius: 0 0 22px 22px;
}

.hero-chip span::before, .hero-chip span::after {
  position: absolute;
  top: -4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.hero-chip span::before { left: 8px; }
.hero-chip span::after { right: 8px; }
.hero-chip b { margin-top: 23px; font-size: 24px; }
.hero-chip small { position: absolute; bottom: 8px; font-size: 7px; font-weight: 900; letter-spacing: .12em; }

.spark { position: absolute; font-weight: 900; }
.spark-a { top: 12px; right: 6px; color: var(--gold); font-size: 19px; }
.spark-b { bottom: 19px; left: 2px; color: var(--calc); }
.spark-c { top: 43px; left: 13px; color: var(--visual); font-size: 9px; }

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 4px 0 10px;
  padding: 0;
  list-style: none;
}

.feature-list li {
  min-width: 0;
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(20, 28, 62, .66);
  text-align: center;
}

.feature-list b { display: block; color: var(--signal-soft); font-size: 22px; line-height: 1; }
.feature-list span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 1.45; }
.save-note { margin: 0; color: #7f8ab3; font-size: 10px; text-align: center; }

.game-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(166, 187, 255, .24);
  border-radius: 25px;
  background: linear-gradient(145deg, rgba(18, 25, 56, .98), rgba(10, 15, 37, .99));
  box-shadow: var(--shadow);
}

.game-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, .035), transparent 42%);
  content: "";
}

.circuit-bg {
  position: absolute;
  inset: 0;
  opacity: .12;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(128, 150, 222, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 150, 222, .22) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

.status-bar {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 50px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 31, .58);
}

.status-bar > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 7px 14px;
  border-right: 1px solid var(--line);
}

.status-bar > div:last-child { border-right: 0; }
.status-bar small { color: #7e8ab7; font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.status-bar strong { overflow: hidden; margin-top: 2px; font-size: 16px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
#integrity-label { color: var(--calc-soft); letter-spacing: .14em; }

.stage-progress { position: relative; padding: 8px 14px 7px; border-bottom: 1px solid var(--line); }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.progress-copy span { color: var(--signal); }
.progress-copy b { color: var(--muted); }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: #080d24; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--signal), var(--visual)); box-shadow: 0 0 12px var(--signal); transition: width .25s ease; }

.next-lane {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 41, .65);
}

.lane-label { color: #7884ad; font-size: 8px; font-weight: 1000; letter-spacing: .14em; }
.next-jobs { display: flex; flex: 1; gap: 6px; min-width: 0; }
.next-chip { display: inline-flex; gap: 6px; align-items: center; min-width: 0; padding: 5px 8px; border: 1px solid currentColor; border-radius: 8px; font-size: 9px; font-weight: 900; }
.next-chip i { font-style: normal; font-size: 12px; }
.next-chip small { color: #dce2f8; white-space: nowrap; }
.next-chip.type-calc { color: var(--calc); background: rgba(255, 110, 138, .09); }
.next-chip.type-visual { color: var(--visual); background: rgba(168, 121, 255, .09); }
.next-chip.type-signal { color: var(--signal); background: rgba(53, 214, 208, .09); }
.next-empty { color: #65719b; font-size: 10px; }
.combo-badge { padding: 5px 8px; border-radius: 7px; color: var(--gold); background: rgba(255, 214, 107, .08); font-size: 9px; font-weight: 1000; white-space: nowrap; }
.combo-badge.is-hot { animation: pulse .45s ease; }

.workbench {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
}

.job-console {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 13, 34, .72);
}

.bot-message { display: flex; gap: 7px; align-items: center; min-height: 36px; }
.bot-message p { margin: 0; color: #c9d2ef; font-size: 10px; font-weight: 800; line-height: 1.4; }
.mini-bot { position: relative; display: grid; flex: 0 0 30px; width: 30px; height: 28px; place-items: center; border: 2px solid var(--signal); border-radius: 8px; background: #16214a; }
.mini-bot::before { position: absolute; top: -5px; width: 7px; height: 5px; border-radius: 4px 4px 0 0; background: var(--signal); content: ""; }
.mini-bot i { position: absolute; top: 7px; width: 17px; height: 6px; border-bottom: 2px solid var(--signal); border-radius: 50%; }
.mini-bot b { margin-top: 10px; font-size: 9px; }

.current-job {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 9px;
  align-items: center;
  min-height: 112px;
  margin-top: 8px;
  padding: 13px 9px 10px;
  overflow: hidden;
  border: 1px solid currentColor;
  border-radius: 14px;
  transition: color .15s ease, transform .15s ease;
}

.current-job::after { position: absolute; right: -30px; bottom: -45px; width: 95px; height: 95px; border: 1px solid currentColor; border-radius: 50%; opacity: .16; content: ""; }
.current-job.type-calc { color: var(--calc); background: linear-gradient(145deg, rgba(255, 110, 138, .15), rgba(255, 110, 138, .03)); }
.current-job.type-visual { color: var(--visual); background: linear-gradient(145deg, rgba(168, 121, 255, .17), rgba(168, 121, 255, .03)); }
.current-job.type-signal { color: var(--signal); background: linear-gradient(145deg, rgba(53, 214, 208, .14), rgba(53, 214, 208, .03)); }
.current-job.is-changing { transform: scale(.97); }
.rare-label { position: absolute; top: 0; right: 0; display: none; padding: 3px 7px; border-radius: 0 0 0 7px; color: #2b2100; background: var(--gold); font-size: 7px; font-weight: 1000; }
.current-job.is-rare .rare-label { display: block; }
.job-icon { display: grid; width: 51px; height: 51px; place-items: center; border: 2px solid currentColor; border-radius: 13px; background: rgba(7, 10, 27, .5); font-size: 26px; font-weight: 900; box-shadow: 0 0 15px color-mix(in srgb, currentColor 25%, transparent); }
.job-copy { min-width: 0; }
.job-copy small { font-size: 7px; font-weight: 1000; letter-spacing: .1em; }
.job-copy h2 { margin: 2px 0 8px; color: #fff; font-size: 15px; line-height: 1.25; }
.job-meters { display: grid; gap: 4px; }
.job-meters span { display: flex; justify-content: space-between; color: #929dc5; font-size: 8px; }
.job-meters b { color: #fff; font-size: 8px; }

.dispatch-actions { display: flex; gap: 7px; align-items: stretch; margin-top: auto; padding-top: 8px; }
.dispatch-actions p { display: flex; flex: 1; flex-direction: column; justify-content: center; margin: 0; color: #b5bfde; font-size: 9px; line-height: 1.45; }
.dispatch-actions p span { color: #7481ac; }
.turbo-button { display: flex; flex: 0 0 72px; flex-direction: column; align-items: center; justify-content: center; min-height: 55px; padding: 5px; border: 1px solid rgba(255, 214, 107, .4); border-radius: 10px; color: var(--gold); background: rgba(255, 214, 107, .07); cursor: pointer; }
.turbo-button span { font-size: 16px; line-height: 1; }
.turbo-button b { font-size: 10px; }
.turbo-button small { color: #9b8d60; font-size: 7px; }
.turbo-button[aria-pressed="true"] { color: #2c2100; background: var(--gold); box-shadow: 0 0 20px rgba(255, 214, 107, .4); transform: translateY(-1px); }
.turbo-button:disabled { opacity: .35; cursor: not-allowed; }

.advance-button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 78px; margin-top: auto; border: 1px solid var(--signal); border-radius: 12px; color: var(--signal-soft); background: rgba(53, 214, 208, .1); cursor: pointer; }
.advance-button span { font-size: 18px; }
.advance-button b { font-size: 11px; }
.advance-button small { color: #8192bd; font-size: 8px; }

.core-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; min-width: 0; }

.core-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 246px;
  padding: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  background: linear-gradient(160deg, rgba(29, 39, 82, .9), rgba(11, 16, 39, .96));
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.core-card:hover { transform: translateY(-2px); }
.core-card.core-calc:hover, .core-card.core-calc.is-match { border-color: var(--calc); box-shadow: inset 0 0 25px rgba(255, 110, 138, .08), 0 8px 24px rgba(255, 110, 138, .12); }
.core-card.core-visual:hover, .core-card.core-visual.is-match { border-color: var(--visual); box-shadow: inset 0 0 25px rgba(168, 121, 255, .09), 0 8px 24px rgba(168, 121, 255, .12); }
.core-card.core-signal:hover, .core-card.core-signal.is-match { border-color: var(--signal); box-shadow: inset 0 0 25px rgba(53, 214, 208, .08), 0 8px 24px rgba(53, 214, 208, .12); }
.core-card.is-full { opacity: .58; }
.core-card.is-full::after { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(7, 10, 27, .62); content: "QUEUE FULL"; font-size: 10px; font-weight: 1000; letter-spacing: .12em; }
.core-card.is-error { animation: shake .32s ease; }
.key-cap { position: absolute; top: 8px; right: 8px; display: grid; width: 18px; height: 18px; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 5px; color: #8994bc; background: #0b1028; font-size: 8px; font-weight: 900; }
.core-head { display: flex; gap: 5px; align-items: center; padding-right: 20px; }
.core-head > i { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 8px; font-style: normal; font-size: 14px; font-weight: 900; }
.core-calc .core-head > i { color: var(--calc); background: rgba(255, 110, 138, .12); }
.core-visual .core-head > i { color: var(--visual); background: rgba(168, 121, 255, .12); }
.core-signal .core-head > i { color: var(--signal); background: rgba(53, 214, 208, .12); }
.core-head > span { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.core-head small { overflow: hidden; color: #6975a1; font-size: 5px; font-weight: 1000; letter-spacing: .06em; text-overflow: ellipsis; white-space: nowrap; }
.core-head b { overflow: hidden; margin-top: 1px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.core-head em { display: none; font-size: 8px; font-style: normal; font-weight: 900; }

.core-ring { position: relative; display: grid; width: 62px; height: 62px; margin: 9px auto 8px; place-items: center; border: 1px solid currentColor; border-radius: 50%; }
.core-ring::before, .core-ring::after { position: absolute; border: 1px solid currentColor; border-radius: 50%; opacity: .3; content: ""; }
.core-ring::before { inset: 6px; }
.core-ring::after { inset: -5px; border-style: dashed; animation: spin 12s linear infinite; }
.core-ring i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; transform: translateY(-27px); }
.core-ring b { font-size: 25px; }
.core-calc .core-ring { color: var(--calc); background: radial-gradient(circle, rgba(255, 110, 138, .2), transparent 68%); }
.core-visual .core-ring { color: var(--visual); background: radial-gradient(circle, rgba(168, 121, 255, .22), transparent 68%); }
.core-signal .core-ring { color: var(--signal); background: radial-gradient(circle, rgba(53, 214, 208, .18), transparent 68%); }

.queue-title { display: flex; justify-content: space-between; margin-bottom: 4px; color: #68749f; font-size: 6px; letter-spacing: .07em; }
.job-queue { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.queue-job, .queue-empty { position: relative; display: grid; grid-template-columns: 20px 1fr auto; gap: 4px; align-items: center; min-height: 26px; padding: 3px 5px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(7, 11, 29, .7); }
.queue-job > i { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 5px; font-style: normal; font-size: 9px; font-weight: 1000; }
.queue-job.type-calc > i { color: var(--calc); background: rgba(255, 110, 138, .14); }
.queue-job.type-visual > i { color: var(--visual); background: rgba(168, 121, 255, .14); }
.queue-job.type-signal > i { color: var(--signal); background: rgba(53, 214, 208, .14); }
.queue-job > span { position: relative; display: block; height: 4px; overflow: hidden; border-radius: 99px; background: #20294e; }
.queue-job > span b { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: inherit; background: currentColor; }
.queue-job.type-calc > span { color: var(--calc); }
.queue-job.type-visual > span { color: var(--visual); }
.queue-job.type-signal > span { color: var(--signal); }
.queue-job > small { color: #c1c9e6; font-size: 6px; font-weight: 900; }
.queue-job.is-urgent > small { color: var(--calc-soft); animation: blink 1s steps(2) infinite; }
.queue-empty { display: block; min-height: 20px; border-style: dashed; opacity: .32; }

.panel-footer { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 5px 12px; border-top: 1px solid var(--line); color: #7481ab; font-size: 8px; }
.panel-footer > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-footer button { flex: 0 0 auto; margin-left: 8px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: #a9b2d3; background: transparent; cursor: pointer; font-size: 8px; font-weight: 800; }

.toast { position: absolute; z-index: 7; top: 122px; left: 50%; min-width: 150px; max-width: calc(100% - 24px); padding: 8px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #fff; background: rgba(8, 12, 31, .94); box-shadow: 0 12px 30px rgba(0,0,0,.35); font-size: 10px; font-weight: 900; text-align: center; opacity: 0; pointer-events: none; transform: translate(-50%, -10px); transition: opacity .18s ease, transform .18s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-good { border-color: rgba(53, 214, 208, .65); color: var(--signal-soft); }
.toast.is-bad { border-color: rgba(255, 110, 138, .65); color: var(--calc-soft); }
.toast.is-gold { border-color: var(--gold); color: var(--gold); }

.screen { position: absolute; z-index: 8; inset: 0; display: grid; padding: 12px; overflow-y: auto; place-items: center; background: rgba(5, 8, 24, .79); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.screen.is-visible { opacity: 1; pointer-events: auto; }
.screen-card { width: min(500px, 100%); max-height: 100%; padding: 22px; overflow-y: auto; border: 1px solid rgba(183, 199, 255, .23); border-radius: 22px; background: linear-gradient(155deg, #1b2550, #0e1534 70%); box-shadow: 0 24px 80px rgba(0,0,0,.55); text-align: center; }
.screen-card h2 { margin: 0 0 9px; font-size: clamp(22px, 3.1vw, 32px); line-height: 1.2; }
.screen-card > p:not(.screen-kicker) { margin: 0 0 13px; color: #b8c2e0; font-size: 12px; line-height: 1.7; }
.screen-kicker { color: var(--signal); }

.start-card { width: min(450px, 100%); }
.start-bot { position: relative; display: grid; height: 74px; margin-bottom: 5px; place-items: center; }
.start-bot > span { position: relative; display: grid; width: 70px; height: 57px; place-items: center; border: 3px solid var(--signal-soft); border-radius: 16px; background: #172452; box-shadow: 0 0 22px rgba(53, 214, 208, .25); }
.start-bot > span::before { position: absolute; top: -10px; width: 14px; height: 10px; border-radius: 8px 8px 0 0; background: var(--signal); content: ""; }
.start-bot > span i { position: absolute; top: 14px; width: 37px; height: 15px; border: 3px solid var(--signal); border-top: 0; border-radius: 0 0 22px 22px; }
.start-bot > span i::before, .start-bot > span i::after { position: absolute; top: -4px; width: 6px; height: 6px; border-radius: 50%; background: #fff; content: ""; }
.start-bot > span i::before { left: 7px; }
.start-bot > span i::after { right: 7px; }
.start-bot > span b { margin-top: 24px; }
.start-bot em { position: absolute; top: 0; right: calc(50% - 80px); padding: 4px 7px; border-radius: 8px 8px 8px 0; color: #2a2000; background: var(--gold); font-size: 8px; font-style: normal; font-weight: 1000; }
.start-tips { display: flex; justify-content: center; gap: 7px; margin: 12px 0 15px; }
.start-tips span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; color: #bdc7e5; font-size: 9px; font-weight: 800; }
.start-tips i { font-style: normal; font-weight: 1000; }
.tip-calc { color: var(--calc); }.tip-visual { color: var(--visual); }.tip-signal { color: var(--signal); }

.primary-button { width: min(310px, 100%); min-height: 46px; padding: 10px 16px; border: 0; border-radius: 13px; color: #071320; background: linear-gradient(90deg, var(--signal), #83ffe8); box-shadow: 0 10px 24px rgba(53, 214, 208, .2); cursor: pointer; font-size: 13px; font-weight: 1000; }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.07); }
.text-button { display: block; margin: 9px auto 0; padding: 5px 10px; border: 0; color: #98a5cd; background: transparent; cursor: pointer; font-size: 10px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.badge-shelf { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.badge-shelf > small { color: #7180ac; font-size: 7px; font-weight: 1000; letter-spacing: .13em; }
.badge-list { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.badge { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #4f5b82; background: #0b112b; font-size: 14px; filter: grayscale(1); }
.badge.is-earned { border-color: rgba(255, 214, 107, .5); color: var(--gold); background: rgba(255, 214, 107, .08); filter: none; box-shadow: 0 0 12px rgba(255, 214, 107, .12); }

.help-card { text-align: left; }
.help-card .screen-kicker, .help-card h2 { text-align: center; }
.help-card ol { display: grid; gap: 7px; margin: 12px 0; padding: 0; list-style: none; }
.help-card li { display: grid; grid-template-columns: 27px 1fr; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; color: #bfc9e8; font-size: 10px; line-height: 1.55; }
.help-card li > b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: #071320; background: var(--signal); font-size: 12px; }
.help-note { display: flex; gap: 10px; align-items: center; padding: 9px; border: 1px solid rgba(255, 214, 107, .3); border-radius: 10px; background: rgba(255, 214, 107, .06); }
.help-note b { flex: 0 0 auto; color: var(--gold); font-size: 11px; }
.help-note span { color: #aeb9d9; font-size: 9px; line-height: 1.45; }
.keyboard-note { margin-top: 10px !important; color: #7784af !important; font-size: 9px !important; text-align: center; }
.help-card .primary-button { display: block; margin: 11px auto 0; }

.upgrade-card { width: min(580px, 100%); }
.upgrade-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 13px 0 10px; }
.upgrade-option { display: flex; flex-direction: column; align-items: center; min-height: 155px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(8, 13, 34, .62); cursor: pointer; transition: transform .15s ease, border-color .15s ease; }
.upgrade-option:hover { transform: translateY(-3px); border-color: var(--signal); }
.upgrade-option > i { display: grid; width: 48px; height: 48px; margin-bottom: 8px; place-items: center; border: 1px solid var(--signal); border-radius: 14px; color: var(--signal-soft); background: rgba(53, 214, 208, .09); font-size: 22px; font-style: normal; }
.upgrade-option b { font-size: 11px; }
.upgrade-option small { margin-top: 6px; color: #939fc4; font-size: 9px; line-height: 1.5; }
.upgrade-note { color: #707da9; font-size: 8px; }

.result-card { width: min(450px, 100%); }
.result-bot { font-size: 50px; filter: drop-shadow(0 0 14px rgba(53,214,208,.35)); }
.result-score { position: relative; display: flex; flex-direction: column; width: min(260px, 100%); margin: 10px auto; padding: 9px; border: 1px solid rgba(255, 214, 107, .32); border-radius: 13px; background: rgba(255, 214, 107, .06); }
.result-score small { color: #8e8462; font-size: 8px; font-weight: 1000; letter-spacing: .14em; }
.result-score strong { color: var(--gold); font-size: 30px; line-height: 1.2; }
.result-score em { position: absolute; top: -8px; right: -5px; display: none; padding: 3px 6px; border-radius: 7px; color: #281e00; background: var(--gold); font-size: 7px; font-style: normal; font-weight: 1000; transform: rotate(5deg); }
.result-score.is-best em { display: block; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 10px 0 14px; }
.result-stats div { padding: 8px 5px; border: 1px solid var(--line); border-radius: 9px; background: rgba(8, 13, 34, .55); }
.result-stats small { display: block; color: #7783ac; font-size: 7px; }
.result-stats b { display: block; margin-top: 3px; font-size: 14px; }

footer { padding: 0 16px 18px; color: #4f5c86; font-size: 8px; font-weight: 900; letter-spacing: .18em; text-align: center; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes blink { 50% { opacity: .45; } }

@media (max-width: 1040px) {
  .page-shell { grid-template-columns: 1fr; width: min(820px, calc(100% - 24px)); }
  .intro { display: grid; grid-template-columns: 1fr 170px; align-items: center; }
  .intro .eyebrow, .intro h1, .intro .lead { grid-column: 1; }
  .hero-machine { grid-column: 2; grid-row: 1 / span 3; }
  .feature-list, .save-note { grid-column: 1 / -1; }
  .intro h1 { font-size: clamp(34px, 7vw, 52px); }
}

@media (max-width: 680px) {
  .topbar { width: calc(100% - 20px); min-height: 52px; }
  .brand { font-size: 10px; letter-spacing: .08em; }
  .brand-chip { width: 25px; height: 25px; }
  .brand-chip::before, .brand-chip::after { width: 32px; height: 13px; }
  .top-button { min-height: 32px; padding: 5px 8px; font-size: 9px; }
  .page-shell { width: min(480px, calc(100% - 16px)); padding-top: 8px; }
  .intro { display: block; padding: 7px 3px; }
  .intro h1 { font-size: clamp(36px, 12.5vw, 52px); }
  .lead { margin-bottom: 8px; }
  .hero-machine { display: none; }
  .feature-list { margin-top: 8px; }
  .game-panel { border-radius: 19px; }
  .status-bar > div { padding: 7px 8px; }
  .status-bar small { font-size: 6px; }
  .status-bar strong { font-size: 13px; }
  .stage-progress { padding-right: 9px; padding-left: 9px; }
  .next-lane { padding-right: 9px; padding-left: 9px; }
  .next-chip { padding: 4px 5px; }
  .next-chip small { display: none; }
  .workbench { grid-template-columns: 1fr; padding: 8px; }
  .job-console { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 7px; padding: 8px; }
  .bot-message { grid-column: 1 / -1; }
  .current-job { min-height: 103px; margin-top: 0; }
  .dispatch-actions { flex-direction: column; margin: 0; padding: 0; }
  .dispatch-actions p { text-align: center; }
  .turbo-button { flex-basis: auto; width: 100%; min-height: 60px; }
  .advance-button { grid-column: 1 / -1; min-height: 58px; margin: 0; }
  .core-grid { grid-template-columns: 1fr; }
  .core-card { display: grid; grid-template-columns: 1fr 62px minmax(112px, 1.2fr); grid-template-rows: auto 1fr; column-gap: 8px; min-height: 112px; padding: 8px; }
  .core-head { grid-column: 1; grid-row: 1; }
  .core-ring { grid-column: 2; grid-row: 1 / span 2; margin: auto; }
  .queue-title { grid-column: 3; grid-row: 1; margin: 0; padding-right: 2px; }
  .job-queue { grid-column: 1 / 4; grid-row: 2; display: grid; grid-template-columns: repeat(3, 1fr); align-self: end; margin-top: 7px; }
  .queue-job, .queue-empty { min-width: 0; }
  .core-card .key-cap { display: none; }
  .panel-footer { min-height: 37px; }
  .screen-card { padding: 18px 14px; }
  .upgrade-options { grid-template-columns: 1fr; }
  .upgrade-option { display: grid; grid-template-columns: 48px 1fr; min-height: 72px; text-align: left; column-gap: 10px; }
  .upgrade-option > i { grid-row: 1 / span 2; margin: 0; }
  .upgrade-option b, .upgrade-option small { align-self: center; }
}

@media (max-width: 390px) {
  .top-actions { gap: 4px; }
  #help-button { width: 32px; overflow: hidden; white-space: nowrap; }
  .feature-list span { font-size: 9px; }
  .job-console { grid-template-columns: minmax(0, 1fr) 93px; }
  .current-job { grid-template-columns: 43px 1fr; padding-right: 6px; padding-left: 6px; }
  .job-icon { width: 42px; height: 42px; }
  .job-copy h2 { font-size: 13px; }
  .core-card { grid-template-columns: 1fr 54px minmax(98px, 1.1fr); }
  .core-ring { width: 52px; height: 52px; }
  .core-ring i { transform: translateY(-22px); }
  .queue-job { grid-template-columns: 17px 1fr auto; padding: 2px 3px; }
  .queue-job > i { width: 15px; height: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
