/* ===== 靜野尋雷 · 溫暖原野遊戲風（木框／厚按鈕／招牌／快捷欄） ===== */
:root {
  --sky: #bfe4f7;
  --panel: #fff8e8;
  --panel-soft: #fffdf5;
  --wood: #a5713d;
  --wood-dark: #7c5227;
  --wood-deep: #57381a;
  --wood-light: #d9a869;
  --line: #e8d3ab;
  --text: #4a3010;
  --text-dim: #9b7e5c;
  --accent: #ff9426;
  --accent-deep: #f07d00;
  --gold: #f5a623;
  --danger: #e85d5d;
  --safe: #43a047;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
  background: var(--sky);
  color: var(--text);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  touch-action: manipulation;
}

body.end-modal-open { overflow: hidden; }

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.more-games-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--wood-dark);
  font-size: 13px;
  font-weight: 900;
}
.game-banner-slot {
  width: min(100%, 336px);
  margin: 14px auto;
  overflow: hidden;
}
.game-banner-slot:not([hidden]) { min-height: 280px; }
.game-banner-stub {
  width: 100%;
  height: 280px;
  display: grid;
  place-items: center;
  border: 3px dashed var(--wood-light);
  background: var(--panel-soft);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 900;
}
/* ---------- HUD ---------- */
#hud {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px;
  background: linear-gradient(180deg, rgba(255,250,235,.96), rgba(255,240,214,.86));
  border-bottom: 4px solid var(--wood-light);
  box-shadow: 0 5px 0 rgba(87,56,26,.22), 0 10px 24px rgba(124,82,39,.16);
}
.hud-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hud-row:last-child { min-width: 0; }
.hud-group { display: flex; align-items: center; gap: 7px; min-width: 0; }

/* 數值木框計數板 */
.pill {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px 12px 6px;
  background: linear-gradient(180deg, #fffdf4, #ffe9bd);
  border: 3px solid var(--wood-dark);
  border-bottom-width: 5px;
  border-radius: 14px;
  font-size: 13px; line-height: 1; white-space: nowrap;
  color: var(--text); font-weight: 800;
}
.pill b {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  font-size: 19px;
  font-weight: 900;
  color: #fff;
  letter-spacing: .02em;
  text-shadow:
    -2px 0 0 var(--wood-dark), 2px 0 0 var(--wood-dark),
    0 -2px 0 var(--wood-dark), 0 2px 0 var(--wood-dark),
    -2px -2px 0 var(--wood-dark), 2px -2px 0 var(--wood-dark),
    -2px 2px 0 var(--wood-dark), 2px 2px 0 var(--wood-dark),
    0 3px 0 var(--wood-deep);
}
.pill b.bump { animation: num-bump .32s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes num-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.pill small { color: var(--text-dim); font-size: 11px; }
.pill i { font-size: 16px; color: var(--accent-deep); filter: drop-shadow(0 1px 0 #fff); }
.pill.gold { border-color: var(--accent-deep); }
.pill.gold i { color: var(--gold); }
.pill.shield { border-color: #2e7cb8; }
.pill.shield i { color: #2e7cb8; }

/* 遊戲招牌 */
#game-logo {
  display: flex; align-items: center; gap: 9px;
  background: linear-gradient(180deg, #b0763c, #8a5526);
  border: 3px solid var(--wood-deep);
  border-radius: 15px;
  padding: 5px 16px 6px 7px;
  box-shadow: 0 5px 0 var(--wood-deep), inset 0 2px 0 rgba(255,235,200,.35);
  transform: rotate(-1.5deg);
  animation: logo-sway 5s ease-in-out infinite alternate;
}
@keyframes logo-sway {
  from { transform: rotate(-2.1deg); }
  to { transform: rotate(.5deg); }
}
.logo-badge {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, #ffd166, #f07d00);
  border: 2.5px solid var(--wood-deep);
  color: #fff; font-size: 18px;
  box-shadow: inset 0 2px 3px rgba(255,255,255,.55), 0 2px 4px rgba(60,30,5,.35);
}
.logo-text {
  display: flex; flex-direction: column;
  color: #fff4da; font-size: 20px; font-weight: 900; letter-spacing: .12em; line-height: 1.05;
  text-shadow: 0 2px 0 rgba(60,30,5,.55), 0 -1px 0 rgba(255,235,200,.25);
}
.logo-text small { font-size: 9px; letter-spacing: .3em; color: #ffd98f; font-weight: 700; margin-top: 3px; }

/* 木紋圓鈕 */
.icon-btn {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; min-width: 50px; min-height: 50px; padding: 4px 12px;
  background: linear-gradient(180deg, #ffd98f, #ffb84d);
  border: 3px solid var(--wood-dark);
  border-bottom-width: 6px;
  border-radius: 15px;
  color: #5f3d1a; font-size: 18px; cursor: pointer; font-weight: 900;
  transition: transform .1s ease, border-bottom-width .1s ease, filter .15s ease;
}
.icon-btn small { font-size: 10px; color: #7a5626; }
.icon-btn::after {
  content: ''; position: absolute; left: 8%; top: 6%; width: 46%; height: 22%;
  border-radius: 8px; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,0));
}
.icon-btn:hover { filter: brightness(1.06); }
.icon-btn:active { transform: translateY(3px); border-bottom-width: 3px; }

/* 難度：木樑上的粗獷頁籤 */
.seg {
  display: flex; gap: 5px; min-width: 0; max-width: 100%;
  overflow-x: auto; scrollbar-width: none;
  background: linear-gradient(180deg, #6b431f, #57381a);
  border: 3px solid var(--wood-deep);
  border-radius: 17px; padding: 4px;
  box-shadow: inset 0 3px 7px rgba(25,12,0,.5), 0 4px 0 rgba(87,56,26,.3);
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent; color: #e9c893;
  font-size: 13px; font-weight: 800; letter-spacing: .06em;
  padding: 8px 17px; border-radius: 11px; cursor: pointer;
  transition: all .14s ease; flex: 0 0 auto;
  text-shadow: 0 1px 2px rgba(40,20,0,.5);
}
.seg button:hover { color: #fff; }
.seg button.locked {
  color: #9b8158;
  cursor: not-allowed;
  opacity: .85;
  text-shadow: none;
}
.seg button.locked i { font-size: 11px; margin-right: 3px; vertical-align: -1px; color: #c9a877; }
.seg button.cleared i {
  font-size: 12px; margin-right: 3px; vertical-align: -1px;
  color: var(--gold);
  filter: drop-shadow(0 1px 1px rgba(90,50,10,.5));
}
.seg button.active {
  background: linear-gradient(180deg, #ffc266, var(--accent));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 0 #b35c00, inset 0 2px 0 rgba(255,255,255,.5);
  text-shadow: 0 2px 2px rgba(150,70,0,.6);
}
.best { font-size: 12px; font-weight: 700; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.best i { color: var(--gold); margin-right: 3px; }

/* ---------- 場景 ---------- */
#scene { position: relative; flex: 1; min-height: 0; box-shadow: inset 0 0 70px rgba(70,120,160,.22); }
#scene canvas { display: block; touch-action: none; }

/* ---------- 底部工具列：RPG 快捷欄（深色木塢） ---------- */
#toolbar {
  position: relative;
  z-index: 10;
  display: flex; align-items: stretch; gap: 9px;
  padding: 22px 12px calc(env(safe-area-inset-bottom, 0px) + 11px);
  background: linear-gradient(180deg, #8a5526, #5f3d1a 65%, #4e300f);
  border-top: 4px solid #3f2712;
  box-shadow: inset 0 3px 0 rgba(255,220,170,.25), 0 -6px 18px rgba(124,82,39,.25);
}
.tool-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 60px; min-height: 56px; padding: 6px 10px;
  background: linear-gradient(180deg, #fffdf4, #ffe9bd);
  border: 3px solid var(--wood-deep);
  border-bottom-width: 6px;
  border-radius: 15px;
  color: var(--text); font-size: 19px; cursor: pointer; font-weight: 700;
  transition: transform .1s ease, border-bottom-width .1s ease, filter .15s ease;
  flex-shrink: 0;
}
.tool-btn small { font-size: 10px; color: #8a6538; font-weight: 800; }
.tool-btn::after {
  content: ''; position: absolute; left: 8%; top: 6%; width: 46%; height: 22%;
  border-radius: 8px; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.8), rgba(255,255,255,0));
}
.tool-btn:active { transform: translateY(3px); border-bottom-width: 3px; }
.tool-btn.latched {
  background: linear-gradient(180deg, #ffd6d1, #ffaba4);
  border-color: #b0483f;
  box-shadow: 0 3px 0 #7c2c26, inset 0 2px 0 rgba(255,255,255,.45);
}
.tool-btn.latched small { color: #a33d3d; }

#item-tray {
  display: flex; gap: 9px; align-items: stretch;
  flex: 1; overflow-x: auto; scrollbar-width: none;
  padding-top: 13px; margin-top: -13px;
}
#item-tray::-webkit-scrollbar { display: none; }

.item-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 60px; min-height: 56px; padding: 6px 8px;
  background: linear-gradient(180deg, #fffdf4, #ffe9bd);
  border: 3px solid var(--wood-deep);
  border-bottom-width: 6px;
  border-radius: 15px;
  color: var(--text); font-size: 20px; cursor: pointer;
  transition: transform .1s ease, border-bottom-width .1s ease, filter .15s ease;
  flex-shrink: 0;
}
.item-btn small { font-size: 10px; color: #8a6538; font-weight: 800; white-space: nowrap; }
.item-btn::after {
  content: ''; position: absolute; left: 8%; top: 6%; width: 46%; height: 22%;
  border-radius: 8px; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.8), rgba(255,255,255,0));
}
.item-btn:active { transform: translateY(3px); border-bottom-width: 3px; }
.item-btn.empty { opacity: .45; filter: grayscale(.75); }
.item-btn.armed {
  background: linear-gradient(180deg, #d8f4c8, #abe294);
  border-color: #2f7d24;
  box-shadow: 0 3px 0 #1e5716, inset 0 2px 0 rgba(255,255,255,.5);
}
.item-btn.passive { cursor: default; }
.item-btn .badge {
  position: absolute; top: -8px; right: -8px;
  min-width: 22px; height: 22px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 32% 28%, #ffd166, #f59e0b);
  color: #6b3d00;
  border-radius: 999px; font-size: 11.5px; font-weight: 900;
  border: 2.5px solid var(--wood-deep);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.6), 0 2px 4px rgba(40,20,0,.35);
}

/* ---------- 瞄準橫幅：任務提示風 ---------- */
#targeting-banner {
  position: absolute; left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--panel);
  border: 3px solid var(--accent);
  border-radius: 16px;
  font-size: 14px; font-weight: 800; color: var(--text);
  box-shadow: 0 5px 0 rgba(87,56,26,.28), 0 10px 24px rgba(90,50,10,.3);
  animation: banner-wiggle 1.4s ease-in-out infinite;
}
@keyframes banner-wiggle {
  0%, 100% { transform: translateX(-50%) rotate(-.6deg); }
  50% { transform: translateX(-50%) rotate(.6deg); }
}
#targeting-banner span i { color: var(--accent-deep); margin-right: 4px; }
#targeting-banner button {
  border: 0; background: var(--panel-soft); color: var(--text-dim);
  border: 2px solid var(--line); border-bottom-width: 4px;
  padding: 5px 13px; border-radius: 10px; font-size: 13px; cursor: pointer; font-weight: 800;
}
#targeting-banner button:active { transform: translateY(2px); border-bottom-width: 2px; }

/* ---------- Overlay / Panel：鉚釘厚框面板 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(60, 40, 15, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 1; transition: opacity .2s ease;
}
.overlay.hidden, .hidden { display: none !important; }

.panel {
  position: relative;
  width: 100%; max-width: 420px;
  max-height: min(86dvh, 640px);
  overflow-y: auto;
  background: linear-gradient(180deg, #fffaf0, #ffefd0);
  border: 4px solid var(--wood-deep);
  border-radius: 26px;
  padding: 22px;
  box-shadow:
    0 12px 0 rgba(87, 53, 19, .4),
    0 30px 70px rgba(50, 30, 8, .45),
    inset 0 0 0 3px rgba(255, 255, 255, .6);
  animation: pop-in .25s cubic-bezier(.2,1.4,.4,1);
}
.panel::after {
  content: ''; position: absolute; inset: 12px; pointer-events: none; border-radius: 16px;
  background:
    radial-gradient(circle 4.5px at 0 0, #c99a5b 62%, transparent 64%),
    radial-gradient(circle 4.5px at 100% 0, #c99a5b 62%, transparent 64%),
    radial-gradient(circle 4.5px at 0 100%, #c99a5b 62%, transparent 64%),
    radial-gradient(circle 4.5px at 100% 100%, #c99a5b 62%, transparent 64%);
}
@keyframes pop-in { from { transform: scale(.88) translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-head h2 {
  display: inline-block;
  background: linear-gradient(180deg, #8a5526, #6b431f);
  color: #ffe9bd;
  padding: 8px 20px;
  border: 2.5px solid var(--wood-deep);
  border-radius: 13px;
  box-shadow: 0 4px 0 var(--wood-deep), inset 0 2px 0 rgba(255,235,200,.3);
  transform: rotate(-1.2deg);
  font-size: 19px; letter-spacing: .06em;
  text-shadow: 0 2px 2px rgba(50,25,0,.5);
}
.head-right { display: flex; align-items: center; gap: 8px; }
.close-btn {
  width: 38px; height: 38px; border-radius: 12px;
  border: 2.5px solid var(--wood-dark); border-bottom-width: 5px;
  background: linear-gradient(180deg, #ffd98f, #ffb84d);
  color: #5f3d1a; font-size: 15px; cursor: pointer;
}
.close-btn:active { transform: translateY(3px); border-bottom-width: 2px; }
.shop-hint { font-size: 12.5px; color: var(--text-dim); margin-bottom: 14px; font-weight: 700; }

/* 商店卡片：貨架商品 */
#shop-items { display: flex; flex-direction: column; gap: 11px; }
.shop-card {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--panel-soft);
  border: 3px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 3px 0 rgba(160,110,40,.15);
}
.shop-card .icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px;
  background: linear-gradient(180deg, #fff3d6, #ffe0a3);
  border: 2.5px solid #d9a869;
  border-radius: 13px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.7);
}
.shop-card .info h3 { font-size: 15px; margin-bottom: 2px; color: var(--wood-dark); font-weight: 900; }
.shop-card .info p { font-size: 12px; color: var(--text-dim); line-height: 1.45; font-weight: 600; }
.buy-btn {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 78px; padding: 9px 12px;
  border: 2.5px solid var(--wood-dark); border-bottom-width: 6px; border-radius: 13px; cursor: pointer;
  background: linear-gradient(180deg, #ffc95e, #ff9d1c);
  color: #6b3d00; font-weight: 900; font-size: 14px;
  transition: transform .1s ease, border-bottom-width .1s ease, filter .15s ease;
}
.buy-btn::after {
  content: ''; position: absolute; left: 8%; top: 6%; width: 46%; height: 22%;
  border-radius: 6px; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,0));
}
.buy-btn small { font-size: 10px; font-weight: 800; opacity: .85; }
.buy-btn:hover { filter: brightness(1.07); }
.buy-btn:active { transform: translateY(3px); border-bottom-width: 3px; }
.buy-btn:disabled { filter: grayscale(.85) brightness(1.05); cursor: not-allowed; transform: none; }

/* 結算畫面 */
.end-panel {
  max-height: calc(100dvh - 24px);
  overflow-y: hidden;
  text-align: center;
}
.end-panel h2 {
  font-size: 32px; letter-spacing: .04em; margin-bottom: 10px;
  color: #fff;
  text-shadow:
    -2px -2px 0 var(--accent-deep), 2px -2px 0 var(--accent-deep),
    -2px 2px 0 var(--accent-deep), 2px 2px 0 var(--accent-deep),
    0 5px 0 #b35c00, 0 9px 16px rgba(90,50,10,.4);
  transform: rotate(-1deg);
}
.end-panel h2 i { color: #fff; filter: drop-shadow(0 3px 0 var(--accent-deep)); }
.end-panel > p { color: var(--text-dim); font-size: 14px; line-height: 1.6; font-weight: 700; }
.gold-text { color: var(--accent-deep); }
.end-stats {
  display: flex; flex-direction: column; gap: 7px;
  margin: 18px 0;
  padding: 15px;
  background: var(--panel-soft);
  border: 3px dashed var(--wood-light);
  border-radius: 15px;
}
.end-stats .row { display: flex; justify-content: space-between; font-size: 14px; font-weight: 800; }
.end-stats .row span:first-child { color: var(--text-dim); }
.end-stats .row span:first-child i { margin-right: 5px; color: var(--wood-light); }
.end-stats .row .gain { color: var(--accent-deep); font-weight: 900; font-size: 15px; }
.end-stats .record { color: var(--safe); font-size: 12.5px; margin-top: 5px; font-weight: 900; }
.end-actions { display: flex; gap: 12px; justify-content: center; }
.end-actions button:disabled { cursor: wait; opacity: .58; filter: grayscale(.35); }
.primary-btn, .ghost-btn {
  flex: 1; max-width: 170px;
  padding: 14px 16px; border-radius: 15px; font-size: 15.5px; font-weight: 900;
  cursor: pointer; letter-spacing: .05em;
  transition: transform .1s ease, border-bottom-width .1s ease, filter .15s ease;
  border: 3px solid transparent;
}
.primary-btn {
  background: linear-gradient(180deg, #ffc266, var(--accent));
  border-color: var(--wood-dark); border-bottom-width: 6px;
  color: #fff;
  text-shadow: 0 2px 2px rgba(150,70,0,.55);
}
.ghost-btn {
  background: var(--panel-soft);
  border-color: var(--wood-light); border-bottom-width: 6px;
  color: var(--text);
}
.primary-btn:hover, .ghost-btn:hover { filter: brightness(1.05); }
.primary-btn:active, .ghost-btn:active { transform: translateY(3px); border-bottom-width: 3px; }

/* Toast：任務快報 */
#toast-wrap {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 154px);
  left: 50%; transform: translateX(-50%);
  z-index: 60;
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
  pointer-events: none;
  width: max-content; max-width: 90vw;
}
.toast {
  padding: 11px 19px;
  background: linear-gradient(#fffdf4, #ffeecc);
  border: 3px solid var(--wood-light);
  border-left-width: 9px;
  border-radius: 14px;
  font-size: 14px; font-weight: 800; color: var(--text);
  box-shadow: 0 6px 0 rgba(87,53,19,.22), 0 12px 28px rgba(90,60,25,.3);
  animation: toast-in .25s cubic-bezier(.2,1.4,.4,1), toast-out .3s ease 2.1s forwards;
  max-width: 90vw; text-align: center;
}
.toast.good { border-left-color: var(--safe); }
.toast.bad { border-left-color: var(--danger); }
.toast.gold { border-left-color: var(--gold); }
@keyframes toast-in { from { transform: translateY(14px) scale(.92); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-8px); opacity: 0; } }

/* ---------- 楓葉飄落裝飾 ---------- */
#fx-leaves {
  position: fixed; inset: 0; z-index: 8;
  pointer-events: none; overflow: hidden;
}
#fx-leaves .leaf {
  position: absolute; top: -6vh;
  width: 15px; height: 15px;
  clip-path: polygon(50% 0%, 88% 22%, 100% 58%, 66% 52%, 78% 100%, 50% 76%, 22% 100%, 34% 52%, 0% 58%, 12% 22%);
  opacity: .85;
  animation-name: leaf-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}
@keyframes leaf-fall {
  0%   { transform: translate(0, -6vh) rotate(0deg); }
  25%  { transform: translate(4vw, 26vh) rotate(95deg); }
  50%  { transform: translate(-3vw, 52vh) rotate(190deg); }
  75%  { transform: translate(3vw, 82vh) rotate(280deg); }
  100% { transform: translate(-1vw, 114vh) rotate(380deg); }
}

/* ---------- Remix Icon 對齊微調 ---------- */
i[class^="ri-"], i[class*=" ri-"] {
  font-style: normal;
  line-height: 1;
  vertical-align: -0.14em;
  display: inline-block;
}
.icon-btn i { font-size: 18px; }
.tool-btn .tool-icon i, .item-btn .tool-icon i { font-size: 21px; }
.close-btn i { font-size: 16px; }
.toast i { margin-right: 6px; font-size: 15px; vertical-align: -0.12em; }
.toast.gold i { color: var(--accent-deep); }
.toast.good i { color: var(--safe); }
.toast.bad i { color: var(--danger); }
.shop-card .icon i { font-size: 27px; color: var(--accent-deep); }
.buy-btn i { font-size: 14px; vertical-align: -0.12em; }
.panel-head h2 i { color: #ffd166; margin-right: 7px; }
.best i { margin-right: 3px; }

/* ---------- 手機響應式 ---------- */
@media (max-width: 880px) {
  #game-logo { display: none; }
}
@media (max-width: 480px) {
  .pill { padding: 4px 9px 5px; font-size: 12px; border-width: 2.5px; border-bottom-width: 4px; }
  .pill b { font-size: 15.5px; }
  .seg { gap: 3px; padding: 3px; }
  .seg button { padding: 7px 10px; font-size: 12px; letter-spacing: 0; }
  .icon-btn { min-width: 46px; min-height: 48px; padding: 3px 8px; font-size: 15px; }
  .icon-btn small { font-size: 9px; }
  .best { display: none; }
  #targeting-banner { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); width: max-content; max-width: 94vw; font-size: 13px; }
  .panel { padding: 18px; border-radius: 22px; }
  .end-panel h2 { font-size: 27px; }
}
@media (max-width: 360px) {
  .hud-group { gap: 4px; }
  .pill { font-size: 11px; padding: 4px 7px 5px; }
}
/* 橫向手機 HUD 收合為一行 */
@media (orientation: landscape) and (max-height: 480px) {
  #hud { flex-direction: row; align-items: center; padding-top: calc(env(safe-area-inset-top, 0px) + 6px); padding-bottom: 6px; }
  #hud .hud-row { flex: 1; }
  #hud .hud-row:last-child { justify-content: flex-end; }
  .tool-btn, .item-btn { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  #fx-leaves { display: none; }
  #game-logo { animation: none; }
}
