html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #080d14;
  font-family: "Georgia", "Palatino Linotype", "Book Antiqua", serif;
  color: #f4ead2;
  user-select: none;
}

#c { display: block; width: 100%; height: 100%; }

/* Hide 3D view until New Game / Continue */
body:not(.in-game) #c {
  visibility: hidden;
}

#story-bg {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background-color: #080d14;
  background-position: center;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.45s ease;
}
#story-bg.on { opacity: 0.85; }
body:not(.in-game) #story-bg.on { opacity: 0.85; }
body.in-game #story-bg.on { opacity: 0; }
body.in-game.dialog-open #story-bg.on { opacity: 0.95; z-index: 10; }
#story-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.28) 0%, rgba(8, 12, 20, 0.5) 48%, rgba(8, 12, 20, 0.78) 100%);
}

#vignette {
  pointer-events: none;
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,.35) 100%);
  transition: opacity 0.6s ease;
}

body.indoor #vignette {
  background: radial-gradient(ellipse at center, transparent 62%, rgba(0,0,0,.28) 100%);
}

#hud, #dialog, #mirror, #win { position: fixed; pointer-events: none; }
#hud { inset: 0; z-index: 8; }
#dialog { z-index: 12; }
#mirror { z-index: 11; }
#win { z-index: 16; }

#top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 26px;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.75) 0%, transparent 100%);
}

.brand {
  letter-spacing: .35em;
  color: #f5d061;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(245, 208, 97, 0.4);
}

#room-name {
  opacity: .85;
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: 0.08em;
  color: #cce4f5;
}

#courage {
  display: inline-flex;
  align-items: center;
  white-space: nowrap !important;
  word-break: keep-all !important;
  font-size: clamp(16px, 2.5vw, 22px);
  letter-spacing: clamp(4px, 1vw, 6px);
  color: #f5d061;
  text-shadow: 0 0 14px rgba(245, 208, 97, 0.75);
  line-height: 1;
}

#rewind {
  color: #1ad4c5;
  font-size: 17px;
  letter-spacing: 6px;
  margin-top: 4px;
  opacity: .95;
  text-shadow: 0 0 10px rgba(26, 212, 197, 0.6);
}

#meters {
  text-align: right;
  white-space: nowrap !important;
}
#play-time {
  display: inline-block;
  color: #ece2d0;
  font-size: 13px;
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 0.08em;
  opacity: 0.85;
  text-shadow: 0 0 6px rgba(245, 208, 97, 0.4);
}

#checkpoint-banner {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  background: linear-gradient(90deg, rgba(8, 16, 28, 0), rgba(12, 28, 44, 0.92) 20%, rgba(12, 28, 44, 0.92) 80%, rgba(8, 16, 28, 0));
  border-top: 1px solid #1ad4c5;
  border-bottom: 1px solid #f5d061;
  color: #6efff3;
  font-size: 15px;
  letter-spacing: 0.16em;
  text-align: center;
  text-shadow: 0 0 12px #1ad4c5;
  animation: banner-float 3.5s ease-in-out forwards;
}

@keyframes banner-float {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -15px); }
}

#boss-hud {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 80vw);
  text-align: center;
}

#boss-title {
  color: #ff6666;
  font-size: 13px;
  letter-spacing: 0.25em;
  margin-bottom: 6px;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.6);
}

#boss-hp-bar {
  width: 100%;
  height: 10px;
  background: rgba(10, 10, 20, 0.8);
  border: 1px solid #f5d061;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(245, 208, 97, 0.35);
}

#boss-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff3344, #9333ea);
  transition: width 0.4s ease-out;
}

#weapons {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: clamp(4px, 1vw, 8px);
}

.slot {
  width: 112px;
  padding: 6px 10px;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(245, 208, 97, 0.4);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  transition: all 0.25s ease;
}

.slot.locked { opacity: .32; filter: grayscale(0.6); }
.slot.on { border-color: #1ad4c5; box-shadow: 0 0 16px rgba(26,212,197,.3); }
.slot.active { animation: pulse-slot 0.9s ease-in-out infinite; }

.slot-zanbeel.on { border-color: #f5d061; }
.slot-cloak.on { border-color: #2dd4bf; }
.slot-eye.on { border-color: #1ad4c5; }
.slot-mirror.on { border-color: #93c5fd; }
.slot-sword.on { border-color: #fbbf24; }

.slot-zanbeel.active { box-shadow: 0 0 24px rgba(245,208,97,.65); }
.slot-cloak.active { box-shadow: 0 0 24px rgba(45,212,191,.65); }
.slot-eye.active { box-shadow: 0 0 24px rgba(26,212,197,.65); }
.slot-mirror.active { box-shadow: 0 0 24px rgba(147,197,253,.65); }
.slot-sword.active { box-shadow: 0 0 24px rgba(251,191,36,.65); }

@keyframes pulse-slot {
  0%, 100% { box-shadow: 0 0 10px rgba(26,212,197,.25); }
  50% { box-shadow: 0 0 24px rgba(26,212,197,.65); }
}

.slot kbd {
  color: #1ad4c5;
  font-family: sans-serif;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 4px;
}

.slot .n { display: block; font-size: 11px; font-weight: 600; line-height: 1.2; color: #f4ead2; }
.slot .e { display: block; font-size: 10px; opacity: 0.75; color: #d4e4f0; }
.elem-badge { font-size: 10px; }

#bonaq-msg {
  position: absolute;
  top: 64px;
  width: 100%;
  text-align: center;
  color: #1ad4c5;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-shadow: 0 0 12px #1ad4c5;
}

#dialog {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(12, 20, 36, 0.96), rgba(6, 10, 18, 0.98));
  border-top: 2px solid #f5d061;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 18px 32px max(18px, env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), inset 0 1px 12px rgba(245, 208, 97, 0.15);
  z-index: 25;
  pointer-events: auto !important;
  cursor: pointer;
}

.dialog-skip-all-btn {
  position: absolute;
  top: 14px;
  right: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(245, 208, 97, 0.5);
  color: #dfbe7a;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto !important;
  transition: all 0.15s ease;
}

.dialog-skip-all-btn:hover, .dialog-skip-all-btn:active {
  background: rgba(245, 208, 97, 0.3);
  color: #fff;
}

#dialog .who {
  color: #f5d061;
  letter-spacing: .16em;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 6px;
}

#dialog .line {
  font-size: 22px;
  line-height: 1.4;
  color: #f8f2e2;
}

#dialog .next {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  margin-top: 10px;
  background: rgba(14, 28, 44, 0.7);
  border: 1.5px solid rgba(245, 208, 97, 0.45);
  border-radius: 8px;
  color: #1ad4c5;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  pointer-events: auto !important;
  box-shadow: 0 0 12px rgba(245, 208, 97, 0.2);
  transition: all 0.15s ease;
}
#dialog .next:hover, #dialog .next:active {
  background: rgba(24, 44, 68, 0.9);
  border-color: #f5d061;
  color: #fce79a;
  box-shadow: 0 0 18px rgba(245, 208, 97, 0.5);
  transform: translateY(-1px);
}
#dialog .next .caret {
  display: inline-block;
  margin-left: 6px;
  color: #f5d061;
  font-size: 18px;
  animation: dialog-caret 0.85s steps(1) infinite;
}
@keyframes dialog-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

/* Guide NPC Interactive Talk Button */
.npc-talk-btn {
  position: fixed;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  min-width: 240px;
  padding: 12px 24px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(16, 24, 40, 0.95), rgba(30, 48, 72, 0.95));
  border: 2px solid #f5d061;
  color: #fce79a;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 20px rgba(245, 208, 97, 0.45);
  cursor: pointer;
  z-index: 100;
  pointer-events: auto !important;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
  animation: npc-talk-pulse 2s infinite ease-in-out;
}
.npc-talk-btn.hidden {
  display: none !important;
}
body.dialog-open .npc-talk-btn {
  display: none !important;
}
.npc-talk-btn:active {
  transform: translateX(-50%) scale(0.96);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 208, 97, 0.7);
}
.npc-talk-btn .npc-btn-icon {
  font-size: 18px;
  color: #6efff3;
}
.npc-talk-btn .npc-btn-text {
  flex: 1;
  text-align: center;
  white-space: nowrap;
}
.npc-talk-btn .npc-btn-badge {
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(245, 208, 97, 0.25);
  color: #fff2c4;
  border: 1px solid rgba(245, 208, 97, 0.5);
}
@keyframes npc-talk-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 208, 97, 0.4); }
  50% { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8), 0 0 26px rgba(245, 208, 97, 0.7); }
}

#mirror {
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, 75%);
  background: rgba(30, 75, 105, 0.35);
  border: 2px solid rgba(160, 220, 255, 0.65);
  border-radius: 16px;
  padding: 16px 22px;
  text-align: center;
  color: #d9f4ff;
  font-size: 18px;
  box-shadow: 0 0 30px rgba(100, 200, 255, 0.25);
}

#shell, #pause, .panel {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
  z-index: 20;
}

#shell {
  position: fixed;
  background: linear-gradient(180deg, rgba(10, 16, 26, 0.72) 0%, rgba(14, 22, 36, 0.78) 55%, rgba(8, 12, 20, 0.82) 100%);
}

#shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 18%, rgba(184, 223, 245, 0.22), transparent 58%);
  pointer-events: none;
}

#shell > * { position: relative; z-index: 1; }
#pause { background: rgba(5,7,12,.48); z-index: 21; }
.panel { flex-direction: column; text-align: center; padding: 28px; }

.file-box, .book {
  width: min(940px, 94vw);
  padding: 32px 40px 28px;
  background: linear-gradient(180deg, #2a2218 0%, #16120c 100%);
  border: 3px solid #f5d061;
  box-shadow:
    0 0 0 6px #16120c,
    0 0 0 8px #9e8760,
    0 24px 70px rgba(0, 0, 0, 0.75);
  text-align: left;
  color: #f4ead2;
  border-radius: 8px;
}

.crawl-box {
  box-sizing: border-box;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
  text-align: center;
}
#menu .file-box {
  position: relative;
  width: min(94vw, 700px);
  max-width: min(94vw, 700px);
  box-sizing: border-box;
  max-height: min(92vh, calc(100dvh - 32px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(16px, 2.8vw, 26px) clamp(16px, 3.2vw, 30px);
  background: linear-gradient(175deg, rgba(12, 24, 38, 0.96) 0%, rgba(6, 14, 24, 0.98) 100%);
  border: 2px solid #dfbe7a;
  border-radius: 18px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(223, 190, 122, 0.24), inset 0 1px 2px rgba(255, 255, 255, 0.22);
}

/* --- Persian Filigree Corner Ornaments --- */
.menu-filigree {
  position: absolute;
  font-size: 16px;
  color: #dfbe7a;
  text-shadow: 0 0 10px rgba(245, 208, 97, 0.8);
  pointer-events: none;
  line-height: 1;
  z-index: 5;
}
.menu-filigree.top-left { top: 10px; left: 12px; }
.menu-filigree.top-right { top: 10px; right: 12px; }
.menu-filigree.bottom-left { bottom: 10px; left: 12px; }
.menu-filigree.bottom-right { bottom: 10px; right: 12px; }

/* --- Majestic Dastan Header --- */
.menu-header {
  text-align: center;
  margin-bottom: 14px;
  position: relative;
}
.menu-badge-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}
.menu-royal-badge {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
  background: rgba(224, 186, 99, 0.12);
  border: 1px solid rgba(224, 186, 99, 0.38);
  padding: 3px 12px;
  border-radius: 12px;
}
.menu-version-pill {
  font-size: 10.5px;
  color: #6efff3;
  background: rgba(110, 255, 243, 0.1);
  border: 1px solid rgba(110, 255, 243, 0.35);
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: 600;
}
.menu-royal-title {
  margin: 4px 0 2px;
  font-family: "Georgia", "Palatino", serif;
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #fff7de 0%, #ffd700 55%, #dfbe7a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 16px rgba(245, 208, 97, 0.4));
  line-height: 1.1;
}
.menu-urdu-sub {
  font-size: clamp(14px, 2.9vw, 18px);
  color: #dfbe7a;
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}
.menu-divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px auto;
  max-width: 340px;
}
.menu-divider-ornament .divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 186, 99, 0.65), transparent);
}
.menu-divider-ornament .divider-gem {
  color: #ffd700;
  font-size: 12px;
  text-shadow: 0 0 8px #ffd700;
}
.menu-mission-subtitle {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #8be4db;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}
.menu-mission-subtitle .mission-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1ad4c5;
  box-shadow: 0 0 8px #1ad4c5;
}

/* --- Action Cards Grid --- */
#menu-list, #pause-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#pause-list {
  grid-template-columns: 1fr 1fr;
}

.menu-card-hero-primary,
.menu-card-hero-secondary,
.menu-card-exit-card {
  grid-column: 1 / -1;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 32, 48, 0.88) 0%, rgba(10, 20, 32, 0.94) 100%);
  border: 1.5px solid rgba(224, 186, 99, 0.32);
  color: #f7eed8;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: all 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-sizing: border-box;
  min-height: 54px;
  overflow: hidden;
}

.menu-item:hover, .menu-item.sel {
  border-color: #ffd700;
  background: linear-gradient(135deg, rgba(26, 52, 76, 0.95) 0%, rgba(14, 32, 50, 0.96) 100%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7), 0 0 16px rgba(255, 215, 0, 0.28);
  transform: translateY(-1px);
}

.menu-item.btn-active, .menu-item:active {
  transform: scale(0.972);
  filter: brightness(1.22);
  border-color: #6efff3;
}

/* Hero Primary (Start Mission) */
.menu-card-hero-primary {
  background: linear-gradient(135deg, rgba(32, 76, 66, 0.94) 0%, rgba(16, 46, 40, 0.98) 100%);
  border: 2px solid #ffd700;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.75), 0 0 24px rgba(255, 215, 0, 0.32);
  padding: 13px 18px;
  min-height: 58px;
}
.menu-card-hero-primary .menu-item-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff9e6;
  letter-spacing: 0.08em;
}
.menu-card-hero-primary:hover, .menu-card-hero-primary.sel {
  background: linear-gradient(135deg, rgba(44, 98, 86, 0.96) 0%, rgba(22, 58, 52, 0.98) 100%);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.85), 0 0 32px rgba(255, 215, 0, 0.5);
}

/* Daily challenges keep their accent even when New Game+ is unlocked. */
.menu-card-mode-card {
  background: linear-gradient(135deg, rgba(42, 26, 64, 0.88) 0%, rgba(20, 14, 36, 0.94) 100%);
  border-color: rgba(188, 128, 255, 0.5);
}
.menu-card-mode-card:hover, .menu-card-mode-card.sel {
  border-color: #c78dff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 22px rgba(188, 128, 255, 0.4);
}

/* Icon Bubble */
.menu-item-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(224, 186, 99, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.16s, border-color 0.16s, background 0.16s;
}
.menu-item.sel .menu-item-icon-wrap, .menu-item:hover .menu-item-icon-wrap {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.16);
  transform: scale(1.08);
}

/* Text Meta */
.menu-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.menu-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.menu-item-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fffaee;
  white-space: normal;
  overflow-wrap: anywhere;
  flex: 1 1 auto;
  min-width: 0;
}
.menu-item-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.18);
  border: 1px solid rgba(255, 215, 0, 0.45);
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}
.menu-item-desc {
  font-size: 11px;
  color: #9cb5c4;
  margin-top: 2px;
  white-space: normal;
  line-height: 1.45;
}
.menu-item.sel .menu-item-desc, .menu-item:hover .menu-item-desc {
  color: #bceae4;
}

.menu-item-arrow {
  font-size: 18px;
  color: rgba(224, 186, 99, 0.4);
  font-weight: 300;
  transition: transform 0.15s, color 0.15s;
  flex-shrink: 0;
}
.menu-item.sel .menu-item-arrow, .menu-item:hover .menu-item-arrow {
  color: #ffd700;
  transform: translateX(3px);
}

/* Exit Card */
.menu-card-exit-card {
  border-color: rgba(225, 80, 80, 0.38);
  background: linear-gradient(135deg, rgba(38, 16, 22, 0.78) 0%, rgba(22, 10, 14, 0.88) 100%);
}
.menu-card-exit-card:hover, .menu-card-exit-card.sel {
  border-color: #ff6b6b;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7), 0 0 18px rgba(255, 107, 107, 0.35);
}

/* --- Difficulty Selector Ribbon --- */
.difficulty-selector {
  background: rgba(10, 20, 32, 0.85);
  border: 1.5px solid rgba(224, 186, 99, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.diff-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.diff-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #dfbe7a;
}
.diff-desc {
  font-size: 11px;
  color: #72cfc5;
  font-weight: 500;
}
.diff-buttons {
  display: flex;
  gap: 8px;
}
.diff-btn {
  flex: 1;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  background: rgba(20, 36, 52, 0.75);
  border: 1.5px solid rgba(110, 177, 199, 0.25);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s;
}
.diff-btn .diff-name {
  font-size: 12px;
  font-weight: 800;
  color: #b0c4de;
  letter-spacing: 0.06em;
}
.diff-btn .diff-sub {
  font-size: 10px;
  color: #7890a8;
  margin-top: 1px;
}
.diff-btn.sel {
  background: linear-gradient(135deg, rgba(26, 212, 197, 0.25) 0%, rgba(245, 208, 97, 0.2) 100%);
  border-color: #ffd700;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.32);
}
.diff-btn.sel .diff-name {
  color: #ffffff;
}
.diff-btn.sel .diff-sub {
  color: #6efff3;
}
.diff-btn:active {
  transform: scale(0.96);
}

/* --- Mode Toggles Ribbon --- */
.mode-toggles {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}
.mode-toggle-card {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(10, 20, 32, 0.85);
  border: 1.5px solid rgba(224, 186, 99, 0.28);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  touch-action: manipulation;
  color: #b0c4de;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.mode-toggle-card:hover {
  border-color: #ffd700;
  color: #ffffff;
}
.mode-toggle-card input {
  width: 18px;
  height: 18px;
  accent-color: #ffd700;
  cursor: pointer;
}

@media (max-width: 680px) {
  #menu-list {
    grid-template-columns: 1fr;
  }
  .menu-royal-title {
    font-size: clamp(24px, 6vw, 32px);
  }
}

@media (max-height: 540px) {
  #menu .file-box {
    max-height: 94dvh !important;
    padding: 8px 14px !important;
  }
  .menu-header {
    margin-bottom: 6px;
  }
  .menu-royal-title {
    font-size: 22px;
  }
  .menu-urdu-sub, .menu-mission-subtitle {
    display: none;
  }
  #menu-list {
    margin: 6px 0;
    gap: 6px;
  }
  .menu-item {
    min-height: 42px;
    padding: 6px 10px;
  }
  .menu-item-icon-wrap {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
}

/* Clear hierarchy and focus without relying on a glow to identify an action. */
#menu .menu-item:focus-visible,
#menu .diff-btn:focus-visible {
  outline: 2px solid #fff4ce;
  outline-offset: 3px;
}
#menu .menu-card-hero-primary {
  background: linear-gradient(115deg, #e8ce8c, #b99550);
  border-color: #f4dfa8;
  box-shadow: 0 6px 20px #0005;
  min-height: 68px;
}
#menu .menu-card-hero-primary .menu-item-title { color: #172d30; }
#menu .menu-card-hero-primary .menu-item-desc { color: #244246; }
#menu .menu-card-hero-primary .menu-item-icon-wrap {
  background: #152f3020;
  border-color: #152f3030;
}
#menu .menu-card-hero-primary .menu-item-badge {
  color: #213c3b;
  background: #fff4ce60;
  border-color: #213c3b40;
}
#menu .menu-card-hero-primary .menu-item-arrow { color: #213c3b; }
#menu .menu-card-hero-primary:hover,
#menu .menu-card-hero-primary.sel { background: linear-gradient(115deg, #f5dfa7, #d3af66); }
#menu .menu-card-sub-card { background: #0b1a24b8; border-color: #adc5c526; }
#menu .menu-card-exit-card { min-height: 48px; background: transparent; }
#menu .menu-royal-badge { color: #e6cd92; text-shadow: none; letter-spacing: .1em; }
#menu .menu-version-pill { color: #a5c9c3; border-color: #a5c9c340; }
#menu .diff-header-row { flex-wrap: wrap; gap: 5px 12px; }
#menu .menu-box { scrollbar-width: thin; scrollbar-color: #b49b65 #0b1721; }
@media (prefers-reduced-motion: reduce) {
  #menu .menu-item, #menu .menu-item-icon-wrap, #menu .menu-item-arrow { transition: none; transform: none; }
}

html.mobile-ui .desktop-setting,
body.mobile-ui .desktop-setting,
.mobile-ui .desktop-setting,
html.mobile-ui .controls-block,
body.mobile-ui .controls-block,
.mobile-ui .controls-block,
html.mobile-ui kbd,
body.mobile-ui kbd,
.mobile-ui kbd,
html.mobile-ui #hud #weapons,
body.mobile-ui #hud #weapons,
.mobile-ui #weapons {
  display: none !important;
}

.legend, .hint, .page-num {
  text-align: center;
  opacity: .82;
  font-size: 13px;
  margin-top: 20px;
  color: #d8ccb8;
}

.kicker { letter-spacing: .4em; color: #1ad4c5; font-size: 12px; text-align: center; }
.verse { max-width: 520px; line-height: 1.6; font-size: 20px; margin: 12px auto; text-align: center; color: #f4ead2; }
.go { color: #1ad4c5; margin-top: 24px; text-align: center; }
.blink { animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.book p { line-height: 1.55; font-size: 17px; color: #ece2d0; }
.file-box label { display: block; margin: 14px 0; font-size: 16px; color: #f0e6d0; }
.file-box input[type="range"] { width: 100%; accent-color: #f5d061; }
.check { display: flex; gap: 10px; align-items: center; }

#win {
  position: fixed;
  z-index: 30;
  inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; background: rgba(5,7,12,.85);
  pointer-events: auto;
}

#win h1 { font-size: 54px; color: #f5d061; text-shadow: 0 0 20px rgba(245, 208, 97, 0.6); }
#win p { margin: 10px 0; font-size: 22px; }
.win-stats {
  margin: 16px auto 8px;
  padding: 14px 22px;
  max-width: 420px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(245, 208, 97, 0.35);
  border-radius: 8px;
  font-size: 17px;
  line-height: 1.7;
  color: #f4ead2;
}
#soul-gems { color: #6efff3; font-size: 15px; letter-spacing: 0.08em; margin-bottom: 4px; }
#dialog { cursor: pointer; }
#dialog:focus { outline: 1px solid rgba(245, 208, 97, 0.5); outline-offset: 2px; }
#soul-forge { z-index: 25; background: rgba(5, 7, 12, 0.72); }
.forge-box { max-width: 520px; text-align: center; }
#forge-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; text-align: left; }
.forge-up {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 208, 97, 0.35);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: #f4ead2;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.forge-up:hover:not(:disabled) { border-color: #1ad4c5; background: rgba(26, 212, 197, 0.1); }
.forge-up:disabled { opacity: 0.55; cursor: default; }
.forge-up-name { font-size: 17px; color: #f5d061; grid-column: 1; }
.forge-up-desc { font-size: 14px; color: #d8ccb8; grid-column: 1; }
.forge-up-cost { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #6efff3; font-size: 14px; }
.forge-up.owned { border-color: rgba(26, 212, 197, 0.45); }
.hidden { display: none !important; }

/* Interactive loading overlay */
#zayan-loader {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

#zayan-loader.hidden { display: none !important; }

#zayan-loader .loader-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(26, 212, 197, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(8, 12, 20, 0.88) 0%, rgba(10, 16, 26, 0.94) 100%);
  backdrop-filter: blur(3px);
}

#zayan-loader .loader-card {
  position: relative;
  z-index: 1;
  width: min(560px, 90vw);
  text-align: center;
}

#zayan-loader .loader-title {
  margin: 0 0 10px;
  font-size: 30px;
  color: #f5d061;
  letter-spacing: 0.06em;
}

#zayan-loader .loader-orbit {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 14px;
}

#zayan-loader .loader-orbit span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1ad4c5;
  box-shadow: 0 0 12px rgba(26, 212, 197, 0.65);
  animation: loader-orbit 1.1s ease-in-out infinite;
}

#zayan-loader .loader-orbit span:nth-child(2) { animation-delay: 0.15s; opacity: 0.75; }
#zayan-loader .loader-orbit span:nth-child(3) { animation-delay: 0.3s; opacity: 0.5; }

@keyframes loader-orbit {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.15); }
}

#zayan-loader .loader-status {
  margin: 0 auto 16px;
  min-height: 1.6em;
  font-size: 18px;
}

#zayan-loader .loader-bar-wrap {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(245, 208, 97, 0.35);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

#zayan-loader .loader-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1ad4c5, #f5d061);
  box-shadow: 0 0 14px rgba(26, 212, 197, 0.55);
  transition: width 0.22s ease-out;
}

#zayan-loader .loader-pct {
  margin: 8px 0 14px;
  font-size: 13px;
  letter-spacing: 0.2em;
  color: #d8ccb8;
}

#zayan-loader .loader-tip {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(245, 208, 97, 0.35);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  color: #f4ead2;
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#zayan-loader .loader-tip:hover,
#zayan-loader .loader-tip:focus-visible {
  background: rgba(26, 212, 197, 0.12);
  border-color: rgba(26, 212, 197, 0.55);
  outline: none;
}

#zayan-loader .loader-cancel {
  min-width: 120px;
  min-height: 46px;
  margin: 12px auto 0;
  padding: 9px 18px;
  border: 1px solid rgba(26, 212, 197, 0.55);
  border-radius: 8px;
  background: rgba(8, 20, 28, 0.84);
  color: #6efff3;
  font: inherit;
  cursor: pointer;
}

#loading .loader-orbit,
#loading .loader-bar-wrap,
#loading .loader-pct,
#loading .loader-tip {
  display: none;
}

/* ==========================================================================
   UNIVERSAL DELAYED LOADING SPINNER (PERSIAN CELESTIAL THEME)
   Appears only if an asset/room transition takes > 150ms.
   ========================================================================== */

#zayan-delayed-spinner {
  position: fixed;
  inset: 0;
  z-index: 9995;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s cubic-bezier(0.2, 0, 0, 1);
}

#zayan-delayed-spinner.active {
  opacity: 1;
  pointer-events: auto;
}

#zayan-delayed-spinner.hidden {
  display: none !important;
}

#zayan-delayed-spinner .delayed-spinner-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(8, 14, 24, 0.55) 0%, rgba(5, 9, 16, 0.82) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#zayan-delayed-spinner .delayed-spinner-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 280px;
  max-width: min(500px, 92vw);
  padding: 16px 26px;
  background: linear-gradient(135deg, rgba(14, 24, 38, 0.94) 0%, rgba(8, 13, 22, 0.98) 100%);
  border: 1px solid rgba(245, 208, 97, 0.45);
  border-radius: 16px;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.75),
    0 0 28px rgba(26, 212, 197, 0.22),
    inset 0 1px 0 rgba(245, 208, 97, 0.35);
  transform: scale(0.92) translateY(8px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

#zayan-delayed-spinner.active .delayed-spinner-card {
  transform: scale(1) translateY(0);
}

#zayan-delayed-spinner .delayed-spinner-ring {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

#zayan-delayed-spinner .spinner-ring-track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(245, 208, 97, 0.18);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

#zayan-delayed-spinner .spinner-ring-arc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: #1ad4c5;
  border-right-color: #f5d061;
  box-shadow: 0 0 14px rgba(26, 212, 197, 0.65);
  animation: delayed-celestial-spin 0.95s linear infinite;
}

#zayan-delayed-spinner .spinner-ring-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zayan-delayed-spinner .spinner-sigil {
  font-size: 16px;
  line-height: 1;
  color: #f5d061;
  text-shadow: 0 0 10px rgba(245, 208, 97, 0.9);
  animation: delayed-sigil-pulse 1.8s ease-in-out infinite alternate;
}

#zayan-delayed-spinner .delayed-spinner-body {
  flex: 1;
  min-width: 0;
}

#zayan-delayed-spinner .delayed-spinner-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f5d061;
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(245, 208, 97, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#zayan-delayed-spinner .delayed-spinner-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #a8d8ea;
  font-style: italic;
  letter-spacing: 0.03em;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes delayed-celestial-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes delayed-sigil-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.7;
    filter: drop-shadow(0 0 2px rgba(245, 208, 97, 0.4));
  }
  100% {
    transform: scale(1.18);
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(245, 208, 97, 0.95));
  }
}


/* On-screen debug (F3 toggle, F4 clear) */
#debug-panel {
  position: fixed;
  left: 8px;
  bottom: 8px;
  width: min(520px, 92vw);
  max-height: 42vh;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid #f55;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
  color: #ddd;
  pointer-events: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}
#debug-head {
  padding: 4px 8px;
  background: #400;
  color: #faa;
  font-weight: bold;
  font-size: 10px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
#debug-status {
  padding: 4px 8px;
  background: #111;
  color: #6ef;
  font-size: 10px;
  border-bottom: 1px solid #333;
  word-break: break-all;
  flex-shrink: 0;
}
#debug-log {
  padding: 6px 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 60px;
}
.debug-line { margin: 2px 0; white-space: pre-wrap; word-break: break-word; }
.debug-error { color: #f88; }
.debug-warn { color: #fc6; }
.debug-info { color: #9f9; }
#debug-panel.hidden { display: none !important; }


/* Tilism-nama, party chips, offer-peace hint — manuscript gold/teal, not a ball motif */
#tilism {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: rgba(6, 10, 22, 0.62);
}
#tilism.hidden { display: none !important; }

.tilism-book {
  width: min(860px, 92vw);
  max-height: 84vh;
  overflow: auto;
  padding: 28px 36px 22px;
  background: linear-gradient(180deg, #162036 0%, #0a1224 100%);
  border: 3px solid #f5d061;
  border-radius: 10px;
  box-shadow:
    0 0 0 6px #0a1224,
    0 0 0 8px #9e8760,
    0 24px 70px rgba(0, 0, 0, 0.75),
    inset 0 0 40px rgba(245, 208, 97, 0.06);
  color: #f4ead2;
  text-align: left;
}
.tilism-book h2 {
  color: #f5d061;
  font-weight: normal;
  text-align: center;
  margin: 6px 0 14px;
  letter-spacing: 0.06em;
  font-size: 22px;
}
.tilism-book h3 {
  color: #1ad4c5;
  letter-spacing: 0.22em;
  font-size: 13px;
  font-weight: normal;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.tilism-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.tilism-entry {
  padding: 10px 12px;
  margin: 8px 0;
  border: 1px solid rgba(245, 208, 97, 0.28);
  border-radius: 8px;
  background: rgba(8, 14, 24, 0.55);
}
.tilism-entry .n { font-size: 15px; font-weight: bold; color: #f4ead2; }
.tilism-entry .e { font-size: 13px; opacity: 0.82; color: #d4e4f0; margin-top: 4px; line-height: 1.4; }
.tilism-entry .seal-mark {
  color: #1ad4c5;
  font-size: 11px;
  letter-spacing: 0.14em;
  margin-top: 6px;
}
.tilism-entry.locked {
  opacity: 0.38;
  filter: grayscale(0.45);
}
.tilism-entry.inscribed { border-color: #f5d061; box-shadow: 0 0 12px rgba(245, 208, 97, 0.18); }
.tilism-entry.rafiq { border-color: #1ad4c5; box-shadow: 0 0 12px rgba(26, 212, 197, 0.22); }
.tilism-entry.silhouette .n { letter-spacing: 0.28em; color: #8a9aaa; }

#peace-hint {
  position: absolute;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  color: #f5d061;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-shadow: 0 0 14px rgba(245, 208, 97, 0.75);
  pointer-events: none;
}

#party {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  pointer-events: none;
}
#party .chip {
  padding: 5px 12px;
  background: rgba(10, 16, 28, 0.88);
  border: 1px solid #1ad4c5;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #f4ead2;
  box-shadow: 0 0 10px rgba(26, 212, 197, 0.25);
}
#party .chip.on { border-color: #1ad4c5; }

@media (max-width: 720px) {
  .tilism-cols { grid-template-columns: 1fr; }
}

#hint-bar {
  position: absolute;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  color: #f4ead2;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85), 0 0 10px rgba(245, 208, 97, 0.4);
  pointer-events: none;
  opacity: 0.92;
  max-width: 78vw;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#hint-bar.hidden { display: none !important; }

#objective-hud {
  position: absolute;
  left: 50%;
  top: 58px;
  transform: translateX(-50%);
  z-index: 18;
  max-width: min(92vw, 720px);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(245, 208, 97, 0.45);
  background: rgba(8, 13, 20, 0.78);
  color: #ffd978;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(0,0,0,0.85);
}
#objective-hud.hidden { display: none !important; }

#reward-toast {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -12px) scale(0.96);
  z-index: 60;
  min-width: 220px;
  max-width: 86vw;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1.5px solid rgba(245, 208, 97, 0.65);
  background: radial-gradient(circle at 50% 0%, rgba(26, 212, 197, 0.18), rgba(8, 13, 20, 0.94));
  color: #f4ead2;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#reward-toast.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
#reward-toast strong {
  display: block;
  color: #f5d061;
  font-size: 16px;
  margin-bottom: 4px;
}
#reward-toast span {
  font-size: 13px;
  color: #d7e7ef;
}

.dungeon-puzzle {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 14, 0.72);
  padding: 20px;
}
.dungeon-puzzle-card {
  width: min(440px, 94vw);
  padding: 20px 18px;
  border-radius: 14px;
  border: 1.5px solid rgba(245, 208, 97, 0.5);
  background: linear-gradient(180deg, rgba(16, 26, 40, 0.98), rgba(8, 13, 20, 0.98));
  box-shadow: 0 0 28px rgba(26, 212, 197, 0.2);
}
.dungeon-puzzle-kicker {
  margin: 0 0 8px;
  color: #1ad4c5;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.dungeon-puzzle-stage {
  margin: 0 0 6px;
  color: #f5d061;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dungeon-puzzle-prompt {
  margin: 0 0 14px;
  color: #f4ead2;
  font-size: 15px;
  line-height: 1.45;
}
.dungeon-puzzle-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dungeon-puzzle-choice,
.dungeon-puzzle-skip {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(245, 208, 97, 0.35);
  background: rgba(245, 208, 97, 0.08);
  color: #ffd978;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dungeon-puzzle-choice:active,
.dungeon-puzzle-skip:active {
  background: rgba(26, 212, 197, 0.22);
  border-color: #1ad4c5;
}
.dungeon-puzzle-skip {
  margin-top: 10px;
  opacity: 0.75;
  font-size: 12px;
  text-align: center;
}
.dungeon-puzzle-teach {
  margin: 10px 0 0;
  color: #1ad4c5;
  font-size: 13px;
  line-height: 1.4;
}
.dungeon-puzzle-teach.hidden { display: none; }

.mini-stage-map {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(4, 8, 14, 0.88);
}
.mini-stage-card {
  width: min(96vw, 720px);
  max-width: 96vw;
  box-sizing: border-box;
  text-align: center;
  padding: 24px 28px 20px;
}
.mini-stage-kicker,
.mini-stage-number { color: #1ad4c5; letter-spacing: 0.16em; text-transform: uppercase; }
.mini-stage-kicker { font-size: 11px; }
.mini-stage-number { margin: 10px 0 4px; font-size: 12px; }
.mini-stage-title { margin: 0 0 6px; color: #f5d061; font-size: 22px; letter-spacing: 0.04em; }
.mini-stage-relic { margin: 0 0 10px; color: #6efff3; font-size: 13px; }
.mini-stage-intro { min-height: 2.8em; color: #ede3cb; font-size: 13.5px; line-height: 1.5; max-width: 620px; margin: 0 auto 10px; }
.mini-stage-state { color: #9bb0c2; font-size: 12.5px; line-height: 1.45; margin: 6px 0 12px; }
.mini-stage-track { display: flex; justify-content: center; gap: 12px; margin: 12px 0; }
.mini-stage-track button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(245, 208, 97, 0.45);
  border-radius: 50%;
  background: rgba(245, 208, 97, 0.06);
  color: #a0b2c2;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mini-stage-track button.complete { color: #6efff3; border-color: #1ad4c5; background: rgba(26, 212, 197, 0.16); }
.mini-stage-track button.current { color: #081018; background: #f5d061; border-color: #f5d061; box-shadow: 0 0 14px rgba(245, 208, 97, 0.55); }
.mini-stage-controls { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 10px; margin-top: 16px; }
.mini-stage-controls button,
.mini-stage-exit {
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid rgba(245, 208, 97, 0.45);
  border-radius: 9px;
  background: rgba(245, 208, 97, 0.08);
  color: #f5d061;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.18s ease;
}
.mini-stage-controls button:disabled { opacity: 0.3; cursor: default; }
.mini-stage-controls .mini-stage-play { background: rgba(26, 212, 197, 0.22); border-color: #1ad4c5; color: #fff; box-shadow: 0 0 16px rgba(26, 212, 197, 0.35); }
.mini-stage-exit { margin-top: 10px; min-height: 42px; font-size: 12px; border-color: rgba(145, 162, 178, 0.35); color: #a8bac9; }

#btn-save {
  position: absolute;
  bottom: 22px;
  right: 22px;
  pointer-events: auto;
  cursor: pointer;
  background: rgba(10, 16, 28, 0.88);
  border: 1px solid rgba(245, 208, 97, 0.55);
  color: #f5d061;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.14em;
  padding: 7px 14px;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
#btn-save:hover { border-color: #1ad4c5; color: #6efff3; }
#btn-save.hidden { display: none !important; }

#speedrun-timer {
  position: absolute;
  top: 78px;
  left: 26px;
  color: #f5d061;
  font-family: "Courier New", monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-shadow: 0 0 8px rgba(245, 208, 97, 0.45);
  pointer-events: none;
}
#speedrun-timer.hidden { display: none !important; }

#settings .file-box { max-height: 86vh; overflow-y: auto; }

#stealth-gem {
  width: 12px;
  height: 12px;
  margin: 8px 0 0 auto;
  transform: rotate(45deg);
  border: 1px solid rgba(26, 212, 197, 0.55);
  background: #0a3d3a;
  box-shadow: 0 0 8px rgba(10, 80, 78, 0.45);
  opacity: 0.5;
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
#stealth-gem.hidden-light {
  background: #0a3d3a;
  border-color: rgba(26, 212, 197, 0.45);
  box-shadow: 0 0 8px rgba(10, 80, 78, 0.45);
}
#stealth-gem.sneaking {
  background: #0d4a52;
  border-color: #6efff3;
  box-shadow: 0 0 10px rgba(110, 255, 243, 0.7);
  opacity: 0.8;
}
#stealth-gem.exposed {
  background: #f5d061;
  border-color: rgba(245, 208, 97, 0.85);
  box-shadow: 0 0 12px rgba(245, 208, 97, 0.9);
  opacity: 1;
}

#stealth-prompt {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(245, 208, 97, 0.85);
  background: rgba(16, 12, 28, 0.92);
  backdrop-filter: blur(8px);
  color: #f5d061;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 0 20px rgba(245, 208, 97, 0.35);
  pointer-events: none;
  animation: stealthPulse 1.8s ease-in-out infinite;
  z-index: 25;
}
#stealth-prompt.hidden { display: none !important; }
@keyframes stealthPulse {
  0%, 100% { transform: translateX(-50%) scale(1); box-shadow: 0 0 14px rgba(245, 208, 97, 0.25); }
  50% { transform: translateX(-50%) scale(1.04); box-shadow: 0 0 24px rgba(245, 208, 97, 0.65); }
}

.version-badge {
  text-align: center;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: #1ad4c5;
  margin: 0 0 10px;
  opacity: 0.92;
}

.credits-book { max-height: min(78vh, 720px); overflow: hidden; }
.credits-body {
  max-height: 46vh;
  overflow-y: auto;
  line-height: 1.55;
  font-size: 16px;
  color: #ece2d0;
}
.credits-body p { margin: 0 0 12px; }
.credits-body code { color: #f5d061; font-size: 13px; }

.win-card {
  text-align: center;
  pointer-events: auto;
  max-width: min(840px, 92vw);
}
.win-card h1 { font-size: 40px; }
.win-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 8px;
}
.win-actions button {
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.12em;
  color: #f4ead2;
  background: linear-gradient(90deg, rgba(26, 212, 197, 0.18), rgba(245, 208, 97, 0.12));
  border: 1px solid rgba(245, 208, 97, 0.55);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
}
.win-actions button:hover,
.win-actions button:focus-visible {
  color: #fffdf5;
  border-color: #f5d061;
  outline: none;
}
.win-actions .btn-win-expedition {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  font-weight: bold;
  background: linear-gradient(135deg, #1ad4c5, #008891) !important;
  color: #fff !important;
  border: 1.5px solid #6efff3 !important;
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(26, 212, 197, 0.35);
}
.win-actions .win-sub-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.win-actions .win-sub-actions button {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
}

#zayan-loader .loader-brand {
  letter-spacing: 0.22em;
  font-size: 11px;
  color: #1ad4c5;
  margin: 16px 0 0;
  opacity: 0.85;
}
#zayan-loader.loader-error .loader-title { color: #f5d061; }
#zayan-loader.loader-error .loader-status { color: #f0c9a0; }

/* Remappable controls (Settings) */
.controls-block {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(245, 208, 97, 0.25);
}
.controls-kicker {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: #1ad4c5;
  margin: 0 0 10px;
}
.bind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
}
.bind-label { color: #f0e6d0; font-size: 15px; }
.bind-btn {
  min-width: 108px;
  padding: 6px 12px;
  border: 1px solid rgba(245, 208, 97, 0.45);
  background: rgba(8, 12, 20, 0.75);
  color: #f5d061;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}
.bind-btn.waiting {
  border-color: #1ad4c5;
  color: #1ad4c5;
  animation: blink 1.2s steps(2) infinite;
}
.bind-reset {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(26, 212, 197, 0.45);
  background: rgba(8, 20, 18, 0.7);
  color: #1ad4c5;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

/* ==========================================================================
   Interactive Ayyar Mini-Games (Folk Stories of Umro Ayyar)
   ========================================================================== */
.mini-game-viewport {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: radial-gradient(circle at center, #0b1522 0%, #04070c 100%);
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  font-family: inherit;
}

.mini-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(6, 12, 20, 0.92);
  border-bottom: 1px solid rgba(245, 208, 97, 0.25);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  min-height: 48px;
}

.mini-game-header-info {
  display: flex;
  flex-direction: column;
}

.mini-game-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1ad4c5;
  margin: 0;
}

.mini-game-title {
  font-size: 17px;
  color: #f5d061;
  font-weight: bold;
  margin: 2px 0 0;
}

.mini-game-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-game-hearts {
  font-size: 18px;
  color: #ff4757;
  letter-spacing: 2px;
}

.mini-game-score-badge {
  background: rgba(245, 208, 97, 0.12);
  border: 1px solid rgba(245, 208, 97, 0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #f5d061;
  font-weight: bold;
}

.mini-game-close-btn {
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid rgba(255, 71, 87, 0.4);
  color: #ff4757;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.mini-game-canvas-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #020408;
}

#mini-game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: none;
}

.mini-game-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(6, 12, 20, 0.95);
  border-top: 1px solid rgba(245, 208, 97, 0.25);
  gap: 10px;
  min-height: 68px;
}

.mini-dpad-group {
  display: flex;
  gap: 6px;
}

.mini-ctrl-btn {
  touch-action: manipulation;
  cursor: pointer;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  padding: 10px 14px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.08s, background 0.15s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.mini-ctrl-btn:active {
  transform: scale(0.94);
}

.mini-btn-dir {
  background: rgba(26, 212, 197, 0.15);
  border: 1px solid rgba(26, 212, 197, 0.45);
  color: #6efff3;
  min-width: 48px;
}

.mini-action-group {
  display: flex;
  gap: 8px;
}

.mini-btn-action-slash {
  background: linear-gradient(135deg, rgba(245, 208, 97, 0.25), rgba(255, 152, 0, 0.2));
  border: 1px solid #f5d061;
  color: #f5d061;
}

.mini-btn-action-parry {
  background: linear-gradient(135deg, rgba(26, 212, 197, 0.25), rgba(0, 188, 212, 0.2));
  border: 1px solid #1ad4c5;
  color: #6efff3;
}

.mini-btn-action-vault {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.25), rgba(46, 125, 50, 0.2));
  border: 1px solid #66bb6a;
  color: #a5d6a7;
}

.mini-btn-action-special {
  background: linear-gradient(135deg, rgba(156, 39, 176, 0.25), rgba(103, 58, 183, 0.2));
  border: 1px solid #ba68c8;
  color: #e1bee7;
}

/* Modal result card overlay */
.mini-result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 160;
  padding: 16px;
  animation: miniFadeIn 0.3s ease-out;
}

@keyframes miniFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.mini-result-card {
  width: min(520px, 94vw);
  background: linear-gradient(145deg, rgba(12, 20, 32, 0.98), rgba(6, 10, 18, 0.98));
  border: 1.5px solid rgba(245, 208, 97, 0.5);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 20px rgba(245, 208, 97, 0.15);
}

.mini-result-badge {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1ad4c5;
  margin-bottom: 6px;
}

.mini-result-title {
  font-size: 26px;
  color: #f5d061;
  margin: 0 0 10px;
  text-shadow: 0 0 15px rgba(245, 208, 97, 0.4);
}

.mini-result-title.fail {
  color: #ff4757;
  text-shadow: 0 0 15px rgba(255, 71, 87, 0.4);
}

.mini-result-desc {
  font-size: 14px;
  line-height: 1.5;
  color: #d8e2ec;
  margin: 0 0 18px;
}

.mini-reward-box {
  background: rgba(245, 208, 97, 0.08);
  border: 1px dashed rgba(245, 208, 97, 0.4);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 18px;
}

.mini-reward-val {
  font-size: 20px;
  font-weight: bold;
  color: #f5d061;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mini-ad-reward-btn {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  background: linear-gradient(135deg, #f5d061 0%, #ff9800 50%, #f5d061 100%);
  background-size: 200% auto;
  animation: shineAd 3s linear infinite;
  color: #060b12;
  font-weight: 800;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(245, 208, 97, 0.4);
}

@keyframes shineAd {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.mini-ad-reward-btn:disabled {
  opacity: 0.6;
  filter: grayscale(0.8);
  cursor: default;
  animation: none;
}

.mini-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.mini-result-actions button {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid rgba(245, 208, 97, 0.35);
  background: rgba(245, 208, 97, 0.1);
  color: #f5d061;
}

.mini-result-actions .primary-action {
  background: rgba(26, 212, 197, 0.2);
  border-color: #1ad4c5;
  color: #6efff3;
}


/* Fullscreen Stage 2 Teaser & Cutscene Overlays */
#stage2-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050810;
}
#stage2-fullscreen.hidden {
  display: none !important;
}
.stage2-fs-bg {
  position: absolute;
  inset: 0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1;
}
.stage2-fs-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5,8,16,0.3) 0%, rgba(5,8,16,0.7) 70%, rgba(5,8,16,0.92) 100%);
  z-index: 2;
}
.stage2-fs-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: min(840px, 92vw);
  padding: 24px;
  color: #f8f2e2;
}
.stage2-fs-kicker {
  font-size: 14px;
  letter-spacing: 0.2em;
  color: #6efff3;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.stage2-fs-stage-num {
  font-size: 18px;
  color: #f5d061;
  font-weight: bold;
}
.stage2-fs-title {
  font-size: clamp(28px, 5vw, 44px);
  color: #f5d061;
  margin: 10px 0;
  text-shadow: 0 2px 16px rgba(0,0,0,0.8);
}
.stage2-fs-tagline {
  font-size: 16px;
  color: #d6e2f0;
  line-height: 1.5;
  margin-bottom: 16px;
}
.stage2-fs-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(110,255,243,0.15);
  border: 1px solid #6efff3;
  border-radius: 999px;
  color: #6efff3;
  font-size: 12px;
  margin-bottom: 20px;
}
.stage2-fs-btn {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(180deg, #f5d061, #d4982a);
  color: #120e06;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(245,208,97,0.35);
}

/* ── Checkpoint Ad Prompt (Modern Tailwind/shadcn Design System) ── */
.checkpoint-ad-prompt {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(12px) scale(0.96);
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.checkpoint-ad-prompt.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}
.checkpoint-ad-prompt.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(16px) scale(0.94);
  pointer-events: none;
}
.checkpoint-ad-card {
  background: rgba(12, 16, 28, 0.92);
  border: 1px solid rgba(245, 208, 97, 0.38);
  border-radius: 16px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.75), 0 0 24px rgba(245, 208, 97, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  min-width: 280px;
  max-width: 90vw;
}
.checkpoint-ad-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(245, 208, 97, 0.12);
  border: 1px solid rgba(245, 208, 97, 0.3);
  font-size: 22px;
  color: #f5d061;
  text-shadow: 0 0 10px rgba(245, 208, 97, 0.6);
  box-shadow: 0 0 14px rgba(245, 208, 97, 0.2);
}
.checkpoint-ad-text {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 600;
  color: #fdfaf0;
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.checkpoint-ad-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}
.checkpoint-watch-btn {
  background: linear-gradient(135deg, #f5d061 0%, #d4a826 60%, #b88d18 100%);
  color: #0b0d14;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 12px 22px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  min-height: 48px;
  box-shadow: 0 4px 14px rgba(212, 168, 38, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.checkpoint-watch-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 6px rgba(212, 168, 38, 0.3);
  filter: brightness(0.95);
}
.checkpoint-dash-btn {
  background: linear-gradient(135deg, #1ad4c5 0%, #0d9488 60%, #0f766e 100%);
  color: #041014;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 12px 20px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  min-height: 48px;
  box-shadow: 0 4px 14px rgba(26, 212, 197, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.checkpoint-dash-btn:active {
  transform: scale(0.96);
  box-shadow: 0 2px 6px rgba(26, 212, 197, 0.3);
  filter: brightness(0.95);
}
.checkpoint-dismiss-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 18px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  min-height: 48px;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
.checkpoint-dismiss-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   EXCITEMENT & JUICE ENHANCEMENTS
   ============================================================ */

/* Tension Vignette (Prowling beasts & stealth danger) */
.tension-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(180, 20, 30, 0.45) 85%, rgba(120, 10, 20, 0.8) 100%);
  transition: opacity 0.3s ease;
}
.tension-vignette.danger {
  opacity: 0.85;
  animation: tensionPulse 0.9s infinite alternate ease-in-out;
}
@keyframes tensionPulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.02); opacity: 0.95; }
}

/* Speed Lines Canvas for Flying Carpet */
.speed-lines {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Combo HUD */
.combo-hud {
  position: fixed;
  left: 24px;
  top: 130px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 15;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(16, 24, 38, 0.88), rgba(8, 13, 20, 0.94));
  border: 1.5px solid rgba(245, 208, 97, 0.55);
  border-radius: 14px;
  padding: 8px 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 16px rgba(245, 208, 97, 0.25);
  transform-origin: left center;
  animation: comboPop 0.18s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes comboPop {
  0% { transform: scale(0.85); }
  50% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
#combo-count {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 32px;
  font-weight: 900;
  color: #f5d061;
  text-shadow: 0 0 12px rgba(245, 208, 97, 0.8);
  line-height: 1;
}
.combo-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#combo-rank {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #6efff3;
  text-shadow: 0 0 8px rgba(110, 255, 243, 0.6);
  text-transform: uppercase;
}
.combo-meter-track {
  width: 90px;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  overflow: hidden;
}
#combo-meter-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #1ad4c5, #f5d061);
  transition: width 0.1s linear;
}

/* Floating Combat Text Popups */
.combat-popups {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  overflow: hidden;
}
.combat-popup-item {
  position: absolute;
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 0 10px #f5d061;
  transform: translate(-50%, -50%);
  animation: popupFloat 0.85s forwards cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes popupFloat {
  0% { opacity: 0; transform: translate(-50%, -10%) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  75% { opacity: 1; transform: translate(-50%, -110%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -150%) scale(0.8); }
}

/* Boss Phase Spectacle Banner */
.boss-spectacle {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 30;
  text-align: center;
  animation: spectacleIn 2.2s forwards ease-out;
}
@keyframes spectacleIn {
  0% { opacity: 0; transform: translateX(-50%) scale(0.75); }
  15% { opacity: 1; transform: translateX(-50%) scale(1.08); }
  25% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.15); }
}
#spectacle-phase {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  letter-spacing: 0.4em;
  color: #aa44ff;
  text-shadow: 0 0 16px rgba(170, 68, 255, 0.9);
  font-weight: 800;
  margin-bottom: 4px;
}
#spectacle-text {
  font-family: 'Cinzel', serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #fff;
  text-shadow: 0 0 24px rgba(245, 208, 97, 0.8), 0 0 40px rgba(170, 68, 255, 0.6);
  text-transform: uppercase;
}

/* Celebratory Victory Splash */
.victory-splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(16, 24, 38, 0.85) 0%, rgba(8, 12, 20, 0.95) 100%);
  pointer-events: none;
  z-index: 35;
  animation: victoryIn 2.8s forwards cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes victoryIn {
  0% { opacity: 0; transform: scale(0.8); }
  12% { opacity: 1; transform: scale(1.04); }
  20% { transform: scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.08); }
}
.victory-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 208, 97, 0.35) 0%, transparent 70%);
  filter: blur(20px);
  animation: glowPulse 2s infinite alternate ease-in-out;
}
@keyframes glowPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}
#victory-title {
  font-family: 'Cinzel', serif;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: #f5d061;
  text-shadow: 0 0 30px rgba(245, 208, 97, 0.9), 0 4px 12px rgba(0, 0, 0, 0.8);
  margin: 0 0 8px 0;
  position: relative;
  z-index: 2;
}
#victory-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  letter-spacing: 0.16em;
  color: #6efff3;
  text-shadow: 0 0 16px rgba(110, 255, 243, 0.7);
  margin: 0;
  position: relative;
  z-index: 2;
}

/* ════════════════════════════════════════════════════════════════════════════
   STREAMING HERO BILLBOARD & EPISODIC BINGE CAROUSEL (NETFLIX-STYLE UX)
   ════════════════════════════════════════════════════════════════════════════ */

.streaming-hub-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: #080d14;
  padding: 0 0 40px 0;
}

.hero-billboard {
  position: relative;
  width: 100%;
  max-width: 1200px;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px 28px;
  box-sizing: border-box;
}

/* Ambient Billboard Media Backdrop */
.billboard-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  border-radius: 0 0 20px 20px;
  pointer-events: none;
}

.billboard-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: brightness(0.68) saturate(1.25);
  transform: scale(1.02);
  transition: transform 8s ease-out;
}

.billboard-gradient-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(180deg, rgba(8,13,20,0.92) 0%, rgba(8,13,20,0) 100%);
  pointer-events: none;
}

.billboard-gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75%;
  background: linear-gradient(0deg, #080d14 0%, rgba(8,13,20,0.85) 55%, rgba(8,13,20,0) 100%);
  pointer-events: none;
}

/* Billboard Content Layer */
.billboard-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin-top: auto;
  padding-bottom: 24px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.stream-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #d6e2f0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
}

.stream-badge.gold-glow {
  background: rgba(245, 208, 97, 0.16);
  color: #f5d061;
  border-color: rgba(245, 208, 97, 0.5);
  box-shadow: 0 0 14px rgba(245, 208, 97, 0.25);
}

.stream-badge.time-badge {
  background: rgba(110, 255, 243, 0.14);
  color: #6efff3;
  border-color: rgba(110, 255, 243, 0.45);
}

.cinematic-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #fffaf0;
  margin: 0 0 6px 0;
  text-shadow: 0 4px 24px rgba(0,0,0,0.9), 0 0 40px rgba(245,208,97,0.3);
  line-height: 1.1;
}

.cinematic-subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(14px, 2.2vw, 19px);
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #f5d061;
  margin: 0 0 16px 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.cinematic-synopsis {
  font-size: 15px;
  line-height: 1.6;
  color: #d0dde9;
  margin: 0 0 24px 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* Call to Action Button Cluster */
.billboard-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f5d061 0%, #e5b338 100%);
  color: #0b0904;
  border: none;
  border-radius: 8px;
  padding: 14px 26px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(245, 208, 97, 0.42);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 208, 97, 0.6);
}

.btn-hero-primary:active {
  transform: translateY(1px);
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 36, 56, 0.65);
  color: #e4edf8;
  border: 1px solid rgba(110, 255, 243, 0.35);
  border-radius: 8px;
  padding: 13px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.btn-hero-secondary:hover {
  background: rgba(30, 50, 78, 0.85);
  border-color: #6efff3;
  color: #6efff3;
  transform: translateY(-2px);
}

.btn-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(22, 36, 56, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.btn-hero-icon:hover {
  border-color: #f5d061;
  background: rgba(245, 208, 97, 0.15);
  transform: scale(1.08);
}

@media (max-width: 680px) {
  .hero-billboard {
    min-height: 70vh;
    padding: 20px 16px;
  }
  .cinematic-title {
    font-size: clamp(28px, 7vw, 42px);
  }
  .cinematic-subtitle {
    font-size: 13px;
    letter-spacing: 0.15em;
  }
  .cinematic-synopsis {
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .billboard-cta-row {
    gap: 8px;
  }
  .btn-hero-primary, .btn-hero-secondary {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 44px;
  }
}

@media (max-height: 540px) {
  .hero-billboard {
    min-height: auto;
    padding: 14px 16px;
  }
  .cinematic-title {
    font-size: clamp(22px, 6vh, 32px);
  }
  .cinematic-subtitle {
    font-size: 12px;
    margin: 0 0 8px 0;
  }
  .cinematic-synopsis {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
  }
  .billboard-cta-row {
    gap: 6px;
  }
  .btn-hero-primary, .btn-hero-secondary {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 38px;
  }
}

/* ── Episodic Binge Carousel ── */
.episodic-carousel-section {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: 10px;
}

.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Cinzel', serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #f5d061;
  margin: 0;
}

.season-info {
  font-size: 12px;
  color: #8fa6bd;
  letter-spacing: 0.08em;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 16px 4px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #f5d061 rgba(255,255,255,0.05);
}

.carousel-track::-webkit-scrollbar {
  height: 6px;
}
.carousel-track::-webkit-scrollbar-thumb {
  background: #f5d061;
  border-radius: 3px;
}

.episode-card {
  flex: 0 0 260px;
  background: rgba(18, 27, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.episode-card:hover {
  transform: translateY(-5px);
  border-color: #f5d061;
  box-shadow: 0 10px 28px rgba(245, 208, 97, 0.28);
}

.episode-thumb-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #000;
}

.episode-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.episode-card:hover .episode-thumb {
  transform: scale(1.06);
}

.episode-thumb.locked-blur {
  filter: blur(4px) brightness(0.45);
}

.episode-time-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.lock-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 8, 24, 0.92);
  color: #ffb86c;
  border: 1px solid #ffb86c;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 6px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}

.episode-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.episode-progress-bar .fill {
  height: 100%;
  background: #f5d061;
  box-shadow: 0 0 8px #f5d061;
}

.episode-meta {
  padding: 12px 14px;
}

.ep-num {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #6efff3;
  margin-bottom: 4px;
}

.ep-name {
  font-family: 'Cinzel', serif;
  font-size: 15px;
  font-weight: 700;
  color: #f7f9fc;
  margin: 0 0 6px 0;
}

.ep-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #9ab1c7;
  margin: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   STREAMING MODALS (TRAILER & 3D RELIC VAULT)
   ════════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(6, 10, 16, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.modal-close-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e4edf8;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  z-index: 10;
}

.modal-close-icon:hover {
  background: rgba(245, 208, 97, 0.25);
  border-color: #f5d061;
  color: #f5d061;
}

/* Trailer Dialog */
.trailer-dialog {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: #0f1622;
  border: 1px solid rgba(245, 208, 97, 0.35);
  border-radius: 14px;
  padding: 22px;
  box-sizing: border-box;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
}

.trailer-header {
  margin-bottom: 12px;
}

.trailer-header h3 {
  font-family: 'Cinzel', serif;
  color: #f5d061;
  font-size: 20px;
  margin: 6px 0 0 0;
}

.trailer-video-wrap {
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
}

.trailer-footer {
  text-align: left;
}

.trailer-synopsis {
  font-size: 13px;
  line-height: 1.55;
  color: #b0c2d6;
  margin: 0;
}

/* 3D Relic Vault Dialog */
.relic-dialog {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0f1622;
  border: 1px solid rgba(110, 255, 243, 0.35);
  border-radius: 14px;
  padding: 24px;
  box-sizing: border-box;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
  text-align: center;
}

.relic-vault-header h2 {
  font-family: 'Cinzel', serif;
  color: #f5d061;
  font-size: 24px;
  margin: 8px 0 4px 0;
}

.relic-instructions {
  font-size: 12px;
  color: #8da5be;
  margin: 0 0 16px 0;
}

.relic-nav-pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.relic-nav-btn {
  background: rgba(22, 34, 52, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd8e8;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.relic-nav-btn:hover {
  border-color: #6efff3;
  color: #6efff3;
}

.relic-nav-btn.active {
  background: rgba(245, 208, 97, 0.2);
  border-color: #f5d061;
  color: #f5d061;
  box-shadow: 0 0 14px rgba(245, 208, 97, 0.3);
}

.relic-viewport-container {
  position: relative;
  width: 100%;
  height: 280px;
  background: radial-gradient(circle at center, #1b293d 0%, #0a0f18 80%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
  overflow: hidden;
  cursor: grab;
}

.relic-viewport-container:active {
  cursor: grabbing;
}

#relic-canvas-wrap {
  width: 100%;
  height: 100%;
}

.saif-element-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(10, 15, 24, 0.85);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.element-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #e4edf8;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.element-btn.aatish:hover, .element-btn.aatish.active {
  background: rgba(255, 69, 0, 0.3);
  border-color: #ff4500;
  color: #ff8544;
}

.element-btn.barf:hover, .element-btn.barf.active {
  background: rgba(102, 255, 255, 0.3);
  border-color: #66ffff;
  color: #66ffff;
}

.element-btn.noor:hover, .element-btn.noor.active {
  background: rgba(245, 208, 97, 0.3);
  border-color: #f5d061;
  color: #f5d061;
}

.relic-details-card {
  text-align: left;
  background: rgba(20, 30, 46, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px 20px;
}

.relic-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#relic-title {
  font-family: 'Cinzel', serif;
  font-size: 19px;
  font-weight: 800;
  color: #f5d061;
  margin: 0;
}

.relic-sub {
  font-size: 12px;
  color: #6efff3;
  margin: 2px 0 0 0;
}

.btn-voice-lore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(110, 255, 243, 0.15);
  border: 1px solid #6efff3;
  color: #6efff3;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-voice-lore:hover {
  background: rgba(110, 255, 243, 0.35);
  box-shadow: 0 0 12px rgba(110, 255, 243, 0.4);
}

.relic-lore-text {
  font-size: 13px;
  line-height: 1.55;
  color: #c4d5e8;
  margin: 0 0 8px 0;
}

.relic-quote-text {
  font-style: italic;
  font-size: 12px;
  color: #f5d061;
  margin: 0;
  border-left: 2px solid #f5d061;
  padding-left: 10px;
}

/* === SHOP / IAP OVERLAY === */
#shop-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 16, 0.88);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  touch-action: manipulation;
}
#shop-panel.hidden { display: none; }
#shop-panel .shop-book {
  width: min(800px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px 24px 18px;
  border: 1px solid rgba(245, 208, 97, 0.6);
  border-radius: 16px;
  color: #f3e9cf;
  background: linear-gradient(160deg, rgba(22, 30, 48, 0.97), rgba(10, 14, 24, 0.98));
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
}
#shop-panel .shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245, 208, 97, 0.3);
}
#shop-panel h2 {
  margin: 0;
  font-size: 22px;
  color: #f5d061;
  letter-spacing: 0.06em;
  font-family: 'Cinzel', serif;
}
#shop-panel .shop-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: #6efff3;
  text-transform: uppercase;
}
#shop-panel .shop-close {
  min-width: 48px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(245,208,97,0.55);
  background: rgba(10,16,28,0.9);
  color: #f5d061;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.15s ease;
}
#shop-panel .shop-close:hover {
  background: rgba(245,208,97,0.2);
}
#shop-panel .shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
#shop-panel .shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 160px;
  padding: 14px 12px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
}
#shop-panel .shop-item:hover {
  border-color: #f5d061;
  background: rgba(245, 208, 97, 0.1);
  box-shadow: 0 0 16px rgba(245,208,97,0.2);
}
#shop-panel .shop-item.owned {
  border-color: #1ad4c5;
  background: rgba(26, 212, 197, 0.1);
  cursor: default;
}
#shop-panel .shop-item .s-icon {
  font-size: 36px;
  width: 48px;
  text-align: center;
  flex: none;
}
#shop-panel .shop-item .s-text { flex: 1; min-width: 0; }
#shop-panel .shop-item .s-name {
  font-weight: bold;
  color: #f5d061;
  font-size: 15px;
}
#shop-panel .shop-item .s-en {
  font-size: 12px;
  opacity: 0.82;
  margin: 2px 0 6px;
}
#shop-panel .shop-item .s-price {
  font-size: 16px;
  font-weight: 700;
  color: #1ad4c5;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(26, 212, 197, 0.5);
  background: rgba(26, 212, 197, 0.12);
}
#shop-panel .shop-item.owned .s-price {
  color: #6efff3;
  background: rgba(110, 255, 243, 0.15);
  border-color: #6efff3;
}
#shop-panel .shop-foot {
  margin-top: 16px;
  font-size: 12px;
  opacity: 0.7;
  text-align: center;
  color: #9aa8b8;
}
@media (max-width: 640px) {
  #shop-panel .shop-grid { grid-template-columns: 1fr 1fr; }
  #shop-panel .shop-item .s-en { display: none; }
}

/* Ending art belongs to the ending screen, independent of gameplay/story layers. */
#win {
  background-image: linear-gradient(90deg, rgba(5,9,18,.88), rgba(5,9,18,.4)), var(--ending-art, url('../assets/story/noorabad.jpg'));
  background-size: cover;
  background-position: center, 65% center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
}
#win .win-card { width: min(620px, 92vw); max-height: 100%; overflow-y: auto; background: rgba(7,14,24,.87); }
#win [hidden] { display: none !important; }
@media (min-width: 900px) { #win { align-items: flex-start; padding-left: 5vw; } }
