/* ======================
   RPG CARD TU TIÊN NÂNG CẤP
========================== */
.rpg-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(13,22,42,0.96), rgba(8,13,26,0.98)),
    radial-gradient(circle at 0% 0%, rgba(251,191,36,0.12) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(56,189,248,0.10) 0%, transparent 70%);
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(251,191,36,0.55);
  box-shadow: 0 0 0 1.5px rgba(251,191,36,0.18), 0 8px 32px rgba(0,0,0,0.32);
  position: relative;
}
.rpg-card::before, .rpg-card::after {
  content: '';
  position: absolute;
  width: 38px; height: 38px;
  background: url('images/rpg-corner-gold.svg') no-repeat center/contain;
  z-index: 2;
}
.rpg-card::before {
  top: -2px; left: -2px;
}
.rpg-card::after {
  bottom: -2px; right: -2px;
  transform: rotate(180deg);
}
.rpg-card {
  box-shadow: 0 0 0 1.5px rgba(251,191,36,0.18), 0 8px 32px rgba(0,0,0,0.32),
    0 0 0 1px rgba(56,189,248,0.25) inset;
}
.rpg-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 2rem 1.2rem 2rem;
}
.rpg-avatar {
  border-radius: 50%;
  border: 2.5px solid #fbbf24;
  box-shadow: 0 0 18px rgba(251,191,36,0.35), 0 0 0 4px rgba(56,189,248,0.18) inset;
  width: 110px; height: 110px;
  object-fit: cover;
  position: relative;
  background: #222;
}
.rpg-avatar-lv {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -18px;
  background: linear-gradient(90deg,#fbbf24,#f59e0b 80%);
  color: #3a2500;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 2px 18px 2px 18px;
  border-radius: 999px;
  border: 2px solid #fbbf24;
  box-shadow: 0 2px 12px rgba(251,191,36,0.22);
  letter-spacing: 0.04em;
  z-index: 3;
}
.rpg-header-content {
  flex: 1;
  min-width: 0;
}
.rpg-header-content > * {
  width: 100%;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}
.rpg-fate-badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.98rem;
  color: #fbbf24;
  background: rgba(251,191,36,0.08);
  border-radius: 8px;
  padding: 2px 12px;
  border: 1px solid rgba(251,191,36,0.22);
  font-weight: 600;
}
@media (max-width: 768px) {
  .rpg-card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .rpg-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.7rem;
    padding: 1.2rem 0.7rem 1.2rem 0.7rem;
  }
  .rpg-header-content > * {
    width: 100%;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
  }
}
/* LINH CĂN BAR */
.rpg-mainstat-bar {
  width: 100%;
  height: 18px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  position: relative;
  margin-top: 0.3rem;
  margin-bottom: 0.3rem;
}
.rpg-mainstat-bar-inner {
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(90deg, #06b6d4, #10b981, #fbbf24);
  box-shadow: 0 0 16px 2px rgba(251,191,36,0.18) inset;
  position: relative;
  transition: width 0.7s cubic-bezier(0.4,1,0.3,1);
  animation: bar-glow-move 2.5s linear infinite;
}
@keyframes bar-glow-move {
  0% { box-shadow: 0 0 16px 2px #06b6d4 inset; }
  50% { box-shadow: 0 0 24px 6px #fbbf24 inset; }
  100% { box-shadow: 0 0 16px 2px #10b981 inset; }
}
.rpg-mainstat-bar-dot {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  background: radial-gradient(circle, #fbbf24 60%, #fffbe6 100%);
  border-radius: 50%;
  box-shadow: 0 0 12px 2px #fbbf24;
  border: 2px solid #fbbf24;
  z-index: 2;
}
.rpg-mainstat-badge {
  display: inline-block;
  margin-left: 0.7rem;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 8px;
  border: 1.5px solid;
  vertical-align: middle;
}
.rpg-mainstat-badge.cuc-pham {
  color: #fbbf24;
  border-color: #fbbf24;
  background: rgba(251,191,36,0.08);
  box-shadow: 0 0 8px 1px #fbbf24;
}
.rpg-mainstat-badge.thuong-pham {
  color: #7c3aed;
  border-color: #38bdf8;
  background: rgba(139,92,246,0.08);
}
.rpg-mainstat-badge.tiem-nang {
  color: #10b981;
  border-color: #10b981;
  background: rgba(16,185,129,0.08);
}
/* THIÊN PHÚ & HUYẾT MẠCH PHỤ */
.rpg-substats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) {
  .rpg-substats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.7rem;
  }
}
.rpg-substat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(251,191,36,0.22);
  border-radius: 12px;
  padding: 10px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.rpg-substat-flames {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}
.rpg-flame {
  font-size: 1.25rem;
  margin-right: 2px;
  transition: filter 0.2s, opacity 0.2s;
}
.rpg-flame.active {
  filter: drop-shadow(0 0 6px rgba(251,146,60,0.85));
  opacity: 1;
}
.rpg-flame.inactive {
  opacity: 0.2;
  filter: grayscale(1);
}
.rpg-substat-tier {
  position: absolute;
  bottom: 7px;
  right: 10px;
  font-size: 0.78rem;
  color: #fbbf24;
  background: rgba(251,191,36,0.08);
  border-radius: 8px;
  padding: 1px 8px;
  border: 1px solid rgba(251,191,36,0.18);
  font-weight: 600;
}
/* ========================================================
   LỊCH SỬ TIẾN HÓA CỦA HẢI THÀNH (2007 - 2026)
   Senior Frontend UI/UX Design System - Multi-Theme System
   ======================================================== */

:root {
  /* Typography & Core Metrics */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container-max: 1240px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --glass-blur: blur(16px);
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --theme-transition: background-color 0.35s ease, background 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;

  /* ========================================================
     FALLBACK PALETTE: ĐÊM OBSIDIAN
     Nền tối dự phòng cho trang chưa chọn theme
     ======================================================== */
  --color-scheme: dark;
  --bg-deep: #0a0d14;
  --bg-surface: #111827;
  --bg-card: rgba(18, 24, 38, 0.78);
  --bg-card-hover: rgba(28, 38, 58, 0.88);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-border-glow: rgba(245, 158, 11, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #f3c363;

  /* Accent Gradients */
  --primary-gold: #f59e0b;
  --primary-gold-light: #fbbf24;
  --primary-amber: #d97706;
  --primary-accent: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --cyan-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  --emerald-gradient: linear-gradient(135deg, #34d399 0%, #059669 100%);
  --violet-gradient: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);

  /* Vintage Paper Colors (For Quote Cards) */
  --paper-bg: #fdfbf7;
  --paper-bg-dark: #f5efe4;
  --paper-text: #292524;
  --paper-subtext: #57534e;
  --paper-border: #e7dfd3;

  /* Navigation & Structural Surfaces */
  --nav-bg: rgba(10, 13, 20, 0.88);
  --filter-bg: rgba(10, 13, 20, 0.92);
  --modal-bg: #0d121f;
  --footer-bg: #080b12;
  --ticket-station-bg: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.08) 0%, rgba(10, 14, 23, 0.98) 70%);

  /* Ambient Lights & Highlights */
  --glow-color-1: rgba(245, 158, 11, 0.2);
  --glow-color-2: rgba(56, 189, 248, 0.15);
  --glow-color-3: rgba(139, 92, 246, 0.15);
  --glass-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --glow-gold: 0 0 35px rgba(245, 158, 11, 0.25);
  --input-bg: rgba(10, 14, 23, 0.85);
  --chip-bg: rgba(255, 255, 255, 0.03);
  --chip-bg-hover: rgba(245, 158, 11, 0.08);
}

/* Explicit Obsidian theme */
html[data-theme="obsidian"] {
  --color-scheme: dark;
  --bg-deep: #0a0d14;
  --bg-surface: #111827;
  --bg-card: rgba(18, 24, 38, 0.78);
  --bg-card-hover: rgba(28, 38, 58, 0.88);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-border-glow: rgba(245, 158, 11, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #f3c363;

  --primary-gold: #f59e0b;
  --primary-gold-light: #fbbf24;
  --primary-amber: #d97706;
  --primary-accent: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --cyan-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);

  --nav-bg: rgba(10, 13, 20, 0.88);
  --filter-bg: rgba(10, 13, 20, 0.92);
  --modal-bg: #0d121f;
  --footer-bg: #080b12;
  --ticket-station-bg: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.08) 0%, rgba(10, 14, 23, 0.98) 70%);

  --glow-color-1: rgba(245, 158, 11, 0.2);
  --glow-color-2: rgba(56, 189, 248, 0.15);
  --glow-color-3: rgba(139, 92, 246, 0.15);
  --glass-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --glow-gold: 0 0 35px rgba(245, 158, 11, 0.25);
  --input-bg: rgba(10, 14, 23, 0.85);
  --chip-bg: rgba(255, 255, 255, 0.03);
  --chip-bg-hover: rgba(245, 158, 11, 0.08);
}

/* ========================================================
   THEME 2: GIẤY CŨ HOÀI NIỆM (VINTAGE SEPIA)
   Nền kem ấm cổ điển kiểu nhật ký xưa, chữ nâu trầm
   ======================================================== */
html[data-theme="sepia"] {
  --color-scheme: light;
  --bg-deep: #f3ebe0;
  --bg-surface: #eae0d0;
  --bg-card: rgba(255, 252, 247, 0.94);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-card-border: rgba(180, 83, 9, 0.22);
  --bg-card-border-glow: rgba(217, 119, 6, 0.45);

  --text-primary: #292524;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  --text-gold: #b45309;

  --primary-gold: #d97706;
  --primary-gold-light: #f59e0b;
  --primary-amber: #b45309;
  --primary-accent: #b45309;
  --gold-gradient: linear-gradient(135deg, #b45309 0%, #92400e 50%, #78350f 100%);
  --cyan-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);

  --nav-bg: rgba(243, 235, 224, 0.95);
  --filter-bg: rgba(243, 235, 224, 0.96);
  --modal-bg: #faf5ee;
  --footer-bg: #eae0d0;
  --ticket-station-bg: radial-gradient(circle at 50% 20%, rgba(217, 119, 6, 0.12) 0%, rgba(243, 235, 224, 0.98) 70%);

  --glow-color-1: rgba(217, 119, 6, 0.18);
  --glow-color-2: rgba(180, 83, 9, 0.14);
  --glow-color-3: rgba(146, 64, 14, 0.12);
  --glass-shadow: 0 15px 35px -10px rgba(120, 53, 15, 0.18);
  --glow-gold: 0 0 35px rgba(217, 119, 6, 0.22);
  --input-bg: rgba(255, 255, 255, 0.95);
  --chip-bg: rgba(180, 83, 9, 0.06);
  --chip-bg-hover: rgba(180, 83, 9, 0.12);
}

/* ========================================================
   THEME 3: XANH ĐÊM VŨ TRỤ (MIDNIGHT BLUE)
   Nền xanh navy sâu thẳm kết hợp ánh xanh cyan hiện đại
   ======================================================== */
html[data-theme="midnight"] {
  --color-scheme: dark;
  --bg-deep: #060b18;
  --bg-surface: #0a1329;
  --bg-card: rgba(13, 23, 48, 0.84);
  --bg-card-hover: rgba(20, 36, 74, 0.92);
  --bg-card-border: rgba(56, 189, 248, 0.2);
  --bg-card-border-glow: rgba(56, 189, 248, 0.5);

  --text-primary: #f0f9ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #38bdf8;

  --primary-gold: #0ea5e9;
  --primary-gold-light: #38bdf8;
  --primary-amber: #0284c7;
  --primary-accent: #38bdf8;
  --gold-gradient: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 50%, #0284c7 100%);
  --cyan-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);

  --nav-bg: rgba(6, 11, 24, 0.9);
  --filter-bg: rgba(6, 11, 24, 0.94);
  --modal-bg: #091226;
  --footer-bg: #040812;
  --ticket-station-bg: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.12) 0%, rgba(6, 11, 24, 0.98) 70%);

  --glow-color-1: rgba(56, 189, 248, 0.24);
  --glow-color-2: rgba(99, 102, 241, 0.2);
  --glow-color-3: rgba(14, 165, 233, 0.2);
  --glass-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.75);
  --glow-gold: 0 0 35px rgba(56, 189, 248, 0.3);
  --input-bg: rgba(8, 16, 36, 0.9);
  --chip-bg: rgba(56, 189, 248, 0.05);
  --chip-bg-hover: rgba(56, 189, 248, 0.14);
}

/* ========================================================
   THEME 4: SÁNG TỐI GIẢN (CLEAN DAYLIGHT)
   Nền trắng ngà nhẹ nhàng, dễ đọc ban ngày
   ======================================================== */
html[data-theme="daylight"] {
  --color-scheme: light;
  --bg-deep: #f8fafc;
  --bg-surface: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #ffffff;
  --bg-card-border: rgba(203, 213, 225, 0.9);
  --bg-card-border-glow: rgba(245, 158, 11, 0.45);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-gold: #d97706;

  --primary-gold: #f59e0b;
  --primary-gold-light: #fbbf24;
  --primary-amber: #d97706;
  --primary-accent: #f59e0b;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  --cyan-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);

  --nav-bg: rgba(248, 250, 252, 0.95);
  --filter-bg: rgba(248, 250, 252, 0.96);
  --modal-bg: #ffffff;
  --footer-bg: #f1f5f9;
  --ticket-station-bg: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.08) 0%, rgba(248, 250, 252, 0.98) 70%);

  --glow-color-1: rgba(245, 158, 11, 0.14);
  --glow-color-2: rgba(56, 189, 248, 0.12);
  --glow-color-3: rgba(14, 165, 233, 0.1);
  --glass-shadow: 0 15px 35px -10px rgba(15, 23, 42, 0.12);
  --glow-gold: 0 0 30px rgba(245, 158, 11, 0.2);
  --input-bg: rgba(255, 255, 255, 0.95);
  --chip-bg: rgba(15, 23, 42, 0.04);
  --chip-bg-hover: rgba(245, 158, 11, 0.1);
}

html[data-theme="xianxia"] {
  color-scheme: dark;
  --color-scheme: dark;
  --bg-deep: #040d0b;
  --bg-surface: #081412;
  --bg-card: rgba(8, 24, 21, 0.88);
  --bg-card-hover: rgba(12, 38, 32, 0.94);
  --bg-card-border: rgba(45, 212, 191, 0.2);
  --bg-card-border-glow: rgba(245, 158, 11, 0.42);
  --text-primary: #f0fdf7;
  --text-secondary: #a7c7ba;
  --text-muted: #729287;
  --text-gold: #fcd98a;
  --primary-gold: #f59e0b;
  --primary-gold-light: #fbbf24;
  --primary-amber: #b7791f;
  --primary-accent: #2dd4bf;
  --gold-gradient: linear-gradient(120deg, #10b981 0%, #2dd4bf 48%, #f59e0b 100%);
  --cyan-gradient: linear-gradient(135deg, #2dd4bf 0%, #0f766e 100%);
  --emerald-gradient: linear-gradient(135deg, #34d399 0%, #047857 100%);
  --violet-gradient: linear-gradient(135deg, #c4b5fd 0%, #7c3aed 100%);
  --nav-bg: rgba(4, 13, 11, 0.92);
  --filter-bg: rgba(4, 13, 11, 0.96);
  --modal-bg: #071411;
  --footer-bg: #030907;
  --ticket-station-bg: radial-gradient(circle at 50% 20%, rgba(45, 212, 191, 0.1), rgba(4, 13, 11, 0.98) 72%);
  --glow-color-1: rgba(245, 158, 11, 0.16);
  --glow-color-2: rgba(45, 212, 191, 0.16);
  --glow-color-3: rgba(16, 185, 129, 0.12);
  --glass-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.72);
  --glow-gold: 0 0 35px rgba(245, 158, 11, 0.22);
  --input-bg: rgba(4, 13, 11, 0.9);
  --chip-bg: rgba(45, 212, 191, 0.04);
  --chip-bg-hover: rgba(245, 158, 11, 0.1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  color-scheme: var(--color-scheme, dark);
  transition: var(--theme-transition);
}

body.museum-body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: var(--theme-transition);
}

html[data-theme="xianxia"] body.museum-body {
  background: linear-gradient(160deg, #040d0b 0%, #06100e 48%, #081412 100%);
}

/* Smooth Theme Transitions on Major Components */
.sticky-nav,
.global-filter-section,
.filter-tabs,
.memory-card,
.rpg-card,
.retro-player-card,
.hero-chip-card,
.ticket-form-card,
.floating-bg-player,
.museum-footer,
.filmstrip-dialog,
.modal-dialog {
  transition: var(--theme-transition);
}

/* Ambient Background Lights */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  transition: background 0.6s ease;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--glow-color-1) 0%, transparent 70%);
  top: -100px;
  left: -150px;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--glow-color-2) 0%, transparent 70%);
  top: 40%;
  right: -200px;
}

.glow-3 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--glow-color-3) 0%, transparent 70%);
  bottom: 10%;
  left: 20%;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 9999px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #1a0f00;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
  filter: brightness(1.08);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--bg-card-border);
  backdrop-filter: var(--glass-blur);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ========================================================
   STICKY TOP NAVIGATION
   ======================================================== */
.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-card-border);
  transition: var(--transition);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 8px;
  border: 1.5px solid var(--accent-color, #fbbf24);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
  flex-shrink: 0;
  cursor: pointer;
  pointer-events: auto;
}

.nav-brand .brand-title {
  cursor: pointer;
  pointer-events: auto;
}

.nav-chapters {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.2rem 0;
}

.nav-chapters::-webkit-scrollbar {
  display: none;
}

.nav-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: var(--transition);
}

.nav-chip:hover,
.nav-chip.active {
  color: var(--text-gold);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.nav-btn.playing {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
}

.scroll-progress-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--gold-gradient);
  transition: width 0.1s linear;
}

/* ========================================================
   HERO SECTION: SẢNH CHÍNH
   ======================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 7rem 1.5rem 4rem;
  z-index: 1;
}

.hero-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  align-self: flex-start;
  backdrop-filter: blur(8px);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-gold);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary-gold);
  animation: pulse 2s infinite;
}

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

.badge-text {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-gold);
}

.hero-main-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-title {
  font-size: clamp(2.4rem, 4.8vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

.text-gradient {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-intro {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin-bottom: 2rem;
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 2.75rem;
  flex-wrap: wrap;
}

.cta-btn .btn-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.cta-btn:hover .btn-arrow {
  transform: translateY(4px);
}

/* Stats Bar */
.hero-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-gold);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* 3D Flip Card for Genesis Image */
.hero-visual-col {
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.genesis-card-wrapper {
  width: 100%;
  max-width: 420px;
}

.genesis-flip-card {
  width: 100%;
  height: auto;
  position: relative;
  perspective: 1200px;
  -webkit-perspective: 1200px;
  cursor: pointer;
  border-radius: var(--radius-xl);
}

.hero-flip-inner {
  position: relative;
  width: 100%;
  height: auto;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.genesis-flip-card.flipped .hero-flip-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* Front Face */
.card-front {
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: var(--glass-shadow), var(--glow-gold);
  display: flex;
  flex-direction: column;
}

.card-frame {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1rem;
}

.card-photo-box {
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: #111;
}

.card-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.genesis-flip-card:hover .card-photo-box img {
  transform: scale(1.05);
}

.genesis-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
}

.genesis-tag {
  background: rgba(10, 13, 20, 0.75);
  backdrop-filter: blur(10px);
  color: var(--text-gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.card-caption {
  padding: 1rem 0.5rem 0.5rem;
  text-align: center;
}

.card-caption .card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.card-caption .card-hint {
  font-size: 0.8rem;
  color: var(--text-gold);
  opacity: 0.9;
  font-weight: 500;
}

/* Back Face */
.card-back {
  background: linear-gradient(145deg, #182032 0%, #0e1320 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: var(--glass-shadow), var(--glow-gold);
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
}

.card-back-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.wax-seal {
  font-size: 3rem;
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.4));
}

.back-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--text-gold);
  font-weight: 700;
}

.back-quote {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.8;
  color: #e2e8f0;
  font-style: italic;
  position: relative;
  padding: 0 0.5rem;
}

.back-signature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.sig-line {
  width: 40px;
  height: 1px;
  background: rgba(245, 158, 11, 0.5);
}

.sig-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.back-flip-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  padding: 0.5rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: var(--transition);
}

.back-flip-btn:hover {
  color: var(--text-gold);
  border-color: rgba(245, 158, 11, 0.4);
}

/* Chapter Select Bar */
.chapter-select-bar {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem 2rem;
  box-shadow: var(--glass-shadow);
}

.chapter-select-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chapter-select-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-gold);
}

.chapter-select-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.chapter-chips-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.75rem;
}

.hero-chip-card {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
}

.hero-chip-card:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
}

.hero-chip-period {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.hero-chip-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.15rem 0;
}

.hero-chip-level {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-gold);
}

/* ========================================================
   GLOBAL FILTER SECTION
   ======================================================== */
.global-filter-section {
  padding: 1.5rem 0;
  position: sticky;
  top: 58px;
  z-index: 80;
  background: rgba(10, 13, 20, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-card-border);
  transition: var(--transition);
}

.filter-container {
  display: flex;
  justify-content: center;
}

.filter-wrapper {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem;
  border-radius: 9999px;
  border: 1px solid var(--bg-card-border);
}

.filter-tab {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.filter-tab.active {
  background: var(--gold-gradient);
  color: #1a0f00;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.tab-badge {
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
}

.filter-tab.active .tab-badge {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
}

/* ========================================================
   MAIN STAGES LAYOUT
   ======================================================== */
.stages-main {
  position: relative;
  z-index: 1;
  padding-bottom: 6rem;
}

.stage-section {
  padding: 5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.stage-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.4), transparent);
}

/* Stage Header */
.stage-header-block {
  margin-bottom: 3rem;
  text-align: center;
}

.stage-index-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-gold);
  letter-spacing: 0.15em;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.stage-main-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Stage RPG & Music Top Row */
.stage-top-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 2rem;
  margin-bottom: 3.5rem;
  align-items: stretch;
}

/* RPG Profile Card */
.rpg-card {
  background:
    radial-gradient(circle at 12% 12%, rgba(251, 191, 36, 0.16), transparent 24%),
    radial-gradient(circle at 88% 78%, rgba(34, 211, 238, 0.13), transparent 28%),
    linear-gradient(145deg, rgba(12, 25, 38, 0.96), rgba(23, 16, 44, 0.94));
  backdrop-filter: var(--glass-blur);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  outline: 1px solid rgba(34, 211, 238, 0.28);
  outline-offset: 3px;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42), 0 0 26px rgba(251, 191, 36, 0.10), 0 0 34px rgba(34, 211, 238, 0.08);
}

.rpg-fate-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 5px 10px;
  margin-top: 2px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(245, 158, 11, 0.12));
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rpg-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.rpg-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.rpg-avatar {
  width: 116px;
  height: 116px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  background: #111;
}

.rpg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.rpg-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rpg-badge-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.rpg-level-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-gold);
  line-height: 1.3;
}

/* RPG Stats Section */
.rpg-stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.rpg-stat-col-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Primary Stats (Progress Bars) */
.stat-bar-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.stat-bar-name {
  color: var(--text-secondary);
}

.stat-bar-val {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.stat-progress-track {
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.stat-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-emerald { background: var(--emerald-gradient); }
.fill-cyan { background: var(--cyan-gradient); }
.fill-gold { background: var(--gold-gradient); }
.fill-violet { background: var(--violet-gradient); }

/* Secondary Stats (Gold Stars) */
.star-stat-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.star-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
}

.star-stat-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.star-rating-box {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.star-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  color: #fbbf24;
}

.star-icon.empty {
  color: rgba(255, 255, 255, 0.15);
}

/* ========================================================
   MINI MUSIC PLAYER (Retro Vinyl Disc)
   ======================================================== */
.music-player-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
}

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

.player-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-gold);
  text-transform: uppercase;
}

.player-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
  transition: var(--transition);
}

.player-status-dot.active {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.player-body {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Spinning Vinyl Disk */
.vinyl-container {
  width: 100px;
  height: 100px;
  position: relative;
  flex-shrink: 0;
}

.vinyl-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #2d3748 15%, #1a202c 16%, #111827 35%, #0f172a 70%, #000 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vinyl-disc::before {
  content: '';
  position: absolute;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.vinyl-center {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #111;
}

.vinyl-hole {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
}

.vinyl-disc.spinning {
  animation: spin 3.5s linear infinite;
}

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

.player-info {
  flex: 1;
  overflow: hidden;
}

.track-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.track-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Audio Controls */
.player-controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-gradient);
  border: none;
  color: #1a0f00;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
}

.play-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.audio-progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.audio-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.audio-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gold);
  border-radius: 9999px;
  transition: width 0.1s linear;
}

.audio-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ========================================================
   HIGHLIGHT MEMORIES SECTION & CARD TYPES
   ======================================================== */
.stage-highlights-section {
  margin-bottom: 3rem;
}

.highlights-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.highlights-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.highlights-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

/* Card Common Styles */
.memory-card {
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Type 1: Standard Photo Card */
.memory-card.card-photo {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  box-shadow: var(--glass-shadow);
}

.memory-card.card-photo:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: var(--glass-shadow), 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-img-container {
  width: 100%;
  height: 260px;
  position: relative;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}

.card-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.memory-card:hover .card-img-container img {
  transform: scale(1.05);
}

.card-tag-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(8px);
  color: var(--text-gold);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  z-index: 2;
}

.card-body-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.card-time-text {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.card-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.card-note-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Type 2: Photo Stack Card (Từ 2 ảnh trở lên) */
.memory-card.card-stack {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  box-shadow: var(--glass-shadow);
}

.memory-card.card-stack:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.4);
}

.stack-wrapper {
  position: relative;
  width: 100%;
  height: 270px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stack-layer {
  position: absolute;
  width: 86%;
  height: 84%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #111;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stack-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tilt angles */
.stack-layer-1 {
  transform: rotate(-5deg) translateY(2px);
  z-index: 1;
  opacity: 0.85;
}

.stack-layer-2 {
  transform: rotate(4deg) translateY(4px);
  z-index: 2;
  opacity: 0.9;
}

.stack-layer-main {
  transform: rotate(0deg);
  z-index: 3;
}

/* Hover fanning effect */
.memory-card.card-stack:hover .stack-layer-1 {
  transform: rotate(-10deg) translate(-15px, -6px);
  opacity: 1;
}

.memory-card.card-stack:hover .stack-layer-2 {
  transform: rotate(9deg) translate(15px, -6px);
  opacity: 1;
}

.memory-card.card-stack:hover .stack-layer-main {
  transform: scale(1.02);
}

.stack-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  background: var(--gold-gradient);
  color: #1a0f00;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

/* Type 3: Quote Card / Thẻ Nhật Ký (Chỉ chữ, không có ảnh) */
.memory-card.card-quote {
  background: var(--paper-bg);
  border: 2px solid var(--paper-border);
  color: var(--paper-text);
  padding: 2.25rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  position: relative;
  justify-content: space-between;
}

.memory-card.card-quote::before {
  content: '“';
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 1;
  color: rgba(217, 119, 6, 0.15);
  pointer-events: none;
}

.quote-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.quote-tag {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quote-time {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--paper-subtext);
}

.quote-heading {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: #1c1917;
  line-height: 1.35;
  margin-bottom: 1rem;
}

.quote-content {
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--paper-subtext);
  font-style: italic;
  margin-bottom: 1.5rem;
  position: relative;
}

.quote-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--paper-border);
  padding-top: 1rem;
}

.quote-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: #78350f;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ========================================================
   VIEW FULL ARCHIVE BUTTON
   ======================================================== */
.stage-archive-row {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.btn-open-archive {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2.2rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(56, 189, 248, 0.24));
  border: 1.5px solid var(--accent-color, #f59e0b);
  color: var(--text-primary);
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.28);
  position: relative;
  overflow: hidden;
}

.btn-open-archive::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -55%;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-18deg);
  animation: archive-shimmer 3.6s ease-in-out infinite;
}

@keyframes archive-shimmer {
  0%, 72% { left: -55%; }
  100% { left: 125%; }
}

.btn-open-archive:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.38), rgba(56, 189, 248, 0.34));
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.45);
}

.btn-open-archive .archive-icon {
  font-size: 1.2rem;
}

/* ========================================================
   FILMSTRIP GRID MODAL (35mm Cuộn Phim)
   ======================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 9, 15, 0.85);
  backdrop-filter: blur(20px);
}

.filmstrip-dialog {
  position: relative;
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  background: #0f131d;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), var(--glow-gold);
}

/* 35mm Film Holes */
.film-holes {
  width: 100%;
  height: 24px;
  background: #090c13;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  overflow: hidden;
}

.holes-track {
  width: 100%;
  height: 12px;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 8px,
    #1f293d 8px,
    #1f293d 20px
  );
  border-radius: 2px;
}

.filmstrip-modal-header {
  padding: 1.5rem 2rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--bg-card-border);
}

.modal-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-gold);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  display: inline-block;
}

.modal-stage-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-stage-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  color: var(--text-gold);
  border-color: rgba(245, 158, 11, 0.4);
}

/* Month Filter Chips */
.modal-month-filter {
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
}

.month-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.month-filter-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.month-filter-chips::-webkit-scrollbar {
  display: none;
}

.month-chip {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.month-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.month-chip.active {
  background: var(--gold-gradient);
  color: #1a0f00;
  font-weight: 700;
}

/* Filmstrip Grid Body */
.filmstrip-grid-body {
  padding: 1.5rem 2rem 2rem;
  overflow-y: auto;
  max-height: calc(90vh - 220px);
}

.filmstrip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

/* Single Film Frame */
.film-frame {
  background: #141a27;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.film-frame:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.film-number {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: var(--text-gold);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.film-thumb-box {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0a0d14;
}

.film-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.film-frame:hover .film-thumb-box img {
  transform: scale(1.08);
}

.film-frame-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.film-frame-time {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.film-frame-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty filter state */
.empty-filter-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ========================================================
   FULLSCREEN LIGHTBOX MODAL
   ======================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 6, 12, 0.95);
  backdrop-filter: blur(25px);
}

.lightbox-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  z-index: 10;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-gold);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid var(--bg-card-border);
}

.lightbox-actions {
  display: flex;
  gap: 0.75rem;
}

.lightbox-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  color: var(--text-gold);
  border-color: rgba(245, 158, 11, 0.4);
}

/* Lightbox Stage */
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  padding: 1rem 0;
}

.lightbox-nav {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 20;
}

.lightbox-nav:hover {
  background: rgba(245, 158, 11, 0.25);
  color: var(--text-gold);
  transform: scale(1.1);
}

.lightbox-img-wrapper {
  max-width: 85%;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.lightbox-img-wrapper img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.lightbox-img-wrapper.zoomed img {
  transform: scale(1.5);
  cursor: grab;
}

/* Lightbox Caption Box */
.lightbox-caption-box {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.lightbox-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.lightbox-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.lightbox-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.lightbox-time {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Thumbnails Strip */
.lightbox-thumbs-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  overflow-x: auto;
}

.lightbox-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.5;
  transition: var(--transition);
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-thumb:hover,
.lightbox-thumb.active {
  opacity: 1;
  border-color: var(--primary-gold);
  transform: scale(1.1);
}

/* ========================================================
   FOOTER
   ======================================================== */
.museum-footer {
  background: #080b12;
  border-top: 1px solid var(--bg-card-border);
  padding: 4rem 0 2rem;
  position: relative;
  z-index: 10;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

.footer-brand h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-gold);
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: var(--text-secondary);
  max-width: 500px;
  font-size: 0.95rem;
}

.footer-bottom {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.back-to-top {
  color: var(--text-gold);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.back-to-top:hover {
  text-decoration: underline;
}

/* ========================================================
   RESPONSIVE DESIGN (Media Queries)
   ======================================================== */
@media (max-width: 1024px) {
  .hero-main-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-visual-col {
    order: -1;
  }

  .genesis-card-wrapper {
    max-width: 360px;
  }

  .genesis-flip-card {
    height: auto;
  }

  .stage-top-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .stage-section {
    padding: 18px 14px !important;
  }

  .stage-header-block {
    margin-bottom: 14px !important;
  }

  .stage-archive-row {
    margin-top: 10px !important;
  }

  .museum-footer {
    min-height: 0 !important;
    max-height: 120px;
    padding: 12px 10px 10px !important;
  }

  .museum-footer .footer-container {
    min-height: 0 !important;
    gap: 6px !important;
  }

  .museum-footer .footer-brand h3 {
    margin: 0 0 4px !important;
    font-size: 0.92rem !important;
  }

  .museum-footer .footer-brand p {
    display: none !important;
  }

  .museum-footer .footer-bottom {
    padding-top: 6px !important;
    gap: 4px !important;
    justify-content: center !important;
  }

  .museum-footer .footer-bottom p {
    margin: 0 !important;
    font-size: 0.72rem !important;
  }

  .game-dialog {
    width: calc(100vw - 20px) !important;
    max-height: 94vh !important;
    padding: 12px !important;
  }

  .game-modal-header,
  .game-status-bar,
  .game-body {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .game-photo-wrap {
    height: 220px !important;
    max-height: 220px !important;
  }

  .game-year-input-wrap {
    flex-direction: column;
  }

  .game-year-submit {
    width: 100%;
  }

  .hero-section {
    padding: 6rem 1rem 3rem;
  }

  .hero-stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
  }

  .rpg-stats-container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .chapter-chips-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .highlights-grid {
    grid-template-columns: 1fr;
  }

  .filmstrip-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal-month-filter {
    padding: 0.75rem 1rem;
  }

  .filmstrip-dialog {
    max-height: 95vh;
  }

  .lightbox-nav {
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .chapter-chips-row {
    grid-template-columns: 1fr;
  }

  .hero-cta-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ========================================================
   MINI-GAME "THỬ THÁCH ĐOÁN NĂM" (GUESS THE YEAR) STYLES
   ======================================================== */
.btn-game {
  background: rgba(15, 23, 42, 0.78);
  color: var(--text-primary);
  border: 1px solid var(--primary-accent);
  backdrop-filter: var(--glass-blur);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-game:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border-color: var(--primary-gold-light);
  filter: brightness(1.08);
}

.nav-btn-game {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-color: rgba(168, 85, 247, 0.4);
  color: #f3e8ff;
}

.nav-btn-game:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
  border-color: rgba(236, 72, 153, 0.6);
  color: #ffffff;
}

/* Game Modal Dialog */
.game-dialog {
  max-width: 780px;
  max-height: 92vh;
  background: #0d121f;
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-xl);
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.game-modal-header {
  padding: 1.5rem 2rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bg-card-border);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
}

.game-tag-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #c084fc;
  text-transform: uppercase;
}

.game-modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.2rem;
}

/* Game Status Bar */
.game-status-bar {
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.game-status-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-q-counter {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-gold);
}

.game-score-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
}

.game-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.game-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ec4899, #8b5cf6, #3b82f6);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* Game Body */
.game-body {
  padding: 1.75rem 2rem 2rem;
  overflow-y: auto;
  max-height: calc(90vh - 180px);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Secret Photo Box */
.game-photo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.game-photo-wrap {
  width: 100%;
  max-width: 480px;
  max-height: 300px;
  height: 300px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  position: relative;
}

.game-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-photo-hint {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

/* Numeric Year Input */
.game-year-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

#game-year-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 1rem;
  border-radius: 9999px;
  border: 1.5px solid rgba(168, 85, 247, 0.45);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
}

#game-year-input:focus {
  border-color: #a855f7;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.28);
}

.game-year-submit { min-width: 112px; }

.game-input-shake {
  animation: game-input-shake 0.35s ease;
  border-color: #ef4444 !important;
}

@keyframes game-input-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

/* Reveal Info Card */
.game-reveal-card {
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--glass-shadow);
  animation: slideUpFade 0.4s ease;
}

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

.reveal-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.reveal-header.is-correct {
  color: #34d399;
}

.reveal-header.is-wrong {
  color: #f87171;
}

.reveal-info-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-left: 3px solid var(--primary-gold);
  padding-left: 1rem;
}

.reveal-memory-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.reveal-memory-time {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-gold);
}

.reveal-memory-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.25rem;
}

.game-next-btn {
  align-self: flex-end;
  padding: 0.75rem 1.8rem;
}

/* Result Screen */
.game-result-screen {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  animation: fadeIn 0.5s ease;
}

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

.result-trophy-box {
  font-size: 4rem;
  filter: drop-shadow(0 4px 20px rgba(245, 158, 11, 0.5));
  animation: bounce 1s infinite alternate ease-in-out;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

.result-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.result-score-highlight {
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.result-badge-pill {
  display: inline-block;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #e9d5ff;
  font-size: 1.15rem;
  font-weight: 800;
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.result-commentary {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 640px) {
  .game-photo-wrap {
    height: 220px;
  }
}

/* ========================================================
   CINEMA MEMORY REEL (CHIẾU PHIM TỰ ĐỘNG) STYLES
   ======================================================== */
.btn-cinema {
  background: rgba(15, 23, 42, 0.78);
  color: var(--text-primary);
  border: 1px solid var(--primary-accent);
  backdrop-filter: var(--glass-blur);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-cinema:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border-color: var(--primary-gold-light);
  filter: brightness(1.08);
}

/* Fullscreen Cinema Modal */
.cinema-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 3000;
  background: #000000;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
}

.cinema-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.cinema-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #05070c;
}

/* Story Segmented Progress Bar */
.cinema-progress-row {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 6px;
  z-index: 100;
}

.cinema-seg {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  overflow: hidden;
}

.cinema-seg-fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  border-radius: 9999px;
  transition: width 0.05s linear;
}

.cinema-seg.completed .cinema-seg-fill {
  width: 100% !important;
}

/* Top Cinema Header */
.cinema-top-header {
  position: absolute;
  top: 2.25rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.cinema-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cinema-icon-pulse {
  animation: pulse 1.5s infinite;
}

.cinema-badge-text {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-gold);
  text-transform: uppercase;
}

.cinema-controls-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cinema-ctrl-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.cinema-ctrl-btn:hover {
  background: rgba(245, 158, 11, 0.35);
  border-color: rgba(245, 158, 11, 0.6);
  color: var(--text-gold);
  transform: scale(1.08);
}

/* Main Cinema Screen & Ken Burns */
.cinema-screen {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cinema-tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  z-index: 40;
  cursor: pointer;
}

.cinema-tap-zone.zone-left {
  left: 0;
}

.cinema-tap-zone.zone-right {
  right: 0;
}

.cinema-arrow {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.cinema-arrow:hover {
  background: rgba(245, 158, 11, 0.35);
  border-color: var(--primary-gold);
  color: var(--text-gold);
  transform: translateY(-50%) scale(1.1);
}

.cinema-arrow-prev {
  left: 1.5rem;
}

.cinema-arrow-next {
  right: 1.5rem;
}

/* Slides Viewport */
.cinema-slides-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cinema-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem 9rem;
}

.cinema-slide.active {
  opacity: 1;
  visibility: visible;
}

/* Ken Burns Effect */
@keyframes kenBurnsEffect {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.1) translate(-1%, -1%);
  }
}

.cinema-img {
  max-width: 90vw;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
}

.cinema-slide.active .cinema-img {
  animation: kenBurnsEffect 5.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Quote Slide (Khi gặp kỷ niệm điểm nhấn không có ảnh) */
.cinema-quote-box {
  max-width: 760px;
  padding: 3rem 2.5rem;
  background: rgba(18, 24, 38, 0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), var(--glow-gold);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: fadeIn 0.6s ease;
}

.cinema-quote-mark {
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 0.8;
  color: var(--text-gold);
  opacity: 0.65;
}

.cinema-quote-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.cinema-quote-text {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.8;
  color: #e2e8f0;
  font-style: italic;
  max-width: 650px;
}

.cinema-quote-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-gold);
  margin-top: 0.5rem;
}

/* Subtitle Bar at Bottom */
.cinema-subtitle-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4rem 2rem 2.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.75) 60%, transparent 100%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  pointer-events: none;
}

.cinema-sub-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cinema-sub-divider {
  opacity: 0.5;
}

.cinema-sub-title {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.cinema-sub-desc {
  font-size: clamp(0.88rem, 1.4vw, 1.05rem);
  color: #cbd5e1;
  max-width: 780px;
  line-height: 1.6;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
  .cinema-arrow {
    display: none;
  }
  .cinema-progress-row {
    top: 0.75rem;
    left: 1rem;
    right: 1rem;
  }
  .cinema-top-header {
    top: 1.5rem;
    left: 1rem;
    right: 1rem;
  }
  .cinema-subtitle-bar {
    padding: 3rem 1rem 1.5rem;
  }
  .cinema-slide {
    padding: 4.5rem 1rem 7.5rem;
  }
}

/* ========================================================
   HERO & NAV TICKET BUTTONS
   ======================================================== */
.btn-ticket {
  background: rgba(15, 23, 42, 0.78);
  color: var(--text-primary);
  border: 1px solid var(--primary-accent);
  backdrop-filter: var(--glass-blur);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-ticket:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border-color: var(--primary-gold-light);
  filter: brightness(1.08);
  color: var(--text-primary);
}

.nav-btn-ticket {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn-ticket:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(5, 150, 105, 0.4) 100%);
  border-color: rgba(16, 185, 129, 0.6);
  color: #ffffff;
}

/* ========================================================
   BƯỚC 4: QUẦY IN VÉ THAM QUAN LƯU NIỆM (SOUVENIR TICKET)
   ======================================================== */
.ticket-station-section {
  padding: 6rem 0 5rem;
  background: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.08) 0%, rgba(10, 14, 23, 0.98) 70%);
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  position: relative;
  overflow: hidden;
}

.ticket-station-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 250px;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

.ticket-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.ticket-section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3.5rem;
}

.ticket-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.ticket-section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.03em;
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.ticket-section-desc {
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Grid Layout: Form vs Ticket Output */
.ticket-station-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Ticket Form Card */
.ticket-form-card {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ticket-form-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ticket-form-icon {
  font-size: 2rem;
  line-height: 1;
  background: rgba(245, 158, 11, 0.15);
  padding: 0.6rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.ticket-form-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.ticket-form-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ticket-form-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ticket-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ticket-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ticket-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.ticket-input:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

.ticket-input-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.ticket-input-note strong {
  color: var(--text-gold);
}

.ticket-select-wrap {
  position: relative;
  width: 100%;
}

.ticket-select {
  width: 100%;
  padding: 0.85rem 2.2rem 0.85rem 1rem;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: var(--transition);
}

.ticket-select:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

.select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  color: var(--text-muted);
  pointer-events: none;
}

.btn-print-ticket {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.95rem 1.5rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: var(--transition);
}

.btn-print-ticket:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.55);
  filter: brightness(1.1);
}

.btn-print-ticket:active {
  transform: translateY(0);
}

/* Ticket Output / Preview Panel */
.ticket-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  width: 100%;
}

.ticket-render-container {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
}

/* ========================================================
   THE VINTAGE SOUVENIR TICKET (Pure HTML/CSS Nostalgic Design)
   Zero <img> tags inside to prevent canvas taint issues
   ======================================================== */
.souvenir-ticket {
  width: 100%;
  max-width: 780px;
  background: #fbf7ee;
  background-image: radial-gradient(circle at 10% 20%, #ffffff 0%, #f7f0df 60%, #eee3cb 100%);
  color: #1e293b;
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(180, 83, 9, 0.35);
  position: relative;
  overflow: hidden;
  user-select: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.souvenir-ticket.print-pulse {
  animation: ticketPrintFlash 0.6s ease-out;
}

@keyframes ticketPrintFlash {
  0% {
    transform: scale(0.97);
    filter: brightness(1.3);
  }
  50% {
    transform: scale(1.01);
    filter: brightness(1.05);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.ticket-outer-border {
  padding: 8px;
  height: 100%;
  box-sizing: border-box;
}

.ticket-inner-border {
  border: 2px solid #b45309;
  border-radius: 9px;
  display: flex;
  position: relative;
  background: transparent;
  min-height: 290px;
}

/* Corner Ornaments */
.ticket-inner-border::before,
.ticket-inner-border::after {
  content: "♦";
  position: absolute;
  color: #b45309;
  font-size: 0.75rem;
  line-height: 1;
}

.ticket-inner-border::before {
  top: 4px;
  left: 6px;
}

.ticket-inner-border::after {
  bottom: 4px;
  left: 6px;
}

/* Main Section of Ticket (Left) */
.ticket-main-section {
  flex: 1;
  padding: 1.5rem 1.6rem 1.5rem 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  position: relative;
  min-width: 0;
}

.ticket-header-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative;
}

.ticket-logo-mark {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 10px rgba(120, 53, 15, 0.35);
  flex-shrink: 0;
}

.ticket-logo-mark img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 8px;
}

/* Utility panels + launcher */
.utility-launcher {
  padding: 2rem 0;
}

.utility-launcher-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.utility-launch-btn {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 10px 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--accent-color, #f59e0b);
  background: linear-gradient(135deg, rgba(245,158,11,.18), rgba(56,189,248,.16));
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245,158,11,.18);
}

.utility-launch-btn[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(245,158,11,.32), rgba(56,189,248,.28));
}

.utility-section[hidden] {
  display: none !important;
}

.utility-close-btn {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 4;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9999px;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 700;
}

.achievements-section.utility-section,
.time-capsule-section.utility-section,
.ticket-station-section.utility-section {
  position: relative;
}

@media (min-width: 769px) {
  .stage-top-grid {
    grid-template-columns: 1fr;
  }

  .rpg-card {
    margin: 0 auto !important;
    max-width: 820px;
    width: 100%;
  }

  .nav-chapters {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
    overflow-x: visible;
  }

  .nav-chip {
    padding-inline: 0.65rem;
  }

  .nav-chip:last-child {
    margin-right: 8px;
  }
}

.ticket-header-text {
  flex: 1;
  min-width: 0;
}

.ticket-museum-brand {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.ticket-category-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #b45309;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* Circular Vintage Stamp */
.ticket-vintage-stamp {
  position: absolute;
  top: -6px;
  right: 0;
  transform: rotate(-12deg);
  opacity: 0.85;
  pointer-events: none;
}

.stamp-inner {
  width: 62px;
  height: 62px;
  border: 2px dashed #b91c1c;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.03);
}

.stamp-star {
  font-size: 0.6rem;
  line-height: 1;
}

.stamp-text {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.stamp-date {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
}

/* Data Grid on Ticket */
.ticket-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px dashed rgba(180, 83, 9, 0.35);
  border-bottom: 1px dashed rgba(180, 83, 9, 0.35);
}

.ticket-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.field-k {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  color: #78716c;
  letter-spacing: 0.05em;
}

.field-v {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.field-v.visitor-name {
  color: #1e3a8a;
  font-size: 1.05rem;
}

.field-v.stage-name {
  color: #92400e;
}

.field-v.time-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #334155;
}

.field-v.serial-code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 800;
  color: #b91c1c;
  letter-spacing: 0.06em;
}

/* Dedicated Quote Box */
.ticket-dedication-box {
  background: rgba(217, 119, 6, 0.08);
  border-left: 3px solid #d97706;
  border-radius: 4px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dedication-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  color: #92400e;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.star-icon {
  font-size: 0.75rem;
}

.dedication-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #292524;
}

.dedication-source {
  font-size: 0.72rem;
  color: #78716c;
  text-align: right;
  font-family: var(--font-mono);
}

/* Perforated Tear Divider & Notches */
.ticket-tear-divider {
  width: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Semi-circular punch-hole notches */
.ticket-notch {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #090d16; /* matches the section background */
  box-shadow: inset 0 0 0 1px rgba(180, 83, 9, 0.4);
  z-index: 5;
}

.ticket-notch.notch-top {
  top: -19px;
}

.ticket-notch.notch-bottom {
  bottom: -19px;
}

.tear-dashed-line {
  height: 100%;
  width: 0;
  border-left: 2px dashed #b5a995;
}

.tear-scissor-mark {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  background: #fbf7ee;
  padding: 2px 0;
  font-size: 0.78rem;
  color: #a89f91;
  line-height: 1;
}

/* Ticket Stub Section (Right) */
.ticket-stub-section {
  width: 195px;
  padding: 1.5rem 1.15rem 1.25rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.018);
  gap: 0.75rem;
}

.stub-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-serif);
  font-weight: 800;
  font-size: 0.95rem;
  color: #0f172a;
  letter-spacing: 0.08em;
}

.stub-meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem 0;
  border-top: 1px dashed rgba(180, 83, 9, 0.3);
  border-bottom: 1px dashed rgba(180, 83, 9, 0.3);
  text-align: left;
}

.stub-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.75rem;
}

.stub-k {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: #78716c;
}

.stub-v {
  font-weight: 700;
  color: #0f172a;
  max-width: 115px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stub-v.serial-val {
  font-family: var(--font-mono);
  color: #b91c1c;
  font-size: 0.75rem;
}

/* Pure CSS Barcode Pattern */
.stub-barcode-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.css-barcode {
  width: 100%;
  height: 44px;
  background: repeating-linear-gradient(
    90deg,
    #0f172a 0px, #0f172a 2px,
    transparent 2px, transparent 4px,
    #0f172a 4px, #0f172a 7px,
    transparent 7px, transparent 9px,
    #0f172a 9px, #0f172a 10px,
    transparent 10px, transparent 13px,
    #0f172a 13px, #0f172a 16px,
    transparent 16px, transparent 18px,
    #0f172a 18px, #0f172a 21px,
    transparent 21px, transparent 23px,
    #0f172a 23px, #0f172a 24px,
    transparent 24px, transparent 27px,
    #0f172a 27px, #0f172a 30px,
    transparent 30px, transparent 33px,
    #0f172a 33px, #0f172a 36px,
    transparent 36px, transparent 38px
  );
  border-radius: 2px;
}

.barcode-digits {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: #475569;
  margin-top: 4px;
  font-weight: 600;
}

/* Download Action Bar */
.ticket-action-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.btn-download-ticket {
  padding: 0.95rem 2.2rem;
  background: linear-gradient(135deg, #059669 0%, #10b981 50%, #047857 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
}

.btn-download-ticket:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.6);
  filter: brightness(1.1);
}

.btn-download-ticket:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.ticket-quality-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Responsive Ticket Layout */
@media (max-width: 1024px) {
  .ticket-station-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .ticket-form-card {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .ticket-station-section {
    padding: 4rem 0 3.5rem;
  }
  .ticket-render-container {
    justify-content: flex-start;
  }
  .souvenir-ticket {
    min-width: 680px; /* Maintains full ticket layout with horizontal scroll on mobile */
  }
}

/* ========================================================
   FLOATING BACKGROUND MUSIC WIDGET
   ======================================================== */
.floating-bg-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 850;
  background: rgba(13, 19, 33, 0.88);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(245, 158, 11, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  user-select: none;
}

.floating-bg-player:hover {
  transform: translateY(-2px);
  border-color: var(--primary-gold);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75), 0 0 25px rgba(245, 158, 11, 0.35);
}

.bg-music-disk-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: var(--text-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.bg-music-disk-btn:hover {
  transform: scale(1.08);
  border-color: var(--primary-gold);
}

.floating-bg-player.playing .bg-disk-icon {
  animation: spinSlow 4s linear infinite;
  display: inline-block;
}

.bg-music-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.bg-music-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-gold);
  letter-spacing: 0.06em;
  line-height: 1;
}

.bg-music-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  max-width: 165px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.bg-music-skip-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.2rem 0.3rem;
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-music-skip-btn:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}

@media (max-width: 640px) {
  .floating-bg-player {
    bottom: 16px;
    right: 16px;
    padding: 0.3rem 0.65rem 0.3rem 0.4rem;
    gap: 0.5rem;
  }
  .bg-music-title {
    max-width: 110px;
    font-size: 0.72rem;
  }
  .bg-music-disk-btn {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
}

/* ========================================================
   THEME SELECTOR DROPDOWN (NAVBAR)
   ======================================================== */
.theme-selector-dropdown {
  position: relative;
  display: inline-block;
}

.nav-btn-theme {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  color: var(--text-primary);
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nav-btn-theme:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--text-gold);
}

.theme-arrow {
  font-size: 0.7rem;
  transition: transform 0.25s ease;
  opacity: 0.75;
}

.theme-selector-dropdown.open .theme-arrow {
  transform: rotate(180deg);
}

.theme-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 215px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 0.45rem;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.2);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.theme-selector-dropdown.open .theme-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.theme-option-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-gold);
}

.theme-option-btn.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--text-gold);
  font-weight: 700;
}

.theme-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.dot-obsidian {
  background: linear-gradient(135deg, #0a0d14 0%, #f59e0b 100%);
}

.dot-sepia {
  background: linear-gradient(135deg, #fdfbf7 0%, #b45309 100%);
}

.dot-midnight {
  background: linear-gradient(135deg, #060b18 0%, #38bdf8 100%);
}

.dot-daylight {
  background: linear-gradient(135deg, #ffffff 0%, #0284c7 100%);
}

.theme-name {
  flex: 1;
}

.theme-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.2);
  color: var(--text-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================================
   MỤC 1: BẢNG HUY HIỆU THÀNH TỰU (RPG ACHIEVEMENTS)
   ======================================================== */
.achievements-section {
  padding: 4.5rem 0 3.5rem;
  position: relative;
  border-bottom: 1px solid var(--bg-card-border);
  background: linear-gradient(180deg, transparent 0%, rgba(245, 158, 11, 0.02) 50%, transparent 100%);
}

.achievements-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem;
}

.achievements-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-gold);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

.achievements-title {
  font-family: var(--font-heading, var(--font-serif));
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.achievements-subtitle {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.achievement-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.achievement-card:focus-visible {
  outline: 2px solid var(--primary-gold);
  outline-offset: 3px;
}

.achievement-card.unlocked:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.45), 0 0 24px rgba(245, 158, 11, 0.2);
}

.achievement-card.locked {
  opacity: 0.58;
  filter: grayscale(0.7);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
}

.achievement-card.locked:hover {
  opacity: 0.85;
  filter: grayscale(0.3);
  transform: translateY(-3px);
  border-color: rgba(148, 163, 184, 0.5);
}

.achievement-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.achievement-icon {
  font-size: 2.2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--bg-card-border);
  border-radius: 16px;
  transition: transform 0.3s ease;
}

.achievement-card.unlocked:hover .achievement-icon {
  transform: scale(1.12) rotate(4deg);
}

.achievement-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.achievement-status-badge.locked-badge {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

.achievement-body {
  margin-bottom: 1.25rem;
  flex: 1;
}

.achievement-level-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-gold);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}

.achievement-name {
  font-family: var(--font-heading, var(--font-serif));
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.achievement-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.achievement-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-gold-light);
}

.achievement-card.locked .achievement-footer {
  color: var(--text-muted);
}

.achievement-action-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.2s ease;
}

.achievement-card.unlocked:hover .achievement-action-hint {
  transform: translateX(4px);
}

/* Pulse Highlight Animation for target stages */
@keyframes achievementHighlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    border-color: var(--bg-card-border);
  }
  50% {
    box-shadow: 0 0 45px 12px rgba(245, 158, 11, 0.75), inset 0 0 25px rgba(245, 158, 11, 0.25);
    border-color: #fbbf24;
  }
}

.achievement-highlight-pulse {
  animation: achievementHighlightPulse 1s ease-in-out 2 !important;
  position: relative;
  z-index: 2;
  border-radius: var(--radius-lg);
}

/* Toast Notification (RPG Achievements & Alerts) */
.rpg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  border: 1px solid rgba(245, 158, 11, 0.5);
  padding: 0.75rem 1.4rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.25);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.rpg-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

@media (max-width: 768px) {
  .achievements-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   MỤC 2: HỘP THỜI GIAN GỬI TUỔI 22 (TIME CAPSULE)
   ======================================================== */
.time-capsule-section {
  padding: 5.5rem 0 4.5rem;
  background: radial-gradient(circle at 50% 10%, rgba(245, 158, 11, 0.06) 0%, transparent 65%), linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
  border-top: 1px solid var(--bg-card-border);
  position: relative;
  overflow: hidden;
}

.capsule-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}

.capsule-section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 2.5rem;
}

.capsule-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-gold);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

.capsule-section-title {
  font-family: var(--font-heading, var(--font-serif));
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.capsule-section-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Real-time Countdown Card */
.capsule-countdown-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 1.85rem 2rem;
  max-width: 820px;
  margin: 0 auto 3rem;
  text-align: center;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), 0 0 25px rgba(245, 158, 11, 0.12);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
}

.countdown-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-gold);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
}

.countdown-live-dot {
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 10px #ef4444;
  animation: liveDotPulse 1.5s infinite;
}

@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.countdown-hud-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.countdown-hud-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.35rem;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
}

.countdown-digit {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  font-weight: 800;
  color: var(--primary-gold-light);
  line-height: 1;
  letter-spacing: 1px;
  text-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
}

.countdown-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

.countdown-hud-sep {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-gold);
  opacity: 0.6;
  align-self: center;
  margin-top: -0.5rem;
}

.countdown-target-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.countdown-target-info strong {
  color: var(--text-primary);
}

/* 2-Column Grid */
.capsule-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2rem;
  align-items: start;
}

.capsule-form-panel,
.capsule-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-xl);
  padding: 1.85rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.capsule-panel-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.list-panel-header {
  justify-content: space-between;
}

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.panel-icon {
  font-size: 1.75rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
}

.panel-title {
  font-family: var(--font-heading, var(--font-serif));
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.panel-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.capsule-total-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--text-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-family: var(--font-mono);
}

/* Form inputs */
.capsule-form .form-group {
  margin-bottom: 1.2rem;
}

.capsule-form .form-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.capsule-form .form-input,
.capsule-form .form-select,
.capsule-form .form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: var(--transition);
}

.capsule-form .form-select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.capsule-form .form-input:focus,
.capsule-form .form-select:focus,
.capsule-form .form-textarea:focus {
  outline: none;
  border-color: var(--primary-gold);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
  background: rgba(0, 0, 0, 0.4);
}

.capsule-form .textarea-counter {
  text-align: right;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-family: var(--font-mono);
}

.btn-seal-capsule {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  background: var(--gold-gradient);
  color: #0a0d14;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

.btn-seal-capsule:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.45);
  filter: brightness(1.08);
}

/* Capsule Items Container */
.capsule-items-scroll {
  max-height: 490px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.35rem;
}

.capsule-items-scroll::-webkit-scrollbar {
  width: 5px;
}
.capsule-items-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
.capsule-items-scroll::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.35);
  border-radius: 4px;
}

.capsule-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  transition: var(--transition);
  position: relative;
  overflow: visible;
}

.capsule-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.capsule-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.capsule-sender-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.capsule-sender-icon {
  font-size: 1rem;
}

.capsule-sender-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.capsule-tag-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  letter-spacing: 0.3px;
}

.tag-goal {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.tag-wish {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.35);
}

.tag-prophecy {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.capsule-meta-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.capsule-sealed-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}

.capsule-sealed-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-gold);
}

.capsule-btn-toggle {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--text-gold);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.capsule-btn-toggle:hover {
  background: rgba(245, 158, 11, 0.25);
  color: #ffffff;
}

.capsule-message-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease, padding 0.3s ease;
  padding: 0 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-primary);
  border-left: 3px solid var(--primary-gold);
}

.capsule-card.revealed .capsule-message-body {
  max-height: none;
  opacity: 1;
  overflow: visible;
  padding: 12px 0.85rem;
  margin-bottom: 0.75rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

.capsule-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.capsule-btn-delete {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 0.72rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.capsule-btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fca5a5;
}

.capsule-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.capsule-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
}

@media (max-width: 900px) {
  .capsule-layout-grid {
    grid-template-columns: 1fr;
  }
  .capsule-countdown-card {
    padding: 1.5rem 1rem;
  }
  .countdown-hud-item {
    min-width: 76px;
    padding: 0.75rem 0.9rem;
  }
}

/* ========================================================
   RESPONSIVE MOBILE ENGINE: CHỐNG TRÀN NGANG & MẤT CHỮ
   Tối ưu hóa hiển thị toàn diện cho điện thoại (<= 768px)
   ======================================================== */

/* 1. Global Overflow Prevention */
html, body {
  max-width: 100% !important;
  overflow-x: hidden !important;
  position: relative;
}

*, *::before, *::after {
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  /* 2. Container & Layout Reset */
  .container,
  .nav-container,
  .filter-container,
  .capsule-container,
  .ticket-container,
  .footer-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    overflow-x: hidden !important;
  }

  /* 3. Sticky Top Navbar on Mobile */
  .sticky-nav {
    max-width: 100vw !important;
    padding: 0 !important;
  }

  .nav-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.45rem !important;
    padding: 0.45rem 0.75rem !important;
  }

  .nav-brand {
    font-size: 0.78rem !important;
    gap: 0.35rem !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex-shrink: 1;
  }

  .brand-title {
    font-size: 0.76rem !important;
    letter-spacing: 0.02em !important;
  }

  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 0.15rem 0 !important;
    max-width: 100% !important;
    flex-shrink: 0;
  }

  .nav-actions::-webkit-scrollbar {
    display: none !important;
  }

  .nav-btn {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.72rem !important;
    gap: 0.25rem !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .nav-chapters {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 0.25rem 0 !important;
  }

  .nav-chapters::-webkit-scrollbar {
    display: none !important;
  }

  .nav-chip {
    padding: 0.22rem 0.55rem !important;
    font-size: 0.72rem !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  /* 4. Global Filter Tabs Bar */
  .filter-tabs {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.3rem !important;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .filter-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 0.4rem 0.75rem !important;
    font-size: 0.78rem !important;
  }

  /* 5. Memory Cards & Timeline Items */
  .stage-section {
    width: 100% !important;
    max-width: 100% !important;
    padding: 3rem 0 !important;
    overflow-x: hidden !important;
  }

  .stage-header-block {
    padding: 0 0.5rem !important;
  }

  .stage-main-title {
    font-size: clamp(1.3rem, 5vw, 1.85rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
  }

  .memory-card,
  .rpg-card,
  .retro-player-card,
  .quote-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .memory-title,
  .card-title,
  .memory-desc,
  .card-desc,
  .quote-text {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
    font-size: clamp(0.85rem, 3.8vw, 1.05rem) !important;
    line-height: 1.6 !important;
  }

  .memory-media-wrap img,
  .memory-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* 6. Chart.js Radar & Hero Stats */
  .rpg-stats-container,
  .rpg-radar-card,
  .chart-wrapper,
  .radar-canvas-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .radar-canvas-wrap canvas,
  #rpg-radar-chart {
    max-width: 100% !important;
    height: auto !important;
  }

  .hero-stats-bar {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }

  .stat-card {
    padding: 0.85rem 0.65rem !important;
  }

  .stat-value {
    font-size: clamp(1.4rem, 5vw, 1.8rem) !important;
  }

  .hero-title {
    font-size: clamp(1.65rem, 6.5vw, 2.5rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .hero-intro {
    font-size: clamp(0.88rem, 3.5vw, 1.05rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .chapter-chips-row {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    padding-bottom: 0.35rem !important;
  }

  .chapter-chips-row::-webkit-scrollbar {
    display: none !important;
  }

  .hero-chip-card {
    flex-shrink: 0 !important;
    min-width: 135px !important;
  }

  /* 7. RPG Achievements Grid */
  .achievements-section {
    padding: 3.5rem 0 2.5rem !important;
  }

  .achievements-title {
    font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .achievements-subtitle {
    font-size: clamp(0.82rem, 3vw, 0.95rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .achievements-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .achievement-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.15rem !important;
    box-sizing: border-box !important;
  }

  .achievement-name {
    font-size: clamp(1rem, 4vw, 1.18rem) !important;
    overflow-wrap: break-word !important;
  }

  .achievement-desc {
    font-size: clamp(0.82rem, 3.2vw, 0.9rem) !important;
    overflow-wrap: break-word !important;
    line-height: 1.55 !important;
  }

  /* 8. Time Capsule Section & Countdown */
  .time-capsule-section {
    padding: 3.5rem 0 2.5rem !important;
  }

  .capsule-section-title {
    font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .capsule-section-desc {
    font-size: clamp(0.82rem, 3vw, 0.95rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .capsule-countdown-card {
    padding: 1.25rem 0.75rem !important;
    margin-bottom: 2rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .countdown-hud-grid {
    gap: 0.35rem !important;
  }

  .countdown-hud-item {
    min-width: 0 !important;
    flex: 1 1 calc(25% - 0.4rem) !important;
    padding: 0.65rem 0.35rem !important;
  }

  .countdown-digit {
    font-size: clamp(1.35rem, 5.5vw, 2.1rem) !important;
  }

  .countdown-label {
    font-size: clamp(0.55rem, 2vw, 0.68rem) !important;
  }

  .countdown-hud-sep {
    font-size: 1.2rem !important;
    margin-top: -0.2rem !important;
  }

  .countdown-target-info {
    font-size: clamp(0.72rem, 2.6vw, 0.85rem) !important;
    overflow-wrap: break-word !important;
  }

  .capsule-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
  }

  .capsule-form-panel,
  .capsule-list-panel {
    padding: 1.25rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .capsule-message-body p {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    font-size: clamp(0.82rem, 3.2vw, 0.9rem) !important;
  }

  /* 9. Ticket Station & Preview */
  .ticket-station-section {
    padding: 3.5rem 0 2.5rem !important;
  }

  .ticket-section-title {
    font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .ticket-section-desc {
    font-size: clamp(0.82rem, 3vw, 0.95rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .ticket-station-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
  }

  .ticket-form-card,
  .ticket-preview-wrapper {
    padding: 1.25rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .museum-ticket {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .ticket-inner {
    padding: 1.25rem 1rem !important;
  }

  .ticket-message-quote {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    font-size: clamp(0.82rem, 3.2vw, 0.95rem) !important;
  }

  /* 10. Modals: Guess The Year, Cinema Reel, Filmstrip */
  .modal-dialog,
  .game-dialog,
  .cinema-dialog,
  .filmstrip-dialog {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 10px auto !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .game-option-btn {
    padding: 0.75rem 0.9rem !important;
    font-size: clamp(0.82rem, 3.2vw, 0.95rem) !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
  }

  .cinema-subtitle-bar {
    padding: 0.85rem 1rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .cinema-sub-title {
    font-size: clamp(1rem, 4vw, 1.35rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  .cinema-sub-desc {
    font-size: clamp(0.8rem, 3.2vw, 0.92rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  /* 11. Floating Music Widget on Mobile */
  .floating-bg-player {
    bottom: 12px !important;
    right: 12px !important;
    max-width: calc(100vw - 24px) !important;
    padding: 0.28rem 0.55rem 0.28rem 0.35rem !important;
    gap: 0.4rem !important;
    z-index: 99 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
  }

  .floating-bg-player .bg-music-tag {
    display: none !important;
  }

  .floating-bg-player .bg-music-title {
    max-width: 88px !important;
    font-size: 0.68rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .hero-cta-group #btn-invite-friends {
    width: max-content !important;
    justify-self: start;
  }

  .floating-bg-player .bg-music-disk-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.85rem !important;
  }

  .floating-bg-player .bg-music-skip-btn {
    font-size: 0.95rem !important;
    padding: 0.15rem !important;
  }
}



/* ========================================================
   RESPONSIVE SUPPLEMENT — MÀN HÌNH ĐIỆN THOẠI (≤ 768px)
   Bổ sung các quy tắc còn thiếu: filmstrip grid, aspect-ratio
   ảnh dọc, hero CTA grid, RPG compact, achievements 2 cột.
   Toàn bộ dùng var(--...) để tương thích 4 Theme nền.
   ======================================================== */

@media (max-width: 768px) {

  /* ── 1. FILMSTRIP / FULL MEMORY GRID ─────────────────────
     Xem toàn bộ kỷ niệm từng giai đoạn: 2 cột, ảnh dọc 3/4  */
  .filmstrip-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .filmstrip-grid-body {
    padding: 1rem !important;
  }

  /* Film frame: gỡ chiều cao vuông cứng → ảnh dọc tự nhiên */
  .film-thumb-box {
    width: 100% !important;
    height: auto !important;         /* bỏ height: 160px cứng */
    aspect-ratio: 3 / 4 !important;  /* khung dọc smartphone */
    overflow: hidden !important;
  }

  .film-thumb-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 20% !important;
  }

  /* Chú thích dưới mỗi ảnh filmstrip */
  .film-frame-info {
    padding: 0 0.1rem !important;
    gap: 0.15rem !important;
  }

  .film-frame-info .film-title,
  .film-frame-info .film-time,
  .film-frame-info .film-tag {
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  /* Film frame padding compact */
  .film-frame {
    padding: 0.4rem !important;
    gap: 0.4rem !important;
  }

  /* ── 2. HERO SECTION: compact layout ─────────────────────── */
  .hero-section {
    padding: 5rem 14px 28px !important;
    min-height: auto !important;
  }

  .hero-container {
    gap: 2rem !important;
  }

  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.4rem) !important;
    margin-bottom: 0.85rem !important;
  }

  .hero-intro {
    margin-bottom: 1.25rem !important;
  }

  /* Hero main grid: 1 cột, visual col xuống dưới */
  .hero-main-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* CTA Buttons: lưới 2 cột, nút đầu trải ngang */
  .hero-cta-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 1.75rem !important;
    align-items: stretch !important;
  }

  .hero-cta-group .btn:first-child,
  .hero-cta-group #btn-start-journey,
  .hero-cta-group #btn-invite-friends {
    grid-column: span 2 !important;
  }

  .hero-cta-group .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.75rem 0.9rem !important;
    font-size: 0.88rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* ── 3. SECTION PADDING rút ngắn ──────────────────────────── */
  .stage-section {
    padding: 28px 14px !important;
  }

  .global-filter-section {
    padding: 10px 0 !important;
  }

  /* ── 4. RPG CARD & CHỈ SỐ — compact 2 cột ─────────────────── */
  .rpg-card {
    padding: 14px !important;
    gap: 1rem !important;
  }

  /* Thanh tiến trình mảnh hơn */
  .stat-progress-track {
    height: 6px !important;
  }

  /* Chỉ số phụ: 2 cột nhỏ gọn */
  .star-stat-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
  }

  .star-stat-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.2rem !important;
    padding: 0.35rem 0.5rem !important;
  }

  .star-rating-box {
    gap: 0.12rem !important;
  }

  .star-icon {
    width: 13px !important;
    height: 13px !important;
  }

  /* RPG label text compact */
  .rpg-level-name {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    overflow-wrap: break-word !important;
  }

  /* ── 5. ACHIEVEMENTS — 2 cột compact ───────────────────────── */
  .achievements-section {
    padding: 28px 14px !important;
  }

  .achievements-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .achievement-card {
    padding: 1rem 0.85rem !important;
  }

  .achievement-desc {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
  }

  /* ── 6. KHÓA TRÀN NGANG TOÀN TRANG ─────────────────────────── */
  html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  *, *::before, *::after {
    box-sizing: border-box !important;
  }

  /* ── 7. NAVBAR: theme switcher không rớt dòng ──────────────── */
  .nav-container {
    flex-wrap: nowrap !important;
    overflow: hidden !important;
  }

  .theme-selector-dropdown {
    flex-shrink: 0 !important;
    position: relative !important;
  }

  .theme-dropdown-menu {
    right: 0 !important;
    left: auto !important;
    min-width: 170px !important;
  }

  .nav-actions {
    flex-shrink: 0 !important;
  }

  /* ── 8. BIỂU ĐỒ Chart.js ─────────────────────────────────── */
  .chart-wrapper,
  .radar-canvas-wrap,
  .rpg-radar-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #rpg-radar-chart,
  .radar-canvas-wrap canvas {
    max-width: 100% !important;
    height: 270px !important;
  }

  /* ── 9. HỘP THỜI GIAN TUỔI 22 ───────────────────────────── */
  .time-capsule-section {
    padding: 28px 14px !important;
  }

  /* ── 10. QUẦY IN VÉ LƯU NIỆM ──────────────────────────────── */
  .ticket-station-section {
    padding: 28px 14px !important;
  }

  .ticket-station-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── 11. MODAL CHIẾU PHIM & MINI-GAME ──────────────────────── */
  .modal-dialog,
  .game-dialog,
  .cinema-dialog,
  .filmstrip-dialog {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  /* ── 12. PADDING CUỐI TRANG: tránh hộp nhạc che nút ─────────
     Giữ khoảng đệm hiện có và thêm 75px cho vùng cuối trang. */
  body {
    padding-bottom: 159px !important;
  }

  .museum-footer {
    padding-bottom: 84px !important;
  }

  /* ── 13. OVERFLOW-WRAP toàn bộ text dài ──────────────────── */
  .ticket-message-quote,
  .capsule-message-body,
  .back-quote,
  .hero-badge,
  .badge-text {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }

  /* ── 14. FILMSTRIP MODAL sizing ──────────────────────────── */
  .filmstrip-dialog {
    width: 96vw !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
  }

  .filmstrip-modal-header {
    padding: 0.85rem 1rem !important;
  }

  /* ── 15. MUSIC PLAYER NỔI: giữ góc phải thấp ─────────────── */
  .floating-bg-player {
    bottom: 10px !important;
    right: 10px !important;
    z-index: 999 !important;
  }
}

/* ========================================================
   SUPPLEMENT 2 — CÁC TINH CHỈNH BỔ SUNG (20/11/2026)
   Toàn bộ dùng var(--...) để tương thích 4 Theme nền.
   ======================================================== */

/* ── 1. ẨN KHỐI NHẠC CHỦ ĐỀ GIAI ĐOẠN TRÊN TRANG CHÍNH ──
   Giữ nguyên <audio> ẩn, chỉ ẩn phần giao diện .music-player-card
   trong .stage-top-grid (không ảnh hưởng filmstrip/cinema)         */
.stage-top-grid .music-player-card {
  display: none !important;
}

/* ── 2. ĐỒNG BỘ MÀU 4 NÚT SECONDARY Ở HERO (kính tối) ───────────
   .btn-glass (Lời tựa) đã có style kính; đồng bộ nốt hover border */
.btn-glass {
  border-color: var(--primary-accent) !important;
}
.btn-glass:hover {
  border-color: var(--primary-gold-light) !important;
}

/* ── 3. RESPONSIVE MOBILE SUPPLEMENT (@media max-width: 768px) ─── */
@media (max-width: 768px) {
  .brand-logo-img {
    width: 28px;
    height: 28px;
  }

  .rpg-avatar {
    width: 92px;
    height: 92px;
    border-radius: 12px;
  }

  .btn-open-archive {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  /* 3a. Hero Section — đủ padding-top tránh bị navbar che */
  .hero-section {
    padding-top: 132px !important;
  }

  /* 3b. Navbar — 4 nút chức năng gọn, không bị cắt */
  .nav-actions {
    gap: 5px !important;
    flex-wrap: nowrap !important;
  }

  .nav-btn {
    padding: 5px 8px !important;
    font-size: 0.74rem !important;
    gap: 3px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* 3c. Theme dropdown: không bị overflow:hidden che khuất */
  .nav-container {
    overflow: visible !important;
  }

  .sticky-nav {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999 !important;
    overflow: visible !important;
    transform: none !important;
  }

  .theme-selector-dropdown {
    position: relative !important;
    overflow: visible !important;
  }

  .theme-dropdown-menu {
    position: absolute !important;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10005 !important;
    pointer-events: auto !important;
    min-width: 180px !important;
  }

  /* 3d. CTA buttons — sửa lỗi tràn chữ "Chiếu phim toàn hành trình" */
  .hero-cta-group .btn {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.25 !important;
    text-align: center !important;
    padding: 10px 8px !important;
    font-size: 0.8rem !important;
    box-sizing: border-box !important;
  }

  /* Nút đầu (Bắt đầu hành trình) giữ font lớn hơn chút */
  .hero-cta-group .btn:first-child {
    font-size: 0.88rem !important;
    padding: 11px 10px !important;
  }

  /* 3e. Filter tabs — 3 cột đều nhau, không tràn mép */
  .filter-wrapper {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    width: 100% !important;
  }

  .filter-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--radius-md) !important;
    padding: 4px !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  .filter-tab {
    padding: 8px 4px !important;
    min-width: 0 !important;
    font-size: 0.73rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    text-align: center !important;
    border-radius: var(--radius-sm) !important;
    flex-direction: column !important;
    gap: 0.2rem !important;
    justify-content: center !important;
  }

  .tab-icon {
    font-size: 1rem !important;
  }

  /* 3f. Time Capsule — khóa tràn viền */
  .time-capsule-section,
  .capsule-container,
  .capsule-layout-grid,
  .capsule-form-panel,
  .capsule-list-panel,
  .capsule-items-scroll,
  .capsule-card,
  .capsule-card-top,
  .capsule-message-body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .capsule-layout-grid {
    grid-template-columns: 1fr !important;
    overflow: hidden !important;
  }

  .capsule-card {
    overflow: hidden !important;
  }

  .capsule-card-top {
    overflow: hidden !important;
  }

  /* 3g. Souvenir Ticket — khóa tràn viền */
  .ticket-station-section,
  .ticket-container,
  .ticket-station-grid,
  .ticket-form-card,
  .ticket-preview-wrapper,
  .ticket-preview-panel,
  .museum-ticket,
  .ticket-inner-border {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .ticket-station-grid {
    grid-template-columns: 1fr !important;
  }

  .museum-ticket {
    padding: 14px !important;
  }

  /* Cho phép chữ, tên, mã vé tự xuống dòng */
  .ticket-inner,
  .ticket-inner-border,
  [class*="ticket-"] {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }
}

/* ========================================================
   SUPPLEMENT 3 — Ticket & Capsule Mobile Fix (20/11/2026)
   Sửa triệt để cắt chữ trên vé lưu niệm và capsule mobile.
   ======================================================== */

@media (max-width: 768px) {

  /* ══════════════════════════════════════════════════
     PHẦN 1: TẤM VÉ LƯU NIỆM — gỡ width cứng, fit màn hình
     ══════════════════════════════════════════════════ */

  /* Wrapper toàn tấm vé */
  .museum-ticket,
  .ticket-outer-border,
  .ticket-inner-border,
  .ticket-main-section,
  .ticket-stub-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Bỏ chiều rộng cứng có thể được set inline / JS */
  .museum-ticket {
    padding: 6px !important;
  }

  .ticket-inner-border {
    flex-direction: column !important;
    min-height: auto !important;
  }

  .ticket-main-section {
    padding: 10px 12px !important;
    gap: 0.75rem !important;
  }

  /* ── Header: icon bảo tàng + tiêu đề ── */
  .ticket-header-row {
    gap: 0.5rem !important;
    align-items: flex-start !important;
  }

  .ticket-logo-mark {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
  }

  .ticket-museum-brand {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    letter-spacing: 0.02em !important;
  }

  .ticket-category-tag {
    font-size: 0.6rem !important;
  }

  /* Stamp nhỏ lại tránh đè chữ */
  .ticket-vintage-stamp {
    top: 0 !important;
    right: 0 !important;
  }

  .stamp-inner {
    width: 48px !important;
    height: 48px !important;
  }

  /* ── Data Grid 2 cột thông tin ── */
  .ticket-data-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 0.5rem 0 !important;
  }

  .ticket-field {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .field-k {
    font-size: 0.62rem !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .field-v {
    font-size: 0.8rem !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
    line-height: 1.3 !important;
  }

  .field-v.visitor-name {
    font-size: 0.85rem !important;
  }

  .field-v.time-text {
    font-size: 0.72rem !important;
  }

  .field-v.serial-code {
    font-size: 0.75rem !important;
    letter-spacing: 0.03em !important;
  }

  /* ── Hộp thông điệp & dòng tên ảnh ── */
  .ticket-dedication-box {
    padding: 0.5rem 0.6rem !important;
  }

  .dedication-quote,
  .dedication-source,
  .ticket-message-quote,
  .ticket-quote-source {
    font-size: 0.78rem !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    max-width: 100% !important;
  }

  /* Toàn bộ class bắt đầu bằng ticket- đều constrained */
  [class^="ticket-"],
  [class*=" ticket-"] {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  /* Stub section (nếu có) */
  .ticket-stub-section {
    padding: 10px 8px !important;
    border-top: 2px dashed rgba(180, 83, 9, 0.4) !important;
    border-left: none !important;
  }

  /* ══════════════════════════════════════════════════
     PHẦN 2: VIÊN NANG (TIME CAPSULE) — hiển thị lời nhắn đầy đủ
     ══════════════════════════════════════════════════ */

  /* Thẻ viên nang: không overflow:hidden khi revealed */
  .capsule-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .capsule-card-top {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  /* Thanh tiêu đề & nhãn tag không tràn */
  .capsule-sender-name {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }

  .capsule-tag-pill {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    max-width: 50% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Hộp lời nhắn khi mở — giãn hết chiều cao */
  .capsule-message-body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .capsule-card.revealed .capsule-message-body {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 12px !important;
    line-height: 1.5 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .capsule-message-body p {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Sealed banner layout fix */
  .capsule-sealed-banner {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    padding: 0.5rem 0.65rem !important;
  }

  .capsule-sealed-status {
    min-width: 0 !important;
    overflow-wrap: break-word !important;
  }

  /* Scroll danh sách capsule */
  .capsule-items-scroll {
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
  }
}

/* ========================================================
   SUPPLEMENT 4 — TICKET & CAPSULE TRIỆT ĐỂ (20/11/2026)
   Ghi đè min-width: 680px, width: 195px cứng + tinh chỉnh
   theo specs mới. Tương thích 4 Theme.
   ======================================================== */

@media (max-width: 768px) {

  /* ══════════════════════════════════════════════════════
     A. TẤM VÉ LƯU NIỆM — gỡ width cứng triệt để
     ══════════════════════════════════════════════════════ */

  /* Gỡ min-width: 680px trên mobile (gốc dòng 3931) */
  .souvenir-ticket {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .ticket-render-container {
    overflow-x: hidden !important;
    justify-content: center !important;
  }

  /* Outer / Inner border */
  .ticket-outer-border {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 5px !important;
  }

  .ticket-inner-border {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
    min-height: auto !important;
  }

  .ticket-main-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 10px 10px !important;
    gap: 0.65rem !important;
  }

  /* ── A1. Header: icon + tiêu đề ── */
  .ticket-header-row {
    gap: 0.45rem !important;
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
    padding-right: 50px !important; /* chừa chỗ cho stamp */
  }

  .ticket-logo-mark {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
  }

  .ticket-header-text {
    min-width: 0 !important;
    flex: 1 !important;
  }

  .ticket-museum-brand {
    font-size: 0.9rem !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    letter-spacing: 0.01em !important;
  }

  .ticket-category-tag {
    font-size: 0.58rem !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    letter-spacing: 0.03em !important;
  }

  /* Stamp nhỏ, sát góc */
  .ticket-vintage-stamp {
    top: -2px !important;
    right: -2px !important;
  }

  .stamp-inner {
    width: 44px !important;
    height: 44px !important;
  }

  .stamp-text { font-size: 0.5rem !important; }
  .stamp-date { font-size: 0.52rem !important; }

  /* ── A2. Data Grid 2 cột ── */
  .ticket-data-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 0.4rem 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ticket-field {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .field-k {
    font-size: 0.6rem !important;
    letter-spacing: 0.2px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .field-v {
    font-size: 0.78rem !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
    line-height: 1.3 !important;
  }

  .field-v.visitor-name {
    font-size: 0.82rem !important;
  }

  .field-v.time-text {
    font-size: 0.7rem !important;
  }

  .field-v.serial-code {
    font-size: 0.72rem !important;
    letter-spacing: 0.02em !important;
  }

  .field-v.stage-name {
    font-size: 0.78rem !important;
  }

  /* ── A3. Hộp thông điệp & trích dẫn ── */
  .ticket-dedication-box {
    padding: 10px !important;
    gap: 0.25rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .dedication-label {
    font-size: 0.58rem !important;
    gap: 0.2rem !important;
  }

  .dedication-quote {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .dedication-source {
    font-size: 0.68rem !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
  }

  /* ── A4. Đường răng cưa xé vé: ẩn trên mobile, layout dọc ── */
  .ticket-tear-divider {
    display: none !important;
  }

  /* ── A5. Cuống vé (stub) chuyển dọc ── */
  .ticket-stub-section {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 10px 8px !important;
    border-top: 2px dashed rgba(180, 83, 9, 0.4) !important;
    border-left: none !important;
    flex-shrink: 1 !important;
    gap: 0.5rem !important;
  }

  .stub-brand {
    font-size: 0.72rem !important;
  }

  .stub-v,
  .stub-k {
    font-size: 0.68rem !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    white-space: normal !important;
  }

  .stub-barcode-container {
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .barcode-digits {
    font-size: 0.6rem !important;
    letter-spacing: 0.5px !important;
    overflow-wrap: anywhere !important;
  }

  /* ══════════════════════════════════════════════════════
     B. KHO LƯU TRỮ VIÊN NANG — rà soát triệt để
     ══════════════════════════════════════════════════════ */

  /* Form tạo viên nang mới */
  .capsule-form-panel,
  .capsule-form-panel input,
  .capsule-form-panel textarea,
  .capsule-form-panel select,
  .capsule-form-panel button,
  .capsule-form-panel .capsule-form {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Danh sách viên nang */
  .capsule-list-panel,
  .capsule-items-scroll {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .capsule-items-scroll {
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
  }

  /* Từng thẻ viên nang */
  .capsule-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  .capsule-card-top {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    flex-wrap: wrap !important;
  }

  .capsule-sender-info {
    min-width: 0 !important;
    overflow: hidden !important;
    flex: 1 !important;
  }

  .capsule-sender-name {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
    white-space: normal !important;
  }

  .capsule-tag-pill {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .capsule-meta-date {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .capsule-sealed-banner {
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    padding: 0.5rem 0.6rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Lời nhắn khi mở — giãn hết chiều cao tự nhiên */
  .capsule-message-body {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .capsule-card.revealed .capsule-message-body {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 12px !important;
    line-height: 1.5 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .capsule-message-body p {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: 100% !important;
    margin: 0 !important;
    line-height: 1.5 !important;
  }

  .capsule-card-footer {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ========================================================
   SUPPLEMENT 5 — SỬA LỖI NAVBAR MOBILE v22 (20/11/2026)
   Đảm bảo nút Đổi màu, Nhạc nền bấm được trên mobile.
   ======================================================== */

/* ── 1. Nâng z-index navbar lên trên mọi section ────────── */
.sticky-nav {
  z-index: 9999 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

/* ── 2. Nav container không clamp chiều cao ─────────────── */
.nav-container {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}

/* ── 3. Tất cả nút trên navbar bấm được ─────────────────── */
.nav-btn,
.nav-actions,
.theme-selector-dropdown,
#theme-toggle-btn,
.theme-option-btn,
#global-audio-toggle,
#btn-nav-game {
  pointer-events: auto !important;
  position: relative;
  z-index: 10000 !important;
}

/* ── 4. Dropdown menu nổi lên trên hero section ──────────── */
.theme-dropdown-menu {
  pointer-events: auto !important;
  z-index: 10001 !important;
}

.theme-selector-dropdown.open .theme-dropdown-menu {
  pointer-events: auto !important;
  z-index: 10001 !important;
}

@media (max-width: 768px) {

  /* ── 5. Mobile: navbar và container thoải mái chiều cao ─ */
  .sticky-nav {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .nav-container {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    pointer-events: auto !important;
  }

  /* ── 6. Nav-actions: cuộn ngang mượt, không bị clip ───── */
  .nav-actions {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    pointer-events: auto !important;
    z-index: 10000 !important;
    position: relative !important;
  }

  /* ── 7. Từng nút: vùng chạm đủ lớn ─────────────────────── */
  .nav-btn {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10000 !important;
    min-height: 36px !important;
    touch-action: manipulation !important;
  }

  /* ── 8. Theme selector & dropdown ────────────────────────── */
  .theme-selector-dropdown {
    position: relative !important;
    overflow: visible !important;
    z-index: 10000 !important;
    pointer-events: auto !important;
  }

  .theme-dropdown-menu {
    position: absolute !important;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10005 !important;
    pointer-events: auto !important;
    min-width: 180px !important;
  }

  /* ── 9. Hero section KHÔNG được đè lên navbar ───────────── */
  .hero-section {
    position: relative !important;
    z-index: 1 !important;
  }
}


/* ========================================================
   MOBILE NAVBAR — CHỐT CUỐI (≤768px)
   ======================================================== */
@media (max-width: 768px) {
  .sticky-nav,
  #sticky-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    z-index: 9999 !important;
  }

  .nav-container,
  .nav-actions {
    height: auto !important;
    max-height: none !important;
  }

  .nav-container {
    overflow: visible !important;
  }

  .nav-actions {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: auto !important;
    touch-action: pan-x !important;
  }

  .nav-chapters,
  #nav-chapters-bar {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .theme-selector-dropdown {
    position: relative !important;
    overflow: visible !important;
    z-index: 10005 !important;
  }

  .theme-dropdown-menu,
  #theme-dropdown-menu {
    display: none !important;
    position: fixed !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: none !important;
    pointer-events: none !important;
  }

  .theme-selector-dropdown.open .theme-dropdown-menu,
  #theme-selector-dropdown.open #theme-dropdown-menu {
    position: fixed !important;
    top: 124px !important;
    left: 12px !important;
    width: 210px !important;
    min-width: 210px !important;
    display: flex !important;
    flex-direction: column !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
  }
}

/* ========================================================
   MODAL / LIGHTBOX — GIỮ NAVBAR NGOÀI NỘI DUNG XEM ẢNH
   ======================================================== */
.modal.active,
.lightbox-modal.active,
.cinema-modal.active {
  z-index: 100000 !important;
}

.modal-close-btn,
.lightbox-btn,
.cinema-close-btn,
#lightbox-btn-close,
#cinema-btn-close,
#btn-close-filmstrip,
#btn-close-game {
  z-index: 100001 !important;
  pointer-events: auto !important;
}

body.modal-open #sticky-header,
body.modal-open .sticky-nav,
body.modal-open .theme-selector-dropdown,
body.modal-open #theme-selector-dropdown {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body:has(.modal.active),
body:has(.lightbox-modal.active),
body:has(.cinema-modal.active) {
  overflow: hidden;
}

body:has(.modal.active) #sticky-header,
body:has(.lightbox-modal.active) #sticky-header,
body:has(.cinema-modal.active) #sticky-header,
body:has(.modal.active) .theme-selector-dropdown,
body:has(.lightbox-modal.active) .theme-selector-dropdown,
body:has(.cinema-modal.active) .theme-selector-dropdown {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Thu gọn và mở tâm sự từng giai đoạn */
.stage-quotes-toggle {
  margin-top: 1.25rem;
}

.btn-toggle-stage-quotes {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 9999px;
  border: 1px solid var(--bg-card-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-toggle-stage-quotes .quotes-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stage-quotes-content {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.stage-quotes-content[hidden] {
  display: none;
}

.stage-quote-item {
  padding: 1rem;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.stage-quote-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.stage-quote-item h4 {
  margin: 0.25rem 0;
}

.stage-quote-item p {
  margin: 0;
  line-height: 1.65;
}

/* Nút chuyển ảnh Lightbox cố định ở mép phải/trái */
.lightbox-prev,
.lightbox-next {
  position: fixed !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
  color: #fff !important;
  font-size: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 100005 !important;
  backdrop-filter: blur(6px);
}

.lightbox-prev {
  left: 12px !important;
}

.lightbox-next {
  right: 12px !important;
}

@media (max-width: 768px) {
  .utility-launcher-container {
    grid-template-columns: 1fr;
  }

  .utility-launch-btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .utility-close-btn {
    right: 10px;
    top: 10px;
  }

  .modal-close-btn,
  #lightbox-btn-close,
  #cinema-btn-close,
  #btn-close-filmstrip,
  #btn-close-game {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    font-size: 1.25rem !important;
    z-index: 100001 !important;
  }
}

/* RPG card presentation overrides */
.rpg-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(251, 191, 36, 0.13), transparent 46%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.12), transparent 48%),
    linear-gradient(145deg, rgba(13, 22, 42, 0.96), rgba(8, 13, 26, 0.98));
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  border-radius: 12px;
  outline: none;
  box-shadow:
    0 14px 38px rgba(0, 0, 0, 0.42),
    0 0 26px rgba(251, 191, 36, 0.1),
    inset 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.rpg-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(251, 191, 36, 0.78), rgba(251, 191, 36, 0.78)) 11px 11px / 12px 1px,
    linear-gradient(rgba(251, 191, 36, 0.78), rgba(251, 191, 36, 0.78)) 11px 11px / 1px 12px,
    linear-gradient(rgba(251, 191, 36, 0.78), rgba(251, 191, 36, 0.78)) calc(100% - 23px) 11px / 12px 1px,
    linear-gradient(rgba(251, 191, 36, 0.78), rgba(251, 191, 36, 0.78)) calc(100% - 11px) 11px / 1px 12px,
    linear-gradient(rgba(251, 191, 36, 0.78), rgba(251, 191, 36, 0.78)) 11px calc(100% - 11px) / 12px 1px,
    linear-gradient(rgba(251, 191, 36, 0.78), rgba(251, 191, 36, 0.78)) 11px calc(100% - 23px) / 1px 12px,
    linear-gradient(rgba(251, 191, 36, 0.78), rgba(251, 191, 36, 0.78)) calc(100% - 23px) calc(100% - 11px) / 12px 1px,
    linear-gradient(rgba(251, 191, 36, 0.78), rgba(251, 191, 36, 0.78)) calc(100% - 11px) calc(100% - 23px) / 1px 12px;
  background-repeat: no-repeat;
}

.rpg-card::after {
  display: none;
}

.rpg-card > * {
  position: relative;
  z-index: 2;
}

.rpg-header {
  align-items: center;
}

.rpg-avatar {
  position: relative;
  overflow: visible;
  border: 2px solid rgba(251, 191, 36, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.35), 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.rpg-avatar img {
  display: block;
  border-radius: 50%;
}

.rpg-avatar-lv {
  position: absolute;
  left: 50%;
  bottom: -12px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 2px 10px;
  border: 1px solid #fbbf24;
  border-radius: 999px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  box-shadow: 0 2px 12px rgba(251, 191, 36, 0.35);
  color: #3a2500;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.rpg-title-group {
  min-width: 0;
}

.rpg-title-group > * {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rpg-fate-badge {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}

.stat-bar-value-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.rpg-mainstat-bar {
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.rpg-mainstat-bar-inner {
  min-width: 0;
  background: linear-gradient(90deg, #06b6d4, #10b981, #fbbf24);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
  overflow: hidden;
}

.rpg-mainstat-bar-inner::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 32%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: rpg-bar-shimmer 2.8s ease-in-out infinite;
}

@keyframes rpg-bar-shimmer {
  from { transform: translateX(-120%); }
  to { transform: translateX(320%); }
}

.rpg-mainstat-bar-dot {
  right: 0;
  width: 10px;
  height: 10px;
  border: 1px solid #fff4c2;
}

.rpg-mainstat-badge {
  margin-left: 0;
  padding: 1px 7px;
  font-size: 0.7rem;
  line-height: 1.3;
}

.rpg-mainstat-badge.cuc-pham {
  color: #fbbf24;
  border-color: #fbbf24;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.rpg-mainstat-badge.thuong-pham {
  color: #c4b5fd;
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.rpg-mainstat-badge.tiem-nang {
  color: #34d399;
  border-color: #10b981;
}

.rpg-substats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.rpg-substat-card {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.rpg-substat-name {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rpg-substat-flames {
  position: relative;
  display: flex;
  gap: 2px;
  margin-top: 6px;
  padding-bottom: 22px;
}

.rpg-flame {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.rpg-substat-tier {
  right: 0;
  bottom: 0;
  color: #fbbf24;
  font-size: 0.68rem;
}

@media (max-width: 768px) {
  .rpg-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .rpg-header {
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 1.5rem 0.75rem 1.75rem;
    text-align: center;
  }

  .rpg-title-group,
  .rpg-title-group > * {
    width: 100%;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
  }

  .rpg-fate-badge {
    justify-content: center;
    margin-inline: auto;
  }

  .rpg-substats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Isolated year-guess dialog styles */
.year-guess-modal {
  z-index: 100002 !important;
}

.year-guess-modal.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto !important;
  z-index: 100002 !important;
}

.year-guess-modal .modal-backdrop {
  z-index: 0;
}

.year-guess-dialog {
  position: relative;
  z-index: 1;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 92% !important;
  max-width: 440px !important;
  max-height: 90vh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  margin: auto !important;
  padding: 20px !important;
  border: 1.5px solid rgba(168, 85, 247, 0.55) !important;
  border-radius: 20px !important;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(9, 13, 28, 0.98)) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75) !important;
}

.year-guess-dialog .game-modal-header {
  position: sticky;
  top: -20px;
  z-index: 5;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0 0 12px;
  gap: 12px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.98), rgba(9, 13, 28, 0.98));
  border-bottom: 1px solid rgba(168, 85, 247, 0.25);
}

.year-guess-dialog .game-title-group {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.year-guess-dialog .game-modal-title {
  margin: 0;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  line-height: 1.25;
}

.year-guess-dialog .game-score-badge {
  white-space: nowrap;
}

.year-guess-dialog #btn-close-game {
  flex: 0 0 44px;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  font-size: 1.7rem;
  line-height: 1;
}

.year-guess-dialog .game-status-bar,
.year-guess-dialog .game-body {
  width: 100%;
  padding: 0;
}

.year-guess-dialog .game-status-bar {
  gap: 10px;
  border: 0;
  background: transparent;
}

.year-guess-dialog .game-status-info {
  justify-content: flex-start;
}

.year-guess-dialog .game-body {
  max-height: none;
  overflow: visible;
  gap: 14px;
}

.year-guess-dialog .game-photo-box {
  width: 100%;
  gap: 10px;
}

.year-guess-dialog .game-photo-wrap {
  width: 100%;
  max-width: none;
  height: 210px !important;
  max-height: 210px !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.year-guess-dialog .game-year-input-wrap {
  flex-direction: row;
  max-width: none;
  margin: 0;
}

.year-guess-dialog .game-year-submit {
  min-width: 112px;
}

.year-guess-dialog .game-reveal-card {
  width: 100%;
  padding: 14px;
  border-color: rgba(248, 113, 113, 0.65);
}

.year-guess-dialog .game-reveal-card.is-correct {
  border-color: rgba(52, 211, 153, 0.9);
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.22);
}

.year-guess-dialog .game-reveal-card.is-wrong {
  border-color: rgba(251, 146, 60, 0.9);
  box-shadow: 0 0 22px rgba(249, 115, 22, 0.18);
}

.year-guess-dialog .game-reveal-hint:not([hidden]) {
  color: #fdba74;
  font-weight: 800;
}

.year-guess-dialog .game-next-btn {
  align-self: stretch;
}

.year-guess-dialog .game-result-screen {
  width: 100%;
  padding: 12px 0;
}

@media (max-width: 380px) {
  .year-guess-dialog {
    width: 96% !important;
    padding: 16px !important;
  }

  .year-guess-dialog .game-year-input-wrap {
    flex-direction: column;
  }

  .year-guess-dialog .game-year-submit {
    width: 100%;
  }
}

/* Cultivation sky layer */
body.museum-body {
  isolation: isolate;
}

#cultivation-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 24%, rgba(16, 185, 129, 0.12), transparent 34%),
    radial-gradient(ellipse at 82% 76%, rgba(245, 158, 11, 0.09), transparent 36%),
    linear-gradient(160deg, rgba(4, 13, 11, 0.3), rgba(8, 20, 18, 0.52));
}

body.museum-body > :not(#cultivation-bg):not(.ambient-glow):not(#sticky-header):not(.modal):not(.lightbox-modal):not(.cinema-modal):not(#floating-bg-player):not(#auth-modal) {
  position: relative;
  z-index: 1;
}

.qi-mist {
  position: absolute;
  width: min(55vw, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.16;
  animation: qi-mist-drift 34s ease-in-out infinite alternate;
}

.qi-mist-one {
  top: 4%;
  left: -18%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.75), transparent 68%);
}

.qi-mist-two {
  right: -20%;
  bottom: -8%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.72), transparent 68%);
  animation-delay: -17s;
}

.star-chart {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(82vw, 820px);
  height: auto;
  transform: translate(-50%, -50%);
  overflow: visible;
  opacity: 0.13;
  animation: star-chart-rotation 70s linear infinite;
  will-change: transform;
}

.star-chart circle,
.star-chart polygon,
.star-chart path {
  fill: none;
  stroke: rgba(125, 211, 252, 0.7);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.star-chart polygon:nth-of-type(2) {
  stroke: rgba(251, 191, 36, 0.68);
}

.star-chart .star-chart-node {
  fill: rgba(251, 191, 36, 0.86);
  stroke: none;
}

.qi-sword {
  position: absolute;
  display: block;
  width: clamp(54px, 8vw, 106px);
  height: 24px;
  opacity: 0.23;
  filter: drop-shadow(0 0 8px rgba(103, 232, 249, 0.65));
  animation: sword-glide 22s ease-in-out infinite;
  will-change: transform;
  z-index: 2;
}

.qi-sword::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -82%;
  width: 82%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.1), rgba(245, 158, 11, 0.8));
  filter: blur(1px);
}

.qi-sword svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.qi-sword path {
  fill: rgba(103, 232, 249, 0.42);
  stroke: rgba(191, 245, 255, 0.86);
  stroke-width: 1;
}

.sword-one { top: 18%; left: 10%; transform: rotate(-24deg); }
.sword-two { top: 38%; right: 9%; opacity: 0.29; transform: rotate(22deg); animation-delay: -5s; }
.sword-three { bottom: 20%; left: 17%; opacity: 0.2; transform: rotate(18deg); animation-delay: -11s; }
.sword-four { right: 18%; bottom: 12%; opacity: 0.25; transform: rotate(-16deg); animation-delay: -8s; }

.qi-stone {
  position: absolute;
  width: 20px;
  height: 23px;
  opacity: 0.24;
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.9), rgba(251, 191, 36, 0.78));
  clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.68));
  animation: qi-float 16s ease-in-out infinite alternate;
  will-change: transform;
}

.stone-one { top: 13%; right: 28%; }
.stone-two { top: 55%; left: 7%; opacity: 0.19; animation-delay: -6s; }
.stone-three { right: 12%; bottom: 35%; opacity: 0.3; animation-delay: -10s; }
.stone-four { bottom: 8%; left: 48%; opacity: 0.21; animation-delay: -3s; }

.xianxia-moon {
  position: absolute;
  top: 11%;
  right: 17%;
  width: clamp(54px, 8vw, 92px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, rgba(255, 247, 214, 0.55), rgba(214, 190, 132, 0.16) 58%, transparent 72%);
  box-shadow: 0 0 48px rgba(252, 211, 121, 0.12);
  opacity: 0.34;
}

.taiji-orbit {
  position: absolute;
  top: 14%;
  left: 50%;
  width: min(52vw, 500px);
  aspect-ratio: 1;
  transform: translateX(-50%);
  opacity: 0.075;
  animation: taiji-rotation 120s linear infinite;
  will-change: transform;
}

.taiji-orbit svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.taiji-orbit circle,
.taiji-orbit path {
  fill: none;
  stroke: rgba(45, 212, 191, 0.9);
  stroke-width: 0.75;
}

.taiji-orbit circle:nth-of-type(2),
.taiji-orbit path:first-of-type {
  stroke: rgba(245, 158, 11, 0.85);
}

.floating-islands {
  position: absolute;
  top: 18%;
  left: 50%;
  width: min(100vw, 1000px);
  height: auto;
  transform: translateX(-50%);
  opacity: 0.15;
  fill: rgba(20, 55, 45, 0.88);
  stroke: rgba(252, 211, 121, 0.42);
  stroke-width: 1.2;
  filter: drop-shadow(0 12px 18px rgba(4, 13, 11, 0.5));
}

.bamboo-shadow {
  position: absolute;
  top: -3%;
  width: clamp(100px, 18vw, 220px);
  height: auto;
  fill: rgba(16, 185, 129, 0.12);
  stroke: rgba(45, 212, 191, 0.2);
  stroke-width: 1.3;
  opacity: 0.7;
  animation: bamboo-sway 12s ease-in-out infinite alternate;
  transform-origin: top center;
  will-change: transform;
}

.bamboo-left { left: -2%; }
.bamboo-right { right: -2%; animation-delay: -6s; }

.ancient-seals {
  position: absolute;
  top: 36%;
  color: rgba(245, 158, 11, 0.85);
  font: 600 clamp(14px, 2vw, 22px)/2.2 'Noto Serif', serif;
  letter-spacing: 0.2em;
  opacity: 0.06;
  text-align: center;
  animation: seal-breathe 8s ease-in-out infinite;
}

.seal-left { left: 3%; }
.seal-right { right: 3%; animation-delay: -4s; }

.flying-crane {
  position: absolute;
  width: clamp(42px, 7vw, 84px);
  height: auto;
  fill: none;
  stroke: rgba(208, 228, 213, 0.45);
  stroke-width: 1.7;
  opacity: 0.24;
  animation: crane-flight 38s linear infinite;
  will-change: transform;
}

.crane-one { top: 24%; left: 8%; }
.crane-two { top: 31%; right: 10%; transform: scaleX(-1); animation-delay: -19s; }

.flying-cultivator {
  position: absolute;
  top: 34%;
  left: 30%;
  width: clamp(60px, 8vw, 112px);
  height: auto;
  opacity: 0.22;
  filter: drop-shadow(0 0 12px rgba(45, 212, 191, 0.45));
  animation: cultivator-flight 48s ease-in-out infinite;
  will-change: transform;
}

.cultivator-sword,
.cultivator-trails {
  fill: none;
  stroke: rgba(252, 211, 121, 0.9);
  stroke-width: 2;
}

.cultivator-robe {
  fill: rgba(45, 212, 191, 0.32);
  stroke: rgba(179, 244, 224, 0.6);
  stroke-width: 1.2;
}

.cultivator-body {
  fill: rgba(252, 211, 121, 0.82);
}

.immortal-landscape {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: clamp(190px, 36vh, 360px);
  opacity: 0.28;
}

.mountain-back {
  fill: rgba(18, 49, 41, 0.58);
  stroke: rgba(45, 212, 191, 0.18);
  stroke-width: 1;
}

.mountain-front {
  fill: rgba(5, 20, 16, 0.92);
  stroke: rgba(16, 185, 129, 0.24);
  stroke-width: 1.1;
}

.immortal-gate,
.pavilion-roof {
  fill: none;
  stroke: rgba(245, 190, 94, 0.36);
  stroke-width: 3;
  stroke-linejoin: round;
}

.xianxia-cloud {
  position: absolute;
  width: 54vw;
  height: 15vh;
  min-height: 70px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(101, 190, 160, 0.1), transparent 70%);
  filter: blur(16px);
  opacity: 0.6;
  animation: cloud-drift 52s ease-in-out infinite alternate;
  will-change: transform;
}

.cloud-one { left: -18%; bottom: 24%; }
.cloud-two { right: -20%; bottom: 39%; animation-delay: -18s; }
.cloud-three { left: 27%; bottom: 5%; animation-delay: -34s; }

.bamboo-leaf {
  position: absolute;
  width: 7px;
  height: 20px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(145deg, rgba(167, 243, 208, 0.82), rgba(16, 185, 129, 0.16));
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.26);
  opacity: 0.22;
  animation: leaf-drift 23s linear infinite;
  will-change: transform;
}

.leaf-one { top: 12%; left: 8%; animation-delay: -1s; }
.leaf-two { top: 26%; left: 18%; animation-delay: -8s; }
.leaf-three { top: 41%; left: 4%; animation-delay: -15s; }
.leaf-four { top: 17%; right: 11%; animation-delay: -4s; }
.leaf-five { top: 34%; right: 6%; animation-delay: -12s; }
.leaf-six { top: 52%; right: 16%; animation-delay: -19s; }

.qi-firefly {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fcd98a;
  box-shadow: 0 0 9px 3px rgba(245, 158, 11, 0.45), 0 0 16px rgba(45, 212, 191, 0.4);
  opacity: 0.28;
  animation: firefly-rise 18s ease-in-out infinite;
  will-change: transform;
}

.firefly-one { left: 13%; bottom: 9%; }
.firefly-two { left: 28%; bottom: 5%; animation-delay: -7s; }
.firefly-three { left: 47%; bottom: 13%; animation-delay: -13s; }
.firefly-four { right: 13%; bottom: 7%; animation-delay: -4s; }
.firefly-five { right: 31%; bottom: 14%; animation-delay: -10s; }
.firefly-six { right: 6%; bottom: 24%; animation-delay: -16s; }

.meridian-axis {
  position: absolute;
  z-index: 2;
  top: 6%;
  bottom: 6%;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(45, 212, 191, 0.2) 12%, rgba(245, 158, 11, 0.23) 50%, rgba(45, 212, 191, 0.2) 88%, transparent);
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.16);
}

.meridian-light {
  position: absolute;
  top: var(--meridian-progress, 0%);
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fcd98a;
  box-shadow: 0 0 8px 3px rgba(245, 158, 11, 0.58), 0 0 18px 5px rgba(45, 212, 191, 0.28);
}

.tribulation-lightning {
  position: absolute;
  top: 5%;
  right: 12%;
  width: min(30vw, 260px);
  height: auto;
  fill: none;
  stroke: rgba(196, 181, 253, 0.92);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.9));
}

#cultivation-bg.is-tribulation .tribulation-lightning {
  animation: lightning-flash 12s steps(1, end) infinite;
}

@keyframes star-chart-rotation {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes qi-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@keyframes sword-glide {
  0%, 100% { transform: translate3d(-9px, 8px, 0) rotate(-22deg); }
  48% { transform: translate3d(24px, -20px, 0) rotate(-16deg); }
}

@keyframes taiji-rotation {
  to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes bamboo-sway {
  from { transform: rotate(-2deg); }
  to { transform: rotate(2deg); }
}

@keyframes seal-breathe {
  0%, 100% { opacity: 0.04; }
  50% { opacity: 0.08; }
}

@keyframes crane-flight {
  0% { transform: translate3d(-5vw, 0, 0) scale(0.9); }
  50% { transform: translate3d(8vw, -16px, 0) scale(1); }
  100% { transform: translate3d(18vw, 2px, 0) scale(0.92); }
}

@keyframes cultivator-flight {
  0%, 100% { transform: translate3d(-12px, 6px, 0) rotate(-2deg); }
  50% { transform: translate3d(21vw, -22px, 0) rotate(2deg); }
}

@keyframes cloud-drift {
  from { transform: translate3d(-6%, 0, 0); }
  to { transform: translate3d(9%, -8px, 0); }
}

@keyframes leaf-drift {
  0% { transform: translate3d(0, -30px, 0) rotate(0deg); }
  100% { transform: translate3d(34px, 75vh, 0) rotate(240deg); }
}

@keyframes firefly-rise {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.16; }
  50% { transform: translate3d(16px, -45vh, 0); opacity: 0.44; }
}

@keyframes lightning-flash {
  0%, 94%, 96%, 100% { opacity: 0; }
  94.2%, 94.7%, 95.1% { opacity: 0.85; }
  95.5% { opacity: 0.3; }
}

@keyframes qi-mist-drift {
  from { transform: translate3d(-2%, 0, 0) scale(0.96); }
  to { transform: translate3d(4%, 3%, 0) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .star-chart,
  .taiji-orbit,
  .qi-mist,
  .qi-sword,
  .qi-stone,
  .bamboo-shadow,
  .ancient-seals,
  .flying-crane,
  .flying-cultivator,
  .xianxia-cloud,
  .bamboo-leaf,
  .qi-firefly,
  #cultivation-bg.is-tribulation .tribulation-lightning {
    animation: none;
  }
}

html[data-theme="xianxia"] .btn-open-archive::before {
  top: -25% !important;
  right: auto !important;
  bottom: -25% !important;
  left: -60% !important;
  width: 34% !important;
  height: auto !important;
  z-index: 1 !important;
  transform: skewX(-20deg) !important;
  background: linear-gradient(90deg, transparent, rgba(228, 255, 246, 0.78), rgba(255, 221, 150, 0.46), transparent) !important;
  animation: sword-energy-sweep 4.8s ease-in-out infinite !important;
}

html[data-theme="xianxia"] .btn-open-archive::after {
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: auto !important;
  height: auto !important;
  z-index: 1 !important;
  transform: none !important;
  background: none !important;
  animation: none !important;
  opacity: 0.65 !important;
}

html[data-theme="xianxia"] .btn-open-archive:active {
  transform: scale(0.975) !important;
}

html[data-theme="xianxia"] .btn-open-archive:active::after {
  top: -9px !important;
  right: -9px !important;
  bottom: -9px !important;
  left: -9px !important;
  opacity: 0 !important;
}

/* Xianxia liquid-glass finish and reliable background/button layering */
#cultivation-bg,
#cultivation-bg *,
.ambient-glow {
  pointer-events: none !important;
}

#cultivation-bg {
  z-index: 0;
}

#xianxia-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none !important;
}

#cultivation-bg .immortal-landscape,
#cultivation-bg .floating-islands {
  display: none !important;
}

.rpg-card,
.rpg-substat-card,
.music-player-card,
.sticky-nav,
.filmstrip-dialog,
.modal-dialog,
.lightbox-container {
  background-color: rgba(8, 22, 19, 0.42) !important;
  background-image:
    radial-gradient(ellipse at 12% 0%, rgba(116, 255, 222, 0.12), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(6, 20, 17, 0.22)) !important;
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.35),
    inset 0 -1px 2px rgba(45, 212, 191, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

.rpg-card {
  position: relative;
  isolation: isolate;
}

.rpg-card::before,
.rpg-card::after {
  pointer-events: none !important;
}

.rpg-card::before {
  display: none !important;
  content: none !important;
}

.rpg-card::after {
  opacity: 0.035;
}

.rpg-card > * {
  z-index: 2;
}

.rpg-substat-card {
  border-radius: 14px;
}

.sticky-nav {
  background-color: rgba(8, 22, 19, 0.72) !important;
}

.filmstrip-dialog,
.modal-dialog,
.lightbox-container {
  background-color: rgba(8, 22, 19, 0.78) !important;
}

.btn-open-archive {
  position: relative !important;
  z-index: 3 !important;
  isolation: isolate;
  overflow: hidden;
  gap: 0.75rem;
  max-width: 100%;
  color: #e8fff8 !important;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(221, 255, 241, 0.38), transparent 48%),
    linear-gradient(135deg, rgba(23, 133, 104, 0.82), rgba(9, 62, 54, 0.8) 52%, rgba(117, 82, 27, 0.7)) !important;
  border: 1px solid rgba(187, 255, 226, 0.76) !important;
  border-radius: 999px;
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.48),
    inset 0 -2px 3px rgba(0, 35, 29, 0.42),
    0 9px 28px rgba(0, 0, 0, 0.36),
    0 0 20px rgba(45, 212, 191, 0.2) !important;
  text-shadow: 0 1px 8px rgba(0, 25, 20, 0.72);
  transition: transform 180ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.btn-open-archive::before {
  content: '' !important;
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: -60%;
  z-index: 1;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(228, 255, 246, 0.78), rgba(255, 221, 150, 0.46), transparent) !important;
  transform: skewX(-20deg);
  animation: sword-energy-sweep 4.8s ease-in-out infinite !important;
  pointer-events: none !important;
}

.btn-open-archive::after {
  content: '' !important;
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid rgba(224, 255, 242, 0.74);
  border-radius: inherit;
  background: none !important;
  box-shadow: inset 0 0 16px rgba(143, 255, 221, 0.2);
  opacity: 0.65;
  transition: inset 250ms ease, opacity 250ms ease;
  pointer-events: none !important;
}

.btn-open-archive .archive-icon,
.btn-open-archive .archive-icon svg {
  display: block;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
}

.btn-open-archive .archive-icon {
  position: relative;
  z-index: 2;
  color: #9fffe0;
  filter: drop-shadow(0 0 7px rgba(89, 255, 205, 0.9)) drop-shadow(0 0 9px rgba(255, 210, 115, 0.42));
}

.btn-open-archive > span:last-child {
  position: relative;
  z-index: 2;
}

.btn-open-archive:hover {
  filter: brightness(1.12);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.55),
    inset 0 -2px 3px rgba(0, 35, 29, 0.38),
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(45, 212, 191, 0.34) !important;
}

.btn-open-archive:active {
  transform: scale(0.975);
}

.btn-open-archive:active::after {
  inset: -9px;
  opacity: 0;
}

.btn-open-archive:focus-visible {
  outline: 2px solid #a7f3d0;
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .stage-section {
    padding: 32px 0 !important;
  }

  .stage-header-block {
    margin-bottom: 1.25rem !important;
  }

  .stage-top-grid {
    gap: 1rem !important;
    margin-bottom: 1.35rem !important;
  }

  .stage-archive-row {
    margin-top: 1rem !important;
  }
}

@media (max-width: 460px) {
  .hero-section {
    padding-top: 220px !important;
  }

  .stage-section {
    scroll-margin-top: 220px;
  }

  .nav-container {
    flex-wrap: wrap !important;
    overflow: visible !important;
  }

  .nav-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 0.35rem !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    flex: 0 1 auto !important;
    padding: 0.1rem 0 !important;
  }

  .theme-selector-dropdown,
  .theme-selector-dropdown > .nav-btn,
  .nav-actions > .nav-btn {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .nav-btn {
    justify-content: center !important;
    gap: 0.2rem !important;
    padding: 0.34rem 0.25rem !important;
    font-size: 0.64rem !important;
    white-space: nowrap !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-open-archive::before {
    animation: none !important;
  }

  .btn-open-archive,
  .btn-open-archive::after {
    transition: none !important;
  }
}

/* Compact, jade-and-gold cultivation profile */
.rpg-card {
  padding: 22px 24px;
  gap: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(251, 191, 36, 0.12), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(56, 189, 248, 0.12), transparent 44%),
    linear-gradient(155deg, rgba(10, 18, 36, 0.96), rgba(6, 11, 24, 0.98));
}

.rpg-card::after {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: min(74vw, 300px);
  height: min(74vw, 300px);
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 31%, rgba(103, 232, 249, 0.8) 31.2% 31.5%, transparent 31.8% 49%, rgba(251, 191, 36, 0.78) 49.2% 49.5%, transparent 49.8%),
    repeating-conic-gradient(from 7.5deg, rgba(103, 232, 249, 0.8) 0deg 0.5deg, transparent 0.5deg 15deg);
  opacity: 0.06;
  pointer-events: none;
}

.rpg-avatar {
  width: 86px;
  height: 86px;
}

.rpg-avatar-lv {
  bottom: -9px;
  padding: 1px 8px;
  font-size: 0.64rem;
}

.rpg-level-name {
  background: linear-gradient(90deg, #fde68a, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rpg-fate-badge {
  border-color: rgba(251, 191, 36, 0.42);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), rgba(56, 189, 248, 0.1));
  color: #fef3c7;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.08);
}

.rpg-stat-col-title {
  margin-bottom: 8px;
}

.stat-bar-group {
  gap: 8px;
}

.rpg-mainstat-bar {
  height: 7px;
}

.rpg-mainstat-bar-dot {
  width: 7px;
  height: 7px;
}

.rpg-substats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 8px;
}

.rpg-substat-card {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
}

.rpg-substat-name {
  font-size: 0.74rem;
}

.rpg-substat-flames {
  gap: 4px;
  margin-top: 5px;
  padding-bottom: 18px;
}

.rpg-crystal {
  display: inline-flex;
  width: 18px;
  height: 20px;
  flex: 0 0 18px;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.rpg-crystal svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.rpg-crystal.active,
.rpg-crystal.half {
  filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.72));
}

.rpg-crystal.inactive {
  opacity: 0.22;
  filter: grayscale(1);
}

@media (max-width: 768px) {
  .rpg-card {
    padding: 16px 14px !important;
    gap: 12px !important;
  }

  .rpg-header {
    gap: 8px;
    padding: 0;
  }

  .rpg-avatar {
    width: 72px;
    height: 72px;
  }

  .rpg-title-group {
    gap: 2px;
  }

  .rpg-level-name {
    font-size: 1rem;
  }

  .rpg-stats-container {
    gap: 12px;
  }

  .rpg-substats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .rpg-substat-card {
    min-height: 84px;
    padding: 7px 8px;
  }

  .rpg-substat-flames {
    gap: 2px;
  }

  .rpg-crystal {
    width: 14px;
    height: 16px;
    flex-basis: 14px;
  }
}

/* A usable year entry row at every phone width */
.year-guess-dialog .game-year-input-wrap {
  width: 100%;
  gap: 10px;
}

.year-guess-dialog #game-year-input {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  flex: 1 1 auto;
}

@media (max-width: 540px) {
  .year-guess-dialog .game-year-input-wrap {
    flex-direction: column;
    gap: 10px;
  }

  .year-guess-dialog #game-year-input,
  .year-guess-dialog .game-year-submit {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
  }
}

/* Xianxia typography, seals, and sword-energy controls */
html[data-theme="xianxia"] .hero-title,
html[data-theme="xianxia"] .stage-main-title,
html[data-theme="xianxia"] .stage-title,
html[data-theme="xianxia"] .rpg-rank,
html[data-theme="xianxia"] .rpg-level-name {
  font-family: 'Noto Serif', var(--font-serif), serif;
  font-weight: 700;
}

.hero-title-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.hero-title-row .hero-title {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.hero-seal-stamp {
  display: inline-flex;
  flex: 0 0 58px;
  width: 58px;
  height: 68px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transform: rotate(3deg);
  border: 2px solid #b91c1c;
  outline: 1px solid rgba(185, 28, 28, 0.55);
  outline-offset: 3px;
  background: linear-gradient(145deg, rgba(127, 29, 29, 0.88), rgba(69, 10, 10, 0.92));
  box-shadow: inset 0 0 0 2px rgba(254, 202, 202, 0.12), 0 5px 16px rgba(127, 29, 29, 0.24);
  color: #fee2e2;
  font-family: 'Noto Serif', serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
}

html[data-theme="xianxia"] .sticky-nav {
  background: var(--nav-bg);
}

.dot-xianxia {
  background: linear-gradient(135deg, #040d0b 0%, #2dd4bf 52%, #f59e0b 100%);
}

html[data-theme="xianxia"] .theme-badge {
  color: #fef3c7;
  background: linear-gradient(110deg, rgba(16, 185, 129, 0.3), rgba(245, 158, 11, 0.3));
  border: 1px solid rgba(252, 211, 121, 0.38);
}

html[data-theme="xianxia"] .btn-primary,
html[data-theme="xianxia"] .btn-open-archive,
html[data-theme="xianxia"] .utility-launch-btn,
html[data-theme="xianxia"] .year-guess-dialog .game-year-submit,
html[data-theme="xianxia"] .year-guess-dialog .game-next-btn,
html[data-theme="xianxia"] .nav-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(45, 212, 191, 0.58);
  outline: 1px solid rgba(245, 158, 11, 0.28);
  outline-offset: -4px;
  background-image: linear-gradient(115deg, rgba(16, 185, 129, 0.12), rgba(245, 158, 11, 0.1));
}

html[data-theme="xianxia"] .btn-primary,
html[data-theme="xianxia"] .btn-open-archive,
html[data-theme="xianxia"] .year-guess-dialog .game-year-submit,
html[data-theme="xianxia"] .year-guess-dialog .game-next-btn {
  background-image: var(--gold-gradient);
}

html[data-theme="xianxia"] .utility-launch-btn {
  background-image: linear-gradient(115deg, rgba(16, 185, 129, 0.28), rgba(245, 158, 11, 0.22));
}

html[data-theme="xianxia"] .nav-btn::before,
html[data-theme="xianxia"] .btn-primary::before,
html[data-theme="xianxia"] .btn-open-archive::before,
html[data-theme="xianxia"] .utility-launch-btn::before,
html[data-theme="xianxia"] .year-guess-dialog .game-year-submit::before,
html[data-theme="xianxia"] .year-guess-dialog .game-next-btn::before {
  content: '◈';
  position: absolute;
  top: 5px;
  right: 0.7rem;
  left: auto;
  z-index: 3;
  color: #fde68a;
  font-size: 0.68rem;
  line-height: 1;
  text-shadow: 0 0 8px rgba(252, 211, 121, 0.85);
  pointer-events: none;
}

html[data-theme="xianxia"] .nav-btn::before {
  right: 0.45rem;
  top: 5px;
  font-size: 0.58rem;
}

html[data-theme="xianxia"] .btn-open-archive::before {
  top: 5px;
  right: 0.7rem;
  left: auto;
  bottom: auto;
  width: auto;
  height: auto;
  transform: none;
  background: none;
  animation: none;
}

html[data-theme="xianxia"] .btn-primary::after,
html[data-theme="xianxia"] .btn-open-archive::after,
html[data-theme="xianxia"] .utility-launch-btn::after,
html[data-theme="xianxia"] .year-guess-dialog .game-year-submit::after,
html[data-theme="xianxia"] .year-guess-dialog .game-next-btn::after,
html[data-theme="xianxia"] .nav-btn::after {
  content: '';
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -65%;
  z-index: 1;
  width: 38%;
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(219, 255, 246, 0.58), rgba(252, 211, 121, 0.32), transparent);
  opacity: 0.45;
  pointer-events: none;
  animation: sword-energy-sweep 5.2s ease-in-out infinite;
}

html[data-theme="xianxia"] .btn-primary > *,
html[data-theme="xianxia"] .btn-open-archive > *,
html[data-theme="xianxia"] .utility-launch-btn > *,
html[data-theme="xianxia"] .year-guess-dialog .game-year-submit > *,
html[data-theme="xianxia"] .year-guess-dialog .game-next-btn > *,
html[data-theme="xianxia"] .nav-btn > * {
  position: relative;
  z-index: 2;
}

html[data-theme="xianxia"] .btn-primary:hover::after,
html[data-theme="xianxia"] .btn-primary:active::after,
html[data-theme="xianxia"] .btn-open-archive:hover::after,
html[data-theme="xianxia"] .btn-open-archive:active::after,
html[data-theme="xianxia"] .utility-launch-btn:hover::after,
html[data-theme="xianxia"] .utility-launch-btn:active::after,
html[data-theme="xianxia"] .year-guess-dialog .game-year-submit:hover::after,
html[data-theme="xianxia"] .year-guess-dialog .game-year-submit:active::after,
html[data-theme="xianxia"] .year-guess-dialog .game-next-btn:hover::after,
html[data-theme="xianxia"] .year-guess-dialog .game-next-btn:active::after,
html[data-theme="xianxia"] .nav-btn:hover::after,
html[data-theme="xianxia"] .nav-btn:active::after {
  animation-duration: 0.65s;
  opacity: 0.75;
}

html[data-theme="xianxia"] .btn-primary:active,
html[data-theme="xianxia"] .btn-open-archive:active,
html[data-theme="xianxia"] .utility-launch-btn:active,
html[data-theme="xianxia"] .year-guess-dialog .game-year-submit:active,
html[data-theme="xianxia"] .year-guess-dialog .game-next-btn:active,
html[data-theme="xianxia"] .nav-btn:active {
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.22), 0 0 22px rgba(245, 158, 11, 0.26);
  transform: scale(0.98);
}

@keyframes sword-energy-sweep {
  0%, 65% { left: -65%; }
  100% { left: 130%; }
}

@media (max-width: 768px) {
  .hero-title-row {
    align-items: flex-start;
    gap: 0.65rem;
  }

  .hero-seal-stamp {
    flex-basis: 44px;
    width: 44px;
    height: 54px;
    font-size: 0.54rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="xianxia"] .btn-primary::after,
  html[data-theme="xianxia"] .btn-open-archive::after,
  html[data-theme="xianxia"] .utility-launch-btn::after,
  html[data-theme="xianxia"] .year-guess-dialog .game-year-submit::after,
  html[data-theme="xianxia"] .year-guess-dialog .game-next-btn::after,
  html[data-theme="xianxia"] .nav-btn::after {
    animation: none;
  }
}

.admin-modal[hidden],
.admin-modal [hidden] {
  display: none !important;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.admin-modal.active {
  display: flex;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 10, 9, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.admin-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(620px, 100%);
  max-height: min(90vh, 900px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(226, 255, 244, 0.3);
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(87, 255, 207, 0.14), transparent 44%),
    rgba(8, 22, 19, 0.86);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.3),
    inset 0 -1px 2px rgba(45, 212, 191, 0.2),
    0 24px 70px rgba(0, 0, 0, 0.62);
  color: #e8fff8;
}

.admin-modal-header,
.admin-dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-modal-header {
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-modal-kicker {
  color: #f3d890;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.admin-modal-header h2,
.admin-form h3,
.admin-memory-manager h3 {
  margin: 4px 0 0;
  color: #f4e7bd;
  font-family: var(--font-serif);
}

.admin-modal-header h2 {
  font-size: 1.35rem;
}

.admin-modal-close,
.admin-primary-button,
.admin-secondary-button,
.admin-delete-button {
  border: 1px solid rgba(210, 255, 239, 0.3);
  border-radius: 12px;
  color: #effff9;
  cursor: pointer;
  font: inherit;
  transition: filter 160ms ease, transform 160ms ease, background 160ms ease;
}

.admin-modal-close {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.1rem;
}

.admin-modal-content {
  overflow: auto;
  padding: 20px 24px 24px;
}

.admin-form {
  display: grid;
  gap: 10px;
}

.admin-form-intro {
  margin: 0 0 6px;
  color: rgba(232, 255, 248, 0.76);
}

.admin-form label {
  margin-top: 4px;
  color: #d7eee5;
  font-size: 0.86rem;
  font-weight: 700;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(214, 255, 239, 0.2);
  border-radius: 12px;
  outline: none;
  background: rgba(2, 14, 12, 0.62);
  color: #edfff8;
  font: inherit;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: rgba(110, 255, 211, 0.72);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.14);
}

.admin-form input[type="file"] {
  padding: 9px;
}

.admin-primary-button,
.admin-secondary-button,
.admin-delete-button {
  padding: 10px 14px;
  background: linear-gradient(120deg, rgba(17, 133, 103, 0.8), rgba(108, 79, 32, 0.72));
}

.admin-primary-button {
  margin-top: 8px;
  font-weight: 800;
}

.admin-secondary-button,
.admin-delete-button {
  background: rgba(255, 255, 255, 0.08);
}

.admin-memory-manager {
  margin-top: 24px;
}

.admin-memory-manager h3 {
  margin-bottom: 10px;
}

.admin-memory-list {
  display: grid;
  gap: 8px;
}

.admin-memory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.admin-memory-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-delete-button {
  flex: 0 0 auto;
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.admin-memory-empty,
.admin-status {
  margin: 10px 0 0;
  color: rgba(226, 255, 243, 0.74);
  font-size: 0.88rem;
}

.admin-status.is-error {
  color: #fecaca;
}

.admin-modal button:disabled {
  cursor: wait;
  filter: grayscale(0.35);
  opacity: 0.62;
}

.admin-modal button:not(:disabled):hover {
  filter: brightness(1.14);
}

.admin-modal button:not(:disabled):active {
  transform: scale(0.98);
}

@media (max-width: 540px) {
  .admin-modal {
    padding: 10px;
  }

  .admin-modal-dialog {
    max-height: 94vh;
    border-radius: 18px;
  }

  .admin-modal-header,
  .admin-modal-content {
    padding-right: 16px;
    padding-left: 16px;
  }
}

.nav-brand-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.nav-brand-row .nav-brand {
  min-width: 0;
  flex: 1 1 auto;
}

.nav-brand-row .brand-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn-auth {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  max-width: 150px;
  padding: 0.4rem 0.75rem;
  border-color: rgba(110, 231, 183, 0.4);
  background: rgba(8, 22, 19, 0.45);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  color: #eafff7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="xianxia"] .nav-btn-auth::before {
  content: none;
}

.nav-btn-auth.is-admin {
  border-color: rgba(250, 204, 21, 0.7);
  background: linear-gradient(135deg, rgba(161, 98, 7, 0.42), rgba(8, 22, 19, 0.72));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28), 0 0 16px rgba(250, 204, 21, 0.22);
  color: #ffe28a;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.auth-tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(232, 255, 248, 0.72);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.auth-tab.active {
  border-color: rgba(110, 231, 183, 0.38);
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.24), rgba(202, 138, 4, 0.17));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
  color: #f4e7bd;
}

.auth-form-enter {
  animation: authFormEnter 220ms ease both;
}

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

.auth-member-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.auth-member-panel p {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
}

.auth-member-panel strong {
  color: #f4e7bd;
}

.auth-admin-heading {
  margin: 18px 0 10px;
  color: #f4e7bd;
  font-family: var(--font-serif);
}

@media (max-width: 767px) {
  .nav-brand-row {
    width: 100%;
    gap: 0.45rem;
  }

  .nav-brand-row .nav-brand {
    max-width: calc(100% - 96px);
  }

  .nav-brand-row .brand-title {
    font-size: 0.76rem;
    letter-spacing: 0.02em;
  }

  .nav-btn-auth {
    max-width: 106px;
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 360px) {
  .nav-brand-row .brand-title {
    font-size: 0.68rem;
  }

  .nav-btn-auth {
    max-width: 96px;
    padding-right: 0.45rem;
    padding-left: 0.45rem;
    font-size: 0.66rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-form-enter {
    animation: none;
  }
}

#auth-modal.auth-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;
  display: none;
  background: rgba(2, 10, 8, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

#auth-modal.auth-modal.active {
  display: flex !important;
}

#auth-modal.auth-modal[hidden] {
  display: none !important;
}

#auth-modal .admin-modal-backdrop {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.btn-toggle-stage-quotes {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(45, 212, 191, 0.58);
  background: linear-gradient(115deg, rgba(8, 22, 19, 0.55), rgba(16, 185, 129, 0.2), rgba(245, 158, 11, 0.16));
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.24), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.btn-toggle-stage-quotes::after {
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -65%;
  z-index: 1;
  width: 38%;
  content: '';
  transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(219, 255, 246, 0.58), rgba(252, 211, 121, 0.32), transparent);
  opacity: 0.45;
  pointer-events: none;
  animation: sword-energy-sweep 5.2s ease-in-out infinite;
}

.btn-toggle-stage-quotes > * {
  position: relative;
  z-index: 2;
}

.quote-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #eafff7;
}

.quote-scroll-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: #6ee7c1;
  filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.72)) drop-shadow(0 0 7px rgba(250, 204, 21, 0.35));
}

.quotes-count {
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(252, 211, 121, 0.24);
  border-radius: 999px;
  background: rgba(2, 10, 8, 0.32);
  white-space: nowrap;
}

.stage-quote-item {
  position: relative;
}

.memory-like-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.72rem;
  border: 1px solid rgba(110, 231, 183, 0.4);
  border-radius: 999px;
  background: rgba(8, 22, 19, 0.56);
  color: #eafff7;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 5px 16px rgba(0, 0, 0, 0.22);
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.memory-like-control {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.memory-like-button:hover {
  border-color: rgba(252, 211, 121, 0.7);
  background: rgba(16, 185, 129, 0.2);
}

.memory-like-button.is-liked {
  border-color: rgba(252, 211, 121, 0.76);
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.24), rgba(202, 138, 4, 0.2));
  color: #ffe28a;
}

.memory-like-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.memory-like-icon {
  filter: drop-shadow(0 0 5px rgba(110, 231, 183, 0.72));
}

.memory-like-status,
.leaderboard-status {
  min-height: 1em;
  margin: 0.2rem 0 0;
  color: rgba(226, 255, 243, 0.7);
  font-size: 0.75rem;
}

.memory-like-status.is-error,
.leaderboard-status.is-error {
  color: #fecaca;
}

.lightbox-memory-like {
  margin-top: 0.35rem;
}

.stage-quote-item .memory-like-button {
  margin-top: 0.65rem;
}

.game-leaderboard {
  width: min(460px, 100%);
  margin: 0.5rem auto 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(8, 22, 19, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  text-align: left;
}

@media (max-width: 480px) {
  .game-leaderboard {
    padding: 0.75rem;
  }

  .leaderboard-row {
    font-size: 0.82rem;
  }
}

.game-leaderboard h4 {
  margin: 0 0 0.55rem;
  color: #ffe28a;
  font-family: var(--font-serif);
  text-align: center;
}

.leaderboard-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding-left: 1.6rem;
}

.leaderboard-list li {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-score {
  flex: 0 0 auto;
  color: #a7f3d0;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .btn-toggle-stage-quotes::after {
    animation: none;
  }
}

/* Cultivation profile, public ranking, and admin tools */
.visitor-count-badge,
.auth-cultivation-card,
.admin-tool-card,
.public-leaderboard-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 22, 19, 0.42);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.2),
    inset 0 -1px 2px rgba(45, 212, 191, 0.14),
    0 12px 32px rgba(0, 0, 0, 0.32);
}

.visitor-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.85rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: #e7fff5;
  font-size: 0.82rem;
}

.visitor-count-badge[hidden],
.auth-cultivation-card[hidden] {
  display: none !important;
}

.auth-cultivation-card {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 18px;
}

.cultivation-card-heading,
.cultivation-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.cultivation-card-heading strong {
  color: #ffe5a0;
}

.cultivation-progress-wrap {
  display: grid;
  gap: 0.35rem;
}

.cultivation-progress-wrap progress {
  width: 100%;
  height: 0.7rem;
  accent-color: #42d9b2;
}

.cultivation-status,
.admin-tool-status {
  min-height: 1.25em;
  color: #b7d9cf;
  font-size: 0.82rem;
}

.cultivation-status.is-error,
.admin-tool-status.is-error {
  color: #ffaaa0;
}

.cultivation-mission-list {
  display: grid;
  gap: 0.35rem;
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: #d3e6dd;
  font-size: 0.85rem;
}

.cultivation-rank-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.14rem 0.45rem;
  border: 1px solid rgba(239, 209, 137, 0.35);
  border-radius: 999px;
  background: rgba(21, 65, 53, 0.7);
  color: #ffe3a0;
  font-size: 0.68rem;
  line-height: 1.3;
  white-space: normal;
}

.cultivation-toast {
  position: fixed !important;
  z-index: 10020 !important;
  top: auto !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  bottom: max(16px, env(safe-area-inset-bottom)) !important;
  left: auto !important;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid rgba(167, 243, 208, 0.36);
  background: rgba(7, 34, 27, 0.92) !important;
  color: #eafff5 !important;
}

.public-leaderboard-section {
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.public-leaderboard-card {
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 24px;
}

.public-leaderboard-card h2 {
  margin: 0.35rem 0 1rem;
}

.leaderboard-list {
  gap: 0.5rem;
}

.leaderboard-list li {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
}

.leaderboard-row,
.leaderboard-identity {
  min-width: 0;
}

.leaderboard-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.leaderboard-status {
  min-height: 1.2em;
}

.admin-tool-card {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 16px;
}

.admin-memory-item {
  align-items: center;
  gap: 0.75rem;
}

.admin-memory-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.admin-memory-actions button {
  min-width: 38px;
  padding: 0.4rem 0.55rem;
}

.admin-memory-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.admin-cultivation-skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-skill-row {
  display: grid;
  gap: 0.35rem;
}

.admin-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.card-back {
  border: 1px solid rgba(219, 190, 111, 0.6);
  background: linear-gradient(155deg, rgba(6, 38, 30, 0.96), rgba(3, 18, 15, 0.98));
  box-shadow: inset 0 0 30px rgba(45, 212, 191, 0.1);
}

.genesis-scroll-icon,
.hero-flip-icon {
  color: #79f1d0;
  filter: drop-shadow(0 0 8px rgba(90, 255, 207, 0.55));
}

@media (max-width: 768px) {
  body {
    padding-bottom: 0 !important;
  }

  .museum-footer {
    margin-bottom: 0 !important;
    padding-bottom: 85px !important;
  }

  .admin-memory-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-memory-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .cultivation-card-heading,
  .cultivation-total {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .admin-cultivation-skills {
    grid-template-columns: 1fr;
  }
}

/* Hero seal, account Tu Vi chip, and dual leaderboard */
.nav-account-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
}

.nav-cultivation-badge {
  display: none;
  flex: 0 0 auto;
  padding: 0.4rem 0.7rem;
  border-color: rgba(110, 231, 183, 0.5);
  background: linear-gradient(130deg, rgba(6, 95, 70, 0.42), rgba(8, 22, 19, 0.68));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), 0 0 14px rgba(45, 212, 191, 0.18);
  color: #b7ffe6;
  white-space: nowrap;
}

.nav-cultivation-badge.is-visible {
  display: inline-flex;
}

.nav-cultivation-badge:hover {
  border-color: rgba(253, 224, 71, 0.75);
  color: #fff0b0;
}

.card-frame {
  align-items: center;
}

.card-frame > .genesis-tag {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0.25rem 0 0.5rem;
  background: rgba(6, 30, 25, 0.82);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.16);
}

.hero-flip-front {
  position: relative;
  inset: auto;
  height: auto;
  min-height: unset;
  padding: 18px 16px 20px;
  box-sizing: border-box;
}

.hero-flip-front .card-frame {
  width: 100%;
  height: auto;
  padding: 0;
}

.hero-flip-front .card-caption {
  padding: 0;
}

.hero-flip-front .card-caption .card-title {
  margin: 0 0 6px;
}

.hero-flip-front .card-caption .card-hint {
  margin: 0;
}

.card-face.hero-flip-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  box-sizing: border-box;
}

.hero-flip-back .card-back-content {
  width: 100%;
  gap: 0.55rem;
}

.hero-flip-back .genesis-scroll-icon {
  width: 42px;
  height: 42px;
}

.hero-flip-back .back-subtitle {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.hero-flip-back .back-quote {
  margin: 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}

.hero-flip-back .back-signature {
  gap: 0.25rem;
  margin-top: 0;
}

.hero-flip-back .sig-name {
  font-size: 0.72rem;
  line-height: 1.3;
}

.hero-flip-back .back-flip-btn {
  margin-top: 0;
  padding: 0.4rem 0.8rem;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.emblem-aura-box {
  position: relative;
  width: min(215px, 100%);
  height: auto;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 10px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.emblem-aura-box .bagua-array {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  filter: drop-shadow(0 0 12px rgba(45, 212, 191, 0.48))
    drop-shadow(0 0 18px rgba(245, 196, 81, 0.3));
  animation: bagua-orbit 72s linear infinite;
  pointer-events: none;
}

.bagua-ring-outer,
.bagua-ring-inner,
.bagua-spokes,
.bagua-trigrams {
  fill: none;
  stroke: rgba(248, 216, 145, 0.88);
  stroke-width: 1.4;
}

.bagua-ring-inner,
.bagua-spokes {
  stroke: rgba(100, 243, 204, 0.82);
}

.bagua-spokes {
  stroke-width: 1;
  stroke-dasharray: 2 3;
}

.bagua-trigrams {
  stroke-width: 3.2;
  stroke-linecap: round;
}

.emblem-aura-box img#genesis-img {
  position: relative;
  z-index: 2;
  display: block;
  width: min(146px, 68%);
  height: auto;
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(245, 196, 81, 0.75);
  border-radius: 50%;
  background: rgba(4, 17, 15, 0.72);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.4);
  object-fit: cover;
  object-position: center;
}

.btn-invite {
  position: relative;
  flex: 0 0 auto;
  width: max-content;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 0;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(110, 231, 183, 0.48);
  border-radius: 999px;
  background: linear-gradient(130deg, rgba(6, 95, 70, 0.46), rgba(8, 22, 19, 0.72));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.24), 0 8px 24px rgba(0, 0, 0, 0.24);
  color: #d7fff1;
  backdrop-filter: blur(16px) saturate(155%);
  -webkit-backdrop-filter: blur(16px) saturate(155%);
}

.btn-invite::after {
  position: absolute;
  z-index: 0;
  top: -25%;
  left: -65%;
  width: 34%;
  height: 150%;
  transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(219, 255, 246, 0.64), rgba(252, 211, 121, 0.38), transparent);
  content: '';
  pointer-events: none;
  animation: sword-energy-sweep 5.2s ease-in-out infinite;
}

.btn-invite > * {
  position: relative;
  z-index: 1;
}

.btn-invite:hover {
  border-color: rgba(245, 196, 81, 0.76);
  color: #fff0b0;
  transform: translateY(-2px);
}

@keyframes bagua-orbit {
  to { transform: rotate(360deg); }
}

.card-caption {
  flex: 0 0 auto;
  width: 100%;
  padding: 0.7rem 0.3rem 0.15rem;
}

.card-caption .card-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
}

.hero-flip-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.hero-intro {
  max-width: 680px;
}

.public-leaderboard-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(215, 187, 112, 0.62);
  outline: 1px solid rgba(72, 220, 180, 0.35);
  outline-offset: -6px;
  background:
    radial-gradient(ellipse at 50% -18%, rgba(245, 198, 93, 0.16), transparent 56%),
    linear-gradient(145deg, rgba(7, 37, 29, 0.86), rgba(4, 19, 17, 0.88));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.26),
    inset 0 0 32px rgba(45, 212, 191, 0.08),
    0 20px 46px rgba(0, 0, 0, 0.34);
}

.public-leaderboard-card::before,
.public-leaderboard-card::after {
  position: absolute;
  z-index: 0;
  width: 34px;
  height: 34px;
  border-color: rgba(248, 216, 145, 0.84);
  border-style: solid;
  content: '';
  pointer-events: none;
}

.public-leaderboard-card::before {
  top: 10px;
  left: 10px;
  border-width: 1px 0 0 1px;
  border-radius: 12px 0 0;
}

.public-leaderboard-card::after {
  right: 10px;
  bottom: 10px;
  border-width: 0 1px 1px 0;
  border-radius: 0 0 12px;
}

.public-leaderboard-card > * {
  position: relative;
  z-index: 1;
}

.public-leaderboard-card h2 {
  font-size: clamp(1.15rem, 4.5vw, 1.65rem);
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: normal;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1rem 0;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(2, 15, 13, 0.52);
}

.leaderboard-tab {
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(227, 247, 239, 0.76);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  line-height: 1.25;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.leaderboard-tab.active {
  border-color: rgba(234, 205, 132, 0.42);
  background: linear-gradient(125deg, rgba(16, 185, 129, 0.28), rgba(202, 138, 4, 0.2));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 0 18px rgba(45, 212, 191, 0.1);
  color: #fff0bd;
}

.leaderboard-panel[hidden] {
  display: none !important;
}

.leaderboard-panel:not([hidden]) {
  animation: leaderboard-panel-enter 220ms ease both;
}

@keyframes leaderboard-panel-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.leaderboard-list {
  padding-left: 0;
  list-style: none;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(4, 23, 19, 0.5);
}

.leaderboard-place {
  flex: 0 0 auto;
  color: #ecd99e;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.leaderboard-identity {
  flex: 1 1 auto;
}

.leaderboard-name {
  min-width: 0;
  color: #f0fff9;
}

.leaderboard-score {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.cultivation-leaderboard-row .leaderboard-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.55rem;
}

.podium-title {
  flex-basis: 100%;
  color: #ffe6a1;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}

.cultivation-leaderboard-row.podium-rank-1 {
  border-color: rgba(255, 221, 110, 0.72);
  background: linear-gradient(105deg, rgba(132, 91, 13, 0.34), rgba(4, 23, 19, 0.6));
  box-shadow: inset 0 0 18px rgba(255, 214, 102, 0.1), 0 0 22px rgba(255, 202, 82, 0.12);
}

.cultivation-leaderboard-row.podium-rank-1 .leaderboard-place {
  color: #ffe27d;
}

.cultivation-leaderboard-row.podium-rank-2 {
  border-color: rgba(216, 232, 236, 0.62);
  background: linear-gradient(105deg, rgba(121, 145, 153, 0.25), rgba(4, 23, 19, 0.6));
  box-shadow: inset 0 0 16px rgba(223, 242, 245, 0.07);
}

.cultivation-leaderboard-row.podium-rank-2 .leaderboard-place {
  color: #e2f1f3;
}

.cultivation-leaderboard-row.podium-rank-3 {
  border-color: rgba(218, 153, 101, 0.58);
  background: linear-gradient(105deg, rgba(137, 71, 36, 0.25), rgba(4, 23, 19, 0.6));
}

.cultivation-leaderboard-row.podium-rank-3 .leaderboard-place {
  color: #eab48e;
}

.game-leaderboard-row .leaderboard-name {
  flex: 1 1 auto;
}

@media (max-width: 767px) {
  .nav-brand-row {
    flex-wrap: nowrap !important;
    gap: 0.3rem !important;
  }

  .nav-brand-row .nav-brand {
    flex: 1 1 0;
    width: 0;
    max-width: none !important;
    gap: 0.35rem;
  }

  .nav-brand-row .brand-logo-img {
    width: 26px;
    height: 26px;
  }

  .nav-brand-row .brand-title {
    font-size: clamp(0.56rem, 2.45vw, 0.76rem) !important;
    letter-spacing: 0 !important;
  }

  .nav-account-actions {
    gap: 0.25rem;
  }

  .nav-cultivation-badge {
    padding: 4px 9px;
    font-size: 0.76rem;
  }

  .nav-brand-row .nav-btn-auth {
    max-width: 104px;
    padding: 4px 7px;
    font-size: 0.68rem;
  }
}

@media (max-width: 430px) {
  .leaderboard-tabs {
    gap: 0.35rem;
  }

  .leaderboard-tab {
    padding: 0.45rem 0.4rem;
    font-size: 0.78rem;
  }

  .leaderboard-list li {
    flex-wrap: wrap;
  }

  .leaderboard-list li .leaderboard-score {
    margin-left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .emblem-aura-box .bagua-array,
  .btn-invite::after {
    animation: none;
  }

  .leaderboard-tab {
    transition: none;
  }

  .leaderboard-panel:not([hidden]) {
    animation: none;
  }
}

/* iOS 26 liquid glass and stable Safari card flipping */
.sticky-nav,
.nav-btn,
.nav-chip,
.rpg-card,
.public-leaderboard-card,
.leaderboard-tab,
.btn-invite,
.utility-launch-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(45, 212, 191, 0.04) 55%, rgba(255, 255, 255, 0.03));
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top-color: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 8px 28px rgba(0, 0, 0, 0.22);
}

.sticky-nav {
  border-right: 0;
  border-left: 0;
}

.nav-btn,
.nav-chip,
.leaderboard-tab,
.btn-invite,
.utility-launch-btn {
  color: var(--text-primary);
}

.museum-body button {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(45, 212, 191, 0.04) 55%, rgba(255, 255, 255, 0.03));
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top-color: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 8px 28px rgba(0, 0, 0, 0.22);
}

.nav-cultivation-badge {
  color: #fff0b0;
  font-weight: 800;
  text-shadow: 0 0 12px rgba(253, 224, 71, 0.55);
}

.rpg-card,
.public-leaderboard-card {
  overflow: hidden;
}

.hero-badge {
  gap: 0.45rem;
  margin-bottom: -1.6rem;
  padding: 0.35rem 0.75rem;
  border-color: rgba(255, 223, 143, 0.44);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(45, 212, 191, 0.04) 55%, rgba(255, 255, 255, 0.025));
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
}

.badge-text {
  color: #ffe28a;
  font-size: clamp(0.72rem, 2.9vw, 0.85rem);
  letter-spacing: 0.035em;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.hero-cta-group {
  align-items: center;
  margin-bottom: 1.5rem;
}

.hero-cta-group .btn-invite {
  margin: 0 auto;
}

.brand-logo-img,
.nav-brand-row .brand-logo-img {
  width: 38px !important;
  height: 38px !important;
  border: 1.5px solid #f6d77e;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.7), 0 0 16px rgba(245, 196, 81, 0.62);
}

.nav-brand .brand-title,
.nav-brand-row .brand-title {
  color: #fff0bd;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 14px rgba(245, 196, 81, 0.34);
}

.hero-flip-front,
.hero-flip-back,
.hero-flip-front *,
.hero-flip-back * {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  z-index: auto !important;
}

.hero-flip-front,
.hero-flip-back {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transition: opacity 0.25s ease;
}

.hero-flip-front {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: linear-gradient(145deg, rgba(16, 43, 41, 0.96), rgba(9, 23, 29, 0.94) 58%, rgba(39, 31, 23, 0.92));
}

.hero-flip-front .genesis-tag {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(45, 212, 191, 0.1), rgba(245, 196, 81, 0.13));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.hero-flip-back {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(18, 45, 43, 0.97), rgba(8, 22, 30, 0.96) 58%, rgba(43, 32, 21, 0.95));
}

.genesis-flip-card.flipped .hero-flip-front,
.genesis-flip-card.is-flipped .hero-flip-front {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.genesis-flip-card.flipped .hero-flip-back,
.genesis-flip-card.is-flipped .hero-flip-back {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.rpg-substat-flames {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
}

.rpg-substat-tier {
  position: static;
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
}

.filmstrip-modal {
  transition: opacity 0.16s ease;
}

.filmstrip-modal.is-closing {
  opacity: 0;
  pointer-events: none;
}

.film-frame,
.film-frame * {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.stage-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 1100px;
}

.memory-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}

@media (max-width: 767px) {
  .hero-badge {
    max-width: 100%;
    align-self: center;
    margin-bottom: -2rem;
    padding-right: 0.45rem;
    padding-left: 0.45rem;
  }

  .badge-text {
    letter-spacing: 0;
  }

  .nav-brand-row .brand-title {
    font-size: clamp(0.56rem, 2.45vw, 0.76rem) !important;
  }
}

/* Cultivation-ranked account badge */
.nav-cultivation-badge {
  color: #fff0bd;
  letter-spacing: 0.01em;
}

.nav-cultivation-badge #nav-cultivation-label {
  color: #ffe28a;
}

#theme-toggle-btn .btn-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 1100px) {
  #theme-toggle-btn .btn-text {
    max-width: 88px;
  }
}

/* Layered sect seal */
.emblem-aura-box {
  width: min(255px, 100%);
  height: 255px;
  max-width: 100%;
  margin: 8px auto 10px;
  flex: 0 0 auto;
}

.emblem-aura-box .bagua-array {
  animation: bagua-orbit 72s linear infinite;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.bagua-script {
  fill: rgba(255, 226, 138, 0.88);
  font-family: 'Noto Serif', serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
}

.celestial-array {
  position: absolute;
  inset: 5%;
  width: 90%;
  height: 90%;
  overflow: visible;
  fill: none;
  stroke: rgba(103, 232, 249, 0.78);
  stroke-width: 1.15;
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.55));
  animation: celestial-orbit 58s linear infinite reverse;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  pointer-events: none;
}

.celestial-array polygon:first-of-type {
  stroke: rgba(192, 132, 252, 0.72);
  stroke-dasharray: 3 4;
}

.celestial-array polygon:last-of-type {
  stroke: rgba(245, 196, 81, 0.82);
  stroke-dasharray: 1 4;
}

.emblem-photo-frame {
  position: relative;
  display: block;
  width: min(176px, 100%);
  height: 176px;
  flex: 0 0 auto;
  box-sizing: border-box;
  overflow: hidden;
  border: 2px solid rgba(245, 196, 81, 0.92);
  border-radius: 50%;
  background: rgba(4, 17, 15, 0.9);
  box-shadow: 0 0 28px rgba(45, 212, 191, 0.55), inset 0 0 18px rgba(245, 196, 81, 0.45);
}

.emblem-aura-box .emblem-photo-frame img#genesis-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(245, 196, 81, 0.45);
  object-fit: cover;
  object-position: center;
}

.emblem-photo-frame::after {
  position: absolute;
  inset: -30% auto -30% -55%;
  width: 38%;
  content: '';
  transform: rotate(22deg);
  background: linear-gradient(90deg, transparent, rgba(237, 255, 248, 0.48), rgba(255, 224, 138, 0.24), transparent);
  animation: emblem-awakening-sweep 7s ease-in-out infinite;
  pointer-events: none;
}

.emblem-particle {
  position: absolute;
  z-index: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4bf 0 18%, #34d399 48%, transparent 74%);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.9), 0 0 20px rgba(245, 196, 81, 0.56);
  pointer-events: none;
}

.particle-one {
  top: 16%;
  left: 18%;
  animation: qi-float 4.5s ease-in-out infinite;
}

.particle-two {
  top: 21%;
  right: 12%;
  animation: qi-float 5.2s ease-in-out -1.6s infinite;
}

.particle-three {
  right: 17%;
  bottom: 14%;
  animation: qi-float 4.8s ease-in-out -2.7s infinite;
}

.particle-four {
  bottom: 20%;
  left: 12%;
  animation: qi-float 5.6s ease-in-out -0.8s infinite;
}

@keyframes celestial-orbit {
  to { transform: rotate(360deg); }
}

@keyframes emblem-awakening-sweep {
  0%, 62% { left: -55%; }
  100% { left: 125%; }
}

/* Per-stage rotating avatar arrays, sized around the existing portrait. */
.rpg-avatar {
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.rpg-avatar::before,
.rpg-avatar::after {
  position: absolute;
  inset: -5px;
  content: '';
  border-radius: 50%;
  pointer-events: none;
}

.rpg-avatar::before {
  background: repeating-conic-gradient(
    from 0deg,
    var(--stage-rune-color, #34d399) 0deg 1deg,
    transparent 1deg 15deg
  );
  -webkit-mask: radial-gradient(transparent 62%, #000 63% 73%, transparent 74%);
  mask: radial-gradient(transparent 62%, #000 63% 73%, transparent 74%);
  filter: drop-shadow(0 0 5px var(--stage-rune-color, #34d399));
  animation: avatar-array-clockwise 32s linear infinite;
}

.rpg-avatar::after {
  inset: -9px;
  border: 1px solid var(--stage-rune-color, #34d399);
  border-radius: 0;
  clip-path: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%);
  filter: drop-shadow(0 0 5px var(--stage-rune-color, #34d399));
  opacity: 0.76;
  animation: avatar-array-counterclockwise 46s linear infinite;
}

.rpg-avatar img {
  position: relative;
  z-index: 1;
  border: 2px solid var(--stage-rune-color, #34d399);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--stage-rune-color, #34d399);
}

.rpg-avatar-lv {
  z-index: 3;
}

#stage-luc-nho .rpg-avatar { --stage-rune-color: #34d399; }
#stage-2021 .rpg-avatar { --stage-rune-color: #38bdf8; }
#stage-2022 .rpg-avatar { --stage-rune-color: #c084fc; }
#stage-2023 .rpg-avatar { --stage-rune-color: #fbbf24; }
#stage-2024 .rpg-avatar { --stage-rune-color: #fb7185; }
#stage-2025 .rpg-avatar { --stage-rune-color: #2dd4bf; }
#stage-2026 .rpg-avatar { --stage-rune-color: #f59e0b; }

@keyframes avatar-array-clockwise {
  to { transform: rotate(360deg); }
}

@keyframes avatar-array-counterclockwise {
  to { transform: rotate(-360deg); }
}

/* Authenticated account/admin perimeter light */
#btn-header-auth.is-member,
#btn-header-auth.is-admin {
  position: relative;
  isolation: isolate;
  border-color: rgba(110, 231, 183, 0.62);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 0 18px rgba(45, 212, 191, 0.2);
}

#btn-header-auth.is-admin {
  border-color: rgba(250, 204, 21, 0.74);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.34), 0 0 18px rgba(250, 204, 21, 0.25);
}

#btn-header-auth.is-member::after,
#btn-header-auth.is-admin::after {
  position: absolute;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: auto;
  height: auto;
  padding: 1.5px;
  border-radius: inherit;
  content: '';
  transform: none;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 265deg,
    rgba(45, 212, 191, 0.12) 285deg,
    rgba(45, 212, 191, 0.96) 315deg,
    rgba(255, 224, 138, 0.98) 338deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 1;
  animation: borderOrbit 3.2s linear infinite;
  pointer-events: none;
}

#btn-header-auth.is-admin::after {
  background: conic-gradient(
    from 0deg,
    transparent 0deg 265deg,
    rgba(255, 224, 138, 0.12) 285deg,
    rgba(255, 224, 138, 0.98) 315deg,
    rgba(45, 212, 191, 0.96) 338deg,
    transparent 360deg
  );
}

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

/* Clearer liquid-glass treatment for independent controls and music player. */
html[data-theme] .sticky-nav,
html[data-theme] .nav-btn,
html[data-theme] .nav-chip,
html[data-theme] .leaderboard-tab,
html[data-theme] .btn-open-archive,
html[data-theme] .utility-launch-btn,
.btn-toggle-stage-quotes,
.btn-invite,
.utility-launch-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(45, 212, 191, 0.025) 60%, rgba(255, 255, 255, 0.02)) !important;
  -webkit-backdrop-filter: blur(20px) saturate(185%) !important;
  backdrop-filter: blur(20px) saturate(185%) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  border-top-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}

.floating-bg-player {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(45, 212, 191, 0.025) 60%, rgba(255, 255, 255, 0.02)) !important;
  -webkit-backdrop-filter: blur(20px) saturate(185%) !important;
  backdrop-filter: blur(20px) saturate(185%) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
  border-top-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.22) !important;
}

@media (prefers-reduced-motion: reduce) {
  .emblem-aura-box .bagua-array,
  .celestial-array,
  .emblem-photo-frame::after,
  .emblem-particle,
  .rpg-avatar::before,
  .rpg-avatar::after,
  #btn-header-auth.is-member::after,
  #btn-header-auth.is-admin::after {
    animation: none;
  }
}

body {
  overflow-x: clip !important;
}

.cultivation-toast {
  position: fixed !important;
  bottom: 88px !important;
  left: 50% !important;
  right: auto !important;
  width: max-content !important;
  max-width: calc(100vw - 32px) !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere;
  text-align: center !important;
  padding: 10px 16px !important;
  border-radius: 16px !important;
  z-index: 10000 !important;
  font-size: 0.88rem !important;
  line-height: 1.4 !important;
  transform: translateX(-50%) translateY(40px) !important;
}

.cultivation-toast.show {
  transform: translateX(-50%) !important;
}

.cultivation-toast > span:last-child {
  min-width: 0;
}

@media (max-width: 768px) {
  .hero-cta-group #btn-invite-friends {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 10px auto 0;
    justify-self: center;
  }

  .card-back {
    padding: 1rem 1.1rem;
  }

  .card-back-content {
    width: 100%;
    gap: 0.5rem;
  }

  .wax-seal {
    font-size: 2rem;
    line-height: 1;
  }

  .genesis-scroll-icon {
    width: 42px;
    height: 42px;
  }

  .back-subtitle {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    line-height: 1.3;
  }

  .back-quote {
    margin: 0;
    padding: 0;
    font-size: 0.86rem;
    line-height: 1.42;
  }

  .back-signature {
    gap: 0.25rem;
    margin-top: 0;
  }

  .sig-name {
    font-size: 0.72rem;
    line-height: 1.3;
  }

  .back-flip-btn {
    margin-top: 0;
    padding: 0.4rem 0.8rem;
    font-size: 0.72rem;
    flex-shrink: 0;
  }
}

/* Compact hero pill and a separate visitor-count row on narrow screens. */
.hero-badge-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: -1.6rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: auto;
  max-width: calc(100vw - 32px);
  height: auto;
  aspect-ratio: auto;
  margin: 0;
  padding: 7px 16px;
  border-radius: 999px;
  text-align: center;
  white-space: normal;
}

.badge-text {
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.hero-badge-meta-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
}

.hero-badge-meta-row[hidden] {
  display: none !important;
}

.visitor-count-badge {
  justify-content: center;
  max-width: 100%;
  margin-top: 0;
  white-space: nowrap;
}

.card-frame {
  position: relative;
  isolation: isolate;
}

.hero-card-corner {
  position: absolute;
  z-index: 5;
  width: 27px;
  height: 27px;
  border-top: 2px solid rgba(255, 224, 138, 0.95);
  border-left: 2px solid rgba(45, 212, 191, 0.94);
  border-radius: 8px 0 0;
  filter: drop-shadow(0 0 5px rgba(245, 196, 81, 0.7));
  pointer-events: none;
}

.hero-card-corner::after {
  position: absolute;
  inset: 4px;
  content: '';
  border-top: 1px solid rgba(45, 212, 191, 0.64);
  border-left: 1px solid rgba(255, 224, 138, 0.62);
  border-radius: 5px 0 0;
}

.hero-card-corner--tl {
  top: 8px;
  left: 8px;
}

.hero-card-corner--tr {
  top: 8px;
  right: 8px;
  transform: scaleX(-1);
}

.hero-card-corner--bl {
  bottom: 8px;
  left: 8px;
  transform: scaleY(-1);
}

.hero-card-corner--br {
  right: 8px;
  bottom: 8px;
  transform: rotate(180deg);
}

.emblem-aura-box::before {
  position: absolute;
  z-index: 0;
  inset: 4%;
  content: '';
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 38%, rgba(245, 196, 81, 0.34), transparent 34%),
    radial-gradient(circle at 60% 62%, rgba(16, 185, 129, 0.32), transparent 48%),
    radial-gradient(circle, rgba(45, 212, 191, 0.22), transparent 72%);
  filter: blur(14px);
  pointer-events: none;
}

.emblem-aura-box .celestial-array {
  z-index: 1;
}

.emblem-aura-box .emblem-photo-frame {
  z-index: 2;
}

.emblem-particle {
  z-index: 3;
}

.emblem-glyph {
  position: absolute;
  z-index: 4;
  color: #b7ffe6;
  font-size: 0.78rem;
  line-height: 1;
  text-shadow: 0 0 7px rgba(45, 212, 191, 0.95), 0 0 13px rgba(245, 196, 81, 0.72);
  animation: emblem-glyph-drift 4.8s ease-in-out infinite;
  pointer-events: none;
}

.emblem-glyph--left-top {
  top: 26%;
  left: 3%;
}

.emblem-glyph--left-mid {
  top: 49%;
  left: 0;
  animation-delay: -1.5s;
}

.emblem-glyph--left-low {
  bottom: 24%;
  left: 5%;
  color: #ffe28a;
  animation-delay: -2.7s;
}

.emblem-glyph--right-top {
  top: 28%;
  right: 3%;
  animation-delay: -2s;
}

.emblem-glyph--right-mid {
  top: 53%;
  right: 0;
  color: #ffe28a;
  animation-delay: -3.2s;
}

.emblem-glyph--right-low {
  right: 5%;
  bottom: 22%;
  animation-delay: -0.8s;
}

@keyframes emblem-glyph-drift {
  0%, 100% { opacity: 0.56; transform: translateY(3px) rotate(-8deg); }
  50% { opacity: 1; transform: translateY(-4px) rotate(8deg); }
}

#auth-account-panel .admin-dashboard-heading {
  min-width: 0;
}

#auth-user-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#auth-sign-out {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .hero-badge-stack {
    margin-bottom: -1.6rem;
  }

  .hero-badge {
    max-width: calc(100vw - 32px);
    padding: 7px 12px;
  }
}

.hero-badge-meta-row {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 8px auto 0;
}

.visitor-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-top-color: rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(45, 212, 191, 0.025) 60%, rgba(255, 255, 255, 0.02));
  -webkit-backdrop-filter: blur(20px) saturate(185%);
  backdrop-filter: blur(20px) saturate(185%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 8px 24px rgba(0, 0, 0, 0.22);
  color: #e7fff5;
  font-size: clamp(0.65rem, 3.2vw, 0.82rem);
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.hero-flip-front::after {
  position: absolute;
  inset: -55% -65%;
  z-index: 4;
  content: '';
  transform: translateX(-58%) rotate(18deg);
  background: linear-gradient(
    112deg,
    transparent 42%,
    rgba(45, 212, 191, 0.04) 46%,
    rgba(166, 255, 226, 0.28) 49%,
    rgba(255, 226, 138, 0.42) 50%,
    rgba(45, 212, 191, 0.12) 53%,
    transparent 58%
  );
  animation: sect-sword-light 7s ease-in-out infinite;
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@keyframes sect-sword-light {
  0%, 62% { transform: translateX(-58%) rotate(18deg); opacity: 0.3; }
  82% { opacity: 0.82; }
  100% { transform: translateX(58%) rotate(18deg); opacity: 0.28; }
}

.five-element-orbit {
  position: absolute;
  z-index: 4;
  inset: 0;
  animation: five-element-orbit 30s linear infinite;
  pointer-events: none;
}

.five-element-gem {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid var(--gem-color);
  border-radius: 5px;
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.96), var(--gem-color) 38%, rgba(4, 17, 15, 0.92) 100%);
  box-shadow: 0 0 8px var(--gem-color), inset 0 0 5px rgba(255, 255, 255, 0.8);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 5px var(--gem-color);
}

.gem-metal {
  --gem-color: #ffe28a;
  transform: translate(-50%, -50%) rotate(0deg) translateY(-117px);
}

.gem-wood {
  --gem-color: #34d399;
  transform: translate(-50%, -50%) rotate(72deg) translateY(-117px);
}

.gem-water {
  --gem-color: #38bdf8;
  transform: translate(-50%, -50%) rotate(144deg) translateY(-117px);
}

.gem-fire {
  --gem-color: #fb7185;
  transform: translate(-50%, -50%) rotate(216deg) translateY(-117px);
}

.gem-earth {
  --gem-color: #c084fc;
  transform: translate(-50%, -50%) rotate(288deg) translateY(-117px);
}

@keyframes five-element-orbit {
  to { transform: rotate(360deg); }
}

.genesis-status-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin: 0.35rem 0 0.55rem;
}

.genesis-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid rgba(157, 255, 221, 0.28);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(10, 78, 64, 0.58), rgba(91, 64, 23, 0.42));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 0 12px rgba(45, 212, 191, 0.16);
  color: #f2ffe8;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}

.rpg-mainstat-badge.trung-pham {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(30, 64, 175, 0.25);
  color: #bfdbfe;
}

.rpg-mainstat-badge.ha-pham {
  border-color: rgba(203, 213, 225, 0.35);
  background: rgba(71, 85, 105, 0.25);
  color: #e2e8f0;
}

.rpg-substat-attribute {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
  margin-top: 5px;
  color: #b6ffe2;
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-dashboard-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 18px;
}

.admin-dashboard-tab {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid rgba(214, 255, 239, 0.2);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  color: #e7fff5;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.admin-dashboard-tab.active {
  border-color: rgba(255, 224, 138, 0.7);
  background: linear-gradient(130deg, rgba(11, 111, 83, 0.54), rgba(128, 88, 27, 0.4));
  color: #ffe8a3;
  box-shadow: 0 0 15px rgba(45, 212, 191, 0.15);
}

.admin-dashboard-panel[hidden] {
  display: none !important;
}

.admin-memory-filters {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
  overflow-x: auto;
  padding: 2px 1px 7px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.admin-memory-filter {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(214, 255, 239, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #e7fff5;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-memory-filter.active {
  border-color: rgba(255, 224, 138, 0.68);
  background: rgba(90, 72, 26, 0.48);
  color: #ffe8a3;
}

.admin-attribute-section-title {
  margin: 12px 0 0;
  color: #ffe8a3;
}

.admin-attribute-list {
  display: grid;
  gap: 12px;
}

.admin-attribute-row,
.admin-skill-row {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(214, 255, 239, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-attribute-row h6,
.admin-skill-row h6 {
  margin: 0 0 5px;
  color: #b9ffe8;
  font-size: 0.82rem;
}

.admin-cultivation-skills {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.film-thumb-box video,
.card-img-container video,
.stack-layer video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox-img-wrapper video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-img-wrapper video[hidden] {
  display: none;
}

.lightbox-img-wrapper img[hidden] {
  display: none;
}

@media (max-width: 768px) {
  #nav-chapters-bar.nav-chapters {
    gap: 4px !important;
  }

  #nav-chapters-bar .nav-chip {
    padding: 5px 10px !important;
    font-size: 0.78rem !important;
  }

  .visitor-count-badge {
    padding: 7px 10px;
  }

  .genesis-status-badges {
    gap: 5px;
  }

  .genesis-status-badge {
    font-size: 0.67rem;
  }

  .admin-dashboard-tabs {
    gap: 5px;
  }

  .admin-dashboard-tab {
    padding: 8px 5px;
    font-size: 0.68rem;
  }

  .admin-cultivation-skills {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-flip-front::after,
  .five-element-orbit,
  .emblem-glyph {
    animation: none;
  }
}