@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&display=swap");

@font-face {
  font-family: "DOSEGA";
  src: local("DOSEGA"), url("assets/fonts/dosega/DOSEGA.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-dark: #050505;
  --bg-glow: #0f1b2e;
  --monitor-shell: #2c2f36;
  --monitor-edge: #1a1c20;
  --screen-border: #0f1012;
  --scanline: rgba(255, 255, 255, 0.045);
  --cyan-glow: #7ad1ff;
  --neon-green: #7dfb7d;
  --boot-blue: #031f46;
  --screen-width: 1024px;
  --screen-height: 768px;
  --shell-padding: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  background: #000000;
  color: #e8e8e8;
  overflow: hidden;
  user-select: none;
}

input,
textarea,
select {
  user-select: text;
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000000;
}

.scene.hidden {
  opacity: 0;
  pointer-events: none;
}

.wm-container {
  position: fixed;
  inset: 0;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: none;
  z-index: 10;
}

.wm-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.wm-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000000;
}

.info-badge {
  position: absolute;
  right: 22px;
  bottom: 22px;
  border: none;
  background: transparent;
  appearance: none;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: help;
  z-index: 5;
}

.info-badge.hidden {
  opacity: 0;
  pointer-events: none;
}

.info-badge:focus {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.info-tooltip {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: min(260px, 80vw);
  background: rgba(10, 10, 12, 0.95);
  color: #f2f2f2;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  padding: 10px 12px;
  border: 1px solid #2f2f2f;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.info-badge:hover .info-tooltip,
.info-badge:focus .info-tooltip {
  opacity: 1;
}

.power-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  z-index: 3;
}

.power-stage.hidden {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.power-btn {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 3px solid #6d717a;
  background: radial-gradient(circle at 30% 30%, #c9cbcf, #7e828a 70%);
  box-shadow: inset 0 6px 12px rgba(255, 255, 255, 0.15), inset 0 -8px 16px rgba(0, 0, 0, 0.45), 0 18px 30px rgba(0, 0, 0, 0.5);
  color: #1f1f1f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.power-btn:hover {
  box-shadow: inset 0 6px 12px rgba(255, 255, 255, 0.2), inset 0 -8px 16px rgba(0, 0, 0, 0.55), 0 20px 36px rgba(0, 0, 0, 0.55);
}

.power-btn:active {
  transform: translateY(1px) scale(0.98);
}

.power-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border: 3px solid #4c4f55;
  border-top-color: transparent;
  border-radius: 50%;
}

.power-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 6px;
  height: 22px;
  background: #4c4f55;
  transform: translateX(-50%);
  border-radius: 3px;
}

.monitor-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--monitor-scale, 1));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
  z-index: 2;
  overflow: visible;
  transform-origin: center;
}

.monitor-wrap.visible {
  opacity: 1;
  pointer-events: auto;
}

.monitor {
  width: calc(var(--screen-width) + (var(--shell-padding) * 2));
  height: calc(var(--screen-height) + (var(--shell-padding) * 2));
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.monitor-shell {
  width: 100%;
  height: 100%;
  padding: var(--shell-padding);
  border-radius: 20px;
  background: linear-gradient(145deg, #3a3f49, #1c1e24);
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6);
}

.monitor-screen {
  position: relative;
  width: 100%;
  height: 100%;
  --glare-x: 0px;
  --glare-y: 0px;
  background: #000000;
  border-radius: 10px;
  border: 6px solid var(--screen-border);
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.7);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: none;
}

.monitor-screen * {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: none;
}

.monitor-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.12), transparent 45%);
  transform: translate3d(var(--glare-x), var(--glare-y), 0);
  transition: none;
  pointer-events: none;
  z-index: 4;
}

.monitor-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    var(--scanline) 0,
    var(--scanline) 1px,
    rgba(0, 0, 0, 0) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.35;
  pointer-events: none;
  z-index: 4;
}

.crt-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.15) 60%, rgba(0, 0, 0, 0.55) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.025) 0,
      rgba(255, 0, 0, 0.025) 1px,
      rgba(0, 255, 0, 0.02) 2px,
      rgba(0, 0, 255, 0.02) 3px
    );
  mix-blend-mode: screen;
  opacity: 0.45;
  pointer-events: none;
  z-index: 6;
}

.screen-layer {
  position: absolute;
  inset: 0;
  height: inherit;
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.screen-layer.active {
  opacity: 1;
  pointer-events: auto;
}

#screen-shutdown {
  background: #000000;
  color: #f2f2f2;
  font-family: "DOSEGA", "PxPlus IBM VGA8", "Perfect DOS VGA 437", "IBM VGA 8x16", "Lucida Console", monospace;
  font-size: 16px;
}

.shutdown-screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

#screen-bios {
  color: #e6e6e6;
  font-family: "DOSEGA", "PxPlus IBM VGA8", "Perfect DOS VGA 437", "IBM VGA 8x16", "Lucida Console", monospace;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 400;
  padding: 28px;
  letter-spacing: 0;
  background: #000000;
  transition: none;
}

.bios-output {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  white-space: pre;
  font-family: "DOSEGA", "PxPlus IBM VGA8", "Perfect DOS VGA 437", "IBM VGA 8x16", "Lucida Console", monospace;
  font-weight: 400;
}

#screen-os {
  background: linear-gradient(180deg, #000000 0%, var(--boot-blue) 100%);
  color: #e6f1ff;
}

.os-boot {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 26px 32px 40px;
}

.os-boot-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.os-logo {
  width: min(70%, 320px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 18px rgba(122, 209, 255, 0.45));
}

.os-boot-progress {
  width: 100%;
  display: flex;
  justify-content: center;
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  color: #111111;
}

.os-boot-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #111111;
}

.os-boot-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  background: #ffffff;
  box-shadow: inset -1px -1px #dfdfdf, inset 1px 1px #808080;
}

#os-progress {
  width: 640px;
}

.login-window {
  opacity: 0;
  visibility: hidden;
  transition: none;
}

.login-window.visible {
  opacity: 1;
  visibility: visible;
}

.login-overlay.logged-in .login-window,
.login-overlay.logged-in .shutdown-button {
  display: none;
}

.welcome-window {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
  transition: none;
  z-index: 2;
}

.welcome-window.visible {
  opacity: 1;
  visibility: visible;
}

.scene.system-dark .monitor-wrap {
  opacity: 0;
  pointer-events: none;
  transition: none;
}

.scene.system-dark .info-badge {
  opacity: 0;
  pointer-events: none;
}

#screen-off {
  background: #000000;
}

.screen-off-glow {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15), transparent 55%);
  opacity: 0.15;
}

#screen-login {
  position: relative;
  background: url("assets/desknet91/backgrounds/desknet91_background_0.png") center/100% 100% no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

#screen-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.3));
  z-index: 0;
}

.login-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.window .window-body {
  color: #111111;
}

.login-window {
  width: min(360px, 86%);
  box-shadow: 10px 12px 0 rgba(0, 0, 0, 0.35);
}

.login-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.shutdown-button {
  position: absolute;
  left: 20px;
  bottom: 20px;
  min-width: 120px;
}

@media (max-width: 600px) {
  .power-btn {
    width: 108px;
    height: 108px;
  }

  .power-label {
    font-size: 10px;
  }

  .monitor-shell {
    padding: 16px;
  }

  #screen-bios {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
