/* Slasher Hero: storybook fantasy UI. Wood panels, parchment cards, gold trim and chunky
   glossy buttons, all with the same warm dark outline as the vector art. */

:root {
  --ink: #2a1b17;
  --cream: #fff8e6;
  --dim: #d9c6a0;
  --wood: #6b4128;
  --wood-dark: #47291a;
  --wood-light: #8a5a36;
  --parch: #f6e7c1;
  --parch-dark: #e2c98e;
  --parch-ink: #4a2c1a;
  --parch-dim: #8a6a48;
  --gold: #f6c03a;
  --gold-dark: #c8871a;
  --green: #62bd45;
  --green-dark: #3b8a2a;
  --red: #d8443e;
  --red-dark: #962a2a;
  --blue: #3a8ae0;
  --soul: #b56fe8;
  --soul-dark: #6a2f9a;
  --display: 'Lilita One', 'Arial Black', sans-serif;
  --font: 'Fredoka', 'Trebuchet MS', sans-serif;
  --outline: 0 2px 0 var(--ink), 0 -1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  touch-action: pan-x pan-y;    /* scrolling yes, pinch zoom no */
  color: var(--cream);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  justify-content: center;
  background: #1c1210 radial-gradient(circle at 50% 30%, #3a2418 0%, #1c1210 70%);
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
button:disabled { cursor: default; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--wood-dark);
  box-shadow: 0 0 0 3px var(--ink), 0 0 50px rgba(0, 0, 0, 0.7);
}

/* ---------- Battle (top half) ---------- */

#battle {
  position: relative;
  flex: 0 0 50%;
  min-height: 250px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  background: #2a1b2a;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hud {
  position: absolute;
  inset: 0 0 auto 0;
  padding: calc(var(--safe-top) + 10px) 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
#hud button { pointer-events: auto; }

.hud-top { display: flex; gap: 6px; align-items: center; padding-right: 46px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px 2px 3px;
  background: linear-gradient(#4a2c1aee, #2a1b17ee);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px #c8871a99, 0 2px 0 rgba(0, 0, 0, 0.35);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: var(--outline);
}
.pill img { width: 24px; height: 24px; }
.pill.gold b { color: #ffe680; font-size: 19px; font-weight: 400; }
.pill.dim { padding-left: 10px; font-family: var(--font); font-weight: 600; font-size: 12px; color: var(--dim); }
.pill.dim b { font-family: var(--display); font-weight: 400; color: var(--cream); font-size: 15px; }
.pill.soul { margin-left: auto; }
.pill.soul b { color: #e8c8ff; font-weight: 400; }
.pill.pulse { animation: pulse 0.25s ease-out; }
@keyframes pulse { 40% { transform: scale(1.12); } }

.stage-nav { display: flex; align-items: center; justify-content: center; gap: 8px; }
.stage-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  padding: 2px 14px 3px;
  background: linear-gradient(#f6e7c1, #e2c98e);
  color: var(--parch-ink);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: inset 0 -3px 0 rgba(120, 70, 20, 0.25), 0 2px 0 rgba(0, 0, 0, 0.35);
  line-height: 1.05;
}
.stage-info span { font-size: 11px; font-weight: 600; color: var(--parch-dim); letter-spacing: 0.3px; }
.stage-info b { font-family: var(--display); font-weight: 400; font-size: 18px; }

.nav-btn {
  width: 40px;
  height: 36px;
  padding: 0;
  font-size: 14px;
  color: var(--cream);
  background: linear-gradient(#8a5a36, #5a3620);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: inset 0 2px 0 rgba(255, 220, 160, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 2px 0 rgba(0, 0, 0, 0.35);
  text-shadow: var(--outline);
}
.nav-btn:active:not(:disabled) { transform: translateY(1px); }
.nav-btn:disabled { opacity: 0.4; }

.enemy-info { align-self: center; width: min(100% - 92px, 300px); display: flex; flex-direction: column; gap: 3px; }
.enemy-line { display: flex; justify-content: space-between; font-family: var(--display); font-size: 15px; text-shadow: var(--outline); }
#enemy-name.boss { color: #ff9a6a; }
#enemy-progress { color: #ffe680; }

.bar {
  position: relative;
  height: 16px;
  background: #2a1b17;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.bar .fill {
  position: absolute;
  inset: 0;
  transform-origin: left;
  border-radius: 999px;
  background: linear-gradient(#ff7a6a, #d8443e 55%, #a82a2a);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.12s ease-out;
}
.bar span {
  position: absolute;
  inset: 0;
  font-family: var(--display);
  font-size: 11px;
  line-height: 12px;
  text-align: center;
  text-shadow: var(--outline);
}
.bar .fill.shield { background: linear-gradient(#d8f6ff, #6fc8f4 55%, #3a8ae0); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.6); }
#enemy-name.special { color: #ffe680; }
.timer-bar { height: 12px; }
.timer-bar .fill { background: linear-gradient(#fff0a0, #f6c03a 60%, #c8871a); transition: none; }
.timer-bar span { font-size: 9px; line-height: 8px; }

#tap-hint {
  position: absolute;
  right: 12%;
  bottom: 6%;
  font-family: var(--display);
  font-size: 22px;
  color: #ffe680;
  text-shadow: var(--outline);
  pointer-events: none;
  animation: bob 0.9s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px) scale(1.06); } }

/* Skill bar: round medallions on the ground strip, left of the enemy. */
#skill-bar { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; }
.skill-btn {
  position: relative;
  width: 46px;
  height: 46px;
  padding: 0;
  background: radial-gradient(circle at 40% 35%, #8a5a36, #47291a);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px #c8871a, 0 3px 0 rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.skill-btn img { width: 32px; height: 32px; display: block; margin: auto; }
.skill-btn.ready { box-shadow: inset 0 0 0 2px var(--gold), 0 0 12px var(--skill), 0 3px 0 rgba(0, 0, 0, 0.4); animation: ready 1.4s ease-in-out infinite; }
.skill-btn.active { box-shadow: inset 0 0 0 3px var(--skill), 0 0 16px var(--skill); }
.skill-btn:active.ready { transform: translateY(2px) scale(0.96); }
@keyframes ready { 50% { transform: scale(1.06); } }
.skill-shade {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 10, 0.7);
  transform-origin: bottom;
  transform: scaleY(0);
}
.skill-time {
  position: absolute;
  inset: auto 0 6px 0;
  font-family: var(--display);
  font-size: 12px;
  line-height: 1;
  text-align: center;
  text-shadow: var(--outline);
}
.skill-btn.active .skill-time { color: var(--skill); font-size: 15px; }

#auto-btn { align-self: center; font-size: 14px; padding: 5px 14px; white-space: nowrap; }

/* ---------- Panel (bottom half): wood planks ---------- */

#panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 2px, transparent 2px 64px),
    repeating-linear-gradient(0deg, rgba(255, 210, 150, 0.04) 0 3px, transparent 3px 9px),
    linear-gradient(#6b4128, #5a3620);
  border-top: 3px solid var(--ink);
  box-shadow: inset 0 3px 0 rgba(255, 210, 150, 0.2);
}

#buy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 6px;
  font-family: var(--display);
  font-size: 14px;
  color: var(--dim);
  text-shadow: var(--outline);
}
.seg { display: flex; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.seg button {
  color: var(--cream);
  min-width: 52px;
  height: 32px;
  padding: 0 6px;
  font-family: var(--display);
  font-size: 14px;
  background: linear-gradient(#8a5a36, #5a3620);
  border: 0;
  border-left: 2px solid var(--ink);
  text-shadow: var(--outline);
}
.seg button:first-child { border-left: 0; }
.seg button.active { background: linear-gradient(#ffe680, #f6c03a 60%, #c8871a); color: var(--parch-ink); text-shadow: none; }

#pages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 10px 12px;
}
.page { display: flex; flex-direction: column; gap: 8px; }
.list { display: flex; flex-direction: column; gap: 7px; }

/* Parchment cards. */
.card {
  background: linear-gradient(175deg, #fbf0d0, #f0dca8);
  color: var(--parch-ink);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), inset 0 -4px 0 rgba(150, 100, 40, 0.25), 0 3px 0 rgba(0, 0, 0, 0.35);
}

.summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2px 4px; padding: 4px 6px; }
.sum-stat { display: inline-flex; align-items: center; gap: 1px; line-height: 18px; cursor: help; }
.sum-stat img { width: 16px; height: 16px; flex: none; }
.sum-stat b { font-family: var(--display); font-weight: 400; font-size: 13px; white-space: nowrap; }

.item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 8px;
}
.item.locked { filter: saturate(0.4); opacity: 0.75; }
.item-icon { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(80, 40, 10, 0.25)); }
.item-body { min-width: 0; line-height: 1.2; }
.item-title { display: flex; align-items: baseline; gap: 6px; }
.item-name { font-family: var(--display); font-weight: 400; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-level { font-size: 12px; font-weight: 700; color: var(--gold-dark); white-space: nowrap; }
.item-desc { font-size: 13px; font-weight: 600; }
.item-note { font-size: 11px; color: var(--parch-dim); }

/* Chunky glossy buttons. */
.buy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  min-height: 50px;
  padding: 3px 8px;
  background: linear-gradient(#8fe06a, #62bd45 50%, #3b8a2a);
  color: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -4px 0 rgba(0, 0, 0, 0.2), 0 3px 0 rgba(0, 0, 0, 0.35);
  line-height: 1.1;
  text-shadow: var(--outline);
}
.buy-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 1px 0 rgba(0, 0, 0, 0.35); }
.buy-btn:disabled { background: linear-gradient(#b8a890, #8a7a64); color: #efe4d0; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15); }
.buy-label { font-family: var(--display); font-size: 13px; }
.buy-cost { display: flex; align-items: center; gap: 3px; font-family: var(--display); font-size: 16px; }
.buy-cost img { width: 18px; height: 18px; }

.info { padding: 10px 12px; }
.info h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--display); font-weight: 400; font-size: 19px; }
.info h3 img { width: 28px; height: 28px; }
.info p { margin: 0 0 10px; font-size: 14px; line-height: 1.35; }
.note { color: var(--parch-dim); font-size: 13px !important; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  border-bottom: 2px dotted rgba(120, 80, 40, 0.35);
}
.stat-row b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row.highlight b { color: var(--soul-dark); font-size: 20px; }

.btn {
  padding: 8px 14px;
  font-family: var(--display);
  font-size: 16px;
  color: var(--cream);
  background: linear-gradient(#a8784a, #7a4a2c 55%, #5a3620);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: inset 0 2px 0 rgba(255, 230, 180, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 3px 0 rgba(0, 0, 0, 0.35);
  text-shadow: var(--outline);
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 230, 180, 0.3), 0 1px 0 rgba(0, 0, 0, 0.35); }
.btn:disabled { filter: grayscale(0.7); opacity: 0.55; }
.btn.accent { background: linear-gradient(#8fe06a, #62bd45 50%, #3b8a2a); }
.btn.danger { background: linear-gradient(#ff8a7a, #d8443e 50%, #962a2a); }
.btn.soul { background: linear-gradient(#a888c8, #6a4f8a); }
.btn.soul:not(:disabled) { background: linear-gradient(#d8a8ff, #b56fe8 50%, #6a2f9a); }
.btn.big { width: 100%; margin-top: 12px; padding: 12px; font-size: 20px; }
.btn.small { padding: 4px 12px; min-width: 80px; font-size: 15px; }
.btn.small.off { background: linear-gradient(#b8a890, #8a7a64); }
.btn.gem { background: linear-gradient(#9ad8ff, #3a8ae0 55%, #2a5fb0); }
#reset-btn { width: 100%; margin-top: 10px; }

.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 0; min-width: 0; padding-inline: 6px; }

.page-hint { margin: 2px 2px 0; font-size: 13px; line-height: 1.3; color: var(--dim); text-shadow: 0 1px 0 var(--ink); }

/* Tabs: a dark wood bar with medallion icons. */
#tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 4px 4px calc(4px + var(--safe-bottom));
  background: linear-gradient(#3a2216, #2a1810);
  border-top: 3px solid var(--ink);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 0 4px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 11px;
  color: var(--dim);
  text-shadow: var(--outline);
}
.tab img { width: 32px; height: 32px; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.4)); transition: transform 0.15s; }
.tab.active { background: linear-gradient(#8a5a36, #5a3620); border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--gold), 0 2px 0 rgba(0, 0, 0, 0.4); color: var(--cream); }
.tab.active img { transform: scale(1.12) translateY(-2px); }
.tab.badge::after {
  content: '!';
  position: absolute;
  top: 1px;
  right: calc(50% - 26px);
  width: 16px;
  height: 16px;
  font-size: 11px;
  line-height: 13px;
  color: var(--cream);
  background: radial-gradient(circle at 35% 30%, #ff9a7a, #d8443e);
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: badge 1.2s ease-in-out infinite;
}
@keyframes badge { 50% { transform: scale(1.18); } }

/* ---------- Overlays ---------- */

#toast {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  font-family: var(--display);
  font-size: 16px;
  color: var(--parch-ink);
  background: linear-gradient(#fbf0d0, #f0dca8);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--gold), 0 4px 0 rgba(0, 0, 0, 0.4);
  z-index: 30;
  pointer-events: none;
  white-space: nowrap;
}
#toast.show { animation: toast 1.8s ease-out forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.8); } 10%, 85% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; } }

#modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 10, 8, 0.7);
}
.modal-box {
  width: min(100%, 380px);
  padding: 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), 0 0 0 3px var(--gold), 0 0 0 6px var(--ink), 0 8px 30px rgba(0, 0, 0, 0.6);
  animation: open 0.22s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes open { from { transform: scale(0.85); opacity: 0; } }
.modal-box h2 { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 23px; color: var(--red-dark); }
.modal-box p { margin: 0 0 10px; font-size: 15px; line-height: 1.35; }
#modal-actions { margin-top: 12px; }
.code-box {
  width: 100%;
  height: 96px;
  padding: 8px;
  font: 12px ui-monospace, monospace;
  color: var(--parch-ink);
  background: #fffaf0;
  border: 2px solid var(--parch-dim);
  border-radius: 8px;
  resize: none;
  word-break: break-all;
}

@media (prefers-reduced-motion: reduce) {
  #tap-hint, .tab.badge::after, .skill-btn.ready, .pill.pulse, .modal-box { animation: none; }
}

@media (min-height: 900px) {
  #battle { flex-basis: 48%; }
}

/* Faint on purpose: findable, never in the way. */
.version {
  position: absolute;
  top: var(--safe-top);
  right: 0;
  z-index: 2;
  padding: 2px 8px 6px 12px;
  font-size: 10px;
  line-height: 11px;
  color: var(--cream);
  background: none;
  border: 0;
  opacity: 0.4;
  text-shadow: 0 1px 0 var(--ink);
}
.version:hover, .version:focus-visible { opacity: 0.85; }

.changelog h3 { display: flex; justify-content: space-between; margin: 10px 0 4px; font-family: var(--display); font-weight: 400; font-size: 17px; color: var(--gold-dark); }
.changelog h3:first-child { margin-top: 0; }
.changelog h3 span { font-family: var(--font); font-size: 11px; color: var(--parch-dim); }
.changelog ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.35; }
.changelog li { margin-bottom: 3px; }
#modal-body:has(.changelog) { max-height: 55vh; overflow-y: auto; }

.section-title { display: flex; gap: 8px; align-items: baseline; margin: 6px 2px 0; font-family: var(--display); font-weight: 400; font-size: 17px; text-shadow: var(--outline); }
.section-title span { font-family: var(--font); font-size: 12px; color: var(--dim); }

.wallet { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.wallet span { display: inline-flex; align-items: center; gap: 4px; }
.wallet b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.wallet img { width: 22px; height: 22px; }

.pet-show { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; padding: 8px; }
.pet-img { width: 70px; height: 70px; object-fit: contain; }
.pet-info { min-width: 0; line-height: 1.25; }
.pet-tags { display: flex; gap: 6px; align-items: baseline; font-size: 12px; font-weight: 700; }
.pet-tags .rarity { text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.stars { color: var(--gold-dark); letter-spacing: 1px; }
.pet-name { font-family: var(--display); font-weight: 400; font-size: 18px; }

.buy-btn.crystal { background: linear-gradient(#a8f8c8, #3fc08a 55%, #2a8a5a); }
.buy-btn.crystal:disabled { background: linear-gradient(#b8a890, #8a7a64); }
.egg .btn.big { margin: 10px 0 8px; }

.pet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.pet-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--parch-ink);
  background: linear-gradient(175deg, #fbf0d0, #f0dca8);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--rarity), 0 3px 0 rgba(0, 0, 0, 0.35);
  line-height: 1.15;
}
.pet-tile img { width: 50px; height: 50px; object-fit: contain; filter: brightness(0) opacity(0.35); }
.pet-tile.owned img { filter: drop-shadow(0 2px 0 rgba(80, 40, 10, 0.25)); }
.pet-tile.active { box-shadow: inset 0 0 0 2px var(--rarity), 0 0 0 3px var(--gold), 0 3px 0 rgba(0, 0, 0, 0.35); }
.pet-tile:disabled { opacity: 0.8; }
.pet-tile-name { font-family: var(--display); font-size: 13px; text-align: center; }
.pet-tile-stars { font-size: 11px; font-weight: 700; color: var(--rarity); text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3); }

.egg-reveal { display: block; width: 110px; height: 110px; margin: 4px auto 6px; object-fit: contain; animation: reveal 0.6s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes reveal { 0% { transform: scale(0.2) rotate(-25deg); opacity: 0; } }
.modal-box .egg-rarity { text-align: center; font-family: var(--display); font-size: 22px; margin-bottom: 4px !important; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }

.dg-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; font-family: var(--display); font-size: 15px; text-shadow: var(--outline); }
.dg-head b { color: #ffe680; font-weight: 400; }
.dg-stage { height: 170px; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; background: #24203a; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
#dungeon-canvas { width: 100%; height: 100%; display: block; }

.role { font-size: 10px; font-weight: 700; padding: 1px 6px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); white-space: nowrap; }
.role-tank { background: #b8c8d8; }
.role-dps { background: #ff9a6a; }
.role-mage { background: #d8a8ff; }
.role-healer { background: #b8f07a; }
.item.in-team { box-shadow: inset 0 0 0 2px var(--gold), inset 0 -4px 0 rgba(150, 100, 40, 0.25), 0 3px 0 rgba(0, 0, 0, 0.35); }
.team-btn {
  margin-top: 3px;
  padding: 2px 10px;
  font-family: var(--display);
  font-size: 12px;
  color: var(--cream);
  background: linear-gradient(#a8784a, #6b4128);
  border: 2px solid var(--ink);
  border-radius: 999px;
  text-shadow: var(--outline);
}
.item.in-team .team-btn { background: linear-gradient(#ffe680, #f6c03a 60%, #c8871a); color: var(--parch-ink); text-shadow: none; }
.team-btn:disabled { opacity: 0.45; }

/* ---------- v0.2: top-right menu, windows ---------- */

.menu-btn {
  position: absolute;
  top: calc(var(--safe-top) + 15px);
  right: 8px;
  z-index: 3;
  width: 42px;
  height: 38px;
  padding: 0;
  background: linear-gradient(#8a5a36, #5a3620);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: inset 0 2px 0 rgba(255, 220, 160, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.3), 0 2px 0 rgba(0, 0, 0, 0.35);
}
.menu-btn img { width: 28px; height: 28px; display: block; margin: auto; }
.bag-btn { top: calc(var(--safe-top) + 61px); }
.bag-btn img { width: 30px; height: 30px; }
.menu-btn.open { background: linear-gradient(#ffe680, #f6c03a 60%, #c8871a); }
.menu-btn:active { transform: translateY(1px); }
.menu-btn.badge::after, .menu-pop button.badge::after {
  content: '!';
  position: absolute;
  top: -7px;
  right: -7px;
  width: 18px;
  height: 18px;
  font-family: var(--display);
  font-size: 12px;
  line-height: 15px;
  text-align: center;
  color: var(--cream);
  background: radial-gradient(circle at 35% 30%, #ff9a7a, #d8443e);
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: badge 1.2s ease-in-out infinite;
}

/* The square bubble of shortcuts, pointing at the menu button. */
.menu-pop {
  position: absolute;
  top: calc(var(--safe-top) + 62px);
  right: 8px;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(4, 72px);
  gap: 6px;
  padding: 10px;
  background: linear-gradient(#6b4128, #4a2c1a);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px #c8871a99, 0 6px 20px rgba(0, 0, 0, 0.5);
  animation: pop 0.18s cubic-bezier(0.2, 1.6, 0.4, 1);
  transform-origin: calc(100% - 20px) 0;
}
.menu-pop::before {
  content: '';
  position: absolute;
  top: -11px;
  right: 14px;
  border: 9px solid transparent;
  border-top: 0;
  border-bottom: 10px solid var(--ink);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.menu-pop button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 76px;
  padding: 7px 2px 5px;
  color: var(--parch-ink);
  background: linear-gradient(175deg, #fbf0d0, #f0dca8);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: inset 0 -3px 0 rgba(150, 100, 40, 0.25), 0 2px 0 rgba(0, 0, 0, 0.35);
  font-family: var(--display);
  font-size: 11.5px;
  line-height: 1.05;
}
.menu-pop button img { width: 38px; height: 38px; }
.menu-pop button:active { transform: translateY(2px); }

/* Parchment window over the whole app. */
#window {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 14px) 12px calc(var(--safe-bottom) + 14px);
  background: rgba(20, 10, 8, 0.66);
}
.window-box {
  display: flex;
  flex-direction: column;
  width: min(100%, 440px);
  max-height: 100%;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), 0 0 0 3px var(--gold), 0 0 0 6px var(--ink), 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: open 0.22s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.window-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(#8a5a36, #5a3620);
  border-bottom: 3px solid var(--ink);
}
.window-head img { width: 34px; height: 34px; }
.window-head h2 { flex: 1; margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--cream); text-shadow: var(--outline); }
.close-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--cream);
  background: radial-gradient(circle at 35% 30%, #ff8a7a, #c8353a);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  text-shadow: var(--outline);
}
#window-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
.window-view { display: flex; flex-direction: column; gap: 10px; }
.window-view .card { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45), 0 2px 0 rgba(0, 0, 0, 0.2); }
.window-lead { margin: 0; font-size: 14px; line-height: 1.35; }
.center { text-align: center; }
#modal { z-index: 25; }

/* Daily login. */
.daily-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.daily-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 7px;
  background: linear-gradient(#fffaf0, #f0e0b8);
  border: 2px solid var(--parch-dim);
  border-radius: 12px;
}
.daily-tile.big { grid-column: span 2; background: linear-gradient(#fff3c8, #f6d88a); border-color: var(--gold-dark); }
.daily-day { font-family: var(--display); font-size: 13px; color: var(--parch-dim); }
.daily-reward { display: inline-flex; align-items: center; gap: 3px; font-family: var(--display); font-size: 14px; }
.daily-reward img { width: 18px; height: 18px; }
.daily-reward b { font-weight: 400; }
.daily-check {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #3b8a2a;
  background: rgba(240, 230, 200, 0.6);
  border-radius: 10px;
  text-shadow: 0 2px 0 #fff;
}
.daily-tile.claimed .daily-check { display: flex; }
.daily-tile.claimed { filter: saturate(0.6); }
.daily-tile.today { border-color: var(--green-dark); box-shadow: 0 0 0 3px var(--gold), 0 0 14px rgba(246, 192, 58, 0.8); animation: ready 1.4s ease-in-out infinite; }
.daily-streak { text-align: center; font-family: var(--display); font-size: 16px; color: var(--red-dark); }
.window-view .btn.big { margin-top: 0; }

/* Mail. */
.mail-card { padding: 0; overflow: hidden; }
.mail-top { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; text-align: left; color: inherit; }
.mail-icon { width: 40px; height: 40px; }
.mail-text { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.mail-text b { font-family: var(--display); font-weight: 400; font-size: 16px; }
.mail-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--red); border: 2px solid var(--ink); }
.mail-card.open .mail-top { border-bottom: 2px dotted rgba(120, 80, 40, 0.35); }
.mail-body { padding: 8px 12px 12px; }
.mail-body p { margin: 0 0 8px; font-size: 14px; line-height: 1.4; }
.mail-reward { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.mail-reward .btn { margin-left: auto; min-width: 90px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 4px; background: #fffaf0; border: 2px solid var(--parch-dim); border-radius: 999px; font-family: var(--display); font-size: 14px; }
.chip img { width: 22px; height: 22px; }
.chip b { font-weight: 400; }

/* Leaderboard placeholder. */
.soon { align-items: center; padding: 10px 6px 16px; text-align: center; }
.soon-art { width: 96px; height: 96px; animation: bob 2s ease-in-out infinite; }
.soon-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--red-dark); }
.soon p { margin: 0; font-size: 14px; line-height: 1.4; }

/* Blog. */
.blog-tabs { align-self: center; }
.blog-tabs button { min-width: 120px; }
.version-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; }
.version-chip {
  flex: 0 0 auto;
  padding: 4px 12px;
  font-family: var(--display);
  font-size: 14px;
  color: var(--parch-ink);
  background: #fffaf0;
  border: 2px solid var(--parch-dim);
  border-radius: 999px;
}
.version-chip.active { color: var(--cream); background: linear-gradient(#8a5a36, #5a3620); border-color: var(--ink); text-shadow: var(--outline); }
.blog-notes { display: flex; flex-direction: column; gap: 4px; }
.news-card { padding: 0; overflow: hidden; }
.news-cover { display: block; width: 100%; aspect-ratio: 9 / 4; object-fit: cover; border-bottom: 3px solid var(--ink); background: #c8e0f0; }
.news-text { padding: 8px 12px 12px; }
.news-text h3 { margin: 2px 0 6px; font-family: var(--display); font-weight: 400; font-size: 19px; }
.news-text p { margin: 0 0 8px; font-size: 14px; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .menu-btn.badge::after, .menu-pop button.badge::after, .daily-tile.today, .soon-art, .menu-pop, .window-box { animation: none; }
}

/* ---------- v0.3: quests and achievements ---------- */

.quest-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.quest-row.ready { box-shadow: inset 0 0 0 2px var(--gold), 0 0 10px rgba(246, 192, 58, 0.6); }
.quest-row.done { opacity: 0.6; filter: saturate(0.6); }
.quest-row.bonus { background: linear-gradient(175deg, #fff3c8, #f6d88a); }
.quest-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.quest-body b { font-family: var(--display); font-weight: 400; font-size: 15px; line-height: 1.15; }
.quest-bar { position: relative; height: 14px; background: #e6d4a8; border: 2px solid var(--parch-dim); border-radius: 999px; overflow: hidden; }
.quest-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(#8fe06a, #3b8a2a); }
.quest-count { position: absolute; inset: 0; font-family: var(--display); font-size: 10px; line-height: 10px; text-align: center; color: var(--cream); text-shadow: var(--outline); }
.quest-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.quest-side .btn { min-width: 64px; }
.reward-chips { display: flex; gap: 4px; }
.chip.small { padding: 1px 7px 1px 2px; font-size: 12px; }
.chip.small img { width: 16px; height: 16px; }
.ach-tiers { color: var(--gold-dark); font-size: 12px; letter-spacing: 1px; }

/* ---------- v0.4: equipment, soul tree, synergies, pet abilities ---------- */

.gear-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.gear-head b { font-family: var(--display); font-weight: 400; font-size: 17px; }
.gear-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.gear-slot.selected .item-tile { box-shadow: inset 0 0 0 3px var(--rarity), 0 0 0 3px var(--gold); }
.gear-label { font-size: 11px; font-weight: 700; color: var(--parch-dim); }
.item-tile {
  position: relative;
  width: 60px;
  height: 60px;
  padding: 4px;
  background: radial-gradient(circle at 50% 40%, #fffaf0, #e8d6aa);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: inset 0 0 0 3px var(--rarity, #b8a890), 0 2px 0 rgba(0, 0, 0, 0.3);
}
.item-tile img { width: 100%; height: 100%; display: block; }
.item-tile.empty { opacity: 0.7; }
.item-tile.selected { box-shadow: inset 0 0 0 3px var(--rarity), 0 0 0 3px var(--gold); }
.item-tile.better::before { content: '▲'; position: absolute; top: -2px; left: 3px; font-size: 11px; color: #3b8a2a; text-shadow: 0 1px 0 #fff; }
.item-lvl { position: absolute; right: 2px; bottom: 0; font-family: var(--display); font-size: 10px; color: var(--cream); text-shadow: var(--outline); }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; justify-items: center; }
.item-detail { padding: 10px; }
.detail-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.detail-img { width: 56px; height: 56px; }
.detail-title { display: flex; flex-direction: column; line-height: 1.2; }
.detail-title b { font-family: var(--display); font-weight: 400; font-size: 19px; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25); }
.detail-stats .stat-row b.up { color: #3b8a2a; }
.detail-stats .stat-row b.down { color: #c0303a; }
.item-detail .btn-row { margin-top: 8px; }
.gear-view .btn.big { display: flex; align-items: center; justify-content: center; gap: 8px; }
.gear-view .btn.big img { width: 30px; height: 30px; }
.gear-view .wallet img { width: 18px; height: 18px; }
.gear-view .wallet b { margin-right: 6px; }

.soul-tree { display: flex; flex-direction: column; gap: 6px; }
.tree-points { display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.tree-points b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--soul-dark); }
.tree-branch { margin: 8px 0 0; font-family: var(--display); font-weight: 400; font-size: 16px; }
.tree-branch.branch-war { color: #c0303a; }
.tree-branch.branch-wealth { color: var(--gold-dark); }
.tree-branch.branch-time { color: #2a6fc0; }
.tree-node { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #fffaf0; border: 2px solid var(--parch-dim); border-radius: 10px; }
.tree-node.maxed { background: #f3ead0; }
.tree-body { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.tree-body b { font-family: var(--display); font-weight: 400; font-size: 15px; }
.tree-pips { color: var(--soul-dark); font-size: 10px; letter-spacing: 1px; margin-left: 4px; }
.tree-node .btn { min-width: 74px; }

.synergy-row { display: flex; flex-wrap: wrap; gap: 5px; }
.synergy { padding: 2px 9px; font-family: var(--display); font-size: 12px; color: var(--dim); background: rgba(0, 0, 0, 0.25); border: 2px solid rgba(0, 0, 0, 0.4); border-radius: 999px; cursor: pointer; }
.synergy.on { color: var(--parch-ink); background: linear-gradient(#ffe680, #f6c03a); border-color: var(--ink); }

.pet-ability { margin-top: 3px; font-size: 12px; font-weight: 600; color: #6a3a9a; line-height: 1.25; }

/* ---------- v0.5: Ekipman screen ---------- */

#gear-screen {
  position: absolute;
  inset: 0;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 10px) 10px calc(var(--safe-bottom) + 10px);
  background: rgba(20, 10, 8, 0.72);
}
.gs-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 460px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 10px 10px;
  background:
    radial-gradient(circle at 50% 18%, #fff6dc 0%, rgba(255, 246, 220, 0) 45%),
    linear-gradient(175deg, #f6e7c1, #e8cf98);
  color: var(--parch-ink);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 0 0 3px #c8871a, 0 0 0 6px var(--ink), 0 12px 34px rgba(0, 0, 0, 0.6);
  animation: open 0.24s cubic-bezier(0.2, 1.6, 0.4, 1);
}
.gs-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -10px;
  padding: 8px 10px;
  background: linear-gradient(#8a5a36, #5a3620);
  border-bottom: 3px solid var(--ink);
}
.gs-head img { width: 32px; height: 32px; }
.gs-head h2 { flex: 1; margin: 0; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--cream); text-shadow: var(--outline); }
.gs-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; gap: 4px; padding: 2px 0 4px; }
.gs-portrait { position: relative; z-index: 1; align-self: start; width: 150px; height: 150px; margin-top: -4px; filter: drop-shadow(0 6px 4px rgba(80, 40, 10, 0.3)); }
.gs-col { display: flex; flex-direction: column; gap: 10px; }
.gs-totals { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; min-height: 26px; }
.gs-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gs-bag { min-height: 80px; }
.gs-panel > .btn.gem { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; }
.gs-panel > .btn.gem img { width: 28px; height: 28px; }
.gs-panel .wallet img { width: 18px; height: 18px; }
.gs-panel .wallet b { margin-right: 6px; }

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px 1px 3px;
  font-family: var(--display);
  font-size: 13px;
  line-height: 18px;
  background: #fffaf0;
  border: 1.5px solid var(--parch-dim);
  border-radius: 999px;
}
.stat-chip img { width: 18px; height: 18px; }
.stat-chip b { font-weight: 400; }
.stat-chip i { font-style: normal; font-size: 10px; }
.stat-chip i.up { color: #3b8a2a; }
.stat-chip i.down { color: #c0303a; }

.item-tile .item-lock { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; }
.item-mark { position: absolute; top: 0; left: 4px; font-size: 12px; text-shadow: 0 1px 0 #fff; }
.item-mark.up { color: #3b8a2a; }
.item-mark.down { color: #c0303a; }
.item-tile.better::before { content: none; }

.gs-pop {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 14px calc(var(--safe-bottom) + 18px);
  background: rgba(20, 10, 8, 0.4);
}
.gs-card { width: min(100%, 420px); padding: 10px 12px 12px; animation: open 0.2s cubic-bezier(0.2, 1.6, 0.4, 1); box-shadow: 0 0 0 3px var(--gold), 0 0 0 6px var(--ink), 0 8px 26px rgba(0, 0, 0, 0.55); }
.gs-card .detail-head { margin-bottom: 8px; }
.gs-card .detail-title { flex: 1; }
.close-btn.small { width: 30px; height: 30px; font-size: 14px; }
.gs-stats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.gs-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gs-buttons .btn { padding: 7px 6px; font-size: 15px; }

/* Toggle switch. */
.switch { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-ui { position: relative; width: 40px; height: 22px; background: #b8a890; border: 2px solid var(--ink); border-radius: 999px; transition: background 0.15s; }
.switch-ui::after { content: ''; position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; background: #fffaf0; border: 2px solid var(--ink); border-radius: 50%; transition: transform 0.15s; }
.switch input:checked + .switch-ui { background: var(--green); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- v0.6: mega boss map ---------- */

.map-keys { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 4px; background: #fffaf0; border: 2px solid #c8871a; border-radius: 12px; }
.map-keys > img { width: 30px; height: 30px; flex: none; }
.map-keys-text { flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.map-keys-text b { font-family: var(--display); font-weight: 400; font-size: 17px; }
.map-keys-text span { font-size: 11px; font-weight: 600; color: var(--parch-dim); }
.map-keys .btn { display: inline-flex; align-items: center; gap: 4px; }
.map-keys .btn img { width: 18px; height: 18px; }
.map-view .note.center { margin: 2px 0 8px; }
.map-road { display: flex; flex-direction: column; }
.map-road-link { display: block; width: 100%; height: 26px; margin: -6px 0; overflow: visible; }
.map-road-link path { fill: none; stroke: #8a5a32; stroke-width: 3; stroke-dasharray: 6 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.map-stop { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; }
.map-stop.right { flex-direction: row-reverse; }
.map-art { position: relative; flex: none; width: 96px; height: 96px; }
.map-pic {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: radial-gradient(circle at 50% 40%, #4a3a5a, #1a1424);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 3px #c8871a, 0 0 0 5px var(--ink), 0 4px 8px rgba(60, 30, 10, 0.35);
}
.map-stop:not(.locked) .map-pic { box-shadow: 0 0 0 3px #ffe680, 0 0 0 5px var(--ink), 0 0 16px 4px rgba(255, 120, 60, 0.6); }
.map-stop.locked .map-pic { filter: grayscale(1) brightness(0.55); }
.map-stop.soon .map-art::after { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 44px; color: #f6e7c1; text-shadow: var(--outline); }
.map-stop.soon .map-lock { display: none; }
.map-lock { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); }
.map-check {
  position: absolute;
  right: -4px;
  bottom: -2px;
  width: 26px;
  height: 26px;
  font-family: var(--display);
  font-size: 16px;
  line-height: 22px;
  text-align: center;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #8ae07a, #3b8a2a);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.map-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; background: #fffaf0; border: 2px solid var(--parch-dim); border-radius: 12px; }
.map-stop:not(.locked) .map-info { border-color: #c8871a; }
.map-stop.locked .map-info { opacity: 0.7; }
.map-title { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.map-name { font-family: var(--display); font-weight: 400; font-size: 17px; line-height: 1.1; }
.map-lvl { font-family: var(--display); font-size: 13px; color: #c0303a; }
.map-range { font-size: 11px; font-weight: 600; color: var(--parch-dim); }
.map-boss { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: #6a2a3a; }
.map-boss img { width: 28px; height: 28px; flex: none; }
.map-trophy { font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--gold-dark); }
.map-reward:empty { display: none; }
.map-fight { margin-top: 4px; padding: 5px 8px; font-size: 14px; }
.reward-line { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-family: var(--display); font-size: 17px; }
.reward-line img { width: 26px; height: 26px; flex: none; }
.reward-line.trophy { color: var(--gold-dark); font-size: 15px; }
.map-reward { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; }
.map-reward-label { font-size: 12px; font-weight: 700; color: var(--parch-dim); }
.reward-chip { display: inline-flex; align-items: center; gap: 2px; font-family: var(--display); font-size: 14px; color: var(--parch-ink); }
.reward-chip img { width: 20px; height: 20px; }
.reward-chip b { font-weight: 400; }
