:root {
  /* Fonts */
  --font-system: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-xs: 11px;
  --font-sm: 12px;
  --font-md: 13px;
  --font-lg: 14px;
  --font-xl: 16px;

  /* Normal State Colors (Acts 1-2) */
  --os-bg: #1a1a2e;
  --os-taskbar: #16213e;
  --os-window-bg: #0f0f1a;
  --os-window-header: #1a1a3e;
  --os-text: #c8c8d4;
  --os-text-bright: #e8e8f0;
  --os-accent: #4a6fa5;
  --os-accent-hover: #5a8fbf;
  --os-border: #2a2a4a;
  --os-error: #a54a4a;
  --os-success: #4a8a5a;
  --os-highlight: #2a3a5e;
}

/* Splash Screens */
#splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#splash-overlay.hidden { display: none; }

.splash-card {
  position: absolute;
  color: #fff;
  font-family: var(--font-system);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 2px;
  opacity: 0;
  user-select: none;
}

.splash-card.fade-in {
  animation: splashFade 3s ease forwards;
}

@keyframes splashFade {
  0%   { opacity: 0; }
  30%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Desktop */
#desktop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 40px);
  background: var(--os-bg);
  overflow: hidden;
}

#wallpaper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  transition: all 2s ease;
}

/* Wallpaper States */
.wallpaper-morning {
  background:
    radial-gradient(ellipse at 50% 120%, #2d5a27 0%, transparent 60%),
    radial-gradient(circle at 30% 80%, #1a3d15 0%, transparent 30%),
    radial-gradient(circle at 70% 85%, #1a3d15 0%, transparent 25%),
    radial-gradient(circle at 50% 30%, rgba(255,255,200,0.1) 0%, transparent 40%),
    radial-gradient(circle at 45% 25%, rgba(255,255,180,0.08) 0%, transparent 20%),
    linear-gradient(180deg, #1a2a4a 0%, #2a3a5a 40%, #1a3d15 100%);
}

.wallpaper-dusk {
  background:
    radial-gradient(ellipse at 50% 120%, #1a3a15 0%, transparent 60%),
    radial-gradient(circle at 30% 80%, #0f2a0d 0%, transparent 30%),
    radial-gradient(circle at 70% 85%, #0f2a0d 0%, transparent 25%),
    radial-gradient(circle at 80% 20%, rgba(180,100,50,0.08) 0%, transparent 30%),
    linear-gradient(180deg, #1a1a3a 0%, #2a1a3a 40%, #0f2a0d 100%);
}

.wallpaper-night {
  background:
    radial-gradient(ellipse at 50% 120%, #0a1a08 0%, transparent 60%),
    radial-gradient(circle at 25% 75%, #050f04 0%, transparent 25%),
    radial-gradient(circle at 60% 80%, #050f04 0%, transparent 30%),
    radial-gradient(circle at 75% 78%, #050f04 0%, transparent 20%),
    linear-gradient(180deg, #0a0a1a 0%, #0a0a15 50%, #050f04 100%);
}

.wallpaper-dark-forest {
  background:
    radial-gradient(ellipse at 50% 120%, #050a04 0%, transparent 60%),
    radial-gradient(circle at 20% 70%, #030803 0%, transparent 20%),
    radial-gradient(circle at 50% 65%, #030803 0%, transparent 15%),
    radial-gradient(circle at 80% 72%, #030803 0%, transparent 18%),
    radial-gradient(ellipse at 50% 75%, rgba(100,120,100,0.03) 0%, transparent 40%),
    linear-gradient(180deg, #050510 0%, #030308 50%, #030803 100%);
}

.wallpaper-wrong {
  background:
    radial-gradient(ellipse at 50% 120%, #030503 0%, transparent 60%),
    radial-gradient(circle at 15% 65%, #020402 0%, transparent 18%),
    radial-gradient(circle at 35% 60%, #020402 0%, transparent 12%),
    radial-gradient(circle at 55% 58%, #020402 0%, transparent 20%),
    radial-gradient(circle at 75% 62%, #020402 0%, transparent 15%),
    radial-gradient(circle at 85% 68%, #020402 0%, transparent 14%),
    radial-gradient(ellipse at 50% 60%, rgba(60,80,60,0.04) 0%, transparent 10%),
    linear-gradient(180deg, #020208 0%, #010104 50%, #020402 100%);
}

.wallpaper-void {
  background: #0a0a0a;
}

/* Desktop Icons */
#desktop-icons {
  position: relative;
  z-index: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 8px;
  height: 100%;
  align-content: flex-start;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 80px;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.desktop-icon:hover {
  background: rgba(255,255,255,0.06);
}

.desktop-icon.selected {
  background: rgba(74,111,165,0.3);
}

.desktop-icon .icon-image {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 4px;
  transition: transform 0.15s;
}

.desktop-icon:hover .icon-image {
  transform: scale(1.05);
}

.desktop-icon .icon-label {
  font-size: var(--font-sm);
  color: var(--os-text-bright);
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  word-wrap: break-word;
  max-width: 76px;
  line-height: 1.3;
}

.icon-browse { background: linear-gradient(135deg, #4a6fa5, #2a4a7a); }
.icon-mail { background: linear-gradient(135deg, #4a8a8a, #2a5a6a); }
.icon-chat { background: linear-gradient(135deg, #7a5aa5, #4a2a7a); }
.icon-note { background: linear-gradient(135deg, #a5a54a, #7a7a2a); }
.icon-wave { background: linear-gradient(135deg, #4aa56a, #2a7a4a); }
.icon-term { background: linear-gradient(135deg, #3a3a3a, #1a1a1a); border: 1px solid #4a8a4a; }

/* Taskbar */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: var(--os-taskbar);
  border-top: 1px solid var(--os-border);
  display: flex;
  align-items: center;
  z-index: 9000;
}

#start-button {
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-md);
  color: var(--os-text);
  border-right: 1px solid var(--os-border);
  transition: background 0.15s;
}

#start-button:hover {
  background: rgba(255,255,255,0.06);
}

#start-button .start-icon {
  font-size: 16px;
}

/* Start Menu */
#start-menu {
  position: fixed;
  bottom: 40px;
  left: 0;
  width: 220px;
  background: var(--os-window-bg);
  border: 1px solid var(--os-border);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  z-index: 9500;
  display: none;
  overflow: hidden;
}

#start-menu.visible {
  display: block;
}

#start-menu .menu-header {
  padding: 12px 14px;
  font-size: var(--font-sm);
  color: var(--os-accent);
  border-bottom: 1px solid var(--os-border);
  font-weight: 500;
}

#start-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: var(--font-md);
  color: var(--os-text);
  cursor: pointer;
  transition: background 0.15s;
}

#start-menu .menu-item:hover {
  background: var(--os-highlight);
}

#start-menu .menu-item .mi-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

#start-menu .menu-divider {
  height: 1px;
  background: var(--os-border);
  margin: 4px 0;
}

/* Taskbar Tabs */
#taskbar-tabs {
  flex: 1;
  display: flex;
  align-items: center;
  height: 100%;
  overflow-x: auto;
  padding: 0 4px;
  gap: 2px;
}

.taskbar-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 32px;
  border-radius: 4px;
  font-size: var(--font-sm);
  color: var(--os-text);
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
}

.taskbar-tab:hover {
  background: rgba(255,255,255,0.06);
}

.taskbar-tab.active {
  background: var(--os-highlight);
  color: var(--os-text-bright);
}

.taskbar-tab .tab-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.taskbar-tab .tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* System Tray */
#system-tray {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  height: 100%;
  border-left: 1px solid var(--os-border);
  font-size: var(--font-xs);
  color: var(--os-text);
}

.tray-icon {
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.tray-icon:hover {
  background: rgba(255,255,255,0.06);
}

#tray-clock {
  padding: 4px 8px;
  font-size: var(--font-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}

#tray-clock:hover {
  background: rgba(255,255,255,0.06);
}

.tray-icon .notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  background: var(--os-error);
  border-radius: 50%;
  display: none;
}

.tray-icon .notification-dot.visible {
  display: block;
}

/* Tray Popups */
.tray-popup {
  position: fixed;
  bottom: 44px;
  background: var(--os-window-bg);
  border: 1px solid var(--os-border);
  border-radius: 8px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  min-width: 300px;
  max-width: 340px;
  z-index: 9999;
  animation: trayPopupIn 0.15s ease-out;
  overflow: hidden;
}

@keyframes trayPopupIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tray-popup-header {
  padding: 14px 16px 10px;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--os-text-bright);
  border-bottom: 1px solid var(--os-border);
}

.tray-popup-subtext {
  font-size: var(--font-sm);
  font-weight: 300;
  color: var(--os-text);
  margin-top: 2px;
}

.tray-popup-section {
  padding: 10px 16px;
}

.tray-popup-section-title {
  font-size: var(--font-xs);
  color: var(--os-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.tray-popup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: default;
  font-size: var(--font-md);
  color: var(--os-text);
  transition: background 0.12s;
}

.tray-popup-item:hover {
  background: var(--os-highlight);
}

.tray-popup-item .item-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.tray-popup-item .item-meta {
  margin-left: auto;
  font-size: var(--font-xs);
  color: #666;
}

.tray-popup-divider {
  height: 1px;
  background: var(--os-border);
  margin: 2px 0;
}

.tray-popup-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--os-border);
  text-align: center;
}

.tray-popup-btn {
  background: none;
  border: 1px solid var(--os-border);
  color: var(--os-text);
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: var(--font-sm);
  font-family: var(--font-system);
  transition: background 0.12s;
}

.tray-popup-btn:hover {
  background: var(--os-highlight);
}

.tray-popup.shake {
  animation: windowShake 0.4s ease;
}

/* Calendar */
.tray-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 4px 0;
}

.cal-header {
  font-size: var(--font-xs);
  color: #666;
  text-align: center;
  padding: 4px 0;
  font-weight: 500;
}

.cal-day {
  text-align: center;
  padding: 5px 0;
  font-size: var(--font-sm);
  color: var(--os-text);
  border-radius: 4px;
}

.cal-day.today {
  background: var(--os-accent);
  color: #fff;
  font-weight: 600;
}

.cal-day.other-month {
  color: #444;
}

.cal-day.empty {
  visibility: hidden;
}

/* Clock popup time display */
.clock-time-display {
  font-size: 36px;
  font-weight: 300;
  color: var(--os-text-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.clock-date-display {
  font-size: var(--font-md);
  color: var(--os-text);
  margin-top: 2px;
}

/* Network items */
.network-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.12s;
}

.network-item:hover {
  background: var(--os-highlight);
}

.network-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.network-info {
  flex: 1;
}

.network-name {
  font-size: var(--font-md);
  color: var(--os-text-bright);
}

.network-status {
  font-size: var(--font-xs);
  color: #666;
}

.network-badge {
  font-size: var(--font-xs);
  color: var(--os-success);
}

/* WiFi toggle */
.wifi-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.toggle-switch {
  width: 36px;
  height: 20px;
  background: var(--os-accent);
  border-radius: 10px;
  position: relative;
  cursor: default;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 18px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}

.toggle-switch.off {
  background: #555;
}

.toggle-switch.off::after {
  left: 2px;
}

/* Battery display */
.battery-display {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.battery-pct {
  font-size: 32px;
  font-weight: 300;
  color: var(--os-text-bright);
  min-width: 80px;
}

.battery-bar-outer {
  flex: 1;
  height: 12px;
  background: #2a2a3a;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--os-border);
}

.battery-bar-inner {
  height: 100%;
  background: var(--os-success);
  border-radius: 6px;
  transition: width 0.3s;
}

.battery-bar-inner.low {
  background: var(--os-error);
}

.battery-bar-inner.medium {
  background: #a58a4a;
}

.battery-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: var(--font-sm);
  color: var(--os-text);
}

.battery-detail-row .detail-label {
  color: #888;
}

/* Notification item */
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 4px;
  cursor: default;
  transition: background 0.12s;
}

.notif-item:hover {
  background: var(--os-highlight);
}

.notif-item .notif-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.notif-item .notif-body {
  flex: 1;
}

.notif-item .notif-title {
  font-size: var(--font-md);
  color: var(--os-text-bright);
  margin-bottom: 2px;
}

.notif-item .notif-desc {
  font-size: var(--font-xs);
  color: #888;
}

.notif-item .notif-time {
  font-size: var(--font-xs);
  color: #555;
  flex-shrink: 0;
  padding-top: 2px;
}

.no-notifications {
  text-align: center;
  padding: 20px 10px;
  color: #666;
  font-size: var(--font-sm);
}

/* Windows */
.app-window {
  position: absolute;
  background: var(--os-window-bg);
  border: 1px solid var(--os-border);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  min-width: 400px;
  min-height: 300px;
  overflow: hidden;
}

.app-window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
}

.app-window.minimized {
  display: none;
}

.window-header {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 8px 0 12px;
  background: var(--os-window-header);
  border-bottom: 1px solid var(--os-border);
  flex-shrink: 0;
  cursor: default;
}

.window-header .wh-icon {
  font-size: 14px;
  margin-right: 8px;
}

.window-header .wh-title {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--os-text-bright);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  display: flex;
  gap: 2px;
}

.window-controls button {
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 12px;
  color: var(--os-text);
  transition: background 0.15s, color 0.15s;
}

.window-controls button:hover {
  background: rgba(255,255,255,0.1);
}

.window-controls .wc-close:hover {
  background: var(--os-error);
  color: #fff;
}

.window-body {
  flex: 1;
  overflow: auto;
  position: relative;
}

/* Resize handles */
.app-window .resize-handle {
  position: absolute;
  z-index: 10;
}

.resize-handle.r-top { top: 0; left: 6px; right: 6px; height: 4px; cursor: ns-resize; }
.resize-handle.r-bottom { bottom: 0; left: 6px; right: 6px; height: 4px; cursor: ns-resize; }
.resize-handle.r-left { top: 6px; left: 0; width: 4px; bottom: 6px; cursor: ew-resize; }
.resize-handle.r-right { top: 6px; right: 0; width: 4px; bottom: 6px; cursor: ew-resize; }
.resize-handle.r-top-left { top: 0; left: 0; width: 8px; height: 8px; cursor: nwse-resize; }
.resize-handle.r-top-right { top: 0; right: 0; width: 8px; height: 8px; cursor: nesw-resize; }
.resize-handle.r-bottom-left { bottom: 0; left: 0; width: 8px; height: 8px; cursor: nesw-resize; }
.resize-handle.r-bottom-right { bottom: 0; right: 0; width: 8px; height: 8px; cursor: nwse-resize; }

/* Notification Toasts */
#notification-container {
  position: fixed;
  bottom: 48px;
  right: 12px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 9800;
  pointer-events: none;
}

.notification-toast {
  background: var(--os-window-bg);
  border: 1px solid var(--os-border);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 280px;
  max-width: 340px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: auto;
  animation: toast-in 0.3s ease-out;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
}

.notification-toast.exiting {
  opacity: 0;
  transform: translateX(100%);
}

.notification-toast .nt-title {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--os-text-bright);
  margin-bottom: 4px;
}

.notification-toast .nt-body {
  font-size: var(--font-xs);
  color: var(--os-text);
  line-height: 1.4;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Content Warning Screen */
#content-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

/* CRT frame */
.cw-crt {
  position: relative;
  max-width: 700px;
  width: 90%;
}

.cw-crt-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Screen overlay - positioned over the CRT's screen area */
.cw-screen {
  position: absolute;
  top: 8%;
  left: 12%;
  right: 12%;
  bottom: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

.cw-screen-title {
  font-family: var(--font-mono);
  font-size: clamp(14px, 3vw, 22px);
  color: #33ff33;
  letter-spacing: 2px;
  margin-bottom: 4px;
  text-shadow: 0 0 8px rgba(51,255,51,0.4);
  flex-shrink: 0;
}

.cw-cursor {
  animation: cursorBlink 1s step-end infinite;
  font-size: clamp(12px, 2.5vw, 18px);
  margin-left: 2px;
  position: relative;
  top: -3px;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.cw-screen-tagline {
  font-size: clamp(9px, 1.5vw, 12px);
  color: #888;
  font-style: italic;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.cw-divider {
  width: 60%;
  height: 1px;
  background: rgba(51,255,51,0.15);
  margin-bottom: 8px;
  flex-shrink: 0;
}

#content-warning .cw-columns {
  display: flex;
  gap: 16px;
  width: 100%;
  margin-bottom: 10px;
  text-align: left;
  flex-shrink: 0;
}

#content-warning .cw-col {
  flex: 1;
}

#content-warning .cw-col-header {
  font-size: clamp(9px, 1.4vw, 12px);
  color: #33ff33;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(51,255,51,0.15);
  text-shadow: 0 0 6px rgba(51,255,51,0.3);
}

#content-warning .cw-list {
  line-height: 1.5;
  font-size: clamp(8px, 1.3vw, 11px);
  color: #aab4a8;
}

#content-warning .cw-recommend {
  line-height: 1.5;
  font-size: clamp(8px, 1.3vw, 11px);
  color: #aab4a8;
  margin-bottom: 4px;
}

#content-warning .cw-note {
  font-size: clamp(7px, 1vw, 10px);
  color: #556655;
}

#content-warning .cw-button {
  padding: 8px 24px;
  background: transparent;
  color: #33ff33;
  border: 1px solid rgba(51,255,51,0.4);
  border-radius: 4px;
  font-size: clamp(10px, 1.4vw, 12px);
  font-family: var(--font-mono);
  font-weight: 500;
  transition: all 0.2s;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(51,255,51,0.3);
  cursor: pointer;
  flex-shrink: 0;
}

#content-warning .cw-button:hover {
  background: rgba(51,255,51,0.1);
  border-color: #33ff33;
  box-shadow: 0 0 12px rgba(51,255,51,0.2);
}

#content-warning .cw-credits {
  margin-top: 6px;
  font-size: clamp(7px, 1vw, 10px);
  color: #445544;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* Continue/New Game Modal */
#save-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99998;
}

#save-modal .modal-box {
  background: var(--os-window-bg);
  border: 1px solid var(--os-border);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  max-width: 360px;
}

#save-modal h3 {
  font-size: var(--font-xl);
  color: var(--os-text-bright);
  margin-bottom: 12px;
}

#save-modal p {
  font-size: var(--font-sm);
  color: var(--os-text);
  margin-bottom: 24px;
}

#save-modal .modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

#save-modal .modal-buttons button {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: var(--font-md);
  transition: background 0.2s;
}

#save-modal .btn-continue {
  background: var(--os-accent);
  color: var(--os-text-bright);
}

#save-modal .btn-continue:hover {
  background: var(--os-accent-hover);
}

#save-modal .btn-new {
  background: var(--os-border);
  color: var(--os-text);
}

#save-modal .btn-new:hover {
  background: #3a3a5a;
}

/* Settings Panel */
.settings-content {
  padding: 20px;
}

.settings-content .setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--os-border);
}

.settings-content .setting-label {
  font-size: var(--font-md);
  color: var(--os-text);
}

.settings-content select,
.settings-content input[type="range"] {
  background: var(--os-bg);
  color: var(--os-text);
  border: 1px solid var(--os-border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: var(--font-sm);
}

/* Error Dialog */
.error-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--os-window-bg);
  border: 1px solid var(--os-error);
  border-radius: 8px;
  padding: 24px;
  min-width: 320px;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.error-dialog .ed-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.error-dialog .ed-message {
  font-size: var(--font-md);
  color: var(--os-text);
  margin-bottom: 20px;
  line-height: 1.5;
}

.error-dialog .ed-button {
  padding: 8px 24px;
  background: var(--os-border);
  color: var(--os-text);
  border-radius: 4px;
  font-size: var(--font-sm);
  transition: background 0.2s;
}

.error-dialog .ed-button:hover {
  background: #3a3a5a;
}

/* Mobile Warning */
#mobile-warning {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #0a0a0a;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

#mobile-warning h2 {
  font-size: 18px;
  color: var(--os-text-bright);
  margin-bottom: 16px;
}

#mobile-warning p {
  font-size: var(--font-md);
  color: var(--os-text);
  line-height: 1.6;
}

@media (max-width: 768px) {
  #mobile-warning { display: flex; flex-direction: column; }
  #desktop, #taskbar, #content-warning { display: none !important; }
}

/* Context Menu */
#context-menu {
  position: fixed;
  background: var(--os-window-bg);
  border: 1px solid var(--os-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  min-width: 160px;
  padding: 4px 0;
  z-index: 9900;
  display: none;
}

#context-menu.visible {
  display: block;
}

.ctx-item {
  padding: 8px 16px;
  font-size: var(--font-sm);
  color: var(--os-text);
  cursor: pointer;
  transition: background 0.1s;
}

.ctx-item:hover {
  background: var(--os-highlight);
}

.ctx-divider {
  height: 1px;
  background: var(--os-border);
  margin: 4px 0;
}

/* BSOD / Ending Screens */
#ending-screen {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #000;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#ending-screen.visible {
  display: flex;
}

#ending-screen .ending-text {
  font-family: var(--font-mono);
  font-size: var(--font-md);
  color: var(--os-text);
  text-align: center;
  line-height: 1.8;
  max-width: 600px;
  padding: 40px;
}
