* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  overflow: hidden;
  background: #000;
  font-family: 'Courier New', Courier, monospace;
  color: #c8a84b;
  user-select: none;
}

#rl-app {
  width: 100vw;
  height: 100vh;
  position: relative;
}

#rl-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#rl-light-indicator {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: 'Creepster', cursive;
  font-size: clamp(28px, 6vw, 48px);
  letter-spacing: 4px;
  pointer-events: none;
  text-shadow: 0 0 20px currentColor;
  transition: color 0.15s, text-shadow 0.15s;
}
#rl-light-indicator.rl-green { color: #2ecc40; text-shadow: 0 0 30px rgba(46, 204, 64, 0.6); }
#rl-light-indicator.rl-red { color: #ff2020; text-shadow: 0 0 30px rgba(255, 32, 32, 0.7); animation: rl-pulse 0.4s ease infinite; }
@keyframes rl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

#rl-hud {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: rgba(200, 168, 75, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
#rl-lives { color: #c41e3a; letter-spacing: 2px; }

#rl-progress-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(400px, 80vw);
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(200, 168, 75, 0.2);
  border-radius: 4px;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}
#rl-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2ecc40, #1a8a28);
  border-radius: 3px;
  transition: width 0.05s linear;
}

.rl-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  text-align: center;
  padding: 24px;
}
.rl-screen.active { display: flex; }

.rl-credit {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  opacity: 0.6;
  margin-bottom: 12px;
}
.rl-screen h1 {
  font-family: 'Creepster', cursive;
  font-size: clamp(48px, 12vw, 90px);
  color: #c41e3a;
  text-shadow: 0 0 30px rgba(196, 30, 58, 0.5);
  letter-spacing: 4px;
  margin-bottom: 8px;
}
.rl-screen h2 {
  font-family: 'Creepster', cursive;
  font-size: clamp(32px, 8vw, 56px);
  color: #c41e3a;
  margin-bottom: 12px;
}
.rl-tagline {
  font-size: 16px;
  letter-spacing: 2px;
  opacity: 0.7;
  margin-bottom: 16px;
}
.rl-sub {
  font-size: 13px;
  line-height: 1.7;
  opacity: 0.5;
  margin-bottom: 32px;
  max-width: 360px;
}
.rl-controls {
  margin-top: 24px;
  font-size: 11px;
  opacity: 0.35;
}
.rl-controls kbd {
  padding: 2px 6px;
  border: 1px solid rgba(200, 168, 75, 0.2);
  border-radius: 3px;
  font-size: 10px;
}
.rl-screen p { opacity: 0.6; margin-bottom: 24px; font-size: 14px; }

.rl-screen button {
  padding: 14px 40px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  background: #6a1010;
  border: 1px solid rgba(196, 30, 58, 0.5);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s;
}
.rl-screen button:hover {
  background: #8b1818;
  transform: scale(1.03);
}

#rl-flash {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s;
}
#rl-flash.rl-on { opacity: 0.9; }

.rl-exit {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 25;
  color: rgba(200, 168, 75, 0.45);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid rgba(200, 168, 75, 0.15);
  border-radius: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.rl-exit:hover { color: #f0d880; border-color: rgba(240, 216, 128, 0.4); }
