/* =========================================================
   MYPC98 — token system
   Color:  face #C0C0C0 / face-light #DFDFDF / shadow #808080
           shadow-dark #404040 / highlight #FFFFFF
           titlebar navy #000080 -> #1084D0 / desktop teal #008080
   Type:   Silkscreen (UI chrome, bitmap-accurate)
           Press Start 2P (signature/display, used sparingly)
           Courier New (mono utility text)
   ========================================================= */

:root {
  --face: #c0c0c0;
  --face-light: #dfdfdf;
  --shadow: #808080;
  --shadow-dark: #404040;
  --highlight: #ffffff;
  --titlebar-a: #000080;
  --titlebar-b: #1084d0;
  --titlebar-inactive: #808080;
  --desktop-bg: #008080;
  --text: #000000;
  --link: #0000ee;
  --font-ui: 'Silkscreen', monospace;
  --font-display: 'Press Start 2P', monospace;
  --font-mono: 'Courier New', Courier, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--desktop-bg);
  font-family: var(--font-ui);
  color: var(--text);
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

/* ambient CRT scanline texture, subtle, always on */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.06) 0px,
    rgba(0, 0, 0, 0.06) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

button { font-family: inherit; }

/* ---------- win95 bevel utilities ---------- */
.bevel-out {
  border: 2px solid;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  box-shadow:
    inset 1px 1px 0 0 var(--face-light),
    inset -1px -1px 0 0 var(--shadow);
  background: var(--face);
}

.bevel-in {
  border: 2px solid;
  border-color: var(--shadow-dark) var(--highlight) var(--highlight) var(--shadow-dark);
  box-shadow:
    inset 1px 1px 0 0 var(--shadow),
    inset -1px -1px 0 0 var(--face-light);
  background: var(--face);
}

.btn95 {
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
}
.btn95.small { padding: 3px 8px; font-size: 11px; }
.btn95 { border: 2px solid; border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  box-shadow: inset 1px 1px 0 0 var(--face-light), inset -1px -1px 0 0 var(--shadow);
  background: var(--face); color: var(--text); }
.btn95:active {
  border-color: var(--shadow-dark) var(--highlight) var(--highlight) var(--shadow-dark);
  box-shadow: inset 1px 1px 0 0 var(--shadow), inset -1px -1px 0 0 var(--face-light);
  padding-top: 7px; padding-left: 15px;
}

/* =========================================================
   BOOT SCREEN
   ========================================================= */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000000;
  color: #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: boot-fade-out 0.6s ease 2.2s forwards;
}
#boot-screen[hidden] { display: none; }

.boot-inner { text-align: center; width: min(90vw, 420px); }

.boot-logo {
  font-family: var(--font-display);
  font-size: clamp(20px, 6vw, 32px);
  color: #ffffff;
  letter-spacing: 2px;
}
.boot-logo span { color: #1084d0; }

.boot-line {
  font-family: var(--font-mono);
  font-size: 13px;
  margin: 18px 0 10px;
  color: #a0a0a0;
}

.boot-bar-track {
  width: 100%;
  height: 14px;
  background: #1a1a1a;
  border: 2px solid #5a5a5a;
  padding: 2px;
}
.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(90deg, #1084d0 0 6px, #0a5fa0 6px 12px);
  animation: boot-fill 1.8s steps(24) forwards;
}
.boot-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #555;
  margin-top: 14px;
}

@keyframes boot-fill { from { width: 0%; } to { width: 100%; } }
@keyframes boot-fade-out {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* =========================================================
   SHUTDOWN SCREEN
   ========================================================= */
#shutdown-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000080;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: default;
}
#shutdown-screen[hidden] { display: none; }
.shutdown-inner p { font-family: var(--font-mono); margin: 6px 0; }
.shutdown-inner p:first-child { font-family: var(--font-display); font-size: 14px; margin-bottom: 20px; }
.shutdown-msg { font-size: 16px; }
.shutdown-hint { font-size: 11px; color: #b8c9ff; margin-top: 24px !important; }

/* =========================================================
   DESKTOP
   ========================================================= */
#desktop {
  position: relative;
  height: 100vh;
  width: 100vw;
  padding: 14px 0 0 0;
  overflow: hidden;
}

#icon-grid {
  position: absolute;
  top: 14px;
  left: 12px;
  display: grid;
  grid-template-rows: repeat(6, 84px);
  grid-auto-flow: column;
  gap: 4px;
  z-index: 1;
}

.desktop-icon {
  width: 78px;
  height: 78px;
  background: transparent;
  border: 1px dashed transparent;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 2px;
  cursor: pointer;
}
.desktop-icon:hover,
.desktop-icon:focus-visible {
  border-color: rgba(255,255,255,0.5);
  outline: none;
}
.desktop-icon:active .pixel-icon,
.desktop-icon.selected .pixel-icon {
  filter: brightness(0.75) saturate(1.4);
}
.desktop-icon.selected {
  background: rgba(0, 0, 128, 0.45);
}

.pixel-icon {
  width: 34px;
  height: 34px;
  shape-rendering: crispEdges;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.4));
}

.desktop-icon span {
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  text-shadow: 1px 1px 1px #000000;
  overflow-wrap: break-word;
}

#visitor-counter {
  position: absolute;
  bottom: 46px;
  right: 14px;
  z-index: 1;
  background: #000000;
  border: 2px solid #404040;
  padding: 6px 8px;
  text-align: center;
}
.counter-label {
  display: block;
  font-size: 8px;
  color: #ff3030;
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.counter-digits {
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  color: #ff3030;
  letter-spacing: 2px;
}

/* =========================================================
   WINDOWS
   ========================================================= */
.window {
  position: absolute;
  top: 60px;
  left: 90px;
  width: 380px;
  max-width: calc(100vw - 24px);
  background: var(--face);
  border: 2px solid;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  box-shadow: inset 1px 1px 0 0 var(--face-light), 3px 3px 8px rgba(0,0,0,0.5);
  z-index: 10;
  display: flex;
  flex-direction: column;
}
.window[hidden] { display: none; }
.window.minimized { display: none; }
.window.active { z-index: 100; }

.titlebar {
  background: linear-gradient(90deg, var(--titlebar-a), var(--titlebar-b));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 4px 8px;
  cursor: grab;
  user-select: none;
}
.window:not(.active) .titlebar {
  background: var(--titlebar-inactive);
}
.titlebar:active { cursor: grabbing; }
.titlebar-text {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.titlebar-btns { display: flex; gap: 2px; }
.tb-btn {
  width: 18px;
  height: 16px;
  font-size: 11px;
  line-height: 1;
  border: 2px solid;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  background: var(--face);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tb-btn:active {
  border-color: var(--shadow-dark) var(--highlight) var(--highlight) var(--shadow-dark);
}

.notepad-menubar {
  background: var(--face);
  border-bottom: 1px solid var(--shadow);
  display: flex;
  gap: 14px;
  padding: 3px 8px;
  font-size: 11px;
}

.window-body {
  padding: 10px;
  font-size: 12px;
  line-height: 1.6;
  overflow-y: auto;
  max-height: 50vh;
}
.window-body.no-pad { padding: 0; }

.drive-list { list-style: none; margin: 0 0 8px; padding: 0; }
.drive-list li { padding: 3px 0; }
.drive-icon { margin-right: 6px; }

.divider { border: none; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--highlight); margin: 10px 0; }

.specs-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.specs-table td { padding: 3px 4px; vertical-align: top; }
.specs-table td:first-child { color: var(--shadow-dark); white-space: nowrap; }

.bin-table { width: 100%; border-collapse: collapse; font-size: 10px; margin-bottom: 8px; }
.bin-table th { text-align: left; border-bottom: 1px solid var(--shadow); padding: 3px 4px; }
.bin-table td { padding: 3px 4px; border-bottom: 1px dotted var(--shadow); }
.bin-status { font-size: 10px; color: var(--shadow-dark); margin: 6px 0; }
.bin-toast { font-size: 11px; margin-top: 8px; color: #800000; }

.notepad-area {
  width: 100%;
  height: 220px;
  border: none;
  resize: none;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 8px;
  line-height: 1.5;
}
.notepad-area:focus { outline: none; }

.guestbook-list { list-style: none; margin: 0 0 10px; padding: 0; font-size: 11px; }
.guestbook-list li {
  padding: 6px;
  margin-bottom: 4px;
  background: #ffffff;
  border: 1px solid var(--shadow);
}
.guestbook-form { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.guestbook-form label { font-size: 10px; color: var(--shadow-dark); }
.guestbook-form input {
  font-family: var(--font-ui);
  font-size: 11px;
  padding: 5px;
  border: 2px solid;
  border-color: var(--shadow-dark) var(--highlight) var(--highlight) var(--shadow-dark);
  background: #ffffff;
}
.guestbook-form input:focus { outline: 1px dotted var(--titlebar-a); }
.guestbook-form .btn95 { align-self: flex-start; margin-top: 4px; }
.guestbook-note { font-size: 10px; color: var(--shadow-dark); font-style: italic; }

.links-list { list-style: none; margin: 0 0 10px; padding: 0; }
.links-list li { padding: 4px 0; }
.links-list a { color: var(--link); text-decoration: underline; font-size: 12px; }

.badge-row { display: flex; gap: 6px; flex-wrap: wrap; }
.badge88 {
  width: 88px;
  height: 31px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  font-size: 7px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  color: var(--shadow-dark);
}

.winamp-titlebar { background: linear-gradient(90deg, #1a1a1a, #3a3a3a) !important; }
.winamp-body { background: #2a2a2a; }
.winamp-screen {
  background: #0a1a0a;
  border: 2px solid;
  border-color: var(--shadow-dark) var(--face-light) var(--face-light) var(--shadow-dark);
  padding: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.winamp-marquee-track {
  display: flex;
  white-space: nowrap;
  overflow: hidden;
  animation: winamp-scroll 6s linear infinite;
  width: max-content;
}
.winamp-marquee {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #33ff33;
}
@keyframes winamp-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.winamp-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
  margin-top: 8px;
}
.winamp-eq span {
  width: 6px;
  background: #33ff33;
  animation: winamp-bounce 0.9s ease-in-out infinite;
}
.winamp-eq span:nth-child(1) { height: 40%; animation-delay: 0s; }
.winamp-eq span:nth-child(2) { height: 80%; animation-delay: 0.1s; }
.winamp-eq span:nth-child(3) { height: 55%; animation-delay: 0.2s; }
.winamp-eq span:nth-child(4) { height: 90%; animation-delay: 0.3s; }
.winamp-eq span:nth-child(5) { height: 30%; animation-delay: 0.4s; }
.winamp-eq span:nth-child(6) { height: 70%; animation-delay: 0.5s; }
.winamp-eq span:nth-child(7) { height: 50%; animation-delay: 0.6s; }
.winamp-eq span:nth-child(8) { height: 85%; animation-delay: 0.7s; }
@keyframes winamp-bounce { 0%, 100% { height: 10%; } 50% { height: 90%; } }
.winamp-eq.paused span { animation-play-state: paused; }

.winamp-controls { display: flex; align-items: center; justify-content: space-between; }
.winamp-time { font-family: var(--font-mono); font-size: 10px; color: #cccccc; }

/* =========================================================
   TASKBAR
   ========================================================= */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 34px;
  background: var(--face);
  border-top: 2px solid var(--highlight);
  display: flex;
  align-items: center;
  padding: 3px 4px;
  gap: 6px;
  z-index: 9999;
}

#start-wrap { position: relative; }

#start-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 6px;
  font-weight: bold;
  font-size: 12px;
  border: 2px solid;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  background: var(--face);
  cursor: pointer;
}
#start-btn:active,
#start-btn.open {
  border-color: var(--shadow-dark) var(--highlight) var(--highlight) var(--shadow-dark);
}
.start-flag { width: 14px; height: 14px; }

#start-menu {
  position: absolute;
  bottom: 32px;
  left: 0;
  width: 190px;
  background: var(--face);
  border: 2px solid;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  box-shadow: 3px 3px 8px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  padding: 3px;
}
#start-menu[hidden] { display: none; }
.start-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}
.start-item:hover { background: var(--titlebar-a); color: #ffffff; }
#start-menu hr { border: none; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--highlight); margin: 3px 2px; }

#taskbar-windows {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  min-width: 0;
}
.taskbar-win-btn {
  font-size: 11px;
  padding: 4px 10px;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 2px solid;
  border-color: var(--highlight) var(--shadow-dark) var(--shadow-dark) var(--highlight);
  background: var(--face);
  cursor: pointer;
  flex-shrink: 0;
}
.taskbar-win-btn.active {
  border-color: var(--shadow-dark) var(--highlight) var(--highlight) var(--shadow-dark);
  background: var(--face-light);
}

#taskbar-clock {
  font-size: 11px;
  border: 2px solid;
  border-color: var(--shadow-dark) var(--highlight) var(--highlight) var(--shadow-dark);
  padding: 5px 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 640px) {
  #icon-grid {
    grid-template-rows: repeat(6, 76px);
    left: 6px;
    top: 8px;
  }
  .desktop-icon { width: 68px; height: 72px; }
  .pixel-icon { width: 28px; height: 28px; }
  .desktop-icon span { font-size: 9.5px; }

  .window {
    top: 8px;
    left: 4px;
    right: 4px;
    width: auto;
    max-width: calc(100vw - 8px);
  }
  .window-body { max-height: 60vh; }

  #visitor-counter { bottom: 40px; right: 6px; padding: 4px 6px; }
  .counter-digits { font-size: 13px; }

  .badge88 { width: 76px; height: 27px; font-size: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  #boot-screen, .boot-bar-fill, .winamp-marquee-track, .winamp-eq span {
    animation: none !important;
  }
  .boot-bar-fill { width: 100%; }
}