/* 三个硬件小游戏共用：博客同一套 token + 扫码大厅。和 public/pomodoro 一样是独立页，不走 Next */
:root {
  --paper: #fafaf9; --card: #fff; --ink: #1c1917; --body: #57534e; --muted: #78716c; --faint: #a8a29e;
  --line: rgba(28,25,23,.09); --line-strong: rgba(28,25,23,.2);
  --hl: #facc15; --hl-soft: rgba(250,204,21,.28); --water: #4a8cc2; --leaf: #3a8f4a; --tomato: #d94c3d;
  --ease-out: cubic-bezier(.32,.72,0,1);
}
@media (prefers-color-scheme: dark) { :root {
  --paper: #0c0a09; --card: #161412; --ink: #f5f5f4; --body: #b6b0ab; --muted: #8f8983; --faint: #5c5652;
  --line: #26221f; --line-strong: #3d3833;
  --hl-soft: rgba(250,204,21,.18); --water: #6aa8db; --leaf: #6cbf7a; --tomato: #e8695b;
} }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper); color: var(--ink); overflow: hidden;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
}
canvas { display: block; touch-action: none; }
.stage { position: fixed; inset: 0; width: 100%; height: 100%; } /* canvas 是替换元素，不写宽高会按像素尺寸显示，高清屏放大 2 倍 */

.btn {
  font: inherit; color: var(--body); background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 18px; cursor: pointer;
  transition: color .15s ease, border-color .15s ease, scale .15s ease-out;
}
@media (hover: hover) and (pointer: fine) { .btn:hover { border-color: var(--line-strong); color: var(--ink); } }
.btn:active { scale: .96; }
.btn.primary { background: var(--hl); border-color: var(--hl); color: #1c1917; font-weight: 500; padding: 14px 36px; font-size: 18px; }

/* PC 端：扫码卡片 */
.lobby {
  position: fixed; left: 50%; top: 50%; translate: -50% -50%; width: min(calc(100% - 32px), 340px);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.lobby h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.lobby p { margin: 0; color: var(--muted); font-size: 14px; text-wrap: balance; }
.qr { width: 200px; aspect-ratio: 1; background: #fff; border-radius: 10px; padding: 6px; display: grid; place-items: center; color: #78716c; font-size: 13px; }
.qr svg { width: 100%; height: 100%; display: block; }
.status { color: var(--faint); font-size: 13px; min-height: 1.5em; }

/* 手机端：手柄页 */
.pad { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.pad { pointer-events: none; } /* 让划动落到底下的 canvas 上 */
.pad button { pointer-events: auto; }
.pad h1 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.pad p { margin: 0; color: var(--muted); }
.pad .msg { font-size: 20px; color: var(--ink); min-height: 1.5em; }

.hud { position: fixed; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; pointer-events: none; font-variant-numeric: tabular-nums; }
.hud b { color: var(--ink); font-weight: 600; }
.toast { position: fixed; left: 50%; top: 22%; translate: -50% 0; font-size: clamp(28px, 6vw, 44px); font-weight: 700; letter-spacing: -.03em; pointer-events: none; opacity: 0; }
.toast.show { animation: toast 1.4s var(--ease-out) both; }
@keyframes toast { 0% { opacity: 0; translate: -50% 8px; } 15%, 75% { opacity: 1; translate: -50% 0; } 100% { opacity: 0; } }
@keyframes toastStill { 0%, 100% { opacity: 0; } 10%, 80% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast.show { animation-name: toastStill; } }

/* 中 / EN 切换（i18n.js mountToggle） */
.btn.lang { padding: 4px 10px; font-size: 12px; }
.lobby .lang { position: absolute; top: 12px; right: 12px; }
