/* Vaporwave x Windows 95 theme */
:root {
  --bg-1: #301934; /* deep purple */
  --bg-2: #0b0b2b; /* dark indigo */
  --pink: #ff71ce;
  --aqua: #01cdfe;
  --lime: #05ffa1;
  --yellow: #ffd166;
  --window: #c0c0c0; /* win95 gray */
  --shadow: #000000;
  --edge-dark: #6e6e6e;
  --edge-light: #ffffff;
  --text: #111;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "VT323", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  overflow: hidden;
}

/* Vaporwave gradient background with subtle scanlines */
.desktop {
  position: relative;
  height: 100vh;
  /* Try user-provided wallpaper (project root) first; fall back to gradient */
  background:
    url('../assets/wallpaper.png') center/cover no-repeat,
    linear-gradient(135deg, var(--bg-1), var(--bg-2)),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4" viewBox="0 0 4 4"><path fill="%23ffffff10" d="M0 0h4v1H0z"/></svg>');
  background-blend-mode: normal, screen, normal;
  background-size: cover, cover, auto;
}

.desktop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 113, 206, 0.25), transparent 40%),
              radial-gradient(circle at 80% 70%, rgba(1, 205, 254, 0.25), transparent 40%);
  pointer-events: none;
}

.desktop-icons {
  position: absolute;
  top: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: repeat(2, 96px);
  gap: 18px 24px;
}

.desktop-icon {
  width: 96px;
  background: transparent;
  border: none;
  color: #f1f1f1;
  text-align: center;
  cursor: default;
}

.desktop-icon:focus-visible { outline: 2px dashed var(--aqua); outline-offset: 2px; }

.desktop-icon .icon {
  display: block;
  width: 48px;
  height: 36px;
  margin: 0 auto 8px;
  background:
    linear-gradient(180deg, #ffe 0%, #ffd 60%, #e8e8e8 60%, #d6d6d6 100%);
  border: 2px solid rgba(0,0,0,0.35);
  border-radius: 3px 3px 2px 2px;
  box-shadow: 0 2px 0 #00000066;
}

/* Icon images */
.desktop-icon .icon.folder {
  width: 48px;
  height: 48px;
  background: center/contain no-repeat url('../assets/Folder.ico');
  border: none;
  box-shadow: none;
}

.desktop-icon .icon.folder.open {
  background: center/contain no-repeat url('../assets/Opened%20Folder.ico');
}

.desktop-icon .icon.mailbox {
  width: 48px;
  height: 48px;
  background: center/contain no-repeat url('../assets/Mailbox%20with%20phone.ico');
  border: none;
  box-shadow: none;
}

/* Game joystick icon */
.desktop-icon .icon.joystick {
  width: 48px;
  height: 48px;
  background: center/contain no-repeat url('../assets/joystick.ico');
  border: none;
  box-shadow: none;
}

/* Console/Terminal icon */
.desktop-icon .icon.console {
  width: 48px;
  height: 48px;
  background: center/contain no-repeat url('../assets/console_prompt.ico');
  border: none;
  box-shadow: none;
}

.desktop-icon .label {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.25);
  font-size: 14px;
}

/* Window 95 style */
.window-95 {
  position: absolute;
  top: 120px;
  left: 200px;
  width: 680px;
  max-width: calc(100vw - 40px);
  background: var(--window);
  border: 2px solid var(--edge-dark);
  box-shadow: 6px 6px 0 #0008, inset -2px -2px 0 var(--edge-dark), inset 2px 2px 0 var(--edge-light);
  display: none;
}

.window-95.active { display: block; }

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(90deg, var(--pink), var(--aqua));
  color: #000;
  cursor: move;
  user-select: none;
}

.titlebar .title { font-family: "Press Start 2P", monospace; font-size: 12px; letter-spacing: 0.5px; }

.window-controls { display: flex; gap: 4px; }
.btn {
  width: 18px; height: 18px; border: 2px solid var(--edge-dark);
  background: #ddd; box-shadow: inset -2px -2px 0 var(--edge-dark), inset 2px 2px 0 var(--edge-light);
}
.btn:active { box-shadow: inset 2px 2px 0 var(--edge-dark), inset -2px -2px 0 var(--edge-light); }
.btn.btn-close { background: linear-gradient(180deg, #ff8fbf, #ff4fa8); }
.btn.btn-min { background: linear-gradient(180deg, #a5e4ff, #65d7ff); }

.window-body { padding: 12px; }
.panel { background: #fff; border: 2px solid var(--edge-dark); box-shadow: inset -2px -2px 0 var(--edge-dark), inset 2px 2px 0 var(--edge-light); padding: 12px; }
.panel h2 { margin: 0 0 8px; font-family: "Press Start 2P", monospace; font-size: 14px; }
.panel p, .panel li { font-size: 18px; }
.list { margin: 0; padding-left: 18px; }

/* Terminal */
#terminal-window .panel { padding: 0; }
.terminal {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 50vh;
  background: #000;
  color: #0f0;
  font-family: monospace;
}
.terminal-output {
  padding: 10px;
  overflow: auto;
  line-height: 1.4;
  font-size: 14px;
  white-space: pre-wrap;
}
.terminal-input-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-top: 2px solid #0a0;
}
.terminal-input-row .prompt { color: #0f0; font-weight: bold; }
.terminal-input-row input {
  background: #000;
  color: #0f0;
  border: 1px solid #0a0;
  padding: 6px 8px;
  font-family: monospace;
}

/* HS Paint */
.paint-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
}

.paint-tools button,
.paint-actions button {
  padding: 6px 10px;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  border: 2px solid var(--edge-dark);
  background: #efefef;
}

.paint-tools button[aria-pressed="true"] {
  background: #fff;
}

.paint-palette {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  justify-content: start;
}

.paint-palette button {
  width: 22px;
  height: 22px;
  border: 2px solid var(--edge-dark);
  background: var(--swatch, #000);
}

.paint-size {
  display: flex;
  align-items: center;
  gap: 6px;
}

.paint-size label {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
}

/* Taskbar */
.taskbar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: #c4c4c4;
  border-top: 2px solid var(--edge-dark);
  box-shadow: inset 0 2px 0 var(--edge-light);
}

.start-button {
  height: 30px;
  min-width: 72px;
  padding: 0 12px;
  font-family: "Press Start 2P", monospace;
  border: 2px solid var(--edge-dark);
  background: linear-gradient(180deg, #dcdcdc, #bdbdbd);
}

.taskbar-tasks { display: flex; gap: 6px; align-items: center; }
.taskbar .task {
  height: 28px; min-width: 120px; padding: 0 8px; display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--edge-dark);
  background: #e1e1e1;
}

.taskbar-spacer { flex: 1; }

.taskbar-clock {
  font-family: "Press Start 2P", monospace;
  background: #e1e1e1;
  border: 2px solid var(--edge-dark);
  padding: 6px 10px;
}

/* Start menu */
.start-menu {
  position: absolute;
  bottom: 40px;
  left: 6px;
  width: 280px;
  background: #d9d9d9;
  border: 2px solid var(--edge-dark);
  box-shadow: 6px 6px 0 #0008, inset -2px -2px 0 var(--edge-dark), inset 2px 2px 0 var(--edge-light);
  display: none;
}
.start-menu.open { display: block; }
.start-menu header {
  padding: 8px;
  background: linear-gradient(90deg, var(--aqua), var(--pink));
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
}
.start-menu ul { list-style: none; margin: 0; padding: 6px; }
.start-menu li { margin: 2px 0; }
.start-menu button {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 2px solid var(--edge-dark);
  background: #efefef;
}
.start-menu button:hover { background: #fff; }
.start-menu .group-label { margin: 6px 4px; font-family: "Press Start 2P"; font-size: 11px; opacity: 0.9; }

/* Responsive */
@media (max-width: 768px) {
  .desktop-icons { grid-template-columns: repeat(2, 84px); gap: 16px 18px; }
  .desktop-icon { width: 84px; }
  .window-95 { width: calc(100vw - 16px); left: 8px; top: 90px; }
}

/* Resume window: make wider and ensure iframe fits within the viewport */
#resume-window {
  width: min(100vw - 40px, 1100px);
}

#resume-window .panel {
  padding: 8px;
}

#resume-window iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 220px); /* leave room for titlebar/taskbar */
  border: 0;
}

/* AFK overlay + DVD logo */
#idle-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease;
  z-index: 9999;
}

#idle-overlay.active {
  opacity: 0.85;
  visibility: visible;
}

#idle-overlay .dvd-logo {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 80px;
  display: grid;
  place-items: center;
  font-family: "Press Start 2P", monospace;
  font-size: 22px;
  color: #000;
  background: linear-gradient(135deg, var(--pink), var(--aqua));
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px #000, 0 0 24px 6px rgba(255, 255, 255, 0.25) inset;
  user-select: none;
  pointer-events: none;
}


