/* ------------------------------------------------------------------ *
 * Base layout
 * ------------------------------------------------------------------ */
:root {
  --crt-green: #7dffb0;
  --crt-dim: #3f8a63;
  --crt-text: #e2ffee;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05070a;
  color: var(--crt-text);
  font-family: "Courier New", Courier, monospace;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: fixed;
  inset: 0;
}

/* Full-screen render target. */
#scene {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* Cursor state while hovering something interactive. */
body.hovering #scene {
  cursor: pointer;
}

/* Subtle vignette so the room edges fall off into darkness. */
#app::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, transparent 42%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 5;
}

/* ------------------------------------------------------------------ *
 * HUD
 * ------------------------------------------------------------------ */
#hud {
  position: absolute;
  top: 18px;
  left: 22px;
  pointer-events: none;
  text-shadow: 0 2px 10px #000;
  z-index: 6;
}

#room-label {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--crt-green);
}

#controls {
  margin: 0;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(214, 255, 231, 0.55);
}

/* ------------------------------------------------------------------ *
 * Hover tooltip
 * ------------------------------------------------------------------ */
#tooltip {
  position: fixed;
  top: 0;
  left: 0;
  padding: 5px 9px;
  transform: translate(16px, 16px);
  border: 1px solid var(--crt-dim);
  background: rgba(4, 16, 11, 0.92);
  color: var(--crt-green);
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 10;
}

#tooltip.visible {
  opacity: 1;
}

/* ------------------------------------------------------------------ *
 * Retro dialogue / examine box
 * ------------------------------------------------------------------ */
#dialogue {
  position: fixed;
  left: 50%;
  bottom: 26px;
  width: min(880px, calc(100% - 36px));
  transform: translate(-50%, 14px);
  padding: 18px 24px 14px;
  border: 3px solid var(--crt-green);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(9, 30, 21, 0.96), rgba(3, 12, 8, 0.97));
  box-shadow:
    0 0 0 3px #02100a,
    0 0 26px rgba(80, 255, 160, 0.25),
    inset 0 0 42px rgba(60, 255, 150, 0.07);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 20;
}

#dialogue.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#dialogue-name {
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #b6ffd2;
}

#dialogue-text {
  margin: 0;
  min-height: 2.6em;
  font-size: 16px;
  line-height: 1.6;
  color: var(--crt-text);
  text-shadow: 0 0 12px rgba(90, 255, 160, 0.22);
}

#dialogue-hint {
  margin-top: 10px;
  font-size: 10px;
  letter-spacing: 2px;
  text-align: right;
  text-transform: uppercase;
  color: rgba(160, 255, 190, 0.45);
  animation: blink 1.4s steps(2, start) infinite;
}

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

/* ------------------------------------------------------------------ *
 * Room-change fade
 * ------------------------------------------------------------------ */
#fade {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 30;
}

#fade.visible {
  opacity: 1;
}
