* {
  box-sizing: border-box;
}

body {
  padding: 0;
  margin: 0;
  background: linear-gradient(180deg, #0a0505 0%, #1a0a0a 50%, #0d0505 100%);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: 'Cinzel', 'Times New Roman', serif;
}

/* Subtle animated background texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(139, 0, 0, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.8) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

#unity-container {
  position: absolute;
}

#unity-container.unity-desktop {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#unity-container.unity-mobile {
  position: fixed;
  width: 100%;
  height: 100%;
}

#unity-canvas {
  background: #0a0505;
  border: 2px solid #3d1515;
  border-bottom: none;
  box-shadow:
    0 0 40px rgba(139, 0, 0, 0.4),
    0 0 80px rgba(139, 0, 0, 0.2),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  display: block;
}

.unity-mobile #unity-canvas {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

#unity-loading-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  text-align: center;
}

/* Remove Unity logo - replaced with game title */
#unity-logo {
  display: none;
}

/* Custom game title during loading */
#unity-loading-bar::before {
  content: 'ETERNITY';
  display: block;
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 42px;
  font-weight: bold;
  letter-spacing: 12px;
  color: #8b0000;
  text-shadow:
    0 0 10px rgba(139, 0, 0, 0.8),
    0 0 20px rgba(139, 0, 0, 0.6),
    0 0 40px rgba(139, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: 30px;
  animation: flicker 3s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
  52% { opacity: 1; }
  54% { opacity: 0.9; }
}

#unity-progress-bar-empty {
  width: 300px;
  height: 8px;
  margin: 20px auto 0;
  background: #1a0808;
  border: 1px solid #3d1515;
  border-radius: 4px;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(139, 0, 0, 0.3);
  overflow: hidden;
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #5c0a0a 0%, #8b0000 50%, #b22222 100%);
  border-radius: 3px;
  box-shadow:
    0 0 10px rgba(178, 34, 34, 0.8),
    0 0 20px rgba(139, 0, 0, 0.5);
  transition: width 0.3s ease;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(178, 34, 34, 0.8), 0 0 20px rgba(139, 0, 0, 0.5); }
  50% { box-shadow: 0 0 15px rgba(178, 34, 34, 1), 0 0 30px rgba(139, 0, 0, 0.7); }
}

/* Loading text */
#unity-loading-bar::after {
  content: 'Descending into darkness...';
  display: block;
  margin-top: 15px;
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 14px;
  color: #666;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#unity-footer {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 8, 8, 0.95) 0%, rgba(10, 5, 5, 1) 100%);
  border: 2px solid #3d1515;
  border-top: 1px solid #2a1010;
  padding: 8px 15px;
  height: 54px;
  overflow: hidden;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.unity-mobile #unity-footer {
  display: none;
}

/* Hide Unity logo in footer */
#unity-logo-title-footer {
  display: none;
}

#unity-build-title {
  float: left;
  line-height: 38px;
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-size: 16px;
  color: #8b0000;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
  text-transform: uppercase;
}

#unity-fullscreen-button {
  cursor: pointer;
  float: right;
  width: 38px;
  height: 38px;
  background: url('fullscreen-button.png') no-repeat center;
  filter: sepia(1) saturate(3) hue-rotate(-30deg) brightness(0.7);
  opacity: 0.8;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  border-radius: 4px;
}

#unity-fullscreen-button:hover {
  opacity: 1;
  filter: sepia(1) saturate(4) hue-rotate(-30deg) brightness(0.9);
  border-color: #8b0000;
  box-shadow: 0 0 15px rgba(139, 0, 0, 0.5);
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translate(-50%);
  background: linear-gradient(180deg, #1a0808 0%, #0d0404 100%);
  border: 1px solid #8b0000;
  color: #c41e1e;
  padding: 15px 25px;
  display: none;
  font-family: 'Cinzel', 'Times New Roman', serif;
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.4);
  border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  #unity-loading-bar::before {
    font-size: 32px;
    letter-spacing: 8px;
  }

  #unity-progress-bar-empty {
    width: 250px;
  }
}
