/* ============================================================
   孵蛋廚房 style.css — 主題、外殼、共用元件、各場景、動畫
   ============================================================ */

/* ---------- 主題變數 ---------- */
:root {
  --bg: #f7e8d0;
  --bg2: #fff6e5;
  --panel: #fffdf7;
  --panel-2: #fdf3dd;
  --ink: #5b4632;
  --ink-soft: #8a7358;
  --ink-faint: #b7a68d;
  --accent: #ff9d3c;
  --accent-deep: #f07f13;
  --accent-soft: #ffe3bd;
  --good: #58b368;
  --good-soft: #ddf3e0;
  --bad: #e05d5d;
  --bad-soft: #fbe0e0;
  --gold: #ffb020;
  --gold-deep: #d98a00;

  --r-common: #9aa88f;
  --r-rare: #5d9fd4;
  --r-epic: #b07fd8;
  --r-legendary: #e8a11c;
  --r-special: #8d8d9d;

  --shadow: 0 2px 10px rgba(91, 70, 50, .12);
  --shadow-lg: 0 8px 28px rgba(91, 70, 50, .22);
  --radius: 16px;
  --radius-sm: 10px;

  --font: "Yuanti TC", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: repeating-linear-gradient(135deg, #f2dfc2 0 24px, #f7e8d0 24px 48px);
  overflow: hidden;
  user-select: none;
}
button { font-family: inherit; color: inherit; border: none; background: none; cursor: pointer; }
svg { display: block; }

/* ---------- App 外殼：直向欄 ≤460px ---------- */
#app {
  height: 100dvh;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
@media (min-width: 500px) { #app { border-radius: 0; } }

/* ---------- HUD ---------- */
#hud {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px;
  background: linear-gradient(#fff6e5, #ffedcd);
  border-bottom: 2px solid #ffe6ba;
  z-index: 5;
}
.hud-title { font-weight: 800; font-size: 17px; letter-spacing: 1px; }
.hud-right { display: flex; align-items: center; gap: 8px; }
.hud-gold {
  display: flex; align-items: center; gap: 5px;
  background: #fff; border: 2px solid #ffd98a;
  border-radius: 999px; padding: 4px 12px 4px 8px;
  font-weight: 800; font-size: 15px; color: var(--gold-deep);
  box-shadow: var(--shadow);
}
.hud-gold.pulse { animation: gold-pulse .45s ease; }
@keyframes gold-pulse { 40% { transform: scale(1.18); } }
.gold-icon, .gold-icon::after {
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--gold) 65%);
  border: 2px solid var(--gold-deep); display: inline-block; flex: none;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow);
  font-size: 18px; display: grid; place-items: center;
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.9); }

/* ---------- 場景容器 ---------- */
#scene-root { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.scene { padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px)); min-height: 100%; }
.scene-header { margin: 2px 2px 10px; }
.scene-title { font-size: 19px; font-weight: 800; }
.scene-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- 底部 Tab 列 ---------- */
#tabbar {
  display: flex; background: #fff;
  border-top: 2px solid #ffe6ba;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 5;
}
.tab {
  flex: 1; min-height: 56px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-faint); font-size: 11px; font-weight: 700;
  transition: color .15s; position: relative;
}
.tab .tab-icon { width: 24px; height: 24px; }
.tab .tab-icon svg { width: 100%; height: 100%; }
.tab.active { color: var(--accent-deep); }
.tab.active::before {
  content: ""; position: absolute; top: -2px; left: 20%; right: 20%; height: 3px;
  background: var(--accent); border-radius: 0 0 4px 4px;
}
.tab .tab-dot {
  position: absolute; top: 6px; right: calc(50% - 16px);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bad); border: 2px solid #fff; display: none;
}
.tab.has-dot .tab-dot { display: block; animation: dot-blink 1.2s infinite; }
@keyframes dot-blink { 50% { opacity: .45; } }

/* ---------- 共用按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 8px 18px;
  border-radius: 999px; font-size: 15px; font-weight: 800;
  background: var(--accent); color: #fff;
  box-shadow: 0 3px 0 var(--accent-deep);
  transition: transform .1s, box-shadow .1s, filter .15s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }
.btn:disabled { filter: grayscale(.7) opacity(.6); pointer-events: none; }
.btn.green { background: var(--good); box-shadow: 0 3px 0 #3f9450; }
.btn.green:active { box-shadow: 0 1px 0 #3f9450; }
.btn.gray { background: #c9b9a2; box-shadow: 0 3px 0 #ab9a80; }
.btn.gray:active { box-shadow: 0 1px 0 #ab9a80; }
.btn.small { min-height: 36px; padding: 4px 14px; font-size: 13px; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 3px 0 #e3d5bd, inset 0 0 0 2px #eadfc9; }
.btn.wide { width: 100%; }

/* ---------- Modal / 底層面板 ---------- */
#modal-root:not(:empty) { position: absolute; inset: 0; z-index: 30; }
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(60, 40, 20, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .18s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  width: 100%; max-height: 88%;
  background: var(--panel); border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column;
  animation: sheet-up .22s cubic-bezier(.2, .9, .3, 1.1);
  box-shadow: var(--shadow-lg);
}
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } }
.modal-grip { width: 44px; height: 5px; border-radius: 3px; background: #e5d8c2; margin: 10px auto 2px; flex: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 8px; flex: none; }
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close { width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); font-size: 15px; }
.modal-body { padding: 2px 16px 8px; overflow-y: auto; }
.modal-actions { display: flex; gap: 10px; padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); flex: none; }
.modal-actions .btn { flex: 1; }

/* ---------- Toast ---------- */
#toast-root {
  position: absolute; left: 0; right: 0; bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 40; pointer-events: none;
}
.toast {
  background: rgba(70, 50, 30, .92); color: #fff;
  padding: 10px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease, toast-out .3s ease 2.2s forwards;
  max-width: 86%; text-align: center;
}
.toast.gold { background: linear-gradient(#ffcf6e, #ffab2e); color: #5b3a00; }
.toast.good { background: linear-gradient(#7ed08a, #4fa95e); color: #0e3d18; }
.toast.bad { background: linear-gradient(#f08e8e, #d95f5f); color: #fff; }
@keyframes toast-in { from { transform: translateY(14px) scale(.9); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(8px); opacity: 0; } }

/* ---------- 卡片基底 ---------- */
.card {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px;
}
.card + .card { margin-top: 10px; }
.section-label { font-size: 13px; font-weight: 800; color: var(--ink-soft); margin: 14px 4px 8px; }

/* ---------- 廚房場景 ---------- */
.kitchen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.station {
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; overflow: hidden;
}
.station.locked { outline: 2px dashed #d9c9ac; outline-offset: -6px; background: var(--panel-2); }
.station-art { width: 92px; height: 92px; position: relative; }
.station-art svg { width: 100%; height: 100%; }
.station-name { font-weight: 800; font-size: 14px; }
.station-lv { font-size: 11px; color: var(--ink-soft); font-weight: 700; }
.station .btn { margin-top: 4px; }
.station .btn.small { min-height: 38px; width: 100%; }

.countdown-wrap { position: relative; width: 74px; height: 74px; margin: 2px 0; }
.countdown-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown-text {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 14px; font-weight: 800; color: var(--ink);
}
.station-ready { animation: station-glow 1.6s ease infinite; }
@keyframes station-glow {
  50% { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
}

/* 狀態徽章 */
.badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 10.5px; font-weight: 800; color: #fff;
  padding: 3px 9px; border-radius: 999px;
}
.badge.cooking { background: var(--r-rare); }
.badge.ready { background: var(--good); animation: dot-blink 1s infinite; }
.badge.burnt { background: var(--bad); }
.badge.sick { background: var(--r-special); }

/* ---------- 調味料選擇面板 ---------- */
.egg-preview { display: grid; place-items: center; margin: 4px 0 8px; }
.egg-preview svg { width: 110px; height: 110px; }
.combo-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 30px; margin-bottom: 10px; }
.combo-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-soft); color: var(--ink);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 800;
  animation: chip-in .18s ease;
}
.combo-chip button { font-size: 12px; opacity: .6; }
@keyframes chip-in { from { transform: scale(.6); opacity: 0; } }
.seasoning-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.season-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--panel-2); border-radius: var(--radius-sm);
  padding: 8px 4px; min-height: 76px; justify-content: space-between;
  transition: transform .1s; position: relative;
}
.season-item:active { transform: scale(.93); }
.season-item.none { opacity: .45; }
.season-item .s-icon { width: 30px; height: 30px; }
.season-item .s-icon svg { width: 100%; height: 100%; }
.season-item .s-name { font-size: 11.5px; font-weight: 700; }
.season-item .s-count { font-size: 10.5px; color: var(--ink-soft); font-weight: 800; }
.season-item.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.season-item .s-buy { font-size: 9.5px; color: var(--gold-deep); font-weight: 800; }
.recipe-hint {
  background: var(--panel-2); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 12.5px; color: var(--ink-soft);
  margin-top: 10px; line-height: 1.5;
}
.recipe-hint b { color: var(--ink); }
.recipe-hint .hint-chicks { display: flex; gap: 6px; margin-top: 6px; }
.recipe-hint .hint-chicks svg { width: 34px; height: 34px; }

/* ---------- 農場 ---------- */
.farm-stage {
  position: relative; height: 380px; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(#cfeaf7 0 34%, #b5e08e 34% 100%);
}
.farm-stage .ground { position: absolute; inset: auto 0 0 0; height: 66%; background: #a8d97e; }
.fence {
  position: absolute; left: 0; right: 0; top: 34%; height: 34px;
  background: repeating-linear-gradient(90deg, #c99b62 0 10px, transparent 10px 26px);
  border-top: 6px solid #b3854e; opacity: .9;
}
.farm-chick {
  position: absolute; width: 44px; height: 44px; will-change: transform;
  transition: none; cursor: pointer;
}
.farm-chick svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 2px rgba(0,0,0,.15)); }
.farm-chick.hop { animation: chick-hop .5s ease; }
@keyframes chick-hop { 30% { margin-bottom: 8px; } 60% { margin-bottom: 0; } }
.farm-toolbar { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.capacity-bar { flex: 1; min-width: 120px; }
.capacity-bar .bar-bg { height: 12px; border-radius: 999px; background: #e8dcc4; overflow: hidden; }
.capacity-bar .bar-fill { height: 100%; background: var(--good); border-radius: 999px; transition: width .3s; }
.capacity-bar .bar-text { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); margin-top: 3px; text-align: center; }
.filter-chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: #fff; color: var(--ink-soft); box-shadow: var(--shadow);
}
.filter-chip.active { background: var(--ink); color: #fff; }

/* 小雞資訊彈窗 */
.chick-detail { display: flex; gap: 14px; align-items: center; }
.chick-detail .cd-art { width: 96px; height: 96px; flex: none; }
.chick-detail .cd-art svg { width: 100%; height: 100%; }
.chick-detail .cd-name { font-size: 17px; font-weight: 800; }
.chick-detail .cd-info { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.6; }

/* ---------- 商店 ---------- */
.shop-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.shop-tab {
  flex: 1; min-height: 40px; border-radius: 999px;
  background: #fff; color: var(--ink-soft); font-weight: 800; font-size: 13.5px;
  box-shadow: var(--shadow); transition: all .15s;
}
.shop-tab.active { background: var(--accent); color: #fff; }
.shop-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 12px;
}
.shop-row + .shop-row { margin-top: 8px; }
.shop-row .sr-icon { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; }
.shop-row .sr-icon svg { width: 36px; height: 36px; }
.shop-row .sr-main { flex: 1; min-width: 0; }
.shop-row .sr-name { font-weight: 800; font-size: 14.5px; }
.shop-row .sr-desc { font-size: 11.5px; color: var(--ink-soft); margin-top: 1px; line-height: 1.45; }
.shop-row .sr-price { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--gold-deep); font-size: 14px; }
.shop-row .sr-price .gold-icon { width: 14px; height: 14px; border-width: 1.5px; }
.price-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--gold-deep); }
.upgrade-pips { display: flex; gap: 4px; margin-top: 5px; }
.upgrade-pips i { width: 16px; height: 7px; border-radius: 4px; background: #e8dcc4; }
.upgrade-pips i.on { background: var(--accent); }

/* ---------- 圖鑑 ---------- */
.book-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.book-progress .bp-text { font-weight: 800; font-size: 14px; white-space: nowrap; }
.book-progress .bar-bg { flex: 1; height: 14px; border-radius: 999px; background: #e8dcc4; overflow: hidden; }
.book-progress .bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.milestone-track { display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 4px; scrollbar-width: none; }
.milestone-track::-webkit-scrollbar { display: none; }
.milestone {
  flex: none; width: 76px; border-radius: var(--radius-sm); text-align: center;
  background: var(--panel-2); padding: 8px 4px; border: 2px solid transparent;
}
.milestone .m-num { font-size: 12px; font-weight: 800; }
.milestone .m-reward { font-size: 10.5px; color: var(--ink-soft); margin: 2px 0 4px; }
.milestone .btn { min-height: 28px; padding: 2px 10px; font-size: 11.5px; }
.milestone.done { opacity: .55; }
.milestone.reachable { border-color: var(--accent); background: var(--accent-soft); }
.book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.book-tile {
  border-radius: var(--radius-sm); background: var(--panel);
  box-shadow: var(--shadow); padding: 7px 4px 6px; text-align: center;
  border: 2.5px solid transparent; position: relative;
}
.book-tile.common { border-color: #dfe7da; }
.book-tile.rare { border-color: #c8dff0; }
.book-tile.epic { border-color: #e2d3f2; }
.book-tile.legendary { border-color: #f3dcae; }
.book-tile.special { border-color: #dcdee3; }
.book-tile .bt-art { width: 56px; height: 56px; margin: 0 auto; }
.book-tile .bt-art svg { width: 100%; height: 100%; }
.book-tile .bt-art.silhouette svg { filter: brightness(0) opacity(.55); }
.book-tile .bt-name { font-size: 10.5px; font-weight: 800; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-tile .bt-count { font-size: 9.5px; color: var(--ink-soft); font-weight: 700; }
.book-tile.new::after {
  content: "NEW"; position: absolute; top: -5px; right: -4px;
  background: var(--bad); color: #fff; font-size: 8.5px; font-weight: 800;
  padding: 2px 6px; border-radius: 999px; transform: rotate(8deg);
}
.rarity-stars { font-size: 10px; letter-spacing: 1px; }

/* ---------- 每日任務 ---------- */
.login-track { display: flex; gap: 6px; margin: 10px 0 4px; }
.login-day {
  flex: 1; border-radius: var(--radius-sm); text-align: center;
  background: var(--panel-2); padding: 8px 2px; position: relative; border: 2px solid transparent;
}
.login-day .ld-label { font-size: 10px; font-weight: 800; color: var(--ink-soft); }
.login-day .ld-reward { font-size: 12.5px; font-weight: 800; color: var(--gold-deep); margin: 3px 0; }
.login-day.claimed { opacity: .5; }
.login-day.claimed::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; color: var(--good); }
.login-day.today { border-color: var(--accent); background: var(--accent-soft); }
.task-card { display: flex; align-items: center; gap: 12px; }
.task-card .tc-main { flex: 1; }
.task-card .tc-name { font-weight: 800; font-size: 14px; }
.task-card .tc-bar { margin-top: 6px; }
.task-card .tc-bar .bar-bg { height: 10px; border-radius: 999px; background: #e8dcc4; overflow: hidden; }
.task-card .tc-bar .bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.task-card .tc-count { font-size: 11px; font-weight: 800; color: var(--ink-soft); margin-top: 3px; }

/* ---------- 收蛋動畫 ---------- */
.hatch-burst {
  position: absolute; inset: 0; display: grid; place-items: center;
  z-index: 20; pointer-events: none;
}
.hatch-burst svg { width: 110px; height: 110px; animation: hatch-pop .9s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes hatch-pop {
  0% { transform: scale(.2); opacity: 0; }
  45% { transform: scale(1.25); opacity: 1; }
  70% { transform: scale(1); }
  100% { transform: scale(1) translateY(-30px); opacity: 0; }
}
.fly-chick {
  position: absolute; z-index: 25; width: 46px; height: 46px; pointer-events: none;
  animation: fly-to-farm 1s ease forwards;
}
@keyframes fly-to-farm {
  40% { transform: translate(0, -90px) scale(1.1); }
  100% { transform: translate(160px, 320px) scale(.4); opacity: 0; }
}

/* ---------- 設定 ---------- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; border-bottom: 1px solid #f0e6d2; font-weight: 700; font-size: 14.5px;
}
.switch { width: 52px; height: 30px; border-radius: 999px; background: #ddceae; position: relative; transition: background .2s; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch.on { background: var(--good); }
.switch.on::after { left: 25px; }
.save-textarea {
  width: 100%; height: 90px; font-size: 11px; font-family: monospace;
  border: 2px solid #e8dcc4; border-radius: var(--radius-sm); padding: 8px;
  background: #fffdf7; color: var(--ink); resize: none;
}

/* ---------- 除錯列 ---------- */
#debug-bar {
  position: absolute; top: 64px; left: 8px; right: 8px; z-index: 50;
  display: flex; gap: 6px; flex-wrap: wrap;
}
#debug-bar button {
  background: rgba(80, 60, 40, .85); color: #ffe; font-size: 11px; font-weight: 700;
  padding: 6px 10px; border-radius: 999px;
}

/* ---------- 桌面微調 ---------- */
@media (min-width: 500px) {
  .farm-stage { height: 440px; }
}

/* ---------- 小雞／廚師具動畫 ---------- */
@keyframes bob { 50% { transform: translateY(-4px); } }
.anim-bob { animation: bob 2.4s ease-in-out infinite; }

@keyframes bubble-up { 0% { transform: translateY(0); opacity: .9; } 100% { transform: translateY(-14px); opacity: 0; } }
.station-art [data-status="cooking"] .bubbles circle { animation: bubble-up 1.4s ease-in infinite; }
.station-art [data-status="cooking"] .bubbles circle:nth-child(2) { animation-delay: .4s; }
.station-art [data-status="cooking"] .bubbles circle:nth-child(3) { animation-delay: .8s; }

@keyframes flame-flicker { 50% { transform: scaleY(1.25) translateY(-1px); } }
.station-art [data-status="cooking"] .flame { animation: flame-flicker .8s ease-in-out infinite; transform-origin: 50% 100%; }

@keyframes egg-shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
.station-art [data-status="ready"] .station-egg { animation: egg-shake .55s ease-in-out infinite; transform-origin: 50% 80%; }
.station-art [data-status="cooking"] .station-egg { animation: egg-shake 1.6s ease-in-out infinite; transform-origin: 50% 80%; }
.station-art [data-status="burnt"] .station-egg { animation: none; }

@keyframes smoke-up { 0% { transform: translateY(4px); opacity: .7; } 100% { transform: translateY(-10px); opacity: 0; } }
.station-art [data-status="burnt"] .smoke circle { animation: smoke-up 2s ease-out infinite; }
.station-art [data-status="burnt"] .smoke circle:nth-child(2) { animation-delay: .5s; }
.station-art [data-status="burnt"] .smoke circle:nth-child(3) { animation-delay: 1s; }

@keyframes heat-pulse { 50% { opacity: .3; } }
.station-art [data-status="cooking"] .heat-waves { animation: heat-pulse 1.6s ease-in-out infinite; }
@keyframes lamp-glow { 50% { opacity: .55; } }
.station-art [data-status="cooking"] .lamp-light { animation: lamp-glow 2s ease-in-out infinite; }

@keyframes sparkle-twinkle { 50% { opacity: .25; transform: scale(.7); } }
.sparkle-ready { animation: sparkle-twinkle 1s ease-in-out infinite; transform-origin: 50% 50%; }
.legend-sparkles { animation: sparkle-twinkle 1.8s ease-in-out infinite; }

/* ---------- 開場玩家設定 ---------- */
#player-setup {
  position: absolute; inset: 0; z-index: 60;
  background: linear-gradient(rgba(255, 246, 229, .96), rgba(255, 214, 150, .96));
  display: grid; place-items: center; padding: 20px;
  animation: fade-in .3s ease;
}
.ps-card {
  width: 100%; max-width: 340px; text-align: center;
  background: var(--panel); border-radius: 24px;
  box-shadow: var(--shadow-lg); padding: 26px 22px;
}
.ps-art { display: flex; justify-content: center; gap: 4px; margin-bottom: 8px; }
.ps-title { font-size: 21px; margin-bottom: 4px; }
.ps-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }
.ps-input {
  width: 100%; height: 48px; border: 2.5px solid #eadfc9; border-radius: 14px;
  background: #fffdf7; text-align: center; font-size: 17px; font-weight: 800;
  color: var(--ink); outline: none; font-family: inherit;
}
.ps-input:focus { border-color: var(--accent); }
.ps-genders { display: flex; gap: 10px; margin-top: 12px; }
.ps-gender {
  flex: 1; min-height: 48px; border-radius: 14px;
  background: var(--panel-2); font-size: 15.5px; font-weight: 800;
  border: 2.5px solid transparent; transition: all .15s;
}
.ps-gender.active { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 減少動態 ---------- */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  animation-duration: .01s !important; animation-iteration-count: 1 !important;
  transition-duration: .01s !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; }
}
