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

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

#ms-app { width: 100vw; height: 100vh; position: relative; }
#ms-canvas { display: block; width: 100%; height: 100%; }

#ms-hud {
  position: fixed;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}
#ms-snacks { color: #f0d880; margin-left: auto; }
#ms-noise-label { opacity: 0.5; }
#ms-noise-bar {
  width: 80px;
  height: 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 3px;
  overflow: hidden;
}
#ms-noise-fill {
  height: 100%;
  width: 0%;
  background: #2ecc40;
  border-radius: 3px;
  transition: width 0.1s, background 0.2s;
}
#ms-noise-fill.ms-warn { background: #e8a040; }
#ms-noise-fill.ms-danger { background: #c41e3a; }

#ms-event {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  max-width: 420px;
  width: 90%;
  padding: 20px 24px;
  background: rgba(10, 8, 16, 0.95);
  border: 2px solid rgba(200, 168, 75, 0.3);
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
#ms-event.ms-scary { border-color: rgba(196, 30, 58, 0.6); box-shadow: 0 0 30px rgba(196, 30, 58, 0.2); }
#ms-event.ms-funny { border-color: rgba(240, 216, 128, 0.5); }
#ms-event-text {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.85);
}
#ms-event-btn {
  padding: 10px 28px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  background: #3a2810;
  border: 1px solid rgba(200, 168, 75, 0.4);
  border-radius: 6px;
  cursor: pointer;
}
#ms-event-btn:hover { background: #4a3820; }
.ms-hidden { display: none !important; }

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

.ms-credit { font-size: 0.7rem; letter-spacing: 0.3em; opacity: 0.6; margin-bottom: 12px; }
.ms-screen h1 {
  font-family: 'Creepster', cursive;
  font-size: clamp(40px, 10vw, 72px);
  color: #c8a84b;
  text-shadow: 0 0 24px rgba(200, 168, 75, 0.4);
  margin-bottom: 8px;
}
.ms-screen h2 {
  font-family: 'Creepster', cursive;
  font-size: clamp(28px, 7vw, 48px);
  color: #c41e3a;
  margin-bottom: 12px;
}
.ms-tagline { font-size: 15px; opacity: 0.75; margin-bottom: 12px; }
.ms-sub { font-size: 13px; line-height: 1.7; opacity: 0.5; margin-bottom: 28px; max-width: 340px; }
.ms-controls { margin-top: 20px; font-size: 11px; opacity: 0.35; }
.ms-controls kbd { padding: 2px 6px; border: 1px solid rgba(200,168,75,0.2); border-radius: 3px; }
.ms-screen p { opacity: 0.65; margin-bottom: 24px; font-size: 14px; max-width: 360px; line-height: 1.5; }
.ms-screen button {
  padding: 14px 36px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  background: #4a3018;
  border: 1px solid rgba(200, 168, 75, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.12s, background 0.2s;
}
.ms-screen button:hover { background: #5a4020; transform: scale(1.03); }

#ms-flash {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
#ms-flash.ms-on { opacity: 0.85; transition: opacity 0.06s; }

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