/* XCar — 共用樣式 */
:root {
  --bg: #070a1c; --fg: #f4f6ff; --accent: #2f7bff; --accent2: #7fd1ff; --hot: #ffcc00;
  --panel: rgba(7, 10, 28, .78);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font-family: system-ui, -apple-system, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  overflow: hidden;
}
a { color: var(--accent2); }
canvas.stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* 按鈕 */
.btn {
  display: inline-block; padding: 14px 34px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 20px; font-weight: 700; letter-spacing: 2px; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #2f7bff, #1246c4); box-shadow: 0 8px 30px rgba(47,123,255,.45);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(47,123,255,.6); }
.btn.ghost { background: transparent; border: 2px solid var(--accent2); box-shadow: none; color: var(--accent2); }

/* 封面 */
.cover { position: fixed; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.cover > * { pointer-events: auto; }
.cover .title { padding: 48px 40px 0; }
.cover h1 {
  margin: 0; font-size: clamp(48px, 9vw, 110px); line-height: .95; letter-spacing: 4px; font-weight: 900;
  background: linear-gradient(180deg, #ffffff, #7fd1ff 60%, #2f7bff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 24px rgba(47,123,255,.5));
}
.cover h2 { margin: 10px 0 0; font-size: clamp(16px, 2.4vw, 26px); font-weight: 400; opacity: .85; letter-spacing: 6px; }
.cover .actions { padding: 0 40px 44px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cover .credit { font-size: 12px; opacity: .5; margin-left: auto; }

/* 說明頁 */
.page { position: fixed; inset: 0; overflow: auto; display: grid; place-items: center; padding: 24px 16px; }
.card {
  width: min(760px, 100%); background: var(--panel); border: 1px solid rgba(127,209,255,.3); border-radius: 20px;
  padding: 32px 36px; backdrop-filter: blur(8px); box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.card h1 { margin: 0 0 6px; font-size: 32px; color: var(--accent2); }
.card h3 { margin: 24px 0 10px; font-size: 18px; color: var(--hot); }
.card p { line-height: 1.7; margin: 6px 0; }
table.keys { width: 100%; border-collapse: collapse; }
table.keys td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: middle; }
table.keys td:first-child { width: 42%; white-space: nowrap; }
kbd {
  display: inline-block; min-width: 30px; text-align: center; padding: 4px 9px; margin: 0 2px;
  border-radius: 7px; background: #1a2142; border: 1px solid #3a4a8a; border-bottom-width: 3px;
  font-family: ui-monospace, Menlo, monospace; font-size: 14px; color: #fff;
}
.row { display: flex; gap: 14px; justify-content: space-between; align-items: center; margin-top: 28px; flex-wrap: wrap; }

/* 遊戲 HUD */
#hud { position: fixed; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
#hud .top { position: absolute; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; }
#hud .box { background: var(--panel); border: 1px solid rgba(127,209,255,.25); border-radius: 14px; padding: 10px 16px; min-width: 150px; }
#hud .label { font-size: 11px; letter-spacing: 2px; opacity: .6; }
#hud .big { font-size: 34px; font-weight: 800; line-height: 1.05; }
#hud .big.warn { color: #ff5c5c; animation: blink .5s steps(2) infinite; }
@keyframes blink { to { opacity: .35; } }
#hud .bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 6px; }
#hud .bar > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #39d353, #a6ff8f); transition: width .15s; }
#hud .bar.nitro > i { background: linear-gradient(90deg, #2f7bff, #7fd1ff); }
#hud .bottom { position: absolute; bottom: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-end; }
#hud .speed { font-size: 48px; font-weight: 900; line-height: 1; }
#hud .speed small { font-size: 14px; font-weight: 400; opacity: .6; margin-left: 6px; }
#hud .hint { font-size: 12px; opacity: .55; }
#hud .msg { position: absolute; top: 22%; left: 0; right: 0; text-align: center; font-size: 40px; font-weight: 900; color: var(--hot); text-shadow: 0 4px 20px rgba(0,0,0,.6); opacity: 0; transition: opacity .3s; }
#hud .msg.show { opacity: 1; }
#crosshair { position: fixed; width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2px solid var(--hot); border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
#crosshair::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: var(--hot); border-radius: 50%; }

/* 覆蓋層：準備 / 暫停 / 結束 */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(4,6,20,.72); backdrop-filter: blur(4px); z-index: 10; }
.overlay[hidden] { display: none; }
.overlay .card { text-align: center; }
.overlay .card h1 { font-size: 42px; }
.stats { display: flex; gap: 24px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.stats div { background: rgba(255,255,255,.06); border-radius: 12px; padding: 12px 20px; min-width: 120px; }
.stats b { display: block; font-size: 30px; color: var(--hot); }
.stats span { font-size: 12px; opacity: .6; letter-spacing: 2px; }
