/* Default: WRATH MODE variables*/
:root {
  --mode: "wrath";
  --primary: #ff4444;
  --primary-dark: #cc0000;
  --primary-light: #ff6666;
  --accent: #ff8800;
  --accent-dark: #cc6600;
  --secondary: #1a0a0a;
  --secondary-dark: #0d0505;
  --danger: #ff0000;
  --success: #2ecc71;
  --text-light: #fff5f5;
  --text-medium: #ffcccc;
  --glow-1: rgba(255, 68, 68, 0.7);
  --glow-2: rgba(255, 136, 0, 0.9);
  --bg-overlay-wrath: linear-gradient(
    135deg,
    rgba(139, 0, 0, 0.3) 0%,
    rgba(10, 0, 0, 0.6) 50%,
    rgba(50, 0, 0, 0.4) 100%
  );
  --container-bg-wrath: linear-gradient(
    145deg,
    rgba(20, 5, 5, 0.65),
    rgba(8, 2, 2, 0.75)
  );
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* SHIELD MODE overrides */
body.shield-mode {
  --mode: "shield";
  --primary: #00b8b8;
  --primary-dark: #008080;
  --primary-light: #33cccc;
  --accent: #00ffaa;
  --accent-dark: #00cc88;
  --secondary: #001f1f;
  --secondary-dark: #000d0d;
  --danger: #009999;
  --success: #33ffcc;
  --text-light: #e5ffff;
  --text-medium: #b3ffff;
  --glow-1: rgba(0, 200, 200, 0.6);
  --glow-2: rgba(0, 255, 170, 0.8);
  --bg-overlay-wrath: linear-gradient(
    135deg,
    rgba(0, 48, 48, 0.25) 0%,
    rgba(0, 8, 8, 0.6) 50%,
    rgba(0, 28, 28, 0.35) 100%
  );
  --container-bg-wrath: linear-gradient(
    145deg,
    rgba(3, 10, 12, 0.65),
    rgba(4, 8, 10, 0.75)
  );
}

/* Optimized global styles */
* {
  transition: color 0.3s var(--transition),
    background-color 0.3s var(--transition), border-color 0.3s var(--transition),
    box-shadow 0.3s var(--transition), transform 0.25s var(--transition);
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  cursor: url("asset/Cursor.cur") 32 32, auto;
}

/* Cursor auto-hide */
body.cursor-hidden,
body.cursor-hidden * {
  cursor: none !important;
}

button,
.btn,
input,
select,
option,
.hero-input,
.difficulty-select {
  cursor: url("asset/Cursor.cur") 32 32, auto !important;
}

html {
  scroll-behavior: smooth;
  font-size-adjust: 0.52;
}

.glow-text,
.results h2,
.loader-text {
  line-height: 1.15;
}

/* Background Layers */
body.shield-mode #bg-image {
  background-image: url("asset/shieldmode.webp");
  filter: saturate(1.04) contrast(1.02);
}

#bg-image,
#bg-overlay {
  width: 100vw;
  height: 100vh;
}

#bg-overlay {
  transition: background 0.6s ease;
}

/* Canvas */
#particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  will-change: auto;
}

.container {
  box-shadow: 0 0 50px var(--glow-1), 0 0 100px rgba(255, 68, 68, 0.3),
    0 20px 60px rgba(0, 0, 0, 0.4), inset 0 0 80px rgba(255, 68, 68, 0.08);
  animation: containerGlow 4s infinite ease-in-out;
  will-change: box-shadow;
}

.container.entered {
  animation: containerFadeIn 0.6s ease;
}

@keyframes containerFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

body.shield-mode .container {
  box-shadow: 0 0 50px var(--glow-1), 0 0 100px rgba(0, 200, 200, 0.3),
    inset 0 0 80px rgba(0, 200, 200, 0.06);
}

@keyframes containerGlow {
  0%,
  100% {
    box-shadow: 0 0 50px var(--glow-1), 0 0 100px rgba(255, 68, 68, 0.3),
      inset 0 0 80px rgba(255, 68, 68, 0.08);
  }
  50% {
    box-shadow: 0 0 70px var(--glow-1), 0 0 120px rgba(255, 68, 68, 0.4),
      inset 0 0 100px rgba(255, 68, 68, 0.12);
  }
}

/* Header*/
.quiz-header {
  text-align: center;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 2px solid rgba(255, 68, 68, 0.2);
  position: relative;
}

.quiz-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: headerLineGlow 2s ease-in-out infinite;
  will-change: opacity, width;
}

@keyframes headerLineGlow {
  0%,
  100% {
    opacity: 0.5;
    width: 100px;
  }
  50% {
    opacity: 1;
    width: 200px;
  }
}

body.shield-mode .quiz-header {
  border-bottom-color: rgba(0, 200, 200, 0.2);
}

.shield-logo {
  animation: shieldFloat 3s infinite ease-in-out;
  filter: drop-shadow(0 0 25px var(--glow-1));
  will-change: transform;
}

@keyframes shieldFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.05);
  }
}

.glow-text {
  font-family: "Cinzel", serif;
  font-size: 38px;
  font-weight: 900;
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--accent),
    #ffcc00,
    var(--primary)
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textShine 4s linear infinite;
  margin: 16px 0;
  letter-spacing: 2px;
  text-transform: uppercase;
  will-change: background-position;
}

@keyframes textShine {
  to {
    background-position: 300% center;
  }
}

.subtitle {
  color: var(--text-medium);
  font-size: 16px;
  text-shadow: 0 0 15px var(--glow-2);
  font-weight: 500;
  letter-spacing: 1px;
  margin-top: 8px;
}

/* Theme Toggle*/
.btn-theme {
  min-width: 180px;
  white-space: nowrap;
  padding: 14px 36px;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    rgba(255, 68, 68, 0.25),
    rgba(255, 136, 0, 0.2),
    rgba(255, 68, 68, 0.25)
  );
  background-size: 200% 200%;
  border: 3px solid rgba(255, 68, 68, 0.5);
  color: var(--text-light);
  box-shadow: 0 6px 20px rgba(255, 68, 68, 0.3),
    0 0 40px rgba(255, 68, 68, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: themeButtonPulse 3s ease-in-out infinite;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}

@keyframes themeButtonPulse {
  0%,
  100% {
    background-position: 0% 50%;
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.3),
      0 0 40px rgba(255, 68, 68, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.15),
      inset 0 -2px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 6px 25px rgba(255, 68, 68, 0.4),
      0 0 50px rgba(255, 68, 68, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.2),
      inset 0 -2px 8px rgba(0, 0, 0, 0.2);
  }
}

body.shield-mode .btn-theme {
  background: linear-gradient(
    135deg,
    rgba(0, 184, 184, 0.25),
    rgba(0, 255, 170, 0.2),
    rgba(0, 184, 184, 0.25)
  );
  background-size: 200% 200%;
  border-color: rgba(0, 200, 200, 0.5);
  box-shadow: 0 6px 20px rgba(0, 200, 200, 0.3),
    0 0 40px rgba(0, 200, 200, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 8px rgba(0, 0, 0, 0.2);
  animation: themeButtonPulseShield 3s ease-in-out infinite;
}

@keyframes themeButtonPulseShield {
  0%,
  100% {
    background-position: 0% 50%;
    box-shadow: 0 6px 20px rgba(0, 200, 200, 0.3),
      0 0 40px rgba(0, 200, 200, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.15),
      inset 0 -2px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 6px 25px rgba(0, 200, 200, 0.4),
      0 0 50px rgba(0, 200, 200, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.2),
      inset 0 -2px 8px rgba(0, 0, 0, 0.2);
  }
}

.btn-theme:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 35px rgba(255, 68, 68, 0.5),
    0 0 60px rgba(255, 68, 68, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 8px rgba(0, 0, 0, 0.3);
  border-color: var(--primary);
  filter: brightness(1.15);
}

body.shield-mode .btn-theme:hover {
  box-shadow: 0 10px 35px rgba(0, 200, 200, 0.5),
    0 0 60px rgba(0, 200, 200, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.btn-theme:active {
  transform: translateY(-1px) scale(1.02);
  transition: all 0.1s ease;
}

/* Theme icon container with rotation effect */
.theme-icon {
  position: relative;
  margin-right: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.btn-theme:hover .theme-icon {
  transform: rotate(360deg) scale(1.2);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Icon visibility toggle*/
.icon-wrath,
.icon-shield {
  position: absolute;
  transition: opacity 0.4s ease,
    transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.icon-wrath {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  animation: iconFloat 2s ease-in-out infinite;
}

.icon-shield {
  opacity: 0;
  transform: scale(0.3) rotate(-180deg);
}

body.shield-mode .icon-wrath {
  opacity: 0;
  transform: scale(0.3) rotate(180deg);
  animation: none;
}

body.shield-mode .icon-shield {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.1);
  }
}

/* Text label switcher*/
.theme-text {
  position: relative;
  margin-left: 4px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  font-weight: 700;
}

.theme-label-wrath,
.theme-label-shield {
  position: absolute;
  white-space: nowrap;
  transition: opacity 0.4s ease,
    transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
}

.theme-label-wrath {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.theme-label-shield {
  opacity: 0;
  transform: translateY(20px) scale(0.8);
}

body.shield-mode .theme-label-wrath {
  opacity: 0;
  transform: translateY(-20px) scale(0.8);
}

body.shield-mode .theme-label-shield {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Animated glow effect on hover - outer glow */
.btn-theme::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50px;
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--accent),
    #ffcc00,
    var(--primary)
  );
  background-size: 300% 300%;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s ease;
  animation: gradientShift 4s ease infinite;
  filter: blur(8px);
}

.btn-theme:hover::before {
  opacity: 0.6;
}

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

/* Pulse animation on click - ripple effect */
.btn-theme::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.8) 0%,
    var(--primary) 40%,
    transparent 70%
  );
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.btn-theme:active::after {
  opacity: 0.5;
  transform: scale(1.5);
  transition: opacity 0s, transform 0s;
}

/* Shimmer effect overlay */
.btn-theme .shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmerSlide 3s ease-in-out infinite;
  pointer-events: none;
  border-radius: 50px;
}

@keyframes shimmerSlide {
  0% {
    left: -100%;
  }
  50%,
  100% {
    left: 200%;
  }
}

/* Button shake animation on click */
@keyframes buttonShake {
  0%,
  100% {
    transform: translateX(0) translateY(-2px);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-4px) translateY(-2px) rotate(-2deg);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(4px) translateY(-2px) rotate(2deg);
  }
}

/* Theme particle burst animation */
@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(
        calc(cos(var(--angle)) * var(--velocity)),
        calc(sin(var(--angle)) * var(--velocity))
      )
      scale(0);
    opacity: 0;
  }
}

.theme-particle {
  animation: particleBurst 0.8s ease-out forwards;
}

/* Theme Toggle positioning */
#themeToggle {
  margin-top: 12px;
}

/* Glow trail effect on hover */
.btn-theme:hover .shimmer {
  animation: shimmerSlide 1.5s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%
  );
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .btn-theme {
    padding: 12px 28px;
    font-size: 14px;
    min-width: 160px;
  }

  .theme-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }

  .theme-text {
    min-width: 80px;
  }
}

/* Screen Card */
.screen-card {
  animation: fadeIn 0.5s ease,
    slideInUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

@keyframes slideInUp {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Welcome */
.welcome-section {
  text-align: center;
  margin-bottom: 35px;
  padding: 20px;
  background: rgba(255, 68, 68, 0.05);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 68, 68, 0.15);
}

body.shield-mode .welcome-section {
  background: rgba(0, 200, 200, 0.05);
  border-color: rgba(0, 200, 200, 0.15);
}

.hero-badge {
  margin-bottom: 12px;
  display: block;
  filter: drop-shadow(0 0 18px var(--glow-1));
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.welcome-section h2 {
  font-family: "Cinzel", serif;
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 10px;
  text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
  animation: fadeInDown 0.8s ease;
}

@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-text {
  color: var(--text-medium);
  line-height: 1.6;
  font-size: 14px;
}

/* Input Group */
.input-group {
  margin-bottom: 24px;
  position: relative;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-input,
.difficulty-select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(20, 5, 5, 0.85);
  border: 2px solid rgba(255, 68, 68, 0.4);
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-size: 15px;
  font-family: "Poppins", sans-serif;
  transition: all 0.3s var(--transition);
  cursor: pointer;
}

.hero-input:hover,
.difficulty-select:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.2);
}

body.shield-mode .hero-input,
body.shield-mode .difficulty-select {
  background: rgba(3, 12, 12, 0.85);
  border-color: rgba(0, 200, 200, 0.25);
}

.hero-input:focus,
.difficulty-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 25px var(--glow-1);
}

.hero-input::placeholder {
  color: var(--text-medium);
  opacity: 0.5;
}

.difficulty-select option {
  background: #1a0505;
  padding: 10px;
}

/* Buttons - pill style */
.btn {
  padding: 14px 30px;
  border: none;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2), 0 0 30px var(--glow-1);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25), 0 0 50px var(--glow-1);
}

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

.btn-secondary {
  background: linear-gradient(135deg, #3a3a3a, #252525);
  color: var(--text-light);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 255, 255, 0.08);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-large {
  padding: 18px 40px;
  font-size: 17px;
  width: 100%;
}

/* Stats Panel */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 68, 68, 0.2);
}

body.shield-mode .stats-panel {
  border-color: rgba(0, 200, 200, 0.2);
}

/* 3D perspective container for question transitions */
#quiz {
  perspective: 1200px;
  perspective-origin: center center;
}

.stat-card {
  background: rgba(255, 68, 68, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
}

.stat-card:hover::before {
  left: 100%;
}

.stat-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 68, 68, 0.4);
  border-color: var(--primary);
}

body.shield-mode .stat-card {
  background: rgba(0, 200, 200, 0.07);
  border: 1px solid rgba(0, 200, 200, 0.22);
}

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

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.timer {
  color: var(--accent) !important;
}

.stat-card.warning {
  animation: cardPulse 0.5s infinite;
}

.stat-card.warning .timer {
  color: var(--danger) !important;
  animation: timerBlink 0.4s infinite;
}

@keyframes timerBlink {
  50% {
    opacity: 0.4;
  }
}

@keyframes cardPulse {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6);
    border-color: rgba(255, 0, 0, 0.8);
  }
}

/* Progress */
.progress-container {
  margin-bottom: 28px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 68, 68, 0.2);
}

body.shield-mode .progress-container {
  border-color: rgba(0, 200, 200, 0.2);
}

.progress-bar {
  height: 10px;
  background: rgba(255, 68, 68, 0.15);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(255, 68, 68, 0.3);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.shield-mode .progress-bar {
  border-color: rgba(0, 200, 200, 0.3);
}

body.shield-mode .progress-bar {
  background: rgba(0, 200, 200, 0.08);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent), #ffcc00);
  background-size: 200% 100%;
  width: 0%;
  transition: width 0.4s ease;
  animation: progressShine 2s linear infinite;
  box-shadow: 0 0 15px var(--glow-1);
}

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

.progress-text {
  text-align: right;
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
}

/* Question Set */
.question-set {
  background: rgba(15, 3, 3, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 68, 68, 0.4);
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  display: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

body.shield-mode .question-set {
  background: rgba(2, 8, 8, 0.45);
  border-color: rgba(0, 200, 200, 0.18);
}

/* Sliding door transition - entering from right */
.question-set.entering {
  display: block;
  animation: slideDoorEnter 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Sliding door transition - exiting to left */
.question-set.exiting {
  display: block;
  animation: slideDoorExit 0.4s cubic-bezier(0.6, 0.04, 0.98, 0.335);
}

.question-set.active {
  display: block;
}

/* Sliding door animations with 3D effect */
@keyframes slideDoorEnter {
  0% {
    opacity: 0;
    transform: translateX(120%) translateZ(-200px) rotateY(60deg) scale(0.8);
    filter: blur(3px);
  }
  50% {
    opacity: 0.7;
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateZ(0) rotateY(0deg) scale(1);
    filter: blur(0);
  }
}

@keyframes slideDoorExit {
  0% {
    opacity: 1;
    transform: translateX(0) translateZ(0) rotateY(0deg) scale(1);
    filter: blur(0);
  }
  50% {
    opacity: 0.5;
    filter: blur(1px);
  }
  100% {
    opacity: 0;
    transform: translateX(-120%) translateZ(-200px) rotateY(-60deg) scale(0.8);
    filter: blur(3px);
  }
}

@keyframes questionGlow {
  0% {
    box-shadow: 0 0 0 rgba(255, 68, 68, 0);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.4);
  }
  100% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
}

legend {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 22px;
  line-height: 1.6;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 68, 68, 0.2);
}

body.shield-mode legend {
  border-bottom-color: rgba(0, 200, 200, 0.2);
}

.question-number {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 13px;
  margin-right: 8px;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  position: relative;
  cursor: pointer;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(10, 2, 2, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 68, 68, 0.3);
  border-radius: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.option-content::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

body.shield-mode .option-content {
  background: rgba(3, 6, 6, 0.6);
  border-color: rgba(0, 200, 200, 0.18);
}

.option:hover .option-content {
  border-color: var(--primary);
  background: rgba(255, 68, 68, 0.15);
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 6px 25px rgba(255, 68, 68, 0.35);
}

.option:hover .option-content::before {
  transform: scaleY(1);
}

body.shield-mode .option:hover .option-content {
  background: rgba(0, 200, 200, 0.06);
}

.option-letter {
  width: 32px;
  height: 32px;
  background: rgba(255, 68, 68, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

body.shield-mode .option-letter {
  background: rgba(0, 200, 200, 0.18);
}

.option-text {
  flex: 1;
  font-size: 14px;
}

.option-check {
  display: none;
  color: var(--accent);
  font-size: 16px;
}

.option.selected .option-content {
  border-color: var(--primary);
  background: rgba(255, 68, 68, 0.2);
  border-width: 3px;
  box-shadow: 0 0 30px rgba(255, 68, 68, 0.5),
    inset 0 0 20px rgba(255, 68, 68, 0.1);
  transform: translateX(6px);
}

.option.selected .option-content::before {
  transform: scaleY(1);
}

body.shield-mode .option.selected .option-content {
  background: rgba(0, 200, 200, 0.12);
}

.option.selected .option-letter {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.option.selected .option-check {
  display: block;
}

.option.correct .option-content {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.2);
}

.option.correct .option-letter {
  background: var(--success);
}

.option.incorrect .option-content {
  border-color: #e74c3c;
  background: rgba(231, 76, 60, 0.2);
}

.option.incorrect .option-letter {
  background: #e74c3c;
}

/* Nav buttons */
.nav-buttons {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 68, 68, 0.2);
}

body.shield-mode .nav-buttons {
  border-top-color: rgba(0, 200, 200, 0.2);
}

.nav-buttons .btn {
  flex: 1;
}

/* Results */
.results {
  display: none;
  text-align: center;
}

.results.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.trophy-icon {
  font-size: 70px;
  animation: trophyGlow 2s infinite, trophyFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 0 25px var(--glow-2));
}

@keyframes trophyGlow {
  0%,
  100% {
    transform: scale(1) rotate(-3deg);
  }
  50% {
    transform: scale(1.1) rotate(3deg);
  }
}

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

.results h2 {
  font-family: "Cinzel", serif;
  font-size: 34px;
  color: var(--primary);
  margin: 14px 0;
  text-shadow: 0 0 25px var(--glow-1);
  animation: fadeInDown 0.8s ease;
}

.results .hero-name-display {
  animation: fadeIn 1s ease 0.2s backwards;
}

.results .score-container {
  animation: fadeIn 1.2s ease 0.4s backwards;
}

.results .score-message {
  animation: fadeIn 1.4s ease 0.6s backwards;
}

.results .achievement-badges {
  animation: fadeIn 1.6s ease 0.8s backwards;
}

.hero-name-display {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 12px 24px;
  border-radius: 50px;
  display: inline-flex;
  gap: 10px;
  margin-bottom: 30px;
  font-size: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.hero-title {
  opacity: 0.9;
}

.hero-name-text {
  font-weight: 700;
}

/* Score circle */
.score-container {
  margin: 30px 0;
}

.score-circle {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.score-ring {
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: rgba(255, 68, 68, 0.15);
  stroke-width: 12;
}

body.shield-mode .score-ring-bg {
  stroke: rgba(0, 200, 200, 0.12);
}

.score-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 1.2s ease;
}

.score-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 20px var(--glow-1);
  animation: scorePopIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scorePopIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.score-percent {
  font-size: 16px;
  color: var(--text-medium);
}

.score-message {
  font-size: 24px;
  color: var(--accent);
  margin: 22px 0;
  font-weight: 600;
  text-shadow: 0 0 15px var(--glow-2);
}

/* Achievement badges */
.achievement-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0;
}

.achievement-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: popBadge 0.5s ease backwards;
  box-shadow: 0 4px 15px rgba(255, 136, 0, 0.4);
}

@keyframes popBadge {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

/* Footer */
.footer {
  width: 100%;
  margin-top: 50px;
  padding: 24px 0;
  background: rgba(15, 3, 3, 0.8);
  border-top: 2px solid rgba(255, 68, 68, 0.4);
  text-align: center;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 -8px 30px rgba(255, 68, 68, 0.35);
  animation: footerGlow 4s infinite ease-in-out;
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: headerLineGlow 2s ease-in-out infinite;
}

body.shield-mode .footer {
  background: rgba(2, 6, 6, 0.7);
  border-top-color: rgba(0, 200, 200, 0.22);
  box-shadow: 0 -5px 20px rgba(0, 200, 200, 0.25);
}

@keyframes footerGlow {
  0%,
  100% {
    box-shadow: 0 -5px 20px rgba(255, 68, 68, 0.35);
  }
  50% {
    box-shadow: 0 -8px 30px rgba(255, 68, 68, 0.6);
  }
}

.footer-content p {
  color: var(--text-medium);
  font-size: 14px;
  margin-bottom: 4px;
}

.footer-small {
  font-size: 11px;
  opacity: 0.7;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(20, 5, 5, 0.7);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 10px;
  box-shadow: 0 0 10px var(--glow-1);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-light), #ffaa00);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) rgba(20, 5, 5, 0.7);
}

/* Responsive */
@media (max-width: 768px) {
  .char,
  .container,
  .btn-theme {
    animation: none !important;
  }

  .container {
    width: min(100% - 30px, 900px);
    padding: 32px 24px;
  }

  .glow-text {
    font-size: 32px;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 24px 20px;
    width: min(100% - 20px, 900px);
    border-radius: 20px;
  }

  .glow-text {
    font-size: 26px;
    letter-spacing: 1px;
  }

  .shield-logo svg {
    width: 80px;
    height: 80px;
  }

  .stats-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .nav-buttons {
    flex-direction: column;
    gap: 12px;
  }

  legend {
    font-size: 16px;
  }

  .results h2 {
    font-size: 28px;
  }

  .score-circle {
    width: 150px;
    height: 150px;
  }

  .score {
    font-size: 36px;
  }

  .option-content {
    padding: 14px 16px;
  }

  .option-text {
    font-size: 13px;
  }

  .question-set {
    padding: 20px;
    border-radius: 16px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 15px;
  }

  .btn-large {
    padding: 16px 32px;
    font-size: 16px;
  }

  .welcome-section {
    padding: 16px;
    margin-bottom: 28px;
  }

  .progress-container {
    padding: 12px 16px;
  }

  .quiz-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
  }
}

@media (max-width: 400px) {
  .container {
    padding: 20px 16px;
  }

  .glow-text {
    font-size: 22px;
  }

  .subtitle {
    font-size: 14px;
  }

  .welcome-section h2 {
    font-size: 22px;
  }

  .stat-icon {
    font-size: 22px;
  }

  .stat-value {
    font-size: 18px;
  }

  .option-content {
    padding: 12px 14px;
    gap: 10px;
  }

  .question-set {
    padding: 16px;
  }

  .stats-panel {
    padding: 12px;
  }
}

/* Input hints */
.input-hint {
  font-size: 12px;
  color: var(--text-medium);
  margin-top: 6px;
  opacity: 0.8;
  font-style: italic;
}

/* Header Stats */
.header-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.stat-badge {
  background: rgba(255, 68, 68, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 68, 68, 0.3);
  border-radius: 50px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  transition: all 0.3s ease;
}

.stat-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
}

body.shield-mode .stat-badge {
  background: rgba(0, 200, 200, 0.1);
  border-color: rgba(0, 200, 200, 0.25);
}

.stat-badge-icon {
  font-size: 16px;
}

.stat-badge-label {
  color: var(--text-medium);
}

.stat-badge-label strong {
  color: var(--primary);
  font-weight: 700;
}

/* Sound Toggle Button */
.btn-sound {
  min-width: 150px;
  white-space: nowrap;
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  font-family: "Poppins", sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    rgba(100, 100, 100, 0.25),
    rgba(150, 150, 150, 0.2),
    rgba(100, 100, 100, 0.25)
  );
  background-size: 200% 200%;
  border: 3px solid rgba(150, 150, 150, 0.4);
  color: var(--text-light);
  box-shadow: 0 6px 20px rgba(100, 100, 100, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.btn-sound:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 10px 35px rgba(100, 100, 100, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.2);
  filter: brightness(1.15);
}

.btn-sound:active {
  transform: translateY(-1px) scale(1.02);
}

.sound-icon {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

.icon-sound-on,
.icon-sound-off {
  position: absolute;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.icon-sound-on {
  opacity: 1;
  transform: scale(1);
}

.icon-sound-off {
  opacity: 0;
  transform: scale(0.3);
}

.btn-sound[aria-pressed="false"] .icon-sound-on {
  opacity: 0;
  transform: scale(0.3);
}

.btn-sound[aria-pressed="false"] .icon-sound-off {
  opacity: 1;
  transform: scale(1);
}

.sound-text {
  position: relative;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.sound-label-on,
.sound-label-off {
  position: absolute;
  white-space: nowrap;
  transition: opacity 0.4s ease, transform 0.4s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
}

.sound-label-on {
  opacity: 1;
  transform: translateY(0);
}

.sound-label-off {
  opacity: 0;
  transform: translateY(20px);
}

.btn-sound[aria-pressed="false"] .sound-label-on {
  opacity: 0;
  transform: translateY(-20px);
}

.btn-sound[aria-pressed="false"] .sound-label-off {
  opacity: 1;
  transform: translateY(0);
}

/* Results Stats */
.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 24px 0;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 68, 68, 0.2);
}

body.shield-mode .results-stats {
  border-color: rgba(0, 200, 200, 0.2);
}

.results-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 68, 68, 0.1);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  animation: statFadeIn 0.6s ease backwards;
}

.results-stat-item:nth-child(1) {
  animation-delay: 0.1s;
}
.results-stat-item:nth-child(2) {
  animation-delay: 0.2s;
}
.results-stat-item:nth-child(3) {
  animation-delay: 0.3s;
}

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

.results-stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(255, 68, 68, 0.3);
}

body.shield-mode .results-stat-item {
  background: rgba(0, 200, 200, 0.08);
}

.results-stat-icon {
  font-size: 24px;
}

.results-stat-content {
  flex: 1;
}

.results-stat-label {
  font-size: 11px;
  color: var(--text-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2px;
}

/* Share Section */
.share-section {
  margin: 20px 0;
  animation: fadeIn 1.8s ease 1s backwards;
}

/* Loader Progress Bar */
.loader-progress-container {
  margin-top: 24px;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.loader-progress-bar {
  height: 8px;
  background: rgba(255, 68, 68, 0.2);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(255, 68, 68, 0.3);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.loader-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent), #ffcc00);
  background-size: 200% 100%;
  width: 0%;
  transition: width 0.3s ease;
  animation: progressShine 2s linear infinite;
  box-shadow: 0 0 15px var(--glow-1);
  border-radius: 50px;
}

.loader-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-medium);
  font-weight: 600;
}

#loaderPercent {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

#loaderStatus {
  font-style: italic;
  opacity: 0.8;
}

body.shield-mode .loader-progress-bar {
  background: rgba(0, 200, 200, 0.15);
  border-color: rgba(0, 200, 200, 0.3);
}

/* Utility */
.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Shake animation for validation */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

/* Ripple effect animation */
@keyframes rippleEffect {
  0% {
    transform: scale(0);
    opacity: 0.5;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Confetti animation */
@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti {
  box-shadow: 0 0 10px currentColor;
}

/* Accessibility - Focus styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
.option:focus-within {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Disable sliding door effect for reduced motion */
  .question-set.entering {
    animation: simpleFadeIn 0.3s ease;
  }

  .question-set.exiting {
    animation: simpleFadeOut 0.3s ease;
  }

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

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

/* Loading screen*/
#loadingScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(10, 0, 0, 0.98) 0%,
    rgba(30, 5, 5, 0.95) 25%,
    rgba(15, 0, 0, 0.98) 50%,
    rgba(25, 3, 3, 0.96) 75%,
    rgba(5, 0, 0, 1) 100%
  );
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  opacity: 1;
  pointer-events: all;
  transition: opacity 800ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 800ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  overflow: hidden;
  will-change: opacity, transform;
}

#loadingScreen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.loader-wrap {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 2;
}

.loader-stage {
  width: min(780px, 92%);
  max-width: 920px;
  margin: 12px;
  padding: 40px 36px;
  border-radius: 28px;
  background: linear-gradient(
    145deg,
    rgba(30, 8, 8, 0.75),
    rgba(15, 3, 3, 0.85),
    rgba(25, 5, 5, 0.8)
  );
  border: 3px solid rgba(255, 68, 68, 0.4);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), 0 0 100px rgba(255, 68, 68, 0.3);
  backdrop-filter: blur(16px) brightness(1.1);
  -webkit-backdrop-filter: blur(16px) brightness(1.1);
  animation: loaderStageFloat 5s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

@keyframes loaderStageFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-12px) scale(1.02);
  }
}

/* center logo */
.loader-logo {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  margin-bottom: 14px;
  position: relative;
  animation: logoBreathing 3s ease-in-out infinite;
}

@keyframes logoBreathing {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.loader-logo::before {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(
    circle,
    rgba(255, 68, 68, 0.5) 0%,
    rgba(255, 136, 0, 0.3) 35%,
    rgba(255, 204, 0, 0.15) 60%,
    transparent 80%
  );
  border-radius: 50%;
  animation: loaderGlowRing 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes loaderGlowRing {
  0%,
  100% {
    transform: scale(0.7) rotate(0deg);
    opacity: 0.5;
  }
  33% {
    transform: scale(1.2) rotate(120deg);
    opacity: 0.8;
  }
  66% {
    transform: scale(1.5) rotate(240deg);
    opacity: 0.6;
  }
}

#loaderShield {
  filter: drop-shadow(0 0 30px rgba(255, 68, 68, 0.8))
    drop-shadow(0 0 50px rgba(255, 136, 0, 0.6))
    drop-shadow(0 0 70px rgba(255, 204, 0, 0.3));
  transform-origin: center;
  animation: loaderShieldSpin 4s ease-in-out infinite,
    loaderShieldFloat 3s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

@keyframes loaderShieldSpin {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
    filter: brightness(1) drop-shadow(0 0 30px rgba(255, 68, 68, 0.8));
  }
  25% {
    transform: rotate(-10deg) scale(1.1);
    filter: brightness(1.2) drop-shadow(0 0 40px rgba(255, 68, 68, 1));
  }
  50% {
    transform: rotate(0deg) scale(1.15);
    filter: brightness(1.3) drop-shadow(0 0 50px rgba(255, 136, 0, 0.9));
  }
  75% {
    transform: rotate(10deg) scale(1.1);
    filter: brightness(1.2) drop-shadow(0 0 40px rgba(255, 204, 0, 0.8));
  }
}

@keyframes loaderShieldFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  33% {
    transform: translateY(-10px) scale(1.05);
  }
  66% {
    transform: translateY(-5px) scale(1.02);
  }
}

.loader-text {
  min-height: 32px;
  line-height: 1.2;
}

.loader-sub {
  min-height: 22px;
}

.loader-text {
  font-weight: 900;
  font-family: "Cinzel", serif;
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--accent),
    #ffcc00,
    #ff6666,
    var(--primary)
  );
  background-size: 400% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 3px;
  font-size: 26px;
  text-shadow: 0 0 30px rgba(255, 68, 68, 0.6), 0 0 50px rgba(255, 136, 0, 0.4);
  animation: loaderTextShine 4s linear infinite,
    textGlowPulse 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
}

@keyframes textGlowPulse {
  0%,
  100% {
    text-shadow: 0 0 30px rgba(255, 68, 68, 0.6),
      0 0 50px rgba(255, 136, 0, 0.4);
  }
  50% {
    text-shadow: 0 0 40px rgba(255, 68, 68, 0.9),
      0 0 70px rgba(255, 136, 0, 0.6), 0 0 90px rgba(255, 204, 0, 0.4);
  }
}

@keyframes loaderTextShine {
  0% {
    background-position: 0% center;
    filter: brightness(1);
  }
  50% {
    background-position: 200% center;
    filter: brightness(1.3);
  }
  100% {
    background-position: 400% center;
    filter: brightness(1);
  }
}

/* sub/text + bar */
.loader-sub {
  color: var(--text-medium);
  font-size: 15px;
  margin-bottom: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(255, 136, 0, 0.3);
  animation: loaderSubPulse 2s ease-in-out infinite,
    subTextFade 3s ease-in-out infinite;
  position: relative;
}

/* Animated dots after text */
.loader-sub::after {
  content: "...";
  position: absolute;
  margin-left: 4px;
  animation: loadingDots 1.5s steps(4, end) infinite;
}

@keyframes loadingDots {
  0%,
  20% {
    content: "";
  }
  40% {
    content: ".";
  }
  60% {
    content: "..";
  }
  80%,
  100% {
    content: "...";
  }
}

@keyframes subTextFade {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

@keyframes loaderSubPulse {
  0%,
  100% {
    opacity: 0.75;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.floating-characters {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 30px;
  margin: 16px 0 22px;
  pointer-events: none;
  height: 190px;
}

.floating-characters::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 20px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 68, 68, 0.3) 0%,
    transparent 70%
  );
  filter: blur(10px);
  animation: shadowPulse 3s ease-in-out infinite;
}

@keyframes shadowPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.7;
    transform: translateX(-50%) scale(1.2);
  }
}

.char {
  width: 140px;
  height: 180px;
  display: inline-block;
  transform-origin: center bottom;
  will-change: transform, filter;
  position: relative;
}

.char::before {
  content: "";
  position: absolute;
  inset: -10px;
  background: radial-gradient(
    circle,
    rgba(255, 68, 68, 0.2) 0%,
    transparent 60%
  );
  border-radius: 50%;
  animation: charGlow 2.5s ease-in-out infinite;
  z-index: -1;
}

@keyframes charGlow {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.char svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 15px rgba(255, 68, 68, 0.3));
}

.char-raphtalia {
  animation: floatLeftEnhanced 4.2s ease-in-out infinite,
    charGlowLeft 3s ease-in-out infinite;
  transform-origin: center 90%;
}

.char-naofumi {
  animation: floatRightEnhanced 4.8s ease-in-out infinite,
    charGlowRight 3.5s ease-in-out infinite;
  transform-origin: center 90%;
}

@keyframes charGlowLeft {
  0%,
  100% {
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.6))
      drop-shadow(0 0 15px rgba(255, 68, 68, 0.3));
  }
  50% {
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.8))
      drop-shadow(0 0 25px rgba(255, 68, 68, 0.5));
  }
}

@keyframes charGlowRight {
  0%,
  100% {
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.6))
      drop-shadow(0 0 15px rgba(255, 136, 0, 0.3));
  }
  50% {
    filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.8))
      drop-shadow(0 0 25px rgba(255, 136, 0, 0.5));
  }
}

@keyframes floatLeftEnhanced {
  0% {
    transform: translateY(0) translateX(0) rotate(-2deg) scale(1);
  }
  20% {
    transform: translateY(-15px) translateX(-4px) rotate(-3deg) scale(1.05);
  }
  40% {
    transform: translateY(-8px) translateX(3px) rotate(-1deg) scale(1.02);
  }
  60% {
    transform: translateY(-18px) translateX(-3px) rotate(-2deg) scale(1.06);
  }
  80% {
    transform: translateY(-10px) translateX(2px) rotate(-0.5deg) scale(1.03);
  }
  100% {
    transform: translateY(0) translateX(0) rotate(-2deg) scale(1);
  }
}

@keyframes floatRightEnhanced {
  0% {
    transform: translateY(0) translateX(0) rotate(2deg) scale(1);
  }
  20% {
    transform: translateY(-18px) translateX(4px) rotate(3deg) scale(1.06);
  }
  40% {
    transform: translateY(-10px) translateX(-3px) rotate(1deg) scale(1.03);
  }
  60% {
    transform: translateY(-20px) translateX(3px) rotate(2.5deg) scale(1.07);
  }
  80% {
    transform: translateY(-12px) translateX(-2px) rotate(1deg) scale(1.04);
  }
  100% {
    transform: translateY(0) translateX(0) rotate(2deg) scale(1);
  }
}

/* small responsive tweak */
@media (max-width: 520px) {
  .floating-characters {
    gap: 16px;
    height: 140px;
  }
  .char {
    width: 110px;
    height: 140px;
  }
  .loader-stage {
    padding: 20px 16px;
  }
  .loader-text {
    font-size: 18px;
  }
  #loaderShield {
    width: 56px;
    height: 56px;
  }
}

/* shield mode styling */
body.shield-mode #loadingScreen {
  background: linear-gradient(
    135deg,
    rgba(0, 10, 10, 0.98) 0%,
    rgba(0, 25, 25, 0.95) 25%,
    rgba(0, 15, 15, 0.98) 50%,
    rgba(0, 20, 20, 0.96) 75%,
    rgba(0, 5, 5, 1) 100%
  );
  background-size: 400% 400%;
}

body.shield-mode #loadingScreen::before {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(0, 200, 200, 0.3) 0%,
    rgba(0, 255, 170, 0.15) 30%,
    transparent 60%
  );
}

body.shield-mode #loadingScreen::after {
  background-image: radial-gradient(
      circle at 20% 30%,
      rgba(0, 200, 200, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(0, 255, 170, 0.12) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 80%,
      rgba(51, 255, 204, 0.1) 0%,
      transparent 50%
    );
}

body.shield-mode .loader-stage {
  background: linear-gradient(
    145deg,
    rgba(3, 15, 15, 0.75),
    rgba(2, 8, 8, 0.85),
    rgba(3, 12, 12, 0.8)
  );
  border-color: rgba(0, 200, 200, 0.4);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.9), 0 0 100px rgba(0, 200, 200, 0.3),
    0 0 40px rgba(0, 255, 170, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.1),
    inset 0 -3px 20px rgba(0, 0, 0, 0.5);
}

body.shield-mode .loader-stage::after {
  background: radial-gradient(
    ellipse at center,
    rgba(0, 200, 200, 0.08) 0%,
    transparent 70%
  );
}

body.shield-mode .loader-stage::before {
  background: linear-gradient(
    135deg,
    #00b8b8,
    #00ffaa,
    #33ffcc,
    #00ffaa,
    #00b8b8
  );
  background-size: 300% 300%;
}

body.shield-mode .loader-logo::before {
  background: radial-gradient(
    circle,
    rgba(0, 200, 200, 0.5) 0%,
    rgba(0, 255, 170, 0.3) 35%,
    rgba(51, 255, 204, 0.15) 60%,
    transparent 80%
  );
}

body.shield-mode #loaderShield {
  filter: drop-shadow(0 0 30px rgba(0, 200, 200, 0.8))
    drop-shadow(0 0 50px rgba(0, 255, 170, 0.6))
    drop-shadow(0 0 70px rgba(51, 255, 204, 0.3));
}

body.shield-mode .floating-characters::before {
  background: radial-gradient(
    ellipse at center,
    rgba(0, 200, 200, 0.3) 0%,
    transparent 70%
  );
}

body.shield-mode .char::before {
  background: radial-gradient(
    circle,
    rgba(0, 200, 200, 0.2) 0%,
    transparent 60%
  );
}

body.shield-mode .char svg {
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 15px rgba(0, 200, 200, 0.3));
}
