/* ============================================
   Rung Chuong Chua - Temple Bell Quiz
   Design System & Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700&family=Lora:wght@500;600;700&display=swap');

/* ---- CSS Variables (Design Tokens) ---- */
:root {
  /* Colors - Temple Theme - Perfectly Aligned with Official Logo */
  --bg-primary: #0e0204; /* Deepest monastic maroon-black ink */
  --bg-surface: #1c0709; /* Zen dark burgundy wood */
  --bg-elevated: #2d1114; /* Elevated temple ash burgundy */
  --gold: #ffdd48; /* Sacred temple gold (Extracted from Logo!) */
  --gold-dim: #cfa426; /* Burnished temple gold */
  --gold-glow: rgba(255, 221, 72, 0.25); /* Warm halo glow */
  --vermillion: #bd212b; /* Altar vermillion red */
  --vermillion-dim: #8b1219; /* Monastic robe red (Extracted from Logo!) */
  --celadon: #cbf0cc; /* Soft, serene sage green for chánh niệm answers */
  --jade: #3fa367; /* Serene emerald jade */
  --rust: #b04332; /* Sacred rust clay */
  --ivory: #fbf7f0; /* Pure ivory silk */
  --ivory-dim: #dad4c8; /* Sandstone silk */
  --sandstone: #a5967f; /* Warm sandstone */
  --lotus: #ffc2c7; /* Lotus pink */
  --lotus-dim: #d39b9f; /* Faded lotus blossom */
  --ink: #050001; /* Deepest ink wash */

  /* Glassmorphism Tokens */
  --glass-bg: rgba(20, 4, 6, 0.65); /* Highly polished semi-transparent dark maroon */
  --glass-border: rgba(255, 221, 72, 0.12); /* Subtle gold boundary */
  --glass-border-hover: rgba(255, 221, 72, 0.3); /* Glowing gold border */
  --glass-shadow: 0 20px 48px rgba(0, 0, 0, 0.5); /* Deep soft ambient shadow */

  /* Typography */
  --font-main: 'Be Vietnam Pro', 'Segoe UI', -apple-system, 'Noto Sans', Arial, sans-serif;
  --font-heading: 'Lora', 'Be Vietnam Pro', Georgia, serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;
  --fs-4xl: 2.5rem;

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px var(--gold-glow);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 450ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-width: 480px;
  --header-height: 56px;
  --landing-width: 1120px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--ivory);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Atmospheric Temple Background Overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url('/assets/temple_bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.15; /* Subtle backdrop texture */
  filter: contrast(1.15) brightness(0.9);
  pointer-events: none;
}

/* Deep Crimson Vignette overlay to ensure high contrast in content cards */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at center, transparent 30%, rgba(14, 2, 4, 0.95) 90%);
  pointer-events: none;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--lotus); }

img { max-width: 100%; display: block; }

button {
  font-family: var(--font-main);
  cursor: pointer;
  border: none;
  outline: none;
  font-size: var(--fs-base);
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(226, 182, 79, 0.75);
  outline-offset: 3px;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-block;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 1rem;
  height: 1rem;
}

/* ---- Layout ---- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

.page-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
}

/* ---- Header ---- */
.header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  background: rgba(20, 4, 6, 0.7);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 221, 72, 0.3);
}

.header-logo .bell-icon {
  width: 1.7rem;
  height: 1.7rem;
}

.header-action {
  min-height: 40px;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
}

/* ---- Cards ---- */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--glass-shadow);
  width: 100%;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 20px 48px rgba(255, 221, 72, 0.04), var(--glass-shadow);
}

.card-gold {
  border-color: var(--gold-dim);
  box-shadow: var(--shadow-gold), var(--glass-shadow);
}

.card-gold:hover {
  border-color: var(--gold);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--fs-base);
  transition: all var(--transition-fast);
  min-height: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-primary);
  box-shadow: var(--shadow-gold);
  border: 1px solid rgba(255, 221, 72, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffd338, var(--gold));
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--gold-glow), var(--shadow-gold);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
}

.btn-secondary {
  background: rgba(45, 17, 20, 0.6);
  color: var(--ivory);
  border: 1px solid var(--sandstone);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--gold-dim);
  color: var(--gold);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

.btn-danger {
  background: var(--vermillion);
  color: var(--ivory);
  border: 1px solid rgba(200, 80, 56, 0.4);
}

.btn-danger:hover {
  background: var(--vermillion-dim);
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: translateY(0) scale(0.98);
}


.btn-block {
  width: 100%;
}

.btn-lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--fs-lg);
  min-height: 56px;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.btn.is-loading .btn-icon {
  animation: bell-soft-ring 700ms ease-in-out infinite;
}

/* ---- Temple Stairs Progress Bar (3D Architectural Stepping Stones) ---- */
.stairs-container {
  width: 100%;
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-4) 0;
  perspective: 400px; /* Perspective for isometric feel */
}

.stair {
  flex: 1;
  height: 40px;
  background: linear-gradient(180deg, rgba(45, 17, 20, 0.7) 0%, rgba(28, 7, 9, 0.95) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--sandstone);
  transition: all var(--transition-base);
  position: relative;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: translateZ(0);
  cursor: default;
}

.stair::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 221, 72, 0.08), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
  border-radius: inherit;
}

.stair.current {
  border-color: var(--gold);
  color: var(--gold);
  background: linear-gradient(180deg, rgba(255, 221, 72, 0.22) 0%, rgba(45, 17, 20, 0.85) 100%);
  box-shadow: 0 0 15px var(--gold-glow), inset 0 1px 0 rgba(255, 221, 72, 0.2);
  animation: pulse-stair 1.6s ease-in-out infinite;
  transform: translateZ(10px) translateY(-2px);
}

.stair.correct {
  background: linear-gradient(180deg, #1b3824 0%, #0c2013 100%);
  border-color: var(--jade);
  color: var(--celadon);
  box-shadow: 0 0 12px rgba(63, 163, 103, 0.25), inset 0 1px 0 rgba(172, 225, 175, 0.15);
  transform: translateZ(4px);
  text-shadow: 0 0 8px rgba(203, 240, 204, 0.4);
}

.stair.wrong {
  background: linear-gradient(180deg, #5c181d 0%, #2b0b0e 100%);
  border-color: var(--vermillion);
  color: var(--lotus);
  box-shadow: 0 0 12px rgba(189, 33, 43, 0.25), inset 0 1px 0 rgba(255, 194, 199, 0.15);
  transform: translateZ(-2px);
}

@keyframes pulse-stair {
  0%, 100% {
    box-shadow: 0 0 12px var(--gold-glow), inset 0 1px 0 rgba(255, 221, 72, 0.2);
    border-color: var(--gold-dim);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 221, 72, 0.45), inset 0 1px 0 rgba(255, 221, 72, 0.4);
    border-color: var(--gold);
    transform: translateZ(12px) translateY(-3px);
  }
}

/* ---- Quiz Question ---- */
.question-card {
  text-align: center;
  margin-bottom: var(--sp-6);
}

.question-number {
  font-size: var(--fs-sm);
  color: var(--sandstone);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.question-text {
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.5;
  color: var(--ivory);
}

/* ---- Answer Options ---- */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 100%;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-4);
  padding-right: 74px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--ivory);
  font-size: var(--fs-base);
  font-weight: 500;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  min-height: 56px;
  position: relative;
  overflow: hidden;
  touch-action: manipulation;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.option-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(45, 17, 20, 0.8);
  transform: translateX(8px);
  box-shadow: 0 8px 24px rgba(255, 221, 72, 0.15), var(--shadow-gold), inset 0 1px 0 rgba(255, 221, 72, 0.1);
}

.option-btn:active:not(:disabled) {
  transform: translateX(4px) scale(0.985);
}

.option-label {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--gold);
  flex-shrink: 0;
  transition: all var(--transition-fast);
  border: 1px solid rgba(255, 221, 72, 0.15);
}

.option-btn:hover:not(:disabled) .option-label {
  background: var(--gold);
  color: var(--bg-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

.option-text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-main);
}

.option-btn.correct {
  border-color: var(--jade);
  background: linear-gradient(135deg, rgba(63, 163, 103, 0.2), rgba(63, 163, 103, 0.08));
  box-shadow: 0 0 20px rgba(63, 163, 103, 0.35), inset 0 1px 0 rgba(63, 163, 103, 0.2);
  animation: answer-glow 450ms ease-out;
  opacity: 1 !important;
}

.option-btn.correct .option-label {
  background: var(--celadon);
  color: var(--bg-primary);
  border-color: var(--celadon);
}

.option-btn.correct::after,
.option-btn.wrong::after {
  position: absolute;
  right: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.option-btn.correct::after {
  content: 'Đúng';
  color: var(--celadon);
}

.option-btn.wrong {
  border-color: var(--vermillion);
  background: linear-gradient(135deg, rgba(189, 33, 43, 0.2), rgba(189, 33, 43, 0.08));
  box-shadow: 0 0 20px rgba(189, 33, 43, 0.35), inset 0 1px 0 rgba(189, 33, 43, 0.2);
  animation: shake 0.3s ease;
  opacity: 1 !important;
}

.option-btn.wrong .option-label {
  background: var(--rust);
  color: var(--ivory);
  border-color: var(--rust);
}

.option-btn.wrong::after {
  content: 'Sai';
  color: var(--lotus);
}

.option-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.option-btn.correct:disabled,
.option-btn.wrong:disabled {
  opacity: 1;
}

@keyframes answer-glow {
  0% { box-shadow: 0 0 0 0 rgba(172, 225, 175, 0); }
  60% { box-shadow: 0 0 0 8px rgba(172, 225, 175, 0.08); }
  100% { box-shadow: 0 0 0 0 rgba(172, 225, 175, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

/* ---- Timer ---- */
.timer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.timer-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--gold);
  transition: all var(--transition-fast);
}

.timer-circle.urgent {
  border-color: var(--vermillion);
  color: var(--vermillion);
  animation: pulse-timer 0.5s ease-in-out infinite;
}

@keyframes pulse-timer {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ---- Lives (Zen Lotus Style) ---- */
.lives-container {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.life-lotus {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  filter: drop-shadow(0 0 5px var(--gold-glow));
  transition: all var(--transition-base);
}

.life-lotus .lotus-svg {
  width: 100%;
  height: 100%;
  transition: all var(--transition-base);
}

.life-lotus.lost {
  color: var(--vermillion-dim);
  opacity: 0.3;
  filter: grayscale(0.8) drop-shadow(0 0 0 transparent);
  transform: scale(0.85);
}

/* ---- Game Stats Bar ---- */
.game-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--sp-3) 0;
  margin-bottom: var(--sp-4);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
  color: var(--sandstone);
}

.stat-value {
  font-weight: 700;
  color: var(--gold);
}

/* ---- Bell Celebration ---- */
.celebration-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 2, 4, 0.85);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.celebration-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Beautiful custom backdrops for Victory and Defeat */
#celebration-overlay {
  background: radial-gradient(circle at center, rgba(14, 2, 4, 0.45) 0%, rgba(14, 2, 4, 0.98) 85%), url('/assets/bell_celebration.png') no-repeat center/cover;
}

#gameover-overlay {
  background: radial-gradient(circle at center, rgba(14, 2, 4, 0.45) 0%, rgba(14, 2, 4, 0.98) 85%), url('/assets/gameover_bg.png') no-repeat center/cover;
}

.bell-animation {
  width: 130px;
  height: 130px;
  animation: bell-ring 1s ease-in-out;
  transform-origin: top center;
  color: var(--gold);
  filter: drop-shadow(0 0 20px var(--gold));
  margin-bottom: var(--sp-4);
}

.bell-animation svg {
  width: 100%;
  height: 100%;
  fill: rgba(255, 221, 72, 0.12);
  stroke: currentColor;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes bell-ring {
  0% { transform: rotate(0); }
  15% { transform: rotate(15deg); }
  30% { transform: rotate(-12deg); }
  45% { transform: rotate(10deg); }
  60% { transform: rotate(-8deg); }
  75% { transform: rotate(5deg); }
  90% { transform: rotate(-3deg); }
  100% { transform: rotate(0); }
}

.celebration-text {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  font-weight: 700;
  color: var(--gold);
  margin-top: var(--sp-4);
  text-align: center;
  text-shadow: 0 0 24px var(--gold-glow);
  letter-spacing: 0.02em;
}

.celebration-score {
  max-width: 420px;
  font-size: var(--fs-lg);
  color: var(--ivory-dim);
  margin-top: var(--sp-2);
  text-align: center;
  line-height: 1.6;
}

.overlay-actions {
  margin-top: var(--sp-8);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  justify-content: center;
}

.lotus-end-mark {
  width: 94px;
  height: 70px;
  position: relative;
}

.lotus-end-mark::before,
.lotus-end-mark::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 54px;
  height: 54px;
  border: 4px solid var(--lotus);
  border-radius: 54px 54px 10px 54px;
  opacity: 0.86;
}

.lotus-end-mark::before {
  left: 0;
  transform: rotate(-32deg);
}

.lotus-end-mark::after {
  right: 0;
  transform: rotate(32deg) scaleX(-1);
}

/* ---- Leaderboard ---- */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: var(--sp-3);
  text-align: left;
  border-bottom: 1px solid rgba(212, 168, 67, 0.1);
}

.leaderboard-table th {
  color: var(--sandstone);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--fs-sm);
}

.rank-1 { background: var(--gold); color: var(--bg-primary); }
.rank-2 { background: #c0c0c0; color: var(--bg-primary); }
.rank-3 { background: #cd7f32; color: var(--bg-primary); }
.rank-other { background: var(--bg-elevated); color: var(--sandstone); }

/* ---- Landing Page ---- */
.landing-page {
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 4rem) var(--sp-4);
  overflow: hidden;
}

.landing-container {
  max-width: var(--landing-width);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  grid-template-areas:
    "hero quiz"
    "start quiz";
  gap: var(--sp-6);
  align-items: center;
}

.temple-aura {
  position: absolute;
  inset: 80px 0 auto 0;
  height: 420px;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.temple-aura span {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(84vw, 860px);
  height: min(48vw, 440px);
  transform: translateX(-50%);
  border: 1px solid rgba(226, 182, 79, 0.16);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  transform-origin: bottom center;
  animation: aura-breath 9s ease-in-out infinite;
}

.temple-aura span:nth-child(2) {
  width: min(70vw, 690px);
  height: min(40vw, 340px);
  border-color: rgba(111, 191, 143, 0.16);
  animation-delay: 3s;
}

.temple-aura span:nth-child(3) {
  width: min(54vw, 520px);
  height: min(30vw, 260px);
  border-color: rgba(232, 180, 184, 0.15);
  animation-delay: 6s;
}

@keyframes aura-breath {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.7;
    filter: drop-shadow(0 0 4px rgba(226, 182, 79, 0.08));
  }
  50% {
    transform: translateX(-50%) scale(1.04);
    opacity: 1;
    filter: drop-shadow(0 0 16px rgba(226, 182, 79, 0.22));
  }
}

.hero {
  grid-area: hero;
  text-align: left;
  padding: var(--sp-8) 0 0;
}

.hero-bell {
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
  margin-bottom: var(--sp-4);
  color: var(--gold);
  animation: float 3s ease-in-out infinite;
}

.hero-bell-svg {
  width: 100%;
  height: 100%;
  fill: rgba(226, 182, 79, 0.08);
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 20px var(--gold-glow));
}

.hero-kicker,
.quiz-card-topline {
  color: var(--jade);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  line-height: 1.05;
  font-weight: 700;
  color: var(--ivory);
  margin: var(--sp-2) 0 var(--sp-4);
  text-shadow: 0 0 34px rgba(226, 182, 79, 0.2);
}

.hero-subtitle {
  max-width: 620px;
  font-size: var(--fs-lg);
  color: var(--ivory-dim);
  margin-bottom: var(--sp-4);
}

.home-quiz-card,
.start-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.home-quiz-card {
  grid-area: quiz;
  padding: var(--sp-6);
  position: relative;
  transition: border-color var(--transition-base);
}

.home-quiz-card:hover {
  border-color: rgba(255, 221, 72, 0.22);
}

.home-quiz-card::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 221, 72, 0.12);
  border-radius: calc(var(--radius-lg) - 2px);
  pointer-events: none;
}

.quiz-card-topline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.lotus-mark {
  width: 28px;
  height: 20px;
  position: relative;
  display: inline-block;
}

.lotus-mark::before,
.lotus-mark::after {
  content: '';
  position: absolute;
  bottom: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--lotus);
  border-radius: 16px 16px 4px 16px;
  transform: rotate(-32deg);
  box-shadow: 0 0 6px rgba(255, 194, 199, 0.2);
}

.lotus-mark::after {
  right: 0;
  transform: rotate(32deg) scaleX(-1);
}

.home-quiz-card h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  line-height: 1.35;
  color: var(--ivory);
  margin-bottom: var(--sp-5);
}

.home-answer-grid {
  display: grid;
  gap: var(--sp-3);
}

.home-answer {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--ivory);
  background: rgba(13, 18, 13, 0.35);
  text-align: left;
  line-height: 1.45;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  touch-action: manipulation;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.02);
}

.home-answer:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(45, 17, 20, 0.85);
  box-shadow: 0 6px 16px rgba(255, 221, 72, 0.12), inset 0 1px 0 rgba(255, 221, 72, 0.08);
}

.answer-letter {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--gold);
  font-weight: 700;
  transition: all var(--transition-fast);
  border: 1px solid rgba(255, 221, 72, 0.15);
}

.home-answer:hover .answer-letter {
  background: var(--gold);
  color: var(--bg-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

.home-answer.correct {
  border-color: var(--jade);
  background: linear-gradient(135deg, rgba(63, 163, 103, 0.2), rgba(63, 163, 103, 0.08));
  box-shadow: 0 0 16px rgba(63, 163, 103, 0.3), inset 0 1px 0 rgba(63, 163, 103, 0.2);
}

.home-answer.correct .answer-letter {
  color: var(--ink);
  background: var(--celadon);
  border-color: var(--celadon);
}

.home-answer.wrong {
  border-color: var(--vermillion);
  background: linear-gradient(135deg, rgba(189, 33, 43, 0.2), rgba(189, 33, 43, 0.08));
  box-shadow: 0 0 16px rgba(189, 33, 43, 0.3), inset 0 1px 0 rgba(189, 33, 43, 0.2);
  animation: shake 0.3s ease;
}

.home-answer.wrong .answer-letter {
  color: var(--ivory);
  background: var(--vermillion);
  border-color: var(--vermillion);
}

.home-feedback {
  min-height: 48px;
  margin-top: var(--sp-4);
  color: var(--sandstone);
  font-size: var(--fs-sm);
}

.home-feedback.is-correct {
  color: var(--celadon);
}

.home-feedback.is-wrong {
  color: var(--lotus);
}

.start-card {
  grid-area: start;
}

.rule-list {
  display: grid;
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
  padding: var(--sp-4);
  background: rgba(13, 18, 13, 0.42);
  border: 1px solid rgba(226, 182, 79, 0.12);
  border-radius: var(--radius-md);
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  color: var(--sandstone);
}

.rule-row strong {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

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

@keyframes bell-soft-ring {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(10deg); }
  50% { transform: rotate(-8deg); }
  75% { transform: rotate(5deg); }
}

/* ---- Incense Smoke ---- */
.incense-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.incense-particle {
  position: absolute;
  bottom: -20px;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, rgba(226, 182, 79, 0.6) 0%, rgba(226, 182, 79, 0) 80%);
  border-radius: var(--radius-full);
  filter: blur(0.5px);
  box-shadow: 0 0 8px rgba(226, 182, 79, 0.35);
  animation: incense-rise linear infinite;
}

@keyframes incense-rise {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-80px) translateX(12px) scale(1.6);
    opacity: 0.3;
  }
  65% {
    transform: translateY(-160px) translateX(-8px) scale(2.2);
    opacity: 0.15;
  }
  100% {
    transform: translateY(-260px) translateX(4px) scale(2.8);
    opacity: 0;
  }
}

/* ---- Admin ---- */
.admin-layout {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}

.admin-sidebar {
  width: 240px;
  background: var(--bg-surface);
  border-right: 1px solid rgba(212, 168, 67, 0.1);
  padding: var(--sp-4);
  flex-shrink: 0;
}

.admin-main {
  flex: 1;
  padding: var(--sp-6);
  overflow-y: auto;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  color: var(--sandstone);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.admin-nav a:hover,
.admin-nav a.active {
  background: var(--bg-elevated);
  color: var(--gold);
}

/* ---- Form Inputs ---- */
.form-group {
  margin-bottom: var(--sp-4);
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sandstone);
  margin-bottom: var(--sp-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--sp-3);
  background: var(--bg-primary);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: var(--radius-md);
  color: var(--ivory);
  font-family: var(--font-main);
  font-size: var(--fs-base);
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a89882' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ---- Utility Classes ---- */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-muted { color: var(--sandstone); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .admin-sidebar {
    display: none;
  }
  .landing-page {
    padding: var(--sp-4) 0 var(--sp-8);
  }
  .landing-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "quiz"
      "start";
    gap: var(--sp-4);
  }
  .hero {
    text-align: center;
    padding-top: var(--sp-4);
  }
  .hero-bell {
    margin-left: auto;
    margin-right: auto;
    width: 78px;
    height: 78px;
  }
  .hero-title {
    font-size: var(--fs-3xl);
  }
  .hero-subtitle {
    font-size: var(--fs-base);
  }
  .home-quiz-card h2 {
    font-size: var(--fs-xl);
  }
  .home-answer {
    align-items: flex-start;
  }
  .option-btn {
    padding-right: var(--sp-4);
  }
  .option-btn.correct::after,
  .option-btn.wrong::after {
    display: none;
  }
  .stair {
    height: 28px;
    font-size: 10px;
  }
}

@media (min-width: 481px) and (max-width: 900px) {
  .landing-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "quiz"
      "start";
    max-width: 640px;
  }
  .hero {
    text-align: center;
  }
  .hero-bell {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
  .incense-container {
    display: none;
  }
}

/* ---- Explanation Card & Next Button ---- */
.explanation-card {
  background: rgba(27, 36, 25, 0.85);
  border: 1px dashed var(--gold);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm), inset 0 0 12px rgba(226, 182, 79, 0.08);
  backdrop-filter: blur(10px);
  animation: fade-in-up 0.4s ease-out;
  border-left: 4px solid var(--gold);
  text-align: left;
}

.explanation-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--gold);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  font-size: var(--fs-base);
}

.lotus-mini-mark {
  filter: drop-shadow(0 0 4px var(--gold));
  font-size: var(--fs-lg);
}

.explanation-desc {
  font-size: var(--fs-sm);
  color: var(--ivory-dim);
  line-height: 1.6;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.next-btn-container {
  animation: fade-in-up 0.5s ease-out;
}

/* ============================================
   Zen Splash Screen & Monastic Zoom Transition
   ============================================ */

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.2s;
  visibility: visible;
  opacity: 1;
}

.splash-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(30, 8, 10, 0.98) 20%, rgba(14, 2, 4, 1) 100%);
  z-index: 1;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Atmospheric subtle background for splash screen */
.splash-backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/assets/temple_bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  filter: blur(2px);
  pointer-events: none;
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-6);
  max-width: 500px;
  width: 100%;
}

.splash-bell-container {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-6);
  cursor: pointer;
}

.splash-aura {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(255, 221, 72, 0.15) 0%, rgba(255, 221, 72, 0.05) 50%, transparent 70%);
  animation: aura-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

.splash-bell {
  width: 155px;
  height: 155px;
  object-fit: contain;
  filter: drop-shadow(0 0 25px var(--gold-glow));
  transition: transform 1.2s cubic-bezier(0.85, 0, 0.15, 1), filter 1.2s ease, opacity 1s ease;
  transform-origin: top center;
  user-select: none;
  -webkit-user-drag: none;
}

/* Mechanical physical bell swing animation when clicked */
.splash-bell.ringing {
  animation: bell-ring-heavy 0.55s ease-in-out infinite alternate;
}

.splash-title {
  font-family: var(--font-heading);
  font-size: var(--fs-4xl);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.03em;
  text-shadow: 0 0 20px rgba(255, 221, 72, 0.4);
  margin: var(--sp-2) 0 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.splash-subtitle {
  font-size: var(--fs-base);
  color: var(--ivory-dim);
  font-family: var(--font-heading);
  font-style: italic;
  opacity: 0.85;
  margin-top: var(--sp-2);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.splash-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: var(--sp-10);
  padding: var(--sp-3) var(--sp-8);
  background: rgba(255, 221, 72, 0.08);
  border: 1px solid rgba(255, 221, 72, 0.25);
  border-radius: var(--radius-full);
  color: var(--gold);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(255, 221, 72, 0.08);
  cursor: pointer;
  user-select: none;
}

.splash-trigger-btn:hover {
  background: rgba(255, 221, 72, 0.18);
  border-color: var(--gold);
  box-shadow: 0 0 25px rgba(255, 221, 72, 0.2);
  transform: translateY(-2px);
}

.splash-trigger-btn .pulse-ring {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(255, 221, 72, 0.4);
  border-radius: var(--radius-full);
  animation: pulse-ring-anim 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
  pointer-events: none;
}

/* ============================================
   Zoom Reveal Transition States
   ============================================ */

.zoom-out-reveal {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.zoom-out-reveal .splash-bell {
  transform: scale(22) translate3d(0, 0, 0);
  filter: blur(16px);
  opacity: 0;
}

.zoom-out-reveal .splash-title,
.zoom-out-reveal .splash-subtitle {
  opacity: 0;
  transform: translateY(-25px);
}

.zoom-out-reveal .splash-backdrop {
  opacity: 0;
}

/* ============================================
   Animation Keyframes
   ============================================ */

@keyframes aura-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
    filter: drop-shadow(0 0 35px rgba(255, 221, 72, 0.3));
  }
}

@keyframes bell-ring-heavy {
  0% { transform: rotate(0); }
  25% { transform: rotate(18deg); }
  50% { transform: rotate(-14deg); }
  75% { transform: rotate(10deg); }
  100% { transform: rotate(-8deg); }
}

@keyframes pulse-ring-anim {
  0% {
    transform: scale(0.96);
    opacity: 1;
  }
  100% {
    transform: scale(1.12);
    opacity: 0;
  }
}

/* Responsive adjustment for Mobile screens */
@media (max-width: 480px) {
  .splash-bell-container {
    width: 180px;
    height: 180px;
  }
  .splash-aura {
    width: 220px;
    height: 220px;
  }
  .splash-bell {
    width: 125px;
    height: 125px;
  }
  .splash-title {
    font-size: var(--fs-2xl);
  }
  .splash-subtitle {
    font-size: var(--fs-sm);
  }
  .splash-trigger-btn {
    padding: var(--sp-2) var(--sp-6);
    font-size: var(--fs-xs);
  }
}

/* ============================================
   Zen Movie Credits Overlay Style & Keyframes
   ============================================ */

.after-credits-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999999;
  background: radial-gradient(circle at center, #140406 10%, #050001 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.after-credits-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Close button - sleek transparent circular style */
.credits-close-btn {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-6);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 221, 72, 0.15);
  color: var(--ivory-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.credits-close-btn:hover {
  background: rgba(255, 221, 72, 0.1);
  border-color: var(--gold);
  color: var(--gold);
  transform: rotate(90deg);
}

/* Credit scrolling text mask window */
.credits-roll-container {
  position: relative;
  width: 90%;
  max-width: 540px;
  height: 80vh;
  overflow: hidden;
  /* Top and bottom soft fade mask */
  mask-image: linear-gradient(to bottom, transparent, white 20%, white 80%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, white 20%, white 80%, transparent);
}

.credits-roll-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
  transform: translateY(85vh); /* Start completely below the viewport window */
  will-change: transform;
}

/* Activate scroll animation only when overlay becomes active */
.after-credits-overlay.active .credits-roll-text {
  animation: credits-scroll 65s linear forwards;
}

/* Sections inside credits */
.credits-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-8) 0;
}

.lotus-glow-mark {
  filter: drop-shadow(0 0 10px var(--gold-glow));
  margin-bottom: var(--sp-4);
  animation: float 4s ease-in-out infinite;
}

.credits-main-title {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  color: var(--gold);
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(255, 221, 72, 0.3);
  text-transform: uppercase;
}

.credits-subtitle {
  font-size: var(--fs-base);
  color: var(--lotus-dim);
  font-family: var(--font-heading);
  font-style: italic;
  margin-top: var(--sp-2);
}

/* Dividers */
.credits-divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 221, 72, 0.4), transparent);
  margin: var(--sp-6) auto;
  position: relative;
}

.credits-divider::after {
  content: '❈';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gold-dim);
  font-size: var(--fs-xs);
  background: #0e0204;
  padding: 0 var(--sp-2);
}

/* Individual credit message blocks */
.credits-block {
  width: 100%;
  padding: var(--sp-4) var(--sp-2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.credits-role {
  font-size: var(--fs-sm);
  color: var(--gold-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
  display: block;
}

.credits-message {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: var(--fs-lg);
  color: var(--ivory);
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto var(--sp-3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.credits-signature {
  font-size: var(--fs-xs);
  color: var(--lotus);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 194, 199, 0.08);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 194, 199, 0.15);
}

.final-wish h1 {
  font-family: var(--font-heading);
  font-size: var(--fs-3xl);
  color: var(--gold);
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 221, 72, 0.4);
}

.credits-date {
  font-size: var(--fs-sm);
  color: var(--sandstone);
  margin-top: var(--sp-4);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Background floating particles for cinematic credit atmosphere */
.credits-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.credits-particles span {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0.3;
  filter: blur(1px);
  animation: float-particle 8s infinite linear;
}

/* Distribute particles across the viewport with CSS */
.credits-particles span:nth-child(1) { left: 10%; bottom: -10px; animation-duration: 9s; animation-delay: 0s; }
.credits-particles span:nth-child(2) { left: 25%; bottom: -10px; animation-duration: 12s; animation-delay: 2s; }
.credits-particles span:nth-child(3) { left: 45%; bottom: -10px; animation-duration: 8s; animation-delay: 1s; }
.credits-particles span:nth-child(4) { left: 60%; bottom: -10px; animation-duration: 14s; animation-delay: 3s; }
.credits-particles span:nth-child(5) { left: 80%; bottom: -10px; animation-duration: 10s; animation-delay: 0.5s; }
.credits-particles span:nth-child(6) { left: 15%; bottom: -10px; animation-duration: 11s; animation-delay: 4s; }
.credits-particles span:nth-child(7) { left: 70%; bottom: -10px; animation-duration: 7s; animation-delay: 1.5s; }
.credits-particles span:nth-child(8) { left: 90%; bottom: -10px; animation-duration: 13s; animation-delay: 2.5s; }

/* Keyframes for credits scrolling and floating particles */
@keyframes credits-scroll {
  0% {
    transform: translateY(80vh);
  }
  100% {
    transform: translateY(-108%); /* Scroll fully past the top mask */
  }
}

@keyframes float-particle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.45;
  }
  90% {
    opacity: 0.45;
  }
  100% {
    transform: translateY(-110vh) translateX(30px);
    opacity: 0;
  }
}

/* Adjust credits sizes on smaller mobile screens */
@media (max-width: 480px) {
  .credits-roll-container {
    height: 75vh;
  }
  .credits-main-title {
    font-size: var(--fs-xl);
  }
  .credits-message {
    font-size: var(--fs-base);
    line-height: 1.6;
    max-width: 100%;
  }
  .final-wish h1 {
    font-size: var(--fs-xl);
  }
  .credits-divider {
    margin: var(--sp-4) auto;
  }
  .credits-close-btn {
    top: var(--sp-4);
    right: var(--sp-4);
    width: 36px;
    height: 36px;
  }
}

