/* ============================================================
   Treasure Escape - Gameplay Stylesheet
   Stage 2: Core Match-3 Engine
   Board grid, temple gem tiles, scoreboard, HUD, and controls
   ============================================================ */

/* Game Grid - Strict 8x8 Board Container */
.grid {
  display: grid;
  grid-template-columns: repeat(8, 70px);
  grid-template-rows: repeat(8, 70px);
  width: 560px;
  height: 560px;
  box-sizing: content-box;
  background: radial-gradient(circle at center, rgba(38, 50, 56, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  padding: 6px;
  border-radius: 14px;
  border: 3px solid #8d6e63;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(255, 215, 0, 0.2);
  margin-left: 60px;
  margin-top: 30px;
  user-select: none;
  position: relative;
}

/* Individual Cell Tile */
.grid-tile, .grid > div {
  width: 70px;
  height: 70px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
  position: relative;
  overflow: visible;
}

.grid-tile:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.grid-tile.empty {
  background: rgba(0, 0, 0, 0.15);
}

/* Selection Highlight */
.grid-tile.selected {
  outline: 3px solid #ffd54f;
  outline-offset: -3px;
  background-color: rgba(255, 213, 79, 0.18);
  box-shadow: 0 0 12px rgba(255, 213, 79, 0.6) inset;
}

.grid-tile.selected .gem-svg {
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px rgba(255, 213, 79, 0.8));
}

/* Gem SVG Icons */
.gem-svg {
  width: 54px;
  height: 54px;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.45));
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Gem Wrapper for Special Overlays */
.gem-wrapper {
  position: relative;
  width: 54px;
  height: 54px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gem-wrapper > .gem-svg {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}

/* Base Special SVG Overlays */
.special-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

/* Striped Crystal Overlays */
.special-stripe-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.striped-h-svg {
  animation: stripePulseH 1.2s infinite ease-in-out;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 12px rgba(0, 229, 255, 0.7));
}

.striped-v-svg {
  animation: stripePulseV 1.2s infinite ease-in-out;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 12px rgba(255, 171, 0, 0.7));
}

@keyframes stripePulseH {
  0%, 100% { opacity: 0.85; transform: scaleX(0.97); }
  50% { opacity: 1; transform: scaleX(1.03); }
}

@keyframes stripePulseV {
  0%, 100% { opacity: 0.85; transform: scaleY(0.97); }
  50% { opacity: 1; transform: scaleY(1.03); }
}

/* Bomb Gem (Explosive Crystal Bomb) Aura & Animation */
.special-wrapped-aura {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.wrapped-svg {
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(255, 160, 0, 0.8)) drop-shadow(0 0 10px rgba(255, 60, 0, 0.45));
}

.wrapped-pulse-core {
  animation: bombCoreHeartbeat 1.3s infinite alternate ease-in-out;
  transform-origin: 30px 30px;
}

@keyframes bombCoreHeartbeat {
  0% { transform: scale(0.9); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 4px #ffffff) drop-shadow(0 0 8px #ffea00); }
  100% { transform: scale(0.9); opacity: 0.9; }
}

.bomb-energy-crack {
  animation: energyCrackFlicker 1.6s infinite alternate ease-in-out;
}

@keyframes energyCrackFlicker {
  0% { opacity: 0.65; stroke-width: 1.4px; }
  50% { opacity: 1; stroke-width: 2px; }
  100% { opacity: 0.75; stroke-width: 1.6px; }
}

.bomb-spark {
  animation: bombSparkPulse 1.1s infinite alternate ease-in-out;
  transform-origin: center;
}

@keyframes bombSparkPulse {
  0% { transform: scale(0.75); opacity: 0.5; }
  100% { transform: scale(1.3); opacity: 1; }
}

.bomb-energy-ring {
  animation: bombRingSpin 6s infinite linear;
  transform-origin: 30px 30px;
}

@keyframes bombRingSpin {
  0% { transform: rotate(0deg); opacity: 0.45; }
  50% { opacity: 0.75; }
  100% { transform: rotate(360deg); opacity: 0.45; }
}

.wrapped-inner-shell {
  transform-origin: 30px 30px;
}

.wrapped-explosive-halo {
  position: absolute;
  inset: 2px;
  border-radius: 10px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 235, 59, 0.12) 0%, rgba(255, 152, 0, 0.06) 60%, transparent 80%);
  border: none;
  box-shadow: none;
}

/* Wrapped Gem / Candy Bomb tile states */
.grid-tile.special-wrapped {
  position: relative;
  filter: drop-shadow(0 0 6px rgba(255, 160, 0, 0.65));
}

.grid-tile.special-wrapped:hover {
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.9));
}

.grid-tile.special-wrapped.selected {
  outline: 3px solid #ff9100;
  outline-offset: -3px;
  filter: drop-shadow(0 0 14px rgba(255, 152, 0, 0.95)) drop-shadow(0 0 4px #ffffff);
}

.wrapped-gem {
  width: 54px;
  height: 54px;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 160, 0, 0.75));
}

/* Prismatic Crystal Sparkle and Chromatic Shift */
.special-prismatic-aura {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 50%;
  background: transparent; /* Transparent to guarantee exact visual consistency with How to Play */
  z-index: 2;
}

.prism-glint-1, .prism-glint-2, .prism-glint-3, .prism-glint-4 {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 4px #ffffff, 0 0 8px #00e5ff;
  animation: glintTwinkle 1.5s infinite ease-in-out;
  pointer-events: none;
}

.prism-glint-1 { top: 4px; left: 10px; animation-delay: 0s; }
.prism-glint-2 { top: 8px; right: 8px; animation-delay: 0.4s; }
.prism-glint-3 { bottom: 8px; left: 8px; animation-delay: 0.8s; }
.prism-glint-4 { bottom: 4px; right: 10px; animation-delay: 1.2s; }

@keyframes glintTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.3); }
}

.prismatic-gem {
  width: 54px;
  height: 54px;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.75)) drop-shadow(0 0 10px rgba(0, 229, 255, 0.45));
  animation: prismBreathing 2.4s infinite alternate ease-in-out;
}

.prism-orbit-ring {
  animation: orbitSpin 8s infinite linear;
  transform-origin: 30px 30px;
}

@keyframes orbitSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes prismBreathing {
  0% { transform: scale(0.97); }
  100% { transform: scale(1.03); }
}

/* Prismatic Gem (Match 5) tile states */
.grid-tile.special-prismatic {
  position: relative;
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.55));
}

.grid-tile.special-prismatic:hover {
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.85)) drop-shadow(0 0 14px rgba(0, 229, 255, 0.75));
}

.grid-tile.special-prismatic.selected {
  outline: 3px solid #00e5ff;
  outline-offset: -3px;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 16px rgba(0, 229, 255, 0.8));
}

.grid-tile:hover .gem-svg {
  transform: scale(1.08);
}

/* Destruction Animation */
.grid-tile.destroying .gem-svg {
  animation: gemPop 0.2s ease-out forwards;
}

@keyframes gemPop {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.8; filter: brightness(1.8); }
  100% { transform: scale(0); opacity: 0; }
}

/* Shuffle Swirl Animation */
.grid-tile.shuffling .gem-svg {
  animation: tileShuffle 0.35s ease-in-out;
}

@keyframes tileShuffle {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(0.6) rotate(180deg); opacity: 0.35; filter: blur(1px); }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

/* Shuffle Toast Overlay */
.shuffle-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(15, 23, 42, 0.95);
  border: 2px solid #ffd54f;
  color: #ffd54f;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(255, 213, 79, 0.5);
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.shuffle-toast.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Scoreboard Panel */
.scoreBoard {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid #b45309;
  border-radius: 16px;
  margin-top: 30px;
  margin-left: 60px;
  width: 200px;
  min-height: 380px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  text-align: center;
  color: #f1f5f9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.score-section, .moves-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.scoreBoard h3 {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 4px;
}

.scoreBoard h1 {
  font-size: 32px;
  font-weight: 700;
  color: #f8fafc;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.scoreBoard h2 {
  font-size: 28px;
  font-weight: 700;
  color: #38bdf8;
  margin-top: 2px;
}

.multiplier-tag {
  font-size: 13px;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-top: 4px;
}

/* Timer and Change Mode Controls */
#timer {
  font-size: 16px;
  font-weight: 600;
  color: #cbd5e1;
  min-height: 22px;
}

#changeMode {
  margin-top: 10px;
  padding: 8px 16px;
  background-color: #ef4444;
  color: white;
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

#changeMode:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
}

/* Game Elements inside Gameplay Screen */
#gameplayScreen .grid {
  display: grid;
}

#gameplayScreen .scoreBoard {
  display: flex;
}

/* ============================================================
   Stage 4: Level System UI & Visual Styling
   Obstacles, Drop Items, Ancient Glass, Level HUD, & Modals
   ============================================================ */

/* Ancient Glass Cell Overlay */
.glass-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(224, 247, 250, 0.45) 0%, rgba(128, 222, 234, 0.2) 50%, rgba(0, 188, 212, 0.35) 100%);
  border: 2px solid rgba(224, 247, 250, 0.85);
  box-shadow: inset 0 0 10px rgba(128, 222, 234, 0.6), 0 0 8px rgba(0, 229, 255, 0.35);
  pointer-events: none;
  z-index: 4;
}

.glass-layer::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 40%;
  height: 40%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 4px 0 0 0;
}

/* Obstacle Tiles */
.grid-tile.obstacle-tile {
  cursor: not-allowed;
}

.grid-tile.obstacle-stone {
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

.grid-tile.obstacle-boulder {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.75));
}

/* Drop Item Animation */
.grid-tile.drop-item-tile .gem-svg {
  animation: dropItemFloat 2.4s ease-in-out infinite alternate;
}

@keyframes dropItemFloat {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-3px) scale(1.04); }
}

/* Black Crystal Pulse */
.grid-tile.black-crystal-tile .gem-svg {
  animation: darkPulse 2s ease-in-out infinite alternate;
}

@keyframes darkPulse {
  0% { filter: drop-shadow(0 0 4px #7b1fa2); }
  100% { filter: drop-shadow(0 0 10px #e040fb); }
}

/* Enhanced Scoreboard for Stage 4 Level System */
.scoreBoard.level-mode {
  width: 250px;
  min-height: 560px;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 14px;
}

/* Level Header Section */
.level-header-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 10px;
}

.level-select-dropdown {
  width: 100%;
  background: #1e293b;
  color: #fbbf24;
  border: 1px solid #d97706;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  outline: none;
}

.level-select-dropdown:hover {
  background: #334155;
}

.level-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.level-name-display {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  text-align: left;
}

.difficulty-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.difficulty-badge.easy {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid #22c55e;
}

.difficulty-badge.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid #f59e0b;
}

.difficulty-badge.hard {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
}

/* Star Rating Gauge */
.star-gauge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 4px 0;
}

.star-gauge-stars {
  display: flex;
  gap: 8px;
  font-size: 22px;
  color: #475569;
}

.star-gauge-stars .star-icon.achieved {
  color: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
  animation: starPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes starPop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.star-threshold-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Objectives Container */
.objectives-container {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.objectives-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #38bdf8;
  margin-bottom: 2px;
  text-align: left;
}

.objective-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.7);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  border-left: 3px solid #38bdf8;
}

.objective-item.completed {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}

.objective-icon-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f1f5f9;
  font-weight: 500;
}

.objective-mini-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.objective-progress-text {
  font-weight: 700;
  color: #fbbf24;
}

.objective-item.completed .objective-progress-text {
  color: #4ade80;
}

/* Special Event Widget (Level 5 & 15) */
.special-event-widget {
  width: 100%;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  text-align: left;
}

/* Distinct Level 15 Guardian Boss Widget */
.special-event-widget.guardian-boss-widget {
  background: linear-gradient(135deg, rgba(88, 28, 28, 0.92) 0%, rgba(30, 10, 36, 0.95) 100%);
  border: 2px solid #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.45), inset 0 0 10px rgba(185, 28, 28, 0.3);
  padding: 10px 10px;
  gap: 8px;
}

.guardian-boss-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 1px solid rgba(239, 68, 68, 0.35);
  padding-bottom: 4px;
}

.guardian-boss-icon {
  font-size: 13px;
}

.guardian-boss-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fca5a5;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
}

.guardian-active-restriction {
  width: 100%;
}

.guardian-restriction-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 6px;
  padding: 5px 8px;
}

.guardian-icon-wrap {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guardian-icon-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.8));
}

.guardian-name-wrap {
  display: flex;
  flex-direction: column;
}

.guardian-restriction-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #f87171;
  text-transform: uppercase;
}

.guardian-restriction-name {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.guardian-forbidden-card {
  background: rgba(220, 38, 38, 0.2);
  border-left: 3px solid #ef4444;
  border-radius: 4px;
  padding: 5px 8px;
}

.guardian-forbidden-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fef08a;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.guardian-forbidden-rule {
  font-size: 11px;
  font-weight: 600;
  color: #fecaca;
  line-height: 1.3;
}

.guardian-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #cbd5e1;
  padding: 2px 2px;
}

.guardian-shift-box {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fef08a;
  font-weight: 600;
}

.guardian-violation-count {
  font-weight: 700;
  color: #f87171;
}

.guardian-strikes {
  display: flex;
  gap: 4px;
  width: 100%;
}

.guardian-strike-badge {
  flex: 1;
  text-align: center;
  padding: 3px 2px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  background: #1e293b;
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guardian-strike-badge.active-warning {
  background: #f59e0b;
  color: #0f172a;
  border-color: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
}

.guardian-strike-badge.active-final {
  background: #ea580c;
  color: #ffffff;
  border-color: #f97316;
  filter: drop-shadow(0 0 8px rgba(234, 88, 12, 0.8));
  animation: pulseFinalStrike 1s infinite alternate;
}

.guardian-strike-badge.active-failed {
  background: #dc2626;
  color: #ffffff;
  border-color: #ef4444;
}

@keyframes pulseFinalStrike {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.05); filter: brightness(1.3); }
}

/* Guardian Shift In-Game Notification Banner */
.guardian-shift-banner {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: linear-gradient(135deg, #7f1d1d 0%, #1e1b4b 100%);
  border: 2px solid #ef4444;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 16px rgba(239, 68, 68, 0.6);
  border-radius: 10px;
  padding: 10px 20px;
  color: #ffffff;
  cursor: pointer;
  animation: shiftBannerSlide 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes shiftBannerSlide {
  0% { transform: translate(-50%, -40px) scale(0.9); opacity: 0; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.guardian-shift-banner.fade-out {
  opacity: 0;
  transform: translate(-50%, -20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.shift-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shift-banner-content strong {
  font-size: 13px;
  color: #fef08a;
  letter-spacing: 0.5px;
}

.shift-sub {
  font-size: 12px;
  color: #fecaca;
  margin-top: 2px;
}

/* Guardian Violation Toast Alert */
.guardian-violation-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 160;
  background: #991b1b;
  border: 2px solid #f87171;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 18px rgba(248, 113, 113, 0.8);
  border-radius: 8px;
  padding: 10px 18px;
  color: #ffffff;
  cursor: pointer;
  animation: violationShake 0.4s ease-in-out;
}

@keyframes violationShake {
  0%, 100% { transform: translate(-50%, 0); }
  20%, 60% { transform: translate(-54%, 0); }
  40%, 80% { transform: translate(-46%, 0); }
}

.guardian-violation-toast.fade-out {
  opacity: 0;
  transform: translate(-50%, -15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.violation-toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.violation-toast-content strong {
  font-size: 13px;
  color: #fef08a;
}

.violation-reason {
  font-size: 12px;
  color: #fee2e2;
  margin-top: 2px;
}

/* Guardian Briefing Modal Styling */
.guardian-briefing-content {
  border-color: #ef4444;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 25px rgba(239, 68, 68, 0.5);
  max-width: 420px;
}

.guardian-briefing-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.guardian-briefing-intro {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
  text-align: center;
}

.briefing-rule-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 10px 12px;
}

.briefing-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.briefing-rule-name {
  font-size: 14px;
  font-weight: 800;
  color: #f87171;
}

.briefing-rule-desc {
  font-size: 12px;
  color: #f1f5f9;
  line-height: 1.3;
}

.briefing-warning-card {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #fca5a5;
  text-align: center;
}

/* Level Result Modal */
.level-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  animation: modalFadeIn 0.25s ease-out;
}

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

.level-modal-content {
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(245, 158, 11, 0.3);
  border-radius: 16px;
  padding: 28px 24px;
  width: 360px;
  max-width: 92vw;
  box-sizing: border-box;
  text-align: center;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: modalSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideUp {
  from { transform: translateY(30px) scale(0.9); }
  to { transform: translateY(0) scale(1); }
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.modal-header.win h2 {
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
}

.modal-header.lose h2 {
  color: #f87171;
  text-shadow: 0 0 12px rgba(248, 113, 113, 0.6);
}

.modal-level-title {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

.modal-stars {
  font-size: 34px;
  display: flex;
  gap: 8px;
  color: #334155;
  margin: 4px 0;
}

.modal-stars .star-achieved {
  color: #fbbf24;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.85));
}

.modal-score-breakdown {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  color: #cbd5e1;
}

.score-row.bonus {
  color: #38bdf8;
}

.score-row.total {
  font-size: 16px;
  font-weight: 700;
  color: #fbbf24;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 6px;
  margin-top: 2px;
}

.modal-fail-reason {
  color: #fca5a5;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.modal-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease, filter 0.15s ease;
}

.modal-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.modal-btn.primary {
  background: #f59e0b;
  color: #0f172a;
}

.modal-btn.secondary {
  background: #334155;
  color: #f1f5f9;
}

.modal-btn.secondary.danger {
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #ef4444;
}

.modal-btn.secondary.danger:hover {
  background: #991b1b;
}

.modal-btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

.modal-buttons.vertical {
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   Stage 5: Game Interface — Main Menu, Map, Pause & Settings
   ============================================================ */

/* Top Controls Row inside LevelHUD */
.level-top-controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
}

.level-top-controls-row .level-select-dropdown {
  margin-bottom: 0;
  flex: 1;
}

.game-pause-btn {
  background: #1e293b;
  border: 1px solid #d97706;
  color: #fbbf24;
  border-radius: 6px;
  width: 34px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.game-pause-btn:hover {
  background: #334155;
  transform: scale(1.05);
}

/* Screen Wrapper */
#appContainer {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Main Menu Screen */
#mainMenuScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.88) 0%, rgba(2, 6, 23, 0.96) 100%);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  padding: 24px 16px;
}

.menu-brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  text-align: center;
}

.menu-temple-crest {
  font-size: 42px;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.8));
  animation: floatCrest 3s ease-in-out infinite alternate;
}

@keyframes floatCrest {
  0% { transform: translateY(0); }
  100% { transform: translateY(-6px); }
}

.menu-title {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fffbeb 0%, #fbbf24 40%, #f59e0b 70%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8));
  margin-bottom: 4px;
}

.menu-subtitle {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #94a3b8;
}

.menu-actions-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 280px;
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  user-select: none;
}

.menu-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.menu-btn.primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  border-color: #fbbf24;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
  font-size: 16px;
  padding: 14px 20px;
}

.menu-btn.secondary {
  background: rgba(30, 41, 59, 0.85);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.menu-btn.secondary.small-btn {
  font-size: 13px;
  padding: 9px 16px;
}

.menu-btn-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.menu-btn-row .menu-btn {
  flex: 1;
}

/* Level Selection Screen */
#levelSelectScreen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.94) 0%, rgba(2, 6, 23, 0.98) 100%);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  padding: 24px 20px 40px 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.level-select-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  margin-bottom: 24px;
}

.level-map-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fbbf24;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.map-stats-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 6px 14px;
  border-radius: 20px;
}

.level-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 900px;
}

/* Temple Level Node Card */
.level-node-card {
  background: rgba(30, 41, 59, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  user-select: none;
}

.level-node-card.unlocked:hover {
  transform: translateY(-3px);
  border-color: #f59e0b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 14px rgba(245, 158, 11, 0.35);
}

.level-node-card.locked {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.05);
  cursor: not-allowed;
  opacity: 0.72;
}

.level-node-card.special-event {
  border-color: rgba(239, 68, 68, 0.6);
  background: linear-gradient(135deg, rgba(69, 10, 10, 0.5) 0%, rgba(30, 41, 59, 0.8) 100%);
}

.level-node-card.special-event:hover {
  border-color: #ef4444;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 16px rgba(239, 68, 68, 0.5);
}

.node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.node-number {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1px;
}

.node-diff {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}

.node-diff.easy { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid #22c55e; }
.node-diff.medium { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #f59e0b; }
.node-diff.hard { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #ef4444; }

.special-event-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.special-event-pill.boulder { background: rgba(249, 115, 22, 0.2); color: #fdba74; border: 1px solid #ea580c; }
.special-event-pill.puzzle { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; border: 1px solid #a855f7; }
.special-event-pill.boss { background: rgba(239, 68, 68, 0.25); color: #fca5a5; border: 1px solid #ef4444; animation: pulseFinalStrike 1.2s infinite alternate; }

.node-name {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

.node-stars {
  display: flex;
  gap: 4px;
  font-size: 18px;
}

.map-star {
  color: #334155;
}

.map-star.active {
  color: #fbbf24;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.7));
}

.node-score {
  font-size: 11px;
  color: #94a3b8;
}

.node-locked-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.node-lock-icon {
  font-size: 14px;
}

/* Gameplay Screen Wrapper */
#gameplayScreen {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

/* Pause Menu */
.pause-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* Settings Modal Body & Groups */
.settings-modal-content {
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.settings-scroll-body {
  overflow-y: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
  text-align: left;
}

.settings-group {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #38bdf8;
  margin-bottom: 2px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #cbd5e1;
}

.setting-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #f59e0b;
}

.setting-row input[type="range"] {
  width: 130px;
  cursor: pointer;
  accent-color: #f59e0b;
}

.setting-select, .setting-input {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
}

.placeholder-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  padding: 2px 6px;
  border-radius: 4px;
}

.setting-buttons-row {
  display: flex;
  gap: 8px;
}

/* Informational & Confirmation Modals */
.confirm-message {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 4px 0 10px 0;
}

.new-record-pill {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: #ffffff;
  padding: 4px 14px;
  border-radius: 14px;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
  animation: pulseFinalStrike 1s infinite alternate;
}

.failed-objective-card {
  background: rgba(220, 38, 38, 0.15);
  border-left: 3px solid #ef4444;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}

.failed-reason-title {
  font-size: 10px;
  font-weight: 800;
  color: #fca5a5;
  letter-spacing: 1px;
}

.failed-reason-text {
  font-size: 12px;
  color: #fee2e2;
  margin-top: 2px;
}

.achievement-placeholder-card {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
  padding: 4px;
}

.score-row.best {
  color: #fbbf24;
  font-weight: 600;
}

/* Floating Toast */
.menu-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  border: 1px solid #f59e0b;
  color: #f8fafc;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 200;
  animation: toastPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastPop {
  0% { transform: translate(-50%, 20px); opacity: 0; }
  100% { transform: translate(-50%, 0); opacity: 1; }
}

.menu-toast.fade-out {
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ============================================================
   Stage 6: Player Systems UI Styling
   Profile, Avatars, Badges, Showcase, Share Card, & Unlock Toasts
   ============================================================ */

/* 1. Profile Modal */
.profile-modal-content {
  width: 520px;
  max-width: 95vw;
  max-height: 88vh;
  padding: 22px 20px;
}

.profile-identity-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(245, 158, 11, 0.15);
}

.profile-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.profile-avatar-wrap:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
}

.profile-avatar-svg {
  width: 100%;
  height: 100%;
}

.profile-avatar-svg svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.avatar-change-hint {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  background: #f59e0b;
  color: #0f172a;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.profile-meta-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.profile-username-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-username-text {
  font-size: 20px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.profile-edit-name-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fbbf24;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-edit-name-btn:hover {
  background: #f59e0b;
  color: #0f172a;
  transform: scale(1.1);
}

.profile-title-tag {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.profile-scroll-body {
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
  margin: 4px 0;
}

/* Stats Overview Grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  width: 100%;
}

.stat-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
}

.stat-value {
  font-size: 16px;
  font-weight: 800;
  color: #fbbf24;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Profile Section Box */
.profile-section-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #38bdf8;
  text-align: left;
}

/* 3 Showcase Pedestals */
.pedestals-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.pedestal-slot {
  position: relative;
  background: radial-gradient(circle at top, #1e293b 0%, #090d16 100%);
  border: 2px dashed rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 105px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pedestal-slot:hover {
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.25);
}

.pedestal-slot.populated {
  border-style: solid;
  border-color: #f59e0b;
  box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.15);
}

.pedestal-add-plus {
  font-size: 24px;
  opacity: 0.7;
}

.pedestal-empty-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.pedestal-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.pedestal-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.2;
}

.pedestal-tier-pill {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 8px;
  text-transform: uppercase;
}

.pedestal-tier-pill.bronze {
  background: #b45309;
  color: #ffffff;
}

.pedestal-tier-pill.silver {
  background: #64748b;
  color: #ffffff;
}

.pedestal-tier-pill.gold {
  background: #f59e0b;
  color: #0f172a;
}

/* Chamber Expedition Log Table */
.profile-levels-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.profile-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.5);
  font-size: 12px;
}

.profile-level-row.locked {
  opacity: 0.45;
}

.lvl-col-id {
  font-weight: 700;
  color: #fbbf24;
  width: 90px;
  text-align: left;
}

.lvl-col-name {
  flex: 1;
  text-align: left;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lvl-col-stars {
  font-size: 12px;
  width: 50px;
}

.lvl-col-stars .active-star {
  color: #fbbf24;
}

.lvl-col-stars .dim-star {
  color: #475569;
}

.lvl-col-score {
  font-weight: 600;
  color: #4ade80;
  width: 90px;
  text-align: right;
}

.lvl-col-status {
  width: 85px;
  text-align: right;
}

.lvl-status-pill {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.lvl-status-pill.won {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid #22c55e;
}

.lvl-status-pill.in-prog {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid #0284c7;
}

.lvl-status-pill.locked {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

/* 2. Avatar Picker Modal */
.avatar-picker-content {
  width: 540px;
  max-width: 95vw;
  max-height: 88vh;
  padding: 22px 20px;
}

.avatar-grid-scroll {
  width: 100%;
  max-height: 58vh;
  overflow-y: auto;
  margin: 10px 0;
  padding-right: 4px;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  width: 100%;
}

.avatar-card {
  position: relative;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-card:hover {
  border-color: #38bdf8;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(56, 189, 248, 0.3);
}

.avatar-card.active {
  border-color: #f59e0b;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.6);
}

.avatar-card-preview {
  width: 64px;
  height: 64px;
}

.avatar-card-preview svg {
  width: 100%;
  height: 100%;
}

.avatar-card-name {
  font-size: 11px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.avatar-card-title {
  font-size: 9px;
  color: #94a3b8;
}

.avatar-selected-badge {
  font-size: 9px;
  font-weight: 800;
  background: #f59e0b;
  color: #0f172a;
  padding: 1px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

/* 3. Edit Username Modal */
.edit-username-content {
  width: 380px;
  max-width: 95vw;
}

.edit-username-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.edit-username-input {
  width: 100%;
  background: #1e293b;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 700;
  padding: 10px 14px;
  outline: none;
  text-align: center;
}

.username-validation-msg {
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 4px;
  padding: 4px 8px;
}

.username-rules-hint {
  font-size: 10px;
  color: #94a3b8;
}

/* 4. Showcase Picker Modal */
.showcase-picker-content {
  width: 440px;
  max-width: 95vw;
  max-height: 85vh;
}

.showcase-list-scroll {
  width: 100%;
  max-height: 52vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
  padding-right: 4px;
}

.showcase-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.showcase-choice-card:hover {
  border-color: #f59e0b;
  background: rgba(30, 41, 59, 0.85);
  transform: translateX(3px);
}

.showcase-choice-card.already-slotted {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.1);
}

.choice-icon {
  font-size: 26px;
}

.choice-info {
  flex: 1;
}

.choice-name {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.choice-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}

.choice-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.choice-badge.bronze { background: #b45309; color: #fff; }
.choice-badge.silver { background: #64748b; color: #fff; }
.choice-badge.gold { background: #f59e0b; color: #0f172a; }

.choice-slotted-tag {
  font-size: 9px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

.empty-showcase-notice {
  padding: 24px 16px;
  text-align: center;
  color: #cbd5e1;
}

/* 5. Achievements Collection Modal */
.achievements-modal-content {
  width: 620px;
  max-width: 95vw;
  max-height: 88vh;
  padding: 22px 20px;
}

.ach-summary-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ach-summary-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
}

.ach-summary-score {
  color: #fbbf24;
}

.ach-summary-bar-bg {
  width: 100%;
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ach-summary-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.ach-tabs-container {
  display: flex;
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  padding: 4px 0;
}

.ach-tab-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ach-tab-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #f1f5f9;
}

.ach-tab-btn.active {
  background: #f59e0b;
  color: #0f172a;
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.ach-cards-scroll {
  width: 100%;
  max-height: 52vh;
  overflow-y: auto;
  margin: 6px 0;
  padding-right: 4px;
}

.ach-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.achievement-node-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.achievement-node-card:hover {
  border-color: #f59e0b;
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.ach-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ach-card-icon {
  font-size: 26px;
}

.ach-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ach-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
}

.ach-category-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.ach-card-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.3;
}

.ach-tiers-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.tier-badge {
  flex: 1;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.tier-badge.locked {
  background: rgba(15, 23, 42, 0.6);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tier-badge.unlocked.bronze {
  background: #b45309;
  color: #ffffff;
  border: 1px solid #d97706;
  box-shadow: 0 0 8px rgba(180, 83, 9, 0.4);
}

.tier-badge.unlocked.silver {
  background: #64748b;
  color: #ffffff;
  border: 1px solid #94a3b8;
  box-shadow: 0 0 8px rgba(100, 116, 139, 0.4);
}

.tier-badge.unlocked.gold {
  background: #f59e0b;
  color: #0f172a;
  border: 1px solid #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.ach-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 2px;
}

.ach-progress-bar {
  width: 100%;
  height: 6px;
  background: #0f172a;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ach-progress-fill {
  height: 100%;
  background: #38bdf8;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ach-progress-sub {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

/* 6. Achievement Detail Modal */
.ach-detail-content {
  width: 440px;
  max-width: 95vw;
}

.detail-modal-icon {
  font-size: 36px;
  margin-bottom: 2px;
}

.detail-modal-desc {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.4;
  text-align: center;
}

.detail-modal-current {
  font-size: 12px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 12px;
  width: 100%;
}

.detail-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 6px 0;
}

.detail-tier-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.detail-tier-card.unlocked {
  border-color: #f59e0b;
}

.detail-tier-badge {
  font-size: 11px;
  font-weight: 800;
  display: inline-block;
}

.detail-tier-badge.bronze { color: #f59e0b; }
.detail-tier-badge.silver { color: #cbd5e1; }
.detail-tier-badge.gold { color: #facc15; }

.detail-tier-desc {
  font-size: 12px;
  color: #f1f5f9;
}

.detail-tier-target {
  font-size: 10px;
  color: #94a3b8;
}

.detail-tier-status {
  font-size: 9px;
  font-weight: 800;
  align-self: flex-start;
  padding: 2px 6px;
  border-radius: 4px;
}

.detail-tier-status.status-unlocked {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.detail-tier-status.status-locked {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

/* 7. Share Modal & Preview */
.share-modal-content {
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
}

.share-card-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
}

.share-preview-canvas {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 16px rgba(245, 158, 11, 0.4);
}

.share-text-preview {
  width: 100%;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px 12px;
  text-align: left;
}

.share-text-box {
  font-family: inherit;
  font-size: 11px;
  color: #cbd5e1;
  white-space: pre-wrap;
  margin: 0;
}

/* 8. In-Game Achievement Unlock Toast Notification */
.achievement-toast-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  background: linear-gradient(135deg, #1e293b 0%, #090d16 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(245, 158, 11, 0.6);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
  animation: achToastSlide 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes achToastSlide {
  0% { transform: translate(-50%, -50px) scale(0.9); opacity: 0; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.achievement-toast-banner.fade-out {
  opacity: 0;
  transform: translate(-50%, -20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ach-toast-crest {
  font-size: 32px;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
}

.ach-toast-body {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 2px;
}

.ach-toast-headline {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fbbf24;
  text-transform: uppercase;
}

.ach-toast-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}

.ach-toast-tier {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ach-toast-tier.bronze { background: #b45309; color: #fff; }
.ach-toast-tier.silver { background: #64748b; color: #fff; }
.ach-toast-tier.gold { background: #f59e0b; color: #0f172a; }

.ach-toast-desc {
  font-size: 11px;
  color: #cbd5e1;
}

/* ============================================================
   Stage 7: Online Systems & Global Leaderboards Styles
   ============================================================ */

/* 1. Main Menu Auth Status Pill */
.menu-auth-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  user-select: none;
}

.menu-auth-pill.guest {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}

.menu-auth-pill.guest:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: #cbd5e1;
  color: #f1f5f9;
}

.menu-auth-pill.online {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(6, 95, 70, 0.3) 100%);
  border: 1px solid #10b981;
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.menu-auth-pill.online:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 95, 70, 0.45) 100%);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
}

.auth-dot {
  font-size: 10px;
  line-height: 1;
}

.auth-dot.green {
  color: #10b981;
  text-shadow: 0 0 6px #10b981;
}

.auth-dot.gray {
  color: #64748b;
}

/* 2. Profile Modal Account Bar */
.profile-account-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.profile-account-bar.online {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.profile-account-bar.guest {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.account-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.account-auth-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.account-auth-btn.sign-in {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.account-auth-btn.sign-in:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
}

.account-auth-btn.sign-in.small {
  padding: 4px 10px;
  font-size: 11px;
}

.account-auth-btn.sign-out {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.account-auth-btn.sign-out:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* 3. Global Leaderboard Modal Structure */
.leaderboard-modal-content {
  width: 580px;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

/* Category Tabs: Chambers vs Timed Mode */
.leaderboard-category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.lb-category-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.lb-category-btn:hover {
  background: rgba(51, 65, 85, 0.5);
  color: #f8fafc;
}

.lb-category-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Chamber Selector Wrapper with Horizontal Scroll Arrows */
.chamber-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-bottom: 8px;
  position: relative;
}

.chamber-scroll-arrow {
  flex-shrink: 0;
  width: 26px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.9);
  color: #fbbf24;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.chamber-scroll-arrow:hover {
  background: #f59e0b;
  color: #0f172a;
  border-color: #fbbf24;
}

/* 4. 15 Chamber Switcher Tabs Carousel */
.chamber-tabs-container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 6px 2px;
  margin-bottom: 0;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #f59e0b #1e293b;
}

.chamber-tabs-container::-webkit-scrollbar {
  height: 6px;
}

.chamber-tabs-container::-webkit-scrollbar-thumb {
  background: #f59e0b;
  border-radius: 3px;
}

.chamber-tab-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.7);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.chamber-tab-btn:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #f1f5f9;
  border-color: #cbd5e1;
}

.chamber-tab-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

/* 5. Active Chamber Header Bar */
.chamber-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 8px;
}

.chamber-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chamber-header-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}

.chamber-diff-pill {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.chamber-diff-pill.easy { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.chamber-diff-pill.medium { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.chamber-diff-pill.hard { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.chamber-diff-pill.boss { background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff; }
.chamber-diff-pill.timed-pill { background: linear-gradient(135deg, #0284c7, #2563eb); color: #fff; }

.lb-col-mode-badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.timed-badge-tag {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 6. Dynamic Content Area */
.leaderboard-content-area {
  min-height: 240px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: rgba(10, 15, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

/* States */
.leaderboard-loading-state,
.leaderboard-empty-state,
.leaderboard-offline-state,
.leaderboard-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
  flex: 1;
  gap: 10px;
  color: #94a3b8;
  font-size: 12px;
}

.leaderboard-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: lbSpin 0.8s linear infinite;
}

@keyframes lbSpin {
  to { transform: rotate(360deg); }
}

.empty-icon, .offline-icon {
  font-size: 36px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.empty-title, .offline-title {
  font-size: 15px;
  font-weight: 800;
  color: #f1f5f9;
}

.empty-sub, .offline-sub {
  font-size: 11px;
  max-width: 340px;
  line-height: 1.5;
  color: #94a3b8;
}

/* 7. Leaderboard Table */
.leaderboard-table-header {
  display: grid;
  grid-template-columns: 56px 1fr 64px 90px;
  align-items: center;
  padding: 8px 14px;
  background: rgba(30, 41, 59, 0.95);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #f59e0b #0f172a;
}

.leaderboard-table-scroll::-webkit-scrollbar {
  width: 6px;
}

.leaderboard-table-scroll::-webkit-scrollbar-thumb {
  background: #f59e0b;
  border-radius: 3px;
}

.leaderboard-entry-row {
  display: grid;
  grid-template-columns: 56px 1fr 64px 90px;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease;
}

.leaderboard-entry-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Podium Rows */
.leaderboard-entry-row.rank-1 {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.15) 0%, rgba(250, 204, 21, 0.02) 100%);
  border-left: 3px solid #facc15;
}

.leaderboard-entry-row.rank-2 {
  background: linear-gradient(90deg, rgba(203, 213, 225, 0.12) 0%, rgba(203, 213, 225, 0.02) 100%);
  border-left: 3px solid #cbd5e1;
}

.leaderboard-entry-row.rank-3 {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.12) 0%, rgba(217, 119, 6, 0.02) 100%);
  border-left: 3px solid #d97706;
}

/* Current Player Row */
.leaderboard-entry-row.current-player-row {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22) 0%, rgba(6, 95, 70, 0.15) 100%) !important;
  border: 1px solid #10b981;
  border-radius: 6px;
  margin: 2px 4px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3) inset;
}

.lb-col-rank {
  font-size: 13px;
  font-weight: 800;
  color: #cbd5e1;
}

.leaderboard-entry-row.rank-1 .lb-col-rank { color: #facc15; font-size: 14px; }
.leaderboard-entry-row.rank-2 .lb-col-rank { color: #e2e8f0; font-size: 14px; }
.leaderboard-entry-row.rank-3 .lb-col-rank { color: #fbbf24; font-size: 14px; }

.lb-col-explorer {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.lb-avatar-mini {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.lb-avatar-mini svg {
  width: 22px;
  height: 22px;
}

.lb-explorer-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.lb-username {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-you-tag {
  background: #10b981;
  color: #064e3b;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.lb-col-stars {
  font-size: 11px;
}

.lb-star-achieved {
  color: #facc15;
  text-shadow: 0 0 4px rgba(250, 204, 21, 0.6);
}

.lb-star-dim {
  color: #475569;
}

.lb-col-score {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  text-align: right;
  white-space: nowrap;
}

.lb-pts-label {
  font-size: 9px;
  font-weight: 600;
  color: #94a3b8;
}

/* 8. Leaderboard Player Standing Footer Bar */
.leaderboard-player-footer {
  width: 100%;
  margin-bottom: 8px;
}

.player-standing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: 8px;
  box-sizing: border-box;
}

.player-standing-bar.ranked {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.player-standing-bar.unranked,
.player-standing-bar.offline {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.player-standing-bar.guest {
  background: rgba(30, 41, 59, 0.9);
  border: 1px dashed rgba(245, 158, 11, 0.5);
}

.standing-rank-badge {
  font-size: 14px;
  font-weight: 900;
  color: #facc15;
  min-width: 50px;
}

.standing-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.standing-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f59e0b;
}

.standing-avatar-mini svg {
  width: 24px;
  height: 24px;
}

.standing-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.standing-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #94a3b8;
  text-transform: uppercase;
}

.standing-username {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
}

.standing-stars {
  font-size: 12px;
  margin: 0 10px;
}

.standing-score {
  font-size: 14px;
  font-weight: 800;
  color: #facc15;
}

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

.guest-info {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.guest-text {
  display: flex;
  flex-direction: column;
}

.guest-title {
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
}

.guest-desc {
  font-size: 10px;
  color: #94a3b8;
  max-width: 320px;
}

/* ============================================================
   STAGE 9: ANCIENT GUARDIAN BOSS HUD
   ============================================================ */
.guardian-boss-bar-card {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid #f59e0b;
  border-radius: 8px;
  padding: 6px 8px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3), inset 0 0 8px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
}

.guardian-boss-bar-card.taking-damage {
  animation: bossDamagePulse 0.45s ease-out;
}

@keyframes bossDamagePulse {
  0% { transform: scale(1); filter: brightness(1); }
  25% { transform: scale(1.03) translateX(-3px); filter: brightness(1.7) drop-shadow(0 0 12px #ef4444); background: rgba(239, 68, 68, 0.4); }
  50% { transform: scale(0.98) translateX(3px); filter: brightness(1.4); }
  75% { transform: scale(1.01) translateX(-1px); }
  100% { transform: scale(1); filter: brightness(1); }
}

.guardian-boss-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.guardian-boss-identity {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guardian-boss-avatar {
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.8));
}

.guardian-boss-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.guardian-boss-name {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.guardian-boss-subtitle {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #94a3b8;
  text-transform: uppercase;
}

.guardian-boss-hp-badge {
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 7px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-family: monospace;
}

.guardian-boss-hp-track {
  width: 100%;
  height: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.7);
}

.guardian-boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
  border-radius: 5px;
  transition: width 0.35s ease-out;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.guardian-boss-hp-fill.critical {
  background: linear-gradient(90deg, #991b1b 0%, #ef4444 100%);
  animation: criticalPulse 1s infinite alternate;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
}

@keyframes criticalPulse {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.5); }
}

/* ============================================================
   STAGE 9: POST-CAMPAIGN BONUS CARDS (ENDLESS & TIMED)
   ============================================================ */
.level-node-card.post-campaign-card {
  border: 2px solid #a855f7;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.85) 0%, rgba(59, 7, 100, 0.85) 100%);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.35);
}

.level-node-card.post-campaign-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #c084fc;
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.6);
}

.level-node-card.post-campaign-card.endless {
  border-color: #3b82f6;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 58, 138, 0.85) 100%);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35);
}

.level-node-card.post-campaign-card.endless:hover {
  border-color: #60a5fa;
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.6);
}

.level-node-card.post-campaign-card.timed {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.85) 0%, rgba(120, 53, 15, 0.85) 100%);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.level-node-card.post-campaign-card.timed:hover {
  border-color: #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
}

.post-campaign-pill {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.6);
  color: #e9d5ff;
  text-transform: uppercase;
}

.node-diff.bonus {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

/* ============================================================
   STAGE 9: FINAL ENDING CELEBRATION MODAL
   ============================================================ */
.ending-celebration-overlay {
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(10px);
}

.ending-celebration-content {
  border: 2px solid #fbbf24;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.4), inset 0 0 20px rgba(245, 158, 11, 0.2);
  max-width: 480px;
}

.celebration-icon {
  font-size: 38px;
  margin-bottom: 6px;
  animation: floatBounce 2s infinite ease-in-out;
}

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

.celebration-lore-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #f1f5f9;
}

.post-campaign-unlock-announcement {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.4) 0%, rgba(30, 27, 75, 0.6) 100%);
  border: 1.5px solid #a855f7;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0 16px 0;
  text-align: center;
}

.unlock-banner-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #d8b4fe;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.unlock-banner-modes {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.unlock-mode-pill {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #c084fc;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.3);
}

.unlock-banner-sub {
  font-size: 10px;
  color: #cbd5e1;
  margin: 0;
  font-style: italic;
}

/* ============================================================
   STAGE 9: COMIC STORY VIEWER MODAL
   ============================================================ */
.story-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.story-modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.35), inset 0 0 16px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.story-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

.story-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-mode-pill {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  background: #f59e0b;
  color: #0f172a;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.story-progress-counter {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  font-family: monospace;
}

.story-skip-btn {
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.story-skip-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  transform: translateX(2px);
}

.story-image-viewport {
  width: 100%;
  height: 320px;
  max-height: 48vh;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.story-slide-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.story-fallback-card {
  width: 90%;
  height: 85%;
  background: linear-gradient(135deg, #1e1b4b 0%, #311042 50%, #1e293b 100%);
  border: 2px dashed rgba(245, 158, 11, 0.5);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.story-fallback-glyph {
  font-size: 42px;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
}

.story-fallback-badge {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.8px;
  text-align: center;
}

.story-fallback-lore {
  font-size: 10px;
  color: #94a3b8;
  font-style: italic;
  letter-spacing: 0.5px;
}

.story-narration-section {
  padding: 14px 18px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-slide-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.5px;
  text-align: left;
}

.story-narration-box {
  background: rgba(15, 23, 42, 0.8);
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  padding: 10px 12px;
}

.story-narration-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #f8fafc;
  font-style: normal;
  text-align: left;
}

.story-dots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 0 10px 0;
}

.story-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.story-dot:hover {
  background: rgba(251, 191, 36, 0.6);
  transform: scale(1.2);
}

.story-dot.active {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  transform: scale(1.3);
}

.story-dot.passed {
  background: rgba(251, 191, 36, 0.4);
}

.story-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 14px 18px;
  background: rgba(15, 23, 42, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.story-nav-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(51, 65, 85, 0.6);
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s ease;
}

.story-nav-btn:hover:not(:disabled) {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
}

.story-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.story-nav-btn.primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #fbbf24;
  color: #0f172a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.story-nav-btn.primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.7);
}

/* Mobile responsive adjustments for story modal */
@media (max-width: 600px) {
  .story-modal-card {
    max-height: 96vh;
    border-radius: 8px;
  }
  .story-image-viewport {
    height: 200px;
  }
  .story-narration-text {
    font-size: 12px;
  }
  .story-nav-btn {
    padding: 6px 12px;
    font-size: 11px;
  }
}


/* ============================================================
   How to Play Guide Modal Styles
   ============================================================ */
.how-to-play-overlay {
  z-index: 9999;
}

.how-to-play-content {
  max-width: 940px;
  width: 94vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 20px 24px;
  box-sizing: border-box;
  text-align: left;
  gap: 10px;
}

.how-to-play-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 10px;
}

.how-to-play-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.how-to-play-top-actions .modal-btn {
  flex: 0 0 auto;
  height: 34px;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-sizing: border-box;
}

.how-to-play-title-group h2 {
  font-size: 22px;
  color: #f59e0b;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: 'Cinzel', serif;
}

.how-to-play-subtitle {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 1px;
}

.how-to-play-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  flex-shrink: 0;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.how-to-play-tab {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cbd5e1;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  box-sizing: border-box;
}

.how-to-play-tab:hover {
  color: #ffffff;
  border-color: #f59e0b;
  background: rgba(51, 65, 85, 0.9);
}

.how-to-play-tab.active {
  background: #f59e0b;
  color: #0f172a;
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

.how-to-play-scroll {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 8px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.how-to-play-footer {
  width: 100%;
  flex-shrink: 0;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: center;
}

.how-to-play-footer .modal-btn {
  max-width: 280px;
  width: 100%;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
  gap: 16px;
  padding-right: 6px;
  text-align: left;
}

.guide-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.guide-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.guide-badge {
  background: #f59e0b;
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.guide-title {
  font-size: 14px;
  font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.5px;
}

.guide-lead-text, .guide-text {
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  margin-bottom: 10px;
}

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

.guide-subcard {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
}

.guide-subcard-title {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 8px;
}

.guide-bullet-list {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.6;
  color: #cbd5e1;
}

.tut-swap-diagram {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}

.tut-gem-slot {
  width: 44px;
  height: 44px;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tut-gem-slot.highlight-slot {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.tut-gem-slot.target-slot {
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.swap-arrow {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #fbbf24;
  font-weight: bold;
}

.tut-diagram-caption {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  margin-top: 14px;
}

.guide-gems-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.guide-gem-tile-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.guide-gem-icon {
  width: 44px;
  height: 44px;
}

.guide-gem-name {
  font-size: 12px;
  font-weight: 700;
}

.guide-gem-shape {
  font-size: 9px;
  color: #94a3b8;
}

.guide-gem-pts {
  font-size: 10px;
  color: #fbbf24;
  font-weight: 600;
}

.special-gems-showcase {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.special-gem-detail-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
}

.special-card-main {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

.special-card-art {
  min-width: 90px;
  text-align: center;
}

.special-gem-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
  display: inline-block;
  letter-spacing: 0.5px;
}

.special-card-info {
  flex: 1;
}

.special-card-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.special-card-recipe {
  font-size: 12px;
  color: #e2e8f0;
  margin-bottom: 3px;
}

.special-card-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 4px;
}

.special-card-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
  flex-wrap: wrap;
}

.special-card-effect-preview {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-label {
  color: #94a3b8;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
}

.mini-laser-preview {
  font-family: monospace;
  font-size: 11px;
  color: #38bdf8;
  font-weight: bold;
}

.mini-blast-preview {
  display: grid;
  grid-template-columns: repeat(3, 18px);
  gap: 2px;
  align-items: center;
}

.blast-cell {
  font-size: 11px;
  line-height: 1;
  text-align: center;
}

.blast-core {
  filter: drop-shadow(0 0 4px #f59e0b);
}

.mini-prism-preview {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #f472b6;
  font-weight: 700;
  font-size: 11px;
}

.combos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.combo-box {
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
}

.combo-formula-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
}

.combo-gem-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
}

.combo-gem-icon svg {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  display: block;
}

.combo-effect-line {
  font-size: 11px;
  line-height: 1.45;
  color: #cbd5e1;
}

.objectives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.obj-card {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
}

.obj-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}

.obj-card-desc {
  font-size: 11px;
  line-height: 1.45;
  color: #cbd5e1;
}

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

.special-level-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
}

.special-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 4px;
}

.special-level-num {
  font-size: 10px;
  font-weight: 800;
  background: #ef4444;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
}

.special-level-name {
  font-size: 12px;
  font-weight: 700;
  color: #fca5a5;
}

.special-level-body {
  font-size: 11px;
  line-height: 1.5;
  color: #e2e8f0;
}

.guide-scoring-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}

.scoring-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scoring-term {
  font-weight: 700;
  color: #fbbf24;
}

.scoring-val {
  color: #e2e8f0;
}

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

.mode-info-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
}

.mode-info-title {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}

.mode-info-desc {
  font-size: 11px;
  line-height: 1.45;
  color: #cbd5e1;
}

/* ============================================================
   Credits Modal Styles
   ============================================================ */
.credits-modal-overlay {
  z-index: 9999;
}

.credits-modal-content {
  max-width: 780px;
  width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
}

.credits-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 8px;
}

.credits-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.credits-title-group h2 {
  font-size: 22px;
  color: #f59e0b;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-family: 'Cinzel', serif;
}

.credits-subtitle {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 1px;
}

.credits-scroll {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
  text-align: left;
}

.credits-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.credits-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.credits-badge {
  background: #f59e0b;
  color: #0f172a;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.credits-heading {
  font-size: 14px;
  font-weight: 800;
  color: #f1f5f9;
}

.credits-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.credits-info-item {
  background: rgba(30, 41, 59, 0.6);
  padding: 8px 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.credits-info-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}

.credits-info-val {
  font-size: 12px;
  color: #f1f5f9;
  font-weight: 600;
}

.credits-dev-profile {
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 14px 16px;
}

.credits-dev-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
  border: 2px solid #fbbf24;
  flex-shrink: 0;
}

.credits-avatar-icon {
  font-size: 28px;
}

.credits-dev-name {
  font-size: 16px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 2px;
}

.credits-dev-nrp {
  font-size: 13px;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.credits-dev-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #94a3b8;
}

.credits-section-item {
  background: rgba(30, 41, 59, 0.55);
  border-left: 3px solid #f59e0b;
  border-radius: 0 6px 6px 0;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.credits-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}

.credits-item-text {
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
}

@media (max-width: 768px) {
  .how-to-play-content, .credits-modal-content {
    padding: 14px 12px;
    max-height: 94vh;
  }
  .guide-gems-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .combos-grid, .guide-columns-2, .credits-grid-2 {
    grid-template-columns: 1fr;
  }
  .special-levels-grid, .modes-grid {
    grid-template-columns: 1fr;
  }
  .credits-dev-profile {
    flex-direction: column;
    text-align: center;
  }
}

/* ============================================================
   Special Gem Combination Visual Animations (Stage 9 / Final Update)
   ============================================================ */
.grid-tile.transforming-gem {
  animation: transformFlash 0.35s ease-out forwards;
}

@keyframes transformFlash {
  0% { transform: scale(0.6) rotate(-15deg); filter: brightness(2) drop-shadow(0 0 12px #ffffff); }
  50% { transform: scale(1.25) rotate(5deg); filter: brightness(1.7) drop-shadow(0 0 16px #ffd700); }
  100% { transform: scale(1); filter: brightness(1); }
}

.grid.rainbow-energy-wave {
  animation: rainbowBoardShockwave 0.6s ease-out;
}

@keyframes rainbowBoardShockwave {
  0% { box-shadow: inset 0 0 50px rgba(255, 255, 255, 0.9), 0 0 40px #ff007f; }
  33% { box-shadow: inset 0 0 70px rgba(0, 229, 255, 0.8), 0 0 60px #00e5ff; }
  66% { box-shadow: inset 0 0 70px rgba(255, 215, 0, 0.8), 0 0 60px #ffd700; }
  100% { box-shadow: none; }
}

/* ============================================================
   Interactive How to Play Tutorial Modal (First-Time Level 1 Flow)
   ============================================================ */
.tutorial-modal-overlay {
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
}

.tutorial-modal-content {
  max-width: 580px;
  width: 92%;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.35), 0 20px 40px rgba(0, 0, 0, 0.8);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  box-sizing: border-box;
  text-align: left;
}

.tutorial-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  padding-bottom: 10px;
}

.tutorial-header-group {
  flex: 1;
}

.tutorial-header-group h3 {
  font-size: 18px;
  font-weight: 800;
  color: #fbbf24;
  margin: 0 0 2px 0;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.tutorial-step-tag {
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

#btnTutorialSkipTop {
  flex: 0 0 auto;
  margin-left: 12px;
  height: 32px;
  padding: 4px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tutorial-stepper-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.tut-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.5);
  transition: all 0.25s ease;
}

.tut-dot.active {
  background: #f59e0b;
  border-color: #ffd700;
  box-shadow: 0 0 8px #ffd700;
  transform: scale(1.2);
}

.tut-dot.done {
  background: #10b981;
  border-color: #34d399;
}

.tutorial-card-body {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.tutorial-step-title {
  font-size: 15px;
  font-weight: 800;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.tutorial-step-desc {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 12px;
}

.tutorial-step-visual {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
}

.tut-visual-grid {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.tut-tile {
  width: 48px;
  height: 48px;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.tut-tile.tut-swap-a {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.tut-tile.tut-swap-b {
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.tut-tile.tut-highlight {
  border-color: #ffd700;
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  animation: tutPulse 1.2s infinite alternate;
}

.tut-hint {
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
  margin-top: 8px;
  text-align: center;
}

.tut-cascade-diagram {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  width: 100%;
}

.tut-step-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

.tut-combo-box {
  border-color: #10b981;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
}

.tut-arrow-down {
  font-size: 10px;
  color: #94a3b8;
}

.tut-hud-preview {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.tut-hud-chip {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tut-chip-label {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 700;
}

.tut-chip-val {
  font-size: 15px;
  font-weight: 900;
}

.tut-special-preview {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.tut-spec-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
  text-align: center;
}

.tut-spec-name {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 4px;
}

.tut-spec-text {
  font-size: 9px;
  color: #38bdf8;
}

.tut-grid-3x3-blast {
  display: grid;
  grid-template-columns: repeat(3, 20px);
  gap: 2px;
  background: rgba(15, 23, 42, 0.9);
  padding: 4px;
  border-radius: 6px;
  border: 1px solid #f59e0b;
}

.blast-cell {
  font-size: 11px;
  text-align: center;
}

.blast-cell.core {
  transform: scale(1.2);
}

.tut-briefing-card {
  width: 100%;
  text-align: left;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  padding: 8px 12px;
}

.tut-briefing-title {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 4px;
}

.tut-briefing-item {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
}

.tutorial-button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 14px;
  gap: 12px;
  box-sizing: border-box;
}

#btnTutorialSkipBottom {
  flex: 0 0 auto;
  min-width: 120px;
  height: 38px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tutorial-nav-group {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.tutorial-nav-group .modal-btn {
  flex: 0 0 auto;
  min-width: 100px;
  height: 38px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
}

@keyframes tutPulse {
  0% { transform: scale(0.97); }
  100% { transform: scale(1.05); }
}
