body {
  margin: 0;
  background: black;
  font-family: 'Segoe UI', sans-serif;
  color: #eee;
}

#game-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#scene-display {
  position: relative;
  flex: 0 0 40vh;
  min-height: 250px;
  max-height: 45vh;
  overflow: hidden;
}

#scene-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: contrast(1.1) saturate(1.2);
  transition: opacity 0.3s ease-in-out;
  background: #000;
}

#scene-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.2),
    rgba(0,0,0,0.7)
  );
  pointer-events: none;
}

#hud {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(0,0,0,0.6);
  font-size: 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

#time-indicator {
  color: #00d4ff;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(0,212,255,0.5);
}

#timeline-status {
  color: #4ade80;
  font-weight: bold;
}

#timeline-status.altered {
  color: #f87171;
  animation: pulse 2s infinite;
}

#menu-btn {
  background: rgba(255,170,0,0.2);
  border: 1px solid rgba(255,170,0,0.5);
  color: #ffaa00;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

#menu-btn:hover {
  background: rgba(255,170,0,0.4);
  transform: scale(1.05);
}

#sound-toggle {
  background: rgba(0,212,255,0.2);
  border: 1px solid rgba(0,212,255,0.5);
  color: #00d4ff;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

#sound-toggle:hover {
  background: rgba(0,212,255,0.4);
  transform: scale(1.1);
}

#sound-toggle.muted {
  background: rgba(255,100,100,0.2);
  border-color: rgba(255,100,100,0.5);
  color: #ff6464;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#text-box {
  padding: 20px;
  background: rgba(10,10,10,0.9);
  min-height: 120px;
  max-height: 35vh;
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,0.1);
}

#scene-text {
  margin: 0;
  line-height: 1.6;
  font-size: 16px;
}

#choices {
  padding: 10px 20px 20px;
  background: rgba(10,10,10,0.95);
  max-height: 30vh;
  overflow-y: auto;
  flex-shrink: 0;
}

#choices button {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 14px 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid #0f3460;
  color: white;
  cursor: pointer;
  font-size: 15px;
  text-align: left;
  border-radius: 4px;
  transition: all 0.2s ease;
}

#choices button:hover {
  background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
  border-color: #00d4ff;
  box-shadow: 0 0 15px rgba(0,212,255,0.3);
  transform: translateX(5px);
}

#choices button:active {
  transform: translateX(5px) scale(0.98);
}

/* Time travel effect overlay */
.time-warp {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, transparent 0%, rgba(0,212,255,0.3) 50%, transparent 100%);
  animation: warp 1s ease-out forwards;
  pointer-events: none;
  z-index: 1000;
}

@keyframes warp {
  0% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(3); }
}

/* Film grain effect */
#scene-display::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.05"/></svg>');
  pointer-events: none;
  opacity: 0.3;
}

/* Vignette effect */
#scene-display::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, transparent 50%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Era-specific color grading */
.era-past #scene-image {
  filter: sepia(0.3) contrast(1.1) saturate(0.9);
}

.era-present #scene-image {
  filter: contrast(1.1) saturate(1.2);
}

.era-future #scene-image {
  filter: hue-rotate(10deg) contrast(1.2) saturate(1.3) brightness(1.1);
}

/* Loading state */
.loading #scene-image {
  filter: blur(10px) brightness(0.5);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

/* Butterfly effect notification animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.butterfly-notification {
  pointer-events: none;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}
