:root {
  color-scheme: dark;
  --gold: #a96ae0;
  --gold-bright: #8806f9;
  --red: #d94d53;
  --ink: #f1ecf6;
  --muted: #77767b;
  --line: rgba(121, 119, 125, .28);
  --black: #08080a;
  --panel: rgba(4, 4, 6, .74);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { color: #c9c7c7; background: var(--black); font-family: var(--mono); overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
.grid-background { position: fixed; inset: 0; pointer-events: none; opacity: .82; background-image: linear-gradient(rgba(26, 16, 44, .42) 1px, transparent 1px), linear-gradient(90deg, rgba(26, 16, 44, .42) 1px, transparent 1px); background-size: 40px 40px; }
.ambient { position: fixed; inset: 0; pointer-events: none; }
.ambient-gold { background: radial-gradient(ellipse at 77% 36%, rgba(188, 150, 15, .11), transparent 47%); }
.ambient-red { background: radial-gradient(ellipse at 16% 73%, rgba(115, 11, 35, .14), transparent 48%); }
.app-shell { position: relative; width: min(1136px, calc(100% - 32px)); min-height: 100vh; margin: 0 auto; }
.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(100, 100, 100, .26); }
.topbar-left, .topbar-right, .brand-line, .system-caption, .energy-caption { display: flex; align-items: center; }
.topbar-left { gap: 20px; }
.back-button { position: relative; width: 44px; height: 44px; border: 1px solid rgba(225, 193, 44, .52); border-radius: 8px; background: rgba(0, 0, 0, .48); color: var(--gold-bright); font-family: Arial, sans-serif; font-size: 36px; line-height: 33px; font-weight: 200; }
.back-button::before, .back-button::after { position: absolute; width: 8px; height: 8px; content: ""; border-color: rgba(225, 193, 44, .55); }
.back-button::before { top: -4px; left: -4px; border-top: 1px solid; border-left: 1px solid; }
.back-button::after { right: -4px; bottom: -4px; border-right: 1px solid; border-bottom: 1px solid; }
.brand-line { gap: 12px; }
.brand h1 { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 30px; line-height: 1; font-weight: 900; letter-spacing: .1em; font-style: italic; white-space: nowrap; }
.brand h1 span { color: var(--gold-bright); text-shadow: 0 0 13px rgba(180, 120, 255, .52); }
.ready-badge { padding: 5px 9px; border: 1px solid rgba(180, 120, 255, .5); border-radius: 3px; color: var(--gold-bright); background: rgba(180, 120, 255, .12); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.system-caption { gap: 10px; margin-top: 7px; color: #4f4d4f; font-size: 9px; letter-spacing: .18em; }
.system-caption i { width: 39px; height: 1px; background: var(--gold); opacity: .62; }
.topbar-right { gap: 25px; }
.bind-button { padding: 9px 15px; border: 1px solid rgba(168, 167, 161, .35); border-radius: 5px; background: rgba(0, 0, 0, .27); color: #aaa8a0; font-size: 10px; }
.bind-button:hover { border-color: rgba(180, 120, 255, .5); color: var(--gold); }
.link-icon { display: inline-block; margin-right: 5px; transform: rotate(-35deg); opacity: .7; }
.bind-short { display: none; }
.energy-readout { min-width: 122px; }
.energy-bars { display: flex; justify-content: flex-end; gap: 3px; height: 12px; }
.energy-bars b { width: 14px; height: 7px; transform: skewX(-20deg); background: #24252a; }
.energy-bars b:nth-child(-n+2) { background: #27282d; }
.energy-caption { justify-content: flex-end; gap: 7px; margin-top: 3px; color: #555359; font-size: 8px; letter-spacing: .04em; }
.energy-caption i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 7px var(--gold-bright); }
.toast { position: fixed; z-index: 20; top: 96px; left: 50%; min-width: 348px; max-width: calc(100vw - 40px); padding: 10px 16px; transform: translateX(-50%) translateY(-20px); border: 1px solid #811cda; border-radius: 5px; color: #f5eafe; background: rgba(199, 68, 0, .9); box-shadow: 0 0 25px rgba(245, 128, 22, .45); text-align: center; font-family: var(--sans); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.main-layout { display: grid; grid-template-columns: 288px minmax(480px, 1fr) 102px; align-items: start; gap: 30px; padding-top: 194px; }
.side-column { display: flex; flex-direction: column; gap: 26px; align-self: start; }
.panel { position: relative; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); box-shadow: 0 0 35px rgba(0, 0, 0, .26); }
.panel::before { position: absolute; left: -1px; bottom: -1px; width: 30px; height: 30px; content: ""; border-bottom: 2px solid rgba(180, 120, 255, .35); border-left: 2px solid rgba(180, 120, 255, .35); }
.target-panel { min-height: 316px; padding: 16px; }
.history-panel { min-height: 95px; padding: 16px; }
.panel-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 17px; color: var(--gold-bright); font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.heading-icon { color: var(--gold-bright); font-size: 15px; opacity: .85; }
.target-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.target-chip { min-height: 29px; display: flex; align-items: center; justify-content: center; padding: 5px 3px; border: 1px solid rgba(105, 104, 107, .35); color: #a8a4a7; font-family: var(--sans); font-size: 10px; transition: color .3s, border .3s, background .3s, box-shadow .3s; }
.target-chip.collected { border-color: rgba(180, 120, 255, .78); color: var(--gold-bright); background: rgba(180, 120, 255, .16); box-shadow: 0 0 13px rgba(180, 120, 255, .17); }
.history-list { max-height: 116px; overflow-y: auto; scrollbar-color: rgba(180, 120, 255, .6) transparent; }
.empty-history { margin: 14px 0 4px; color: #737073; font-size: 9px; font-style: italic; }
.history-entry { display: flex; align-items: center; gap: 8px; min-height: 23px; padding: 5px 0 5px 9px; border-left: 1px solid rgba(180, 120, 255, .52); color: #d2d0d0; font-family: var(--sans); font-size: 9px; }
.history-entry i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold-bright); }
.machine-column { width: 100%; max-width: 576px; justify-self: center; }
.machine { position: relative; border: 2px solid rgba(79, 80, 85, .43); border-radius: 8px; background: rgba(13, 13, 15, .91); box-shadow: 0 0 55px rgba(0, 0, 0, .75); }
.machine-header { height: 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid rgba(68, 69, 73, .5); color: rgba(180, 120, 255, .53); font-size: 9px; letter-spacing: .2em; }
.machine-header > span:first-child i { margin-right: 7px; font-style: normal; }
.machine-lights { display: flex; gap: 8px; }
.machine-lights i { width: 6px; height: 6px; border-radius: 50%; background: rgba(180, 120, 255, .17); }
.machine-lights i:last-child { background: rgba(217, 77, 83, .3); }
.reel-chamber { position: relative; display: flex; gap: 13px; padding: 24px; background: #010101; }
.reel-chamber::before { position: absolute; inset: 8px; content: ""; pointer-events: none; border: 1px solid rgba(180, 120, 255, .6); }
.reel-chamber::after { position: absolute; inset: 15px 20px; content: ""; pointer-events: none; border-top: 1px solid rgba(180, 120, 255, .15); border-bottom: 1px solid rgba(180, 120, 255, .15); }
.reel { position: relative; z-index: 1; flex: 1; height: 160px; overflow: hidden; border: 1px solid rgba(180, 120, 255, .52); background: repeating-linear-gradient(0deg, rgba(255,255,255,.018), rgba(255,255,255,.018) 2px, transparent 2px, transparent 5px); }
.reel-track { position: absolute; inset: 0 0 auto; width: 100%; transform: translateY(0); transition: transform 1.6s cubic-bezier(.45,.05,.55,.95); }
.reel-row { height: 160px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border-bottom: 1px solid rgba(100, 100, 100, .17); color: #77777f; font-family: var(--sans); font-size: 28px; font-weight: 800; white-space: nowrap; }
.reel.result .reel-row.active { color: var(--gold-bright); text-shadow: 0 0 14px rgba(180, 120, 255, .7); }
.reel.result .reel-row.active::after { position: absolute; right: 7px; left: 7px; height: 1px; content: ""; background: rgba(180, 120, 255, .28); }
.machine-footer { height: 69px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-top: 1px solid rgba(79, 80, 85, .36); background: rgba(44, 44, 47, .27); }
.signal { display: flex; flex-direction: column; gap: 5px; color: rgba(180, 120, 255, .6); font-size: 8px; }
.signal > div { display: flex; gap: 2px; }
.signal b { width: 5px; height: 9px; border-radius: 1px; background: var(--gold-bright); box-shadow: 0 0 6px rgba(180, 120, 255, .5); }
.signal b:last-child { background: #48464a; box-shadow: none; }
.machine-state { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.machine-state strong { color: var(--gold-bright); font-size: 11px; text-shadow: 0 0 9px rgba(180, 120, 255, .45); }
.machine-state small { color: rgba(180, 120, 255, .55); font-size: 8px; }
.machine-state em { color: var(--gold-bright); font-style: normal; }
.mobile-action { display: none; }
.report { position: relative; min-height: 80px; display: flex; align-items: center; justify-content: space-between; margin-top: 26px; padding: 14px 18px; border: 1px solid rgba(180, 120, 255, .42); border-radius: 4px; background: rgba(0, 0, 0, .82); box-shadow: 0 0 36px rgba(180, 120, 255, .15); overflow: hidden; }
.report[hidden] { display: none; }
.report-accent { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--gold-bright); box-shadow: 0 0 13px var(--gold-bright); }
.report h2 { margin: 0 0 8px; color: rgba(180, 120, 255, .7); font-size: 9px; letter-spacing: .25em; }
.report h2 small { font-size: inherit; }
.report p { margin: 0; color: var(--ink); font-family: var(--sans); font-size: 25px; font-weight: 900; font-style: italic; letter-spacing: .03em; text-shadow: 0 0 11px rgba(180, 120, 255, .42); }
.locked-mark { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--gold-bright); }
.locked-mark span { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(180, 120, 255, .7); border-radius: 50%; background: rgba(180, 120, 255, .16); font-size: 20px; }
.locked-mark small { font-size: 8px; }
.lever-column { align-self: start; margin-top: 27px; }
.lever-housing { position: relative; width: 96px; height: 224px; border: 2px solid rgba(112, 111, 119, .54); border-radius: 13px; background: rgba(10, 10, 13, .95); box-shadow: inset 0 0 22px rgba(0, 0, 0, .8); }
.lever-lights { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 8px; }
.lever-lights i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-bright); box-shadow: 0 0 7px var(--gold-bright); }
.lever-lights i:last-child { background: #454348; box-shadow: none; }
.lever-slot { position: absolute; top: 35px; bottom: 39px; left: 50%; width: 11px; transform: translateX(-50%); border: 1px solid rgba(98, 98, 104, .7); border-radius: 9px; background: #030304; box-shadow: inset 0 0 10px #000; }
.lever-button { position: absolute; bottom: 14px; left: 50%; width: 19px; height: 154px; padding: 0; transform: translateX(-50%); border: 0; background: transparent; }
.lever-button:disabled { cursor: not-allowed; }
.lever-rod { position: absolute; bottom: 16px; left: 50%; width: 8px; height: 126px; transform: translateX(-50%); border: 1px solid #77757b; border-radius: 6px; background: linear-gradient(90deg, #28272d, #77757b, #302e34); box-shadow: 0 0 8px #000; transition: transform .3s; transform-origin: bottom center; }
.lever-ball { position: absolute; top: 0; left: 50%; z-index: 1; width: 40px; height: 40px; transform: translateX(-50%); border: 1px solid #9f4ee5; border-radius: 50%; background: radial-gradient(circle at 34% 28%, #d4a5fd 0 7%, #8f16f9 19%, #551b87 83%); box-shadow: 0 0 14px rgba(180, 120, 255, .65); transition: transform .3s; }
.lever-button:active .lever-rod, .lever-button.pulling .lever-rod { transform: translateX(-50%) rotateX(60deg); }
.lever-button:active .lever-ball, .lever-button.pulling .lever-ball { transform: translateX(-50%) translateY(26px); }
.lever-caption { margin-top: 13px; color: rgba(180, 120, 255, .53); text-align: center; font-size: 9px; letter-spacing: .1em; }
.lever-progress { height: 4px; margin-top: 8px; border-radius: 3px; background: #2b292a; overflow: hidden; }
.lever-progress i { display: block; width: 0; height: 100%; background: var(--gold-bright); transition: width .5s; }
.bind-dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 1px solid rgba(180, 120, 255, .55); border-radius: 6px; color: #dbd7cf; background: rgba(12, 12, 14, .98); box-shadow: 0 0 50px rgba(0, 0, 0, .8); }
.bind-dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); }
.bind-dialog form { position: relative; padding: 28px; }
.dialog-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; color: #8a8783; font-size: 25px; }
.dialog-kicker { margin-bottom: 8px; color: var(--gold); font-size: 10px; letter-spacing: .2em; }
.bind-dialog h2 { margin: 0 0 14px; color: var(--gold-bright); font-family: var(--sans); font-size: 25px; }
.bind-dialog p { margin: 0 0 23px; color: #8e8b8b; font-family: var(--sans); font-size: 12px; line-height: 1.7; }
.bind-dialog label { display: block; margin-bottom: 7px; color: var(--gold); font-size: 10px; }
.bind-dialog input { width: 100%; padding: 11px 12px; border: 1px solid #47454a; border-radius: 3px; outline: none; color: #eee; background: #050506; }
.bind-dialog input:focus { border-color: var(--gold-bright); box-shadow: 0 0 12px rgba(180, 120, 255, .18); }
.dialog-submit, .demo-button { width: 100%; margin-top: 18px; padding: 11px; border-radius: 3px; font-size: 10px; letter-spacing: .05em; }
.dialog-submit { border: 1px solid rgba(180, 120, 255, .72); color: var(--gold-bright); background: rgba(180, 120, 255, .14); }
.demo-button { border: 0; color: #807d7d; background: transparent; }
@media (max-width: 920px) {
  .app-shell { width: min(100% - 32px, 580px); }
  .topbar { height: 69px; }
  .topbar-left { gap: 14px; }
  .back-button { width: 36px; height: 36px; font-size: 30px; }
  .brand h1 { font-size: 18px; letter-spacing: .08em; }
  .ready-badge { padding: 3px 6px; font-size: 8px; }
  .system-caption { gap: 6px; margin-top: 5px; font-size: 7px; letter-spacing: .12em; }
  .system-caption i { width: 16px; }
  .topbar-right { gap: 12px; }
  .bind-button { padding: 6px 9px; font-size: 8px; }
  .bind-long { display: none; }
  .bind-short { display: inline; }
  .energy-readout { min-width: 70px; }
  .energy-bars b { width: 9px; height: 6px; }
  .energy-caption { font-size: 6px; }
  .toast { top: 80px; min-width: 0; width: 196px; padding: 10px 12px; font-size: 10px; line-height: 1.5; }
  .main-layout { display: flex; flex-direction: column; gap: 0; align-items: stretch; padding-top: 94px; }
  .machine-column { display: contents; }
  .machine { order: 1; width: 100%; }
  .machine-header { height: 38px; padding: 0 12px; font-size: 8px; }
  .reel-chamber { gap: 9px; padding: 16px 10px; }
  .reel { height: 120px; }
  .reel-row { height: 120px; font-size: 19px; }
  .machine-footer { height: 42px; padding: 0 12px; }
  .signal { gap: 2px; font-size: 6px; }
  .signal b { width: 3px; height: 7px; }
  .machine-state { gap: 2px; }
  .machine-state strong { font-size: 8px; }
  .machine-state small { font-size: 6px; }
  .mobile-action { display: block; order: 2; width: 100%; height: 56px; margin-top: 17px; border: 2px solid rgba(180, 120, 255, .75); border-radius: 4px; color: var(--gold-bright); background: rgba(180, 120, 255, .09); box-shadow: 0 0 28px rgba(180, 120, 255, .16); font-size: 14px; font-weight: 900; letter-spacing: .3em; }
  .mobile-action:disabled { border-color: #303033; color: #656268; background: rgba(0, 0, 0, .25); box-shadow: none; }
  .report { order: 3; margin-top: 16px; min-height: 80px; padding: 12px 13px; }
  .report h2 { margin-bottom: 8px; font-size: 8px; }
  .report p { font-size: 20px; }
  .locked-mark span { width: 28px; height: 28px; }
  .side-column { order: 4; gap: 17px; width: 100%; margin-top: 26px; }
  .history-panel { order: 1; min-height: 80px; padding: 13px; }
  .target-panel { order: 2; min-height: 0; padding: 13px; }
  .panel-heading { margin-bottom: 12px; font-size: 9px; }
  .target-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .target-chip { min-height: 23px; font-size: 8px; }
  .history-list { max-height: 70px; }
  .empty-history { margin: 12px 0 4px; font-size: 8px; }
  .history-entry { min-height: 19px; font-size: 8px; }
  .lever-column { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
