/* ============================================================
   消費者端版面與元件（手機直式・深色奇幻 RPG）。
   顏色一律引用 theme.css 的 var()，本檔不寫死色值。
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-base);
  color: var(--text);
  background: var(--grad-app) fixed, var(--bg-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; }

/* ---- App 直式容器 ---- */
.app {
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding: 0 14px 96px;
  overflow-x: hidden;
}

/* ---- 頂欄 ---- */
.app-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 4px 10px;
  background: linear-gradient(var(--bg-1) 70%, transparent);
  backdrop-filter: blur(4px);
}
.app-bar .who { flex: 1; min-width: 0; }
.app-bar .who b { display: block; font-size: 15px; color: var(--gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-bar .who small { color: var(--text-mute); font-size: 11px; }
.app-bar .brand { font-family: var(--font-title); letter-spacing: 1px; font-size: 13px; color: var(--text-dim); }
.icon-btn {
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text-dim); border-radius: 999px; padding: 7px 12px; font-size: 12px;
}
.icon-btn:active { background: var(--panel-3); }

/* ---- 面板 ---- */
.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
  box-shadow: var(--shadow-soft);
}
.panel > h2 {
  font-size: 14px; letter-spacing: .5px; color: var(--text-dim);
  display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
  text-transform: none;
}
.panel > h2::before { content: ""; width: 4px; height: 15px; border-radius: 3px;
  background: var(--grad-gold); box-shadow: var(--glow-gold); }
.note { color: var(--text-mute); font-size: 12px; line-height: 1.6; margin: 6px 0 0; }

/* ---- 按鈕 ---- */
.btn {
  border: none; border-radius: var(--radius-sm); padding: 12px 16px;
  font-weight: 700; font-size: 14px; color: #2a1c00; background: var(--grad-gold);
  box-shadow: var(--glow-gold); width: 100%;
}
.btn:active { transform: translateY(1px); filter: brightness(1.05); }
.btn.ghost { background: var(--panel-2); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.accent { background: var(--grad-accent); color: #fff; box-shadow: var(--glow-accent); }
.btn.danger { background: var(--grad-danger); color: #fff; box-shadow: var(--glow-danger); }
.btn[disabled] { opacity: .45; filter: grayscale(.4); box-shadow: none; }

/* ============================================================
   Portal 入口首頁
   ============================================================ */
.portal {
  min-height: 100vh; max-width: var(--app-max); margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 22px; gap: 18px; text-align: center;
}
.portal .logo { font-size: 52px; filter: drop-shadow(var(--glow-gold)); }
.portal h1 { font-family: var(--font-title); font-size: 26px; letter-spacing: 2px;
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.portal .sub { color: var(--text-dim); font-size: 13px; margin-top: -6px; }
.portal .tag-poc {
  align-self: center; font-size: 10px; letter-spacing: 2px; color: var(--text-mute);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}
.enter-card {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 18px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow); transition: transform .12s;
}
.enter-card:active { transform: scale(.98); }
.enter-card .em { font-size: 34px; }
.enter-card .txt b { display: block; font-size: 17px; }
.enter-card .txt small { color: var(--text-mute); font-size: 12px; }
.enter-card.player { border-color: var(--gold-soft); }
.enter-card.admin { border-color: var(--border); }
.enter-card .arrow { margin-left: auto; color: var(--text-mute); font-size: 20px; }

/* ============================================================
   選角登入 gate
   ============================================================ */
.login {
  position: fixed; inset: 0; z-index: 40; background: var(--grad-app) fixed, var(--bg-0);
  display: flex; flex-direction: column; padding: 40px 22px; overflow-y: auto;
}
.login h1 { font-family: var(--font-title); font-size: 22px; letter-spacing: 2px; text-align: center; color: var(--gold); }
.login .sub { text-align: center; color: var(--text-dim); font-size: 13px; margin: 6px 0 22px; }
.char-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  margin-bottom: 12px; box-shadow: var(--shadow-soft);
}
.char-card:active { transform: scale(.98); border-color: var(--gold-soft); }
.char-card .av { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 26px; background: var(--panel-3); border: 2px solid var(--gold-soft); }
.char-card .meta b { font-size: 16px; }
.char-card .meta small { display: block; color: var(--text-mute); font-size: 12px; }
.char-card .badge-persona { margin-left: auto; font-size: 11px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim); }

/* ============================================================
   角色卡面 + 雷達圖
   ============================================================ */
.hero { text-align: center; }
.card-frame {
  position: relative; width: 100%; max-width: 300px; margin: 0 auto;
  aspect-ratio: 300 / 380; border-radius: 16px; overflow: hidden;
}
.card-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-overlay { position: absolute; }
.fx-weapon_glow { filter: drop-shadow(0 0 10px var(--gold)); }
.fx-aurora { filter: drop-shadow(0 0 12px var(--accent)); }
.stage-chip {
  display: inline-block; margin-top: 10px; font-size: 11px; letter-spacing: 1px;
  padding: 4px 12px; border-radius: 999px; background: var(--panel-2);
  border: 1px solid var(--border); color: var(--gold);
}
.card-sub { display: block; color: var(--text-mute); font-size: 11px; margin-top: 5px; }
.badge-toggles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.badge-toggle { font-size: 11px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim); }
.badge-toggle.on { border-color: var(--gold); color: var(--gold); box-shadow: var(--glow-gold); }

.radar-wrap { display: flex; flex-direction: column; align-items: center; }
.radar-wrap canvas { max-width: 100%; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.stat-pill {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); font-size: 13px;
}
.stat-pill .ic { font-size: 14px; }
.stat-pill b { color: var(--gold); }
.stat-pill small { color: var(--text-mute); }

/* ---- 等級 / 語錄 / 稱號 ---- */
.level-box { display: flex; align-items: baseline; gap: 8px; }
.level-box .lv { font-family: var(--font-title); font-size: 40px; color: var(--gold); text-shadow: var(--glow-gold); }
.level-box small { color: var(--text-dim); font-size: 12px; }
.equipped-title { margin: 8px 0; }
.quote { color: var(--text-dim); font-style: italic; font-size: 13px; line-height: 1.6; }
.title-chip {
  display: inline-block; font-size: 12px; padding: 3px 9px; border-radius: 8px;
  border: 1px solid currentColor; background: rgba(255, 255, 255, 0.04);
}
.title-chip.legendary { box-shadow: var(--glow-gold); font-weight: 700; }

/* ---- 進度條（四軌 / 卡面）---- */
.track { margin-bottom: 12px; }
.track-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.track-name { color: var(--text); }
.track-level { color: var(--gold); font-weight: 700; }
.bar-track { position: relative; height: 12px; border-radius: 999px; background: var(--bar-bg);
  overflow: hidden; margin: 5px 0; border: 1px solid var(--border-soft); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; transition: width .5s; }
.bar-fill.debt { background: var(--danger) !important; }
.bar-preview { position: absolute; top: 0; bottom: 0; background: var(--bar-preview);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,255,255,.15) 4px, rgba(255,255,255,.15) 8px); }
.track-meta { display: flex; justify-content: space-between; align-items: center; }
.track-meta small { color: var(--text-mute); font-size: 11px; }
.flag { font-size: 10px; padding: 2px 7px; border-radius: 999px; margin-left: 5px; border: 1px solid var(--border);
  white-space: nowrap; display: inline-block; }
.flag-cap { color: var(--warn); border-color: var(--warn); }
.flag-max { color: var(--gold); border-color: var(--gold); }
.flag-debt { color: var(--danger); border-color: var(--danger); }
.debt-flag { margin-top: 8px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: rgba(255, 93, 115, 0.12); border: 1px solid var(--danger); color: var(--danger); font-size: 12px; }

/* ---- 錢包 ---- */
.wallet-row { display: flex; gap: 10px; flex-wrap: wrap; }
.wallet-cell { flex: 1; min-width: 92px; text-align: center; padding: 12px 8px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--border); }
.wallet-cell .w-icon { font-size: 20px; }
.wallet-cell b { display: block; font-size: 20px; color: var(--gold); margin: 3px 0; }
.wallet-cell small { color: var(--text-mute); font-size: 11px; }
.w-vouchers { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.w-voucher { font-size: 11px; padding: 4px 8px; border-radius: 8px; background: var(--panel-3); border: 1px solid var(--border); }

/* ---- 抽獎券 / 凍結 ---- */
.ticket, .frozen { padding: 9px 11px; border-radius: var(--radius-sm); background: var(--panel-2);
  border: 1px solid var(--border); font-size: 13px; margin-bottom: 8px; }
.ticket small, .frozen small { color: var(--text-mute); }
.frozen .badge { color: var(--warn); }
.frozen.voided { opacity: .55; }
.frozen.settled { border-color: var(--success); }

/* ============================================================
   Tabs（稱號 / 戰利品箱共用）
   ============================================================ */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
.tab {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; font-size: 12px; white-space: nowrap;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim);
}
.tab.active { background: var(--grad-gold); color: #2a1c00; border-color: transparent; font-weight: 700; box-shadow: var(--glow-gold); }

/* ---- 稱號 rows ---- */
.title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 0;
  border-bottom: 1px solid var(--border-soft); }
.title-row.locked { opacity: .72; }
.title-row .t-meta { color: var(--text-mute); font-size: 11px; }
.title-row .t-action { margin-left: auto; }
.t-equip { font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--gold); }
.t-equip.on { background: var(--grad-gold); color: #2a1c00; border-color: transparent; }
.t-hint { font-size: 11px; color: var(--text-mute); }

/* ---- 戰利品箱 ---- */
.lootbox-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.lootbox-name { color: var(--gold); font-weight: 700; }
.lootbox-progress { color: var(--text-mute); font-size: 11px; }
.lootbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.lb-slot { position: relative; padding: 10px 8px; border-radius: var(--radius-sm); text-align: center;
  background: var(--panel-2); border: 1px solid var(--border); min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.lb-slot.empty { opacity: .4; }
.lb-slot.locked { opacity: .6; }
.lb-slot.claimed { border-color: var(--success); }
.lb-slot.unclaimed { border-color: var(--gold); box-shadow: var(--glow-gold); }
.lb-lv { position: absolute; top: 5px; left: 7px; font-size: 10px; color: var(--text-mute); }
.lb-icon { font-size: 20px; }
.lb-name { font-size: 12px; }
.lb-value { font-size: 11px; color: var(--gold); }
.lb-lock, .lb-claimed { font-size: 11px; color: var(--text-mute); }
.lb-btn { margin-top: 3px; font-size: 12px; padding: 5px 12px; border-radius: 999px; border: none;
  background: var(--grad-gold); color: #2a1c00; font-weight: 700; }

/* ============================================================
   魔王戰入口 banner（game 頁）
   ============================================================ */
.boss-banner {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border-radius: var(--radius); border: 1px solid var(--danger);
  background: radial-gradient(120% 100% at 100% 0%, rgba(224,65,122,.25), var(--panel));
  box-shadow: var(--shadow-soft);
}
.boss-banner .thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 1px solid var(--danger); }
.boss-banner .info { flex: 1; min-width: 0; }
.boss-banner .info b { color: var(--text); font-size: 14px; }
.boss-banner .mini-hp { height: 8px; border-radius: 999px; background: var(--bar-bg); overflow: hidden; margin: 6px 0 3px; }
.boss-banner .mini-hp > i { display: block; height: 100%; background: var(--grad-hp); }
.boss-banner .info small { color: var(--text-mute); font-size: 11px; }
.boss-banner .go { flex: 0 0 auto; }

/* ============================================================
   魔王戰頁（boss.html）
   ============================================================ */
.boss-stage { position: relative; text-align: center; padding: 18px 14px 8px; }
.boss-portrait {
  width: 200px; max-width: 62%; aspect-ratio: 1; margin: 0 auto; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: 0 0 44px var(--boss-aura);
  position: relative; animation: bossFloat 4s ease-in-out infinite;
}
.boss-portrait img { width: 100%; height: 100%; object-fit: cover; }
.boss-portrait.hit { animation: bossHit .32s; }
@keyframes bossFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bossHit { 0% { transform: translateX(0); } 25% { transform: translateX(-8px); filter: brightness(2); }
  50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } 100% { transform: translateX(0); } }
.boss-name { font-family: var(--font-title); font-size: 22px; letter-spacing: 1px; color: var(--gold); margin-top: 12px; }
.boss-weak { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-dim); }
.boss-weak.has { color: var(--weakness); border-color: var(--weakness); box-shadow: 0 0 12px rgba(255,210,74,.3); }

.hp-wrap { margin: 16px 2px 4px; }
.hp-bar { position: relative; height: 22px; border-radius: 999px; background: var(--bar-bg);
  overflow: hidden; border: 1px solid var(--border); }
.hp-bar > i { display: block; height: 100%; background: var(--grad-hp); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.hp-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-mute); margin-top: 5px; }

/* 傷害跳字 */
.dmg-pop { position: absolute; left: 50%; top: 30%; transform: translateX(-50%);
  font-family: var(--font-title); font-size: 40px; font-weight: 800; color: var(--gold);
  text-shadow: 0 2px 12px rgba(0,0,0,.7); pointer-events: none; opacity: 0; }
.dmg-pop.show { animation: dmgPop 1s ease-out; }
.dmg-pop.crit { color: var(--weakness); }
@keyframes dmgPop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
  20% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); } }

/* 選屬性攻擊按鈕 */
.attack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.attack-btn {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 12px 13px; border-radius: var(--radius); text-align: left;
  border: 1px solid var(--border); background: linear-gradient(180deg, var(--panel-2), var(--panel)); color: var(--text);
}
.attack-btn:active { transform: translateY(1px); }
.attack-btn[disabled] { opacity: .45; }
.attack-btn .ab-head { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.attack-btn .ab-range { font-size: 12px; color: var(--gold); }
.attack-btn .ab-val { font-size: 11px; color: var(--text-mute); }
.attack-btn.weak { border-color: var(--weakness); box-shadow: 0 0 14px rgba(255,210,74,.28); }
.attack-btn .ab-weak { position: absolute; top: 8px; right: 9px; font-size: 10px; color: var(--weakness);
  border: 1px solid var(--weakness); border-radius: 999px; padding: 1px 6px; }

.attacks-left { text-align: center; font-size: 13px; color: var(--text-dim); margin: 4px 0 12px; }
.attacks-left b { color: var(--gold); }
.responsible-note { font-size: 11px; color: var(--text-mute); line-height: 1.6; margin-top: 10px;
  padding: 9px 11px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--border-soft); }
.opt-out { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }

/* ---- 事件紀錄 ---- */
.log { max-height: 180px; overflow-y: auto; font-size: 12px; color: var(--text-dim); line-height: 1.7; }
.log > div { padding: 3px 0; border-bottom: 1px solid var(--border-soft); }

/* ============================================================
   底部導覽（消費者）
   ============================================================ */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-max); display: flex; z-index: 30;
  background: linear-gradient(transparent, var(--bg-1) 30%); padding: 10px 14px 14px;
}
.bottom-nav a {
  flex: 1; text-align: center; color: var(--text-mute); font-size: 11px;
  display: flex; flex-direction: column; gap: 3px; padding: 6px 0; border-radius: var(--radius-sm);
}
.bottom-nav a .ni { font-size: 20px; }
.bottom-nav a.active { color: var(--gold); }

/* ---- 轉生動畫遮罩 ---- */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(168,85,247,.25), var(--bg-0));
  transition: opacity .5s; }
.overlay.hide { opacity: 0; pointer-events: none; }
.overlay h2 { font-family: var(--font-title); font-size: 30px; letter-spacing: 8px; color: var(--gold); text-shadow: var(--glow-gold); }
.overlay p { color: var(--text-dim); font-size: 13px; margin-top: 12px; }

/* ---- Toast ---- */
.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-3); border: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; opacity: 0; transition: all .3s; z-index: 60; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

/* ============================================================
   六分頁（消費者化重構）：底部導覽 6 格 / 子分頁 / 首頁摘要
   ============================================================ */
.bottom-nav.nav6 a { font-size: 10px; padding: 5px 0; }
.bottom-nav.nav6 a .ni { font-size: 18px; }

/* ---- 子分頁（角色頁：狀態/收藏/紀錄）---- */
.subtabs { display: flex; gap: 6px; margin: 4px 0 2px; }
.subtabs .tab { flex: 1; text-align: center; }

/* ---- 首頁：RPG 主舞台（角色大卡＝視覺主體，單屏不捲動）---- */
.hero-stage { min-height: calc(100vh - 170px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; position: relative; padding-top: 4px; }
.hero-stage .coin-chip { position: absolute; top: 6px; right: 2px; z-index: 6;
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-dim);
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--gold-soft);
  background: rgba(25, 19, 39, .85); }
.hero-stage .coin-chip b { color: var(--gold); }
.stage-card { display: block; width: min(78vw, 320px); max-width: none;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .6), var(--glow-accent); border: 1px solid var(--gold-soft); }
.stage-card:active { transform: scale(.985); }
.hero-id { text-align: center; }
.hero-id b { font-size: 20px; }
.hero-id .lv-inline { color: var(--gold); font-family: var(--font-title); font-size: 17px; margin-left: 8px; }
.hero-id #heroTitle { margin-top: 7px; }
.hero-id .quote { margin: 8px 0 0; font-size: 12px; }
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.s-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-dim);
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); }
.s-chip b { color: var(--gold); }
.s-chip.alert { border-color: var(--gold); box-shadow: var(--glow-gold); color: var(--text); }
.s-chip.boss { border-color: var(--danger); }
.s-chip.boss b { color: var(--danger); }

/* ---- 首頁：prototype 功能列 ---- */
.proto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.proto-btn { display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 10px; border-radius: var(--radius-sm); font-size: 13px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim); }
.proto-btn:active { background: var(--panel-3); }

/* ============================================================
   任務牆
   ============================================================ */
.quest { padding: 11px 12px; border-radius: var(--radius-sm); background: var(--panel-2);
  border: 1px solid var(--border); margin-bottom: 10px; }
.quest.ready { border-color: var(--gold); box-shadow: var(--glow-gold); }
.quest.cleared { opacity: .62; }
.quest-head { display: flex; align-items: center; gap: 8px; }
.quest-head b { font-size: 14px; }
.attr-chip { font-size: 10px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.quest-status { margin-left: auto; font-size: 11px; color: var(--text-mute); white-space: nowrap; }
.quest-status.ready { color: var(--gold); font-weight: 700; }
.quest-status.cleared { color: var(--success); }
.quest-desc { font-size: 12px; color: var(--text-dim); margin: 5px 0 7px; line-height: 1.5; }
.quest .bar-track { height: 9px; }
.quest-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.quest-meta small { color: var(--text-mute); font-size: 11px; }
.quest-go { font-size: 12px; padding: 5px 12px; border-radius: 999px;
  background: var(--grad-gold); color: #2a1c00; font-weight: 700; }

/* ============================================================
   挑戰頁：任務討伐小怪
   ============================================================ */
.mob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mob-card { position: relative; text-align: center; padding: 14px 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); background: linear-gradient(180deg, var(--panel-2), var(--panel));
  display: flex; flex-direction: column; gap: 6px; align-items: center; overflow: hidden; }
.mob-card.ready { border-color: var(--danger); box-shadow: 0 0 14px var(--boss-aura); }
.mob-card.cleared { opacity: .55; }
.mob-card.locked .mob-emoji { filter: grayscale(1) brightness(.4); }
.mob-emoji { font-size: 42px; line-height: 1; animation: bossFloat 3.4s ease-in-out infinite; }
.mob-card.hit .mob-emoji { animation: bossHit .32s; }
.mob-name { font-size: 13px; font-weight: 700; }
.mob-quest { font-size: 10px; color: var(--text-mute); }
.mob-hp { width: 100%; height: 8px; border-radius: 999px; background: var(--bar-bg); overflow: hidden;
  border: 1px solid var(--border-soft); }
.mob-hp > i { display: block; height: 100%; background: var(--grad-hp); transition: width .35s; }
.mob-reward { font-size: 11px; color: var(--gold); }
.mob-btn { width: 100%; border: none; border-radius: 999px; padding: 8px 0; font-size: 13px; font-weight: 700;
  background: var(--grad-danger); color: #fff; }
.mob-btn[disabled] { opacity: .4; }
.mob-lock { font-size: 11px; color: var(--text-mute); line-height: 1.5; }
.mob-done { font-size: 12px; color: var(--success); font-weight: 700; }
.mob-card .dmg-pop { font-size: 26px; top: 18%; }

/* ============================================================
   商城
   ============================================================ */
.coin-banner { display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border-radius: var(--radius); border: 1px solid var(--gold-soft);
  background: radial-gradient(120% 100% at 0% 0%, rgba(244,200,74,.16), var(--panel)); }
.coin-banner .em { font-size: 30px; }
.coin-banner b { font-size: 22px; color: var(--gold); font-family: var(--font-title); }
.coin-banner small { display: block; color: var(--text-mute); font-size: 11px; }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-item { display: flex; flex-direction: column; gap: 5px; padding: 12px 11px; border-radius: var(--radius);
  border: 1px solid var(--border); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.shop-item .si-icon { font-size: 30px; text-align: center; }
.shop-item .si-name { font-size: 13px; font-weight: 700; text-align: center; }
.shop-item .si-desc { font-size: 11px; color: var(--text-mute); line-height: 1.5; flex: 1; }
.shop-item .si-cost { text-align: center; font-size: 13px; color: var(--gold); font-weight: 700; }
.shop-item .si-buy { border: none; border-radius: 999px; padding: 8px 0; font-size: 12px; font-weight: 700;
  background: var(--grad-gold); color: #2a1c00; }
.shop-item .si-buy[disabled] { opacity: .45; box-shadow: none; }
.shop-item.owned { border-color: var(--success); }
.si-owned { text-align: center; font-size: 12px; color: var(--success); font-weight: 700; padding: 8px 0; }

/* ---- 背包（功能道具）---- */
.inv-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; margin-bottom: 8px; }
.inv-row .count { margin-left: auto; color: var(--gold); font-weight: 700; }

/* ============================================================
   模擬推播（進場觸點）：手機推播樣式 banner ＋ 鈴鐺通知中心
   ============================================================ */
.push-banner {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%) translateY(-120%);
  width: calc(100% - 28px); max-width: calc(var(--app-max) - 28px); z-index: 70;
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 16px; border: 1px solid var(--border);
  background: rgba(25, 19, 39, .96); backdrop-filter: blur(10px);
  box-shadow: var(--shadow); color: var(--text);
  transition: transform .35s cubic-bezier(.2, .9, .3, 1.1);
}
.push-banner.show { transform: translateX(-50%) translateY(0); }
.push-banner .pb-icon { font-size: 26px; flex: 0 0 auto; }
.push-banner .pb-txt { flex: 1; min-width: 0; }
.push-banner .pb-txt b { display: block; font-size: 13px; }
.push-banner .pb-txt small { display: block; color: var(--text-dim); font-size: 11px; line-height: 1.45;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.push-banner .pb-app { flex: 0 0 auto; align-self: flex-start; font-size: 9px; color: var(--text-mute); letter-spacing: .5px; }

.bell { position: relative; }
.bell-badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px;
  display: grid; place-items: center; padding: 0 4px; font-weight: 700;
}
.notif-row { display: flex; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border-soft);
  align-items: flex-start; color: var(--text); }
.notif-row.unread { background: rgba(244, 200, 74, .05); }
.notif-row .n-icon { font-size: 20px; flex: 0 0 auto; }
.notif-row .n-txt { flex: 1; min-width: 0; }
.notif-row .n-txt b { display: block; font-size: 13px; }
.notif-row .n-txt small { color: var(--text-dim); font-size: 11px; line-height: 1.5; }
.notif-row .n-time { flex: 0 0 auto; color: var(--text-mute); font-size: 10px; }

/* ============================================================
   交易戰績單（每筆交易換到了什麼）
   ============================================================ */
.receipt { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2);
  border: 1px solid var(--border); margin-bottom: 8px; }
.receipt.refund { border-color: var(--danger); }
.receipt.frozen { border-color: var(--warn); }
.receipt-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.receipt-head b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-head .amt { color: var(--gold); font-weight: 700; }
.receipt-head .amt.neg { color: var(--danger); }
.receipt-yield { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.6; }
.receipt-yield .y-tag { color: var(--text); }
.receipt-quests { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 5px; }
.receipt-quests .flag { margin-left: 0; }
.receipt-time { color: var(--text-mute); font-size: 10px; margin-top: 5px; }

/* ---- 金額分層徽章 ---- */
.flag.tier-elite { color: var(--accent); border-color: var(--accent); }
.flag.tier-rare { color: var(--gold); border-color: var(--gold); box-shadow: var(--glow-gold); }
.quest.tier-rare, .mob-card.tier-rare { border-color: var(--gold); }
.mob-card.tier-rare.ready { box-shadow: var(--glow-gold); }
.quest.tier-elite, .mob-card.tier-elite { border-color: var(--accent); }
.mob-card.tier-elite.ready { box-shadow: var(--glow-accent); }

/* ============================================================
   分享卡 modal（canvas 渲染 → 下載 PNG）
   ============================================================ */
.share-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(11, 9, 19, .82); backdrop-filter: blur(4px); padding: 20px; }
.share-modal .share-box { display: flex; flex-direction: column; gap: 10px; align-items: center;
  max-width: 340px; width: 100%; }
.share-modal canvas { width: 100%; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.share-modal .share-link { font-size: 11px; color: var(--text-mute); word-break: break-all; text-align: center; }
.share-modal .share-actions { display: flex; gap: 10px; width: 100%; }
.share-modal .share-actions .btn { flex: 1; }
.mob-share { border: 1px solid var(--gold); background: transparent; color: var(--gold);
  border-radius: 999px; padding: 6px 0; width: 100%; font-size: 12px; }

/* ============================================================
   爽感回饋：升級全屏特效 / 開箱動畫 / nav 紅點
   ============================================================ */
.levelup-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(244,200,74,.22), rgba(11,9,19,.88));
  text-align: center; animation: luFade 2.4s forwards; pointer-events: none; }
.levelup-overlay .lu-burst { font-size: 64px; animation: luBurst .9s ease-out; }
.levelup-overlay h2 { font-family: var(--font-title); font-size: 44px; letter-spacing: 6px;
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(244,200,74,.8)); animation: luPop .6s cubic-bezier(.2,1.4,.4,1); }
.levelup-overlay .lu-tracks { color: var(--text); font-size: 17px; margin-top: 10px; line-height: 1.8; }
.levelup-overlay .lu-tracks b { color: var(--gold); font-family: var(--font-title); }
@keyframes luPop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes luBurst { 0% { transform: scale(.2) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.4) rotate(8deg); opacity: 1; } 100% { transform: scale(1); } }
@keyframes luFade { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }

.chest-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  background: rgba(11,9,19,.8); text-align: center; }
.chest-overlay .chest { font-size: 84px; display: inline-block; animation: chestShake .9s ease-in-out; }
.chest-overlay .chest.open { animation: chestOpen .5s ease-out forwards; }
.chest-overlay .chest-reward { opacity: 0; margin-top: 6px; }
.chest-overlay .chest-reward.show { opacity: 1; animation: luPop .5s cubic-bezier(.2,1.4,.4,1); }
.chest-overlay .chest-reward .cr-icon { font-size: 46px; display: block; filter: drop-shadow(var(--glow-gold)); }
.chest-overlay .chest-reward b { display: block; color: var(--gold); font-size: 20px; margin-top: 6px; font-family: var(--font-title); }
.chest-overlay .chest-reward small { color: var(--text-dim); font-size: 13px; }
@keyframes chestShake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-9deg) scale(1.04); }
  40% { transform: rotate(9deg) scale(1.08); } 60% { transform: rotate(-7deg) scale(1.1); } 80% { transform: rotate(6deg) scale(1.12); } }
@keyframes chestOpen { 0% { transform: scale(1.1); } 50% { transform: scale(1.5); filter: brightness(2.4); } 100% { transform: scale(1.25); filter: brightness(1.4); } }

.bottom-nav a { position: relative; }
.nav-dot { position: absolute; top: 0; right: 50%; transform: translateX(20px);
  min-width: 16px; height: 16px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; display: grid; place-items: center; padding: 0 4px;
  box-shadow: 0 0 8px rgba(255,93,115,.7); }

/* ============================================================
   孵化中寶箱（紅燈凍結獎勵的期待感包裝）
   ============================================================ */
.hatch-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin-bottom: 8px;
  border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--warn); }
.hatch-row.legend { border-color: var(--gold); box-shadow: var(--glow-gold); }
.hatch-row .egg { font-size: 34px; animation: bossFloat 3s ease-in-out infinite; }
.hatch-row .h-txt { flex: 1; min-width: 0; }
.hatch-row .h-txt b { display: block; font-size: 13px; }
.hatch-row .h-txt small { color: var(--text-mute); font-size: 11px; }
.hatch-row .h-eta { flex: 0 0 auto; text-align: right; }
.hatch-row .h-eta b { display: block; color: var(--warn); font-size: 13px; }
.hatch-row.legend .h-eta b { color: var(--gold); }
.hatch-row .h-eta small { color: var(--text-mute); font-size: 10px; }
.hatch-bar { height: 6px; border-radius: 999px; background: var(--bar-bg); overflow: hidden; margin-top: 5px; }
.hatch-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--warn), var(--gold)); }

/* ============================================================
   新戶引導：覺醒心測（首次登入）
   ============================================================ */
.quiz-progress { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.quiz-progress i { width: 10px; height: 10px; border-radius: 50%; background: var(--panel-3);
  border: 1px solid var(--border); }
.quiz-progress i.done { background: var(--grad-gold); border-color: transparent; box-shadow: var(--glow-gold); }
.quiz-q { font-size: 17px; font-weight: 700; text-align: center; margin: 8px 0 18px; line-height: 1.6; }
.quiz-opt { display: block; width: 100%; text-align: left; padding: 15px 16px; margin-bottom: 12px;
  border-radius: var(--radius); border: 1px solid var(--border); font-size: 14px; color: var(--text);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: var(--shadow-soft); }
.quiz-opt:active { transform: scale(.98); border-color: var(--gold-soft); }
.quiz-result { text-align: center; }
.quiz-result .qr-burst { font-size: 56px; animation: luBurst .9s ease-out; }
.quiz-result h2 { font-family: var(--font-title); font-size: 26px; letter-spacing: 3px; color: var(--gold);
  text-shadow: var(--glow-gold); margin: 10px 0 4px; animation: luPop .6s cubic-bezier(.2,1.4,.4,1); }
.quiz-result .qr-title { margin: 10px 0; }
.quiz-result .stat-row { margin: 14px 0 20px; }
.quiz-result .btn { margin-bottom: 10px; }

/* ---- 排行榜（消費者頁化）---- */
.lb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lb-table th { text-align: left; color: var(--text-mute); font-size: 11px; font-weight: 400;
  padding: 6px 8px; border-bottom: 1px solid var(--border); }
.lb-table td { padding: 8px; border-bottom: 1px solid var(--border-soft); }
.lb-league { color: var(--gold); font-weight: 700; font-size: 13px; margin: 10px 0 4px; }
