/* General Styling - Dark Fantasy Arcane Theme */
:root {
  --gold-primary: #d4af37;
  --gold-bright: #facc15;
  --gold-dark: #854d0e;
  --gold-muted: #c5a059;
  --navy-obsidian: #050811;
  --navy-celestial: #0a1226;
  --karolos-azure: #38bdf8;
  --karolos-cyan: #00e5ff;
  --font-display: 'Cinzel Decorative', Georgia, serif;
  --font-serif: 'Marcellus', 'Cinzel', serif;
}

/* Brass-and-Sapphire Celestial Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--navy-obsidian, #050811);
  border: 1px solid rgba(212, 175, 55, 0.2);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e3a8a, #0369a1);
  border: 1px solid var(--gold-primary, #d4af37);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2563eb, #0284c7);
  border-color: var(--gold-bright, #facc15);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
}

html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden !important;
  position: fixed;
  inset: 0;
}

body {
  --theme-accent: rgba(56, 189, 248, 0.45);
  --theme-glow: rgba(56, 189, 248, 0.15);
  --theme-text-accent: #38bdf8;
  --circle-speed: 90s;
  --orb-color-1: #38bdf8;
  --orb-color-2: #818cf8;

  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 50%, #030712 100%);
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Montserrat', sans-serif;
  color: #f8fafc;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  transition: background 0.8s ease-in-out;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: background 0.8s ease-in-out;
}

/* Arcane Magic Circle Backdrop & Floating Mana Particles */
.arcane-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  contain: strict;
  transform: translateZ(0);
}

@keyframes magicCircleRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes magicCircleCounterRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.magic-circle-svg {
  position: absolute;
  width: 86vmin;
  height: 86vmin;
  max-width: 750px;
  max-height: 750px;
  opacity: 0.15;
  color: var(--theme-text-accent);
  transform-origin: center center;
  transition: color 0.8s ease;
  contain: paint;
  will-change: transform;
  transform: translateZ(0);
}

/* Floating Mana Particles */
.mana-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.mana-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  bottom: -30px;
  box-shadow: 0 0 10px currentColor;
  opacity: 0;
  animation: floatUpOrb 9s ease-in-out infinite;
  transition: color 0.8s ease;
  will-change: transform, opacity;
  transform: translateZ(0);
}

@keyframes floatUpOrb {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0;
  }
  15% {
    opacity: 0.75;
  }
  85% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-110vh) scale(1.1);
    opacity: 0;
  }
}

.mana-orb:nth-child(1)  { left: 6%;  width: 10px; height: 10px; color: var(--orb-color-1); animation-duration: 9s;   animation-delay: 0s;   }
.mana-orb:nth-child(2)  { left: 16%; width: 14px; height: 14px; color: var(--orb-color-2); animation-duration: 12.5s; animation-delay: 2.5s; }
.mana-orb:nth-child(3)  { left: 25%; width: 7px;  height: 7px;  color: var(--orb-color-1); animation-duration: 8s;    animation-delay: 4.2s; }
.mana-orb:nth-child(4)  { left: 34%; width: 16px; height: 16px; color: var(--orb-color-2); animation-duration: 14s;   animation-delay: 1.2s; }
.mana-orb:nth-child(5)  { left: 44%; width: 9px;  height: 9px;  color: var(--orb-color-1); animation-duration: 9.5s;  animation-delay: 5.5s; }
.mana-orb:nth-child(6)  { left: 53%; width: 12px; height: 12px; color: var(--orb-color-2); animation-duration: 11s;   animation-delay: 0.6s; }
.mana-orb:nth-child(7)  { left: 62%; width: 8px;  height: 8px;  color: var(--orb-color-1); animation-duration: 10s;   animation-delay: 3.8s; }
.mana-orb:nth-child(8)  { left: 71%; width: 15px; height: 15px; color: var(--orb-color-2); animation-duration: 13s;   animation-delay: 6s;   }
.mana-orb:nth-child(9)  { left: 81%; width: 6px;  height: 6px;  color: var(--orb-color-1); animation-duration: 8.5s;  animation-delay: 2.1s; }
.mana-orb:nth-child(10) { left: 89%; width: 11px; height: 11px; color: var(--orb-color-2); animation-duration: 10.5s; animation-delay: 4.8s; }
.mana-orb:nth-child(11) { left: 20%; width: 8px;  height: 8px;  color: var(--orb-color-1); animation-duration: 10.2s; animation-delay: 7.2s; }
.mana-orb:nth-child(12) { left: 77%; width: 13px; height: 13px; color: var(--orb-color-2); animation-duration: 11.8s; animation-delay: 1.8s; }

/* Mode Atmospheric Themes */
body.mode-endless {
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 50%, #030712 100%) !important;
  --theme-accent: rgba(56, 189, 248, 0.45);
  --theme-glow: rgba(56, 189, 248, 0.15);
  --theme-text-accent: #38bdf8;
  --circle-speed: 90s;
  --orb-color-1: #38bdf8;
  --orb-color-2: #818cf8;
}
body.mode-endless::before {
  background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.14) 0%, transparent 70%);
}

body.mode-timed {
  background: radial-gradient(circle at 50% 25%, #3b1d06 0%, #1a0b02 50%, #030712 100%) !important;
  --theme-accent: rgba(251, 191, 36, 0.45);
  --theme-glow: rgba(251, 191, 36, 0.15);
  --theme-text-accent: #fbbf24;
  --circle-speed: 24s;
  --orb-color-1: #fbbf24;
  --orb-color-2: #f97316;
}
body.mode-timed::before {
  background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
}

body.mode-versus {
  background: linear-gradient(125deg, #3f0a14 0%, #0f172a 50%, #082f49 100%) !important;
  --theme-accent: rgba(192, 132, 252, 0.45);
  --theme-glow: rgba(192, 132, 252, 0.15);
  --theme-text-accent: #c084fc;
  --circle-speed: 45s;
  --orb-color-1: #f43f5e;
  --orb-color-2: #38bdf8;
}
body.mode-versus::before {
  background: radial-gradient(circle at 50% 50%, rgba(192, 132, 252, 0.12) 0%, transparent 70%);
}

body.mode-coop {
  background: radial-gradient(circle at 50% 25%, #063e32 0%, #02241d 50%, #030712 100%) !important;
  --theme-accent: rgba(52, 211, 153, 0.45);
  --theme-glow: rgba(52, 211, 153, 0.15);
  --theme-text-accent: #34d399;
  --circle-speed: 70s;
  --orb-color-1: #38bdf8;
  --orb-color-2: #4ade80;
}
body.mode-coop::before {
  background: radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.15) 0%, transparent 70%);
}

/* Boss Dynamic Atmospheric Auras */
body.boss-sopor {
  background: radial-gradient(circle at 50% 25%, #11224a 0%, #070e24 55%, #030712 100%) !important;
}
body.boss-sopor::before {
  background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, 0.16) 0%, rgba(99, 102, 241, 0.1) 38%, transparent 72%);
}

/* Main Layout Container - True Landscape Side-by-Side Widescreen */
.game-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 12px 20px;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.arena-center-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 590px;
  height: 590px;
  min-width: 590px;
  flex-shrink: 0;
}

body.mode-campaign .game-container {
  padding: 8px 18px;
}

body.mode-campaign .arena-center-stage {
  flex-direction: column;
  height: auto;
  min-height: 0;
  gap: 6px;
}

@media (min-width: 1210px) {
  .game-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
  }
  .game-container .scoreBoard {
    grid-column: 1;
    justify-self: end;
  }
  .game-container .arena-center-stage {
    grid-column: 2;
    justify-self: center;
  }
}

.grid {
  display: none;
  flex-wrap: wrap;
  height: 560px;
  width: 560px;
  min-width: 560px;
  background-color: #060a14;
  background-image: 
    radial-gradient(circle at center, #0a1329 0%, #050811 100%),
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 70px 70px, 70px 70px;
  background-position: center, 8px 8px, 8px 8px;
  padding: 8px;
  border-radius: 22px;
  border: 7px solid #c5a059;
  outline: 2px solid #78350f;
  outline-offset: -3px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(212, 175, 55, 0.22), inset 0 0 30px rgba(0, 0, 0, 0.9);
  box-sizing: content-box;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
  transition: border-color 0.8s ease, box-shadow 0.8s ease;
  contain: strict;
  transform: translateZ(0);
}

/* Corner Rosette Ornaments for Celestial Observatory Altar (4 Corners) */
.grid::before,
.grid::after {
  content: "✦";
  position: absolute;
  font-size: 15px;
  color: var(--gold-bright, #facc15);
  pointer-events: none;
  z-index: 50;
  line-height: 1;
}
.grid::before {
  top: 2px;
  left: 3px;
  text-shadow: 568px 0 0 var(--gold-bright, #facc15), 0 0 8px rgba(212, 175, 55, 0.8), 568px 0 8px rgba(212, 175, 55, 0.8);
}
.grid::after {
  bottom: 2px;
  right: 3px;
  text-shadow: -568px 0 0 var(--gold-bright, #facc15), 0 0 8px rgba(212, 175, 55, 0.8), -568px 0 8px rgba(212, 175, 55, 0.8);
}

.grid > div {
  height: 70px;
  width: 70px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.16);
  background-size: 82%;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 12px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.65);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  transition: opacity 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

/* Hover effect for interactivity */
.grid div:hover {
  transform: scale(1.06);
  transition: transform 0.2s ease;
  z-index: 2;
}

/* Sliding Swap Animation */
.grid div.swapping {
  transition: transform 0.15s ease-in-out !important;
  z-index: 5;
}

.grid div.swapping-reverse {
  transition: transform 0.12s ease-in-out !important;
  z-index: 5;
}

/* Board Micro-Shake Animation */
@keyframes boardMicroShake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -2px); }
  80% { transform: translate(2px, 1px); }
  100% { transform: translate(0, 0); }
}

.grid.board-shake {
  animation: boardMicroShake 0.18s ease-in-out !important;
}

/* Candy Popping Animation */
@keyframes candyPop {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.28); opacity: 0.95; filter: brightness(1.3); }
  100% { transform: scale(0); opacity: 0; }
}

.grid div.popping {
  animation: candyPop 0.18s forwards ease-in-out !important;
  pointer-events: none;
}

/* Candy Drop-in Gravity Animation */
@keyframes dropIn {
  0% { transform: translateY(-32px); opacity: 0.25; }
  100% { transform: translateY(0); opacity: 1; }
}

.grid div.dropping {
  animation: dropIn 0.18s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* Floating Text */
@keyframes floatUpFade {
  0% { transform: translate(-50%, 0) scale(0.7); opacity: 0; }
  25% { transform: translate(-50%, -10px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -45px) scale(1); opacity: 0; }
}

.grid .floating-text,
.floating-text {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
  animation: floatUpFade 0.85s forwards ease-out;
  z-index: 60;
  white-space: nowrap;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  border: none !important;
  background-color: transparent !important;
}

.floating-text.score { color: #f1c40f; font-size: 18px; }
.floating-text.combo { color: #e67e22; font-size: 20px; text-shadow: 0 0 10px #e67e22; }
.floating-text.damage { color: #ff3838; font-size: 22px; text-shadow: 0 0 12px #ff3838; }
.floating-text.synergy { color: #2ecc71; font-size: 20px; text-shadow: 0 0 10px #2ecc71; }

/* ========================================================
   SPECIAL CANDIES VISUAL EFFECTS (VFX)
   ======================================================== */

/* 1. Arcane Laser Beam VFX (Striped Candy) */
@keyframes laserStrikeHorizontal {
  0% { transform: translateY(-50%) scaleX(0) scaleY(0.4); opacity: 0; }
  25% { transform: translateY(-50%) scaleX(1) scaleY(1.4); opacity: 1; }
  65% { transform: translateY(-50%) scaleX(1) scaleY(1); opacity: 0.9; }
  100% { transform: translateY(-50%) scaleX(1) scaleY(0); opacity: 0; }
}

@keyframes laserStrikeVertical {
  0% { transform: translateX(-50%) scaleY(0) scaleX(0.4); opacity: 0; }
  25% { transform: translateX(-50%) scaleY(1) scaleX(1.4); opacity: 1; }
  65% { transform: translateX(-50%) scaleY(1) scaleX(1); opacity: 0.9; }
  100% { transform: translateX(-50%) scaleY(1) scaleX(0); opacity: 0; }
}

.grid .vfx-laser,
.vfx-overlay .vfx-laser,
.vfx-laser {
  position: absolute;
  pointer-events: none;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 0 12px #00e5ff, 0 0 24px #3498db, 0 0 40px #ffffff;
  z-index: 54;
  overflow: visible !important;
}

.grid .vfx-laser.horizontal,
.vfx-overlay .vfx-laser.horizontal,
.vfx-laser.horizontal {
  left: 8px;
  width: 560px !important;
  height: 14px !important;
  transform-origin: center center;
  animation: laserStrikeHorizontal 0.32s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

.grid .vfx-laser.vertical,
.vfx-overlay .vfx-laser.vertical,
.vfx-laser.vertical {
  top: 8px;
  height: 560px !important;
  width: 14px !important;
  transform-origin: center center;
  animation: laserStrikeVertical 0.32s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}

/* 2. Shockwave Ring, Radial Flash & Sparks VFX (Wrapped Candy) */
@keyframes vfxFlashAnim {
  0% { transform: translate(-50%, -50%) scale(0.18); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

@keyframes vfxShockwaveAnim {
  0% { transform: translate(-50%, -50%) scale(0.1); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 0; }
}

@keyframes vfxSparkAnim {
  0% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0); opacity: 0; }
}

.grid .vfx-flash,
.vfx-overlay .vfx-flash,
.vfx-flash {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  width: 220px;
  height: 220px;
  z-index: 52;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffffff 15%, #ffd700 50%, #ff5252 80%, transparent 100%);
  border: none !important;
  background-color: transparent !important;
  animation: vfxFlashAnim 0.35s ease-out forwards;
  overflow: visible !important;
}

.grid .vfx-shockwave,
.vfx-overlay .vfx-shockwave,
.vfx-shockwave {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 4px solid #ffffff;
  box-shadow: 0 0 20px #ff9f43, inset 0 0 14px #ff5252;
  z-index: 53;
  transform: translate(-50%, -50%) scale(0.1);
  animation: vfxShockwaveAnim 0.38s cubic-bezier(0.15, 0.85, 0.25, 1) forwards;
  overflow: visible !important;
}

.grid .vfx-spark,
.vfx-overlay .vfx-spark,
.vfx-spark {
  position: absolute;
  pointer-events: none;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px #ffd700, 0 0 14px #ff5722;
  z-index: 53;
  animation: vfxSparkAnim 0.4s ease-out forwards;
  overflow: visible !important;
}

/* 3. SVG Homing Lightning & Target Rings VFX (Color Bomb) */
@keyframes lightningStrike {
  0% { stroke-dashoffset: 600; opacity: 1; }
  70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes targetRingAnim {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  65% { transform: translate(-50%, -50%) scale(1.15); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; }
}

.grid .vfx-svg-overlay,
.vfx-overlay .vfx-svg-overlay,
.vfx-svg-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 560px !important;
  height: 560px !important;
  pointer-events: none;
  z-index: 55;
  overflow: visible !important;
}

.vfx-lightning-beam {
  stroke: #ffffff;
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px #00e5ff);
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: lightningStrike 0.24s ease-out forwards;
}

.grid .vfx-target-ring,
.vfx-overlay .vfx-target-ring,
.vfx-target-ring {
  position: absolute;
  pointer-events: none;
  width: 54px !important;
  height: 54px !important;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 14px #00e5ff, inset 0 0 10px #ff1744;
  z-index: 54;
  transform: translate(-50%, -50%);
  animation: targetRingAnim 0.32s ease-out forwards;
  overflow: visible !important;
}

/* Stage 3A: Special Candies Visual Styling */

/* Striped Candy - Horizontal clearing (horizontal laser energy bands) */
.grid div.striped-horizontal::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 12px;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.95) 0px,
    rgba(255, 255, 255, 0.95) 3px,
    transparent 3px,
    transparent 11px
  );
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.7), 0 0 6px rgba(255, 255, 255, 0.4);
  mix-blend-mode: screen;
}

/* Striped Candy - Vertical clearing (vertical laser energy bands) */
.grid div.striped-vertical::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 12px;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.95) 0px,
    rgba(255, 255, 255, 0.95) 3px,
    transparent 3px,
    transparent 11px
  );
  box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.7), 0 0 6px rgba(255, 255, 255, 0.4);
  mix-blend-mode: screen;
}

/* Crystal Facet Silhouette Clipping: Ensures laser stripes conform 100% strictly to gemstone geometry */
.grid div[data-candy-color="red"].striped-horizontal::after,
.grid div[data-candy-color="red"].striped-vertical::after {
  clip-path: polygon(50% 6%, 88% 28%, 88% 72%, 50% 94%, 12% 72%, 12% 28%);
}
.grid div[data-candy-color="blue"].striped-horizontal::after,
.grid div[data-candy-color="blue"].striped-vertical::after {
  clip-path: polygon(30% 8%, 70% 8%, 92% 30%, 92% 70%, 70% 92%, 30% 92%, 8% 70%, 8% 30%);
}
.grid div[data-candy-color="green"].striped-horizontal::after,
.grid div[data-candy-color="green"].striped-vertical::after {
  clip-path: polygon(26% 10%, 74% 10%, 90% 26%, 90% 74%, 74% 90%, 26% 90%, 10% 74%, 10% 26%);
}
.grid div[data-candy-color="yellow"].striped-horizontal::after,
.grid div[data-candy-color="yellow"].striped-vertical::after {
  clip-path: polygon(50% 6%, 94% 50%, 50% 94%, 6% 50%);
}
.grid div[data-candy-color="orange"].striped-horizontal::after,
.grid div[data-candy-color="orange"].striped-vertical::after {
  clip-path: polygon(50% 8%, 86% 18%, 94% 54%, 70% 88%, 30% 88%, 6% 54%, 14% 18%);
}
.grid div[data-candy-color="purple"].striped-horizontal::after,
.grid div[data-candy-color="purple"].striped-vertical::after {
  clip-path: polygon(50% 8%, 88% 26%, 88% 74%, 50% 92%, 12% 74%, 12% 26%);
}

/* Color Bomb - Cosmic Astral Sphere inside the grid cell */
.grid div.color-bomb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid div.color-bomb::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd700 0%, #ff3b69 25%, #8b5cf6 55%, #1e1b4b 80%, #05020a 100%);
  border: 2px solid rgba(254, 240, 138, 0.85);
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.7), inset 0 0 8px rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.grid div.color-bomb::after {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: #ffffff;
  text-shadow: 0 0 8px #f59e0b, 0 0 16px #ec4899, 0 0 24px #38bdf8;
  animation: color-bomb-pulse 1.8s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes color-bomb-pulse {
  0% { transform: translate(-50%, -50%) scale(0.85) rotate(0deg); }
  100% { transform: translate(-50%, -50%) scale(1.15) rotate(180deg); }
}

/* Scoreboard Styling - Dark Arcane Glass Lectern (Left HUD Column) */
.scoreBoard {
  display: none;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  background: linear-gradient(180deg, rgba(10, 16, 32, 0.98), rgba(5, 8, 17, 0.98));
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.3);
  outline-offset: -5px;
  border-radius: 20px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7), 0 0 25px rgba(212, 175, 55, 0.12);
  padding: 14px 16px;
  color: #f8fafc;
  box-sizing: border-box;
  max-height: min(94vh, 580px);
  overflow-y: auto;
  transition: border-color 0.8s ease, box-shadow 0.8s ease;
  contain: layout style;
  transform: translateZ(0);
}

.hud-top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 10px;
  margin-bottom: 10px;
}

.control-icon-btn {
  background: radial-gradient(circle at 35% 35%, #1e293b, #0f172a);
  border: 1.5px solid var(--gold-primary, #d4af37);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.control-icon-btn:hover {
  background: radial-gradient(circle at 35% 35%, #334155, #1e293b);
  border-color: var(--gold-bright, #facc15);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
}

.control-icon-btn.audio-playing {
  border-color: var(--gold-bright, #facc15);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
  animation: audioPulse 2s infinite ease-in-out;
}

@keyframes audioPulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
    border-color: rgba(212, 175, 55, 0.5);
  }
  50% {
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.7);
    border-color: var(--gold-bright, #facc15);
  }
}

#standardScoreHeader {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 6px;
}

h3, h1 {
  margin: 0;
}

h3, #scoreTitle {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold-muted, #c5a059);
  text-transform: uppercase;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(197, 160, 89, 0.35);
}

h1, #score {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 38px;
  font-weight: 800;
  color: var(--gold-bright, #facc15);
  text-shadow: 0 0 16px rgba(250, 204, 21, 0.6), 0 2px 4px #000000;
  margin-top: -2px;
  transition: color 0.8s ease, text-shadow 0.8s ease;
}

/* Mode Selection Styling - Widescreen Celestial Observatory Altar */
#modeSelection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at center, #0e1830 0%, #0a1020 65%, #050811 100%);
  font-family: 'Montserrat', sans-serif;
  z-index: 100;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
  contain: paint layout;
  transform: translateZ(0);
}

.mode-selection-card {
  background: transparent;
  border: none;
  outline: none;
  border-radius: 0;
  box-shadow: none;
  padding: 10px 20px 8px 20px;
  width: min(1120px, 94vw);
  max-height: min(92vh, 580px);
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  color: #ffffff;
  box-sizing: border-box;
  position: relative;
  contain: layout;
}

/* 4 Corner Filigree Brackets for Mode Lectern (Hidden for seamless boundless presentation) */
.card-filigree {
  display: none;
}

/* ========================================================
   MONUMENTAL MAIN MENU TITLE ("THE GEMSTONE SORCERY ACADEMY")
   ======================================================== */
.title-monument-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  contain: layout;
}

/* Watermarked Celestial Astrolabe Rune Backdrop */
.astrolabe-rune-backdrop {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(0);
  width: 190px;
  height: 190px;
  pointer-events: none;
  z-index: 0;
  contain: paint;
  will-change: transform;
  animation: astrolabeRuneSpin 90s linear infinite;
  opacity: 0.75;
}

@keyframes astrolabeRuneSpin {
  from { transform: translate(-50%, -50%) rotate(0deg) translateZ(0); }
  to { transform: translate(-50%, -50%) rotate(360deg) translateZ(0); }
}

.rune-rings-svg {
  width: 100%;
  height: 100%;
}

/* Small Roman Tracked Prefix */
.game-title-prefix {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 5px;
  color: rgba(212, 175, 55, 0.85);
  text-transform: uppercase;
  margin-bottom: 4px;
  z-index: 1;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* ==========================================================================
   SNAPSHOT BACKUP (GOLD TITLE STYLE) - REVERTIBLE:
   .game-title.backup-gold {
     background: linear-gradient(180deg, #ffffff 0%, #fef9c3 14%, #fef08a 28%, #facc15 46%, #eab308 64%, #ca8a04 82%, #854d0e 100%);
     -webkit-background-clip: text;
     background-clip: text;
     -webkit-text-fill-color: transparent;
     color: transparent;
     filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.5)) drop-shadow(0 2px 0px rgba(0, 0, 0, 0.98)) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.85));
   }
   ========================================================================== */

/* Monumental Title with Royal Glintstone Crystalline Sorcery & Razor-Sharp Relief */
.game-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  text-align: center;
  margin: 0;
  line-height: 1.1;
  text-transform: uppercase;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #e0f2fe 12%,
    #bae6fd 28%,
    #38bdf8 52%,
    #0ea5e9 76%,
    #0284c7 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  /* Chiseled 3D crystalline relief: razor-sharp occlusion cuts + crisp Glintstone starlight (zero blurry mist) */
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.95))
          drop-shadow(0 4px 10px rgba(0, 0, 0, 0.85))
          drop-shadow(0 0 14px rgba(56, 189, 248, 0.45));
  animation: celestialTitleBreathe 4s ease-in-out infinite alternate;
  transform: translateZ(0);
  will-change: opacity, transform;
  padding-bottom: 2px;
}

.title-line-main {
  display: block;
  font-size: clamp(24px, 2.7vw, 34px);
  font-weight: 900;
  letter-spacing: clamp(5px, 0.55vw, 8px);
}

.title-line-sub {
  display: block;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 900;
  letter-spacing: clamp(9px, 0.9vw, 15px);
  margin-top: 2px;
}

@keyframes celestialTitleBreathe {
  0% {
    opacity: 0.92;
    transform: scale(0.995) translateZ(0);
  }
  100% {
    opacity: 1;
    transform: scale(1.005) translateZ(0);
  }
}

/* Tapered Starlight Hairline Divider */
.elden-title-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(380px, 80%);
  margin-top: 6px;
  z-index: 1;
}

.elden-title-divider .divider-taper {
  flex: 1;
  height: 1px;
}

.elden-title-divider .divider-taper.left {
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6));
}

.elden-title-divider .divider-taper.right {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.6), transparent);
}

.elden-title-divider .divider-rune {
  color: var(--gold-bright, #facc15);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
}

/* ========================================================
   ELDEN RING STYLE TITLE SPLASH ("PRESS ANY BUTTON")
   ======================================================== */
.elden-press-any-prompt {
  display: none;
}

#modeSelection.title-splash-active {
  cursor: pointer;
}

#modeSelection.title-splash-active .mode-selection-card {
  justify-content: center;
  align-items: center;
  gap: 44px;
  min-height: 360px;
}

#modeSelection.title-splash-active .mode-button-group,
#modeSelection.title-splash-active .menu-secondary-actions {
  display: none;
}

#modeSelection.title-splash-active .elden-press-any-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 32px;
  user-select: none;
  -webkit-user-select: none;
  animation: eldenPressAnyPulse 2.6s ease-in-out infinite;
  outline: none;
}

.press-any-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(260px, 65vw);
  opacity: 0.72;
}

.press-any-rule {
  flex: 1;
  height: 1px;
}

.press-any-rule.left {
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.7));
}

.press-any-rule.right {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.7), transparent);
}

.press-any-diamond {
  font-size: 9px;
  color: rgba(250, 204, 21, 0.85);
  line-height: 1;
}

.press-any-text {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: clamp(14px, 1.55vw, 18px);
  font-weight: 700;
  letter-spacing: clamp(4px, 0.5vw, 6.5px);
  color: #fef3c7;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95), 0 0 18px rgba(250, 204, 21, 0.55);
}

#modeSelection.title-splash-active:hover .press-any-text {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 22px rgba(250, 204, 21, 0.85);
}

@keyframes eldenPressAnyPulse {
  0%, 100% {
    opacity: 0.42;
    transform: translateY(0) scale(0.99);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px) scale(1.015);
  }
}

#modeSelection:not(.title-splash-active) .mode-button-group,
#modeSelection:not(.title-splash-active) .menu-secondary-actions {
  animation: eldenMainMenuReveal 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes eldenMainMenuReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================
   5-COLUMN HORIZONTAL MODE BUTTON GROUP (WIDESCREEN ALTAR)
   ======================================================== */
.mode-button-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 12px 0;
  width: 100%;
}

.medallion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 10px;
  font-family: inherit;
  border-radius: 16px;
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.3, 1), border-color 0.12s ease, box-shadow 0.12s ease;
  will-change: transform;
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.85) 0%, rgba(10, 16, 28, 0.95) 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(56, 189, 248, 0.04);
  position: relative;
  overflow: hidden;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.medallion-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: translate3d(-140%, 0, 0) skewX(-20deg);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.3, 1);
  will-change: transform;
  pointer-events: none;
}

.medallion-btn:hover {
  transform: translateY(-3px) translateZ(0);
  background: linear-gradient(180deg, rgba(30, 48, 80, 0.9) 0%, rgba(14, 24, 44, 0.98) 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 16px rgba(56, 189, 248, 0.3), inset 0 0 14px rgba(212, 175, 55, 0.15);
  border-color: var(--gold-bright, #facc15);
}

.medallion-btn:hover::before {
  transform: translate3d(220%, 0, 0) skewX(-20deg);
}

.medallion-btn:active {
  transform: translateY(-1px) scale(0.97) translateZ(0);
  transition: transform 0.05s ease;
}

.medallion-btn.highlight {
  background: linear-gradient(180deg, rgba(67, 24, 105, 0.85) 0%, rgba(26, 16, 60, 0.95) 100%);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 6px 18px rgba(126, 34, 206, 0.35), 0 0 14px rgba(212, 175, 55, 0.25);
}

.medallion-btn.highlight:hover {
  transform: translateY(-3px) translateZ(0);
  background: linear-gradient(180deg, rgba(92, 32, 145, 0.95) 0%, rgba(40, 18, 88, 1) 100%);
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.5), 0 0 18px rgba(250, 204, 21, 0.45);
  border-color: var(--gold-bright, #facc15);
}

.medallion-btn.highlight:active {
  transform: translateY(-1px) scale(0.97) translateZ(0);
  transition: transform 0.05s ease;
}
  box-shadow: 0 8px 24px rgba(147, 51, 234, 0.5), 0 0 18px rgba(250, 204, 21, 0.45);
  border-color: var(--gold-bright, #facc15);
}

.mode-icon-crest {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.3, 1);
  will-change: transform;
}

.mode-icon-crest .mode-svg {
  width: 40px;
  height: 40px;
}

.medallion-btn:hover .mode-icon-crest {
  transform: scale(1.08) translateZ(0);
}

.mode-title-text {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #f1f5f9;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.medallion-btn:hover .mode-title-text {
  color: var(--gold-bright, #facc15);
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.5);
}

/* ========================================================
   BOTTOM NAVIGATION DOCK: CIRCULAR GOLD-FILIGREE MEDALLIONS
   ======================================================== */
.menu-secondary-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  border-top: none;
  padding-top: 12px;
  margin-top: 2px;
  position: relative;
}

.menu-secondary-actions::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, 80%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.35) 50%, transparent);
}

.dock-medallion-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(20, 32, 54, 0.95), rgba(8, 14, 26, 0.98));
  border: 1.5px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.3);
  outline-offset: -3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(56, 189, 248, 0.08);
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.3, 1), border-color 0.12s ease, box-shadow 0.12s ease;
  will-change: transform;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.dock-medallion-btn svg {
  width: 24px;
  height: 24px;
  color: #e2e8f0;
  transition: transform 0.12s ease, color 0.12s ease;
  pointer-events: none;
}

.dock-medallion-btn:hover {
  transform: translateY(-3px) scale(1.08) translateZ(0);
  border-color: var(--gold-bright, #facc15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 18px rgba(250, 204, 21, 0.45);
}

.dock-medallion-btn:hover svg {
  color: var(--gold-bright, #facc15);
}

.dock-medallion-btn:active {
  transform: translateY(-1px) scale(0.97) translateZ(0);
  transition: transform 0.05s ease;
}

.credits-modal-card {
  max-width: 500px;
  text-align: center;
}

.credits-author-card {
  background: linear-gradient(145deg, rgba(16, 26, 48, 0.92), rgba(8, 14, 28, 0.96));
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 14px 0;
  box-shadow: inset 0 0 18px rgba(212, 175, 55, 0.08);
}

.credits-author-name {
  font-family: 'Cinzel', var(--font-serif, serif);
  font-size: 20px;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.credits-author-meta {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #7dd3fc;
  margin-bottom: 4px;
}

.credits-author-course {
  display: inline-block;
  margin-top: 2px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: #fde68a;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.credits-assets-box {
  background: rgba(8, 14, 26, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 16px;
}

.credits-assets-box h3 {
  margin: 0 0 8px 0;
  font-family: var(--font-serif, 'Cinzel', serif);
  font-size: 13px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #38bdf8;
}

.credits-assets-lead {
  margin: 0 0 10px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #e2e8f0;
}

.credits-assets-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
}

.credits-assets-list strong {
  color: #fef08a;
}

.credits-assets-list code {
  color: #7dd3fc;
  font-size: 11px;
}

/* Campaign Act I Closure / To Be Continued Modal */
.tbc-modal-card {
  max-width: 540px;
  text-align: center;
  background: linear-gradient(155deg, rgba(14, 21, 42, 0.98), rgba(8, 12, 26, 0.99));
  border: 1.5px solid rgba(212, 175, 55, 0.65);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 36px rgba(212, 175, 55, 0.16);
}

.tbc-emblem-wrap {
  margin: 10px auto 6px;
  display: flex;
  justify-content: center;
}

.tbc-emblem-svg {
  width: 54px !important;
  height: 54px !important;
  max-width: 54px !important;
  max-height: 54px !important;
  filter: drop-shadow(0 0 14px rgba(250, 204, 21, 0.35));
}

.tbc-subtitle {
  margin: 0 0 14px 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #cbd5e1;
}

.tbc-subtitle strong {
  color: #fef08a;
}

.tbc-summary-box {
  background: rgba(9, 15, 30, 0.84);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.tbc-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #e2e8f0;
}

.tbc-pill {
  flex-shrink: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
  padding: 4px 9px;
  border-radius: 999px;
  min-width: 96px;
  text-align: center;
}

.tbc-pill.done {
  color: #86efac;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.tbc-pill.soon {
  color: #fde047;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.tbc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.tbc-actions .action-btn {
  flex: 1 1 190px;
  margin-top: 0;
}

/* ========================================================
   ARCANE TOOLTIP: CELESTIAL RUNE PLAQUE (REPLACES OS POPUP)
   ======================================================== */
.dock-medallion-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 11px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fef08a;
  background: linear-gradient(135deg, rgba(14, 22, 38, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 1px solid rgba(212, 175, 55, 0.65);
  outline: 1px solid rgba(212, 175, 55, 0.2);
  outline-offset: -3px;
  border-radius: 6px;
  padding: 6px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 14px rgba(212, 175, 55, 0.3), inset 0 0 8px rgba(56, 189, 248, 0.08);
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.6), 0 1px 2px #000000;
  transition: opacity 0.1s ease, transform 0.1s cubic-bezier(0.2, 0.8, 0.3, 1), visibility 0.1s;
  z-index: 1000;
}

/* Little Gold Pointer Notch */
.dock-medallion-btn::after {
  content: "";
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: rgba(212, 175, 55, 0.7) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.1s ease, transform 0.1s cubic-bezier(0.2, 0.8, 0.3, 1), visibility 0.1s;
  z-index: 1000;
}

.dock-medallion-btn:hover::before,
.dock-medallion-btn:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.btn-icon {
  font-size: 18px;
}

/* Timer */
#timer {
  font-size: 16px;
  font-weight: bold;
  color: #f87171;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
  margin-top: 6px;
}

/* Initially Hide Game Elements */
.grid, .scoreBoard {
  display: none;
}

/* Shake animation for invalid swap rollback */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.grid div.shake {
  animation: shake 0.3s ease-in-out;
}

/* Selected square highlight removed in favor of pure drag/swipe */

.grid.locked {
  cursor: wait;
}

/* Notice for reshuffle / status */
.notice {
  font-size: 14px;
  color: #ff4500;
  font-weight: bold;
  min-height: 20px;
  margin-top: 5px;
  text-align: center;
}

/* --- STAGE 2: ACHIEVER STYLING --- */

/* Personal Best & Live Stars */
.pb-display {
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 5px;
}

#pbScore {
  color: #facc15;
  font-weight: 700;
}

.star-display {
  font-size: 20px;
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
  letter-spacing: 3px;
  margin: 4px 0;
}

/* ========================================================
   OBSIDIAN SLATE TABLETS (IN-GAME ACTION BUTTONS)
   ======================================================== */
.hud-action-btn {
  position: relative;
  width: 100%;
  margin-top: 8px;
  padding: 10px 14px 10px 18px;
  background: linear-gradient(135deg, rgba(16, 24, 42, 0.95) 0%, rgba(8, 12, 22, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  outline: 1px solid rgba(212, 175, 55, 0.2);
  outline-offset: -3px;
  border-radius: 8px;
  cursor: pointer;
  color: #f1f5f9;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
  box-sizing: border-box;
}

/* Guard against JS inline style="display: block" breaking obsidian flex layout */
.hud-action-btn[style*="display: block"] {
  display: flex !important;
}

.hud-action-btn svg,
.dock-medallion-btn svg {
  pointer-events: none;
}

/* Gemstone Left Edge Accent Bar */
.hud-action-btn .btn-gem-edge {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  transition: width 0.25s ease, box-shadow 0.25s ease;
}

.hud-action-btn.ruby .btn-gem-edge {
  background: linear-gradient(180deg, #f87171, #ef4444, #991b1b);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.hud-action-btn.topaz .btn-gem-edge {
  background: linear-gradient(180deg, #fde047, #facc15, #854d0e);
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.6);
}

.hud-action-btn.azure .btn-gem-edge {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8, #0369a1);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.hud-action-btn .btn-svg-wrap {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hud-action-btn .btn-svg-wrap svg {
  width: 18px;
  height: 18px;
}

.hud-action-btn.ruby .btn-svg-wrap svg {
  color: #ef4444;
}

.hud-action-btn.topaz .btn-svg-wrap svg {
  color: #facc15;
}

.hud-action-btn.azure .btn-svg-wrap svg {
  color: #38bdf8;
}

.hud-action-btn .btn-text {
  flex: 1;
  text-align: left;
}

/* Gleam sweep animation on hover */
.hud-action-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-25deg);
  transition: left 0.5s ease;
  pointer-events: none;
}

.hud-action-btn:hover {
  transform: translateY(-2px);
  border-color: var(--gold-bright, #facc15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 15px rgba(212, 175, 55, 0.35);
  color: #ffffff;
}

.hud-action-btn:hover::after {
  left: 140%;
}

.hud-action-btn:hover .btn-gem-edge {
  width: 6px;
}

.hud-action-btn.ruby:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 15px rgba(239, 68, 68, 0.4);
}

.hud-action-btn.topaz:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 15px rgba(250, 204, 21, 0.45);
}

.hud-action-btn.azure:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7), 0 0 15px rgba(56, 189, 248, 0.4);
}

/* Modal Overlay & Content - Zero-Scroll Viewport Isolation */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at center, rgba(14, 20, 36, 0.88) 0%, rgba(4, 7, 15, 0.96) 100%);
  justify-content: center;
  align-items: center;
  z-index: 100;
  overflow-y: auto;
  padding: 16px;
  box-sizing: border-box;
  contain: paint;
}

#leaderboardModal,
#versusSetupModal,
#coopSetupModal {
  z-index: 110;
}

#modeTutorialModal,
#confirmQuitModal {
  z-index: 120;
}

.modal-content {
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -5px;
  border-radius: 20px;
  padding: 24px;
  width: min(520px, 92vw);
  max-height: min(88vh, 640px);
  overflow-y: auto;
  text-align: center;
  color: #f8fafc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.15);
  animation: modalPop 0.25s cubic-bezier(0.2, 0.8, 0.3, 1);
  box-sizing: border-box;
}

@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-content h2, #endModalTitle {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--gold-bright, #facc15);
  font-size: 22px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

/* Tabs */
.tab-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* Leaderboard Table */
.leaderboard-container {
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 16px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  background: rgba(5, 8, 17, 0.6);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.leaderboard-table th {
  background: rgba(212, 175, 55, 0.15);
  padding: 9px 8px;
  color: var(--gold-bright, #facc15);
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--gold-primary, #d4af37);
}

.leaderboard-table td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  color: #cbd5e1;
}

.leaderboard-table tr:nth-child(1) td { font-weight: bold; color: var(--gold-bright, #facc15); text-shadow: 0 0 8px rgba(250, 204, 21, 0.5); }
.leaderboard-table tr:nth-child(2) td { font-weight: bold; color: #e2e8f0; text-shadow: 0 0 6px rgba(226, 232, 240, 0.4); }
.leaderboard-table tr:nth-child(3) td { font-weight: bold; color: #d97706; text-shadow: 0 0 6px rgba(217, 119, 6, 0.4); }

.empty-state {
  padding: 20px;
  color: #94a3b8;
  font-style: italic;
}

/* Achievements List */
.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 16px;
  text-align: left;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.25);
  transition: all 0.2s ease;
}

.achievement-card.unlocked {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.6);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.2);
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.achievement-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.4));
}

.achievement-info h4 {
  margin: 0;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 14px;
  color: #f8fafc;
}

.achievement-info p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: #94a3b8;
}

/* Modal Actions */
.modal-close-btn, .action-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #f8fafc;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: linear-gradient(135deg, #334155, #1e293b);
  border-color: var(--gold-bright, #facc15);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.action-btn {
  background: linear-gradient(135deg, #d4af37, #b45309);
  border: 1.5px solid #fde047;
  color: #050811;
  margin: 4px;
}

.action-btn:hover {
  background: linear-gradient(135deg, #facc15, #d4af37);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
  transform: translateY(-1px);
}

.action-btn.secondary {
  background: linear-gradient(135deg, #334155, #1e293b);
  border: 1.5px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
}

.action-btn.secondary:hover {
  border-color: rgba(212, 175, 55, 0.5);
  color: #ffffff;
}

.end-modal-score {
  margin: 12px 0;
}

.end-modal-score .label {
  display: block;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 12px;
  color: var(--gold-muted, #c5a059);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.end-modal-score .score-val {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 36px;
  font-weight: 800;
  color: var(--gold-bright, #facc15);
  text-shadow: 0 0 14px rgba(250, 204, 21, 0.6);
}

.end-stars {
  font-size: 28px;
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.6);
  margin-bottom: 8px;
}

.pb-badge {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(133, 77, 14, 0.5));
  border: 1px solid var(--gold-bright, #facc15);
  color: var(--gold-bright, #facc15);
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

#playerNameInput {
  padding: 9px 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  color: #f8fafc;
  margin-bottom: 10px;
  width: 70%;
  text-align: center;
}

#playerNameInput:focus {
  outline: none;
  border-color: var(--gold-bright, #facc15);
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.qualify-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.storage-warning {
  color: #e74c3c;
  font-size: 12px;
  margin: 6px 0;
  font-weight: bold;
}

.storage-notice {
  background: rgba(133, 77, 14, 0.25);
  color: var(--gold-bright, #facc15);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  margin-bottom: 8px;
  text-align: center;
}

.pb-badge.session-only {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.4), rgba(124, 45, 18, 0.6));
  border: 1px solid #f97316;
  color: #ffedd5;
}

.pb-badge.persistent {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(6, 78, 59, 0.6));
  border: 1px solid #34d399;
  color: #ecfdf5;
}

.ach-status.temp {
  color: #fb923c;
  font-style: italic;
}

/* Toast - Royal Sanctum Accolade Tablet */
.achievement-toast {
  position: fixed;
  top: -100px;
  right: 20px;
  background: linear-gradient(135deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 1.5px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.3);
  outline-offset: -3px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transition: top 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
  pointer-events: none;
}

.achievement-toast.show {
  top: 20px;
}

.toast-icon {
  font-size: 26px;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.5));
}

.toast-title {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-bright, #facc15);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.toast-desc {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13.5px;
  font-weight: 600;
  color: #f8fafc;
}

/* ========================================================
   ENHANCEMENT PLAN: WRAPPED CANDY, MODES & VISUALS
   ======================================================== */

/* Wrapped Candy Styling (L/T Pattern Explorer) */
.grid div.wrapped {
  box-shadow: inset 0 0 0 4px #ffffff, 0 0 12px rgba(255, 255, 255, 0.9) !important;
  position: relative;
}

.grid div.wrapped::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px dashed rgba(255, 255, 255, 0.95);
  border-radius: 4px;
  pointer-events: none;
}

.grid div.wrapped::after {
  content: "✦";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 14px;
  color: #facc15;
  filter: drop-shadow(0 0 4px #ffffff);
  pointer-events: none;
}

/* Freeze Tile Styling (Killer Versus Mode Sabotage) */
.grid div.frozen {
  filter: brightness(1.15) contrast(1.1);
  box-shadow: inset 0 0 14px #00e5ff, 0 0 8px #00b0ff !important;
  cursor: not-allowed !important;
}

.grid div.frozen::after {
  content: "❆";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #00e5ff;
  text-shadow: 0 0 10px #00e5ff, 0 0 20px #ffffff;
  background: rgba(0, 229, 255, 0.28);
  border-radius: 5px;
  pointer-events: none;
}

/* Audio Toggle Button */
.hud-top-bar .audio-toggle-btn {
  margin-top: 0;
}

/* Dynamic Scoreboard Panels */
.mode-panel {
  display: none;
  width: 100%;
  margin: 6px 0;
  flex-direction: column;
  align-items: center;
}

/* Versus Mode HUD */
.player-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.player-pill.p1 { background: #e74c3c; color: white; }
.player-pill.p2 { background: #3498db; color: white; }

.vs-scores {
  display: flex;
  justify-content: space-around;
  width: 100%;
  gap: 8px;
  margin: 6px 0;
}

.player-score-box {
  flex: 1;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s ease;
}

.player-score-box.active {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
  transform: scale(1.05);
}

.player-label {
  font-size: 11px;
  font-weight: bold;
  color: #94a3b8;
}

.player-val {
  font-size: 18px;
  font-weight: bold;
  color: #f8fafc;
}

/* Turns Display */
.turns-display {
  font-size: 14px;
  font-weight: bold;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 12px;
  margin: 4px 0;
}

/* Co-op Mode HUD */
.coop-objectives {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 0;
  width: 100%;
}

.obj-pill {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 14px;
  font-weight: bold;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.obj-pill.blue { color: #38bdf8; }
.obj-pill.green { color: #4ade80; }

.obj-pill.done {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
}

.synergy-banner {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  color: white;
  font-weight: bold;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  margin: 4px 0;
  box-shadow: 0 0 8px rgba(155, 89, 182, 0.7);
  animation: synergyPulse 0.4s ease-in-out;
}

@keyframes synergyPulse {
  0% { transform: scale(0.85); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Boss Campaign HUD (Full-Width Arena Header & Footer + VFX) */
.campaign-top-hud,
.campaign-bottom-hud {
  width: 590px;
  max-width: 96vw;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(10, 16, 32, 0.96), rgba(5, 8, 17, 0.98));
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.28);
  outline-offset: -4px;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.72), 0 0 18px rgba(56, 189, 248, 0.14);
}

.campaign-top-hud {
  padding: 7px 14px;
  gap: 4px;
}

.campaign-bottom-hud {
  padding: 4px;
}

.campaign-boss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.campaign-boss-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.boss-avatar {
  font-size: 22px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.98));
  border: 2px solid var(--gold-primary, #d4af37);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
  overflow: hidden;
  flex-shrink: 0;
}

.campaign-top-hud .boss-avatar .avatar-svg-glyph,
.campaign-top-hud .boss-avatar svg {
  width: 30px;
  height: 30px;
  max-width: 30px;
  max-height: 30px;
}

.boss-name-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}

.boss-name {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-bright, #facc15);
  text-transform: none;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boss-subtitle {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.campaign-boss-atk-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.hp-bar-container {
  width: 100%;
  height: 17px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  margin: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55);
}

.hp-bar-container.boss-hp {
  height: 15px;
  background: #1e293b;
}

.hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  width: 100%;
  transition: width 0.28s ease-out;
}

.hp-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Sopor 15-Second Attack Countdown Track */
.sopor-countdown-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sopor-countdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  line-height: 1.1;
}

.sopor-countdown-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #7dd3fc;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.sopor-countdown-timer {
  font-family: 'Montserrat', monospace;
  font-weight: 800;
  font-size: 11.5px;
  color: #e0f2fe;
  letter-spacing: 0.4px;
}

.sopor-countdown-timer.urgent {
  color: #fca5a5;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.75);
}

.sopor-countdown-track {
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.sopor-countdown-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: linear-gradient(90deg, #0284c7, #38bdf8, #bae6fd);
  transition: transform 0.1s linear;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
}

.sopor-countdown-fill.urgent {
  background: linear-gradient(90deg, #dc2626, #f97316, #fde047);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.85);
}

/* Campaign Bottom Player HUD & White-Gold Shield Aura */
.player-hp-aura-wrap {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  padding: 4px 8px 5px 8px;
  border: 1.5px solid transparent;
  transition: border-color 0.28s ease, box-shadow 0.28s ease, background 0.28s ease;
}

.player-hp-aura-wrap.barrier-active {
  border-color: #fef3c7;
  background: radial-gradient(circle at 50% 50%, rgba(254, 249, 195, 0.14), rgba(250, 204, 21, 0.05));
  box-shadow:
    0 0 16px rgba(254, 243, 199, 0.7),
    0 0 28px rgba(250, 204, 21, 0.45),
    inset 0 0 12px rgba(255, 255, 255, 0.35);
  animation: barrierAuraPulse 1.8s infinite ease-in-out;
}

@keyframes barrierAuraPulse {
  0%, 100% {
    box-shadow: 0 0 14px rgba(254, 243, 199, 0.6), 0 0 24px rgba(250, 204, 21, 0.38), inset 0 0 10px rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 255, 255, 0.85), 0 0 36px rgba(250, 204, 21, 0.65), inset 0 0 16px rgba(254, 243, 199, 0.5);
  }
}

.player-hp-aura-wrap.barrier-negate-flash {
  animation: barrierNegateFlash 0.65s ease-out;
}

@keyframes barrierNegateFlash {
  0% { box-shadow: 0 0 36px #ffffff, inset 0 0 24px #fef08a; background: rgba(255, 255, 255, 0.35); }
  100% { box-shadow: none; background: transparent; }
}

.player-hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.player-name-tag {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #e2e8f0;
  text-transform: uppercase;
}

.status-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.status-badge.shield {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(250, 204, 21, 0.28));
  color: #fef9c3;
  border: 1px solid #fef08a;
  box-shadow: 0 0 10px rgba(254, 240, 138, 0.55);
}

.hp-bar-container.player-hp {
  height: 14px;
  margin: 0;
  background: #0f172a;
}

.hp-bar-fill.player {
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.28s ease-out;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.55);
}

.hp-bar-container.player-hp.heal-flash {
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.95), inset 0 0 10px rgba(167, 243, 208, 0.6);
  border-color: #6ee7b7;
}

/* Boss & Player Hit Animations */
@keyframes bossHitShake {
  0% { transform: translateX(0) scale(1); }
  20% { transform: translateX(-5px) scale(0.985); filter: brightness(1.35); border-color: #f87171; }
  45% { transform: translateX(5px) scale(1.01); }
  70% { transform: translateX(-3px); }
  100% { transform: translateX(0) scale(1); filter: none; }
}

.campaign-top-hud.hit {
  animation: bossHitShake 0.4s ease-in-out;
}

@keyframes playerHitShake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); border-color: #ef4444; box-shadow: 0 0 22px rgba(239, 68, 68, 0.7); }
  55% { transform: translateX(6px); }
  80% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.campaign-bottom-hud.hit {
  animation: playerHitShake 0.42s ease-in-out;
}

@keyframes soporGridStrikeShake {
  0% { transform: translate(0, 0); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85); }
  25% { transform: translate(-4px, 3px); box-shadow: 0 0 32px rgba(56, 189, 248, 0.8), inset 0 0 28px rgba(56, 189, 248, 0.45); }
  55% { transform: translate(4px, -2px); }
  100% { transform: translate(0, 0); }
}

.grid.sopor-strike-shake {
  animation: soporGridStrikeShake 0.42s ease-out;
}

/* Green Healing Orb VFX Flying into Player HP */
.vfx-heal-orb {
  position: fixed;
  left: 50%;
  top: 44%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1450;
  transform: translate(-50%, -50%) scale(0.6);
  background: radial-gradient(circle at 35% 35%, #ecfdf5 0%, #6ee7b7 35%, #10b981 75%, rgba(5, 150, 105, 0.2) 100%);
  box-shadow: 0 0 18px #34d399, 0 0 34px rgba(16, 185, 129, 0.85), inset 0 0 8px #ffffff;
  animation: healOrbFlight 0.72s cubic-bezier(0.22, 0.82, 0.32, 1) forwards;
}

@keyframes healOrbFlight {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45);
  }
  20% {
    opacity: 1;
    transform: translate(calc(-50% + var(--heal-dx, 0px) * 0.18), calc(-50% + var(--heal-dy, 180px) * 0.12 - 18px)) scale(1.22);
  }
  78% {
    opacity: 1;
    transform: translate(calc(-50% + var(--heal-dx, 0px)), calc(-50% + var(--heal-dy, 220px))) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--heal-dx, 0px)), calc(-50% + var(--heal-dy, 220px))) scale(1.65);
  }
}

/* Solar Thaw Full-Board Melt Wave & Per-Tile Burst VFX */
.vfx-melt-wave {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  pointer-events: none;
  z-index: 58;
  background: radial-gradient(circle at center, rgba(254, 240, 138, 0.55) 0%, rgba(251, 146, 60, 0.42) 45%, rgba(239, 68, 68, 0.18) 80%, transparent 100%);
  animation: solarThawWave 0.62s ease-out forwards;
}

@keyframes solarThawWave {
  0% { opacity: 0; transform: scale(0.65); }
  35% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.06); }
}

.vfx-tile-melt {
  position: absolute;
  width: 66px;
  height: 66px;
  border-radius: 14px;
  pointer-events: none;
  z-index: 59;
  transform: translate(-50%, -50%) scale(0.4);
  background: radial-gradient(circle, #ffffff 0%, #fde047 38%, #fb923c 70%, transparent 100%);
  box-shadow: 0 0 18px rgba(251, 146, 60, 0.9);
  animation: tileMeltBurst 0.56s ease-out forwards;
}

@keyframes tileMeltBurst {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.45); }
  55% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
}

.grid div.melting {
  animation: gemThawPulse 0.5s ease-out;
}

@keyframes gemThawPulse {
  0% { filter: brightness(1.7) drop-shadow(0 0 10px #fb923c); transform: scale(1.08); }
  100% { filter: none; transform: scale(1); }
}

/* 200-Point Milestone 3-Card Choice Modal */
#campaignCardChoiceModal {
  z-index: 1300;
  background: rgba(3, 7, 18, 0.84);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.card-choice-modal-card {
  max-width: 780px;
  width: min(95vw, 780px);
  background: linear-gradient(180deg, rgba(13, 21, 42, 0.98) 0%, rgba(5, 9, 20, 0.99) 100%);
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -5px;
  border-radius: 20px;
  padding: 22px 24px 24px 24px;
  color: #f8fafc;
  box-sizing: border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 32px rgba(56, 189, 248, 0.22);
  text-align: center;
}

.card-choice-modal-card h2 {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  color: var(--gold-bright, #facc15);
  font-size: 22px;
  margin: 4px 0 8px 0;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
}

.card-choice-subrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.card-milestone-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.45);
  padding: 3px 12px;
  border-radius: 999px;
}

.card-queue-note {
  font-size: 11px;
  font-weight: 700;
  color: #fde047;
  background: rgba(250, 204, 21, 0.14);
  border: 1px solid rgba(250, 204, 21, 0.4);
  padding: 3px 10px;
  border-radius: 999px;
}

.card-choice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}

.choice-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 14px 14px 14px;
  border-radius: 16px;
  border: 1.8px solid rgba(212, 175, 55, 0.45);
  background: linear-gradient(180deg, rgba(22, 34, 62, 0.92) 0%, rgba(10, 16, 30, 0.98) 100%);
  color: #f8fafc;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.3, 1), border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

.choice-card-btn:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: var(--gold-bright, #facc15);
}

.choice-card-btn.melt-ice:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 22px rgba(251, 146, 60, 0.45);
}

.choice-card-btn.barrier:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 24px rgba(254, 243, 199, 0.55);
}

.choice-card-btn.heal:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 22px rgba(52, 211, 153, 0.48);
}

.choice-card-btn.zero-frozen {
  opacity: 0.76;
}

.choice-card-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.choice-card-tag.unique {
  color: #fed7aa;
  background: rgba(249, 115, 22, 0.24);
  border: 1px solid rgba(251, 146, 60, 0.55);
}

.choice-card-tag.defense {
  color: #fef9c3;
  background: rgba(254, 240, 138, 0.2);
  border: 1px solid rgba(254, 240, 138, 0.65);
}

.choice-card-tag.restore {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.24);
  border: 1px solid rgba(52, 211, 153, 0.55);
}

.choice-card-art {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.8), rgba(9, 14, 28, 0.95));
  border: 1px solid rgba(212, 175, 55, 0.25);
}

.card-choice-svg {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  display: block;
}

.choice-card-title {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  font-size: 14px;
  color: var(--gold-bright, #facc15);
  letter-spacing: 0.8px;
}

.choice-card-desc {
  margin: 0;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  flex: 1;
}

.choice-card-meta {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  padding: 3px 10px;
  border-radius: 8px;
}

/* Global Dialogue Overlay (Supports In-Arena & Campaign Map Chronicles) */
.arena-dialogue-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: fadeInDialogue 0.25s ease-out;
}

@keyframes fadeInDialogue {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.dialogue-box {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98), rgba(6, 10, 20, 0.99));
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 175, 55, 0.25);
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialogue-speaker-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dialogue-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.98));
  border: 2px solid var(--gold-primary, #d4af37);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  animation: avatarFloat 2.5s ease-in-out infinite alternate;
}

.dialogue-avatar svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes avatarFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.dialogue-speaker-info {
  display: flex;
  flex-direction: column;
}

.dialogue-speaker {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-bright, #facc15);
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.dialogue-role {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

.dialogue-text {
  font-size: 14px;
  line-height: 1.55;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 64px;
  display: flex;
  align-items: center;
  border-left: 3px solid #38bdf8;
}

.dialogue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialogue-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.dialogue-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

.dialogue-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
}

.dialogue-btn.primary {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.dialogue-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
}

/* Pause Modal */
.pause-modal-card {
  max-width: 380px;
  text-align: center;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -5px;
  border-radius: 20px;
  padding: 28px 24px;
  color: #f8fafc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.15);
}

.pause-modal-card h2 {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  color: var(--gold-bright, #facc15);
  margin-top: 4px;
  margin-bottom: 6px;
  font-size: 22px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

.pause-msg {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13px;
  color: #cbd5e1;
  margin: 6px 0 20px 0;
  line-height: 1.5;
}

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn.danger {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.action-btn.danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.5);
}

/* Guide / How To Play Modal */
.guide-modal-card {
  max-width: 580px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  text-align: left;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -5px;
  border-radius: 20px;
  padding: 24px;
  box-sizing: border-box;
  color: #f8fafc;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.15);
}

.guide-modal-card h2 {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  font-size: 18px;
  color: var(--gold-bright, #facc15);
  margin-top: 0;
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.guide-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 14px 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  padding-bottom: 8px;
}

.guide-body {
  overflow-y: auto;
  flex: 1;
  padding: 8px 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #cbd5e1;
}

.guide-section {
  margin-bottom: 18px;
}

.guide-section h3 {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-bright, #facc15);
  margin: 0 0 8px 0;
  text-transform: none;
  letter-spacing: 0.5px;
}

.guide-card,
.guide-card-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(15, 23, 42, 0.75);
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-left: 4px solid #38bdf8;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.guide-card:hover,
.guide-card-row:hover {
  background: rgba(22, 33, 60, 0.85);
  border-color: rgba(212, 175, 55, 0.4);
}

.guide-card.special,
.guide-card-row.special {
  border-left-color: #a855f7;
}

.guide-card.mode,
.guide-card-row.mode {
  border-left-color: var(--gold-primary, #d4af37);
}

.guide-card-icon {
  font-size: 24px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.3));
}

.guide-card-content h4,
.guide-card-content strong {
  display: block;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13.5px;
  color: #f8fafc;
  margin: 0 0 3px 0;
  letter-spacing: 0.3px;
}

.guide-card-content p {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}

/* ========================================================
   ELEMENTAL GEMS SKIN OVERLAY (SVG DATA URIS)
   ======================================================== */
.grid div[data-candy-color="red"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="rg1" cx="35%" cy="35%" r="65%"><stop offset="0%" stop-color="%23ff6b81"/><stop offset="60%" stop-color="%23e11d48"/><stop offset="100%" stop-color="%23881337"/></radialGradient></defs><polygon points="50,6 88,28 88,72 50,94 12,72 12,28" fill="url(%23rg1)"/><polygon points="50,6 88,28 68,36 50,22" fill="%23fda4af" opacity="0.6"/><polygon points="50,6 12,28 32,36 50,22" fill="%23ffffff" opacity="0.75"/><polygon points="12,28 12,72 32,64 32,36" fill="%23be123c" opacity="0.5"/><polygon points="88,28 88,72 68,64 68,36" fill="%239f1239" opacity="0.6"/><polygon points="50,94 88,72 68,64 50,78" fill="%234c0519" opacity="0.8"/><polygon points="50,94 12,72 32,64 50,78" fill="%23881337" opacity="0.7"/><polygon points="50,22 68,36 68,64 50,78 32,64 32,36" fill="%23f43f5e"/><polygon points="50,22 68,36 50,42" fill="%23ffffff" opacity="0.5"/><circle cx="38" cy="34" r="3.5" fill="%23ffffff" opacity="0.85"/></svg>') !important;
}

.grid div[data-candy-color="blue"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="bg1" cx="35%" cy="35%" r="65%"><stop offset="0%" stop-color="%2338bdf8"/><stop offset="60%" stop-color="%230284c7"/><stop offset="100%" stop-color="%230c4a6e"/></radialGradient></defs><polygon points="30,8 70,8 92,30 92,70 70,92 30,92 8,70 8,30" fill="url(%23bg1)"/><polygon points="30,8 70,8 64,24 36,24" fill="%23ffffff" opacity="0.8"/><polygon points="70,8 92,30 76,36 64,24" fill="%23bae6fd" opacity="0.6"/><polygon points="30,8 8,30 24,36 36,24" fill="%23ffffff" opacity="0.7"/><polygon points="92,30 92,70 76,64 76,36" fill="%230369a1" opacity="0.5"/><polygon points="8,30 8,70 24,64 24,36" fill="%23075985" opacity="0.6"/><polygon points="92,70 70,92 64,76 76,64" fill="%230c4a6e" opacity="0.7"/><polygon points="8,70 30,92 36,76 24,64" fill="%23082f49" opacity="0.8"/><polygon points="30,92 70,92 64,76 36,76" fill="%230f172a" opacity="0.75"/><polygon points="36,24 64,24 76,36 76,64 64,76 36,76 24,64 24,36" fill="%230284c7"/><polygon points="36,24 64,24 50,38" fill="%23ffffff" opacity="0.45"/><circle cx="34" cy="32" r="3.5" fill="%23ffffff" opacity="0.9"/></svg>') !important;
}

.grid div[data-candy-color="green"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="gg1" cx="35%" cy="35%" r="65%"><stop offset="0%" stop-color="%2334d399"/><stop offset="60%" stop-color="%23059669"/><stop offset="100%" stop-color="%23064e3b"/></radialGradient></defs><polygon points="26,10 74,10 90,26 90,74 74,90 26,90 10,74 10,26" fill="url(%23gg1)"/><polygon points="26,10 74,10 66,24 34,24" fill="%23ffffff" opacity="0.75"/><polygon points="74,10 90,26 76,34 66,24" fill="%23a7f3d0" opacity="0.6"/><polygon points="26,10 10,26 24,34 34,24" fill="%23ffffff" opacity="0.65"/><polygon points="90,26 90,74 76,66 76,34" fill="%23047857" opacity="0.5"/><polygon points="10,26 10,74 24,66 24,34" fill="%23065f46" opacity="0.6"/><polygon points="90,74 74,90 66,76 76,66" fill="%23064e3b" opacity="0.75"/><polygon points="10,74 26,90 34,76 24,66" fill="%23022c22" opacity="0.8"/><polygon points="26,90 74,90 66,76 34,76" fill="%23064e3b" opacity="0.7"/><polygon points="34,24 66,24 76,34 76,66 66,76 34,76 24,66 24,34" fill="%2310b981"/><polygon points="34,24 66,24 50,36" fill="%23ffffff" opacity="0.45"/><circle cx="32" cy="30" r="3.5" fill="%23ffffff" opacity="0.85"/></svg>') !important;
}

.grid div[data-candy-color="yellow"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="yg1" cx="35%" cy="35%" r="65%"><stop offset="0%" stop-color="%23fef08a"/><stop offset="55%" stop-color="%23eab308"/><stop offset="100%" stop-color="%23713f12"/></radialGradient></defs><polygon points="50,6 94,50 50,94 6,50" fill="url(%23yg1)"/><polygon points="50,6 94,50 68,50 50,26" fill="%23fef08a" opacity="0.7"/><polygon points="50,6 6,50 32,50 50,26" fill="%23ffffff" opacity="0.85"/><polygon points="6,50 50,94 50,74 32,50" fill="%23a16207" opacity="0.6"/><polygon points="94,50 50,94 50,74 68,50" fill="%23713f12" opacity="0.75"/><polygon points="50,26 68,50 50,74 32,50" fill="%23facc15"/><polygon points="50,26 68,50 50,42" fill="%23ffffff" opacity="0.5"/><circle cx="42" cy="38" r="3.5" fill="%23ffffff" opacity="0.9"/></svg>') !important;
}

.grid div[data-candy-color="orange"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="og1" cx="35%" cy="35%" r="65%"><stop offset="0%" stop-color="%23fed7aa"/><stop offset="60%" stop-color="%23ea580c"/><stop offset="100%" stop-color="%237c2d12"/></radialGradient></defs><polygon points="50,8 86,18 94,54 70,88 30,88 6,54 14,18" fill="url(%23og1)"/><polygon points="50,8 86,18 72,30 50,22" fill="%23fed7aa" opacity="0.6"/><polygon points="50,8 14,18 28,30 50,22" fill="%23ffffff" opacity="0.8"/><polygon points="86,18 94,54 76,52 72,30" fill="%23c2410c" opacity="0.5"/><polygon points="14,18 6,54 24,52 28,30" fill="%239a3412" opacity="0.6"/><polygon points="94,54 70,88 58,74 76,52" fill="%237c2d12" opacity="0.7"/><polygon points="6,54 30,88 42,74 24,52" fill="%23431407" opacity="0.8"/><polygon points="70,88 30,88 42,74 58,74" fill="%23270b04" opacity="0.75"/><polygon points="50,22 72,30 76,52 58,74 42,74 24,52 28,30" fill="%23f97316"/><polygon points="50,22 72,30 50,40" fill="%23ffffff" opacity="0.45"/><circle cx="36" cy="34" r="3.5" fill="%23ffffff" opacity="0.85"/></svg>') !important;
}

.grid div[data-candy-color="purple"] {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><radialGradient id="pg1" cx="35%" cy="35%" r="65%"><stop offset="0%" stop-color="%23d8b4fe"/><stop offset="60%" stop-color="%239333ea"/><stop offset="100%" stop-color="%233b0764"/></radialGradient></defs><polygon points="50,8 88,26 88,74 50,92 12,74 12,26" fill="url(%23pg1)"/><polygon points="50,8 88,26 70,34 50,20" fill="%23e9d5ff" opacity="0.6"/><polygon points="50,8 12,26 30,34 50,20" fill="%23ffffff" opacity="0.75"/><polygon points="88,26 88,74 70,66 70,34" fill="%237e22ce" opacity="0.5"/><polygon points="12,26 12,74 30,66 30,34" fill="%236b21a8" opacity="0.6"/><polygon points="88,74 50,92 50,78 70,66" fill="%23581c87" opacity="0.75"/><polygon points="12,74 50,92 50,78 30,66" fill="%233b0764" opacity="0.8"/><polygon points="50,20 70,34 70,66 50,78 30,66 30,34" fill="%23a855f7"/><polygon points="50,20 70,34 50,40" fill="%23ffffff" opacity="0.5"/><circle cx="36" cy="32" r="3.5" fill="%23ffffff" opacity="0.85"/></svg>') !important;
}

/* ========================================================
   VERSUS DUEL SETUP MODAL & AI DIFFICULTY SELECTION
   ======================================================== */
.versus-setup-card {
  max-width: 520px;
  width: 92%;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -5px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.15);
  border-radius: 20px;
  padding: 24px 28px;
  color: #f8fafc;
  box-sizing: border-box;
}

.versus-setup-card h2 {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  color: var(--gold-bright, #facc15);
  margin-top: 4px;
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.vs-setup-subtitle {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 18px 0;
}

.vs-setup-section {
  text-align: left;
  margin-bottom: 18px;
}

.vs-section-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #38bdf8;
  font-weight: 700;
  margin-bottom: 8px;
}

.vs-type-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vs-mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.75);
  border: 1.5px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.vs-mode-btn:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.vs-mode-btn.active {
  background: rgba(14, 165, 233, 0.18);
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.vs-btn-icon {
  font-size: 24px;
  line-height: 1;
}

.vs-btn-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vs-btn-content strong {
  font-size: 13px;
  color: #f8fafc;
}

.vs-btn-content small {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.vs-check {
  font-size: 14px;
  color: transparent;
  font-weight: bold;
  transition: color 0.2s;
}

.vs-mode-btn.active .vs-check {
  color: #38bdf8;
}

.difficulty-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.difficulty-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.65);
  border: 1.5px solid rgba(148, 163, 184, 0.15);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: #cbd5e1;
}

.difficulty-btn:hover {
  background: rgba(51, 65, 85, 0.75);
  border-color: rgba(148, 163, 184, 0.35);
}

.diff-badge {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  width: 72px;
  text-align: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.diff-badge.easy {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.diff-badge.normal {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.diff-badge.hard {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.diff-badge.extreme {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.diff-badge.impossible {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.difficulty-btn[data-difficulty="easy"].active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.difficulty-btn[data-difficulty="normal"].active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.difficulty-btn[data-difficulty="hard"].active {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.15);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.difficulty-btn[data-difficulty="extreme"].active {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.18);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.35);
}

.difficulty-btn[data-difficulty="impossible"].active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.22);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.55);
  animation: pulseOverlordGlow 2s infinite alternate;
}

@keyframes pulseOverlordGlow {
  0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.4); }
  100% { box-shadow: 0 0 22px rgba(239, 68, 68, 0.8), inset 0 0 8px rgba(239, 68, 68, 0.3); }
}

.diff-info {
  display: flex;
  flex-direction: column;
}

.diff-info strong {
  font-size: 12.5px;
  color: #f1f5f9;
}

.diff-info small {
  font-size: 11px;
  color: #94a3b8;
}

.vs-setup-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ========================================================
   QUALITY OF LIFE: MODE TUTORIAL & CONFIRM QUIT MODALS
   ======================================================== */
.tutorial-modal-card {
  max-width: 520px;
  width: 92%;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -5px;
  border-radius: 20px;
  padding: 24px 28px;
  color: #f8fafc;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.15);
}

.tutorial-modal-card h2 {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  color: var(--gold-bright, #facc15);
  margin-top: 4px;
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.tutorial-subtitle {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 18px 0;
}

.tutorial-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  text-align: left;
}

.tutorial-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  transition: background 0.2s, border-color 0.2s;
}

.tutorial-card:hover {
  background: rgba(22, 33, 60, 0.85);
  border-color: rgba(212, 175, 55, 0.4);
}

.tut-card-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.3));
}

.tut-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tut-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gold-bright, #facc15);
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  letter-spacing: 0.5px;
}

.tut-card-desc {
  font-size: 11.5px;
  color: #cbd5e1;
  margin-top: 3px;
  line-height: 1.45;
}

.tutorial-checkbox-container {
  display: flex;
  justify-content: center;
  margin: 14px 0 16px 0;
}

.tutorial-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.tutorial-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.tutorial-actions {
  display: flex;
  justify-content: center;
}

.tutorial-actions .action-btn {
  min-width: 180px;
  padding: 11px 24px;
  font-size: 14px;
}

/* Confirm Quit Modal */
.confirm-quit-card {
  max-width: 430px;
  width: 90%;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 2px solid rgba(239, 68, 68, 0.5);
  outline: 1px solid rgba(239, 68, 68, 0.25);
  outline-offset: -5px;
  border-radius: 20px;
  padding: 24px 26px;
  color: #f8fafc;
  box-sizing: border-box;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(239, 68, 68, 0.2);
  text-align: center;
}

.modal-badge.warning {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.confirm-quit-card h2 {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  color: #f87171;
  margin-top: 6px;
  margin-bottom: 8px;
  font-size: 20px;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

.confirm-quit-msg {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 10px 0 20px 0;
}

.confirm-quit-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ========================================================
   CO-OP HARMONY SETUP MODAL & DUAL-ELEMENTAL FLASK HUD
   ======================================================== */
.coop-setup-card {
  max-width: 500px;
  width: 92%;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -5px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.15);
  border-radius: 20px;
  padding: 24px 28px;
  color: #f8fafc;
  box-sizing: border-box;
}

.coop-setup-card h2 {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  color: var(--gold-bright, #facc15);
  margin-top: 4px;
  margin-bottom: 6px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.coop-setup-subtitle {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 18px 0;
}

.coop-setup-section {
  text-align: left;
  margin-bottom: 18px;
}

.coop-section-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #4ade80;
  font-weight: 700;
  margin-bottom: 8px;
}

.coop-type-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.coop-setup-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

/* Companion Speech Bubble */
.companion-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  padding: 8px 10px;
  color: #e2e8f0;
  font-size: 11.5px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  animation: floatBubble 3s ease-in-out infinite;
}

@keyframes floatBubble {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.companion-avatar {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.companion-speech {
  line-height: 1.35;
  color: #cbd5e1;
  font-style: italic;
}

/* Co-op Role Badge */
.coop-role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  margin: 4px 0 8px 0;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.coop-role-badge.water-role {
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.coop-role-badge.nature-role {
  background: rgba(5, 150, 105, 0.25);
  border: 1px solid rgba(74, 222, 128, 0.5);
  color: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

/* Elixir Flask Progress Bars */
.elixir-flask-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 6px 0;
}

.flask-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.flask-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: #cbd5e1;
  padding: 0 2px;
}

.flask-icon {
  font-size: 13px;
  margin-right: 4px;
}

.flask-label {
  flex: 1;
  text-align: left;
}

.flask-count {
  font-weight: 700;
  font-family: monospace;
  font-size: 11.5px;
  color: #f1f5f9;
}

.flask-bar-track {
  width: 100%;
  height: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.flask-fill {
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 5px;
}

.flask-fill.blue {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.flask-fill.green {
  background: linear-gradient(90deg, #059669, #4ade80);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

/* ========================================================
   AUDIO & GAME SETTINGS MODAL & ARCANE SLIDERS
   ======================================================== */
.settings-modal-card {
  max-width: 460px;
  width: 92%;
  background: linear-gradient(180deg, rgba(14, 21, 40, 0.98) 0%, rgba(6, 10, 20, 0.99) 100%);
  border: 2px solid var(--gold-primary, #d4af37);
  outline: 1px solid rgba(212, 175, 55, 0.35);
  outline-offset: -5px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(212, 175, 55, 0.15);
  border-radius: 20px;
  padding: 26px;
  color: #f8fafc;
  box-sizing: border-box;
  text-align: center;
}

.settings-modal-card h2 {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  color: var(--gold-bright, #facc15);
  margin-top: 4px;
  margin-bottom: 6px;
  font-size: 24px;
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.settings-subtitle {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 22px 0;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 22px;
  text-align: left;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
}

.setting-group label span,
.setting-val-display {
  font-weight: 700;
  color: #38bdf8;
  font-size: 15px;
}

/* Arcane Slider Styling */
.arcane-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
  margin: 6px 0;
}

.arcane-slider:hover {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.arcane-slider::-webkit-slider-runnable-track {
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.arcane-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  cursor: pointer;
  margin-top: -5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.arcane-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}

.arcane-slider::-moz-range-track {
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.arcane-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.arcane-slider::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.9);
}

.qol-section {
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  padding-top: 18px;
  margin-bottom: 24px;
}

.settings-notice {
  font-size: 12px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  text-align: center;
}

.settings-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ========================================================
   RESPONSIVE DESIGN & MOBILE COMPACT ADAPTATIONS
   ======================================================== */
@media (max-width: 900px) {
  .mode-button-group {
    gap: 8px;
  }
  .medallion-btn {
    padding: 10px 6px;
    gap: 6px;
  }
  .mode-icon-crest {
    width: 36px;
    height: 36px;
  }
  .mode-icon-crest .mode-svg {
    width: 32px;
    height: 32px;
  }
  .mode-title-text {
    font-size: 11px;
    letter-spacing: 1px;
  }
}

@media (max-width: 680px) {
  #modeSelection {
    padding: 10px;
  }
  .mode-selection-card {
    padding: 16px 14px;
    width: 96vw;
    max-height: 96vh;
  }
  .title-line-main {
    font-size: 18px;
    letter-spacing: 3px;
  }
  .title-line-sub {
    font-size: 22px;
    letter-spacing: 6px;
  }
  .astrolabe-rune-backdrop {
    width: 130px;
    height: 130px;
  }
  .mode-button-group {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
  .medallion-btn {
    padding: 8px 4px;
  }
  .mode-title-text {
    font-size: 9.5px;
    letter-spacing: 0.5px;
  }
  .dock-medallion-btn {
    width: 40px;
    height: 40px;
  }
  .dock-medallion-btn svg {
    width: 20px;
    height: 20px;
  }
  body.mode-campaign .game-container {
    flex-direction: column;
    justify-content: flex-start;
    padding: 8px 8px;
    gap: 8px;
    overflow-y: auto;
  }
  body.mode-campaign .scoreBoard {
    width: min(94vw, 354px);
    min-width: 0;
    max-width: 94vw;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
  }
  body.mode-campaign .scoreBoard .hud-top-bar {
    width: auto;
    margin-bottom: 0;
  }
  body.mode-campaign #standardScoreHeader {
    flex-direction: row;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 0;
  }
  body.mode-campaign #score {
    font-size: 28px;
  }
  body.mode-campaign .arena-center-stage {
    zoom: 0.60;
  }
  body.mode-campaign .campaign-top-hud,
  body.mode-campaign .campaign-bottom-hud {
    width: 590px;
    max-width: none;
  }
  .card-choice-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .card-choice-modal-card {
    max-height: 92vh;
    overflow-y: auto;
    padding: 16px 14px;
  }
}

@media (min-width: 681px) and (max-height: 780px) {
  body.mode-campaign .arena-center-stage {
    zoom: 0.94;
  }
}

@media (min-width: 681px) and (max-height: 740px) {
  body.mode-campaign .arena-center-stage {
    zoom: 0.88;
  }
}

@media (min-width: 681px) and (max-height: 660px) {
  body.mode-campaign .arena-center-stage {
    zoom: 0.76;
  }
}

@media (max-height: 640px) {
  .game-container {
    padding: 6px 14px;
    gap: 16px;
  }
  .scoreBoard {
    max-height: 96vh;
    padding: 10px 12px;
  }
  .mode-selection-card {
    padding: 14px 20px 12px 20px;
    max-height: 96vh;
  }
  .title-monument-container {
    margin-bottom: 4px;
  }
  .mode-button-group {
    margin: 8px 0;
  }
  .medallion-btn {
    padding: 8px 6px;
    gap: 6px;
  }
}

/* ============================================================
   ARCANE SVG VECTOR GLYPH SYSTEM & STRICT MODAL SVG CONSTRAINTS
   ============================================================ */

/* Universal Modal SVG Boundaries - Prevents any unconstrained SVG explosion */
.modal-overlay svg {
  max-width: 100%;
  box-sizing: border-box;
}

.modal-content svg:not(.avatar-svg-glyph):not(.dialogue-avatar svg):not(.card-choice-svg) {
  max-width: 32px;
  max-height: 32px;
  box-sizing: border-box;
}

/* Guard: Preserve stroke-based SVGs with explicit fill="none" */
svg[fill="none"] {
  fill: none !important;
}

/* Modal Headers: h2, h3, coop-modal-header, titles */
.modal-content h2 svg,
.modal-content h3 svg,
.modal-title-svg,
.coop-modal-header svg,
#endModalTitle svg,
#tutorialTitle svg {
  display: inline-block;
  width: 22px;
  height: 22px;
  max-width: 24px;
  max-height: 24px;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}

.modal-title-svg {
  fill: var(--gold-bright, #facc15);
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.5));
}

.modal-title-svg[fill="none"] {
  fill: none !important;
}

/* Modal Badges & Status Badges */
.modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.modal-badge.warning {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.modal-badge svg,
.status-badge svg,
.badge-svg-glyph,
.pb-badge svg {
  display: inline-block;
  width: 14px;
  height: 14px;
  max-width: 16px;
  max-height: 16px;
  vertical-align: middle;
  flex-shrink: 0;
}

.modal-badge svg {
  margin-right: 0;
}

.status-badge svg,
.badge-svg-glyph,
.pb-badge svg {
  margin-right: 5px;
}

.campaign-boss-atk-pill .badge-svg-glyph,
.sopor-countdown-label .badge-svg-glyph,
.status-badge.shield .badge-svg-glyph {
  margin-right: 0;
}

.badge-svg-glyph:not([fill="none"]),
.modal-badge svg:not([fill="none"]),
.status-badge svg:not([fill="none"]),
.pb-badge svg:not([fill="none"]) {
  fill: currentColor;
}

/* Buttons: Action Buttons, Dialogue Buttons, and Control Icon Buttons */
.action-btn svg,
.dialogue-btn svg,
.modal-close-btn svg,
.btn-svg-glyph {
  display: inline-block;
  width: 16px;
  height: 16px;
  max-width: 18px;
  max-height: 18px;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

/* When button icon follows label text */
.action-btn svg:not(:first-child),
.dialogue-btn svg:not(:first-child) {
  margin-left: 6px;
  margin-right: 0;
}

.action-btn svg:not([fill="none"]),
.dialogue-btn svg:not([fill="none"]),
.modal-close-btn svg:not([fill="none"]),
.btn-svg-glyph:not([fill="none"]) {
  fill: currentColor;
}

.action-btn:hover .btn-svg-glyph,
.action-btn:hover svg,
.dialogue-btn:hover .btn-svg-glyph,
.dialogue-btn:hover svg {
  transform: scale(1.15);
}

.control-icon-btn svg,
.control-svg-glyph {
  display: block;
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  margin: auto;
  flex-shrink: 0;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.control-icon-btn svg:not([fill="none"]),
.control-svg-glyph:not([fill="none"]) {
  fill: currentColor;
}

.control-icon-btn:hover svg,
.control-icon-btn:hover .control-svg-glyph {
  transform: scale(1.18);
  filter: drop-shadow(0 0 6px var(--gold-bright, #facc15));
}

/* Guide Cards & Tutorial Card Icons */
.guide-card-icon svg,
.tutorial-card-icon svg,
.tut-card-icon svg,
.guide-svg-glyph,
.tut-svg-glyph {
  width: 28px;
  height: 28px;
  max-width: 32px;
  max-height: 32px;
  display: block;
  margin: auto;
  flex-shrink: 0;
  vertical-align: middle;
}

.tut-card-icon,
.tutorial-card-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.3));
}

/* Versus and Co-op Format Setup Buttons */
.vs-btn-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vs-btn-icon svg {
  width: 20px;
  height: 20px;
  max-width: 22px;
  max-height: 22px;
  display: block;
  margin: auto;
  flex-shrink: 0;
}

.vs-btn-icon svg:not([fill="none"]) {
  fill: currentColor;
}

/* Catalyst & Specialty Glyphs */
.catalyst-svg-glyph {
  display: inline-block;
  width: 15px;
  height: 15px;
  vertical-align: middle;
  margin: 0 2px;
  flex-shrink: 0;
}

.inline-crest-glyph {
  display: inline-block;
  width: 22px;
  height: 22px;
  vertical-align: middle;
  fill: currentColor;
  flex-shrink: 0;
}

.avatar-svg-glyph {
  display: block;
  width: 36px;
  height: 36px;
  margin: auto;
  fill: currentColor;
  filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.6));
  flex-shrink: 0;
}

.achievement-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.achievement-icon svg,
.ach-svg-glyph {
  width: 22px;
  height: 22px;
  max-width: 24px;
  max-height: 24px;
  display: block;
  margin: auto;
  flex-shrink: 0;
}

.toast-icon svg {
  width: 24px;
  height: 24px;
  max-width: 26px;
  max-height: 26px;
  display: block;
  margin: auto;
  flex-shrink: 0;
}

.ach-status svg,
.ach-status .badge-svg-glyph,
.ach-status .btn-svg-glyph {
  width: 13px;
  height: 13px;
  vertical-align: middle;
  margin-right: 3px;
  display: inline-block;
  flex-shrink: 0;
}

/* Semantic Vector Glyph Selectors */
.svg-stasis-pillars,
.svg-play-rune,
.svg-grimoire-tome,
.svg-portal-archway,
.svg-warning-rune,
.svg-purge-censer,
.svg-sound-resonator,
.svg-matrix-gem,
.svg-astrolabe-dial,
.svg-laurel-trophy,
.svg-erdtree-medallion,
.svg-ward-lock,
.svg-catalyst-water,
.svg-catalyst-nature,
.svg-catalyst-solar,
.svg-lyra-crest,
.svg-apprentice-crest,
.svg-aegis-shield,
.svg-phoenix-feather,
.svg-crossed-blades,
.svg-cyclic-rebirth,
.svg-magic-scroll,
.svg-fast-forward,
.svg-chevron-forward {
  vertical-align: middle;
  pointer-events: none;
}

/* ========================================================
   THE GRAND PRISMHALL ACADEMY - CAMPAIGN MAP SCREEN
   ======================================================== */
.campaign-map-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at center, #1C150E 0%, #140E0A 55%, #0B0705 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  box-sizing: border-box;
  padding: 12px 18px 10px 18px;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.campaign-map-screen.active,
.campaign-map-screen[style*="display: flex"] {
  opacity: 1;
  pointer-events: auto;
}

.campaign-map-backdrop {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(212, 175, 55, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 50% 85%, rgba(140, 109, 70, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Polished Header */
.campaign-map-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 8px auto;
  padding: 4px 10px;
  box-sizing: border-box;
  z-index: 5;
  flex-shrink: 0;
}

.map-header-left {
  display: flex;
  align-items: center;
  min-width: 220px;
}

.campaign-return-btn {
  width: auto !important;
  margin-top: 0 !important;
  padding: 8px 18px !important;
  font-size: 11px !important;
  letter-spacing: 1.5px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.25) !important;
}

.campaign-return-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 0 18px rgba(250, 204, 21, 0.45) !important;
}

.map-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.campaign-map-prefix {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: var(--gold-muted, #c5a059);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.campaign-map-title {
  margin: 0;
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #f8fafc;
  background: linear-gradient(180deg, #ffffff 0%, #fde047 50%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.35));
}

.map-header-center .elden-title-divider {
  width: min(380px, 90%);
  margin-top: 4px;
}

.map-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 220px;
}

/* Elden Ring-Style Map Layer Switcher */
.elden-layer-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(22, 17, 12, 0.95);
  border: 1.5px solid #D4AF37;
  border-radius: 6px;
  padding: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.8);
  gap: 3px;
  margin-right: 12px;
}

.layer-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  outline: none;
  color: #D8C398;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.layer-switch-btn:hover {
  color: #FAF5E8;
  background: rgba(212, 175, 55, 0.15);
}

.layer-switch-btn.active {
  color: #1E160E !important;
  font-weight: 800;
  background: linear-gradient(180deg, #FDE047 0%, #D4AF37 100%);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

.layer-switch-icon {
  font-size: 8px;
}

.elden-corner-layer-btn {
  position: absolute;
  top: 14px;
  left: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(22, 17, 12, 0.92);
  border: 1.5px solid #D4AF37;
  color: #FDE047;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.elden-corner-layer-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85), 0 0 10px rgba(212, 175, 55, 0.45);
}

.map-status-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(22, 17, 12, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 0 8px rgba(212, 175, 55, 0.15);
}

.map-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D4AF37;
  box-shadow: 0 0 8px #FACC15, 0 0 14px #854D0E;
  animation: mapStatusBlink 2.2s infinite ease-in-out;
}

@keyframes mapStatusBlink {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.map-status-info {
  display: flex;
  flex-direction: column;
}

.map-status-label {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #D4AF37;
  text-transform: uppercase;
}

.map-status-sub {
  font-size: 8.5px;
  color: #D8C398;
  letter-spacing: 0.8px;
}

/* Map Container & Viewport Frame */
.campaign-map-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 0;
  box-sizing: border-box;
  z-index: 2;
}

.map-viewport-frame {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #F5EEDB;
  border: 2px solid #8C6D46;
  outline: 1px solid rgba(140, 109, 70, 0.4);
  outline-offset: -5px;
  border-radius: 12px;
  box-shadow: 
    0 16px 45px rgba(0, 0, 0, 0.75),
    0 0 35px rgba(140, 109, 70, 0.2),
    inset 0 0 40px rgba(140, 109, 70, 0.25);
  overflow: hidden;
  box-sizing: border-box;
}

.map-viewport-frame .card-filigree {
  display: block !important;
  position: absolute;
  font-size: 16px;
  color: var(--gold-bright, #facc15);
  pointer-events: none;
  z-index: 15;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
}
.map-viewport-frame .card-filigree.top-left { top: 8px; left: 10px; }
.map-viewport-frame .card-filigree.top-right { top: 8px; right: 10px; }
.map-viewport-frame .card-filigree.bottom-left { bottom: 8px; left: 10px; }
.map-viewport-frame .card-filigree.bottom-right { bottom: 8px; right: 10px; }

.campaign-map-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.campaign-map-viewport.is-stationary {
  cursor: default;
}

.campaign-map-viewport.can-drag {
  cursor: grab;
}

.campaign-map-viewport.is-dragging {
  cursor: grabbing !important;
}

.campaign-map-viewport.is-dragging * {
  cursor: grabbing !important;
}

.campaign-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
}

.campaign-map-svg > rect,
.campaign-map-transform-group > rect,
.academy-map-seal {
  pointer-events: none !important;
}

.campaign-map-nodes,
.map-node {
  pointer-events: auto !important;
}

.campaign-map-transform-group {
  transform-origin: 0 0;
}

/* Map HUD Overlays */
.map-hud-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.elevation-gauge {
  display: none !important;
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 18px;
  width: 110px;
  flex-direction: column;
}

.elevation-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.6) 0%, rgba(212, 175, 55, 0.6) 50%, rgba(147, 51, 234, 0.6) 100%);
}

.elevation-step {
  position: absolute;
  left: 8px;
  display: flex;
  flex-direction: column;
  transform: translateY(-50%);
}

.elevation-step span {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold-bright, #facc15);
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.9);
}

.elevation-step small {
  font-size: 7.5px;
  letter-spacing: 0.8px;
  color: #94a3b8;
  text-transform: uppercase;
}

.astrolabe-compass {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8));
}

/* Footer / Legend Bar (Hidden per user revision) */
.campaign-map-footer {
  display: none !important;
  position: relative;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  background: rgba(6, 10, 22, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-top: none;
  border-radius: 0 0 10px 10px;
  box-sizing: border-box;
  flex-shrink: 0;
  z-index: 5;
}

.map-sector-tag {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sector-roman {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 9px;
  font-weight: 800;
  color: var(--gold-primary, #d4af37);
  letter-spacing: 1px;
}

.sector-name {
  font-size: 9px;
  color: #e2e8f0;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.map-footer-separator {
  color: rgba(212, 175, 55, 0.4);
  font-size: 8px;
}

.map-footer-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: #94a3b8;
  font-style: italic;
  margin-left: auto;
}

.hint-pulse {
  color: #38bdf8;
  font-size: 10px;
  animation: hintGlow 2s infinite ease-in-out;
}

@keyframes hintGlow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; text-shadow: 0 0 8px #38bdf8; }
}

/* Interactive SVG Layer Styling */
.map-astrolabe-rotating {
  transform-origin: 0px 0px;
  animation: astrolabeSpin 80s linear infinite;
}

.map-astrolabe-counter {
  transform-origin: 0px 0px;
  animation: astrolabeSpinCounter 55s linear infinite;
}

@keyframes astrolabeSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes astrolabeSpinCounter {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.starlight-pulse {
  animation: starlightBeamGlow 3.5s ease-in-out infinite;
}

@keyframes starlightBeamGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.95; filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.8)); }
}

.prism-core-pulse {
  animation: prismCoreFlicker 4s ease-in-out infinite;
}

@keyframes prismCoreFlicker {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.9)); }
}

/* Dynamic Map Nodes */
.campaign-map-node-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.campaign-map-node-overlay > * {
  pointer-events: auto;
}

/* Campaign Map Zoom Navigation HUD */
.campaign-map-zoom-controls {
  position: absolute;
  bottom: 16px;
  right: 18px;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(22, 17, 12, 0.92);
  border: 1.5px solid #D4AF37;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), inset 0 0 8px rgba(212, 175, 55, 0.15);
  overflow: hidden;
  user-select: none;
}

.map-zoom-btn {
  background: transparent;
  border: none;
  color: #FDE047;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 14px;
  font-weight: 700;
  width: 38px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, text-shadow 0.15s ease;
  padding: 0;
  outline: none;
}

.map-zoom-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  color: #FFFFFF;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
}

.map-zoom-btn:active {
  background: rgba(212, 175, 55, 0.35);
}

.map-zoom-btn.map-zoom-reset {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  color: #FAF5E8;
  width: 44px;
}

.map-zoom-btn.disabled,
.map-zoom-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Map Layers Transition */
.map-layer {
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s ease;
}

.map-layer.active {
  opacity: 1 !important;
  pointer-events: all;
}

.map-layer.hidden {
  opacity: 0 !important;
  pointer-events: none;
}

/* Interactive Spiral Stair / Trapdoor Triggers */
.interactive-stair-trigger {
  cursor: pointer;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.interactive-stair-trigger:hover,
.interactive-stair-trigger:focus-visible {
  transform: scale(1.06);
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.85));
}

.stair-pulse {
  transform-origin: 0 0;
  animation: stairPulseAnim 2.5s infinite ease-out;
  pointer-events: none;
}

@keyframes stairPulseAnim {
  0% { opacity: 0.8; transform: scale(0.95); }
  50% { opacity: 0.25; transform: scale(1.15); }
  100% { opacity: 0.8; transform: scale(0.95); }
}

.map-node {
  cursor: pointer;
  transition: filter 0.2s ease;
  outline: none;
}

.map-node:hover,
.map-node:focus-visible {
  filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.95)) brightness(1.2);
}

.map-node circle,
.map-node polygon {
  transition: stroke 0.2s ease, fill 0.2s ease;
}

.map-node.locked {
  opacity: 0.55;
  filter: grayscale(0.5);
}

.map-node.locked:hover {
  filter: drop-shadow(0 0 8px rgba(148, 163, 184, 0.6)) brightness(1.1);
}

.map-node.cleared circle,
.map-node.cleared polygon {
  stroke: #facc15 !important;
}

.map-node.layer-hidden {
  display: none !important;
}

.node-radar-pulse {
  transform-origin: 0 0;
  animation: nodeRadarPulse 2.4s infinite ease-out;
  pointer-events: none;
}

@keyframes nodeRadarPulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  70% { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

.map-connection-path {
  stroke-dasharray: 6 4;
  animation: pathDashScroll 20s linear infinite;
  pointer-events: none;
}

.map-connection-path.cleared {
  stroke: rgba(212, 175, 55, 0.85) !important;
  stroke-width: 2.4 !important;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.4));
}

.map-connection-path.active {
  stroke: rgba(56, 189, 248, 0.85) !important;
  stroke-width: 2.2 !important;
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.35));
}

.map-connection-path.stair-link {
  animation: pathDashScroll 12s linear infinite;
}

.map-connection-path.layer-hidden {
  display: none !important;
}

@keyframes pathDashScroll {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -100; }
}

/* Cartographic Map Node Hover Tooltip */
.map-hover-tooltip {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  user-select: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65));
}

.map-hover-tooltip text {
  user-select: none;
  pointer-events: none;
}

/* Arknights Operation Briefing Card Modal */
.campaign-briefing-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 16px;
  box-sizing: border-box;
  animation: briefingFadeIn 0.25s ease-out;
}

@keyframes briefingFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.briefing-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 4, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.briefing-card {
  position: relative;
  width: min(600px, 94%);
  background: linear-gradient(135deg, rgba(26, 18, 12, 0.98) 0%, rgba(16, 11, 7, 0.98) 100%);
  border: 1.8px solid #D4AF37;
  outline: 1px solid rgba(212, 175, 55, 0.3);
  outline-offset: -5px;
  border-radius: 8px;
  padding: 22px 24px 20px 24px;
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.9),
    0 0 35px rgba(212, 175, 55, 0.25),
    inset 0 0 25px rgba(0, 0, 0, 0.8);
  box-sizing: border-box;
  z-index: 2;
  animation: briefingSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes briefingSlideUp {
  from { transform: translateY(16px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

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

.briefing-code-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.briefing-rhombus {
  color: #facc15;
  font-size: 13px;
}

.briefing-code {
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #facc15;
}

.briefing-badge {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
}

.briefing-badge.story {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.briefing-badge.encounter {
  color: #facc15;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
}

.briefing-badge.boss {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.briefing-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.briefing-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.briefing-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.briefing-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 18, 38, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.briefing-titles {
  flex: 1;
}

.briefing-location {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #38bdf8;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.briefing-title {
  margin: 0;
  font-family: var(--font-display, 'Cinzel Decorative', Georgia, serif);
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 1px;
}

.briefing-guardian {
  font-size: 11px;
  color: #d4af37;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  letter-spacing: 0.8px;
  margin-top: 2px;
}

.briefing-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 14px 0;
}

.briefing-divider .divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.45), transparent);
}

.briefing-divider .divider-gem {
  color: #facc15;
  font-size: 11px;
}

.briefing-intel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.intel-block {
  background: rgba(10, 18, 38, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-left: 3px solid #d4af37;
  border-radius: 4px;
  padding: 10px 12px;
}

.intel-block.objective-block {
  border-left-color: #38bdf8;
}

.intel-label {
  display: block;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-muted, #c5a059);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.briefing-lore,
.briefing-objective {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: #cbd5e1;
}

.briefing-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.briefing-action-btn {
  flex: 1.4 !important;
  margin-top: 0 !important;
  padding: 10px 16px !important;
  font-size: 11px !important;
  letter-spacing: 1.5px !important;
}

.briefing-action-btn.coming-soon {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.9), rgba(69, 26, 3, 0.95)) !important;
  border-color: rgba(251, 191, 36, 0.7) !important;
  color: #fef08a !important;
}

.briefing-cancel-btn {
  flex: 1 !important;
  margin-top: 0 !important;
  padding: 10px 14px !important;
  font-size: 10.5px !important;
  letter-spacing: 1px !important;
}

@media (max-width: 900px) {
  .campaign-map-header {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  .map-header-left,
  .map-header-right {
    min-width: auto;
  }
  .campaign-map-footer {
    display: none;
  }
}

@media (max-width: 768px) {
  .elevation-gauge {
    display: none;
  }
  .astrolabe-compass {
    width: 44px;
    height: 44px;
    top: 8px;
    right: 8px;
  }
  .campaign-map-screen {
    padding: 8px 10px 8px 10px;
  }
  .campaign-map-title {
    font-size: 14px;
  }
  .elden-corner-layer-btn {
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    font-size: 8px;
  }
  .campaign-map-zoom-controls {
    bottom: 10px;
    right: 10px;
  }
}

/* ========================================================
   HTML-BASED CAMPAIGN MAP FLOATING TOOLTIP OVERLAY
   ======================================================== */
.campaign-map-floating-tooltip {
  position: absolute;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 50;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translate(-50%, -100%);
  margin-top: -16px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.85));
}

.map-floating-tooltip-card {
  width: max-content;
  max-width: 344px;
  background: linear-gradient(135deg, rgba(20, 14, 10, 0.96) 0%, rgba(12, 9, 6, 0.98) 100%);
  border: 1.5px solid #D4AF37;
  outline: 1px solid rgba(212, 175, 55, 0.3);
  outline-offset: -4px;
  border-radius: 6px;
  padding: 10px 14px 9px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 16px rgba(212, 175, 55, 0.25);
  box-sizing: border-box;
}

.map-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.map-tooltip-code-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.map-tooltip-rhombus {
  color: #D4AF37;
  font-size: 8.5px;
  flex-shrink: 0;
}

.map-tooltip-badge {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.75px;
  color: #D4AF37;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-tooltip-status {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.75px;
  padding: 1px 7px;
  border-radius: 10px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.map-tooltip-status.cleared {
  background: rgba(250, 204, 21, 0.15);
  color: #FACC15;
  border: 1px solid rgba(250, 204, 21, 0.45);
}

.map-tooltip-status.available,
.map-tooltip-status.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.map-tooltip-status.locked {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.map-tooltip-status.coming-soon {
  background: rgba(245, 158, 11, 0.16);
  color: #FDE047;
  border: 1px solid rgba(251, 191, 36, 0.5);
}

.map-tooltip-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11.5px;
  font-weight: 700;
  color: #FAF5E8;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px rgba(212, 175, 55, 0.35);
}

.map-tooltip-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 9.5px;
  line-height: 1.35;
  margin-top: 2px;
}

.map-tooltip-label {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-weight: 700;
  color: #C5A059;
  flex-shrink: 0;
}

.map-tooltip-val {
  color: #E2E8F0;
  word-break: break-word;
}

.map-tooltip-parts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 6px 0;
  padding: 5px 6px;
  background: rgba(10, 14, 24, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 4px;
}

.map-tooltip-part-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  line-height: 1.3;
  padding: 2px 4px;
  border-radius: 3px;
}

.map-tooltip-part-item .part-tag {
  font-family: var(--font-display, 'Cinzel', serif);
  font-weight: 800;
  letter-spacing: 0.9px;
  flex-shrink: 0;
}

.map-tooltip-part-item .part-title {
  flex: 1;
  color: #E2E8F0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-tooltip-part-item .part-state {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  padding: 1px 5px;
  border-radius: 6px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.map-tooltip-part-item.active {
  background: rgba(56, 189, 248, 0.12);
}

.map-tooltip-part-item.active .part-tag {
  color: #38BDF8;
}

.map-tooltip-part-item.active .part-state {
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.15);
}

.map-tooltip-part-item.cleared .part-tag {
  color: #FACC15;
}

.map-tooltip-part-item.cleared .part-state {
  color: #FACC15;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.15);
}

.map-tooltip-part-item.locked {
  opacity: 0.68;
}

.map-tooltip-part-item.locked .part-tag,
.map-tooltip-part-item.locked .part-title {
  color: #94A3B8;
}

.map-tooltip-part-item.locked .part-state {
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
}

.briefing-parts-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.briefing-part-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: #94A3B8;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.briefing-part-tab:hover {
  border-color: rgba(212, 175, 55, 0.65);
  color: #F8FAFC;
}

.briefing-part-tab.active {
  background: rgba(30, 41, 59, 0.92);
  border-color: #D4AF37;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
  color: #FAF5E8;
}

.briefing-part-num {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #D4AF37;
}

.briefing-part-name {
  font-size: 11px;
  font-weight: 600;
}

/* ========================================================
   VISUAL NOVEL SCENARIO SYSTEM (FGO / Arknights style)
   ======================================================== */
.vn-scene-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 40%, rgba(26, 20, 14, 0.95) 0%, rgba(12, 10, 8, 0.98) 75%, #050403 100%);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.vn-scene-screen.active,
.vn-scene-screen[style*="display: flex"] {
  opacity: 1;
  pointer-events: auto;
}

.vn-backdrop-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.vn-ambient-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.75) 100%),
              linear-gradient(180deg, rgba(5, 4, 3, 0.8) 0%, transparent 25%, transparent 60%, rgba(5, 4, 3, 0.9) 100%);
}

.vn-scenery-overlay {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 40%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
    linear-gradient(rgba(140, 109, 70, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 109, 70, 0.03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

.vn-scene-screen.theme-campfire .vn-scenery-overlay {
  background-image:
    radial-gradient(circle at 50% 82%, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.09) 34%, transparent 65%),
    radial-gradient(circle at 25% 40%, rgba(217, 119, 6, 0.06) 0%, transparent 45%),
    linear-gradient(rgba(140, 109, 70, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 109, 70, 0.025) 1px, transparent 1px);
  animation: vnCampfireHearth 3.6s ease-in-out infinite;
}

@keyframes vnCampfireHearth {
  0%, 100% { opacity: 0.88; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.015); }
}

/* Header: Watermark & Action Toolbar */
.vn-scene-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px;
  box-sizing: border-box;
  z-index: 30;
}

.vn-header-watermark {
  display: flex;
  flex-direction: column;
}

.vn-watermark-tag {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #D4AF37;
  text-transform: uppercase;
}

.vn-watermark-sub {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 9.5px;
  letter-spacing: 1px;
  color: #94A3B8;
  margin-top: 2px;
}

.vn-action-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vn-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(22, 17, 12, 0.88);
  border: 1.2px solid rgba(212, 175, 55, 0.4);
  color: #D8C398;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.vn-toolbar-btn:hover {
  color: #FAF5E8;
  border-color: #D4AF37;
  background: rgba(30, 22, 14, 0.95);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8), 0 0 10px rgba(212, 175, 55, 0.3);
  transform: translateY(-1px);
}

.vn-toolbar-btn:active {
  transform: translateY(0);
}

.vn-btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748B;
  transition: all 0.25s ease;
}

.vn-toolbar-btn.active .vn-btn-dot {
  background: #4ADE80;
  box-shadow: 0 0 8px #4ADE80, 0 0 14px rgba(74, 222, 128, 0.6);
  animation: vnAutoPulse 1.8s infinite ease-in-out;
}

.vn-toolbar-btn.active {
  color: #FAF5E8;
  border-color: #4ADE80;
  background: rgba(20, 36, 25, 0.9);
}

@keyframes vnAutoPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* 3-Point Character Staging */
.vn-staging-container {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 6vw 110px 6vw;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 10;
}

.vn-character-slot {
  position: relative;
  width: 280px;
  max-width: 30vw;
  height: 460px;
  max-height: 62vh;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.35s ease,
              opacity 0.35s ease;
  pointer-events: none;
}

.vn-stickman-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.8));
}

/* Active Speaker Pop & Forward Lighting */
.vn-character-slot.slot-active {
  filter: brightness(1) drop-shadow(0 0 20px rgba(212, 175, 55, 0.45));
  transform: scale(1.02) translateY(-6px);
  opacity: 1;
  z-index: 5;
}

/* Inactive / Listening Characters Dimmed */
.vn-character-slot.slot-dimmed {
  filter: brightness(0.42);
  transform: scale(0.98);
  opacity: 0.85;
  z-index: 2;
}

/* Hidden Slot */
.vn-character-slot.slot-hidden {
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  pointer-events: none;
}

/* ======================================================== */
/* CENTERED DIMMED NARRATION STAGE (ARKNIGHTS / FGO STYLE)  */
/* ======================================================== */
.vn-narration-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 84px 28px 64px 28px;
  box-sizing: border-box;
  z-index: 22;
  cursor: pointer;
  outline: none;
  animation: vnNarrationFadeIn 0.28s ease-out;
}

.vn-narration-overlay:focus,
.vn-narration-overlay:focus-visible {
  outline: none;
}

@keyframes vnNarrationFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.vn-narration-dimmer {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.48);
  backdrop-filter: blur(2.2px);
  -webkit-backdrop-filter: blur(2.2px);
  pointer-events: none;
  z-index: 1;
}

.vn-narration-stage {
  position: relative;
  z-index: 2;
  width: min(760px, 88vw);
  padding: 26px 42px 20px 42px;
  box-sizing: border-box;
  text-align: center;
  background: linear-gradient(
    90deg,
    rgba(6, 9, 16, 0) 0%,
    rgba(6, 9, 16, 0.7) 14%,
    rgba(6, 9, 16, 0.8) 50%,
    rgba(6, 9, 16, 0.7) 86%,
    rgba(6, 9, 16, 0) 100%
  );
  animation: vnNarrationTextRise 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vnNarrationTextRise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vn-narration-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.45) 50%,
    transparent 100%
  );
}

.vn-narration-text {
  margin: 18px auto 14px auto;
  min-height: 2.9em;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', Georgia, serif);
  font-size: clamp(16px, 1.65vw, 20.5px);
  line-height: 1.72;
  color: #FAF5E8;
  letter-spacing: 0.45px;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.95),
    0 0 18px rgba(0, 0, 0, 0.82);
  word-break: break-word;
}

.vn-narration-footer {
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.vn-narration-chevron {
  color: #FACC15;
  font-size: 12px;
  animation: vnChevronBob 1.2s infinite ease-in-out;
}

/* Bottom Dialogue Box (Two-Phase Click) */
.vn-dialogue-box {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1040px, 94vw);
  min-height: 140px;
  background: rgba(14, 18, 26, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  outline: 1px solid rgba(56, 189, 248, 0.22);
  outline-offset: -3px;
  border-radius: 10px;
  padding: 22px 30px;
  box-sizing: border-box;
  box-shadow: 
    0 16px 45px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(212, 175, 55, 0.15),
    inset 0 0 25px rgba(0, 0, 0, 0.65);
  cursor: pointer;
  z-index: 25;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, outline-color 0.2s ease;
}

.vn-dialogue-box:hover,
.vn-dialogue-box:focus-visible {
  border-color: #D4AF37;
  outline-color: rgba(56, 189, 248, 0.45);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.95),
    0 0 30px rgba(212, 175, 55, 0.25),
    inset 0 0 25px rgba(0, 0, 0, 0.65);
}

.vn-speaker-badge {
  position: absolute;
  top: -14px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(28, 20, 14, 0.98) 0%, rgba(16, 12, 8, 0.98) 100%);
  border: 1.4px solid #D4AF37;
  border-radius: 4px;
  padding: 4px 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
}

.vn-speaker-rhombus {
  color: #D4AF37;
  font-size: 9px;
}

.vn-speaker-name {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FAF5E8;
  text-transform: uppercase;
}

.vn-speaker-role-sep {
  color: rgba(212, 175, 55, 0.5);
  font-size: 12px;
}

.vn-speaker-role {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  color: #C5A059;
}

.vn-dialogue-body {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 60px;
  margin-top: 6px;
}

.vn-dialogue-text {
  flex: 1;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', Georgia, serif);
  font-size: clamp(14px, 1.35vw, 16.5px);
  line-height: 1.65;
  color: #FAF5E8;
  letter-spacing: 0.4px;
  word-break: break-word;
}

.vn-chevron {
  color: #FACC15;
  font-size: 13px;
  margin-left: 12px;
  margin-bottom: 2px;
  flex-shrink: 0;
  animation: vnChevronBob 1.2s infinite ease-in-out;
}

@keyframes vnChevronBob {
  0%, 100% { transform: translateY(0); opacity: 0.35; }
  50% { transform: translateY(5px); opacity: 1; text-shadow: 0 0 8px #FACC15; }
}

/* ======================================================== */
/* ARKNIGHTS / FGO PLAYER DIALOGUE CHOICES SELECTION        */
/* ======================================================== */
.vn-choices-container {
  position: absolute;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  width: min(840px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 40;
  pointer-events: auto;
  outline: none;
  animation: vnChoicesFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.vn-choices-container:focus {
  outline: none;
}

@keyframes vnChoicesFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, 16px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.vn-choice-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 22px 14px 20px;
  background: rgba(10, 16, 26, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-left: 4px solid #38bdf8;
  border-radius: 6px;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.75),
    0 0 15px rgba(56, 189, 248, 0.12),
    inset 0 0 15px rgba(14, 165, 233, 0.08);
  color: #FAF5E8;
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', Georgia, serif);
  font-size: clamp(13.5px, 1.25vw, 15.5px);
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.2s ease,
              box-shadow 0.2s ease,
              background 0.2s ease;
  box-sizing: border-box;
}

.vn-choice-btn:hover,
.vn-choice-btn:focus-visible,
.vn-choice-btn.focused {
  background: rgba(16, 24, 38, 0.94);
  border-color: #D4AF37;
  border-left-color: #FACC15;
  transform: translateY(-3px) scale(1.008);
  box-shadow: 
    0 14px 36px rgba(0, 0, 0, 0.9),
    0 0 22px rgba(212, 175, 55, 0.4),
    0 0 12px rgba(56, 189, 248, 0.3),
    inset 0 0 18px rgba(212, 175, 55, 0.12);
}

.vn-choice-btn:active {
  transform: translateY(-1px) scale(0.995);
  box-shadow: 
    0 6px 18px rgba(0, 0, 0, 0.8),
    0 0 16px rgba(212, 175, 55, 0.3);
}

.vn-choice-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.vn-choice-bullet {
  color: #38bdf8;
  font-size: 11px;
  transition: color 0.2s ease, transform 0.2s ease, text-shadow 0.2s ease;
  flex-shrink: 0;
}

.vn-choice-btn:hover .vn-choice-bullet,
.vn-choice-btn:focus-visible .vn-choice-bullet,
.vn-choice-btn.focused .vn-choice-bullet {
  color: #FACC15;
  transform: scale(1.2);
  text-shadow: 0 0 8px #FACC15;
}

.vn-choice-number {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 700;
  color: rgba(212, 175, 55, 0.7);
  letter-spacing: 0.5px;
  flex-shrink: 0;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 3px;
}

.vn-choice-btn:hover .vn-choice-number,
.vn-choice-btn:focus-visible .vn-choice-number,
.vn-choice-btn.focused .vn-choice-number {
  color: #FACC15;
  border-color: #FACC15;
}

.vn-choice-text {
  flex: 1;
  color: #FAF5E8;
  letter-spacing: 0.3px;
}

.vn-choice-chevron {
  color: #38bdf8;
  font-size: 18px;
  font-weight: 700;
  margin-left: 14px;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.vn-choice-btn:hover .vn-choice-chevron,
.vn-choice-btn:focus-visible .vn-choice-chevron,
.vn-choice-btn.focused .vn-choice-chevron {
  color: #FACC15;
  transform: translateX(4px);
  text-shadow: 0 0 8px #FACC15;
}

/* Dialogue History Log Modal Drawer */
.vn-log-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 250;
  display: flex;
  justify-content: flex-end;
  animation: vnFadeIn 0.25s ease-out;
}

@keyframes vnFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.vn-log-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 3, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.vn-log-drawer {
  position: relative;
  width: min(640px, 92vw);
  height: 100%;
  background: linear-gradient(180deg, rgba(18, 14, 10, 0.98) 0%, rgba(10, 8, 5, 0.99) 100%);
  border-left: 2px solid #D4AF37;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.9), 0 0 25px rgba(212, 175, 55, 0.2);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  z-index: 2;
  animation: vnSlideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vnSlideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.vn-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.35);
  box-sizing: border-box;
}

.vn-log-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vn-log-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #FAF5E8;
  margin: 0;
}

.vn-log-close-btn {
  background: transparent;
  border: none;
  outline: none;
  color: #D8C398;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vn-log-close-btn:hover {
  color: #FAF5E8;
  background: rgba(212, 175, 55, 0.15);
  transform: scale(1.1);
}

.vn-log-content {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vn-log-content::-webkit-scrollbar {
  width: 6px;
}

.vn-log-content::-webkit-scrollbar-track {
  background: rgba(14, 10, 6, 0.8);
}

.vn-log-content::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.4);
  border-radius: 3px;
}

.vn-log-content::-webkit-scrollbar-thumb:hover {
  background: #D4AF37;
}

.vn-log-entry {
  background: rgba(24, 18, 12, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 6px;
  padding: 12px 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.vn-log-entry:hover {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(30, 22, 14, 0.8);
}

.vn-log-speaker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.vn-log-badge {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 11px;
  font-weight: 800;
  color: #FACC15;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.vn-log-role {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', serif);
  font-size: 9.5px;
  color: #C5A059;
}

.vn-log-text {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', Georgia, serif);
  font-size: 13.5px;
  line-height: 1.55;
  color: #E2E8F0;
}

.vn-log-entry.vn-log-narration {
  background: rgba(12, 16, 24, 0.58);
  border-color: rgba(212, 175, 55, 0.14);
  border-left: 2.5px solid rgba(212, 175, 55, 0.5);
  padding: 12px 16px;
}

.vn-log-entry.vn-log-narration .vn-log-text {
  color: #D8D2C5;
  font-style: italic;
}

/* Skip Scene Confirmation Popup Modal */
.vn-skip-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: vnFadeIn 0.2s ease-out;
}

.vn-skip-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.vn-skip-dialog {
  position: relative;
  width: min(520px, 92vw);
  background: linear-gradient(135deg, rgba(26, 18, 12, 0.98) 0%, rgba(14, 10, 6, 0.99) 100%);
  border: 1.8px solid #D4AF37;
  outline: 1px solid rgba(212, 175, 55, 0.3);
  outline-offset: -5px;
  border-radius: 8px;
  padding: 24px 26px;
  box-sizing: border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(212, 175, 55, 0.25);
  z-index: 2;
  text-align: center;
  animation: vnDialogPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes vnDialogPop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.vn-skip-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

.vn-skip-tag {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #D4AF37;
  text-transform: uppercase;
}

.vn-skip-title {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 19px;
  font-weight: 800;
  color: #FAF5E8;
  margin: 6px 0 10px 0;
  letter-spacing: 1px;
}

.vn-skip-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px auto 14px auto;
  width: 70%;
}

.vn-skip-divider .divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
}

.vn-skip-divider .divider-gem {
  color: #FACC15;
  font-size: 11px;
}

.vn-skip-body {
  background: rgba(14, 10, 6, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 20px;
  text-align: left;
}

.vn-synopsis-label {
  font-family: var(--font-display, 'Cinzel', serif);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #D4AF37;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.vn-skip-synopsis {
  font-family: var(--font-serif, 'Marcellus', 'Cinzel', Georgia, serif);
  font-size: 12px;
  line-height: 1.55;
  color: #CBD5E1;
  margin: 0;
}

.vn-skip-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 768px) {
  .vn-scene-header {
    padding: 12px 16px;
  }
  .vn-staging-container {
    padding: 0 3vw 125px 3vw;
  }
  .vn-character-slot {
    width: 200px;
    height: 380px;
    max-height: 52vh;
  }
  .vn-dialogue-box {
    bottom: 12px;
    width: 96vw;
    padding: 18px 20px 16px 20px;
  }
  .vn-dialogue-text {
    font-size: 13.5px;
  }
  .vn-speaker-badge {
    top: -12px;
    left: 16px;
    padding: 3px 10px;
  }
  .vn-speaker-name {
    font-size: 11.5px;
  }
  .vn-speaker-role {
    font-size: 9.5px;
  }
  .vn-choices-container {
    bottom: 175px;
    width: 95vw;
    gap: 8px;
  }
  .vn-choice-btn {
    padding: 10px 14px;
    font-size: 12.5px;
  }
  .vn-narration-overlay {
    padding: 76px 14px 48px 14px;
  }
  .vn-narration-stage {
    width: 94vw;
    padding: 20px 18px 14px 18px;
  }
  .vn-narration-text {
    margin: 14px auto 10px auto;
    min-height: 3.1em;
    font-size: 15.5px;
    line-height: 1.62;
  }
}

