/* 像素戰機 · 復古街機視覺系統
   1980s 投幣機台／印刷海報：米白紙 × 墨黑 × 信號紅。
   粗描邊、實色硬陰影、半調網點、超大招牌字、記分條與警示斜紋。
   無漸變、無發光、無模糊；所有舊變數名保留為別名，既有模板不需改動。 */
:root {
  --paper: #f3ead6;
  --paper-2: #e7d9bd;
  --cream: #fff8e9;
  --ink: #181410;
  --ink-2: #443a2e;
  --red: #e03427;
  --red-dark: #ab231b;
  --yellow: #f5b812;

  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --panel: var(--cream);
  --panel-solid: var(--cream);
  --line: #cdbb9c;
  --line-strong: var(--ink);
  --text: var(--ink);
  --muted: #655847;
  --dim: #8b7a62;
  --amber: var(--red);
  --amber-soft: #fbe3d7;
  --gold: var(--red-dark);
  --cyan: var(--red);
  --indigo: var(--ink-2);
  --green: #4e763c;
  --radius: 0px;
  --shadow: 5px 5px 0 var(--ink);
  --hard: 5px 5px 0 var(--ink);
  --hard-sm: 3px 3px 0 var(--ink);
  --mono: "Courier New", ui-monospace, Consolas, monospace;
  --display: "Arial Black", "PingFang TC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { background: var(--bg); }
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(24, 20, 16, .11) 1px, transparent 1.3px),
    repeating-linear-gradient(0deg, rgba(24, 20, 16, .022) 0 1px, transparent 1px 28px);
  background-size: 8px 8px, 100% 28px;
  background-attachment: fixed;
  color: var(--text);
  font-family: "PingFang TC", "Microsoft JhengHei", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; letter-spacing: .02em; }
h2 { font-size: 22px; }
h3 { font-size: 15px; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 頂欄：黑機台殼 + 紅黑警示斜紋 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 26px;
  height: 76px; padding: 9px clamp(16px, 4vw, 48px) 0;
  background: var(--ink);
  border-bottom: 4px solid var(--red);
}
.topbar::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 7px;
  background: repeating-linear-gradient(45deg, var(--red) 0 12px, var(--ink) 12px 24px);
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 3px solid var(--cream); background: var(--red); color: var(--cream);
  box-shadow: 3px 3px 0 var(--red-dark);
}
.brand-mark svg { width: 20px; height: 20px; display: block; fill: currentColor; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-family: var(--display); font-size: 18px; font-weight: 900; letter-spacing: .12em; color: var(--cream); }
.brand-text small { font-family: var(--mono); font-size: 9px; letter-spacing: .2em; color: var(--yellow); }
.nav { display: flex; gap: 8px; margin-right: auto; }
.nav-btn {
  border: 2px solid transparent; background: transparent; color: #ecdfc6;
  padding: 8px 14px; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  transition: color .12s, background .12s;
}
.nav-btn:hover { color: var(--yellow); }
.nav-btn.active {
  color: var(--cream); background: var(--red);
  border-color: var(--cream); box-shadow: 3px 3px 0 var(--red-dark);
}
.account { display: flex; align-items: center; gap: 10px; }
.account-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px; border: 2px solid var(--cream);
  background: var(--cream); box-shadow: 3px 3px 0 var(--red);
  font-size: 12px; white-space: nowrap;
}
.avatar {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--red); border: 2px solid var(--ink); color: var(--cream);
  font-family: var(--mono); font-weight: 700; font-size: 12px;
}
.account-chip b { font-weight: 800; }
.account-chip .chip-lv, .account-chip .chip-coin {
  font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.account-chip .chip-lv { color: var(--muted); }
.account-chip .chip-coin { color: var(--red-dark); font-weight: 700; }
.topbar .btn { box-shadow: 3px 3px 0 var(--red); }

/* ---------- 按鈕／表單：厚邊、硬陰影、按下去會位移 ---------- */
.btn {
  border: 2px solid var(--ink); border-radius: 0;
  background: var(--cream); color: var(--ink);
  font-weight: 800; font-size: 13px; letter-spacing: .06em;
  padding: 10px 20px; box-shadow: var(--hard-sm);
  transition: transform .08s ease-out, box-shadow .08s ease-out, background .12s;
}
.btn:hover { background: var(--yellow); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled {
  opacity: .45; cursor: not-allowed; transform: translate(2px, 2px);
  box-shadow: none; background: var(--paper-2); border-color: var(--ink-2); color: var(--ink-2);
}
.btn-primary {
  background: var(--red); color: var(--cream);
  text-shadow: 1px 1px 0 var(--red-dark);
}
.btn-primary:hover { background: #ef443a; }
.btn-ghost { background: var(--paper); }
.btn.block { display: block; width: 100%; }
.btn.mini { padding: 6px 14px; font-size: 11px; }
.link-btn {
  border: 0; background: transparent; color: var(--red-dark);
  font-size: 12px; padding: 4px 0; font-weight: 800; letter-spacing: .06em;
  text-decoration: underline; text-underline-offset: 4px;
}
.link-btn:hover { color: var(--red); }

.panel {
  position: relative;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(24, 20, 16, .045) 1px, transparent 1px);
  background-size: 8px 8px;
  border: 3px solid var(--ink); border-radius: 0;
  box-shadow: var(--hard); padding: 22px;
}
/* 右上角紅色鉚釘：機台貼紙的對位記號 */
.panel::after {
  content: ''; position: absolute; top: -3px; right: -3px;
  width: 16px; height: 16px; background: var(--red);
  border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  pointer-events: none;
}
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 800; color: var(--ink); letter-spacing: .06em; }
.form label small { font-weight: 600; color: var(--muted); font-size: 10px; }
.form input {
  width: 100%; padding: 11px 13px; border-radius: 0;
  background: var(--paper); border: 2px solid var(--ink);
  box-shadow: inset 2px 2px 0 rgba(24, 20, 16, .08);
  color: var(--ink); outline: none; font-size: 15px;
  font-family: var(--mono); letter-spacing: .03em;
  transition: box-shadow .12s, border-color .12s;
}
.form input:focus { border-color: var(--red); box-shadow: 3px 3px 0 var(--red); }
.form input::placeholder { color: #9b8b73; }
.form-error { min-height: 18px; margin-top: 10px; color: var(--red-dark); font-size: 12px; font-weight: 700; font-family: var(--mono); }

/* ---------- 螢幕容器 ---------- */
.main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 34px clamp(16px, 4vw, 40px) 44px; }
.screen { animation: fade .16s ease-out; }
@keyframes fade { from { opacity: .55; } to { opacity: 1; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 16px; }
.section-head.compact { margin: 0 0 14px; }
.section-head h2::before {
  content: ''; display: inline-block; width: 12px; height: 12px;
  background: var(--red); border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink); margin-right: 10px; vertical-align: baseline;
}
.section-head h3::before {
  content: ''; display: inline-block; width: 9px; height: 9px;
  background: var(--red); border: 2px solid var(--ink); margin-right: 8px;
}
/* ---------- 頁尾：政策連結 + 版權，兩段式機台銘牌 ---------- */
.footer {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px clamp(16px, 4vw, 48px) 14px;
  background: var(--ink); border-top: 4px solid var(--red);
  color: var(--paper); font-size: 10px; font-family: var(--mono); letter-spacing: .1em;
}
.footer-top, .footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px 22px; flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--display); font-size: 12px; font-weight: 900;
  letter-spacing: .12em; color: var(--yellow); white-space: nowrap;
}
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
.footer-links a {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 12px;
  color: var(--cream); font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-decoration: none; border-left: 1px solid rgba(243, 234, 214, .32);
  transition: color .12s, background .12s;
}
.footer-links a:first-child { border-left: 0; }
.footer-links a:hover, .footer-links a:focus-visible {
  background: var(--red); color: var(--cream); outline: none;
}
.footer-bottom {
  padding-top: 10px; border-top: 1px dashed rgba(243, 234, 214, .22);
}
.footer-copy { color: #d2c1a2; font-size: 10px; letter-spacing: .08em; }
.footer .muted { color: #d2c1a2; }
#server-status.offline { color: var(--yellow); cursor: pointer; text-decoration: underline dotted; }
#server-status.offline:hover { color: var(--cream); }

/* ---------- 登入頁：街機海報 ---------- */
.auth-layout {
  position: relative;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px;
  align-items: center; min-height: min(74vh, 640px);
}
.auth-intro, .auth-card { position: relative; z-index: 1; }
.score-strip {
  display: inline-flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
  padding: 7px 14px; background: var(--ink); color: var(--yellow);
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--red);
  font: 700 11px var(--mono); letter-spacing: .14em;
}
.score-strip i { color: var(--cream); font-style: normal; }
.score-strip .credit { color: var(--red); animation: blink 1.2s steps(2, jump-none) infinite; }
.eyebrow {
  color: var(--red-dark); font-family: var(--mono);
  font-size: 10px; letter-spacing: .22em; font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::after {
  content: ''; height: 3px; flex: 1;
  background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 12px);
}
/* 主標題做成斜貼的紅色招牌貼紙：比堆疊描邊更清晰，也更像機台海報 */
.auth-intro h1 {
  display: inline-block;
  font-family: var(--display); font-size: clamp(40px, 5.4vw, 68px);
  line-height: 1.12; margin: 16px 0 28px; letter-spacing: .02em;
  color: var(--cream); background: var(--red);
  border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  padding: 4px 18px 8px; transform: rotate(-1.4deg);
}
.h1-dot {
  display: inline-block; width: 14px; height: 14px; margin-left: 10px;
  background: var(--yellow); border: 2px solid var(--ink);
  font-size: 0; vertical-align: baseline;
}
.lead { color: var(--ink-2); font-size: 15px; line-height: 1.9; font-weight: 600; letter-spacing: .03em; }
.feature-list { list-style: none; margin-top: 30px; display: grid; gap: 14px; }
.feature-list li { display: flex; align-items: center; gap: 14px; color: var(--ink-2); font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.feature-list li span {
  width: 30px; height: 28px; flex-shrink: 0; display: grid; place-items: center;
  border: 2px solid var(--ink); background: var(--red); color: var(--cream);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
}
.auth-card { padding: 26px; padding-top: 30px; box-shadow: inset 0 8px 0 var(--red), var(--hard); }
.coin-label {
  display: inline-block; margin-bottom: 14px; padding: 4px 10px;
  background: var(--yellow); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--red);
  font: 700 10px var(--mono); letter-spacing: .18em;
}
@keyframes blink { 50% { opacity: .48; } }
.tabs {
  display: flex; gap: 3px; padding: 3px; margin-bottom: 22px;
  border: 3px solid var(--ink); background: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}
.tab {
  flex: 1; border: 0; background: var(--paper); color: var(--ink);
  padding: 10px; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  transition: background .12s, color .12s;
}
.tab:hover { background: var(--yellow); }
.tab.active { color: var(--cream); background: var(--red); }
.auth-foot {
  display: flex; flex-direction: column; gap: 4px; margin-top: 12px;
  padding-top: 16px; border-top: 2px dashed var(--ink-2);
}

/* ---------- 機庫 ---------- */
.hangar-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.player-top { display: flex; align-items: center; gap: 16px; }
.avatar-lg {
  width: 54px; height: 54px; border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink); display: grid; place-items: center;
  background: var(--red); color: var(--cream);
  font-family: var(--display); font-weight: 900; font-size: 23px; flex-shrink: 0;
}
.player-name { font-family: var(--display); font-size: 19px; font-weight: 900; letter-spacing: .04em; }
.player-sub { color: var(--muted); font-size: 11px; font-family: var(--mono); letter-spacing: .02em; }
.lv-badge { margin-left: auto; text-align: right; flex-shrink: 0; }
.lv-badge b {
  display: block; font-family: var(--display); font-size: 30px;
  color: var(--red); line-height: 1.1; letter-spacing: .01em;
  font-variant-numeric: tabular-nums; text-shadow: 2px 2px 0 var(--ink);
}
.lv-badge span { font-family: var(--mono); font-size: 9px; color: var(--ink-2); letter-spacing: .18em; font-weight: 700; }
.xp-row { margin-top: 20px; }
.xp-label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; letter-spacing: .04em; }
.xp-bar { height: 14px; background: var(--paper-2); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); overflow: hidden; }
.xp-bar i {
  display: block; height: 100%;
  background: repeating-linear-gradient(45deg, var(--red) 0 8px, var(--red-dark) 8px 16px);
  transition: width .4s ease;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.stat-item {
  background: var(--paper); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); padding: 12px 10px;
}
.stat-item b {
  display: block; font-family: var(--display); font-size: 22px;
  letter-spacing: .01em; font-weight: 900; font-variant-numeric: tabular-nums;
}
.stat-item span { font-size: 10px; color: var(--ink-2); letter-spacing: .06em; font-weight: 700; }
.guest-card { text-align: center; padding: 12px 0 4px; }
.guest-card h3 { font-size: 18px; margin-bottom: 6px; }
.guest-card p { color: var(--muted); font-size: 12px; margin-bottom: 16px; }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.mode-card {
  position: relative; overflow: hidden; text-align: left;
  background: var(--cream); border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink); padding: 20px; color: var(--text);
  transition: transform .1s ease-out, box-shadow .1s ease-out;
}
.mode-card:not(.disabled):hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.mode-card.selected { border-color: var(--red); box-shadow: 5px 5px 0 var(--red), inset 0 0 0 2px var(--red); }
.mode-card.selected::after {
  content: ''; position: absolute; top: 0; right: 0;
  border-top: 20px solid var(--red); border-left: 20px solid transparent;
}
.mode-card.disabled { opacity: .45; cursor: not-allowed; }
.mode-icon {
  width: 36px; height: 28px; display: grid; place-items: center;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  background: var(--red); color: var(--cream);
  font-family: var(--mono); font-size: 11px; font-weight: 700; margin-bottom: 14px;
}
.mode-card h3 { font-size: 17px; margin-bottom: 6px; }
.mode-card p { color: var(--ink-2); font-size: 12px; line-height: 1.7; min-height: 40px; }
.mode-rules { color: var(--ink-2); font-family: var(--mono); font-size: 10px; line-height: 1.7; margin-top: 8px; letter-spacing: .02em; }
.mode-rules::before { content: '▸ '; color: var(--red); }
.mode-rules + .mode-tag { margin-top: 10px; }
.mode-tag {
  display: inline-block; margin-top: 14px; padding: 2px 8px;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em;
  background: var(--yellow); color: var(--ink); border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.mode-tag.soon { background: var(--paper-2); color: var(--muted); }
.mode-start { margin-top: 16px; }

.run-list { display: flex; flex-direction: column; gap: 10px; }
.run-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  background: var(--paper); font-size: 12px;
}
.run-row b { font-family: var(--display); font-size: 18px; color: var(--red-dark); font-variant-numeric: tabular-nums; }
.run-row small { color: var(--muted); font-family: var(--mono); font-size: 10px; }
.empty { color: var(--muted); font-family: var(--mono); font-size: 11px; text-align: center; padding: 22px 8px; letter-spacing: .04em; font-weight: 700; }
.tips p { font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.tips p b { color: var(--red-dark); font-family: var(--mono); font-size: 11px; font-weight: 700; }

/* ---------- 排行榜 ---------- */
.panel.wide { max-width: 760px; margin: 0 auto; padding-top: 28px; box-shadow: inset 0 8px 0 var(--red), var(--hard); }
.lb-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.lb-tab {
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 7px 14px; font-size: 11px; font-weight: 800; letter-spacing: .08em;
}
.lb-tab:hover { background: var(--yellow); }
.lb-tab.active { color: var(--cream); background: var(--red); }
.lb-row {
  display: grid; grid-template-columns: 48px 1fr 90px 90px; align-items: center; gap: 10px;
  padding: 12px 14px; font-size: 13px; border-bottom: 2px dashed #d6c6a8;
}
.lb-row.head {
  color: var(--ink-2); font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: .1em; border-bottom: 3px solid var(--ink); padding-top: 6px; padding-bottom: 6px;
}
.lb-row .rank { font-family: var(--display); font-size: 16px; font-weight: 900; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-row .rank.top1 { color: var(--red); }
.lb-row .rank.top2 { color: #a5790c; }
.lb-row .rank.top3 { color: var(--ink-2); }
.lb-row .score { text-align: right; font-family: var(--display); font-size: 16px; font-weight: 900; color: var(--red-dark); font-variant-numeric: tabular-nums; }
.lb-row .level { text-align: right; color: var(--muted); font-family: var(--mono); font-size: 11px; }

/* ---------- Toast：機台訊息牌 ---------- */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; max-width: 340px; padding: 12px 16px;
  border: 3px solid var(--red); background: var(--ink); color: var(--cream);
  box-shadow: 5px 5px 0 rgba(24, 20, 16, .35);
  font-size: 12px; font-weight: 700; letter-spacing: .04em; animation: toastIn .18s ease;
}
.toast.error { background: var(--red-dark); border-color: var(--cream); }
.toast.success { border-color: var(--yellow); }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ---------- 鑽石商城 ---------- */
.shop-head {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  margin-bottom: 20px; padding-top: 28px;
  box-shadow: inset 0 8px 0 var(--red), var(--hard);
}
.shop-head h2 { margin-bottom: 4px; }
.wallet {
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
  padding: 10px 16px; border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--red); background: var(--ink);
}
.wallet span { color: #ecdfc6; font-size: 11px; letter-spacing: .08em; font-weight: 700; }
.wallet b { color: var(--yellow); font-family: var(--display); font-size: 21px; font-variant-numeric: tabular-nums; }
.guest-inline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.guest-inline b { color: var(--red-dark); font-family: var(--mono); font-size: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.item-card {
  display: flex; gap: 14px; padding: 18px; border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink); background: var(--cream);
}
.item-card.maxed { border-color: var(--ink-2); }
.item-icon {
  width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  background: var(--red); color: var(--cream);
}
.item-body { flex: 1; min-width: 0; }
.item-top { display: flex; align-items: center; gap: 8px; }
.item-top h3 { font-size: 15px; }
.item-tag {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ink);
  background: var(--yellow); border: 2px solid var(--ink); padding: 1px 7px; letter-spacing: .04em;
}
.item-body p { color: var(--ink-2); font-size: 12px; margin: 6px 0; line-height: 1.5; }
.item-effect { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .02em; }
.lv-dots { display: flex; gap: 5px; margin-top: 10px; }
.lv-dots i { width: 18px; height: 10px; border: 2px solid var(--ink); background: var(--paper-2); }
.lv-dots i.on { background: var(--red); }
.item-buy { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 10px; min-width: 96px; }
.item-buy .price { color: var(--red-dark); font-family: var(--display); font-weight: 900; font-size: 19px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bonus-bar { display: flex; gap: 12px; flex-wrap: wrap; }
.bonus-chip {
  display: flex; flex-direction: column; align-items: center; min-width: 96px;
  padding: 12px 16px; border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink); background: var(--paper);
}
.bonus-chip b { color: var(--red); font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.bonus-chip span { color: var(--ink-2); font-size: 10px; letter-spacing: .06em; font-weight: 700; }
.bonus-chip.skin b { color: var(--red-dark); }

/* ---------- 戰機塗裝商店 ---------- */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.skin-card {
  display: flex; gap: 14px; padding: 14px;
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); background: var(--cream);
}
.skin-card.active { border-color: var(--red); box-shadow: 5px 5px 0 var(--red); }
.skin-preview-wrap { position: relative; flex: 0 0 104px; align-self: flex-start; }
.skin-preview {
  display: block; width: 104px; height: 120px;
  border: 2px solid var(--ink); background: var(--ink);
  image-rendering: pixelated;
}
.skin-code {
  position: absolute; top: 5px; left: 5px;
  font: 700 10px var(--mono); letter-spacing: .06em;
  color: var(--yellow); background: var(--ink);
  border: 1px solid var(--yellow); padding: 0 4px;
}
.skin-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.skin-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.skin-top h3 { font-size: 15px; }
.skin-info p { color: var(--ink-2); font-size: 12px; margin: 6px 0; line-height: 1.5; }
.skin-foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 10px; border-top: 2px dashed var(--line);
}
.skin-price {
  color: var(--red-dark); font-family: var(--display); font-weight: 900;
  font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hangar-skin-body { display: flex; align-items: center; gap: 14px; }
.hangar-skin-body canvas {
  width: 86px; height: 100px; flex: 0 0 86px;
  border: 2px solid var(--ink); image-rendering: pixelated;
}
.hangar-skin-body b { display: block; font-family: var(--display); font-size: 17px; }
.hangar-skin-body span { display: block; margin-top: 4px; }
.hangar-skin-body .btn { margin-top: 0; }

/* ---------- 鑽石儲值（USD / PayerMax） ---------- */
.demo-notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; margin-bottom: 20px;
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  background: var(--yellow); color: var(--ink); font-size: 12px; line-height: 1.6;
}
.demo-notice b { color: var(--red-dark); white-space: nowrap; font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.pack-card {
  position: relative; overflow: hidden; padding: 20px; text-align: center;
  border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer; background: var(--cream);
  transition: transform .1s ease-out, box-shadow .1s ease-out;
}
.pack-card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.pack-card.selected { border-color: var(--red); box-shadow: 5px 5px 0 var(--red); }
.pack-card.selected::after {
  content: ''; position: absolute; top: 0; right: 0;
  border-top: 18px solid var(--red); border-left: 18px solid transparent;
}
.pack-icon {
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--yellow);
  letter-spacing: .08em; display: inline-block;
  background: var(--ink); border: 2px solid var(--ink); padding: 2px 7px;
}
.pack-name { font-family: var(--display); font-weight: 900; margin-top: 10px; letter-spacing: .04em; font-size: 14px; }
.pack-coins {
  font-family: var(--display); font-size: 27px; font-weight: 900; color: var(--red-dark);
  margin-top: 10px; font-variant-numeric: tabular-nums; text-shadow: 2px 2px 0 var(--yellow);
}
.pack-sub { font-size: 11px; color: var(--ink-2); font-family: var(--mono); }
.pack-tag {
  display: inline-block; margin: 10px 0; font-family: var(--mono); font-size: 10px; font-weight: 700;
  color: var(--ink); background: var(--paper-2); border: 2px solid var(--ink);
  padding: 2px 8px; letter-spacing: .04em;
}
.pack-price { font-family: var(--display); font-size: 20px; font-weight: 900; margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.channel-list { display: flex; gap: 12px; flex-wrap: wrap; }
.channel {
  display: flex; align-items: center; gap: 10px; min-width: 220px; padding: 12px 16px;
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  background: var(--paper); cursor: pointer;
}
.channel.disabled { opacity: .45; cursor: not-allowed; }
.channel.selected { border-color: var(--red); box-shadow: 3px 3px 0 var(--red); }
.channel input { accent-color: var(--red); }
.channel span { display: flex; flex-direction: column; }
.channel b { font-size: 12px; letter-spacing: .06em; }
.channel small { color: var(--muted); font-size: 11px; }
.channel .channel-mark {
  display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 32px;
  font: 700 13px var(--mono); letter-spacing: .04em;
  color: var(--yellow); background: var(--ink); border: 2px solid var(--ink);
}
/* span 的 flex-direction: column 不應套用到標記方塊 */
.channel > span:not(.channel-mark) { flex-direction: column; }
.pack-price small { font: 700 10px var(--mono); color: var(--muted); letter-spacing: .08em; }
.checkout { margin-top: 20px; padding-top: 28px; box-shadow: inset 0 8px 0 var(--red), var(--hard); }
.checkout h3 { margin-bottom: 12px; }
.checkout-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 2px dashed #d6c6a8; font-size: 12px; }
.checkout-row span { color: var(--muted); }
.checkout-row b { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.gold { color: var(--red-dark); font-weight: 800; }
.checkout-actions { display: flex; gap: 10px; margin-top: 16px; }
.checkout p { margin-top: 12px; }
.order-list { display: flex; flex-direction: column; gap: 10px; }
.order-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  background: var(--paper); font-size: 12px;
}
.order-row small, .order-row .tiny { font-family: var(--mono); font-size: 10px; }

/* ---------- 遊戲屏：切換成投幣機台的深色艙體 ---------- */
/* 艙體外殼用深棕網點，機台本體用純墨黑，兩者拉開層次 */
body[data-screen="game"] {
  background-color: #241d16;
  background-image: radial-gradient(rgba(243, 234, 214, .10) 1px, transparent 1px);
  background-size: 8px 8px;
}
/* 網點底材上的字級微調：正文級小字放大一階，避免印刷質感吃掉可讀性 */
.mode-card p, .item-body p, .tips p, .run-row { font-size: 13px; }
.feature-list li { font-size: 14px; }
.lead { font-size: 16px; }
.empty { font-size: 12px; }

body[data-screen="game"] .side .panel { box-shadow: 5px 5px 0 var(--red); }
body[data-screen="game"] .toast { box-shadow: 5px 5px 0 var(--red-dark); }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; gap: 28px; }
  .auth-intro { display: none; }
  .auth-card { max-width: 440px; margin: 0 auto; width: 100%; }
  .hangar-grid { grid-template-columns: 1fr; }
  .col-side { order: -1; }
  .topbar { gap: 12px; padding: 0 16px; }
  .brand-text small { display: none; }
  .nav-btn { padding: 8px 12px; }
  .shop-head { flex-direction: column; align-items: flex-start; }
  .shop-grid, .pack-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .account-chip .chip-coin, .account-chip .chip-lv { display: none; }
  .lb-row { grid-template-columns: 36px 1fr 70px; }
  .lb-row .level { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .toast { animation: none; }
  .score-strip .credit, .coin-label { animation: none; }
  * { transition-duration: 0s !important; }
}
