/* ── Self-hosted fonts (bundled for offline / Capacitor) ── */
@font-face {
  font-family: 'Cinzel';
  font-style: normal; font-weight: 400 700;
  font-display: swap;
  src: url('assets/fonts/cinzel-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Cinzel Decorative';
  font-style: normal; font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/cinzel-decorative-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Cinzel Decorative';
  font-style: normal; font-weight: 900;
  font-display: swap;
  src: url('assets/fonts/cinzel-decorative-900.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal; font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/rajdhani-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal; font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/rajdhani-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Rajdhani';
  font-style: normal; font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/rajdhani-700.woff2') format('woff2');
}
@font-face {
  font-family: 'ZCOOL XiaoWei';
  font-style: normal; font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/zcool-xiaowei.woff2') format('woff2');
}

/* style.css — Dark card game theme, responsive */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Typography ──────────────────────────────────────────────
     Display/Logo : Cinzel Decorative — Roman regal, "FATED QUEENS" energy
     UI headings  : Cinzel           — readable companion
     Numbers      : Rajdhani         — compact, ATK/HP stats feel great
     CJK display  : ZCOOL XiaoWei   — classical Chinese art-display
     CJK body     : Noto Serif SC    — much richer than system sans
  ──────────────────────────────────────────────────────────── */
  --font-display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --font-ui:      "Cinzel", Georgia, serif;
  --font-number:  "Rajdhani", "Cinzel", monospace;
  --font-latin:   "Cinzel", Georgia, serif;
  --font-body:    system-ui, -apple-system, "SF Pro Text", "Inter", "Segoe UI", sans-serif;
  --font-cjk:          "ZCOOL XiaoWei", "PingFang SC", "Hiragino Sans GB", serif;
  --font-cjk-body:     "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --app-width: 390px;
  --page-pad: 12px;
  --page-gap: 10px;
  --surface-radius: 18px;
  --surface-radius-lg: 22px;
  --cta-height: 48px;

  /* Safe area insets (iOS notch / Android punch-hole / home indicator) */
  --sat: env(safe-area-inset-top,    0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left,   0px);
  --sar: env(safe-area-inset-right,  0px);

  /* Header top = base spacing + device safe area */
  --header-top: calc(16px + var(--sat));

  /* Background hierarchy */
  --bg-deep:    #0A0612;
  --bg-surface: #150D28;
  --bg-panel:   #1E1438;

  /* Gold accent */
  --gold:       #D4AF37;
  --gold-light: #F5D060;
  --gold-dark:  #C8971F;

  /* Danger / HP / CTA */
  --rose:       #E8457A;

  /* T5 prismatic accent */
  --purple:     #C084FC;

  /* Text */
  --text-primary: #F0E8FF;
  --text-muted:   #9988BB;

  /* Borders */
  --border:     #2A1D4A;

  /* Rarity */
  --rarity-common:    #8899AA;
  --rarity-rare:      #4488EE;
  --rarity-epic:      #AA44EE;
  --rarity-legendary: #D4AF37;
  --rarity-gold:      #C084FC;

  /* Z-index */
  --z-cards:   10;
  --z-select:  15;
  --z-log:     20;
  --z-dmg:     30;
  --z-toast:   50;
  --z-modal:   100;
  --z-modal-content: 110;
}

html, body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body); /* clarity first; display elements override explicitly */
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
  background:
    radial-gradient(circle at 50% 10%, rgba(55, 30, 92, 0.4) 0%, transparent 32%),
    var(--bg-deep);
}

/* CJK override — body uses Noto Serif SC, headings/titles inherit ZCOOL XiaoWei */
:lang(zh), :lang(ja), :lang(ko) {
  letter-spacing: 0 !important;
  font-family: var(--font-cjk-body);
}
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3,
:lang(zh) .game-title, :lang(zh) .game-subtitle,
:lang(zh) .page-header h2,
:lang(zh) .btn-battle, :lang(zh) .menu-title,
:lang(zh) .card-name-strip, :lang(zh) .detail-card-name {
  font-family: var(--font-cjk);
}

/* Arabic RTL */
:lang(ar) {
  font-family: system-ui, 'Geeza Pro', 'Noto Sans Arabic', sans-serif;
  direction: rtl;
}

/* Page routing */
.page { display: none; }
.page.active {
  display: flex; flex-direction: column;
  width: min(100vw, var(--app-width));
  max-width: var(--app-width);
  height: 100vh; height: 100dvh;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  box-shadow: 0 0 0 1px rgba(72, 43, 116, 0.45), 0 22px 60px rgba(0,0,0,0.45);
}

.page-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;   /* fallback */
  min-height: 100dvh;  /* iOS 15.4+ / Capacitor */
  padding: 12px;
  gap: 12px;
}

/* ===== MAIN MENU ===== */
.menu-header {
  text-align: center;
  padding: 40px 0 20px;
}


.gold-display {
  font-size: 1.2rem;
  color: var(--gold);
  font-weight: bold;
}

.gold-display-sm { font-size: 1rem; color: var(--gold); font-weight: bold; }

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 340px;
  margin: 0 auto;
  width: 100%;
}

.menu-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 9px;
  color: #7c699c;
  z-index: 2;
  pointer-events: none;
}

#settings {
  height: 100%;
  background: linear-gradient(180deg, #140728 0%, #0a0612 100%);
}

.settings-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 20px;
}

.settings-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #180c30 0%, #10071f 100%);
}

.settings-panel-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.settings-panel-copy {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: #b8acd6;
}

.settings-language-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.settings-lang-btn {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid #3a2a5b;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 20%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #231640 0%, #180f2f 100%);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -8px 14px rgba(5, 3, 10, 0.28),
    0 8px 16px rgba(5, 3, 10, 0.18);
}

.settings-lang-btn.active {
  border: 1px solid rgba(245, 208, 96, 0.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.08) 18%, rgba(255,255,255,0) 28%),
    linear-gradient(180deg, #f6d76f 0%, #efc84d 40%, #d5a62b 58%, #936912 100%);
  color: #2b1800;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
}

.settings-debug-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid #6c4d1f;
  background: linear-gradient(135deg, rgba(85, 47, 13, 0.92) 0%, rgba(145, 92, 20, 0.96) 100%);
  color: #ffe5b2;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

/* ── Buttons ── */
.btn {
  cursor: pointer; border: none; border-radius: 14px; font-weight: 700;
  transition: transform 100ms, filter 100ms, box-shadow 100ms;
}
.btn:active          { transform: scale(0.96); filter: brightness(0.88); }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled        { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #f6d76f 0%, #e8b830 50%, #c8930a 100%);
  color: var(--bg-deep);
  font-size: 14px; font-weight: 800; letter-spacing: 1.5px;
  padding: 14px 28px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.2),
    0 4px 16px 2px #D4AF3766,
    0 1px 0 #a07010;
}

.btn-secondary {
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0) 100%), var(--bg-panel);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  padding: 14px 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 2px 8px rgba(0,0,0,0.25);
}
.btn-secondary:active { background: var(--border); }

.btn-danger {
  background: linear-gradient(180deg, #f05878 0%, #d83060 50%, #b01848 100%);
  color: #FFF;
  font-size: 13px; font-weight: 800; letter-spacing: 1.5px;
  padding: 14px 28px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.2),
    0 4px 14px 1px #E8457A66;
}

.btn-menu {
  background: #1E1438CC;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 14px; font-weight: 600;
  border-radius: 14px;
  height: 52px;
  padding: 0 24px;
  width: 100%;
}

.btn-back {
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 6px rgba(0,0,0,0.25);
  padding: 8px 14px;
  border-radius: 10px;
}

.btn-attack {
  background: #c0392b;
  padding: 6px 10px;
  font-size: 0.8rem;
  margin: 2px;
}

.btn-gacha {
  background: linear-gradient(135deg, #8e44ad, #3498db);
  padding: 14px 20px;
  font-size: 1rem;
  min-width: 200px;
}
.btn-gacha-multi { background: linear-gradient(135deg, var(--gold), #e74c3c); }

/* ===== PAGE HEADER ===== */
/* ── Page header (generic) ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--header-top) var(--page-pad) 10px;
  background: transparent;
  border-bottom: 0;
  flex-shrink: 0;
}
.page-header h2 {
  flex: 1;
  font-size: 22px; font-weight: 700; letter-spacing: 0;
  color: var(--text-primary);
}

/* ===== CARD LOCK OVERLAY (shared) ===== */
.card-lock-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}

/* ===== MINI CARD ===== */
.mini-card {
  width: 80px; height: 100px;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--bg-surface);
}
.mini-card img { width: 100%; height: 70%; object-fit: cover; }
.mini-placeholder {
  width: 100%; height: 70%;
  display: none; align-items: center; justify-content: center;
  font-size: 1.2rem; color: rgba(255,255,255,0.5);
}
.mini-stats { font-size: 0.6rem; padding: 2px 3px; display: flex; flex-direction: column; gap: 1px; }

/* ===== COLLECTION FILTERS ===== */
.collection-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.collection-filters select {
  background: var(--bg-panel); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; font-size: 0.85rem; cursor: pointer;
}
.col-count { color: var(--text-muted); font-size: 0.85rem; margin-left: auto; }

/* ===== DECK BUILDER ===== */
.deck-slots {
  display: flex; gap: 12px; justify-content: center;
  padding: 10px 0;
}
.deck-slot {
  width: 90px; height: 120px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-panel);
}
.deck-slot.filled { border-style: solid; border-color: var(--gold); }
.slot-empty { color: var(--text-muted); font-size: 0.75rem; }

/* ===== GACHA ===== */
.gacha-info { text-align: center; padding: 10px 0; }
.gacha-rate { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-size: 0.8rem; }
.rate-common { color: #6b7c93; }
.rate-rare { color: #3a82f7; }
.rate-epic { color: #9b59b6; }
.rate-legendary { color: var(--gold); }
.gacha-note { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }
.gacha-buy-btn {
  display: block; margin: 16px auto 8px; padding: 14px 24px;
  background: linear-gradient(135deg, #C9A962, #a07830);
  color: #0A0A0A; font-weight: 700; font-size: 0.95rem;
  border-radius: 12px; text-align: center; text-decoration: none;
  letter-spacing: 0.02em; box-shadow: 0 4px 20px rgba(201,169,98,0.35);
  transition: opacity 0.2s;
}
.gacha-buy-btn:hover { opacity: 0.85; }

.gacha-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 10px 0; }

.gacha-result {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; padding: 12px 0;
}

@keyframes reveal {
  from { transform: scale(0.5) rotateY(90deg); opacity: 0; }
  to   { transform: scale(1) rotateY(0deg); opacity: 1; }
}
.gacha-reveal { animation: reveal 0.4s ease-out; }
.gacha-reveal:nth-child(n) { animation-delay: calc(var(--i, 0) * 0.08s); }

/* ===== BATTLE ===== */
.battle-field {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-panel); border-radius: 8px;
  padding: 12px; border: 1px solid var(--border);
}
.team-label { text-align: center; color: var(--text-muted); font-size: 0.75rem; }
.battle-team { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.battle-divider { height: 1px; background: var(--border); margin: 4px 0; }

.battle-slot {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; width: 100px;
  transition: opacity 0.3s;
}
.battle-slot.dead { opacity: 0.3; }

.battle-card-img {
  width: 80px; height: 100px;
  border: 2px solid var(--border); border-radius: 8px;
  overflow: hidden; position: relative; background: var(--bg-surface);
}
.battle-card-img img { width: 100%; height: 100%; object-fit: cover; }
.battle-placeholder {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
  font-size: 1.5rem; color: rgba(255,255,255,0.5);
}
.dead-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #e74c3c;
}

.battle-card-name { font-size: 0.7rem; text-align: center; }
.battle-hp-bar { width: 80px; height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.battle-hp-fill { height: 100%; transition: width 0.3s; border-radius: 3px; }
.battle-hp-text { font-size: 0.6rem; color: var(--text-muted); }
.card-skill-badge { font-size: 0.6rem; color: #9b59b6; }
.status-icons { display: flex; gap: 2px; }
.status-icon { font-size: 0.65rem; padding: 1px 3px; border-radius: 3px; }
.status-icon.poison { background: #6c3483; }
.status-icon.freeze { background: #1a5276; }
.status-icon.shield { background: #1d6a1d; }

.battle-slot.shielded .battle-card-img { box-shadow: 0 0 10px #27ae60; }

/* (old battle-actions / battle-log rules removed — replaced by newer rules below) */

/* ===== MODAL ===== */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal); padding: 16px;
}
.modal {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 30%),
    linear-gradient(180deg, #1c1248 0%, #0e0828 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; padding: 24px 20px 20px;
  max-width: 500px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 8px 40px rgba(0,0,0,0.70);
}
.modal-title {
  font-size: 1.3rem; font-weight: 900; letter-spacing: 1px;
  margin-bottom: 12px; color: var(--text-primary); text-align: center;
}
.modal-body { color: var(--text-primary); margin-bottom: 20px; text-align: center; }
.modal-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Battle result variants */
.modal-victory {
  border-color: rgba(212,175,55,0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 8px 40px rgba(0,0,0,0.70),
    0 0 50px rgba(212,175,55,0.14);
}
.modal-victory .modal-title { color: var(--gold); }

.modal-defeat {
  border-color: rgba(232,69,122,0.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 8px 40px rgba(0,0,0,0.70),
    0 0 40px rgba(232,69,122,0.10);
}
.modal-defeat .modal-title { color: var(--rose); }

/* Card detail */
.card-detail { display: flex; flex-direction: column; gap: 10px; }
.detail-image-wrap {
  width: 140px; height: 190px; margin: 0 auto;
  border: 2px solid var(--border); border-radius: 8px; overflow: hidden;
  position: relative; background: var(--bg-surface);
}
.detail-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.detail-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: rgba(255,255,255,0.5);
}
.detail-tiers { display: flex; gap: 6px; justify-content: center; }
.tier-tab {
  padding: 4px 12px; border: 1px solid var(--border); background: var(--bg-deep);
  color: var(--text-primary); border-radius: 4px; cursor: pointer; font-size: 0.8rem;
}
.tier-tab:hover:not(:disabled) { border-color: var(--rose); }
.locked-tab { opacity: 0.4; }

.detail-stats { display: flex; flex-direction: column; gap: 4px; }
.detail-stats div { display: flex; justify-content: space-between; font-size: 0.85rem; border-bottom: 1px solid var(--border); padding: 2px 0; }
.detail-skill-desc { font-size: 0.8rem; color: #9b59b6; font-style: italic; }
.detail-char-desc { font-size: 0.75rem; color: var(--text-muted); }
.tier-unlock-info { font-size: 0.75rem; color: var(--gold); }
.tier-unlock-info.locked { color: var(--text-muted); }

/* ===== TOAST ===== */
#toast {
  position: fixed; bottom: calc(20px + var(--sab)); left: 50%; transform: translateX(-50%);
  background: rgba(30,30,50,0.95); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 20px; font-size: 0.85rem;
  z-index: var(--z-toast); opacity: 0; transition: opacity 0.2s;
  pointer-events: none; white-space: nowrap;
}
#toast.visible { opacity: 1; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== 品质徽章 ===== */
.tier-badge { position:absolute; top:4px; right:4px; font-size:10px; padding:2px 6px; border-radius:8px; font-weight:bold; color:#fff; }
.quality-Common    { background:#6b7c93; }
.quality-Rare      { background:#3a82f7; }
.quality-Epic      { background:#9b59b6; }
.quality-Legendary { background:var(--gold); }
.quality-Gold      { background:linear-gradient(135deg,#ffd700,#ff8c00); color:#000; }

/* 重复卡标识 */
.gacha-duplicate { position:relative; opacity:0.75; }

/* ===== Power Center ===== */
.pc-list { display:flex; flex-direction:column; gap:8px; padding:12px; }
.pc-skill-row { display:flex; align-items:center; justify-content:space-between; background:var(--bg-surface); border-radius:8px; padding:10px 14px; }
.pc-skill-name { font-weight:bold; color:#e0e0e0; }
.pc-skill-level { color:var(--gold); font-size:13px; }
.pc-upgrade-btn {
  background: linear-gradient(180deg, #50e090 0%, #22a855 50%, #107030 100%);
  border: none; color: #fff; padding: 6px 14px; border-radius: 10px; cursor: pointer;
  font-weight: 700; font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 3px 8px rgba(34,168,85,0.40);
}
.pc-upgrade-btn:disabled { background: linear-gradient(180deg,#4a4a4a,#2a2a2a); box-shadow: none; cursor: not-allowed; }

/* ===== Lucky Wheel ===== */
.wheel-progress-bar { position:relative; height:20px; background:#333; border-radius:10px; margin:16px; overflow:hidden; }
.wheel-progress-fill { height:100%; background:linear-gradient(90deg,var(--gold),#e74c3c); border-radius:10px; transition:width 0.4s; }
#wheel-progress-text { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:12px; color:#fff; pointer-events:none; }
.wheel-result { padding:12px; text-align:center; font-size:16px; color:#ffd700; min-height:40px; }
.amorite-shop { padding:12px; }
.amorite-shop h3 { color:#e74c3c; margin-bottom:8px; }
.amorite-item { display:flex; justify-content:space-between; align-items:center; padding:8px; background:var(--bg-surface); border-radius:6px; margin-bottom:6px; }
.amorite-exchange-btn {
  background: linear-gradient(180deg, #f06050 0%, #cc2810 50%, #901000 100%);
  border: none; color: #fff; padding: 4px 12px; border-radius: 10px; cursor: pointer;
  font-weight: 700; font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 3px 8px rgba(200,40,16,0.40);
}
.amorite-exchange-btn:disabled { background: linear-gradient(180deg,#4a4a4a,#2a2a2a); box-shadow: none; cursor: not-allowed; }

/* ===== 段位 ===== */
.rank-display { text-align:center; padding:32px; }
.rank-name { font-size:32px; font-weight:bold; color:var(--gold); letter-spacing:2px; }
.rank-stars { font-size:24px; margin-top:8px; }

/* ===== 卡牌详情（新样式） ===== */
.quality-info { margin-top:8px; font-size:12px; color:#aaa; }
.quality-info.locked { color:#e74c3c; }

/* ===== Power Center cell display ===== */
.pc-cell-display { font-size:14px; color:var(--gold); }

/* ——— Resolve button ——— */
.btn-resolve { background:#5a1a1a; border-color:#e74c3c; color:#e74c3c; font-size:12px; }
.btn-resolve:hover { background:#7a2a2a; }

/* ——— Power Center Reset ——— */
.pc-reset-area { margin-top:16px; text-align:center; }
/* btn-danger defined above in button system */

/* ── Rarity glow animations ── */
@keyframes rarity-glow-rare {
  0%, 100% { box-shadow: 0 0 8px var(--rarity-rare); }
  50%       { box-shadow: 0 0 14px var(--rarity-rare); }
}
@keyframes rarity-glow-epic {
  0%, 100% { box-shadow: 0 0 16px 3px var(--rarity-epic); }
  50%       { box-shadow: 0 0 26px 5px var(--rarity-epic); }
}

/* ── Battle feedback ── */
@keyframes hit-flash {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; background: rgba(255,255,255,0.4); }
  100% { opacity: 1; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-4px); }
  40%     { transform: translateX(4px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
@keyframes dmg-float {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* ── Page transitions ── */
@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
.page-enter       { animation: slide-in-right 280ms ease-out forwards; }
.page-enter-right { animation: slide-in-left 280ms ease-out forwards; }

/* ── RTL support ── */
[dir="rtl"] .page-header    { flex-direction: row-reverse; }
[dir="rtl"] .currency-bar   { flex-direction: row-reverse; }
[dir="rtl"] .battle-log     { text-align: right; }
[dir="rtl"] .card-info      { text-align: right; }

/* ── Main Menu ── */
#main-menu {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  justify-content: flex-end;
}

.menu-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(30, 18, 52, 0.88) 0%, rgba(10, 6, 18, 0.96) 52%, #09050f 100%),
    radial-gradient(circle at 50% 18%, rgba(86, 45, 140, 0.32) 0%, transparent 36%);
  z-index: 0;
}

.hero-bg {
  position: absolute; top: 0; left: 0; right: 0;
  height: 420px;
  background-image: url('https://cdn.fatedqueens.com/cards/ANGEL_pack1_Legendary_tier4_card.jpg');
  background-size: cover; background-position: center 8%;
  opacity: 0.62;
  filter: saturate(0.98);
  z-index: 1;
}
.hero-gradient {
  position: absolute; top: 142px; left: 0; right: 0;
  height: 300px;
  background: linear-gradient(180deg, rgba(10,6,18,0.02) 0%, rgba(10,6,18,0.54) 42%, rgba(10,6,18,0.92) 78%, rgba(10,6,18,1) 100%);
  z-index: 1;
}


.currency-bar {
  position: absolute; top: var(--header-top); right: 12px;
  display: flex; gap: 8px; z-index: 2;
}

.menu-settings-btn {
  position: absolute;
  top: var(--header-top);
  left: 12px;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid #3a2a5b;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 20%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, rgba(35, 22, 64, 0.98) 0%, rgba(24, 14, 45, 0.98) 100%);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  z-index: 2;
}

.menu-settings-icon {
  font-size: 12px;
}
.currency-badge {
  min-height: 28px;
  display: flex;
  align-items: center;
  background: rgba(20, 11, 34, 0.92);
  border: 1px solid #3a275e;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px; font-weight: 700; color: var(--gold);
}
.currency-badge.gem { color: var(--purple); border-color: var(--purple); }

.menu-sm-label-evolve { color: var(--rarity-epic); }
.menu-sm-label-rank { color: var(--gold); }
.menu-sm-label-shop { color: var(--rose); }

.menu-title-area {
  position: absolute; top: 286px; left: 0; right: 0;
  text-align: center; z-index: 2;
  padding: 0 24px;
}
.game-title {
  font-size: 30px; font-weight: 900; letter-spacing: 3.2px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.game-subtitle {
  font-size: 10px; font-weight: 700; letter-spacing: 4px;
  color: var(--text-muted); margin-top: 6px;
}
:lang(zh) .game-subtitle {
  font-size: 13px; letter-spacing: 2px;
}
.title-divider {
  font-size: 10px; color: var(--gold-dark); margin-top: 10px; letter-spacing: 2px;
}

.menu-stack {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 12px 52px;
  margin-bottom: env(safe-area-inset-bottom, 0px);
}

.btn-battle {
  display: flex; align-items: center; justify-content: center;
  height: 54px; width: 100%; gap: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.38) 0%, rgba(255,255,255,0.08) 18%, rgba(255,255,255,0) 28%),
    linear-gradient(180deg, #f8db74 0%, #efc84e 42%, #d8a92d 58%, #8e6412 100%);
  border: 1px solid rgba(245, 208, 96, 0.72); border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    inset 0 -10px 18px rgba(107, 71, 5, 0.32),
    0 10px 24px rgba(212, 175, 55, 0.28),
    0 0 0 1px rgba(96, 60, 7, 0.25);
  color: var(--bg-deep); padding: 0 28px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
}
.battle-swords  { font-size: 16px; font-weight: 800; flex-shrink: 0; }
.battle-content { display: flex; flex-direction: column; align-items: center; flex: 1; }
.battle-label   { font-size: 18px; font-weight: 900; letter-spacing: 4px; }
.battle-sub     { font-size: 9px; font-weight: 700; letter-spacing: 1px; opacity: 0.72; }

.btn-menu {
  display: flex; flex-direction: row; align-items: center;
  height: 50px; gap: 10px; padding: 12px 14px; width: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.09) 0%, rgba(255,255,255,0.02) 20%, rgba(255,255,255,0) 32%),
    linear-gradient(180deg, rgba(35, 22, 64, 0.98) 0%, rgba(24, 14, 45, 0.98) 100%);
  border-radius: 10px; cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -10px 16px rgba(5, 3, 10, 0.28),
    0 8px 18px rgba(5, 3, 10, 0.2);
}
.btn-menu-gacha {
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -10px 16px rgba(5, 3, 10, 0.28),
    0 0 0 1px rgba(104, 78, 17, 0.16),
    0 10px 20px rgba(5, 3, 10, 0.22),
    0 0 16px rgba(212, 175, 55, 0.08);
}
.btn-menu-cards {
  border: 1px solid rgba(68, 136, 238, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -10px 16px rgba(5, 3, 10, 0.28),
    0 0 0 1px rgba(29, 64, 124, 0.16),
    0 10px 20px rgba(5, 3, 10, 0.22),
    0 0 16px rgba(68, 136, 238, 0.08);
}
.menu-icon        { font-size: 14px; flex-shrink: 0; opacity: 0.85; }
.menu-icon-gold   { color: var(--gold); }
.menu-icon-blue   { color: var(--rarity-rare); }
.menu-icon-purple { color: #c084fc; }
.menu-info    { display: flex; flex-direction: column; gap: 2px; flex: 1; text-align: center; align-items: center; }
.menu-title   { font-size: 14px; font-weight: 800; letter-spacing: 2px; color: var(--text-primary); }
.menu-desc    { font-size: 9px; color: var(--text-muted); letter-spacing: 0.5px; }

.menu-row-3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
}
.btn-menu-sm {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; height: 48px; padding: 10px 0; font-size: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 22%, rgba(255,255,255,0) 36%),
    linear-gradient(180deg, #231640 0%, #150d28 100%);
  border-radius: 10px; cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -8px 14px rgba(5, 3, 10, 0.28),
    0 8px 16px rgba(5, 3, 10, 0.18);
}
.btn-menu-evolve { border: 1px solid rgba(170, 68, 238, 0.32); }
.btn-menu-rank   { border: 1px solid rgba(212, 175, 55, 0.32); }
.btn-menu-shop   { border: 1px solid rgba(232, 69, 122, 0.32); }
.menu-sm-label   { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start; /* aspect-ratio on items needs no stretch interference */
  gap: 8px;
  padding: 4px 12px;
}

/* ── Pagination ── */
.col-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 0 20px;
  flex-shrink: 0;
}
.btn-page-nav {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--gold);
  font-size: 26px; line-height: 1;
  width: 44px; height: 44px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.btn-page-nav:disabled { opacity: 0.25; cursor: not-allowed; }
.btn-page-nav:not(:disabled):active { transform: scale(0.92); }
.col-page-info {
  color: var(--text-muted);
  font-size: 13px; font-weight: 600;
  min-width: 56px; text-align: center;
}

.card-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1664 / 2304; /* portrait — canvas is absolute so this is the sole height source */
  border: none; /* canvas draws its own rarity border */
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 120ms;
  background: #1A1230;
  isolation: isolate;
}

.card-item::before {
  content: none;
}
.card-item:active { transform: scale(0.96); }
.card-item.locked {
  opacity: 0.24;
  cursor: not-allowed;
  filter: grayscale(0.9) saturate(0.35) brightness(0.72);
}
.card-item.deck-selected { outline: 3px solid var(--gold); outline-offset: 2px; }

.card-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
  inset: 0;
}

.card-info-strip {
  background: #080510CC;
  padding: 4px 6px;
  min-height: 35px;
}
.card-name-strip {
  font-size: 10px; font-weight: 700;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-rarity-strip { font-size: 7px; font-weight: 600; letter-spacing: 1px; }

.card-lock-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: rgba(0,0,0,0.3);
  pointer-events: none;
}

/* Gold placeholder hint */
.col-gold-hint {
  position: absolute;
  bottom: 8px; left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  pointer-events: none;
}

/* Card select indicator (deck builder) */
.card-select-indicator {
  position: absolute; top: 4px; right: 4px;
  width: 18px; height: 18px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: transparent;
}
.card-item.selected .card-select-indicator {
  background: var(--gold);
}

/* Mini card (deck builder / battle slots) */
.mini-card {
  position: relative;
  border-radius: 6px; overflow: hidden;
  width: 90px; height: 120px;
  cursor: pointer;
  flex-shrink: 0;
}
.mini-card-canvas { width: 100%; height: 100%; display: block; }
.mini-stats {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: #080510CC;
  display: flex; justify-content: space-between;
  padding: 2px 4px;
  font-size: 9px; font-weight: 700;
}

/* ── Collection Page ── */
#collection {
  height: 100%;
  background: var(--bg-deep);
}

#collection .page-header {
  padding: var(--header-top) var(--page-pad) 8px;
  display: flex; align-items: center; gap: 12px;
  background: transparent;
  border-bottom: 0;
  flex-shrink: 0;
}
#collection .page-header h2 {
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
}
.col-count {
  font-size: 11px; color: var(--gold-light);
  background: rgba(24, 12, 48, 0.9);
  border: 1px solid #6c5330;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
}

.collection-filters {
  padding: 0 12px 8px;
  background: transparent;
  border-bottom: 0;
  flex-shrink: 0;
}

.filter-pills {
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none;
}
.filter-pills::-webkit-scrollbar { display: none; }

.pill {
  flex-shrink: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 10px; font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 100ms, color 100ms, border-color 100ms;
}
.pill.active, .pill:active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-deep);
}
/* Rarity-colored active pills */
.pill[data-value="Common"].active    { background: #8899AA; border-color: #8899AA; color: var(--bg-deep); }
.pill[data-value="Rare"].active      { background: #4488EE; border-color: #4488EE; color: #fff; }
.pill[data-value="Epic"].active      { background: #AA44EE; border-color: #AA44EE; color: #fff; }
.pill[data-value="Legendary"].active { background: #D4AF37; border-color: #D4AF37; color: var(--bg-deep); }
.pill[data-value="Gold"].active      { background: #C084FC; border-color: #C084FC; color: var(--bg-deep); }

#collection .card-grid {
  flex: 1;
  overflow-y: auto;
  grid-template-columns: repeat(3, 1fr);
  align-content: start;
  gap: 8px;
  padding: 4px 12px 0;
}

/* ── Card Detail Page ── */
#card-detail {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
}

.detail-page-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #140728 0%, #0a0612 100%);
}

.detail-page-glow {
  position: absolute;
  top: 76px;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, #d4af3730 0%, transparent 72%);
  pointer-events: none;
}


.detail-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: var(--header-top) var(--page-pad) 10px;
}

.detail-title-wrap {
  text-align: center;
}

.detail-title-wrap h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text-primary);
}

.detail-title-wrap p {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.detail-back-btn,
.detail-fav-btn {
  width: 44px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 2px 6px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  background: #1e143866;
  color: var(--gold);
}

.detail-fav-btn {
  color: var(--rose);
}

.detail-scroll {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 108px;
}

.detail-hero-card {
  display: flex;
  justify-content: center;
  padding-top: 0;
}

.detail-image-wrap {
  width: 214px;
  height: 298px;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 2px solid var(--gold);
  background: var(--bg-panel);
  box-shadow: 0 0 0 1px #f5d06022, 0 16px 38px #0000004a;
  padding: 0;
  cursor: zoom-in;
  appearance: none;
}

.detail-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-preview-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

.detail-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 800;
  color: rgba(255,255,255,0.28);
}

.detail-image-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 86px;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 6, 18, 0.94) 100%);
}

.detail-image-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-card-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--gold-light);
}

.detail-tier-pill {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d4af3722;
  border: 1px solid #d4af3755;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--gold-light);
}

.detail-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.detail-stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 12px;
  background: #140b26e6;
  border: 1px solid var(--border);
}

.detail-stat-atk { border-color: #e8457a55; }
.detail-stat-hp { border-color: #4488ee55; }
.detail-stat-power { border-color: #d4af3755; }

.detail-stat-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
  color: var(--text-muted);
}

.detail-stat-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.detail-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.detail-chip {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  border: 1px solid var(--border);
  background: #1a1230;
}

.detail-chip-series {
  color: var(--purple);
  border-color: #aa44ee55;
  background: #aa44ee22;
}

.detail-chip-attr {
  color: #8bb7ff;
  border-color: #4488ee55;
  background: #4488ee22;
}

.detail-chip-quality {
  color: #ff8ab2;
  border-color: #e8457a55;
  background: #e8457a22;
}

.detail-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #180c30 0%, #10071f 100%);
}

.detail-panel-lore,
.detail-panel-meta {
  background: #120a22cc;
}

.detail-panel-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.detail-panel-skill {
  padding: 12px 12px 10px;
}

.detail-skill-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.detail-skill-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #d4af3755;
  background: #d4af3722;
  color: var(--gold-light);
  font-size: 22px;
  font-weight: 800;
}

.detail-skill-copy {
  min-width: 0;
  flex: 1;
}

.detail-feature-title {
  margin-top: 0;
  font-size: 14px;
  font-weight: 700;
  color: #f7f1ff;
}

.detail-feature-copy {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: #b8acd6;
}

.detail-skill-hint {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #3b2a5b;
  background: #1a1230;
  color: #9988bb;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

.detail-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  padding: 7px 0;
  border-bottom: 1px solid #2a1d4a88;
}

.detail-panel-meta {
  display: none;
}

.detail-meta-row:last-child {
  border-bottom: 0;
}

.detail-meta-row span:first-child {
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 700;
}

.detail-meta-row span:last-child {
  color: var(--text-primary);
  font-weight: 800;
}

.detail-action-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--sab));
  z-index: 3;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
}

.detail-secondary-btn {
  height: var(--cta-height);
  border-radius: 14px;
  border: 1px solid #3a2a5b;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 20%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #231640 0%, #180f2f 100%);
  color: #b8acd6;
  letter-spacing: 1.5px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -8px 14px rgba(5, 3, 10, 0.28),
    0 8px 16px rgba(5, 3, 10, 0.18);
}

.detail-primary-btn {
  height: var(--cta-height);
  border-radius: 14px;
  border: 1px solid rgba(245, 208, 96, 0.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.08) 18%, rgba(255,255,255,0) 28%),
    linear-gradient(180deg, #f6d76f 0%, #efc84d 40%, #d5a62b 58%, #936912 100%);
  color: #2b1800;
  letter-spacing: 1.6px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    inset 0 -10px 18px rgba(107, 71, 5, 0.32),
    0 10px 24px rgba(212, 175, 55, 0.24);
}

.detail-fullscreen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 12px 24px;
}

.detail-fullscreen-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(63, 35, 103, 0.35) 0%, transparent 34%),
    rgba(5, 3, 10, 0.94);
}

.detail-fullscreen-close {
  position: absolute;
  top: 52px;
  right: 14px;
  width: 38px;
  height: 38px;
  z-index: 2;
  border-radius: 999px;
  border: 1px solid #4b3970;
  background: rgba(18, 10, 34, 0.9);
  color: var(--text-primary);
  font-size: 26px;
  line-height: 1;
  padding: 0;
}

.detail-fullscreen-stage {
  position: relative;
  z-index: 1;
  width: min(calc(100vw - 28px), 390px);
  height: min(calc(100dvh - 116px), 540px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-fullscreen-stage img,
.detail-fullscreen-stage canvas,
.detail-fullscreen-placeholder {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}

.detail-fullscreen-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(calc(100vw - 64px), 360px);
  aspect-ratio: 1664 / 2304;
  background: linear-gradient(180deg, #2A2040 0%, #1A1230 100%);
  color: rgba(255, 255, 255, 0.32);
  font-size: 80px;
  font-weight: 800;
}

.detail-fullscreen-hint {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #9f8fbd;
}

/* ── Deck Builder Page ── */
#deck-builder,
#evolution {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
}

.deck-page-bg,
.evolution-page-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #140728 0%, #0a0612 100%);
}

.deck-page-glow,
.evolution-page-glow {
  position: absolute;
  top: 76px;
  left: 50%;
  width: 220px;
  height: 200px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18) 0%, transparent 72%);
  pointer-events: none;
}

.deck-header,
.evolution-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: var(--header-top) var(--page-pad) 10px;
}

.deck-title-wrap,
.evolution-title-wrap {
  text-align: center;
}

.deck-title-wrap h2,
.evolution-title-wrap h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--text-primary);
}

.deck-title-wrap p,
.evolution-title-wrap p {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.deck-back-btn,
.evolution-back-btn {
  width: 44px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #1e143866;
  color: var(--gold);
}

.deck-power-pill,
.evolution-resource-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 18px;
  background: #180c30cc;
  border: 1px solid #d4af3755;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.deck-scroll,
.evolution-scroll {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 108px;
}

.deck-panel,
.evolution-cost-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #180c30 0%, #10071f 100%);
}

.deck-panel-head,
.deck-available-head,
.evolution-available-head,
.detail-panel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.deck-panel-head span,
.deck-available-head span,
.evolution-available-head span,
.detail-panel-head-row .detail-panel-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.deck-panel-head strong,
.deck-available-head strong,
.evolution-available-head strong,
.detail-panel-head-row strong {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-light);
}

.deck-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.deck-slot {
  min-height: 132px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #130a25;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.deck-slot.filled {
  border-color: #d4af3755;
}

.deck-slot .mini-card {
  width: 100%;
  height: 132px;
  border-radius: 14px;
}

.slot-empty {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.deck-synergy-bar {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #120a22cc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.deck-synergy-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--text-muted);
}

.deck-synergy-copy {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.deck-synergy-badge {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #d4af3755;
  background: #d4af3722;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.deck-available-head,
.evolution-available-head {
  margin-top: 14px;
  margin-bottom: 10px;
}

.deck-card-grid,
.evolution-card-grid {
  padding: 0 0 10px;
}

.deck-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 0 2px;
  flex-shrink: 0;
}
.deck-page-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(160, 130, 220, 0.35);
  background: rgba(20, 10, 40, 0.6);
  color: var(--text-primary);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 120ms;
}
.deck-page-btn:disabled { opacity: 0.3; cursor: default; }
.deck-page-btn:not(:disabled):active { background: rgba(90, 60, 180, 0.5); }
.deck-page-indicator {
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-number);
  letter-spacing: 1px; min-width: 40px; text-align: center;
}

.deck-action-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--sab));
  z-index: 3;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
}

.deck-auto-btn {
  height: var(--cta-height);
  border-radius: 14px;
  border: 1px solid #3a2a5b;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 20%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #231640 0%, #180f2f 100%);
  color: #b8acd6;
  letter-spacing: 1.5px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -8px 14px rgba(5, 3, 10, 0.28),
    0 8px 16px rgba(5, 3, 10, 0.18);
}

.deck-battle-btn {
  height: var(--cta-height);
  border-radius: 14px;
  border: 1px solid rgba(245, 208, 96, 0.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.08) 18%, rgba(255,255,255,0) 28%),
    linear-gradient(180deg, #f6d76f 0%, #efc84d 40%, #d5a62b 58%, #936912 100%);
  color: #2b1800;
  letter-spacing: 1.6px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    inset 0 -10px 18px rgba(107, 71, 5, 0.32),
    0 10px 24px rgba(212, 175, 55, 0.24);
}

/* ── Evolution Page ── */
.evolution-hero-card {
  display: flex;
  justify-content: center;
  padding-top: 0;
}

.evolution-image-wrap {
  width: 198px;
  height: 276px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid var(--gold);
  background: var(--bg-panel);
  box-shadow: 0 0 0 1px #f5d06022, 0 12px 32px #00000044;
}

.evolution-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.evolution-stat-row {
  margin-top: 14px;
}

.evolution-stat-row .detail-stat-card {
  min-height: 50px;
  padding: 8px 10px;
}

.evolution-stat-row .detail-stat-value {
  font-size: 12px;
}

.evolution-cost-panel .detail-panel-head-row strong {
  color: var(--gold-light);
}

.evolution-path-panel {
  margin-top: 10px;
  background: #120a22cc;
}

.evolution-path-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.evolution-path-star {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5b4c7e;
  font-size: 16px;
}

.evolution-path-star-active {
  color: var(--gold-light);
}

.evolution-path-line {
  height: 1px;
  flex: 1;
  background: #3a2a5a;
}

.evolution-path-line-active {
  background: linear-gradient(90deg, #d4af37, #f5d060);
}

.evolution-path-copy {
  margin-top: 10px;
  font-size: 10px;
  color: #9988bb;
}

/* ── Rank Page ── */
#rank {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
}

.rank-page-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #140728 0%, #0a0612 100%);
}

.rank-page-glow {
  position: absolute;
  top: 72px;
  left: 50%;
  width: 220px;
  height: 200px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.2) 0%, transparent 72%);
  pointer-events: none;
}

.rank-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: var(--header-top) var(--page-pad) 10px;
}

.rank-title-wrap {
  text-align: center;
}

.rank-title-wrap h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text-primary);
}

.rank-title-wrap p {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.rank-back-btn {
  width: 44px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #1e143866;
  color: var(--gold);
}

.rank-season-pill {
  padding: 7px 10px;
  border-radius: 18px;
  background: #180c30cc;
  border: 1px solid #d4af3755;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.rank-scroll {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 108px;
}

.rank-hero-panel,
.rank-panel,
.rank-season-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #180c30 0%, #10071f 100%);
}

.rank-hero-name {
  font-size: 24px;
  font-weight: 800;
  color: #f8f2ff;
  letter-spacing: 1.2px;
}

.rank-hero-stars {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--gold-light);
}

.rank-hero-meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: #b8acd6;
}

.rank-hero-meta strong {
  color: #8bb7ff;
}

.rank-progress-wrap {
  margin-top: 12px;
}

.rank-progress-title,
.rank-panel-head span,
.rank-reward-label,
.rank-season-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  color: var(--text-muted);
}

.rank-progress-bar {
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  background: #120a22;
  border: 1px solid var(--border);
  overflow: hidden;
}

.rank-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light) 50%, var(--gold-dark));
}

.rank-progress-copy {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-light);
}

.rank-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.rank-panel-head strong {
  font-size: 10px;
  color: var(--text-muted);
}

.rank-opponent-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.rank-opponent-slot {
  min-height: 112px;
  border-radius: 14px;
  border: 1px solid #aa44ee55;
  background: #130a25;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.rank-opponent-slot-gold {
  border-color: #d4af3755;
}

.rank-opponent-slot-blue {
  border-color: #4488ee55;
}

.rank-opponent-name {
  font-size: 11px;
  font-weight: 800;
  color: #f7f1ff;
}

.rank-opponent-role {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  color: #b8acd6;
}

.rank-match-hint,
.rank-season-copy {
  margin-top: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #b8acd6;
}

.rank-reward-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.rank-reward-card {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #120a22cc;
}

.rank-reward-value {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-light);
}

.rank-reward-value-blue {
  color: #8bb7ff;
}

.rank-season-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.rank-season-days {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid #e8457a55;
  background: #e8457a22;
  color: #ff8ab2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.rank-action-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--sab));
  z-index: 3;
  display: grid;
  grid-template-columns: 72px 1fr 1fr;
  gap: 8px;
}

.rank-auto-btn {
  height: var(--cta-height);
  border-radius: 14px;
  border: 1px solid rgba(192, 132, 252, 0.5);
  background: linear-gradient(180deg, rgba(168,85,247,0.18) 0%, rgba(100,40,160,0.28) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 4px 14px rgba(100,40,160,0.30);
}
.rank-auto-btn:active {
  transform: scale(0.96);
  filter: brightness(0.88);
}
.auto-btn-label {
  font-size: 11px;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 0.3px;
}
.auto-btn-uses {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.rank-auto-btn.auto-btn-depleted {
  border-color: rgba(255,255,255,0.15);
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}
.rank-auto-btn.auto-btn-depleted .auto-btn-label {
  color: rgba(255,255,255,0.4);
}
.rank-auto-btn.auto-btn-depleted .auto-btn-uses {
  font-size: 10px;
  color: #a78bfa;
}

.rank-log-btn {
  height: var(--cta-height);
  border-radius: 14px;
  border: 1px solid #3a2a5b;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 20%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #231640 0%, #180f2f 100%);
  color: #b8acd6;
  letter-spacing: 1.5px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -8px 14px rgba(5, 3, 10, 0.28),
    0 8px 16px rgba(5, 3, 10, 0.18);
}

.rank-battle-btn {
  height: var(--cta-height);
  border-radius: 14px;
  border: 1px solid rgba(245, 208, 96, 0.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.08) 18%, rgba(255,255,255,0) 28%),
    linear-gradient(180deg, #f6d76f 0%, #efc84d 40%, #d5a62b 58%, #936912 100%);
  color: #2b1800;
  letter-spacing: 1.6px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    inset 0 -10px 18px rgba(107, 71, 5, 0.32),
    0 10px 24px rgba(212, 175, 55, 0.24);
}

/* ── Gacha / Shop Pages ── */
#gacha,
#shop {
  position: relative;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
}

.gacha-page-bg,
.shop-page-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #140728 0%, #0a0612 100%);
}

.gacha-page-glow,
.shop-page-glow {
  position: absolute;
  top: 70px;
  left: 50%;
  width: 230px;
  height: 200px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(170, 68, 238, 0.18) 0%, transparent 72%);
  pointer-events: none;
}

.gacha-header,
.shop-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: var(--header-top) var(--page-pad) 10px;
}

.gacha-back-btn,
.shop-back-btn {
  width: 44px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #1e143866;
  color: var(--gold);
}

.gacha-title-wrap,
.shop-title-wrap {
  text-align: left;
}

.gacha-eyebrow,
.shop-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--purple);
}

.shop-eyebrow {
  color: #ff8ab2;
}

.gacha-title-wrap h2,
.shop-title-wrap h2 {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  color: #f8f2ff;
  letter-spacing: 1px;
}

.gacha-currency-pill,
.shop-wallet {
  padding: 7px 10px;
  border-radius: 14px;
  background: #180c30cc;
  border: 1px solid #d4af3755;
  color: #f8f2ff;
  font-size: 11px;
  font-weight: 700;
}

.gacha-scroll,
.shop-scroll {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 18px;
}

/* ── Tutorial gacha banner ── */
.tutorial-gacha-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1E1438, #2A1D4A);
  border: 1.5px solid var(--gold);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 0 20px #D4AF3733;
}
.tutorial-banner-icon { font-size: 28px; flex-shrink: 0; }
.tutorial-banner-text { flex: 1; }
.tutorial-banner-title { font-size: 14px; font-weight: 700; color: var(--gold); }
.tutorial-banner-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.tutorial-banner-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--bg-deep);
  font-size: 12px; font-weight: 800; letter-spacing: 1px;
  padding: 10px 14px; border-radius: 10px; flex-shrink: 0;
  white-space: nowrap;
}
.tutorial-go-battle-btn {
  margin-top: 12px !important;
  animation: pulse-cta 1.6s ease-in-out infinite;
}
@keyframes pulse-cta {
  0%,100% { box-shadow: 0 4px 16px #D4AF3744; }
  50%      { box-shadow: 0 4px 28px #D4AF3799, 0 0 8px #F5D060; }
}

.gacha-tabs {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  margin-bottom: 12px;
}

.gacha-tab {
  flex: 1;
  padding: 9px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #1a1230;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
}

.gacha-tab.active {
  background: linear-gradient(90deg, var(--gold), var(--gold-light) 50%, var(--gold-dark));
  border-color: var(--gold);
  color: #2b1800;
}

.gacha-banner {
  position: relative;
  min-height: 294px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid #aa44ee55;
  background: linear-gradient(160deg, #261045 0%, #12071f 55%, #0b0612 100%);
  overflow: hidden;
}

.gacha-banner::before {
  content: '';
  position: absolute;
  top: 30px;
  left: 50%;
  width: 164px;
  height: 198px;
  transform: translateX(-50%);
  border-radius: 16px;
  border: 2px solid var(--gold);
  background: url('https://cdn.fatedqueens.com/cards/WITCHY_pack2_Gold_tier5_card.jpg') center/cover no-repeat;
  box-shadow: 0 0 0 1px #f5d06022, 0 12px 32px #00000044;
}

.gacha-banner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 130px;
  background: linear-gradient(180deg, transparent 0%, rgba(10, 6, 18, 0.96) 100%);
}

.gacha-banner-tag,
.shop-featured-badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e8457a55;
  background: #e8457a22;
  color: #ff8ab2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
}

.gacha-banner-copy {
  position: relative;
  z-index: 1;
  margin-top: 212px;
}

.gacha-banner-name {
  font-size: 20px;
  font-weight: 800;
  color: #f8f2ff;
}

.gacha-banner-desc,
.shop-section p,
.shop-hint {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #c9bcd8;
}

.gacha-info-panel,
.shop-section {
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #180c30 0%, #10071f 100%);
}

.gacha-panel-head,
.shop-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.gacha-panel-head span,
.shop-section-head span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
}

.gacha-panel-head strong,
.shop-section-head strong {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.gacha-rate-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
}

.gacha-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.gacha-btn-single,
.gacha-btn-multi {
  min-width: 0;
  height: 48px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
}

.gacha-btn-single {
  border: 1px solid #3a2a5b;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 20%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #231640 0%, #180f2f 100%);
  color: var(--text-primary);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -8px 14px rgba(5, 3, 10, 0.28),
    0 8px 16px rgba(5, 3, 10, 0.18);
}

.gacha-btn-multi {
  border: 1px solid rgba(245, 208, 96, 0.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0.08) 18%, rgba(255,255,255,0) 28%),
    linear-gradient(180deg, #f6d76f 0%, #efc84d 40%, #d5a62b 58%, #936912 100%);
  color: #2b1800;
  text-shadow: 0 1px 0 rgba(255,255,255,0.18);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.42),
    inset 0 -10px 18px rgba(107, 71, 5, 0.32),
    0 10px 24px rgba(212, 175, 55, 0.24);
}

.btn-super {
  border: 1px solid #aa44ee55;
  background: linear-gradient(90deg, #3a1560, #5b208e);
  color: #f8f2ff;
}

.gacha-result {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.shop-section-featured {
  position: relative;
  overflow: hidden;
}

.shop-section-featured h3 {
  margin-top: 12px;
  font-size: 26px;
  font-weight: 800;
  color: #f8f2ff;
}

.shop-featured-price {
  margin-top: 26px;
  font-size: 34px;
  font-weight: 800;
  color: var(--gold-light);
}

.shop-free-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.shop-free-slot {
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #1a1230;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}

.shop-free-slot.claimed {
  border-color: #2b5f41;
  background: #17301f;
  color: #7ce0a5;
}

.shop-vip-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #d4af3755;
}

.shop-iap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.shop-iap-card {
  border-radius: 14px;
  border: 1px solid #2a1d4a;
  background: #120a22cc;
  padding: 12px;
  text-align: center;
}

/* ── Battle Page ── */
#battle {
  height: 100vh; height: 100dvh;
  background: radial-gradient(ellipse at 50% 50%, #1E1438 0%, var(--bg-deep) 100%);
  position: relative;
  overflow: hidden;
}

/* Compact header — floats over the field */
.battle-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(16px + var(--sat)) 16px 10px;
  background: linear-gradient(180deg, #0C071Acc 0%, transparent 100%);
  pointer-events: none;
}
.battle-header .btn-back { pointer-events: all; }
.battle-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.battle-page-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  color: #f0e8ff;
  font-family: var(--font-cjk);
}
.battle-page-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  color: #b8acd6;
  font-family: var(--font-cjk);
}
.battle-turn-badge {
  background: #1A103888; border: 1px solid var(--border);
  border-radius: 10px; padding: 3px 10px;
  font-size: 11px; font-weight: 700; color: var(--gold);
  letter-spacing: 0;
  font-family: var(--font-cjk);
}

/* Full-screen field — true top/bottom split */
.battle-field {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.battle-enemy-zone,
.battle-player-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: static;
  width: 100%;
  flex: 1;
  justify-content: center;
}
.battle-enemy-zone { padding: 4px 0 2px; }
.battle-player-zone { padding: 2px 0 4px; }

/* Log strip — floats in the dead zone between enemy and player areas */
.battle-log-strip {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 16px;
  z-index: 17;
  pointer-events: none;
}

.battle-team-label {
  position: static;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  width: 100%;
  font-family: var(--font-cjk);
}
.enemy-team-label {
  margin-bottom: 6px;
  color: #e8457a;
}
.player-team-label {
  margin-top: 6px;
  color: #d4af37;
}

.battle-team {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 2px;
  padding: 0 4px;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Battle card slot — fills grid column, keeps portrait ratio */
.battle-card-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 1664 / 2304;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer; transition: transform 120ms;
}

/* Mini-card fills slot, canvas fills mini-card */
#battle .mini-card {
  position: absolute; inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px; overflow: hidden;
}
#battle .mini-card-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%; display: block;
}
#battle .mini-stats {
  display: none;
}
.battle-card-slot.selected    { transform: scale(1.04); box-shadow: 0 0 12px var(--gold); }
.battle-card-slot.disabled    { opacity: 0.5; pointer-events: none; }
.battle-card-slot.defeated    { filter: grayscale(100%); opacity: 0.3; pointer-events: none; }
.battle-card-slot.frozen      { filter: hue-rotate(160deg) brightness(1.2); outline: 2px solid #88CCFF; box-shadow: 0 0 12px #88CCFF88; }
.battle-card-slot.actor-selected { transform: scale(1.06); box-shadow: 0 0 16px #F5D060, 0 0 4px #F5D060; outline: 2px solid #F5D060; }
.battle-card-slot.target-ready   { box-shadow: 0 0 12px #E8457A; outline: 2px solid #E8457A88; animation: pulse-target 800ms ease-in-out infinite alternate; }
.battle-card-slot.action-queued  { outline: 2px solid #44BB66; box-shadow: 0 0 10px #44BB6688; }
.battle-card-slot.action-queued::after { content: '✓'; position: absolute; top: 4px; right: 6px; font-size: 14px; color: #44BB66; font-weight: 900; text-shadow: 0 0 6px #000; }
@keyframes pulse-target { from { box-shadow: 0 0 8px #E8457A88; } to { box-shadow: 0 0 18px #E8457A; } }

/* HP bar */
.hp-bar { height: 4px; width: 100%; background: #222; }
.hp-fill { height: 100%; transition: width 300ms ease; }
.hp-fill.hp-high { background: #44BB66; }
.hp-fill.hp-mid  { background: #FFAA00; }
.hp-fill.hp-low  { background: var(--rose); }

/* Battle log — floats in mid-field, tap to expand */
.battle-log {
  position: static;
  pointer-events: auto; /* override parent's none */
  width: 100%;
  background: rgba(6, 3, 16, 0.72);
  border: 1px solid rgba(100, 70, 160, 0.25);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  box-shadow: none;
  padding: 6px 12px;
  display: flex;
  flex-direction: column-reverse; /* newest entry visible first */
  gap: 2px;
  overflow: hidden;
  max-height: 40px;
  cursor: pointer;
  appearance: none;
  text-align: left;
}
.battle-log .log-line {
  display: block;
  font-size: 11px; font-weight: 500; line-height: 1.4;
  text-align: left;
  text-shadow: 0 1px 4px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0;
}
.battle-log .log-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.log-attack  { color: #FF6B6B; }
.log-skill   { color: #C084FC; }
.log-heal    { color: #44BB66; }
.log-poison  { color: #A3E635; }
.log-freeze  { color: #60D5FA; }
.log-death   { color: #888; font-style: italic; }
.log-system  { color: #888; }
.log-win     { color: var(--gold); font-weight: 800; }
.log-lose    { color: var(--rose); font-weight: 800; }

/* Floating hint bar */
.battle-actions {
  position: absolute; bottom: 14px; left: 0; right: 0; z-index: 18;
  pointer-events: none;
}
.battle-hint {
  text-align: center; font-size: 11px; font-weight: 700;
  color: #cfc4e6;
  background: rgba(8, 5, 16, 0.68);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(74, 54, 120, 0.32);
  border-radius: 16px;
  margin: 0 64px;
  padding: 8px 12px;
  letter-spacing: 0;
  font-family: var(--font-cjk);
}

/* Floating skill menu */
/* ── Battle action strip ─────────────────────────────────── */
.battle-skill-menu {
  position: static;
  flex-shrink: 0;
  z-index: 22;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0) 40%),
    linear-gradient(180deg, #150a38f8 0%, #0a0520f5 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(180, 140, 255, 0.22);
  border-radius: 18px;
  margin: 0 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 4px 24px rgba(30, 10, 90, 0.55),
    0 0 0 1px rgba(120, 80, 220, 0.08);
  animation: skill-menu-in 140ms ease-out;
}
@keyframes skill-menu-in {
  from { opacity: 0; transform: scaleY(0.85); }
  to   { opacity: 1; transform: scaleY(1); }
}

/* Left: card name + skill badge */
.skill-menu-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.skill-menu-name {
  font-size: 13px; font-weight: 800; color: var(--gold);
  letter-spacing: 0; font-family: var(--font-ui);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.skill-menu-desc {
  font-size: 10px; font-weight: 400; color: #a899cc;
  line-height: 1.35; font-family: var(--font-body);
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* Right: action pill buttons */
.skill-menu-btns { display: flex; flex-direction: row; gap: 6px; flex-shrink: 0; }
.skill-menu-attack,
.skill-menu-skill-btn,
.skill-menu-defend,
.skill-menu-cancel {
  height: 36px; padding: 0 14px;
  border-radius: 18px; border: none;
  font-size: 12px; font-weight: 700;
  font-family: var(--font-cjk);
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; justify-content: center;
}
.skill-menu-attack {
  background: linear-gradient(180deg, #f06070 0%, #d02040 50%, #a81030 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.20),
    0 3px 12px #e8457a66;
}
.skill-menu-skill-btn {
  background: linear-gradient(180deg, #9b69ff 0%, #6633d0 50%, #4411a8 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.20),
    0 3px 12px #7744ff55;
}
.skill-menu-defend {
  background: linear-gradient(180deg, #f0d060 0%, #c89010 50%, #906000 100%);
  color: #1a0e00;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.40),
    inset 0 -1px 0 rgba(0,0,0,0.15),
    0 3px 12px #e8c04055;
}
.skill-menu-cancel {
  height: 36px; width: 36px; padding: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(160, 140, 200, 0.25);
  color: #a090cc;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 6px rgba(0,0,0,0.25);
}

.battle-log-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 74px 12px 14px;
}
.battle-log-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 10, 0.42);
  backdrop-filter: blur(2px);
}
.battle-log-full {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 366px;
  max-height: min(42vh, 320px);
  border-radius: 24px;
  border: 1px solid rgba(96, 69, 138, 0.42);
  background: linear-gradient(180deg, rgba(22,14,40,0.82) 0%, rgba(10,6,18,0.9) 100%);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.34);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.battle-log-full-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid #2a1d4a;
}
.battle-log-full-title {
  color: #f0e8ff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  font-family: var(--font-cjk);
}
.battle-log-full-close {
  min-width: 56px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid #3a2a5b;
  background: #1a1230;
  color: #b8acd6;
}
.battle-log-full-vs {
  padding: 8px 14px;
  text-align: center;
  color: #d4af37;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  font-family: var(--font-cjk);
}
.battle-log-full-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 12px 12px;
}
.battle-log-full-list .log-line {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.45;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.btn-attack { background: linear-gradient(135deg, #C84060, var(--rose)); color: #FFF; border: none; }
.btn-skill  { background: linear-gradient(135deg, #7733CC, var(--purple)); color: #FFF; border: none; }
.btn-defend { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: var(--bg-deep); border: none; }

/* Damage float */
.dmg-float {
  position: fixed;
  font-size: 18px; font-weight: 800; color: #FFF;
  pointer-events: none; z-index: var(--z-dmg);
  animation: dmg-float 800ms ease-out forwards;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.dmg-float.critical { color: var(--gold); font-size: 22px; }

/* ── Number font: Rajdhani for all numeric values ── */
.detail-stat-value,
.col-count, .deck-power-val,
.currency-val, .coin-amount, .gem-amount,
.hp-fill, .battle-hp-text,
.mini-stats, .mini-stat,
.rank-stars-val, .rank-tier-val,
.power-level-num, .pc-level,
.gacha-cost, .shop-price,
.col-page-info,
.dmg-float {
  font-family: var(--font-number);
}

/* ── Display font: Cinzel Decorative for game logo/title areas ── */
.game-title, #main-menu h1, .page-title-display {
  font-family: var(--font-display);
  letter-spacing: 2px;
}

/* ── Artistic font: Cinzel for UI labels, section headers, card names ──
   Base body is now system-ui (clarity). These elements get Cinzel explicitly. */
.game-subtitle,
.page-header h2,
.section-eyebrow, .section-header,
.menu-title,
.btn-battle .btn-label, .btn-battle,
.card-name-strip,
.detail-card-name,
.rarity-pill, .rarity-badge, .tier-pill, .detail-tier-pill,
.battle-turn-badge,
.skill-menu-name,
.skill-menu-attack, .skill-menu-skill-btn, .skill-menu-defend,
.evolve-card-name, .evolve-quality-label,
.shop-section-title, .gacha-title, .gacha-eyebrow,
.rank-tier-label, .deck-section-label {
  font-family: var(--font-ui);
}

/* ── Clear font: system-ui for all body / descriptive / log text ── */
.battle-log .log-line,
.battle-log-full-list .log-line,
.battle-hint,
.detail-skill-desc,
.detail-lore-body, .lore-copy, .detail-lore p,
.menu-desc,
.gacha-banner-desc, .gacha-note,
.settings-copy, .settings-desc,
.evolve-copy, .shop-hint,
.synergy-copy, .deck-synergy-detail {
  font-family: var(--font-body);
}

/* ── Daily Missions ────────────────────────────────────────────── */
.missions-page-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, #1e0b40 0%, #0c071a 60%);
  z-index: 0;
}
.missions-page-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 340px; height: 260px;
  background: radial-gradient(ellipse, rgba(168,85,247,0.18) 0%, transparent 70%);
  z-index: 0; pointer-events: none;
}

.missions-header {
  position: relative; z-index: 2;
  padding: var(--header-top) var(--page-pad) 12px;
}
.missions-header h2 { flex: 1; }
.missions-countdown-wrap {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 4px;
  align-items: center;
  white-space: nowrap;
}
.missions-countdown-wrap strong {
  color: #c084fc;
  font-variant-numeric: tabular-nums;
}

/* Progress banner */
.missions-progress-banner {
  position: relative; z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 var(--page-pad) 20px;
  padding: 12px 16px;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.missions-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.missions-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #c084fc);
  border-radius: 3px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px rgba(192,132,252,0.6);
}
.missions-progress-label {
  font-size: 13px;
  font-weight: 700;
  color: #c084fc;
  white-space: nowrap;
}

/* Scroll area */
.missions-scroll {
  flex: 1;
  overflow-y: auto;
  position: relative; z-index: 2;
}

#missions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 var(--page-pad) 24px;
}

/* Mission card */
.mission-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-left: 3px solid rgba(168,85,247,0.4);
  border-radius: 16px;
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.mission-card-ready {
  border-left-color: #f6d76f;
  box-shadow: 0 0 20px rgba(246,215,111,0.12);
  background: linear-gradient(135deg, rgba(246,215,111,0.07) 0%, rgba(255,255,255,0.03) 100%);
}
.mission-card-claimed {
  border-left-color: rgba(255,255,255,0.12);
  opacity: 0.7;
}

/* Icon */
.mission-icon-wrap {
  position: relative;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.22);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mission-card-ready .mission-icon-wrap {
  background: rgba(246,215,111,0.10);
  border-color: rgba(246,215,111,0.25);
}
.mission-card-claimed .mission-icon-wrap {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.mission-icon {
  font-size: 24px;
  line-height: 1;
}
.mission-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,10,30,0.65);
  border-radius: 14px;
  font-size: 20px;
  color: #4ade80;
  font-weight: 900;
}

/* Info */
.mission-info {
  flex: 1;
  min-width: 0;
}
.mission-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.2px;
}
.mission-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 3px;
}

/* Action column */
.mission-action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.mission-reward-row {
  font-size: 13px;
  font-weight: 700;
  color: #f6d76f;
  white-space: nowrap;
}
.mission-claim-btn {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.mission-claim-ready {
  background: linear-gradient(180deg, #f6e27a 0%, #e8b830 50%, #c8930a 100%);
  color: #3a1a00;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    0 3px 12px rgba(246,215,111,0.4);
}
.mission-claim-locked {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.25);
  cursor: not-allowed;
}
.mission-claimed-badge {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  font-style: italic;
}

.btn-menu-missions {
  border: 1px solid rgba(192, 132, 252, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -10px 16px rgba(5, 3, 10, 0.28),
    0 0 0 1px rgba(100, 40, 160, 0.12),
    0 10px 20px rgba(5, 3, 10, 0.22),
    0 0 16px rgba(192, 132, 252, 0.08);
}

/* Red dot badge on btn-missions */
#btn-missions {
  position: relative;
}

#btn-missions.has-badge::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 1.5px solid #1a1030;
}
