:root {
  --gold: #ffd700;
  --gold-light: #fffbe6;
  --dark-bg: #181818;
  --success-color: #4CAF50;
  --warning-color: #FF9800;
  --danger-color: #f44336;
  --info-color: #2196F3;
  --card-bg: rgba(30, 30, 30, 0.96);
  --panel-bg: rgba(40, 40, 40, 0.92);
  --accent: #ffe066;
  --shadow: 0 4px 24px rgba(255, 215, 0, 0.10), 0 2px 8px rgba(0, 0, 0, 0.18);
  --purple-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --green-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --orange-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --blue-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: url('https://ludounbound.com/images/background.png') repeat;
  background-size: auto;
  font-family: 'Segoe UI', 'Orbitron', Arial, sans-serif;
  color: #fff;
  min-height: 100vh;
  background: #181818;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* Yellow divider lines for protected areas (phone screen margins) */
/* Yellow divider lines for protected areas (phone screen margins) */
.s1-screen {
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto; /* Disable elastic scrolling */
  scroll-behavior: auto;
  touch-action: pan-y; /* Allow vertical scrolling, prevent stretching */
  position: relative;
}
.s1-screen.active {
  display: flex;
}

/* Top divider */
.s1-screen::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #ffd700 20%, #ffd700 80%, transparent 100%);
  box-shadow: 
    0 2px 8px rgba(255, 215, 0, 0.6),
    0 4px 16px rgba(255, 215, 0, 0.4),
    0 8px 24px rgba(255, 215, 0, 0.2);
  z-index: 9998;
  pointer-events: none;
  opacity: 1;
}

/* Bottom divider - using absolute positioning instead of fixed */
.s1-screen::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #ffd700 20%, #ffd700 80%, transparent 100%);
  box-shadow: 
    0 -2px 8px rgba(255, 215, 0, 0.6),
    0 -4px 16px rgba(255, 215, 0, 0.4),
    0 -8px 24px rgba(255, 215, 0, 0.2);
  z-index: 99999;
  pointer-events: none;
  opacity: 1;
  display: block !important;
}

/* Alternative bottom divider using a child element */
.s1-screen .bottom-divider {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #ffd700 20%, #ffd700 80%, transparent 100%);
  box-shadow: 
    0 -2px 8px rgba(255, 215, 0, 0.6),
    0 -4px 16px rgba(255, 215, 0, 0.4),
    0 -8px 24px rgba(255, 215, 0, 0.2);
  z-index: 99999;
  pointer-events: none;
  opacity: 1;
}


/* Home screen specific styles */
.home-screen {
  background: #181818;
}
.home-screen::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at top center, #ffe06644 0%, transparent 60%), radial-gradient(ellipse at bottom center, #ffd70033 0%, transparent 70%), linear-gradient(120deg, #181818 60%, #232323 100%);
}
/* Evening theme override for home screen */
.home-screen.theme-evening::before {
  background:
    radial-gradient(ellipse at top center, #9b59b644 0%, transparent 60%), radial-gradient(ellipse at bottom center, #8e44ad33 0%, transparent 70%), linear-gradient(120deg, #181818 60%, #232323 100%);
}
/* Home screen specific container */
.home-screen {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  margin: 0;
}
body.splash-finished {
  display: flex;
  animation: slideDownFade 0.8s ease-out 0s both;
}
/* Splash Screen */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.9));
  z-index: 9999;
  transition: opacity 1s ease-in-out;
  /* backdrop-filter removed for performance */
}
/* Evening theme for splash screen */
#splash::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at top center, #9b59b644 0%, transparent 60%), radial-gradient(ellipse at bottom center, #8e44ad33 0%, transparent 70%), linear-gradient(120deg, #181818 60%, #232323 100%);
}
/* Glass‐box style for splash */
.glass-box {
  background: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border-radius: 25px;
  border: 2px solid gold;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), inset 0 0 20px rgba(255, 215, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  /* backdrop-filter removed for performance */
  background: rgba(30, 30, 30, 0.9);
}
.glass-box img {
  width: 200px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}
/* Animated Dice Container */
.dice-container {
  display: flex;
  gap: 15px;
  margin: 20px 0;
  justify-content: center;
}
.dice {
  width: 40px;
  height: 40px;
  background: linear-gradient(145deg, #ffffff, #e6e6e6);
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  position: relative;
  animation: diceRoll 2s ease-in-out; /* infinite removed */
}
.dice:nth-child(1) {
  animation-delay: 0s;
}
.dice:nth-child(2) {
  animation-delay: 0.3s;
}
.dice:nth-child(3) {
  animation-delay: 0.6s;
}
@keyframes diceRoll {
  0%, 100% {
    /* transform: rotateY(0deg) rotateX(0deg); - 3D removed for performance */
    transform: rotate(0deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
  25% {
    /* transform: rotateY(90deg) rotateX(10deg); - 3D removed for performance */
    transform: rotate(90deg);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  }
  50% {
    /* transform: rotateY(180deg) rotateX(0deg); - 3D removed for performance */
    transform: rotate(180deg);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  }
  75% {
    /* transform: rotateY(270deg) rotateX(-10deg); - 3D removed for performance */
    transform: rotate(270deg);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  }
}
/* Loading Messages */
.loading-message {
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  margin: 15px 0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  min-height: 24px;
  transition: opacity 0.3s ease-in-out;
  animation: messageFade 2s ease-in-out; /* infinite removed */
}
@keyframes messageFade {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
/* Loading bar */
.loading-bar-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 25px;
  margin-top: 20px;
  overflow: hidden;
  height: 20px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd700, #ff8c00, #ffd700);
  border-radius: 25px;
  transition: width 0.3s ease-out;
  position: relative;
  overflow: hidden;
}
.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s; /* infinite removed */
}
@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
.percentage {
  margin-top: 12px;
  font-weight: bold;
  font-size: 18px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  color: #ffd700;
  animation: percentagePulse 1s ease-in-out; /* infinite removed */
}
@keyframes percentagePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}
/* New layout content visibility is handled by newlayout/styles.css */
/* Smooth transitions for splash hide */
#splash.fade-out {
  opacity: 0;
  pointer-events: none;
  animation: splashFadeOut 0.8s ease-out;
}
@keyframes splashFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Browser Download Popup Button Hover Effect */
#browser-download-popup a:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(74, 222, 128, 0.6) !important;
}

#browser-download-popup a:active {
  transform: translateY(-1px) scale(1.02);
}
/* New layout elements are handled by newlayout/styles.css */
@keyframes slideDownFade {
  0% {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-10px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
/* Theme Classes */
.theme-evening {
  --accent-color: #9b59b6;
  --accent-light: #b07cc7;
  --accent-dark: #8e44ad;
}
/* Evening theme for body background */
body.theme-evening::before {
  background:
    radial-gradient(ellipse at top center, #9b59b644 0%, transparent 60%), radial-gradient(ellipse at bottom center, #8e44ad33 0%, transparent 70%), linear-gradient(120deg, #181818 60%, #232323 100%);
}
/* Evening theme for splash screen */
body.theme-evening #splash::before {
  background:
    radial-gradient(ellipse at top center, #9b59b644 0%, transparent 60%), radial-gradient(ellipse at bottom center, #8e44ad33 0%, transparent 70%), linear-gradient(120deg, #181818 60%, #232323 100%);
}
/* Universal SPA Overlay System */
.spa-overlay-background {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9998;
  display: block;
}
.spa-overlay-content {
  color: #222;
  width: 90%;
  margin: 0 auto;
  max-width: 100vw;
  margin: auto;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  position: relative;
  padding: 2em 1em;
  display: block;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
@media (max-width: 700px) {
  .spa-overlay-content {
    width: 98vw;
    max-width: 98vw;
    padding: 1em 0.5em;
  }
}
/* Login popup */
#login-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
}
#login-popup .popup-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 300px;
  width: 90%;
}
#login-popup button {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #4285F4;
  color: white;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}
#login-popup button:nth-child(2) {
  background: #3b5998;
}
#login-popup button:nth-child(3) {
  background: #666;
}
#login-popup button:hover {
  filter: brightness(1.1);
}
/* Toast styles are now handled by toast-manager.js */

/* Loading Screen Styles */
.l1-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.l1-container.show {
    opacity: 1;
    transform: scale(1);
}

.l1-container.hide {
    opacity: 0;
    transform: scale(1.1);
}

.l1-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.l1-bg-image {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    object-position: center;
    filter: blur(2px) brightness(0.7) saturate(1.2);
}

.l1-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    /* backdrop-filter removed for performance */
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.l1-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    width: 300px;
}

.l1-phrase-container {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.l1-phrase {
    font-size: 16px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
    text-align: center;
    min-height: 20px;
}

.l1-phrase.active {
    opacity: 1;
    transform: translateY(0);
}

.l1-loading-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.l1-progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.l1-circle-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.l1-circle-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    /* backdrop-filter removed for performance */
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 0 1px 3px rgba(255, 255, 255, 0.2),
        inset 0 -1px 3px rgba(0, 0, 0, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(255, 0, 128, 0.1);
}

.l1-circle-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #ff0080 0deg,
        #ff0000 30deg,
        #ff8000 60deg,
        #ffff00 90deg,
        #80ff00 120deg,
        #00ff00 150deg,
        #00ff80 180deg,
        #00ffff 210deg,
        #0080ff 240deg,
        #8000ff 270deg,
        #ff00ff 300deg,
        #ff0080 330deg,
        #ff0080 360deg
    );
    mask: radial-gradient(circle, transparent 70%, black 70%);
    -webkit-mask: radial-gradient(circle, transparent 70%, black 70%);
    animation: l1-rainbow-spin 1.5s linear infinite, l1-ring-pulse 2s ease-in-out; /* infinite removed */
    opacity: 1;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 0 20px rgba(255, 0, 128, 0.5));
    transform-origin: center center;
}

.l1-circle-inner-ring {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: conic-gradient(
        from 180deg,
        rgba(255, 0, 128, 0.3) 0deg,
        rgba(0, 255, 255, 0.3) 180deg,
        rgba(255, 0, 128, 0.3) 360deg
    );
    mask: radial-gradient(circle, transparent 85%, black 85%);
    -webkit-mask: radial-gradient(circle, transparent 85%, black 85%);
    animation: l1-rainbow-spin 3s linear reverse; /* infinite removed */
    opacity: 0.6;
    transform-origin: center center;
}

.l1-circle-outer-ring {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    border-radius: 50%;
    background: conic-gradient(
        from 90deg,
        rgba(255, 255, 0, 0.2) 0deg,
        rgba(255, 0, 255, 0.2) 120deg,
        rgba(0, 255, 255, 0.2) 240deg,
        rgba(255, 255, 0, 0.2) 360deg
    );
    mask: radial-gradient(circle, transparent 75%, black 75%);
    -webkit-mask: radial-gradient(circle, transparent 75%, black 75%);
    animation: l1-rainbow-spin 4s linear; /* infinite removed */
    opacity: 0.4;
    transform-origin: center center;
}

.l1-particles {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
}

.l1-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    animation: l1-particle-orbit 2s linear; /* infinite removed */
    transform: translate(-50%, -50%);
}

.l1-progress-markers {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
}

.l1-marker {
    position: absolute;
    width: 2px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    transform-origin: 0 4px;
    top: 50%;
    left: 50%;
    margin-top: -4px;
    margin-left: -1px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.l1-marker.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}

.l1-dice-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    perspective: 100px;
    z-index: 10;
}

.l1-dice {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: l1-dice-spin 1s linear; /* infinite removed */
}

.l1-dice-face {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    /* backdrop-filter removed for performance */
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        inset 0 1px 3px rgba(255, 255, 255, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.2);
}

.l1-dice-front {
    /* transform: rotateY(0deg) translateZ(20px); - 3D removed for performance */
    transform: none;
}

.l1-dice-back {
    /* transform: rotateY(180deg) translateZ(20px); - 3D removed for performance */
    transform: rotate(180deg);
}

.l1-dice-right {
    /* transform: rotateY(90deg) translateZ(20px); - 3D removed for performance */
    transform: rotate(90deg);
}

.l1-dice-left {
    /* transform: rotateY(-90deg) translateZ(20px); - 3D removed for performance */
    transform: rotate(-90deg);
}

.l1-dice-top {
    /* transform: rotateX(90deg) translateZ(20px); - 3D removed for performance */
    transform: rotate(180deg);
}

.l1-dice-bottom {
    /* transform: rotateX(-90deg) translateZ(20px); - 3D removed for performance */
    transform: none;
}

.l1-loading-dots {
    display: flex;
    gap: 8px;
}

.l1-dot {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    animation: l1-bounce 1.4s ease-in-out both; /* infinite removed */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.l1-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.l1-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.l1-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes l1-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes l1-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes l1-rainbow-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes l1-ring-pulse {
    0%, 100% {
        mask: radial-gradient(circle, transparent 70%, black 70%);
        -webkit-mask: radial-gradient(circle, transparent 70%, black 70%);
    }
    50% {
        mask: radial-gradient(circle, transparent 65%, black 65%);
        -webkit-mask: radial-gradient(circle, transparent 65%, black 65%);
    }
}

@keyframes l1-particle-orbit {
    0% {
        transform: translate(-50%, -50%) rotate(0deg) translateX(50px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg) translateX(50px) rotate(-360deg);
        opacity: 0;
    }
}

@keyframes l1-dice-spin {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    25% {
        transform: rotateX(90deg) rotateY(90deg) rotateZ(0deg);
    }
    50% {
        transform: rotateX(180deg) rotateY(180deg) rotateZ(90deg);
    }
    75% {
        transform: rotateX(270deg) rotateY(270deg) rotateZ(180deg);
    }
    100% {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(270deg);
    }
}

/* Confetti Effect Animation */
@keyframes confettiFloat {
    from { 
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }
    90% {
        opacity: 0.8;
        transform: translateY(-280px) scale(0.8);
    }
    to {
        opacity: 0;
        transform: translateY(-300px) scale(0);
    }
}