/* ===== Base / Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep: #0a0610;
  --wood: #5c3a21;
  --wood-dark: #3d2414;
  --shag: #6b3f2a;
  --neon-pink: #ff2d95;
  --neon-cyan: #00f0ff;
  --neon-purple: #b44aff;
  --neon-orange: #ff8c42;
  --crt-green: #33ff66;
  --crt-amber: #ffb000;
  --cream: #f5e6c8;
  --panel-bg: rgba(12, 8, 20, 0.94);
  --panel-border: #ff2d95;
  --font-pixel: 'Press Start 2P', monospace;
  --font-mono: 'VT323', 'Share Tech Mono', monospace;
  --font-ui: 'Share Tech Mono', monospace;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 18px;
  cursor: default;
  user-select: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 1;
  outline: none;
}

.hidden { display: none !important; }

/* ===== Boot Screen ===== */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(ellipse at center, #1a0a18 0%, #050308 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.boot-inner {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 2rem;
  animation: bootFadeIn 1.2s ease-out;
}

@keyframes bootFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.boot-logo {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.boot-glitch {
  font-family: var(--font-pixel);
  font-size: clamp(1.4rem, 5vw, 2.8rem);
  color: var(--neon-pink);
  text-shadow:
    0 0 10px var(--neon-pink),
    0 0 40px rgba(255, 45, 149, 0.5),
    3px 0 var(--neon-cyan),
    -3px 0 var(--neon-purple);
  letter-spacing: 0.15em;
  position: relative;
  animation: glitchShift 3s infinite;
}

@keyframes glitchShift {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, 2px); }
}

.boot-sub {
  font-family: var(--font-pixel);
  font-size: clamp(0.9rem, 3vw, 1.6rem);
  color: var(--neon-cyan);
  text-shadow: 0 0 12px var(--neon-cyan);
  letter-spacing: 0.4em;
}

.boot-tagline {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: rgba(245, 230, 200, 0.65);
  margin-bottom: 2.5rem;
  letter-spacing: 0.08em;
}

.boot-prompt {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--cream);
  padding: 1rem 1.5rem;
  border: 2px solid var(--neon-pink);
  display: inline-block;
  box-shadow: 0 0 20px rgba(255, 45, 149, 0.35), inset 0 0 20px rgba(255, 45, 149, 0.08);
  animation: pulseBorder 2s ease-in-out infinite;
}

@keyframes pulseBorder {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 45, 149, 0.35); }
  50% { box-shadow: 0 0 35px rgba(0, 240, 255, 0.5), 0 0 10px rgba(255, 45, 149, 0.4); border-color: var(--neon-cyan); }
}

.boot-hints {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: center;
  font-size: 1.1rem;
  color: rgba(245, 230, 200, 0.45);
}

.boot-hints span {
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.blink { animation: blink 1s step-end infinite; }
.blink-soft { animation: blink 2s step-end infinite; color: #ff4444; }

@keyframes blink {
  50% { opacity: 0; }
}

.vhs-noise {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseMove 0.4s steps(4) infinite;
}

@keyframes noiseMove {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ===== HUD ===== */
.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  transition: color 0.15s, text-shadow 0.15s, transform 0.15s;
}

.crosshair.hot {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
  transform: translate(-50%, -50%) scale(1.25);
}

.interact-prompt {
  position: absolute;
  top: calc(50% + 36px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--cream);
  background: rgba(0, 0, 0, 0.65);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.interact-prompt.visible { opacity: 1; }

.hud-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(10, 6, 16, 0.75), rgba(10, 6, 16, 0.35));
  border: 1px solid rgba(255, 45, 149, 0.25);
  min-width: 110px;
}

.hud-tl { top: 12px; left: 12px; border-left: 3px solid var(--neon-pink); }
.hud-tr { top: 12px; right: 12px; text-align: right; border-right: 3px solid var(--neon-cyan); }
.hud-bl { bottom: 12px; left: 12px; border-left: 3px solid var(--neon-purple); }
.hud-br { bottom: 12px; right: 12px; text-align: right; border-right: 3px solid var(--neon-orange); }

.hud-label {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: rgba(245, 230, 200, 0.5);
  letter-spacing: 0.12em;
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.hud-tr .hud-value { color: var(--neon-pink); text-shadow: 0 0 8px rgba(255, 45, 149, 0.4); }
.hud-br .hud-value { color: var(--neon-orange); text-shadow: 0 0 8px rgba(255, 140, 66, 0.4); }

/* ===== Toasts ===== */
.toasts {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  align-items: center;
}

.toast {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  background: rgba(10, 6, 16, 0.9);
  border: 1px solid var(--neon-cyan);
  color: var(--cream);
  padding: 0.7rem 1.2rem;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
  animation: toastIn 0.3s ease-out, toastOut 0.4s ease-in 2.4s forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-8px); }
}

/* Mobile hint */
@media (max-width: 700px) {
  .hud-corner { min-width: 80px; padding: 0.5rem; }
  .hud-label { font-size: 0.32rem; }
  .hud-value { font-size: 1rem; }
  .boot-hints { font-size: 0.95rem; }
}
