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

body {
  background: #020204;
  color: #c8b8a0;
  font-family: system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
}

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

#ow-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #050508;
}

#ow-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 10;
}

#ow-heart {
  color: #8b2020;
  letter-spacing: 0.15em;
  font-weight: 700;
}

#ow-zone {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  opacity: 0.7;
}

#ow-fear-label {
  font-size: 0.7rem;
  opacity: 0.6;
}

#ow-fear-bar {
  width: 80px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

#ow-fear-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4a3020, #8b2020, #ff2020);
  border-radius: 3px;
  transition: width 0.15s;
}

.ow-screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: rgba(2, 2, 6, 0.92);
  z-index: 30;
}

.ow-screen.active { display: flex; }

.ow-credit {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

#ow-start h1,
#ow-win h2,
#ow-over h2 {
  font-family: 'Creepster', cursive;
  font-size: clamp(2.5rem, 10vw, 4.5rem);
  color: #a08060;
  text-shadow: 0 0 30px rgba(160, 80, 40, 0.4);
  margin-bottom: 0.5rem;
}

.ow-tagline {
  font-family: 'Creepster', cursive;
  font-size: 1.3rem;
  color: #604030;
  margin-bottom: 1rem;
}

.ow-sub {
  max-width: 28rem;
  line-height: 1.6;
  opacity: 0.75;
  margin-bottom: 2rem;
}

.ow-controls {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  opacity: 0.5;
}

.ow-controls kbd {
  background: rgba(255,255,255,0.08);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

#ow-play-btn,
#ow-intro-btn,
#ow-again-btn,
#ow-retry-btn,
#ow-event-btn {
  font-family: 'Creepster', cursive;
  font-size: 1.4rem;
  padding: 0.6rem 2rem;
  background: #1a1008;
  color: #a08060;
  border: 1px solid #403020;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#ow-play-btn:hover,
#ow-intro-btn:hover,
#ow-again-btn:hover,
#ow-retry-btn:hover,
#ow-event-btn:hover {
  background: #2a1810;
  color: #c0a080;
}

/* Intro gate */
.ow-intro-screen {
  background: #020204;
}

.ow-intro-gate {
  position: relative;
  width: min(320px, 80vw);
  height: 220px;
  margin-bottom: 2rem;
}

.ow-gate-post {
  position: absolute;
  bottom: 0;
  width: 18px;
  height: 180px;
  background: linear-gradient(to right, #1a1008, #302018, #1a1008);
  border: 1px solid #403020;
}

.ow-gate-post--l { left: 20px; }
.ow-gate-post--r { right: 20px; }

.ow-gate-arch {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 100px;
  border: 12px solid #302018;
  border-bottom: none;
  border-radius: 160px 160px 0 0;
  box-shadow: inset 0 -20px 40px rgba(0,0,0,0.8);
}

.ow-gate-sign {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Creepster', cursive;
  font-size: 2rem;
  color: #604030;
  letter-spacing: 0.15em;
  transition: color 0.5s, text-shadow 0.5s;
}

.ow-gate-eyes {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 2.5rem;
  opacity: 0;
  transition: opacity 0.8s;
}

.ow-gate-eyes.visible { opacity: 1; }

.ow-gate-eye {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff2020;
  box-shadow: 0 0 12px #ff4040, 0 0 24px #ff2020;
  animation: ow-blink 3s infinite;
}

@keyframes ow-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

.ow-intro-gate.scary .ow-gate-sign {
  color: #8b2020;
  text-shadow: 0 0 20px rgba(255, 32, 32, 0.6);
}

.ow-intro-gate.scary .ow-gate-arch {
  border-color: #502018;
  box-shadow: inset 0 -20px 40px rgba(80, 0, 0, 0.4);
}

.ow-intro-caption {
  max-width: 26rem;
  line-height: 1.7;
  font-size: 0.95rem;
  opacity: 0.85;
  min-height: 4rem;
  margin-bottom: 1.5rem;
}

#ow-event {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  width: 28rem;
  padding: 1.25rem 1.5rem;
  background: rgba(8, 4, 4, 0.95);
  border: 1px solid #402020;
  border-radius: 6px;
  z-index: 20;
  text-align: center;
}

#ow-event.ow-scary {
  border-color: #602020;
  box-shadow: 0 0 40px rgba(255, 32, 32, 0.15);
}

#ow-event-text {
  white-space: pre-line;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.ow-hidden { display: none !important; }

#ow-flash {
  position: absolute;
  inset: 0;
  background: #ff2020;
  opacity: 0;
  pointer-events: none;
  z-index: 25;
  transition: opacity 0.08s;
}

#ow-flash.ow-on { opacity: 0.35; }

#ow-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
}

.ow-exit {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.8rem;
  color: rgba(200, 184, 160, 0.4);
  text-decoration: none;
  z-index: 40;
}

.ow-exit:hover { color: rgba(200, 184, 160, 0.8); }

#ow-win p,
#ow-over p {
  max-width: 24rem;
  line-height: 1.6;
  opacity: 0.75;
  margin-bottom: 1.5rem;
}
