@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/cinzel-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'New Rocker';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/new-rocker.woff2') format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/alegreya-sans-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/alegreya-sans-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/alegreya-sans-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/alegreya-sans-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Alegreya Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/alegreya-sans-italic.woff2') format('woff2');
}

:root {
  /* Theme: Realms (rustic; each area has its own surroundings, see the Realms block at the end) */
  --bg: #07061a;
  --glow: #2a1d5e;          /* light at the top of the page */
  --panel: rgba(22, 16, 54, 0.82);
  --panel-2: rgba(38, 28, 86, 0.78);
  --line: #5a4a9a;
  --deep: #05041a;          /* insets: icon wells, inputs, bar tracks */
  --shadow: transparent;        /* hard drop shadows under panels */
  --topbar-bg: rgba(8, 6, 26, 0.86);
  --tabbar: rgba(8, 6, 26, 0.94);
  --text: #f2ecff;
  --muted: #a99fd6;
  --gold: #f6d27a;
  --gold-dark: #9c7a2e;
  --gold-bg: rgba(60, 44, 14, 0.65);
  --accent: #b48cff;
  --primary: #5b2fc2;
  --primary-line: #c9a6ff;
  --bar-1: #d6b8ff;
  --bar-2: #7a4ae0;
  --danger: #d0524a;
  --c-common: #b8b8b0;
  --c-uncommon: #5fbf5a;
  --c-rare: #4a90e2;
  --c-epic: #a35ae0;
  --c-legendary: #f0a020;
  --c-mythic: #e8435a;
  --c-divine: #fff1a8;
  --display-font: 'New Rocker', Georgia, serif;
  --body-font: 'Alegreya Sans', system-ui, sans-serif;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(circle at 50% -20%, var(--glow) 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, .tabbar, .tile, .chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }

/* ---------- Install / welcome ---------- */
.install-banner {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 12px;
  background: var(--gold-bg); border: 2px solid var(--gold-dark); box-shadow: 4px 4px 0 var(--shadow);
}
.install-banner img { image-rendering: pixelated; flex: none; }
.install-text { flex: 1; min-width: 0; line-height: 1.3; }
.install-banner .btn { min-height: 38px; padding: 6px 12px; }
@media (max-width: 380px) {
  .install-banner img { display: none; }
  .install-banner { gap: 8px; padding: 8px 10px; }
  .panel .slots { grid-template-columns: 1fr; }
}
.install-x { background: none; border: 0; color: var(--muted); font-size: 22px; padding: 4px 6px; cursor: pointer; }
.steps { padding-left: 22px; margin: 12px 0; }
.steps li { margin-bottom: 10px; }
.ios-share { width: 16px; height: 19px; vertical-align: -3px; color: #4a90e2; margin: 0 2px; }
.welcome { text-align: center; }
.welcome-icon { image-rendering: pixelated; margin: 0 auto 4px; display: block; }
.welcome-install { text-align: left; background: var(--gold-bg); border: 2px solid var(--gold-dark); padding: 10px 12px; margin: 14px 0; }
.welcome-install p { margin: 0 0 4px; font-size: 14px; }
.welcome-install .btn { margin-top: 8px; }
.field { display: block; text-align: left; margin-top: 16px; font-size: 13px; color: var(--muted); }
.field input {
  display: block; width: 100%; margin-top: 6px; padding: 12px;
  background: var(--deep); border: 2px solid var(--line); color: var(--text);
  font: 600 18px var(--display-font); /* >=16px stops iPhone zooming in on focus */
}
.field input:focus { outline: none; border-color: var(--gold); }
a { color: var(--gold); }
h2, h3, .brand, .stat-num, .lvl, .banner, .die { font-family: var(--display-font); letter-spacing: 0.02em; }
h2 { margin: 0 0 12px; font-size: 20px; font-weight: 700; }
h3 { margin: 18px 0 8px; font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.hidden { display: none !important; }

/* ---------- Chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--topbar-bg);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.brand { font-size: 22px; color: var(--gold); text-shadow: 2px 2px 0 #000; }
.coin-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 2px solid var(--gold-dark); background: var(--gold-bg);
  font-family: var(--display-font); color: var(--gold);
}
.coin-icon {
  width: 12px; height: 12px; background: var(--gold);
  box-shadow: inset -3px -3px 0 var(--gold-dark), 0 0 0 2px #000;
}
.coin { color: var(--gold); }

main { max-width: 640px; margin: 0 auto; padding: 16px; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--tabbar); border-top: 2px solid var(--line);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; color: var(--muted); font-size: 11px; cursor: pointer;
}
.tabbar button span { font-size: 20px; filter: grayscale(0.6); }
.tabbar button.on { color: var(--gold); }
.tabbar button.on span { filter: none; }

.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: inset 0 0 0 2px var(--deep), 4px 4px 0 var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 8px 16px;
  background: var(--panel-2); border: 2px solid var(--line);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer; text-align: center;
}
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary-line); color: #fff; font-weight: 600; }
.btn.danger-btn { background: #4a1f1d; border-color: var(--danger); }
.btn.wide { width: 100%; margin-top: 16px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn-row .btn { flex: 1; }
.btn-col { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.quick { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; padding: 6px 10px; min-height: 36px;
  background: var(--panel-2); border: 2px solid var(--line); cursor: pointer; white-space: nowrap; font-size: 13px;
}
.chip.on { border-color: var(--gold); color: var(--gold); }

.chip-scroller { position: relative; display: flex; align-items: stretch; gap: 4px; }
.chip-scroller .chips { flex: 1; min-width: 0; -webkit-overflow-scrolling: touch; }
.chip-arrow {
  flex: none; width: 32px; min-height: 36px; padding: 0;
  background: var(--panel-2); border: 2px solid var(--line); color: var(--gold);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.chip-arrow:active { transform: translateY(1px); }
.chip-scroller.at-start .chip-arrow.left,
.chip-scroller.at-end .chip-arrow.right { opacity: 0.3; pointer-events: none; }

/* ---------- Home ---------- */
.hero { text-align: center; }
.avatar-wrap { position: relative; display: inline-block; padding: 8px 32px 0; }
.avatar { width: 150px; image-rendering: pixelated; display: block; }
.avatar-pet { position: absolute; right: -14px; bottom: 6px; width: 64px; image-rendering: pixelated; animation: bob 2.4s ease-in-out infinite; }
.avatar-pet.detailed { width: 84px; animation: none; }   /* detailed pets animate themselves */
.sprite.outfit-icon { aspect-ratio: 1; object-fit: contain; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.name { display: block; margin-left: auto; margin-right: auto; background: none; border: 0; font-family: var(--display-font); font-size: 22px; margin-top: 8px; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stats > div { background: var(--panel-2); border: 2px solid var(--line); padding: 8px 4px; }
.stat-num { font-size: 22px; }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot {
  display: flex; gap: 10px; align-items: center; text-align: left;
  background: var(--panel-2); border: 2px solid var(--line); padding: 8px; cursor: pointer; min-width: 0;
}
.slot-icon { flex: none; width: 48px; height: 48px; display: grid; place-items: center; background: var(--deep); border: 2px solid var(--deep); }
.slot-icon .sprite { width: 40px; }
.slot-empty { font-size: 22px; opacity: 0.5; }
.slot-text { min-width: 0; }
.slot-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.slot-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-sub { font-size: 12px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.li-icon { font-size: 22px; }
.li-main { flex: 1; font-size: 14px; }
.li-time { font-size: 12px; }

/* ---------- Skills ---------- */
.skill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.skill-row {
  width: 100%; display: flex; gap: 12px; align-items: center; text-align: left;
  background: var(--panel-2); border: 2px solid var(--line); padding: 10px; cursor: pointer;
}
.skill-row:active { border-color: var(--gold-dark); }
.skill-icon {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px;
  background: var(--deep); border: 2px solid var(--deep);
}
.skill-icon.big { width: 56px; height: 56px; font-size: 30px; }
.skill-body { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.skill-top { display: flex; justify-content: space-between; }
.lvl { color: var(--gold); }
.skill-sub { font-size: 12px; }
.boost { color: var(--accent); font-weight: 600; }
.bar { display: block; height: 10px; background: var(--deep); border: 2px solid var(--deep); position: relative; }
.bar > span { display: block; height: 100%; background: linear-gradient(var(--bar-1), var(--bar-2)); transition: width 0.9s cubic-bezier(.2, .8, .2, 1); }
.bar.big { height: 16px; margin: 12px 0 4px; }

/* ---------- Collection ---------- */
.coll-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 10px 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--panel-2); border: 2px solid var(--line); padding: 8px 4px 6px; cursor: pointer; min-height: 112px;
}
.tile.unknown { cursor: default; opacity: 0.7; }
.tile .sprite { width: 48px; }
.tile-name { font-size: 11px; text-align: center; line-height: 1.2; }
.count { position: absolute; top: 3px; right: 4px; font-family: var(--display-font); font-size: 12px; color: var(--text); text-shadow: 1px 1px 0 #000; }
.badge { position: absolute; top: 2px; left: 3px; font-size: 13px; }
.eq { position: absolute; bottom: 3px; right: 4px; font-family: var(--display-font); font-size: 11px; background: var(--gold); color: #000; padding: 0 4px; }
.type-dot { position: absolute; top: 3px; right: 4px; font-size: 12px; }

.sprite { image-rendering: pixelated; display: block; }
.sprite.xl { width: 120px; margin: 0 auto 8px; }

.rtag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.r-common { color: var(--c-common); } .r-uncommon { color: var(--c-uncommon); } .r-rare { color: var(--c-rare); }
.r-epic { color: var(--c-epic); } .r-legendary { color: var(--c-legendary); } .r-mythic { color: var(--c-mythic); }
.r-divine { color: var(--c-divine); text-shadow: 0 0 6px rgba(255, 241, 168, 0.6); }
.r-border-common { border-color: #55534e; } .r-border-uncommon { border-color: #3c6e38; } .r-border-rare { border-color: #2f5b8f; }
.r-border-epic { border-color: #6a3a93; } .r-border-legendary { border-color: #a06a14; } .r-border-mythic { border-color: #9a2c3c; }
.r-border-divine { border-color: #d9c86a; }

.glow-legendary { filter: drop-shadow(0 0 4px rgba(240, 160, 32, 0.55)); }
.glow-mythic { filter: drop-shadow(0 0 6px rgba(232, 67, 90, 0.7)); animation: pulse 2s ease-in-out infinite; }
.glow-divine { filter: drop-shadow(0 0 8px rgba(255, 241, 168, 0.85)); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.2)); } }

/* ---------- Settings ---------- */
.rules { padding-left: 18px; margin: 0; }
.rules li { margin-bottom: 6px; }
.danger { border-color: #4a1f1d; }

/* ---------- Modals ---------- */
#modal-root { position: fixed; inset: 0; z-index: 50; display: none; }
#modal-root.open { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(3, 4, 14, 0.78); animation: fade 0.15s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  max-height: 92dvh; overflow-y: auto;
  background: var(--panel); border: 2px solid var(--line); border-bottom: 0;
  box-shadow: inset 0 0 0 2px var(--deep);
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up 0.2s cubic-bezier(.2, .8, .2, 1);
}
.sheet.small { bottom: auto; top: 50%; transform: translateY(-50%); width: calc(100% - 32px); border-bottom: 2px solid var(--line); animation: fade 0.15s; }
.sheet.no-anim { animation: none; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 600px) {
  .sheet { bottom: auto; top: 50%; transform: translateY(-50%); border-bottom: 2px solid var(--line); animation: fade 0.15s; }
}

.sheet-head { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; }
.time-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.time-inputs label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.time-inputs input {
  display: block; width: 100%; margin-top: 4px; padding: 10px;
  background: var(--deep); border: 2px solid var(--line); color: var(--text);
  font: 700 24px var(--display-font); text-align: center;
}
.time-inputs input:focus { outline: none; border-color: var(--gold); }
.chips.quick { margin-top: 10px; }
.preview, .gains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; text-align: center; }
.gains { grid-template-columns: 1fr 1fr; }
.preview > div, .gains > div { background: var(--panel-2); border: 2px solid var(--line); padding: 8px; display: flex; flex-direction: column; }
.preview b, .gains b { font: 700 22px var(--display-font); }
.preview span, .gains span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.preview p { grid-column: 1 / -1; margin: 6px 0; }
.gear { margin-top: 14px; }
.gear-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gear-slot {
  position: relative; display: flex; gap: 8px; align-items: center; text-align: left; min-width: 0;
  background: var(--panel-2); border: 2px solid var(--line); padding: 6px; cursor: pointer;
}
.gear-slot.match { border-color: var(--primary); }
.gear-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; background: var(--deep); }
.gear-icon .sprite { width: 34px; }
.gear-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.gear-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gear-up { position: absolute; top: 2px; right: 5px; color: var(--accent); font-size: 12px; }
.gear-best { margin-top: 8px; min-height: 40px; border-color: var(--primary-line); color: var(--accent); }
@media (max-width: 380px) { .gear-slots { grid-template-columns: 1fr; } }
.boost-list { margin-top: 12px; font-size: 13px; color: var(--accent); }
.big-q { font-size: 18px; }

.roll-stage { min-height: 260px; display: grid; place-items: center; text-align: center; }
.die {
  font-size: 56px; width: 96px; height: 96px; display: grid; place-items: center; margin: 0 auto 12px;
  background: var(--panel-2); border: 3px solid var(--gold-dark);
  animation: shake 0.35s infinite;
}
@keyframes shake {
  0%, 100% { transform: rotate(0) scale(1); }
  25% { transform: rotate(-12deg) scale(1.05); }
  75% { transform: rotate(12deg) scale(0.97); }
}
.result h2 { text-align: center; }
.result h3 { text-align: center; }
.banner { text-align: center; padding: 8px; margin: 10px 0; font-size: 18px; border: 2px solid; animation: pop 0.5s cubic-bezier(.2, 1.6, .4, 1) both; }
.banner.levelup { color: var(--gold); border-color: var(--gold-dark); background: var(--gold-bg); }
.banner.bonus { color: var(--c-divine); border-color: #7a6d2d; background: #24210f; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

.drops { display: flex; flex-direction: column; gap: 8px; }
.drop {
  display: flex; gap: 12px; align-items: center; background: var(--panel-2); border: 2px solid var(--line); padding: 6px 10px;
  animation: drop-in 0.45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.drop .sprite { width: 48px; flex: none; }
.drop.fancy { animation-name: drop-in-fancy; animation-duration: 0.7s; }
.drop.r-border-mythic, .drop.r-border-divine, .drop.r-border-legendary { background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent); }
@keyframes drop-in { from { transform: translateY(12px) scale(0.9); opacity: 0; } }
@keyframes drop-in-fancy {
  0% { transform: scale(0.3) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(2deg); opacity: 1; }
}
.new { display: inline-block; margin-left: 6px; padding: 0 5px; font: 700 11px var(--display-font); background: var(--gold); color: #000; }
.new.pet { background: var(--accent); }

.item-detail { text-align: center; }
.item-detail h2 { margin: 4px 0; }

.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick { display: flex; gap: 12px; align-items: center; text-align: left; background: var(--panel-2); border: 2px solid var(--line); padding: 8px; cursor: pointer; }
.pick.on { border-color: var(--gold); }
.pick .sprite { width: 44px; flex: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%);
  z-index: 60; background: var(--deep); border: 2px solid var(--gold-dark); color: var(--gold);
  padding: 8px 14px; font-family: var(--display-font); animation: fade 0.2s; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- Engagement: streaks, quests, achievements, titles ---------- */
.top-pills { display: flex; gap: 6px; align-items: center; }
.streak-pill {
  display: flex; align-items: center; gap: 4px; padding: 4px 9px; cursor: pointer;
  border: 2px solid #b8541c; background: #2e1a10; color: #ffb35c; font-family: var(--display-font); font-weight: 700;
}
.streak-pill.cold { filter: grayscale(1); opacity: 0.6; }
.streak-pill.at-risk { animation: risk 1.6s ease-in-out infinite; }
@keyframes risk { 50% { border-color: #ff6a3a; box-shadow: 0 0 10px rgba(255, 106, 58, 0.6); } }
.tabbar button { position: relative; font-size: 10px; }
.tab-dot { position: absolute; top: 8px; right: calc(50% - 18px); width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }

.title-line { display: block; margin: -2px auto 0; background: none; border: 0; cursor: pointer; font-family: var(--display-font); font-style: italic; color: var(--gold); font-size: 15px; }
.hero-btns { margin-top: 12px; }
.hero-btns .btn { font-size: 13px; padding: 6px 8px; }

.streak-card { display: flex; gap: 14px; align-items: center; border-color: #b8541c; background: linear-gradient(135deg, #2e1a10, var(--panel) 60%); }
.streak-card .flame { font-size: 46px; animation: flicker 1.8s ease-in-out infinite; }
.streak-card.at-risk { border-color: #ff6a3a; }
@keyframes flicker { 50% { transform: scale(1.08) rotate(-3deg); } }
.streak-big { font-family: var(--display-font); font-size: 28px; font-weight: 700; color: #ffb35c; }
.streak-info .small { display: block; margin-top: 2px; }
.streak-line { text-align: center; color: #ffb35c; font-family: var(--display-font); margin: -6px 0 6px; }

.quest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.quest { display: flex; gap: 10px; align-items: center; background: var(--panel-2); border: 2px solid var(--line); padding: 8px; }
.quest.claimed { border-color: var(--primary); opacity: 0.75; }
.quest-icon { font-size: 24px; flex: none; width: 34px; text-align: center; }
.quest-body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.ach-grid { display: grid; grid-template-columns: 1fr; gap: 6px; margin-bottom: 8px; }
.ach { display: flex; gap: 10px; align-items: center; background: var(--panel-2); border: 2px solid var(--line); padding: 8px; }
.ach.got { border-color: var(--gold-dark); background: linear-gradient(90deg, var(--gold-bg), var(--panel-2)); }
.ach.locked { opacity: 0.7; }
.ach-icon { font-size: 26px; width: 36px; text-align: center; flex: none; }
.ach-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.title-pick:disabled { opacity: 0.5; cursor: default; }
.title-icon { font-size: 22px; width: 32px; text-align: center; }
.card-img { width: 100%; display: block; margin: 4px 0 8px; border: 2px solid var(--line); }

/* result screen: things revealed later on the timeline */
.later { display: none; }
.later.show { display: block; }
.banner.quest { color: var(--accent); border-color: var(--primary); background: #0f2a22; font-size: 15px; }
.banner.achieve, .banner.title-unlock { color: var(--gold); border-color: var(--gold-dark); background: var(--gold-bg); font-size: 15px; }
.banner span { display: block; font-family: system-ui, sans-serif; font-size: 12px; color: var(--muted); margin-top: 2px; }
.banner.milestone { font-size: 24px; padding: 14px 8px; border-width: 3px; box-shadow: 0 0 24px rgba(255, 201, 74, 0.45); animation: pop 0.7s cubic-bezier(.2, 1.6, .4, 1) both, glowpulse 1.4s 0.7s ease-in-out infinite; }
.banner.milestone small { display: block; font-size: 13px; letter-spacing: 0.15em; color: #fff4b0; }
@keyframes glowpulse { 50% { box-shadow: 0 0 40px rgba(255, 201, 74, 0.8); } }

/* ---------- drop reveal ----------
   Common / Uncommon / Rare: quick, quiet pop-in.
   Epic and up: a mystery card charges up in the rarity colour (for --charge),
   then bursts open. Each tier is slower, brighter and bigger than the last. */
.drop { animation: drop-in 0.4s cubic-bezier(.2, 1.4, .4, 1) both; }

.big-drop { position: relative; overflow: hidden; animation: none; min-height: 66px; --c: #a35ae0; --c-rgb: 163, 90, 224; }
.big-drop.rar-legendary { --c: #f0a020; --c-rgb: 240, 160, 32; }
.big-drop.rar-mythic { --c: #e8435a; --c-rgb: 232, 67, 90; }
.big-drop.rar-divine { --c: #fff1a8; --c-rgb: 255, 241, 168; }
.big-drop.pending { display: none; }
.drop-inner { display: flex; gap: 12px; align-items: center; position: relative; z-index: 2; width: 100%; }

/* charging: the item is hidden, an orb of light grows and pulses faster and faster */
.big-drop.charging { border-color: var(--c); background: #0b0d20; animation: card-appear 0.35s ease-out both, charge-shake var(--charge) ease-in both; }
.big-drop.charging .drop-inner { visibility: hidden; }
.mystery-orb { display: none; position: absolute; inset: 0; z-index: 3; place-items: center; pointer-events: none; }
.big-drop.charging .mystery-orb { display: grid; }
.mystery-orb span {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  font: 700 26px var(--display-font); color: #fff;
  background: radial-gradient(circle, #fff 0%, var(--c) 45%, transparent 72%);
  animation: orb-grow var(--charge) ease-in both, orb-pulse 0.5s ease-in-out infinite;
}
.big-drop.rar-legendary.charging .mystery-orb span { animation: orb-grow var(--charge) ease-in both, orb-pulse 0.35s ease-in-out infinite; }
.big-drop.rar-mythic.charging .mystery-orb span,
.big-drop.rar-divine.charging .mystery-orb span { animation: orb-grow var(--charge) ease-in both, orb-pulse 0.22s ease-in-out infinite; }
/* Mythic and Divine darken everything around the card while charging */
.big-drop.rar-mythic.charging, .big-drop.rar-divine.charging { overflow: visible; z-index: 4; box-shadow: 0 0 0 200vmax rgba(3, 4, 14, 0.72), 0 0 30px rgba(var(--c-rgb), 0.8); }
.big-drop.rar-divine.charging { box-shadow: 0 0 0 200vmax rgba(3, 4, 14, 0.88), 0 0 50px rgba(var(--c-rgb), 0.9); }

@keyframes card-appear { from { opacity: 0; transform: scale(0.85); } }
@keyframes charge-shake {
  0%, 60% { transform: translate(0, 0); }
  70% { transform: translate(-1px, 1px); } 80% { transform: translate(2px, -1px); }
  90% { transform: translate(-2px, 2px); } 100% { transform: translate(3px, -2px); }
}
@keyframes orb-grow { from { transform: scale(0.25); filter: brightness(0.7); } to { transform: scale(1.35); filter: brightness(1.8); } }
@keyframes orb-pulse { 50% { opacity: 0.65; } }

/* revealed: bursts open, keeps a glow; Legendary+ get rotating light rays behind */
.big-drop.revealed { border: 3px solid var(--c); background: linear-gradient(90deg, rgba(var(--c-rgb), 0.25), var(--panel-2)); }
.big-drop.rar-epic.revealed { animation: burst-epic 0.8s cubic-bezier(.2, 1.5, .4, 1) both, glow-epic 2.4s 0.8s ease-in-out infinite; }
.big-drop.rar-legendary.revealed { animation: burst-big 1.1s cubic-bezier(.2, 1.5, .4, 1) both, glow-pulse 2s 1.1s ease-in-out infinite; }
.big-drop.rar-mythic.revealed { animation: burst-big 1.4s cubic-bezier(.2, 1.5, .4, 1) both, glow-pulse 1.6s 1.4s ease-in-out infinite; }
.big-drop.rar-divine.revealed { animation: burst-divine 1.9s cubic-bezier(.2, 1.4, .4, 1) both, glow-pulse 1.4s 1.9s ease-in-out infinite; }
.big-drop.revealed .drop-text > div:first-child { font-family: var(--display-font); font-weight: 700; font-size: 16px; }
.big-drop.rar-mythic.revealed .drop-text > div:first-child, .big-drop.rar-divine.revealed .drop-text > div:first-child { font-size: 18px; }
/* a light sweep across Epic+ cards as they open */
.big-drop.revealed::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  background-size: 250% 100%; animation: sweep 1.1s 0.15s ease-out both;
}
.rays { display: none; position: absolute; left: 34px; top: 50%; width: 300px; height: 300px; margin: -150px 0 0 -150px; z-index: 0; pointer-events: none;
  background: repeating-conic-gradient(rgba(var(--c-rgb), 0.38) 0deg 10deg, transparent 10deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 68%); mask: radial-gradient(circle, #000 15%, transparent 68%); }
.big-drop.revealed .rays { display: block; animation: rays-in 0.9s ease-out both, spin 9s linear infinite; }
.big-drop.rar-divine.revealed .rays { width: 440px; height: 440px; margin: -220px 0 0 -220px; animation: rays-in 1.4s ease-out both, spin 6s linear infinite; }

@keyframes burst-epic { 0% { transform: scale(0.6); filter: brightness(3); } 60% { transform: scale(1.08); } 100% { filter: brightness(1); } }
@keyframes burst-big {
  0% { transform: scale(0.3) rotate(-10deg); filter: brightness(4); }
  50% { transform: scale(1.18) rotate(3deg); filter: brightness(1.8); }
  75% { transform: scale(0.97) rotate(-1deg); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes burst-divine {
  0% { transform: scale(0.1); filter: brightness(6) saturate(0); }
  35% { transform: scale(1.3); filter: brightness(3); }
  60% { transform: scale(0.94); }
  80% { transform: scale(1.04); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes glow-epic { 50% { box-shadow: 0 0 18px rgba(var(--c-rgb), 0.6); } }
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 0 18px rgba(var(--c-rgb), 0.55); } 50% { box-shadow: 0 0 38px rgba(var(--c-rgb), 0.95); } }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes rays-in { from { opacity: 0; transform: scale(0.3); } }
@keyframes spin { to { rotate: 360deg; } }

.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 70; }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 65; animation: flashfade 1.1s ease-out forwards; }
@keyframes flashfade { from { opacity: 1; } to { opacity: 0; } }
.shake { animation: shake 0.45s; }
.shake-strong { animation: shake-strong 0.65s; }
@keyframes shake { 20%, 60% { transform: translate(-4px, 2px); } 40%, 80% { transform: translate(4px, -2px); } }
@keyframes shake-strong { 10%, 50%, 90% { transform: translate(-9px, 4px) rotate(-1deg); } 30%, 70% { transform: translate(9px, -4px) rotate(1deg); } }
.skip-hint { position: sticky; top: 0; z-index: 6; text-align: center; font-size: 12px; color: var(--muted); margin: -8px 0 4px; animation: fade 0.4s 1.5s both; }
.result.skipped .drop, .result.skipped .banner { animation-duration: 0.01ms !important; animation-delay: 0ms !important; }
.result.skipped .big-drop.revealed { animation: none !important; box-shadow: 0 0 22px rgba(var(--c-rgb), 0.7); }
.result.skipped .big-drop.revealed::after { display: none; }
.result.skipped .big-drop.revealed .rays { animation: spin 9s linear infinite !important; }
.drop-text { min-width: 0; overflow-wrap: anywhere; }

/* ---------- pixel-art icons ---------- */
.ui-ic, .skill-ic, .ach-ic { image-rendering: pixelated; display: inline-block; vertical-align: middle; }
.ui-ic { width: 26px; height: 26px; }
.ui-ic.tiny { width: 18px; height: 18px; margin: -3px 1px 0; }
.ui-ic.btn-ic { width: 22px; height: 22px; margin: -3px 4px 0 -2px; }
.ui-ic.ban-ic { width: 24px; height: 24px; margin: -4px 4px 0 0; }
.ui-ic.pill-ic { width: 20px; height: 20px; margin: -2px 0 0; }
.ui-ic.big-flame { width: 64px; height: 64px; }
.ui-ic.tab-ic { width: 30px; height: 30px; }
.tabbar button span { filter: grayscale(0.75) brightness(0.7); display: block; line-height: 0; }
.tabbar button.on span { filter: none; }
.coin-pill { gap: 4px; padding: 3px 9px; }
.streak-pill { gap: 2px; padding: 3px 8px 3px 5px; }
.skill-icon { background: none !important; border: 0 !important; width: 48px; height: 48px; }
.skill-icon .skill-ic { width: 48px; height: 48px; }
.skill-icon.big, .skill-icon.big .skill-ic { width: 60px; height: 60px; }
.li-icon .skill-ic { width: 34px; height: 34px; }
.skill-ic.chip-ic { width: 22px; height: 22px; margin: -3px 2px 0 -3px; }
.quest-icon .ui-ic, .quest-icon .skill-ic { width: 32px; height: 32px; }
.slot-empty .ui-ic { width: 30px; height: 30px; opacity: 0.45; }
.gear-icon .slot-empty .ui-ic { width: 26px; height: 26px; }
.ach-icon { width: 52px; }
.ach-icon .ach-ic { width: 52px; height: 52px; }
.banner .ach-ic { width: 40px; height: 40px; margin: -6px 6px -6px 0; }
.title-icon .ui-ic { width: 28px; height: 28px; }
.die .skill-ic { width: 72px; height: 72px; }
.die { font-size: 0; }
.name .ui-ic.tiny { opacity: 0.6; }
.badge .ui-ic, .type-dot .ui-ic { width: 16px; height: 16px; margin: 0; }
/* tier-up moment on milestone level-ups: old icon → new icon */
.tier-up { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; }
.tier-up .skill-ic { width: 64px; height: 64px; }
.tier-up b { font-size: 26px; color: var(--gold); }
.tier-up .old { opacity: 0.55; filter: grayscale(0.5); }
.tier-up .new { animation: tier-pop 1.2s 0.3s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes tier-pop { 0% { transform: scale(0.2) rotate(-20deg); filter: brightness(4); } 60% { transform: scale(1.25) rotate(4deg); filter: brightness(1.8); } 100% { transform: scale(1); filter: brightness(1); } }
.btn > .muted { margin-left: 5px; }


/* ---------- Dungeon ---------- */
.d-intro { text-align: center; }
.d-tower-art { display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; margin-bottom: 6px; }
.d-tower-art img { width: 56px; height: 56px; image-rendering: pixelated; }
.d-red { color: #ff6a5a !important; font-weight: 700; }
.d-go { font-size: 16px; min-height: 52px; }
/* hub: compact header */
.d-hud { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; }
.d-lv { width: 46px; height: 46px; flex: none; border-radius: 50%; position: relative; background: conic-gradient(var(--accent) var(--p), var(--deep) 0); }
.d-lv b { position: absolute; inset: 4px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font: 700 18px var(--display-font); color: var(--gold); }
.d-hud-mid { flex: 1; min-width: 0; line-height: 1.25; }
.d-hud-t { font: 700 13px var(--display-font); }
.d-hud-s { font-size: 11px; color: var(--muted); }
.d-chip { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--deep); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--accent); }
.d-chip span { opacity: 0.6; }
.d-chip.red { color: #ff7a6a; border-color: #6a2a2a; }
/* hub: the tower */
.d-tower-wrap { overflow-x: hidden; margin: 0 -16px; padding: 10px 0 170px; }
.d-tower { width: 236px; margin: 0 auto; display: flex; flex-direction: column; }
.d-tower-hint { text-align: center; margin: 14px 24px 0; }
.d-spire { height: 96px; position: relative; }
.d-roof { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); border-left: 70px solid transparent; border-right: 70px solid transparent; border-bottom: 80px solid #3a1414; filter: drop-shadow(0 -2px 0 #ff6a2a); }
.d-flag { position: absolute; left: 50%; bottom: 78px; width: 3px; height: 26px; background: #ccc; }
.d-flag::after { content: ''; position: absolute; left: 3px; top: 0; width: 18px; height: 11px; background: var(--danger); animation: d-wave 1.2s steps(2) infinite; }
@keyframes d-wave { 50% { transform: skewY(8deg); } }
.d-seg { position: relative; border-left: 4px solid var(--edge); border-right: 4px solid var(--edge); background-size: 48px 24px; image-rendering: pixelated; }
.d-crenel { height: 14px; margin: 0 -10px; background: linear-gradient(90deg, var(--edge) 0 18px, transparent 18px 30px) repeat-x; background-size: 30px 14px; border-bottom: 6px solid var(--edge); }
.d-seg-name { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); white-space: nowrap; font: 700 11px var(--display-font); color: #fff; background: rgba(0, 0, 0, 0.55); padding: 2px 8px; border-radius: 6px; z-index: 2; }
.d-tfloors { display: flex; flex-direction: column-reverse; padding: 40px 0 6px; }
.d-tfl { height: 44px; display: flex; align-items: center; }
.d-tfl:nth-child(even) { flex-direction: row-reverse; }
.d-win { width: 34px; height: 36px; margin: 0 22px; padding: 0; border-radius: 17px 17px 3px 3px; background: #07070f; border: 3px solid rgba(0, 0, 0, 0.6); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08); display: grid; place-items: end center; cursor: pointer; }
.d-win:disabled { cursor: default; }
.d-win.open { background: #1e2450; }
.d-win.lit { background: radial-gradient(circle at 50% 70%, #ffe680, #ffb02e 55%, #b8661c); box-shadow: 0 0 12px rgba(255, 190, 60, 0.55); }
.d-win.next { background: radial-gradient(circle at 50% 70%, #3a4a8a, #141a3a); border-color: var(--gold); animation: d-pulse 1.4s ease-in-out infinite; }
@keyframes d-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(255, 201, 74, 0.35), 0 0 14px rgba(255, 201, 74, 0.5); } 50% { box-shadow: 0 0 0 5px rgba(255, 201, 74, 0.15), 0 0 22px rgba(255, 201, 74, 0.85); } }
.d-win img { width: 26px; image-rendering: pixelated; margin-bottom: 1px; }
.d-plaque { font: 700 12px var(--display-font); color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 0 #000; min-width: 22px; text-align: center; }
.d-stair { flex: 1; height: 4px; margin-top: 30px; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0 6px, transparent 6px 10px); }
.d-tfl.boss { height: 92px; flex-direction: column !important; justify-content: center; }
.d-balcony { position: relative; width: 120px; height: 64px; padding: 0; border-radius: 60px 60px 4px 4px; background: radial-gradient(circle at 50% 80%, var(--aura), #0a0a14 70%); border: 4px solid rgba(0, 0, 0, 0.6); display: flex; align-items: flex-end; justify-content: center; cursor: pointer; }
.d-balcony:disabled { cursor: default; }
.d-balcony img { width: 72px; margin-bottom: -4px; image-rendering: pixelated; filter: drop-shadow(0 0 6px var(--aura)); }
.d-balcony .d-hero { width: 26px; position: absolute; left: 6px; bottom: 0; margin: 0; filter: none; }
.d-balcony.here { border-color: var(--gold); animation: d-pulse 1.4s ease-in-out infinite; }
.d-balcony.dead img:first-child { filter: grayscale(1) brightness(0.5); }
.d-balcony.dead::after { content: 'DEFEATED'; position: absolute; top: 24px; font: 700 10px var(--display-font); color: var(--accent); background: rgba(0, 0, 0, 0.7); padding: 1px 6px; border-radius: 4px; }
.d-ledge { width: 150px; height: 8px; margin-top: -2px; background: var(--edge); border-radius: 2px; }
.d-seg.locked .d-tfloors { height: 120px; overflow: hidden; }
.d-seg.locked .d-tfloors, .d-seg.locked .d-crenel { filter: brightness(0.35) saturate(0.3); }
.d-fog { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; background: linear-gradient(transparent, rgba(10, 10, 30, 0.75) 30%, rgba(10, 10, 30, 0.75) 70%, transparent); }
.d-fog img { width: 36px; image-rendering: pixelated; }
.d-fog span { color: var(--muted); }
.d-ground { height: 46px; margin: 0 -60px; background: linear-gradient(#2e4a22 0 8px, #3a2a1a 8px); border-top: 2px solid #4a7a32; display: flex; justify-content: center; }
.d-door { width: 46px; height: 54px; margin-top: -54px; background: #3a2412; border: 4px solid #1a0e06; border-radius: 23px 23px 0 0; }
/* hub: pinned action bar above the tab bar */
.d-bar { position: fixed; left: 0; right: 0; z-index: 9; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 18px 12px 8px; background: linear-gradient(transparent, var(--bg) 30%); }
.d-bar-row { max-width: 616px; margin: 0 auto; display: flex; gap: 6px; align-items: stretch; }
.d-hubbtn { flex: none; width: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px 0 3px; background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px; color: var(--text); font-size: 10px; font-weight: 700; }
.d-hubbtn img { width: 26px; height: 26px; image-rendering: pixelated; }
.d-bar .d-go { flex: 1; margin: 0; min-width: 0; padding: 6px 8px; font-size: 14px; line-height: 1.15; }
.d-back { min-height: 34px; padding: 4px 10px; margin-bottom: 8px; }
.d-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.d-stats b { color: var(--text); }
.d-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.d-slot { display: flex; gap: 8px; align-items: center; text-align: left; background: var(--panel-2); border: 2px solid var(--line); padding: 6px; min-width: 0; cursor: pointer; }
.d-slot:disabled { cursor: default; }
.d-slot-icon { flex: none; width: 42px; height: 42px; display: grid; place-items: center; background: var(--deep); }
.d-slot-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.d-gear { width: 50px; height: 50px; image-rendering: pixelated; flex: none; }
.d-gear.xl { width: 150px; height: 150px; margin: 0 auto 6px; display: block; }
.plus { color: var(--accent); }
.d-moves { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.d-moves li { background: var(--panel-2); border: 2px solid var(--line); padding: 6px 8px; }
.d-moves.left { text-align: left; }
.d-inv-list, .d-shop { display: flex; flex-direction: column; gap: 6px; }
.d-inv, .d-shop-row { display: flex; gap: 8px; align-items: center; text-align: left; background: var(--panel-2); border: 2px solid var(--line); padding: 6px; cursor: pointer; }
.d-shop-row { cursor: default; }
.d-shop-row .btn { min-height: 36px; padding: 4px 10px; }
.d-inv-text { flex: 1; min-width: 0; line-height: 1.3; }
.d-potion { width: 36px; text-align: center; font-size: 22px; color: #e8435a; }
@media (max-width: 380px) { .d-slots { grid-template-columns: 1fr; } }

/* battle */
#d-battle { position: fixed; inset: 0; z-index: 45; display: none; flex-direction: column; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 8px) 10px calc(env(safe-area-inset-bottom) + 10px); }
#d-battle.open { display: flex; }
.d-bg { position: fixed; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 30%, #2a2f55, #090a18 75%); }
.d-bg.sec-1 { background: radial-gradient(circle at 50% 30%, #2f4a2a, #0b120a 75%); }
.d-bg.sec-2 { background: radial-gradient(circle at 50% 30%, #3a2f55, #0d0a18 75%); }
.d-bg.sec-3 { background: radial-gradient(circle at 50% 30%, #4a3a2a, #120d0a 75%); }
.d-bg.sec-4 { background: radial-gradient(circle at 50% 30%, #2a4a6a, #081220 75%); }
.d-bg.sec-5 { background: radial-gradient(circle at 50% 30%, #5a1a10, #140505 75%); }
.d-bg.dark { filter: brightness(0.5) saturate(0.5); }
.d-top { display: flex; justify-content: space-between; align-items: center; font: 700 14px var(--display-font); color: var(--gold); gap: 8px; }
.d-flee { background: none; border: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 3px 8px; cursor: pointer; }
.d-enemies { display: flex; justify-content: center; gap: 6px; margin: 12px 0 6px; flex-wrap: wrap; }
.d-enemy { position: relative; flex: 1 1 0; max-width: 170px; min-width: 96px; background: rgba(10, 11, 24, 0.55); border: 2px solid transparent; padding: 6px 4px; cursor: pointer; }
.d-enemy.targeted { border-color: var(--gold); }
.d-enemy.dead { opacity: 0.25; filter: grayscale(1); pointer-events: none; }
.d-enemy.boss { max-width: 260px; flex-basis: 100%; }
.d-enemy-cv { width: 88px; height: 88px; image-rendering: pixelated; display: block; margin: 0 auto; }
.d-enemy.boss .d-enemy-cv { width: 150px; height: 150px; }
.d-ename { font: 700 13px var(--display-font); text-align: center; }
.d-hpbar { height: 10px; background: #1a0a0a; border: 2px solid #000; margin: 3px 0 1px; }
.d-hpbar span { display: block; height: 100%; background: linear-gradient(#ff6a5a, #c8302a); transition: width 0.3s; }
.d-hpbar.me span { background: linear-gradient(var(--bar-1), var(--bar-2)); }
.d-hptext { font-size: 11px; color: var(--muted); text-align: center; }
.d-player .d-hptext { text-align: left; }
.d-sts { display: inline-flex; flex-wrap: wrap; gap: 3px; justify-content: center; min-height: 4px; }
.d-st { font-size: 10px; text-transform: uppercase; padding: 0 4px; border: 1px solid; border-radius: 2px; }
.st-bleed { color: #ff5a5a; } .st-burn { color: #ff9a3a; } .st-poison { color: #8ae05a; } .st-freeze { color: #9fd3ff; } .st-slow { color: #c8a0ff; } .st-ward { color: #ffd84a; }
.d-tele { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #5a0a0a; border: 2px solid #ff4a3a; color: #ffd0c8; font: 700 11px var(--display-font); padding: 1px 6px; animation: risk 0.9s ease-in-out infinite; z-index: 2; }
.d-log { min-height: 70px; background: rgba(5, 6, 16, 0.7); border: 2px solid var(--line); padding: 6px 8px; font-size: 13px; margin: 4px 0 8px; }
.d-log div:last-child { color: var(--text); }
.d-log div { color: var(--muted); }
.d-player { position: relative; background: rgba(10, 11, 24, 0.75); border: 2px solid var(--line); padding: 8px; margin-top: auto; }
.d-pname { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.d-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.d-act { position: relative; flex-direction: column; align-items: flex-start; text-align: left; min-height: 54px; padding: 6px 8px; gap: 1px; }
.d-act .small { color: var(--muted); }
.d-act.sig { border-color: var(--c-epic); }
.d-eff { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.d-eff.good { color: var(--accent); } .d-eff.bad { color: #ff8a7a; }
.d-pop { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font: 700 20px var(--display-font); color: #fff; text-shadow: 2px 2px 0 #000; pointer-events: none; animation: dpop 1.1s ease-out forwards; z-index: 3; white-space: nowrap; }
.d-pop.crit { color: var(--gold); font-size: 26px; }
.d-pop.eff { color: #8affc0; }
.d-pop.heal { color: var(--accent); }
.d-pop.st-bleed { color: #ff5a5a; font-size: 15px; } .d-pop.st-burn { color: #ff9a3a; font-size: 15px; } .d-pop.st-poison { color: #8ae05a; font-size: 15px; }
@keyframes dpop { 0% { opacity: 0; transform: translate(-50%, 6px) scale(0.6); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -38px) scale(1); } }
.hit { animation: dhit 0.3s; }
@keyframes dhit { 25% { transform: translateX(-4px); filter: brightness(2) saturate(0.4); } 60% { transform: translateX(3px); } }
.d-result { margin: auto 0; background: rgba(10, 11, 24, 0.85); border: 2px solid var(--line); padding: 16px; }
.d-result h2 { text-align: center; }
.d-gains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; margin: 8px 0; }
.d-gains > div { background: var(--panel-2); border: 2px solid var(--line); padding: 6px; display: flex; flex-direction: column; }
.d-gains b { font: 700 20px var(--display-font); }
.d-gains span { font-size: 11px; color: var(--muted); }
.d-fall { position: relative; height: 200px; overflow: hidden; border: 2px solid var(--line); background: linear-gradient(#1a1a2a, #05050a); margin-bottom: 10px; }
.d-fall-floors { position: absolute; left: 0; right: 0; top: 0; animation: dscroll 2.4s cubic-bezier(.5, 0, .7, 1) forwards; }
.d-fall-floors div { height: 60px; border-bottom: 2px dashed #2f3670; font: 700 20px var(--display-font); color: var(--muted); padding: 6px 12px; }
@keyframes dscroll { to { transform: translateY(calc(-60px * (var(--fall-n, 3) - 3))); } }
.d-faller { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); animation: dtumble 0.6s linear infinite; }
.d-faller-img { width: 56px; image-rendering: pixelated; }
@keyframes dtumble { 25% { transform: translateX(-50%) rotate(90deg); } 50% { transform: translateX(-50%) rotate(180deg); } 75% { transform: translateX(-50%) rotate(270deg); } 100% { transform: translateX(-50%) rotate(360deg); } }
/* six tabs: keep labels on one line on narrow phones */
.tabbar button { font-size: 9.5px; letter-spacing: -0.01em; padding: 0 1px; }
.ui-ic.tab-ic { width: 27px; height: 27px; }

/* Dungeon: fold-out section lists (Backpack, Blacksmith) */
.d-folds { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.d-fold { border: 2px solid var(--line); border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.d-fold.open { border-color: var(--gold-dark); }
.d-fold.locked { opacity: 0.5; }
.d-fold-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; }
.d-fold-head:disabled { cursor: default; }
.d-fold-icon img { width: 36px; height: 36px; image-rendering: pixelated; display: block; }
.d-fold-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.d-fold-title b { font-family: var(--display-font); font-size: 14px; }
.d-fold-count { font-weight: 700; color: var(--muted); font-size: 13px; }
.d-fold-chev { font-size: 22px; color: var(--gold); transition: transform 0.15s; width: 14px; text-align: center; }
.d-fold.open .d-fold-chev { transform: rotate(90deg); }
.d-fold-body { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; }
.d-fold-h { margin: 6px 2px 0; font: 700 12px var(--display-font); color: var(--gold); letter-spacing: 0.5px; }
.d-gold { color: var(--gold); }
.d-exclusive { background: linear-gradient(90deg, rgba(255, 201, 74, 0.1), transparent 60%), var(--panel-2); }
.d-seg-toggle { display: flex; gap: 0; margin: 4px 0 2px; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; }
.d-seg-toggle button { flex: 1; padding: 9px 0; background: var(--panel-2); border: 0; color: var(--muted); font: 700 14px var(--display-font); cursor: pointer; }
.d-seg-toggle button.on { background: var(--gold-bg); color: var(--gold); }

/* Dungeon: win chance */
.d-good { color: var(--accent); }
.d-odds { max-width: 616px; margin: 0 auto 6px; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 2px solid var(--line); border-left-width: 6px; font-size: 13px; line-height: 1.3; }
.d-odds-top b { font: 700 17px var(--display-font); }
.d-odds-word { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-left: 4px; }
.d-odds-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.d-odds-sub b { color: var(--text); }
.d-odds-sub b.d-good { color: var(--accent); }
.d-odds-sub b.d-red { color: #ff7a6a; }
.odds-good { border-left-color: #3ee0a0; } .odds-good .d-odds-top b, .odds-good .d-odds-word { color: #3ee0a0; }
.odds-ok { border-left-color: #ffc94a; } .odds-ok .d-odds-top b, .odds-ok .d-odds-word { color: #ffc94a; }
.odds-risky { border-left-color: #ff9a3a; } .odds-risky .d-odds-top b, .odds-risky .d-odds-word { color: #ff9a3a; }
.odds-bad { border-left-color: #ff5a4a; } .odds-bad .d-odds-top b, .odds-bad .d-odds-word { color: #ff5a4a; }
.d-stats + .d-odds { margin: 8px 0 4px; }
.d-odds-boss { font-size: 12px; margin-top: 1px; }
.d-odds-boss b { font-size: 13px; }
.d-odds-boss .odds-good { color: #3ee0a0; } .d-odds-boss .odds-ok { color: #ffc94a; } .d-odds-boss .odds-risky { color: #ff9a3a; } .d-odds-boss .odds-bad { color: #ff5a4a; }

/* ---------- Dungeon Camp: gear, bag, forge, shop, potions ---------- */
.r-common-bg { --rc: #6a6a66; --rcb: rgba(255, 255, 255, 0.05); }
.r-uncommon-bg { --rc: #4a9a46; --rcb: rgba(95, 191, 90, 0.18); }
.r-rare-bg { --rc: #3a78c8; --rcb: rgba(74, 144, 226, 0.22); }
.r-epic-bg { --rc: #8a4ac8; --rcb: rgba(163, 90, 224, 0.26); }
.r-legendary-bg { --rc: #d88a10; --rcb: rgba(240, 160, 32, 0.3); }
.r-mythic-bg { --rc: #d0384e; --rcb: rgba(232, 67, 90, 0.32); }
.r-divine-bg { --rc: #e8d890; --rcb: rgba(255, 241, 168, 0.35); }
.d-camp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.d-camp-head h2 { margin: 0; }
.d-camp-head .d-back { margin: 0; }
.d-ctabs { display: flex; position: sticky; top: calc(env(safe-area-inset-top) + 56px); z-index: 5; margin: 0 -16px 12px; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); }
.d-ctabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 5px; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.d-ctabs button img { width: 26px; height: 26px; image-rendering: pixelated; }
.d-ctabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
/* paperdoll */
.d-doll { display: grid; grid-template-columns: minmax(0, 70px) 1fr minmax(0, 70px); gap: 8px; align-items: center; }
.d-dcol { display: flex; flex-direction: column; gap: 8px; }
.d-dslot, .d-tile { position: relative; width: 100%; aspect-ratio: 1; padding: 0; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, var(--rcb, rgba(255, 255, 255, 0.04)), rgba(0, 0, 0, 0.5) 78%); border: 2px solid var(--rc, var(--line)); }
.d-dslot img, .d-tile img { width: 94%; image-rendering: pixelated; }
.d-dslot.empty, .d-tile.empty { cursor: default; opacity: 0.4; border-style: dashed; }
.d-dlbl { position: absolute; bottom: -1px; left: 0; right: 0; font-size: 8.5px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--muted); background: rgba(0, 0, 0, 0.6); border-radius: 0 0 8px 8px; }
.d-dplus, .d-tup { position: absolute; top: 2px; right: 4px; font: 700 11px var(--display-font); color: var(--accent); text-shadow: 1px 1px 0 #000; }
.d-dhero { text-align: center; }
.d-dhero img { width: 100%; max-width: 124px; image-rendering: pixelated; }
.d-dpow { font: 700 23px var(--display-font); color: var(--gold); line-height: 1.1; }
.d-dpowl { font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0 10px; }
.d-chips span { background: var(--deep); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--muted); }
.d-chips b { color: var(--text); }
.d-camp .d-odds { margin: 0 0 4px; }
.d-bestall { margin-top: 10px; }
/* bag */
.d-flt { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.d-flt::-webkit-scrollbar { display: none; }
.d-flt button { flex: none; display: flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.d-flt button img { width: 18px; height: 18px; image-rendering: pixelated; }
.d-flt button.on { color: var(--gold); border-color: var(--gold); background: var(--gold-bg); }
.d-cap { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); margin: 6px 2px 4px; }
.d-cap span:last-child { text-align: right; }
.d-bag { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.d-te { position: absolute; top: 2px; left: 3px; font: 700 9px var(--display-font); background: var(--gold); color: #000; padding: 0 3px; border-radius: 3px; }
.d-tn { position: absolute; bottom: 1px; right: 3px; font: 700 10px var(--display-font); color: #fff; text-shadow: 1px 1px 0 #000; }
/* forge */
.d-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.d-strip::-webkit-scrollbar { display: none; }
.d-strip .d-tile { flex: none; width: 58px; }
.d-strip .d-tile.sel { box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(255, 201, 74, 0.6); }
.d-anvil { position: relative; overflow: hidden; margin-top: 6px; padding: 12px; text-align: center; border-radius: 14px; border: 2px solid var(--line); background: radial-gradient(circle at 50% 40%, rgba(255, 140, 40, 0.2), transparent 60%), var(--panel); }
.d-anvil canvas { width: 160px; height: 160px; image-rendering: pixelated; }
.d-anvil-lv { font: 700 18px var(--display-font); margin-top: 2px; }
.d-pips { display: flex; justify-content: center; gap: 3px; margin: 8px 0; }
.d-pips i { width: 16px; height: 6px; border-radius: 2px; background: var(--deep); border: 1px solid var(--line); }
.d-pips i.on { background: var(--gold); border-color: var(--gold-dark); box-shadow: 0 0 6px rgba(255, 201, 74, 0.6); }
.d-pips i.nx { background: rgba(255, 201, 74, 0.35); animation: d-blink 1s infinite; }
@keyframes d-blink { 50% { opacity: 0.3; } }
.d-diff { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 13px; }
.d-diff b { color: var(--accent); }
.d-cost { display: flex; justify-content: center; gap: 8px; margin: 8px 0 2px; font-size: 12px; }
.d-cost span { background: var(--deep); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.d-cost .bad { color: #ff7a6a; border-color: #6a2a2a; }
.d-spark { position: absolute; left: 50%; top: 40%; width: 4px; height: 4px; background: #ffd27a; box-shadow: 0 0 6px #ff8a2e; pointer-events: none; animation: d-spk 0.7s ease-out forwards; }
@keyframes d-spk { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
/* shop */
.d-smith { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.d-smith img { width: 56px; image-rendering: pixelated; flex: none; }
.d-bubble { position: relative; flex: 1; padding: 8px 10px; border-radius: 12px; background: #f4ecd8; color: #2a2010; font-size: 13px; font-style: italic; }
.d-bubble::before { content: ""; position: absolute; left: -8px; top: 16px; border: 8px solid transparent; border-right-color: #f4ecd8; border-left: 0; }
.d-sh { margin: 12px 0 6px; font: 700 13px var(--display-font); color: var(--gold); letter-spacing: 0.5px; }
.d-feat { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px; scrollbar-width: none; }
.d-feat::-webkit-scrollbar { display: none; }
.d-fcard { flex: none; width: 72%; max-width: 260px; scroll-snap-align: center; padding: 10px; text-align: center; border-radius: 14px; border: 2px solid var(--rc); background: radial-gradient(circle at 50% 30%, var(--rcb), #07060c 80%); }
.d-fart, .d-sart { background: none; border: 0; padding: 0; cursor: pointer; display: block; margin: 0 auto; }
.d-fart canvas { width: 140px; height: 140px; image-rendering: pixelated; }
.d-fname { font: 700 15px var(--display-font); }
.d-fpass { min-height: 32px; margin: 3px 0 6px; font-size: 11px; color: var(--accent); }
.d-price { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--gold-dark); background: var(--gold-bg); color: var(--gold); font-weight: 700; font-size: 13px; cursor: pointer; }
.d-coin { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -3px; margin-right: 3px; }
.d-price.no, .d-price:disabled { opacity: 0.45; cursor: default; }
.d-stock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.d-scard { padding: 6px 4px 8px; text-align: center; border-radius: 10px; border: 2px solid var(--rc); background: radial-gradient(circle at 50% 30%, var(--rcb), rgba(0, 0, 0, 0.5) 80%); }
.d-sart img { width: 72px; image-rendering: pixelated; }
.d-sname { min-height: 28px; margin-bottom: 4px; font-size: 11.5px; font-weight: 700; line-height: 1.2; }
.d-scard .d-price { font-size: 11px; padding: 2px 9px; }
/* potions */
.d-pack { display: flex; justify-content: center; gap: 8px; margin: 8px 0 14px; }
.d-pack div { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 10px; border: 2px dashed var(--line); color: var(--muted); font-size: 24px; }
.d-pack div.f { border-style: solid; border-color: currentColor; background: rgba(255, 255, 255, 0.04); }
.d-shelf { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.d-pcard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; text-align: center; border-radius: 12px; border: 2px solid var(--line); background: var(--panel); }
.d-pic { font-size: 32px; line-height: 1.1; color: var(--pc); filter: drop-shadow(0 0 6px var(--pc)); }
.d-pbuy { display: flex; gap: 6px; margin-top: 6px; }
/* item sheet */
.d-sheet h2 { margin: 0 0 2px; font-size: 18px; }
.d-sheet-top { display: flex; gap: 12px; align-items: center; }
.d-sheet-art { flex: none; width: 112px; height: 112px; display: grid; place-items: center; border-radius: 12px; border: 2px solid var(--rc); background: radial-gradient(circle at 50% 35%, var(--rcb), #07060c 80%); }
.d-sheet-art canvas { width: 106px; height: 106px; image-rendering: pixelated; }
.d-cmp { width: 100%; border-collapse: collapse; margin: 10px 0 4px; font-size: 13px; }
.d-cmp td { padding: 3px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.d-cmp td:nth-child(n+2) { text-align: right; }
.d-sheet-acts { display: flex; gap: 8px; }
.d-sheet-acts .btn { flex: 1; }



/* equipped items: a gold ring instead of a badge */
.d-tile.worn { box-shadow: 0 0 0 2px #f6d27a, 0 0 0 4px rgba(0, 0, 0, 0.55); }
.d-strip .d-tile.worn.sel, .d-strip .d-tile.sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold); }
.d-bag { padding: 3px; }
/* matchup line (no win percentages) */
.d-match { max-width: 616px; margin: 0 auto 6px; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.35; }
.d-match b { color: var(--text); }
.d-match b.d-good { color: #7ae0a0; } .d-match b.d-red { color: #ff7a6a; }
.d-camp .d-match { margin: 0 0 4px; }
/* Crypts XP bar */
.d-hud-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.d-xpbar { height: 10px; margin-top: 5px; }
.d-bestall { margin-top: 10px; min-height: 38px; padding: 6px 18px; font-size: 14px; }

/* ==================== Realms: rustic, and each area has its own surroundings ====================
   Character = journal on a leather desk, Skills = library, Quests = cork notice board, Collection = trophy hall,
   Dungeon = stone keep under a blood moon, Camp: Gear = war tent, Bag = satchel, Forge, Shop = merchant stall, Potions = alchemist. */
body::before, body::after { display: none !important; }
.panel, .sheet { background-image: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.panel > h2::after { display: none; }
.topbar, .tabbar { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.tabbar button.on::before { display: none; }
.brand, h2, .tabbar button.on { text-shadow: none; }
.btn, .btn.primary { box-shadow: none; text-shadow: none; }
.bar > span { box-shadow: none; }
.coin-pill, .streak-pill { box-shadow: none; }

:root {
  --display-font: 'New Rocker', Georgia, serif;
  --body-font: 'Alegreya Sans', system-ui, sans-serif;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .12 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --planks: repeating-linear-gradient(90deg, transparent 0 46px, rgba(0, 0, 0, 0.45) 46px 48px), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 9px, rgba(0, 0, 0, 0.06) 9px 11px, transparent 11px 23px);
  --stone: repeating-linear-gradient(0deg, #0a0908 0 2px, transparent 2px 40px), repeating-linear-gradient(90deg, #0a0908 0 2px, transparent 2px 80px);
}
body {
  --bg: #1e1c1a; --panel: #2a2724; --panel-2: #36322e; --line: #4a4540; --deep: #161412;
  --text: #e6dcc4; --muted: #a89c86; --gold: #e09a3a; --gold-dark: #8a5a1a; --gold-bg: #2e2216;
  --accent: #c8b06a; --primary: #7a1e16; --primary-line: #c8a24a; --bar-1: #d8743a; --bar-2: #a8481a;
  --area-bg: var(--noise), var(--stone), #1e1c1a;
  --area-panel: var(--noise), #2a2724;
  --area-frame: 3px solid #0a0908;
  --area-frame-in: inset 0 0 0 3px #4a4540, inset 0 0 0 5px #0a0908;
  --area-radius: 2px;
  font-family: var(--body-font); font-size: 16px;
  background: var(--area-bg);
  transition: background-color 0.4s;
}
.panel, .sheet, .d-match { background: var(--area-panel); border: var(--area-frame); border-radius: var(--area-radius); box-shadow: var(--area-frame-in), 0 4px 0 rgba(0, 0, 0, 0.5); }
.topbar { background: var(--noise), #1a1816; border-bottom: 3px solid #0a0908; }
.tabbar { background: var(--noise), #1a1816; border-top: 3px solid #0a0908; }
.tabbar button { color: #8a7e6a; font-family: var(--body-font); font-weight: 700; }
.tabbar button.on { color: #e09a3a; }
.brand { font-family: var(--display-font); font-weight: 400; font-size: 25px; color: #e09a3a; }
.coin-pill, .streak-pill { border-radius: 3px; background: #2e2216; }
h2 { font-family: var(--display-font); font-weight: 400; font-size: 24px; color: var(--gold); }
h3 { font-family: var(--display-font); font-weight: 400; font-size: 19px; color: var(--accent); }
.btn { border: 2px solid rgba(0, 0, 0, 0.7); border-radius: 3px; background: var(--noise), var(--panel-2); color: var(--text); font-family: var(--body-font); font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn.primary { background: var(--noise), var(--primary); color: #f6ead0; box-shadow: inset 0 0 0 1px var(--primary-line); }
.bar { border-radius: 2px; border: 1px solid rgba(0, 0, 0, 0.6); background: rgba(0, 0, 0, 0.45); }
.d-ctabs { background: var(--noise), #1a1816; border-bottom: 3px solid #0a0908; }
.d-ctabs button.on { color: var(--gold); border-bottom-color: var(--gold); }
.d-chips span, .d-flt button, .d-chip, .d-hubbtn { background: var(--noise), var(--panel-2); border-color: rgba(0, 0, 0, 0.6); color: var(--text); }
.d-flt button.on { color: var(--gold); border-color: var(--gold); }
.d-bar { background: linear-gradient(transparent, rgba(10, 9, 8, 0.95) 30%); }
body[data-view="home"] {
  --text: #3a2814; --muted: #7a6040; --gold: #7a3a10; --accent: #2f6a2a; --panel-2: #e0cfa8; --deep: #d4c094; --line: #a8875a;
  --c-common: #6a6458; --c-uncommon: #2f7a2a; --c-rare: #1f5aa8; --c-epic: #6a2a9a; --c-legendary: #a8600a; --c-mythic: #a81e34; --c-divine: #8a7a1a;
  --area-bg: var(--noise), #3a2414;
  --area-panel: var(--paper), #eadcbc;
  --area-frame: 1px solid #8a6a3e;
  --area-frame-in: 0 0 0 4px #eadcbc, 0 0 0 5px #8a6a3e;
}
body[data-view="home"] .btn { background: #e8d6ae; border-color: #8a6a3e; }
body[data-view="home"] .btn.primary { background: #8e2418; color: #fbe8d0; border-radius: 999px; }
body[data-view="skills"] {
  --panel-2: #4a2e22; --gold: #e8c070; --accent: #d8b880;
  --area-bg: repeating-linear-gradient(0deg, #1a0e08 0 10px, transparent 10px 120px), var(--planks), #2e1c12;
  --area-panel: var(--noise), #4a2a1e;
  --area-frame: 2px solid #1a0e08;
  --area-frame-in: inset 0 0 0 3px #4a2a1e, inset 0 0 0 4px #b8904a;
  --area-radius: 4px;
}
body[data-view="quests"] {
  --text: #3a2814; --muted: #7a6040; --gold: #7a3a10; --accent: #2f6a2a; --panel-2: #e0cfa8; --deep: #d4c094; --line: #a8875a;
  --area-bg: var(--noise), radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.06), transparent 60%), #a87a4a;
  --area-panel: var(--paper), #f0e4c4;
  --area-frame: 1px solid #b8986a;
  --area-frame-in: 2px 3px 0 rgba(0, 0, 0, 0.25);
  --area-radius: 1px;
}
body[data-view="quests"] .panel { position: relative; }
body[data-view="quests"] .panel::before { content: ""; position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff7a6a, #a81e1e 60%, #5a0a0a); box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.4); }
body[data-view="quests"] .panel:nth-child(even) { transform: rotate(0.6deg); }
body[data-view="quests"] .panel:nth-child(odd) { transform: rotate(-0.5deg); }
body[data-view="quests"] .btn { background: #e8d6ae; border-color: #8a6a3e; }
body[data-view="collection"] {
  --panel-2: #3a2216; --gold: #e8c070;
  --area-bg: var(--noise), radial-gradient(ellipse at 50% 0%, #7a1a22, #3a080e 70%);
  --area-panel: var(--noise), #2e1a12;
  --area-frame: 3px solid #160a06;
  --area-frame-in: inset 0 0 0 2px #b8904a, inset 0 0 0 4px #160a06;
  --area-radius: 4px;
}
body[data-camp="bag"] {
  --area-bg: var(--noise), radial-gradient(ellipse at 50% 30%, #6a4426, #3a2210 75%);
}
body[data-camp="bag"] .d-camp-body { padding: 10px; border: 2px dashed #c8a070; border-radius: 10px; background: var(--noise), #5a3a1e; box-shadow: 0 0 0 4px #5a3a1e, 0 6px 0 4px rgba(0, 0, 0, 0.4); }
body[data-camp="forge"] {
  --gold: #ff9a3a; --accent: #ffb060;
  --area-bg: radial-gradient(ellipse at 50% 115%, rgba(255, 110, 30, 0.55), transparent 55%), var(--noise), #121010;
}
body[data-camp="forge"] .d-anvil { background: radial-gradient(circle at 50% 80%, rgba(255, 120, 30, 0.35), transparent 60%), var(--noise), #1c1918; border: 3px solid #0a0908; border-radius: 2px; }
body[data-camp="shop"] {
  --gold: #ffd45a;
  --area-bg: var(--planks), #4a2e16;
}
body[data-camp="shop"] .d-camp-body { position: relative; padding-top: 30px; }
body[data-camp="shop"] .d-camp-body::before { content: ""; position: absolute; top: 0; left: -16px; right: -16px; height: 22px; background: repeating-linear-gradient(90deg, #a8281e 0 22px, #f0e2c0 22px 44px); clip-path: polygon(0 0, 100% 0, 100% 60%, 97.5% 100%, 95% 60%, 92.5% 100%, 90% 60%, 87.5% 100%, 85% 60%, 82.5% 100%, 80% 60%, 77.5% 100%, 75% 60%, 72.5% 100%, 70% 60%, 67.5% 100%, 65% 60%, 62.5% 100%, 60% 60%, 57.5% 100%, 55% 60%, 52.5% 100%, 50% 60%, 47.5% 100%, 45% 60%, 42.5% 100%, 40% 60%, 37.5% 100%, 35% 60%, 32.5% 100%, 30% 60%, 27.5% 100%, 25% 60%, 22.5% 100%, 20% 60%, 17.5% 100%, 15% 60%, 12.5% 100%, 10% 60%, 7.5% 100%, 5% 60%, 2.5% 100%, 0 60%); }
body[data-camp="shop"] .d-bubble { background: #f6e8c4; border: 2px solid #5a3a12; font-style: normal; }
body[data-camp="potions"] {
  --gold: #a8f07a; --accent: #7ae0a0;
  --area-bg: radial-gradient(circle at 20% 30%, rgba(90, 220, 120, 0.12), transparent 40%), radial-gradient(circle at 80% 70%, rgba(150, 90, 220, 0.12), transparent 40%), var(--noise), #0e1612;
}
body[data-camp="potions"] .d-pcard { background: var(--noise), #16241c; border: 2px solid #0a120e; border-radius: 3px; box-shadow: inset 0 0 0 1px #3a5a44; }
body[data-camp="potions"] .d-pack div { border-color: #3a5a44; }
.topbar, .tabbar, .d-ctabs { --gold: #e09a3a; --gold-dark: #8a5a1a; --gold-bg: #2e2216; --text: #e6dcc4; --muted: #a89c86; color: #e6dcc4; }
body[data-view="dungeon"]:not([data-camp]) .d-tower-wrap::before, body[data-view="dungeon"]:not([data-camp]) .d-tower-wrap::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body[data-view="dungeon"]:not([data-camp]) .d-tower-wrap::before { inset: 0 0 118px 0; }
body[data-view="dungeon"]:not([data-camp]) .d-bar { background: linear-gradient(transparent, #0a0908 22%); }
body[data-view="dungeon"]:not([data-camp]) .d-tower-wrap::before { background-repeat: no-repeat; }
@keyframes realm-fog { from { background-position: 0 0, 0 0; } to { background-position: -200% 0, 0 0; } }
@keyframes realm-lightning { 0%, 93%, 95.5%, 97.5%, 100% { background-size: 200% 100%, 0 0; } 94% , 96.5% { background-size: 200% 100%, 100% 100%; } }
body[data-view="dungeon"]:not([data-camp]) .d-tower-wrap::before {
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20400%20200%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20fill%3D%27%23060203%27%20d%3D%27M0%20200v-40l14-6v-30l6-4%204%206v-20l8-30%206%2026v40l10%206v-18l10-4%206%2010v30h18l4-60%206-16%205%2018%203%2058h14v-24l10-30%206%2022v40h20v-80l7-24%207%2022v90h16v-36l10-8%208%2010v-20l6-14%206%2016v46h18l6-30%2010%2030h20v-60l6-20%206%2018v66h24v-30l8-6%206%2010v40z%27%2F%3E%3C%2Fsvg%3E"), radial-gradient(circle at 28% 20%, #c8281e 0 46px, transparent 47px), radial-gradient(circle at 28% 20%, rgba(200,40,30,.35) 46px, transparent 147.20000000000002px), linear-gradient(#0a0204, #2a0608 60%, #4a0e0c);
  background-size: 100% 40%, auto, auto, auto; background-position: bottom, 0 0, 0 0, 0 0; background-repeat: no-repeat;
}
body[data-view="dungeon"]:not([data-camp]) .d-tower-wrap::after {
  background-image: radial-gradient(2px 2px at 10% 80%, #ff5a2a, transparent), radial-gradient(1.5px 1.5px at 30% 90%, #ff8a3a, transparent), radial-gradient(2px 2px at 55% 85%, #ff5a2a, transparent), radial-gradient(1.5px 1.5px at 75% 95%, #ffaa4a, transparent), radial-gradient(2px 2px at 90% 75%, #ff5a2a, transparent);
  animation: realm-ash 9s linear infinite;
}
@keyframes realm-ash { from { transform: translateY(0); opacity: 0.9; } to { transform: translateY(-70vh); opacity: 0; } }
@keyframes realm-snow { from { transform: translateY(-20vh); } to { transform: translateY(60vh); } }
@keyframes realm-blink { from { opacity: 0.2; } to { opacity: 1; } }
body[data-view="dungeon"]:not([data-camp]) .d-tower-wrap .d-tower-hint { color: #e6dcc4; text-shadow: 0 1px 2px #000; }
body[data-view="quests"] .streak-big, body[data-view="home"] .streak-big { color: #a8400a; }
body[data-camp="gear"] .d-camp-body .hint, body[data-camp="gear"] .d-camp-body h3 { text-shadow: 0 1px 2px #000, 0 0 6px #000; }
body[data-camp="gear"] .d-camp-body .hint { color: #e6dcc4; }
body[data-camp="gear"] {
  background: radial-gradient(ellipse at 50% 8%, rgba(255, 190, 90, 0.45), transparent 45%) fixed,
    linear-gradient(90deg, transparent calc(50% - 4px), #2a1a0e calc(50% - 4px), #4a2e16 50%, #2a1a0e calc(50% + 4px), transparent calc(50% + 4px)) fixed,
    linear-gradient(115deg, transparent 49.6%, rgba(0, 0, 0, 0.5) 49.6% 50.4%, transparent 50.4%) fixed, linear-gradient(65deg, transparent 49.6%, rgba(0, 0, 0, 0.5) 49.6% 50.4%, transparent 50.4%) fixed,
    repeating-linear-gradient(90deg, #4a3a24 0 28px, #3e3020 28px 56px) fixed, var(--noise);
}
body[data-view="home"], body[data-view="quests"] { --gold-bg: #ecd9a8; --gold-dark: #8a5a1a; }
body[data-view="home"] .install-banner, body[data-view="home"] .welcome-install { background: #ecd9a8; border-color: #8a5a1a; color: #3a2814; }
body[data-view="quests"] .btn.primary { background: #8e2418; border-color: #5a140c; color: #fbe8d0; border-radius: 999px; }

/* page content sits on its own layer so area backdrops (e.g. the blood moon) draw between it and the background */
main { position: relative; z-index: 1; }


/* ==================== Battle: face-off (enemies on a platform above, you on one below) ==================== */
.d-bg.sec-1 { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20400%20120%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20fill%3D%27%230a0e06%27%20d%3D%27M0%20120V70l30-30%2030%2040%2040-50%2040%2040%2040-30%2050%2050%2040-40%2060%2050%2040-30%2030%2020v60z%27%2F%3E%3Cg%20fill%3D%27%230a0e06%27%3E%3Cpath%20d%3D%27M60%20120l26-40%2026%2040zM250%20120l34-52%2034%2052z%27%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%27%23ff9a3a%27%3E%3Crect%20x%3D%27280%27%20y%3D%27104%27%20width%3D%276%27%20height%3D%278%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") bottom / 100% 45% no-repeat, radial-gradient(ellipse at 70% 100%, rgba(255,140,40,.3), transparent 50%), linear-gradient(#0e1408, #2a3a1a 60%, #3e4a24); }
.d-bg.sec-2 { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20400%20120%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20fill%3D%27%2308060e%27%20d%3D%27M0%20120V96c60-6%20140-8%20210-4s130%204%20190-2v30z%27%2F%3E%3Cg%20fill%3D%27%2308060e%27%3E%3Cpath%20d%3D%27M50%20100v-20a9%209%200%200%201%2018%200v20zM120%2098v-28h-8v-6h8v-8h6v8h8v6h-8v28zM300%20100v-18a8%208%200%200%201%2016%200v18zM230%20104c-2-30-4-50%202-70-10-6-18-14-22-24%208%206%2016%2010%2022%2012%202-10%208-18%2016-24-4%2010-6%2018-4%2026%208-2%2016-8%2022-16-4%2012-12%2020-20%2024%202%2022%202%2042-2%2072z%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") bottom / 100% 50% no-repeat, radial-gradient(circle at 80% 18%, #d8d4f0 0 22px, rgba(200,190,255,.2) 23px, transparent 70px), linear-gradient(#0a0814, #1e1834 60%, #2e2448); }
.d-bg.sec-3 { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20400%2080%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20fill%3D%27%23050507%27%20d%3D%27M0%200h400v20l-10%2030-8-28-12%2018-10-24-14%2044-10-42-12%2016-8-20-14%2038-12-34-10%2014-12-24-12%2050-12-48-10%2016-12-20-10%2030-10-28-14%2024-10-26-12%2040-12-38-10%2018-12-22-12%2034-10-30-10%2012-12-18-10%2028-10-26-12%2014-10-16z%27%2F%3E%3C%2Fsvg%3E") top / 100% 30% no-repeat, radial-gradient(ellipse at 8% 60%, rgba(80,190,255,.4), transparent 22%), radial-gradient(ellipse at 92% 50%, rgba(80,190,255,.35), transparent 20%), linear-gradient(#0a0a0e, #1c1c24); }
.d-bg.sec-4 { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20400%20160%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20fill%3D%27%23324a6e%27%20d%3D%27M0%20160V80l50-40%2040%2030%2050-60%2050%2050%2040-30%2060%2050%2040-30%2070%2050v60z%27%2F%3E%3Cpath%20fill%3D%27%23e8f2ff%27%20d%3D%27M50%2040l14%2012-6%202-8-5-8%206-6-3zM140%2010l18%2018-8%202-10-7-10%208-8-3z%27%2F%3E%3C%2Fsvg%3E") bottom / 100% 55% no-repeat, linear-gradient(#0a1426, #1e3456 60%, #3a5a80); }
.d-bg.sec-5 { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20400%20160%27%20preserveAspectRatio%3D%27none%27%3E%3Cpath%20fill%3D%27%23050101%27%20d%3D%27M0%20160v-40l10-40%208%2030%2010-70%2010%2080%2014-30%208%2040%2012-60%2010%2050%2016-20%2010%2040h10l12-80%2010%2070%2014-40%2010%2050%208-30%2012%2050%2014-100%2012%20100%2010-20%2014%2030%2010-60%2010%2060%2016-40%2010%2040%2012-70%2010%2070h10l10-40%2010%2040v60z%27%2F%3E%3C%2Fsvg%3E") bottom / 100% 55% no-repeat, radial-gradient(ellipse at 50% 110%, rgba(255,90,20,.6), transparent 50%), radial-gradient(circle at 25% 20%, #c8281e 0 30px, rgba(200,40,30,.3) 31px, transparent 90px), linear-gradient(#120404, #3a0a06 60%, #6a1a08); }
#d-battle.fo { padding: 0; overflow: hidden; }
#d-battle.fo .d-top { position: relative; z-index: 6; padding: calc(env(safe-area-inset-top) + 8px) 10px 6px; background: linear-gradient(rgba(0, 0, 0, 0.65), transparent); color: #e09a3a; text-shadow: 0 1px 2px #000; }
#d-battle.fo .d-flee { background: rgba(0, 0, 0, 0.5); color: #e6dcc4; border-color: #5a5048; border-radius: 3px; }
.fo-stage { position: relative; flex: 1; min-height: 250px; }
.fo-plates { position: absolute; left: 8px; top: 2px; z-index: 4; width: 46%; max-width: 210px; display: flex; flex-direction: column; gap: 4px; }
.fo-erow, .fo-me { background: rgba(20, 16, 12, 0.9); border: 2px solid #0a0908; box-shadow: inset 0 0 0 1px #5a5048; border-radius: 4px; padding: 3px 8px 4px; color: #e6dcc4; }
.fo-erow.targeted { box-shadow: inset 0 0 0 1px #e09a3a; }
.fo-erow.dead { opacity: 0.35; }
.fo-ename { font: 400 13px var(--display-font); line-height: 1.15; }
.fo-telename { font: 700 11px var(--body-font); color: #ff6a5a; animation: d-blink 0.8s infinite; }
.fo-erow .d-hpbar, .fo-me .d-hpbar { height: 7px; margin: 2px 0 1px; border: 1px solid #0a0908; border-radius: 2px; overflow: hidden; }
.fo-erow-sub { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.fo-erow .d-hptext, .fo-me .d-hptext { font-size: 10px; text-align: left; color: #a89c86; }
.fo-plat { position: absolute; border-radius: 50%; z-index: 1; background: radial-gradient(ellipse, rgba(255, 240, 210, 0.2), rgba(0, 0, 0, 0.35) 58%, transparent 72%); }
.fo-plat-foe { right: -6%; top: 40%; width: 70%; height: 58px; }
.fo-plat-me { left: -8%; bottom: 2%; width: 70%; height: 58px; }
.fo-foes { position: absolute; right: 2%; width: 66%; top: 0; height: calc(40% + 32px); z-index: 3; display: flex; justify-content: center; align-items: flex-end; gap: 0; }
#d-battle .fo-foe { position: relative; flex: none; min-width: 0; max-width: none; background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform 0.15s; }
#d-battle .fo-foe .d-enemy-cv { width: 88px; height: 88px; }
#d-battle .fo-foes.n3 .fo-foe .d-enemy-cv, #d-battle .fo-foes.n4 .fo-foe .d-enemy-cv { width: 70px; height: 70px; }
#d-battle .fo-foe.boss .d-enemy-cv { width: 136px; height: 136px; }
#d-battle .fo-foe.dead { visibility: hidden; opacity: 1; filter: none; }
.fo-shadow { width: 70%; height: 9px; margin-top: -7px; border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, 0.65), transparent 70%); }
.fo-mark { position: absolute; top: -12px; color: #e09a3a; font-size: 13px; text-shadow: 0 1px 0 #000; opacity: 0; }
.fo-foes:not(.n1) .fo-foe.targeted .fo-mark { opacity: 1; animation: fo-bob 0.7s ease-in-out infinite alternate; }
@keyframes fo-bob { to { transform: translateY(4px); } }
.fo-hero { position: absolute; left: 7%; bottom: calc(2% + 26px); z-index: 3; }
.fo-hero img { display: block; width: 104px; image-rendering: pixelated; }
.fo-ui { position: relative; z-index: 5; margin-top: 0 !important; border: 0 !important; background: linear-gradient(transparent, rgba(10, 8, 6, 0.96) 18px) !important; padding: 18px 8px calc(env(safe-area-inset-bottom) + 8px) !important; }
.fo-me { position: absolute; right: 8px; top: -58px; width: 52%; max-width: 230px; }
.fo-me-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.fo-me b { font: 400 15px var(--display-font); }
.fo-text { min-height: 46px; margin: 0 0 8px !important; border: 2px solid #c8a24a !important; border-radius: 4px; background: rgba(12, 10, 8, 0.94) !important; font-size: 14px; color: #f4e6c8; }
.fo-text div { color: #a89c86; } .fo-text div:last-child { color: #f4e6c8; }
/* effects */
#d-battle.fo .fo-foe.hit .d-enemy-cv, .fo-hero.hit img:not(.d-gl) { animation: fo-hitflash 0.3s; }
@keyframes fo-hitflash { 0%, 40% { filter: brightness(4) saturate(0); transform: translateX(6px); } 70% { transform: translateX(-4px); } 100% { filter: none; transform: none; } }
.fo-hero.lunge { animation: fo-lunge-up 0.55s ease-out; }
@keyframes fo-lunge-up { 25% { transform: translate(-6px, 8px) scale(1.03); } 55% { transform: translate(110px, -100px) scale(0.78) rotate(4deg); } 75% { transform: translate(98px, -88px) scale(0.8); } 100% { transform: none; } }
.fo-hero.hit { animation: fo-knock 0.45s ease-out; }
@keyframes fo-knock { 20% { transform: translate(-12px, 5px) rotate(-6deg); } 55% { transform: translate(5px, 0); } 100% { transform: none; } }
.fo-ready { transform-origin: 50% 100%; animation: fo-ready 1.3s ease-in-out infinite; }
@keyframes fo-ready { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(-3deg) translateY(-3px) scaleY(1.02); } }
.d-gav > img.d-cape { z-index: 3; transform-origin: 50% 48%; animation: d-cape 1.8s ease-in-out infinite; pointer-events: none; }
@keyframes d-cape { 0%, 100% { transform: skewX(0deg) scaleY(1); } 50% { transform: skewX(-5deg) scaleY(1.02); } }
@media (prefers-reduced-motion: reduce) { .fo-ready, .d-gav > img.d-cape { animation: none; } }
#d-battle .fo-foe.lunge { animation: fo-lunge-down 0.35s; }
@keyframes fo-lunge-down { 40% { transform: translate(-34px, 40px) scale(1.15); } }
#d-battle .fo-foe.tele .d-enemy-cv { animation: fo-tele 0.6s ease-in-out infinite alternate; }
@keyframes fo-tele { from { filter: drop-shadow(0 0 0 #ff2a1a); } to { filter: drop-shadow(0 0 12px #ff2a1a) brightness(1.2); } }
.fo-bang { position: absolute; top: -20px; z-index: 2; font: 400 28px var(--display-font); color: #ff3a2a; text-shadow: 0 2px 0 #000; animation: fo-bang 0.5s infinite alternate; }
@keyframes fo-bang { to { transform: translateY(-5px) scale(1.15); } }
.fo-warn { position: absolute; bottom: -4px; width: 110%; height: 20px; border-radius: 50%; border: 2px dashed #ff3a2a; animation: fo-warn 1.2s linear infinite; }
@keyframes fo-warn { from { transform: rotate(0deg) scaleY(0.35); } to { transform: rotate(360deg) scaleY(0.35); } }
/* death: flash and shudder, then crumble down into dust (beats the hit flash, which stays on the last enemy hit) */
#d-battle.fo .fo-foe.dying .d-enemy-cv { animation: fo-crumble 0.95s ease-in forwards; transform-origin: 50% 100%; }
@keyframes fo-crumble { 0% { filter: brightness(4) saturate(0); transform: none; } 12% { transform: translateX(-4px) rotate(-3deg); } 24% { transform: translateX(4px) rotate(3deg); filter: brightness(1.6) sepia(0.6); } 36% { transform: translateX(-2px); } 50% { transform: scaleY(0.92) scaleX(1.06); filter: grayscale(0.6) brightness(0.8); opacity: 1; } 100% { transform: scaleY(0.1) scaleX(1.25) translateY(10px); filter: grayscale(1) brightness(0.5) blur(1px); opacity: 0; } }
#d-battle.fo .fo-foe.dying .fo-shadow { transition: opacity 0.9s; opacity: 0; }
.fo-bit { position: absolute; z-index: 15; width: 5px; height: 5px; pointer-events: none; animation: fo-bit 0.8s ease-out forwards; }
@keyframes fo-bit { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.fo-slash { position: absolute; left: 50%; top: 42%; width: 130px; height: 130px; margin: -65px 0 0 -65px; z-index: 4; pointer-events: none; border-radius: 50%; border-top: 6px solid #fff; border-right: 3px solid rgba(255, 255, 255, 0.6); filter: drop-shadow(0 0 6px #ffe8a0); animation: fo-slash 0.28s ease-out forwards; }
@keyframes fo-slash { from { transform: rotate(-80deg) scale(0.6); opacity: 1; } to { transform: rotate(60deg) scale(1.1); opacity: 0; } }
#d-battle.fo .d-pop { top: 18%; font: 400 26px var(--display-font); color: #fff; text-shadow: 0 2px 0 #000, 0 0 6px #000; animation: fo-num 0.95s ease-out forwards; }
#d-battle.fo .d-pop.crit { font-size: 38px; color: #ffd84a; }
#d-battle.fo .d-pop.me { color: #ff7a6a; }
#d-battle.fo .d-pop.heal { color: #8ae07a; }
#d-battle.fo .d-pop small { display: block; font: 700 11px var(--body-font); color: #7ae0a0; text-align: center; }
@keyframes fo-num { 0% { transform: translate(-50%, 0) scale(0.4); opacity: 0; } 15% { transform: translate(-50%, -14px) scale(1.25); opacity: 1; } 35% { transform: translate(-50%, -20px) scale(1); } 100% { transform: translate(-50%, -58px); opacity: 0; } }
.fo-flash { position: absolute; inset: 0; z-index: 20; background: #fff; opacity: 0; pointer-events: none; }
.fo-flash.go { animation: fo-flash 0.25s; }
@keyframes fo-flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
.fo-vig { position: absolute; inset: 0; z-index: 19; pointer-events: none; }
.fo-vig.go { animation: fo-vig 0.6s; }
@keyframes fo-vig { 0% { box-shadow: inset 0 0 80px 30px rgba(220, 20, 10, 0.75); } 100% { box-shadow: inset 0 0 80px 30px rgba(220, 20, 10, 0); } }
.fo-bar { position: absolute; left: 0; right: 0; z-index: 25; height: 0; background: #000; transition: height 0.35s; }
.fo-bar.top { top: 0; } .fo-bar.bot { bottom: 0; }
.fo-bar.on { height: 70px; }
.fo-bossname { position: absolute; top: 38%; left: 0; right: 0; z-index: 26; text-align: center; font: 400 36px var(--display-font); color: #e09a3a; text-shadow: 0 3px 0 #000; transform: translateX(-120%); animation: fo-bossname 2.4s cubic-bezier(.2, .8, .2, 1) forwards; pointer-events: none; }
.fo-bossname small { display: block; font: 600 13px var(--body-font); color: #e6dcc4; letter-spacing: 3px; }
@keyframes fo-bossname { 0% { transform: translateX(-120%); } 20%, 80% { transform: translateX(0); } 100% { transform: translateX(120%); } }
.fo-me .d-hpbar.me span { background: linear-gradient(#8ae07a, #3a9a2a); }


/* ==================== Battle: tarot move cards ==================== */
.tc-hand { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 178px; padding-top: 16px; margin-bottom: 2px; }
.tc-card { position: relative; flex: none; width: 104px; height: 152px; margin: 0 calc(-1 * var(--ov, 14px)); padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-align: center;
  transform: rotate(var(--r)) translateY(var(--y)); transform-origin: 50% 120%; transition: transform 0.16s; will-change: transform; }
.tc-card.lift { transform: rotate(0deg) translateY(-24px) scale(1.1); z-index: 5; }
.tc-card.off { filter: grayscale(0.8) brightness(0.6); cursor: default; }
.tc-card.pending { opacity: 0; }
.tc-card.play { animation: tc-play 0.42s forwards cubic-bezier(.5, 0, .7, .3); z-index: 6; pointer-events: none; }
@keyframes tc-play { 0% { transform: translateY(-24px) scale(1.1); } 70% { transform: translate(50px, -300px) scale(0.7) rotate(16deg); opacity: 1; } 100% { transform: translate(60px, -330px) scale(0.3); opacity: 0; } }
.tc-card.draw { animation: tc-draw 0.5s cubic-bezier(.2, .8, .3, 1.15) both; z-index: 4; }
@keyframes tc-draw { 0% { transform: translate(var(--dx), var(--dy)) rotate(0deg) scale(0.4); } 45% { transform: translate(calc(var(--dx) * 0.35), calc(var(--dy) * 0.35 - 26px)) rotate(0deg) scale(0.04, 0.9); } 100% { transform: rotate(var(--r)) translateY(var(--y)); } }
.tc-card.draw::after { content: ""; position: absolute; inset: 0; z-index: 9; border-radius: 7px; border: 2px solid #c8a24a; background: repeating-linear-gradient(45deg, #6a1e16 0 6px, #4a120c 6px 12px); animation: tc-back 0.5s steps(1) both; }
@keyframes tc-back { 0%, 44% { opacity: 1; } 45%, 100% { opacity: 0; } }
.tc-face { position: absolute; inset: 0; border-radius: 7px; background: var(--noise), #efe0bc; border: 2px solid #3a2410; box-shadow: inset 0 0 0 3px #efe0bc, inset 0 0 0 4px #b8862a, inset 0 0 0 6px #efe0bc, inset 0 0 0 7px #6a4a1a, 0 4px 0 #000; }
.tc-card.sig .tc-face { box-shadow: inset 0 0 0 3px #efe0bc, inset 0 0 0 4px #ffd84a, inset 0 0 0 6px #efe0bc, inset 0 0 0 7px #b8862a, 0 4px 0 #000, 0 0 10px rgba(255, 216, 74, 0.45); }
.tc-art { position: absolute; left: 11px; right: 11px; top: 11px; height: 68px; border-radius: 36px 36px 4px 4px; border: 2px solid #6a4a1a; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--tc) 55%, transparent), transparent 70%), linear-gradient(#2a1c12, #4a3420); }
.tc-art img { width: 64px; image-rendering: pixelated; }
.tc-big { width: 32px; height: 32px; }
.tc-ribbon { position: absolute; left: 3px; right: 3px; top: 75px; padding: 3px 4px; background: #7a1e16; color: #fbe8d0; font: 400 11.5px var(--display-font); line-height: 1.1; clip-path: polygon(0 0, 100% 0, 94% 50%, 100% 100%, 0 100%, 6% 50%); }
.tc-txt { position: absolute; left: 9px; right: 9px; top: 100px; font-size: 10px; line-height: 1.2; color: #4a3420; }
.tc-seal { position: absolute; left: 7px; bottom: 6px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 40% 35%, #c8402a, #7a1410 70%); color: #fbe8d0; font: 400 10px var(--display-font); box-shadow: 0 2px 0 #3a0a06; }
.tc-uses { position: absolute; left: 44px; bottom: 16px; display: flex; gap: 3px; }
.tc-uses i { width: 7px; height: 7px; border-radius: 50%; background: #3a2410; border: 1px solid #b8862a; }
.tc-uses i.on { background: #ffd84a; }
.tc-tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); padding: 0 5px; border-radius: 2px; font: 700 10px var(--body-font); letter-spacing: 0.5px; white-space: nowrap; }
.tc-tag.good { background: #8ae07a; color: #0a1a06; }
.tc-tag.bad { background: #c84a3a; color: #fff; }
.tc-tag.hint { background: #6ab0ff; color: #061a2a; animation: d-blink 0.8s infinite; }
.tc-card.hint .tc-face { box-shadow: inset 0 0 0 3px #efe0bc, inset 0 0 0 4px #6ab0ff, inset 0 0 0 6px #efe0bc, inset 0 0 0 7px #2a5a9a, 0 4px 0 #000, 0 0 12px rgba(106, 176, 255, 0.6); }
.tc-deck { position: absolute; right: 2px; bottom: -42px; width: 34px; height: 50px; border-radius: 5px; border: 2px solid #c8a24a; background: repeating-linear-gradient(45deg, #6a1e16 0 6px, #4a120c 6px 12px); box-shadow: 2px 2px 0 #1a0806, 4px 4px 0 #c8a24a, 6px 6px 0 #1a0806; }
.tc-under { display: flex; align-items: center; gap: 10px; min-height: 40px; padding-right: 50px; }
.tc-pot { min-height: 36px; padding: 4px 14px; border-radius: 999px; font-size: 14px; }
.tc-hint { font-size: 11px; color: #a89c86; }


/* ==================== Floor chests ==================== */
.ch-earned { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 6px auto 10px; padding: 6px 12px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); border: 1px solid #8a6a1a; width: fit-content; }
.ch-earned img { width: 54px; image-rendering: pixelated; }
.ch-earned b { display: block; color: #ffd84a; }
.ch-row { margin: 0 0 10px; padding: 8px; border-radius: 8px; border: 2px dashed #c8a070; background: rgba(0, 0, 0, 0.25); }
.ch-row-h { font: 400 14px var(--display-font); color: #ffd84a; margin-bottom: 4px; }
.ch-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.ch-btn { position: relative; flex: none; width: 74px; display: flex; flex-direction: column; align-items: center; padding: 4px 2px 6px; border-radius: 8px; border: 2px solid #5a3a12; background: radial-gradient(circle at 50% 35%, rgba(255, 216, 120, 0.25), rgba(0, 0, 0, 0.4) 75%); color: #f4e6c8; cursor: pointer; }
.ch-btn img { width: 60px; image-rendering: pixelated; animation: ch-wiggle 2.4s ease-in-out infinite; }
@keyframes ch-wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-6deg); } 88% { transform: rotate(6deg); } 92% { transform: rotate(-3deg); } }
.ch-n { position: absolute; top: 2px; right: 4px; font: 700 12px var(--display-font); color: #ffd84a; text-shadow: 1px 1px 0 #000; }
.ch-name { font-size: 10px; line-height: 1.1; text-align: center; }
.ch-open { text-align: center; }
.ch-stage { position: relative; height: 150px; display: grid; place-items: center; }
.ch-stage img { position: absolute; width: 132px; image-rendering: pixelated; }
.ch-opened { opacity: 0; }
.ch-open.go .ch-closed { animation: ch-shake 0.9s ease-in-out forwards; }
.ch-open.go .ch-opened { animation: ch-pop 0.4s 0.9s forwards; }
@keyframes ch-shake { 0%, 100% { transform: none; } 15%, 45%, 75% { transform: rotate(-7deg) scale(1.04); } 30%, 60%, 90% { transform: rotate(7deg) scale(1.04); } 99% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ch-pop { 0% { opacity: 1; transform: scale(1.2); } 100% { opacity: 1; transform: scale(1); } }
.ch-burst { position: absolute; width: 30px; height: 30px; border-radius: 50%; border: 4px solid #ffe89a; opacity: 0; }
.ch-open.go .ch-burst { animation: ch-burst 0.6s 0.9s ease-out; }
@keyframes ch-burst { 0% { opacity: 1; transform: scale(0.5); } 100% { opacity: 0; transform: scale(8); } }
.ch-reel { position: relative; height: 84px; margin: 6px 0 10px; overflow: hidden; border-radius: 8px; border: 2px solid #c8a24a; background: #120c08; }
.ch-strip { display: flex; gap: 6px; padding: 6px; width: max-content; transform: translateX(0); }
.ch-pointer { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ffd84a; box-shadow: 0 0 6px #ffd84a; }
.ch-cell { flex: none; width: 68px; height: 68px; border-radius: 6px; border: 2px solid var(--rc, #4a4540); background: radial-gradient(circle at 50% 35%, var(--rcb, rgba(255, 255, 255, 0.06)), rgba(0, 0, 0, 0.5) 80%); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ch-cell img { width: 48px; image-rendering: pixelated; }
.ch-cell b { display: none; }
.ch-cell.coin { --rc: #8a6a1a; }
.ch-got { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; opacity: 0; }
@keyframes ch-fade { to { opacity: 1; } }
.ch-got .ch-cell { width: auto; min-width: 86px; height: auto; padding: 6px 8px; }
.ch-got .ch-cell b { display: block; font-size: 12px; margin-top: 2px; color: #f4e6c8; }
.ch-pot { font-size: 34px; color: #e8435a; }
.ch-btns .btn { margin: 0; }

/* chest rarities */
.ch-btn.tier-i { border-color: #8a92a8; }
.ch-btn.tier-g { border-color: #c8962a; background: radial-gradient(circle at 50% 35%, rgba(255, 216, 74, 0.45), rgba(0, 0, 0, 0.4) 75%); box-shadow: 0 0 10px rgba(255, 216, 74, 0.35); }
.ch-btn.tier-a { border-color: #b48cff; background: radial-gradient(circle at 50% 35%, rgba(180, 140, 255, 0.5), rgba(0, 0, 0, 0.45) 75%); box-shadow: 0 0 12px rgba(180, 140, 255, 0.55); }
.ch-btn.tier-a img { filter: drop-shadow(0 0 6px #7af0ff); }
.ch-name b { display: block; font-size: 10px; letter-spacing: 0.5px; }
.ch-earned.tier-g { border-color: #ffd84a; box-shadow: 0 0 12px rgba(255, 216, 74, 0.4); }
.ch-earned.tier-a { border-color: #b48cff; box-shadow: 0 0 16px rgba(180, 140, 255, 0.6); }
.ch-open.tier-i .ch-burst { border-color: #e8ecf8; }
.ch-open.tier-g .ch-burst { border-color: #ffd84a; border-width: 6px; }
.ch-open.tier-g .ch-stage::before, .ch-open.tier-a .ch-stage::before { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; opacity: 0; background: radial-gradient(circle, rgba(255, 216, 74, 0.55), transparent 65%); }
.ch-open.tier-a .ch-stage::before { background: radial-gradient(circle, rgba(180, 140, 255, 0.7), rgba(122, 240, 255, 0.25) 45%, transparent 68%); }
.ch-open.go.tier-g .ch-stage::before, .ch-open.go.tier-a .ch-stage::before { animation: ch-aura 1.6s 0.9s ease-out forwards; }
@keyframes ch-aura { 0% { opacity: 0; transform: scale(0.4) rotate(0deg); } 30% { opacity: 1; } 100% { opacity: 0.55; transform: scale(1.1) rotate(90deg); } }
.ch-open.go.tier-a .ch-closed { animation: ch-shake-big 1.3s ease-in-out forwards; }
.ch-open.go.tier-a .ch-opened, .ch-open.go.tier-a .ch-burst { animation-delay: 1.3s; }
.ch-open.tier-a .ch-burst { border-color: #7af0ff; border-width: 7px; }
@keyframes ch-shake-big { 0%, 100% { transform: none; } 10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg) scale(1.08) translateY(-4px); } 20%, 40%, 60%, 80% { transform: rotate(10deg) scale(1.08) translateY(-4px); } 99% { opacity: 1; } 100% { opacity: 0; } }

/* chest reel (driven by JS so it rolls on every phone) */
.ch-strip { will-change: transform; }
.ch-cell.win.landed { animation: ch-win 0.9s ease-in-out infinite alternate; }
@keyframes ch-win { from { box-shadow: 0 0 0 2px #ffd84a; } to { box-shadow: 0 0 0 3px #ffd84a, 0 0 18px #ffd84a; } }
.ch-open.done .ch-got { animation: ch-fade 0.4s forwards; }
.ch-reel::before, .ch-reel::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 2; pointer-events: none; }
.ch-reel::before { left: 0; background: linear-gradient(90deg, #120c08, transparent); }
.ch-reel::after { right: 0; background: linear-gradient(-90deg, #120c08, transparent); }
.ch-pointer { z-index: 3; }
.ch-pointer::before, .ch-pointer::after { content: ""; position: absolute; left: -5px; border: 6px solid transparent; }
.ch-pointer::before { top: 0; border-top-color: #ffd84a; }
.ch-pointer::after { bottom: 0; border-bottom-color: #ffd84a; }

/* in-game question windows */
.q-win { text-align: center; }
.q-win h2 { margin: 4px 0 8px; }
.q-win p { margin: 0 0 8px; line-height: 1.4; }
.q-ico img { width: 72px; image-rendering: pixelated; }
.q-note { padding: 8px 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); border: 1px solid #8a6a1a; font-size: 14px; text-align: left; }

/* numbers: easy-to-read, even-height digits (the title font's old-style numerals are hard to read) */
.coin-pill, .streak-pill { font-family: var(--body-font) !important; font-weight: 700; font-size: 15px; }
body, .coin-pill, .streak-pill, .stat-num, .d-dpow, .d-hptext, .d-pop, .tc-seal, .d-price, .d-chip, .ch-cell b { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
/* numbers in the clean text font (bold) so they are always easy to read; titles keep the metal font */
.stat-num, .d-dpow, .d-pop, .tc-seal, .ch-n, .d-anvil-lv .plus, .lvl, .count, .d-chip { font-family: var(--body-font) !important; font-weight: 800; }

/* dealing the hand at the start of a fight: the back shows until each card flips */
.tc-card.dealing::after { animation-delay: inherit; }

/* chest odds chips */
.odds-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; max-width: 616px; margin: 0 auto 6px; font-size: 11px; }
.odds-lbl { color: #e6dcc4; font-weight: 700; text-shadow: 0 1px 2px #000; }
.odds-chip { padding: 1px 7px; border-radius: 999px; border: 1px solid var(--oc); background: rgba(10, 8, 6, 0.85); color: var(--oc); white-space: nowrap; }
.odds-chip b { color: #fff; }
.q-win .odds-row { margin: 4px 0 10px; }

/* armour rarity glow round the avatar (Camp, battles) */
.d-gav { position: relative; display: inline-grid; place-items: center; vertical-align: top; }
.d-gav > img { grid-area: 1 / 1; position: relative; z-index: 2; }
.d-gav > img.d-gl { z-index: 1; filter: blur(4px) saturate(1.4); opacity: 0.95; pointer-events: none; }
.d-gav.pulse > img.d-gl { animation: d-glowpulse 2.2s ease-in-out infinite; }
@keyframes d-glowpulse { 50% { opacity: 0.45; } }
.d-gpt { position: absolute; width: 4px; height: 4px; z-index: 3; bottom: 15%; opacity: 0; pointer-events: none; animation: d-gpt-rise linear infinite; }
@keyframes d-gpt-rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-90px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .d-gav.pulse > img.d-gl, .d-gpt { animation: none; } }

/* battle: dodges and banners (no log box under the fight) */
.fo-hero.dodge { animation: fo-dodge-hero 0.42s ease-out; }
@keyframes fo-dodge-hero { 35% { transform: translate(-26px, 4px) rotate(-10deg); opacity: 0.6; } 100% { transform: none; opacity: 1; } }
#d-battle .fo-foe.dodge { animation: fo-dodge-foe 0.42s ease-out; }
@keyframes fo-dodge-foe { 35% { transform: translateX(30px) skewX(-12deg); opacity: 0.55; } 100% { transform: none; opacity: 1; } }
.d-pop.dodge-pop { color: #9fe8ff; font-size: 22px; letter-spacing: 1px; }
.fo-banner { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); z-index: 8; max-width: 86%; padding: 8px 14px; border: 2px solid #c8a24a; border-radius: 4px; background: rgba(12, 10, 8, 0.92); color: #f4e6c8; font: 700 15px var(--body-font); text-align: center; pointer-events: none; animation: fo-banner 1.6s ease-out forwards; }
.fo-banner.warn { color: #ffb0a0; border-color: #ff5a3a; }
.fo-banner.phase { font: 400 18px var(--display-font); color: #ffd27a; border-color: #ff5a3a; animation-duration: 2.2s; }
@keyframes fo-banner { 0% { opacity: 0; transform: translate(-50%, -40%) scale(0.95); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
