@import url("https://fonts.googleapis.com/css2?family=VT323&display=swap");

:root {
  color-scheme: dark;
  --bg: #0b0f0c;
  --glow: #1fff7a;
  --glow-dim: rgba(31, 255, 122, 0.7);
  --glow-soft: rgba(31, 255, 122, 0.2);
  --frame: #1b1f1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--glow);
  font-family: "VT323", "Courier New", monospace;
  min-height: 100vh;
  background: radial-gradient(circle at top, #1d2822 0%, #0b0f0c 60%, #040605 100%);
  display: grid;
  place-items: center;
}


.monitor {
  display: grid;
  gap: 16px;
  place-items: center;
  position: relative;
}

.monitor::after {
  content: "";
  position: absolute;
  width: 80%;
  height: 36px;
  bottom: -18px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.45) 0%, transparent 70%);
  filter: blur(4px);
  z-index: -1;
}

.bezel {
  width: min(980px, 94vw);
  padding: 18px 18px 24px;
  background: linear-gradient(145deg, #e6d4b4 0%, #cbb186 55%, #d8c4a4 100%);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  position: relative;
}

.bezel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.bezel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #4d422f;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px 10px;
}

.brand {
  font-weight: 600;
}

.power-light {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #93ff58 0%, #47b83c 60%, #2f6f2a 100%);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(86, 255, 93, 0.7);
}

.terminal {
  position: relative;
  width: 100%;
  height: min(560px, 70vh);
  background: linear-gradient(145deg, #0b0f0c 0%, #070a08 100%);
  border: 10px solid #1e2320;
  border-radius: 18px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.6);
  padding: 22px;
  overflow: auto;
  outline: none;
  animation: flicker 7s infinite;
  filter: brightness(var(--crt-brightness, 1)) contrast(var(--crt-contrast, 1));
}

.terminal:focus {
  box-shadow: 0 0 80px rgba(31, 255, 122, 0.25), inset 0 0 40px rgba(0, 0, 0, 0.6);
}

.terminal::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.terminal {
  scrollbar-width: none;
}

.output {
  margin: 0;
  white-space: pre-wrap;
  font-size: 1.35rem;
  line-height: 1.35;
  text-shadow: 0 0 6px var(--glow-soft);
  min-height: 100%;
  position: relative;
  z-index: 2;
}

.output.boot {
  animation: bootIn 1.2s ease-out both;
}

.output::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.25) 0px,
    rgba(0, 0, 0, 0.25) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.6;
  z-index: 1;
}

.cursor {
  display: inline-block;
  font-size: 1.35rem;
  color: var(--glow);
  animation: blink 1s steps(2, start) infinite;
  text-shadow: 0 0 10px var(--glow-soft);
}

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0px,
    rgba(255, 255, 255, 0.08) 1px,
    rgba(0, 0, 0, 0.05) 2px,
    transparent 4px
  );
  mix-blend-mode: screen;
  opacity: 0.65;
  animation: scanmove 4s linear infinite;
  z-index: 4;
}

.glass {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08) 0%, transparent 35%);
  opacity: 0.7;
  z-index: 3;
}

.vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 5;
}

.hint {
  position: absolute;
  left: 24px;
  bottom: 24px;
  font-size: 1.1rem;
  color: rgba(31, 255, 122, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: hintpulse 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 6;
}

.hint.hidden {
  opacity: 0;
  animation: none;
}

.control-panel {
  width: min(980px, 94vw);
  display: grid;
  grid-template-columns: 110px 110px 110px 110px 1fr 130px;
  align-items: end;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e2cfa9 0%, #c9b08a 55%, #e0caa4 100%);
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.2);
  color: #4d422f;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.control-module {
  align-self: end;
}

.dial-group {
  display: grid;
  gap: 6px;
  justify-items: center;
  font-size: 0.8rem;
  min-height: 88px;
}

.dial {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f1dec0 0%, #d2b58a 55%, #9e825f 100%);
  box-shadow: inset 0 4px 6px rgba(255, 255, 255, 0.35), inset 0 -6px 10px rgba(0, 0, 0, 0.35);
  position: relative;
  cursor: pointer;
  touch-action: none;
}

.dial::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 18px;
  background: #5f4b35;
  top: 50%;
  left: 50%;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--angle, 0deg));
  border-radius: 6px;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.25), inset 0 -2px 3px rgba(0, 0, 0, 0.2);
}


.toggle-group {
  display: grid;
  gap: 6px;
  justify-items: center;
  font-size: 0.8rem;
  min-height: 88px;
}

.mode-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}

.toggle {
  width: 70px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid #6b553b;
  background: linear-gradient(180deg, #cbb08a 0%, #a58a65 100%);
  position: relative;
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25), inset 0 -3px 6px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.toggle::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f3e0c2 0%, #d1b487 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.25);
  transform-origin: center top;
  transition: transform 0.2s ease;
}

.toggle::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, #90b97a 0%, #6b9a55 100%);
}

.toggle[aria-pressed="true"]::after {
  transform: translateY(6px);
  background: linear-gradient(180deg, #c8ff9d 0%, #7fd55b 100%);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.45), inset 0 -3px 5px rgba(0, 0, 0, 0.3);
}

.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #d9c3a1 0%, #c2a881 55%, #d9c3a1 100%);
  border-radius: 14px;
  border: 1px solid rgba(110, 91, 65, 0.35);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.18);
}

.panel-button {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 9px 0;
  width: 92px;
  border: 2px solid #6b553b;
  border-radius: 12px;
  background: linear-gradient(180deg, #e8d4b2 0%, #c9b08a 100%);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: grid;
  place-items: center;
  user-select: none;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.35), inset 0 -3px 6px rgba(0, 0, 0, 0.18);
  position: relative;
}

.panel-button::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.panel-button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.speaker {
  width: 120px;
  height: 50px;
  border-radius: 12px;
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.35) 0px,
    rgba(0, 0, 0, 0.35) 3px,
    transparent 3px,
    transparent 6px
  );
}

@media (max-width: 1050px) {
  .control-panel {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    justify-items: center;
  }

  .button-row {
    grid-column: span 2;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .control-panel {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .button-row {
    grid-column: 1 / -1;
  }

  .speaker {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 220px;
  }
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  10% {
    opacity: 0.98;
  }
  20% {
    opacity: 1;
  }
  30% {
    opacity: 0.97;
  }
  40% {
    opacity: 1;
  }
  55% {
    opacity: 0.98;
  }
  70% {
    opacity: 1;
  }
  85% {
    opacity: 0.97;
  }
}

.monitor.power-off .terminal {
  filter: brightness(0) contrast(1);
  animation: none;
}

.monitor.power-off .output {
  opacity: 0;
}

.monitor.power-off .cursor {
  opacity: 0;
  animation: none;
}

.monitor.power-off .scanlines {
  opacity: 0;
}

.monitor.power-off .power-light {
  background: radial-gradient(circle, #6f5b41 0%, #3a2f22 60%, #2a2016 100%);
  box-shadow: none;
}

@keyframes scanmove {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(6px);
  }
}

@keyframes bootIn {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


@keyframes hintpulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.85;
  }
}
