/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
  font-size: 11px;
  user-select: none;
}

/* ============================================================
   DESKTOP
   ============================================================ */
body {
  background-image: url('./assets/bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

/* ============================================================
   CRT TV EFFECT SYSTEM
   ============================================================ */

/* Barrel distortion — slight curvature like a real CRT screen */
body {
  /* We apply a very subtle perspective warp via the body itself */
}

/* The whole page content gets the CRT warp */
body > *:not(.crt-tv-frame):not(.crt-overlay):not(.crt-vignette):not(.crt-flicker):not(.crt-rgb-shift):not(.subliminal-layer) {
  /* Content sits inside the CRT "glass" */
}

/* CRT TV physical frame/bezel */
.crt-tv-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

.crt-bezel-top, .crt-bezel-bottom, .crt-bezel-left, .crt-bezel-right {
  position: absolute;
  background: #0a0a0a;
}

.crt-bezel-top {
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 60%, transparent 100%);
}

.crt-bezel-bottom {
  bottom: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(0deg, #1a1a1a 0%, #0a0a0a 60%, transparent 100%);
}

.crt-bezel-left {
  top: 0; left: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(90deg, #1a1a1a 0%, #0a0a0a 60%, transparent 100%);
}

.crt-bezel-right {
  top: 0; right: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(270deg, #1a1a1a 0%, #0a0a0a 60%, transparent 100%);
}

/* Rounded CRT corners */
.crt-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  z-index: 10001;
}

.crt-tl {
  top: 0; left: 0;
  background: radial-gradient(circle at 100% 100%, transparent 34px, #0c0c0c 35px);
}

.crt-tr {
  top: 0; right: 0;
  background: radial-gradient(circle at 0% 100%, transparent 34px, #0c0c0c 35px);
}

.crt-bl {
  bottom: 0; left: 0;
  background: radial-gradient(circle at 100% 0%, transparent 34px, #0c0c0c 35px);
}

.crt-br {
  bottom: 0; right: 0;
  background: radial-gradient(circle at 0% 0%, transparent 34px, #0c0c0c 35px);
}

/* Heavy CRT scanlines */
.crt-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9998;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 1px,
      rgba(0, 0, 0, 0.08) 1px,
      rgba(0, 0, 0, 0.08) 2px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(0, 0, 0, 0.04) 3px,
      rgba(0, 0, 0, 0.04) 6px
    );
  animation: scanline-scroll 8s linear infinite;
}

@keyframes scanline-scroll {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 0 4px, 0 12px; }
}

/* CRT vignette — dark edges, bright center */
.crt-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0, 0, 0, 0.15) 70%,
    rgba(0, 0, 0, 0.5) 90%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

/* CRT flicker — subtle brightness oscillation */
.crt-flicker {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9996;
  background: transparent;
  animation: crt-flicker-anim 0.08s infinite;
  opacity: 0.015;
}

@keyframes crt-flicker-anim {
  0%   { background: rgba(255, 255, 255, 0.03); }
  25%  { background: transparent; }
  50%  { background: rgba(255, 255, 255, 0.01); }
  75%  { background: transparent; }
  100% { background: rgba(255, 255, 255, 0.02); }
}

/* RGB chromatic aberration — triple-layer color shift */
.crt-rgb-shift {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9995;
  mix-blend-mode: screen;
  opacity: 0.025;
  animation: rgb-shift 4s ease-in-out infinite;
}

@keyframes rgb-shift {
  0%, 100% {
    box-shadow:
      -1px 0 0 rgba(255, 0, 0, 0.3) inset,
       1px 0 0 rgba(0, 0, 255, 0.3) inset;
  }
  50% {
    box-shadow:
      -2px 0 0 rgba(255, 0, 0, 0.4) inset,
       2px 0 0 rgba(0, 0, 255, 0.4) inset,
       0 1px 0 rgba(0, 255, 0, 0.2) inset;
  }
}

/* Phosphor glow on the body */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9994;
  box-shadow:
    inset 0 0 80px rgba(120, 200, 255, 0.04),
    inset 0 0 160px rgba(120, 200, 255, 0.02);
  animation: phosphor-pulse 3s ease-in-out infinite;
}

@keyframes phosphor-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.85; }
}

/* Horizontal CRT beam line — a single bright line that slowly scrolls down */
.crt-overlay::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(180deg,
    transparent,
    rgba(255, 255, 255, 0.04),
    rgba(200, 230, 255, 0.07),
    rgba(255, 255, 255, 0.04),
    transparent
  );
  animation: beam-sweep 6s linear infinite;
}

@keyframes beam-sweep {
  0%   { top: -3px; }
  100% { top: 100%; }
}

/* ============================================================
   SUBLIMINAL TEXT BACKDROP
   ============================================================ */
.subliminal-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.subliminal-text {
  position: absolute;
  font-family: 'VT323', 'Courier New', monospace;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
  opacity: 0;
  animation: subliminal-flash var(--flash-duration, 0.15s) ease-in-out var(--flash-delay, 0s) infinite;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--sub-color, rgba(255, 113, 206, 0.35));
  text-shadow:
    0 0 10px var(--sub-color, rgba(255, 113, 206, 0.3)),
    0 0 20px var(--sub-color, rgba(255, 113, 206, 0.15));
}

/* The flash: appear briefly then vanish */
@keyframes subliminal-flash {
  0%   { opacity: 0; filter: blur(3px); }
  8%   { opacity: var(--sub-opacity, 0.25); filter: blur(1.5px); }
  15%  { opacity: var(--sub-opacity, 0.25); filter: blur(2px); }
  22%  { opacity: 0; filter: blur(4px); }
  100% { opacity: 0; filter: blur(3px); }
}

/* Some variants flash in different ways */
.subliminal-text.glitch {
  animation: subliminal-glitch var(--flash-duration, 0.2s) steps(3) var(--flash-delay, 0s) infinite;
}

@keyframes subliminal-glitch {
  0%   { opacity: 0; transform: translate(0, 0) skewX(0deg); filter: blur(2px); }
  5%   { opacity: var(--sub-opacity, 0.3); transform: translate(-3px, 1px) skewX(-5deg); filter: blur(1px); }
  10%  { opacity: var(--sub-opacity, 0.3); transform: translate(2px, -1px) skewX(3deg); filter: blur(2.5px); }
  18%  { opacity: 0; transform: translate(0, 0) skewX(0deg); filter: blur(3px); }
  100% { opacity: 0; filter: blur(2px); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .subliminal-text,
  .crt-flicker,
  .crt-overlay,
  .crt-overlay::after {
    animation: none !important;
  }
  .subliminal-text {
    display: none;
  }
}

/* ============================================================
   BRANDING
   ============================================================ */
.desktop-brand {
  position: absolute;
  top: 20px;
  right: 260px;
  font-family: 'VT323', serif;
  font-size: 80px;
  color: #fff;
  text-shadow:
    0 0 12px rgba(255,255,255,0.9),
    0 0 30px rgba(255, 50, 200, 0.8),
    0 0 60px rgba(0, 255, 240, 0.5),
    2px 2px 0 rgba(0,0,0,0.5);
  letter-spacing: 4px;
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   DESKTOP ICONS
   ============================================================ */
.desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 2;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  width: 72px;
}

.desktop-icon .icon-img {
  font-size: 28px;
  position: relative;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.8));
}

.desktop-icon .rec-dot {
  position: absolute;
  top: -4px;
  right: -6px;
  font-size: 10px;
  color: #ff2200;
  text-shadow: 0 0 4px #ff2200;
}

.desktop-icon span {
  font-size: 11px;
  color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  text-align: center;
  line-height: 1.3;
}

.desktop-icon:hover .icon-img {
  filter: brightness(1.3) drop-shadow(1px 1px 0 rgba(0,0,0,0.8));
}

/* Sound Toggle */
.sound-toggle {
  position: absolute;
  bottom: 40px;
  left: 100px;
  z-index: 10;
  background: #d4d0c8;
  border: none;
  padding: 4px 10px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  cursor: pointer;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
}

.sound-toggle:active {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

/* ============================================================
   WIN98 WINDOW BASE
   ============================================================ */
.win98-window {
  position: absolute;
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  min-width: 220px;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   WIN98 TITLE BAR
   ============================================================ */
.win98-titlebar {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  color: #fff;
  font-weight: bold;
  font-size: 11px;
  padding: 3px 4px 3px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
  flex-shrink: 0;
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
}

.win98-titlebar.inactive {
  background: linear-gradient(90deg, #808080 0%, #b0b0b0 100%);
}

.win98-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  letter-spacing: 0;
}

/* Win98 title bar control buttons */
.win98-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 6px;
}

.win98-btn {
  width: 16px;
  height: 14px;
  background: #d4d0c8;
  color: #000;
  border: none;
  font-size: 10px;
  font-family: Tahoma, Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
}

.win98-btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
}

/* ============================================================
   MENU BAR
   ============================================================ */
.win98-menubar {
  background: #d4d0c8;
  padding: 2px 4px;
  display: flex;
  gap: 8px;
  font-size: 11px;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
}

.win98-menubar span {
  padding: 1px 4px;
  cursor: default;
}

.win98-menubar span:hover {
  background: #000080;
  color: #fff;
}

/* ============================================================
   WIN98 GENERIC BUTTON
   ============================================================ */
.win98-button {
  background: #d4d0c8;
  color: #000;
  border: none;
  padding: 4px 14px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  cursor: pointer;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  min-width: 70px;
}

.win98-button:active {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

/* ============================================================
   BUDDY LIST WINDOW
   ============================================================ */
.window-buddylist {
  width: 240px;
  top: 50px;
  left: 100px;
}

/* Player */
.buddy-player {
  background: #000;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 2px solid #404040;
}

.player-art-wrap {
  position: relative;
  width: 100%;
  line-height: 0;
}

.player-art {
  width: 100%;
  height: auto;
  max-height: 160px;
  object-fit: cover;
  display: block;
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: 2px solid #fff;
  padding: 8px 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  cursor: pointer;
  letter-spacing: 1px;
  white-space: nowrap;
}

.play-overlay:hover {
  background: rgba(0, 128, 255, 0.8);
}

.play-overlay.hidden {
  display: none;
}

.player-controls {
  background: #d4d0c8;
  width: 100%;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  border-top: 1px solid #808080;
}

.ctrl-btn {
  background: #d4d0c8;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  padding: 2px 6px;
  font-size: 10px;
  cursor: pointer;
  font-family: Tahoma, Arial, sans-serif;
  white-space: nowrap;
}

.ctrl-btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
}

.ctrl-play {
  font-weight: bold;
  min-width: 52px;
}

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.vol-label {
  font-size: 10px;
  color: #333;
}

.vol-slider {
  width: 60px;
  height: 16px;
  cursor: pointer;
  accent-color: #000080;
}

.player-status {
  background: #000;
  color: #00ff00;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 2px 6px;
  width: 100%;
  border-top: 1px solid #333;
}

/* Buddy tabs */
.buddy-tabs {
  display: flex;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
  padding-top: 4px;
  padding-left: 4px;
  gap: 1px;
}

.buddy-tab {
  background: #d4d0c8;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #808080;
  border-bottom: none;
  padding: 2px 10px;
  font-size: 11px;
  font-family: Tahoma, Arial, sans-serif;
  cursor: pointer;
  margin-bottom: -1px;
  color: #000;
  position: relative;
}

.buddy-tab.active {
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 1px solid #808080;
  font-weight: bold;
  z-index: 1;
  padding-bottom: 3px;
}

/* Tab content */
.buddy-tab-content {
  background: #fff;
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  border-top: 1px solid #404040;
  min-height: 80px;
}

.buddy-group-header {
  background: #d4d0c8;
  font-weight: bold;
  font-size: 11px;
  padding: 2px 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid #808080;
  cursor: pointer;
}

.buddy-list-items {
  list-style: none;
  padding: 0;
}

.buddy-item {
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
}

.buddy-item:hover {
  background: #000080;
  color: #fff;
}

.buddy-name.blue { color: #0000cc; }
.buddy-name.red { color: #990000; }
.buddy-name.green { color: #006600; }

.buddy-item:hover .buddy-name { color: #fff !important; }

.track-list {
  padding: 2px 4px;
}

.track-item {
  padding: 2px 4px;
  font-size: 11px;
  cursor: pointer;
  color: #333;
}

.track-item:hover {
  background: #000080;
  color: #fff;
}

.track-item.active {
  color: #000080;
  font-weight: bold;
}

.no-requests {
  color: #666;
  font-style: italic;
  font-size: 11px;
  padding: 6px 8px;
  text-align: center;
}

.request-art-wrap {
  display: flex;
  justify-content: center;
  padding: 8px;
}

.request-art {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border: 2px solid #808080;
}

/* ============================================================
   INSTANT MESSAGE WINDOW
   ============================================================ */
.window-im {
  width: 340px;
  top: 80px;
  left: 270px;
}

/* Info bar */
.im-infobar {
  background: #ffffc0;
  border-bottom: 1px solid #e0e000;
  padding: 3px 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.im-infobar-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  color: #666;
  padding: 0 2px;
  line-height: 1;
}

.im-infobar-close:hover { color: #000; }

/* Chat area */
.im-chat {
  background: #fff;
  height: 200px;
  overflow-y: auto;
  padding: 6px 8px;
  border-top: 1px solid #404040;
  border-bottom: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #ffffff;
  margin: 4px 4px 0;
  font-size: 12px;
  line-height: 1.5;
}

.chat-system {
  color: #666;
  font-style: italic;
  text-align: center;
  margin: 3px 0;
  font-size: 11px;
}

.chat-msg {
  margin: 2px 0;
  word-wrap: break-word;
  font-size: 12px;
  color: #000;
}

.chat-user {
  font-weight: bold;
}

.chat-user.blue { color: #0000cc; }
.chat-user.red { color: #990000; }
.chat-user.purple { color: #660099; }

/* Formatting toolbar */
.im-toolbar {
  background: #d4d0c8;
  padding: 3px 4px;
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #808080;
  margin: 0 4px;
  flex-shrink: 0;
}

.fmt-btn {
  background: #d4d0c8;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #404040;
  border-bottom: 1px solid #404040;
  padding: 1px 5px;
  font-size: 11px;
  font-family: Tahoma, Arial, sans-serif;
  cursor: pointer;
  min-width: 20px;
}

.fmt-btn:active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
}

.fmt-btn.active {
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  background: #c0c0c0;
}

/* Input area */
.im-input-area {
  margin: 0 4px;
  flex-shrink: 0;
}

.im-input {
  width: 100%;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  padding: 4px 6px;
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  resize: none;
  outline: none;
  background: #fff;
  color: #000;
  line-height: 1.4;
}

.im-send-bar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 6px;
  gap: 4px;
  flex-shrink: 0;
}

/* ============================================================
   TIPS.exe WINDOW
   ============================================================ */
.window-tips {
  width: 240px;
  top: 110px;
  right: 20px;
  left: auto;
}

@media (min-width: 769px) {
  .window-tips {
    right: 20px;
    left: auto;
  }
}

/* Tips crypto tabs */
.tips-tabs {
  display: flex;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
  padding-top: 4px;
  padding-left: 4px;
  gap: 1px;
}

.tips-tab {
  background: #d4d0c8;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #808080;
  border-bottom: none;
  padding: 3px 8px;
  font-size: 10px;
  font-family: Tahoma, Arial, sans-serif;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: -1px;
  color: #000;
  position: relative;
  white-space: nowrap;
}

.tips-tab.active {
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 1px solid #808080;
  z-index: 1;
  padding-bottom: 4px;
}

.tips-tab-content {
  flex: 1;
  overflow-y: auto;
}

.tips-body {
  background: #d4d0c8;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.tips-network-label {
  font-size: 11px;
  font-weight: bold;
  color: #000080;
  text-align: center;
}

.tips-compat-networks {
  background: #fffff0;
  border: 1px solid #e0e0a0;
  padding: 4px 6px;
  font-size: 9px;
  color: #444;
  text-align: center;
  line-height: 1.4;
  border-radius: 0;
}

.tips-compat-networks strong {
  color: #000080;
}

.qr-wrap {
  display: flex;
  justify-content: center;
}

.qr-container {
  position: relative;
  width: 160px;
  height: 160px;
  border: 3px solid #808080;
  border-top: 3px solid #404040;
  border-left: 3px solid #404040;
  background: #fff;
}

.qr-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.crypto-logo-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  font-family: Arial, sans-serif;
}

.tips-address {
  font-family: 'VT323', 'Courier New', monospace;
  font-size: 13px;
  color: #333;
  text-align: center;
  cursor: default;
  letter-spacing: 0.5px;
}

.tips-copy-btn {
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  padding: 3px 10px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.tips-copy-btn:active {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.tips-copy-btn.copied {
  color: #006600;
}

.tips-footer {
  background: #d4d0c8;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #808080;
  flex-shrink: 0;
}

.tips-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  cursor: pointer;
}

/* ============================================================
   PARENTAL ADVISORY
   ============================================================ */
.parental-advisory {
  position: absolute;
  bottom: 48px;
  right: 20px;
  z-index: 5;
}

.pa-inner {
  background: #000;
  color: #fff;
  border: 4px solid #fff;
  outline: 4px solid #000;
  padding: 10px 14px;
  text-align: center;
  width: 160px;
}

.pa-top {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.2;
}

.pa-middle {
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.2;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
  margin: 4px 0;
  padding: 3px 0;
}

.pa-bottom {
  font-size: 8px;
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 1px;
  line-height: 1.4;
}

/* ============================================================
   TASKBAR
   ============================================================ */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 32px;
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px;
  z-index: 1000;
  box-shadow: 0 -1px 0 #808080;
}

.start-btn {
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  padding: 2px 8px;
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
}

.start-btn:active {
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.start-logo {
  font-size: 14px;
}

.taskbar-divider {
  width: 2px;
  height: 24px;
  background: #808080;
  border-right: 1px solid #fff;
  margin: 0 3px;
}

.taskbar-windows {
  display: flex;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.taskbar-win-btn {
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  padding: 2px 8px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  cursor: pointer;
  height: 24px;
  min-width: 100px;
  max-width: 150px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskbar-win-btn.active {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  background: #c0c0c0;
}

.taskbar-win-btn.minimized {
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  background: #d4d0c8;
}

.taskbar-tray {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding: 0 4px;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  height: 24px;
  gap: 8px;
}

.tray-clock {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  color: #000;
  white-space: nowrap;
}

/* ============================================================
   START MENU
   ============================================================ */
.start-menu {
  position: fixed;
  bottom: 32px;
  left: 0;
  width: 200px;
  background: #d4d0c8;
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  z-index: 2000;
  box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
}

.start-menu-header {
  background: linear-gradient(180deg, #000080 0%, #1084d0 100%);
  color: #fff;
  padding: 8px 8px 8px 12px;
  font-weight: bold;
  font-family: 'VT323', monospace;
  font-size: 22px;
  letter-spacing: 2px;
}

.start-menu-items {
  list-style: none;
  padding: 2px 0;
}

.start-menu-items li {
  padding: 4px 12px;
  font-size: 11px;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 8px;
}

.start-menu-items li:hover {
  background: #000080;
  color: #fff;
}

.start-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.start-separator {
  height: 1px;
  background: #808080;
  margin: 2px 4px;
  border-bottom: 1px solid #ffffff;
  padding: 0 !important;
}

.start-separator:hover {
  background: #808080 !important;
}

/* ============================================================
   CASCADING START SUBMENUS
   ============================================================ */
.has-submenu {
  position: relative;
}

.submenu-arrow {
  margin-left: auto;
  font-size: 10px;
}

.start-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  width: 180px;
  background: #d4d0c8;
  border: 2px solid;
  border-color: #ffffff #404040 #404040 #ffffff;
  box-shadow: 3px 3px 5px rgba(0,0,0,0.5);
  list-style: none;
  padding: 2px 0;
  z-index: 2001;
}

.start-submenu li {
  padding: 4px 12px;
  font-size: 11px;
  cursor: default;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.start-submenu li:hover {
  background: #000080;
  color: #fff;
}

.has-submenu:hover > .start-submenu {
  display: block;
}

/* ============================================================
   GAME WINDOWS
   ============================================================ */
.window-snake {
  width: 332px;
}

.window-breakout {
  width: 372px;
}

.window-minesweeper {
  width: auto;
}

.game-canvas-wrap {
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  line-height: 0;
}

.game-canvas-wrap canvas {
  display: block;
}

.game-statusbar {
  background: #d4d0c8;
  padding: 2px 6px;
  font-size: 11px;
  font-family: Tahoma, Arial, sans-serif;
  border-top: 1px solid #808080;
  min-height: 18px;
}

.game-menubar span {
  cursor: default;
}

/* ============================================================
   MINESWEEPER SPECIFIC
   ============================================================ */
.ms-header {
  background: #d4d0c8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-bottom: 2px solid #808080;
  border-top: 2px solid #404040;
  margin: 4px;
  border-left: 2px solid #404040;
  border-right: 2px solid #808080;
  background: #c0c0c0;
}

.ms-counter {
  background: #000;
  color: #ff0000;
  font-family: 'VT323', monospace;
  font-size: 24px;
  padding: 2px 4px;
  min-width: 42px;
  text-align: center;
  border-top: 2px solid #404040;
  border-left: 2px solid #404040;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  letter-spacing: 2px;
}

.ms-smiley {
  width: 28px;
  height: 28px;
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.ms-smiley:active {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.ms-board {
  display: grid;
  grid-template-columns: repeat(9, 20px);
  grid-template-rows: repeat(9, 20px);
  gap: 0;
  margin: 0 4px 4px 4px;
  padding: 0;
  border-top: 3px solid #808080;
  border-left: 3px solid #808080;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  background: #c0c0c0;
}

.ms-cell {
  width: 20px;
  height: 20px;
  background: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  font-family: Tahoma, Arial, sans-serif;
  cursor: pointer;
  user-select: none;
  padding: 0;
  line-height: 1;
}

.ms-cell.revealed {
  border: 1px solid #808080;
  background: #c0c0c0;
  cursor: default;
}

.ms-cell.mine-exploded {
  background: #ff0000;
  border: 1px solid #808080;
}

.ms-cell .num-1 { color: #0000ff; }
.ms-cell .num-2 { color: #008000; }
.ms-cell .num-3 { color: #ff0000; }
.ms-cell .num-4 { color: #000080; }
.ms-cell .num-5 { color: #800000; }
.ms-cell .num-6 { color: #008080; }
.ms-cell .num-7 { color: #000000; }
.ms-cell .num-8 { color: #808080; }

/* ============================================================
   SCROLLBARS — Win98 style
   ============================================================ */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  background: #d4d0c8;
}

::-webkit-scrollbar-thumb {
  background: #d4d0c8;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
}

::-webkit-scrollbar-button {
  background: #d4d0c8;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  height: 16px;
  width: 16px;
}

/* ============================================================
   WINDOW DRAGGING
   ============================================================ */
.win98-window.dragging {
  opacity: 0.9;
  z-index: 500 !important;
}

.win98-window.focused {
  z-index: 200;
}

/* ============================================================
   RESPONSIVE (mobile)
   ============================================================ */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
  }

  .win98-window {
    position: static !important;
    width: 100% !important;
    margin: 8px 0;
    left: 0 !important;
    top: 0 !important;
  }

  .desktop-icons {
    display: none;
  }

  .parental-advisory {
    position: static;
    margin: 8px auto;
  }

  .window-tips {
    width: 100% !important;
  }

  .taskbar {
    position: fixed;
  }

  .desktop-brand {
    font-size: 40px;
    top: 10px;
    right: 10px;
  }

  .sound-toggle {
    top: auto;
    right: auto;
    bottom: 40px;
    left: 8px;
  }
}

/* ============================================================
   FORUM / BBS WINDOW
   ============================================================ */
.window-forum {
  width: 500px;
  height: 420px;
}

.forum-body {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  border: 2px inset #808080;
  margin: 2px;
}

/* Thread List View */
.forum-thread-list {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.forum-header-row {
  display: flex;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.forum-header-row span {
  padding: 3px 6px;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #404040;
  border-top: 1px solid #fff;
  background: #d4d0c8;
}

.forum-col-subject { flex: 2; min-width: 0; }
.forum-col-author { flex: 1; min-width: 0; }
.forum-col-replies { width: 52px; flex-shrink: 0; text-align: center; }
.forum-col-last { flex: 1; min-width: 0; }

.forum-thread-rows {
  flex: 1;
  overflow-y: auto;
}

.forum-thread-row {
  display: flex;
  font-size: 11px;
  cursor: pointer;
  border-bottom: 1px solid #e0e0e0;
}

.forum-thread-row:nth-child(even) {
  background: #f0f0f0;
}

.forum-thread-row:nth-child(odd) {
  background: #fff;
}

.forum-thread-row:hover {
  background: #000080;
  color: #fff;
}

.forum-thread-row span {
  padding: 3px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  background: #d4d0c8;
  border-top: 1px solid #808080;
  flex-shrink: 0;
}

.forum-thread-count {
  font-size: 11px;
  color: #444;
}

/* Thread View */
.forum-thread-view {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.forum-back-link {
  padding: 4px 8px;
  font-size: 11px;
  color: #0000cc;
  cursor: pointer;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
}

.forum-back-link:hover {
  text-decoration: underline;
}

.forum-thread-title {
  font-size: 12px;
  font-weight: bold;
  padding: 6px 8px 4px;
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  flex-shrink: 0;
}

.forum-posts {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.forum-post {
  background: #fff;
  border: 1px solid #808080;
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  margin-bottom: 4px;
  padding: 4px 6px;
}

.forum-post-author {
  font-weight: bold;
  font-size: 11px;
}

.forum-post-time {
  font-size: 10px;
  color: #888;
  margin-left: 8px;
}

.forum-post-text {
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.4;
  color: #000;
  word-wrap: break-word;
}

/* Reply / New Thread Form */
.forum-reply-section {
  background: #d4d0c8;
  border-top: 1px solid #808080;
  padding: 6px;
  flex-shrink: 0;
}

.forum-reply-section label {
  font-size: 11px;
  display: block;
  margin-bottom: 2px;
}

.forum-input {
  width: 100%;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  padding: 2px 4px;
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  background: #fff;
  color: #000;
  outline: none;
  margin-bottom: 4px;
}

.forum-textarea {
  width: 100%;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  padding: 2px 4px;
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  background: #fff;
  color: #000;
  outline: none;
  resize: none;
  margin-bottom: 4px;
  height: 50px;
}

.forum-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

/* New Thread View */
.forum-new-thread {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.forum-new-thread .forum-reply-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.forum-new-thread .forum-textarea {
  flex: 1;
  height: auto;
  min-height: 60px;
}

/* AIM-era name colors */
.forum-name-blue { color: #0000cc; }
.forum-name-red { color: #990000; }
.forum-name-green { color: #006600; }
.forum-name-purple { color: #660099; }

/* ── Discord OAuth / Auth Bar ─────────────────────────── */
.forum-auth-bar {
  background: #d4d0c8;
  border-bottom: 1px solid #808080;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 11px;
}

.forum-auth-bar .auth-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.forum-auth-bar .auth-status .discord-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #808080;
  flex-shrink: 0;
}

.forum-auth-bar .auth-username {
  font-weight: bold;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-auth-bar .auth-display-name {
  color: #444;
  font-style: italic;
  white-space: nowrap;
}

.discord-login-btn {
  background: #5865F2;
  color: #fff;
  border: 2px outset #7983f5;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.discord-login-btn:hover {
  background: #4752c4;
}

.discord-login-btn:active {
  border-style: inset;
}

.discord-login-btn .discord-icon {
  width: 14px;
  height: 14px;
}

.forum-auth-logout {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 10px;
  background: #d4d0c8;
  border: 1px outset #fff;
  cursor: pointer;
  padding: 1px 6px;
  color: #444;
  flex-shrink: 0;
}

.forum-auth-logout:hover {
  color: #000;
}

.forum-auth-logout:active {
  border-style: inset;
}

/* ── Login Gate Overlay ─────────────────────────────────── */
.forum-login-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 10px;
  text-align: center;
}

.forum-login-gate .gate-icon {
  font-size: 28px;
  opacity: 0.6;
}

.forum-login-gate .gate-text {
  font-size: 11px;
  color: #444;
  line-height: 1.5;
}

.forum-login-gate .discord-login-btn {
  font-size: 12px;
  padding: 4px 14px;
}

/* ── Display Name Picker ────────────────────────────────── */
.forum-name-picker {
  background: #ece9d8;
  border: 2px outset #fff;
  padding: 8px;
  margin-bottom: 6px;
}

.forum-name-picker .picker-title {
  font-size: 11px;
  font-weight: bold;
  margin-bottom: 6px;
}

.forum-name-picker .picker-options {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 6px;
}

.forum-name-picker label {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.forum-name-picker label input[type="radio"] {
  margin: 0;
}

.forum-name-picker .custom-name-input {
  width: 140px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  padding: 1px 3px;
  border-top: 1px solid #404040;
  border-left: 1px solid #404040;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  background: #fff;
  margin-left: 2px;
}

.forum-name-picker .custom-name-input:disabled {
  background: #d4d0c8;
  color: #888;
}

.forum-name-picker .picker-save-btn {
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  padding: 2px 12px;
}
