@font-face { font-family: "Cubic11"; src: url("../fonts/Cubic_11.woff2") format("woff2"); font-display: block; }
:root {
  --purple: #9146ff; --purple-d: #772ce8; --purple-dd: #451093;
  --bg: #0e0e10; --panel: #18181b; --panel2: #1f1f23; --line: #2f2f35;
  --text: #efeff1; --muted: #adadb8;
  --green: #00f593; --yellow: #ffd93d; --pink: #ff4f8b; --red: #eb0400; --cyan: #3de0ff;
  --font: "Cubic11", "Microsoft JhengHei", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: none; font-smooth: never; }
canvas, img { image-rendering: pixelated; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 像素框 */
.px { position: relative; background: var(--panel); box-shadow: 0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line); }
.px-purple { box-shadow: 0 -4px 0 0 var(--purple), 0 4px 0 0 var(--purple), -4px 0 0 0 var(--purple), 4px 0 0 0 var(--purple); }

/* 像素按鈕 */
.btn { --c: var(--purple); --c2: var(--purple-dd); cursor: pointer; border: 0; background: var(--c); color: #fff; padding: 12px 20px; position: relative;
  box-shadow: 0 -4px 0 0 #000, 0 4px 0 0 #000, -4px 0 0 0 #000, 4px 0 0 0 #000, inset -4px -4px 0 0 var(--c2), inset 4px 4px 0 0 rgba(255,255,255,.25); }
.btn:active { transform: translateY(2px); box-shadow: 0 -4px 0 0 #000, 0 4px 0 0 #000, -4px 0 0 0 #000, 4px 0 0 0 #000, inset 4px 4px 0 0 var(--c2); }
.btn.green { --c: var(--green); --c2: #00995c; color: #0e0e10; }
.btn.yellow { --c: var(--yellow); --c2: #b8941a; color: #0e0e10; }
.btn.pink { --c: var(--pink); --c2: #a32a57; }
.btn.ghost { --c: var(--panel2); --c2: #0b0b0d; color: var(--text); }
.btn.red { --c: var(--red); --c2: #7a0200; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* CRT 掃描線 */
.crt::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.18) 0 2px, transparent 2px 4px); mix-blend-mode: multiply; }

/* 連線燈 */
.conn { position: fixed; right: 10px; bottom: 10px; width: 10px; height: 10px; background: var(--red); z-index: 9998; box-shadow: 0 0 0 2px #000; }
.conn.ok { background: var(--green); }
