/* [claude code] 2026-10-18 v0.1 遊戲範本主題(顏色只在 :root,字級 11 / 13 / 15 / 20 / 28,圓角 8 / 14 / 999)
   [claude code] 2026-10-19 v0.2 英語小鎮:暖色亮系(奶油底 · 橘主色 · 青綠輔色),參考「一起來擺攤」的小鎮感。
   🔴 顏色只在這裡定義,其他檔一律用變數(tools/check_ui.py 擋);輸入框字級 16(iOS 小於 16 聚焦會整頁放大)。 */
:root {
  --bg: #fff4e0;
  --bg-2: #ffe9c4;
  --surface: #ffffff;
  --surface-2: #fff8ec;
  --border: #f0d9b5;
  --text: #4a3426;
  --mute: #9a7f6a;
  --accent: #f59e2b;
  --accent-2: #ffb85c;
  --ink: #ffffff;
  --teal: #2a9d8f;
  --teal-soft: #d6f2ee;
  --gold: #e8a400;
  --good: #3fa34d;
  --good-soft: #e3f5e1;
  --danger: #e4572e;
  --danger-soft: #fde4dc;
  --sky: #bfe6ff;
  --sky-2: #e8f7ff;
  --grass: #8cc96b;
  --grass-2: #7dbb5c;
  --dirt: #e7c99a;
  --road: #f3dfb8;
  --road-edge: #d9bf90;
  --mine: #3b2a20;
  --mine-2: #5a4030;
  --scrim: rgba(60, 40, 20, .55);
  --shadow: rgba(120, 80, 30, .18);
  --glow: rgba(245, 158, 43, .45);
  --white-70: rgba(255, 255, 255, .7);
  --phone-width: min(100vw, 480px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif; }
body { overflow: hidden; }
h1, h2, h3, p { margin: 0; }

button { font: inherit; font-size: 15px; color: var(--text); min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--ink); font-weight: 700; }
button.teal { background: var(--teal); border-color: var(--teal); color: var(--ink); font-weight: 700; }
button.flat { background: transparent; border-color: transparent; }
button:focus-visible, [role="button"]:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input { font: inherit; font-size: 16px; color: var(--text); min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); width: 100%; }
label { font-size: 13px; color: var(--mute); }

/* 登入畫面 */
.screen { display: flex; flex-direction: column; justify-content: center; gap: 12px; height: 100dvh; padding: 24px 16px; background: var(--bg); }
.screen[hidden] { display: none; }
.screen h1 { font-size: 28px; }
.screen p { font-size: 13px; color: var(--mute); }

/* 遊戲畫面:一個直版框(桌機也是) */
#game { position: relative; display: flex; flex-direction: column; width: var(--phone-width); max-width: 480px; height: 100dvh; margin: 0 auto; background: var(--bg); overflow: hidden; }
#game[hidden] { display: none; }
#dock { padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }

/* 殼層會吃 html[data-ui-skin] 的那幾條(index.html 已經設好 data-ui-skin) */
.lb-art canvas { image-rendering: auto; }

/* 面板 */
#backdrop { position: absolute; inset: 0; z-index: 25; background: var(--scrim); }
#backdrop[hidden] { display: none; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 48px; z-index: 30; display: flex; flex-direction: column; padding: 12px; border-radius: 14px 14px 0 0; background: var(--surface); box-shadow: 0 -4px 16px var(--shadow); }
.sheet[hidden] { display: none; }
.sheet > h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; margin-bottom: 8px; font-size: 20px; }
.sheet-content { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; }
.row { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.row > div { flex: 1; min-width: 0; }
.row b { display: block; font-size: 15px; }
.row small, .note { font-size: 13px; color: var(--mute); }

/* 玩法畫在這一層(整個交給 mode) */
#battle { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg); }
#battle[hidden] { display: none; }

#toast { position: absolute; left: 50%; top: 64px; z-index: 90; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 8px 16px; border-radius: 14px; background: var(--text); color: var(--ink); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
