:root {
  --bg: #000;
  --phosphor: #7cfc00;
  --phosphor-dim: #4ca600;
  --frame: #0a3d00;
  --glow: rgba(124, 252, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--phosphor);
  font-family: ui-monospace, "Fira Code", "SFMono-Regular", Menlo, Consolas,
    "Liberation Mono", monospace;
}

.wrap {
  width: 100%;
  max-width: 960px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.terminal {
  width: min(95vw, 960px);
  height: min(85vh, 600px);
  border: 2px solid var(--frame);
  border-radius: 12px;
  background: #000;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(124, 252, 0, 0.12),
    inset 0 0 20px rgba(124, 252, 0, 0.16);
}

.terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
      to bottom,
      rgba(124, 252, 0, 0.05) 0px,
      rgba(124, 252, 0, 0.05) 1px,
      transparent 3px,
      transparent 4px
    ),
    radial-gradient(120% 90% at 50% -10%, rgba(124, 252, 0, 0.15), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.screen {
  position: absolute;
  inset: 12px 14px;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  line-height: 1.4;
  font-size: clamp(12px, 2.2vw, 18px);
  text-shadow: 0 0 6px rgba(124, 252, 0, 0.35);
  letter-spacing: 0.2px;
}

.screen:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 252, 0, 0.35);
}

.screen__dialogue {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 4px;
}

.screen__hud {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-top: 1px solid rgba(124, 252, 0, 0.25);
  padding-top: 0.6rem;
  background: linear-gradient(
      to bottom,
      rgba(124, 252, 0, 0.06),
      rgba(124, 252, 0, 0.02)
    )
    padding-box;
}

.hud__menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.screen__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid rgba(124, 252, 0, 0.25);
  margin-top: 0.6rem;
  padding-top: 0.6rem;
}

.control-button {
  background: rgba(124, 252, 0, 0.05);
  border: 1px solid rgba(124, 252, 0, 0.35);
  border-radius: 4px;
  color: inherit;
  font: inherit;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.control-button:hover,
.control-button:focus-visible {
  color: #a6ff4d;
  border-color: #a6ff4d;
  box-shadow: 0 0 6px rgba(166, 255, 77, 0.35);
  outline: none;
}

.control-volume {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--phosphor-dim);
}

.control-slider {
  appearance: none;
  width: min(180px, 40vw);
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
      to right,
      rgba(124, 252, 0, 0.7),
      rgba(124, 252, 0, 0.2)
    ),
    rgba(124, 252, 0, 0.1);
  outline: none;
  cursor: pointer;
}

.control-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(124, 252, 0, 0.9);
  box-shadow: 0 0 6px rgba(124, 252, 0, 0.6);
}

.control-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: rgba(124, 252, 0, 0.9);
  box-shadow: 0 0 6px rgba(124, 252, 0, 0.6);
}

.control-slider:focus-visible {
  box-shadow: 0 0 0 2px rgba(124, 252, 0, 0.35);
}

.hud__details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hud__options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
}

.line--log {
  color: var(--phosphor-dim);
  text-shadow: 0 0 4px rgba(124, 252, 0, 0.25);
}

.line--location {
  font-weight: 600;
}

.line--menu-title {
  font-weight: 700;
  letter-spacing: 0.3ch;
}

.line--menu-subheader {
  color: var(--phosphor);
}

.line--option {
  padding-left: 0.5ch;
}

.line--prompt {
  font-style: italic;
}

.menu-option {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.menu-option:hover,
.menu-option:focus-visible {
  color: #a6ff4d;
  outline: none;
  text-shadow: 0 0 6px rgba(166, 255, 77, 0.35);
}

.menu-option[disabled] {
  color: var(--phosphor-dim);
  cursor: not-allowed;
}

.menu-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.menu-input {
  background: rgba(124, 252, 0, 0.05);
  border: 1px solid rgba(124, 252, 0, 0.35);
  color: inherit;
  font: inherit;
  padding: 0.4rem 0.6rem;
}

.menu-input:focus {
  outline: 1px solid rgba(124, 252, 0, 0.6);
  outline-offset: 2px;
}

.menu-submit {
  align-self: flex-start;
  background: transparent;
  border: 1px solid rgba(124, 252, 0, 0.4);
  color: inherit;
  font: inherit;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.menu-submit:hover,
.menu-submit:focus-visible {
  color: #a6ff4d;
  border-color: #a6ff4d;
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .terminal::before {
    animation: none;
  }
}