/* ============================================================
   CANOS - THEME SYSTEM
   Supports macOS X (Aqua) and Windows XP (Luna)
   ============================================================ */

/* Custom Pixel Fonts */
@font-face {
  font-family: 'KVN 97';
  src: url('assets/fonts/kvn-97.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'SVN Determination Sans';
  src: url('assets/fonts/SVN-DeterminationSans.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========== THEME VARIABLES ========== */

/* macOS X (Aqua) Theme */
body.theme-macos {
  /* Desktop */
  --desktop-bg: linear-gradient(180deg, #b8c6d9 0%, #8fa4bd 100%);

  /* Menu Bar */
  --menubar-bg: linear-gradient(180deg, #fff 0%, #e8e8e8 50%, #d8d8d8 51%, #e0e0e0 100%);
  --menubar-border: #999;
  --menubar-text: #333;

  /* Windows */
  --window-bg: #ececec;
  --window-header-bg: linear-gradient(180deg, #e8e8e8 0%, #c8c8c8 50%, #b8b8b8 51%, #c0c0c0 100%);
  --window-header-focused-bg: linear-gradient(180deg, #f0f0f0 0%, #d0d0d0 50%, #c0c0c0 51%, #d0d0d0 100%);
  --window-header-border: #999;
  --window-title-color: #333;
  --window-title-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  --window-content-bg: #fff;
  --window-border-radius: 6px;

  /* Traffic Light Buttons */
  --btn-close-bg: linear-gradient(180deg, #ff6b6b 0%, #d93636 100%);
  --btn-close-hover-bg: linear-gradient(180deg, #ff8080 0%, #e04040 100%);
  --btn-minimize-bg: linear-gradient(180deg, #ffd83d 0%, #e5a000 100%);
  --btn-minimize-hover-bg: linear-gradient(180deg, #ffe066 0%, #f0b000 100%);
  --btn-maximize-bg: linear-gradient(180deg, #5fcf65 0%, #2ea043 100%);
  --btn-maximize-hover-bg: linear-gradient(180deg, #70e077 0%, #3eb853 100%);
  --window-btn-size: 12px;
  --window-btn-radius: 50%;
  --window-controls-position: left;

  /* Dock */
  --dock-bg: linear-gradient(180deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.4) 50%, rgba(200,220,240,0.5) 50%, rgba(180,200,220,0.6) 100%);
  --dock-border: 1px solid rgba(255, 255, 255, 0.6);
  --dock-border-radius: 20px;
  --dock-padding: 6px 14px;
  --dock-position: fixed;
  --dock-bottom: 8px;
  --dock-left: 50%;
  --dock-right: auto;
  --dock-transform: translateX(-50%);

  /* Accent Colors */
  --accent-color: #6baadc;
  --accent-color-dark: #4a8bc2;
}

/* Windows XP (Luna) Theme */
body.theme-winxp {
  /* Desktop - XP Bliss-inspired gradient */
  --desktop-bg: linear-gradient(180deg, #245EDC 0%, #3A7BD5 50%, #5B9BD5 100%);

  /* Start Bar (replaces menu bar position) */
  --menubar-bg: linear-gradient(180deg, #1C5AA0 0%, #2B6FC2 50%, #3B8FE2 100%);
  --menubar-border: #0A246A;
  --menubar-text: #fff;

  /* Windows - XP Luna style (XP.css accurate) */
  --window-bg: #ECE9D8;
  --window-header-bg: linear-gradient(180deg, rgba(9,151,255,1) 0%, rgba(0,83,238,1) 8%, rgba(0,80,238,1) 40%, rgba(0,102,255,1) 88%, rgba(0,102,255,1) 93%, rgba(0,91,255,1) 95%, rgba(0,61,215,1) 96%, rgba(0,61,215,1) 100%);
  --window-header-focused-bg: linear-gradient(180deg, rgba(9,151,255,1) 0%, rgba(0,83,238,1) 8%, rgba(0,80,238,1) 40%, rgba(0,102,255,1) 88%, rgba(0,102,255,1) 93%, rgba(0,91,255,1) 95%, rgba(0,61,215,1) 96%, rgba(0,61,215,1) 100%);
  --window-header-border: transparent;
  --window-title-color: #fff;
  --window-title-shadow: 1px 1px #0f1089;
  --window-content-bg: #fff;
  --window-border-radius: 8px 8px 0 0;

  /* XP Window Buttons (rectangles on right) */
  --btn-close-bg: linear-gradient(180deg, #e8724a 0%, #d25c34 50%, #c14b25 100%);
  --btn-close-hover-bg: linear-gradient(180deg, #f08060 0%, #e06040 50%, #d04030 100%);
  --btn-minimize-bg: linear-gradient(180deg, #3c81f3 0%, #2b6cd9 50%, #1859c4 100%);
  --btn-minimize-hover-bg: linear-gradient(180deg, #5091ff 0%, #3b7ce9 50%, #2969d4 100%);
  --btn-maximize-bg: linear-gradient(180deg, #3c81f3 0%, #2b6cd9 50%, #1859c4 100%);
  --btn-maximize-hover-bg: linear-gradient(180deg, #5091ff 0%, #3b7ce9 50%, #2969d4 100%);
  --window-btn-size: 21px;
  --window-btn-radius: 3px;
  --window-controls-position: right;

  /* Taskbar (replaces dock) */
  --dock-bg: linear-gradient(180deg, #3168d5 0%, #4e8ad5 3%, #2255c5 50%, #1941a5 100%);
  --dock-border: 1px solid #0A246A;
  --dock-border-radius: 0;
  --dock-padding: 4px 8px;
  --dock-position: fixed;
  --dock-bottom: 0;
  --dock-left: 0;
  --dock-right: 0;
  --dock-transform: none;

  /* Accent Colors - XP Blue */
  --accent-color: #316AC5;
  --accent-color-dark: #1C5AA0;
}

/* ========== MENU BAR ========== */

#menu-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: var(--menubar-bg);
  border-bottom: 1px solid var(--menubar-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  z-index: 9999;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.menu-logo {
  font-weight: 700;
  color: var(--menubar-text);
}

.menu-clock {
  font-weight: 500;
  color: var(--menubar-text);
  font-variant-numeric: tabular-nums;
}

/* ========== DESKTOP ========== */

#desktop {
  width: 100vw;
  height: calc(100vh - 24px);
  margin-top: 24px;
  background: var(--desktop-bg);
  position: relative;
  overflow: hidden;
}

/* ========== DESKTOP ICONS ========== */

#desktop-icons {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap-reverse;
  gap: 8px;
  max-height: calc(100vh - 140px);
}

/* WinXP: Desktop icons on left side */
body.theme-winxp #desktop-icons {
  right: auto;
  left: 20px;
  flex-wrap: wrap;
}

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

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

.desktop-icon:active {
  background: rgba(255, 255, 255, 0.4);
}

.desktop-icon-img {
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.desktop-icon-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  text-align: center;
  line-height: 1.2;
}

/* ========== WINDOWS ========== */

.window {
  position: absolute;
  top: 100px;
  left: 100px;
  width: 320px;
  min-width: 200px;
  min-height: 150px;
  background: var(--window-bg);
  border-radius: var(--window-border-radius);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.window.hidden {
  display: none;
}

/* Minimized state - shrink and fade */
.window.minimized {
  transform: scale(0.1) translateY(400px);
  opacity: 0;
  pointer-events: none;
}

/* Maximized state - fullscreen */
.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
  transition: all 0.2s ease;
}

/* Title bar - brushed metal look */
.window-header {
  background: var(--window-header-bg);
  padding: 8px 10px;
  cursor: grab;
  user-select: none;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--window-header-border);
  position: relative;
  touch-action: none;
}

.window-header:active {
  cursor: grabbing;
}

/* Traffic light container */
.window-controls {
  display: flex;
  gap: 6px;
  margin-right: 10px;
}

/* Base button style for close/minimize/maximize */
.window-close,
.window-minimize,
.window-maximize {
  width: var(--window-btn-size);
  height: var(--window-btn-size);
  border-radius: var(--window-btn-radius);
  border: 1px solid rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 0;
  transition: all 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Close button - red */
.window-close {
  background: var(--btn-close-bg);
}

.window-close:hover {
  background: var(--btn-close-hover-bg);
  transform: scale(1.1);
}

/* Minimize button - yellow */
.window-minimize {
  background: var(--btn-minimize-bg);
}

.window-minimize:hover {
  background: var(--btn-minimize-hover-bg);
  transform: scale(1.1);
}

.window-close:active,
.window-minimize:active,
.window-maximize:active {
  transform: scale(0.95);
}

/* Maximize button - green */
.window-maximize {
  background: var(--btn-maximize-bg);
}

.window-maximize:hover {
  background: var(--btn-maximize-hover-bg);
  transform: scale(1.1);
}

.window-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--window-title-color);
  text-shadow: var(--window-title-shadow);
  letter-spacing: 0.02em;
  flex: 1;
  text-align: center;
  margin-right: 40px;
}

/* Window body */
.window-content {
  padding: 12px;
  flex: 1;
  background: var(--window-content-bg);
  color: #222;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  overflow-y: auto;
}

/* Resize handle - bottom right corner */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 50%,
    #999 50%,
    #999 60%,
    transparent 60%,
    transparent 70%,
    #999 70%,
    #999 80%,
    transparent 80%,
    transparent 90%,
    #999 90%
  );
  opacity: 0.5;
  transition: opacity 0.15s;
  touch-action: none;
}

.resize-handle:hover {
  opacity: 0.8;
}

/* Focused window */
.window.focused {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.window.focused .window-header {
  background: var(--window-header-focused-bg);
}

/* ========== NOTES APP ========== */

.window-content textarea {
  width: 100%;
  height: 100%;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  resize: none;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  line-height: 1.5;
  outline: none;
  background: #fff;
  color: #222;
  padding: 8px;
}

.window-content textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(107, 170, 220, 0.3);
}

/* ========== CHAT APP ========== */

.chat-content {
  display: flex;
  flex-direction: column;
  padding: 8px;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  padding: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-message {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 11px;
  max-width: 80%;
  line-height: 1.4;
  word-wrap: break-word;
}

/* user messages - right aligned, blue */
.chat-message.user {
  align-self: flex-end;
  background: linear-gradient(180deg, #4a9eff 0%, #2d7fd9 100%);
  color: #fff;
  border: 1px solid #2070c0;
  border-radius: 12px 12px 4px 12px;
}

/* assistant messages - left aligned, gray */
.chat-message.assistant {
  align-self: flex-start;
  background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
  color: #222;
  border: 1px solid #c0c0c0;
  border-radius: 12px 12px 12px 4px;
}

/* system messages - centered, muted */
.chat-message.system {
  align-self: center;
  background: transparent;
  color: #888;
  border: none;
  font-style: italic;
  font-size: 10px;
  max-width: 90%;
  text-align: center;
}

/* typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  align-self: flex-start;
  background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
  border: 1px solid #c0c0c0;
  border-radius: 12px 12px 12px 4px;
  margin-bottom: 8px;
}

.chat-typing.hidden {
  display: none;
}

/* Override: when chat-typing-fade is present, use opacity instead of display:none */
.chat-typing.chat-typing-fade.hidden {
  display: flex;
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, max-height 0.2s ease, padding 0.2s ease, margin 0.2s ease;
}

.chat-typing.chat-typing-fade:not(.hidden) {
  max-height: 50px;
  transition: opacity 0.2s ease, max-height 0.2s ease, padding 0.2s ease, margin 0.2s ease;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #888;
  border-radius: 50%;
  animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.chat-input-area {
  display: flex;
  gap: 6px;
}

.chat-input-area input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  background: #fff;
  color: #222;
  font-size: 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.chat-input-area input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(107, 170, 220, 0.3);
}

.chat-input-area button {
  padding: 8px 14px;
  border: 1px solid var(--accent-color-dark);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.15s ease;
}

.chat-input-area button:hover {
  filter: brightness(1.1);
}

.chat-input-area button:active {
  filter: brightness(0.9);
  transform: translateY(1px);
}

/* clear button - smaller, red tint */
#chat-clear {
  padding: 8px 10px;
  background: linear-gradient(180deg, #e57061 0%, #c8402f 100%);
  border-color: #b02e1e;
}

#chat-clear:hover {
  background: linear-gradient(180deg, #f08070 0%, #d8503f 100%);
}

/* error state for messages */
.chat-message.error {
  align-self: center;
  background: linear-gradient(180deg, #ffe0e0 0%, #ffc0c0 100%);
  color: #c00;
  border: 1px solid #f0a0a0;
  font-size: 10px;
  cursor: pointer;
}

.chat-message.error:hover {
  filter: brightness(0.95);
}

/* disabled states for send button and input */
.chat-input-area button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.chat-input-area input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: #f0f0f0;
}

/* shake animation for empty input */
@keyframes chat-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.chat-input-error {
  animation: chat-shake 0.4s ease;
  border-color: #e04040 !important;
  box-shadow: 0 0 0 2px rgba(224, 64, 64, 0.3) !important;
}

/* typing indicator fade transition */
.chat-typing {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chat-typing:not(.hidden) {
  opacity: 1;
}

.chat-typing.hidden {
  pointer-events: none;
}

/* inline clear confirmation */
.chat-clear-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 11px;
  color: #666;
}

.chat-clear-confirm span {
  flex: 1;
  text-align: center;
}

.chat-clear-confirm button {
  padding: 6px 12px;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
}

.chat-clear-confirm .chat-clear-yes {
  background: linear-gradient(180deg, #e57061 0%, #c8402f 100%);
  border-color: #b02e1e;
  color: #fff;
}

.chat-clear-confirm .chat-clear-no {
  background: linear-gradient(180deg, #f0f0f0 0%, #ddd 100%);
  color: #333;
}

/* ========== SETTINGS APP ========== */

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item label {
  font-size: 11px;
  color: #333;
}

.settings-item input[type="text"],
.settings-item select {
  padding: 5px 8px;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  background: #fff;
  color: #222;
  font-size: 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.settings-item input[type="text"]:focus,
.settings-item select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(107, 170, 220, 0.3);
}

.settings-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--accent-color-dark);
}

.settings-content {
  overflow-y: auto;
}

.wallpaper-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.wallpaper-option {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}

.wallpaper-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wallpaper-option:hover {
  border-color: var(--accent-color);
  transform: scale(1.02);
}

.wallpaper-option.selected {
  border-color: var(--accent-color-dark);
  box-shadow: 0 0 0 2px rgba(107, 170, 220, 0.5);
}

/* Theme settings item layout */
.settings-item-theme {
  flex-direction: column;
  align-items: flex-start !important;
}

.settings-item-theme > label {
  margin-bottom: 8px;
}

/* Theme Picker */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.theme-card {
  position: relative;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  padding: 8px 8px 6px;
  cursor: pointer;
  background: #f8f8f8;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: center;
}

.theme-card:hover {
  border-color: var(--accent-color);
  transform: scale(1.03);
}

.theme-card.active {
  border-color: var(--accent-color-dark, #3478f6);
  box-shadow: 0 0 0 2px rgba(52, 120, 246, 0.35);
}

.theme-card-label {
  font-size: 10px;
  font-weight: 600;
  color: #444;
  margin-top: 5px;
}

.theme-card-check {
  display: none;
  position: absolute;
  top: 4px;
  right: 5px;
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  background: var(--accent-color-dark, #3478f6);
  border-radius: 50%;
}

.theme-card.active .theme-card-check {
  display: block;
}

/* Theme Card Preview — shared */
.theme-card-preview {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #7ec8e3 0%, #3d8bca 100%);
}

.preview-window {
  position: absolute;
  top: 14%;
  left: 12%;
  width: 60%;
  height: 50%;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.preview-titlebar {
  height: 28%;
  display: flex;
  align-items: center;
  padding: 0 4px;
}

.preview-body {
  flex: 1;
  background: #fff;
  height: 72%;
}

/* macOS preview */
.macos-preview {
  background: linear-gradient(135deg, #b0d4f1 0%, #76b5e8 50%, #4a90d9 100%);
}

.macos-titlebar {
  background: linear-gradient(180deg, #e8e8e8, #d0d0d0);
}

.preview-dots {
  display: flex;
  gap: 2px;
}

.preview-dots i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.preview-dots i:nth-child(1) { background: #ff5f57; }
.preview-dots i:nth-child(2) { background: #febc2e; }
.preview-dots i:nth-child(3) { background: #28c840; }

.macos-preview .preview-window {
  border-radius: 4px;
}

.preview-dock {
  position: absolute;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(2px);
  padding: 2px 6px;
  border-radius: 6px;
}

.macos-dock i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: rgba(255,255,255,0.7);
}

/* WinXP preview */
.winxp-preview {
  background: linear-gradient(180deg, #2b7cd8 0%, #3a6ea5 100%);
}

.winxp-titlebar {
  background: linear-gradient(180deg, #0a58ca, #0842a0);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-title-text {
  display: block;
  width: 35%;
  height: 2px;
  background: rgba(255,255,255,0.5);
  border-radius: 1px;
  margin-left: 2px;
}

.preview-btns {
  display: flex;
  gap: 1px;
}

.preview-btns i {
  display: block;
  width: 5px;
  height: 4px;
  background: #d4d4d4;
  border-radius: 1px;
}

.winxp-preview .preview-window {
  border-radius: 2px;
  border: 1px solid #0842a0;
}

.preview-taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 14%;
  background: linear-gradient(180deg, #3168d5, #245edb, #1941a5);
  display: flex;
  align-items: center;
  padding-left: 3px;
}

.preview-start {
  display: block;
  width: 22%;
  height: 60%;
  border-radius: 3px;
  background: linear-gradient(180deg, #3c8f3c, #2d7b2d);
}

/* WinXP theme overrides for theme cards */
.theme-winxp .theme-card {
  background: #ece9d8;
  border-color: #aca899;
}

.theme-winxp .theme-card:hover {
  border-color: #316ac5;
}

.theme-winxp .theme-card.active {
  border-color: #316ac5;
  box-shadow: 0 0 0 2px rgba(49, 106, 197, 0.35);
}

.theme-winxp .theme-card-check {
  background: #316ac5;
}

.theme-winxp .theme-card-label {
  color: #333;
}

/* Wallpaper settings item layout */
.settings-item:has(.wallpaper-picker) {
  flex-direction: column;
  align-items: flex-start;
}

.settings-item:has(.wallpaper-picker) label {
  margin-bottom: 8px;
}

/* ========== TASKS APP ========== */

.tasks-input-area {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.tasks-input-area input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  background: #fff;
  color: #222;
  font-size: 11px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tasks-input-area input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(107, 170, 220, 0.3);
}

.tasks-input-area button {
  width: 28px;
  border: 1px solid var(--accent-color-dark);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.15s ease;
}

.tasks-input-area button:hover {
  filter: brightness(1.1);
}

.tasks-input-area button:active {
  transform: translateY(1px);
}

.task-list {
  list-style: none;
  max-height: 145px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #f8f8f8;
  border: 1px solid #e0e0e0;
  border-radius: 3px;
  margin-bottom: 4px;
  font-size: 11px;
  transition: background 0.15s;
}

.task-item:hover {
  background: #f0f0f0;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: #888;
}

.task-checkbox {
  width: 13px;
  height: 13px;
  cursor: pointer;
  accent-color: var(--accent-color-dark);
}

.task-text {
  flex: 1;
  color: #222;
}

.task-delete {
  background: none;
  border: none;
  color: #c0c0c0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}

.task-delete:hover {
  color: #d93636;
}

/* ========== DOCK / TASKBAR ========== */

#dock {
  position: var(--dock-position);
  bottom: var(--dock-bottom);
  left: var(--dock-left);
  right: var(--dock-right);
  transform: var(--dock-transform);
  background: var(--dock-bg);
  border: var(--dock-border);
  border-radius: var(--dock-border-radius);
  padding: var(--dock-padding);
  display: flex;
  gap: 8px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(12px);
}

.dock-icon {
  width: 64px;
  height: 64px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-icon img {
  width: 52px;
  height: 52px;
}

.dock-icon:hover {
  transform: scale(1.25) translateY(-8px);
}

.dock-icon:active {
  transform: scale(1.15) translateY(-4px);
}

/* Indicator dot for open windows */
.dock-icon.open::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #333;
  border-radius: 50%;
}

/* ========== SCROLLBAR ========== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* ========== FILE MANAGER ========== */

.files-content {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.files-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: #f0f0f0;
  border-bottom: 1px solid #ddd;
}

.files-btn {
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}

.files-btn:hover {
  background: #e8e8e8;
}

.files-path {
  flex: 1;
  font-size: 11px;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
}

.files-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  padding: 12px;
  overflow-y: auto;
  align-content: start;
}

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

.file-item:hover {
  background: #e8f0ff;
}

.file-item.selected {
  background: #cce0ff;
}

.file-item-icon {
  font-size: 32px;
  margin-bottom: 4px;
}

.file-item-name {
  font-size: 10px;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
}

/* ========== IMAGE VIEWER ========== */

.viewer-content {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #1a1a1a;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  background: #2a2a2a;
  border-bottom: 1px solid #444;
}

.viewer-btn {
  padding: 4px 10px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #333;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}

.viewer-btn:hover {
  background: #444;
}

.viewer-zoom-level {
  color: #aaa;
  font-size: 11px;
  min-width: 40px;
  text-align: center;
}

.viewer-canvas {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  position: relative;
}

.viewer-placeholder {
  color: #666;
  font-size: 14px;
}

.viewer-canvas img {
  max-width: none;
  transition: transform 0.15s;
}

.viewer-canvas.drag-over {
  background: rgba(100, 150, 255, 0.1);
  border: 2px dashed #4a9eff;
}

/* ========== WINDOWS XP SPECIFIC OVERRIDES ========== */

/* XP: Window frame - multi-layer blue box-shadow border (XP.css accurate) */
body.theme-winxp .window {
  box-shadow:
    inset -1px -1px #00138c,
    inset 1px 1px #0831d9,
    inset -2px -2px #001ea0,
    inset 2px 2px #166aee,
    inset -3px -3px #003bda,
    inset 3px 3px #0855dd;
  border: none;
  border-radius: 8px 8px 0 0;
  padding: 0 0 3px 0;
}

body.theme-winxp .window.focused {
  box-shadow:
    inset -1px -1px #00138c,
    inset 1px 1px #0831d9,
    inset -2px -2px #001ea0,
    inset 2px 2px #166aee,
    inset -3px -3px #003bda,
    inset 3px 3px #0855dd;
}

/* XP: Unfocused windows - silver/gray title bar */
body.theme-winxp .window:not(.focused) .window-header {
  background: linear-gradient(180deg, #7a96df 0%, #97aee2 3%, #afc4ea 5%, #baced0 14%, #90b0dc 33%, #7da4d9 47%, #7ba2d7 53%, #82a9dc 60%, #93b5e0 70%, #a3c0e4 75%, #b0cae8 85%, #b7cfea 91%, #bbd1ea 96%, #bcd1ea 100%);
}

/* XP: Title bar */
body.theme-winxp .window-header {
  height: 28px;
  padding: 3px 5px 3px 3px;
  border-bottom: none;
  border-top: 1px solid #0831d9;
  border-left: 1px solid #0831d9;
  border-right: 1px solid #001ea0;
  border-radius: 8px 8px 0 0;
  font-family: 'Trebuchet MS', 'Tahoma', sans-serif;
}

/* XP: Window body sunken inner border */
body.theme-winxp .window-content {
  margin: 0 3px;
  font-family: 'Tahoma', 'Segoe UI', sans-serif;
  font-size: 11px;
  border-top: 1px solid #aca899;
}

/* XP: Window controls on right side */
body.theme-winxp .window-controls {
  position: absolute;
  right: 5px;
  top: 4px;
  margin-right: 0;
  gap: 2px;
  z-index: 1;
}

body.theme-winxp .window-minimize { order: 1; }
body.theme-winxp .window-maximize { order: 2; }
body.theme-winxp .window-close   { order: 3; }

/* XP: Title left-aligned */
body.theme-winxp .window-title {
  margin-right: 0;
  margin-left: 5px;
  padding-right: 75px; /* Leave space for window controls */
  text-align: left;
  font-family: 'Trebuchet MS', 'Tahoma', sans-serif;
  font-size: 13px;
  font-weight: bold;
  text-shadow: 1px 1px #0f1089;
  letter-spacing: 0;
}

/* XP: Window buttons - SVG background images from XP.css */
body.theme-winxp .window-close,
body.theme-winxp .window-minimize,
body.theme-winxp .window-maximize {
  width: 21px;
  height: 21px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  background-color: transparent;
  background-size: 21px 21px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Remove all ::after text symbols */
body.theme-winxp .window-close::after,
body.theme-winxp .window-minimize::after,
body.theme-winxp .window-maximize::after {
  content: none;
}

/* Close button */
body.theme-winxp .window-close {
  background-image: url('assets/winxp/close.svg');
  margin-left: 2px;
}
body.theme-winxp .window-close:hover {
  background-image: url('assets/winxp/close-hover.svg');
  transform: none;
}
body.theme-winxp .window-close:active {
  background-image: url('assets/winxp/close-active.svg');
  transform: none; filter: none;
}

/* Minimize button */
body.theme-winxp .window-minimize {
  background-image: url('assets/winxp/minimize.svg');
}
body.theme-winxp .window-minimize:hover {
  background-image: url('assets/winxp/minimize-hover.svg');
  transform: none; filter: none;
}
body.theme-winxp .window-minimize:active {
  background-image: url('assets/winxp/minimize-active.svg');
  transform: none; filter: none;
}

/* Maximize button */
body.theme-winxp .window-maximize {
  background-image: url('assets/winxp/maximize.svg');
}
body.theme-winxp .window-maximize:hover {
  background-image: url('assets/winxp/maximize-hover.svg');
  transform: none; filter: none;
}
body.theme-winxp .window-maximize:active {
  background-image: url('assets/winxp/maximize-active.svg');
  transform: none; filter: none;
}



/* XP: Window title — center aligned like macOS */
body.theme-winxp .window-title {
  text-align: center;
  padding-right: 0;
  margin-left: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-shadow: none;
  letter-spacing: 0.02em;
}

/* XP: General buttons - white-to-cream gradient with blue border */
body.theme-winxp button:not(.window-close):not(.window-minimize):not(.window-maximize):not(#start-button):not(.dock-icon):not(.taskbar-btn):not(.videos-btn):not(.videos-btn-play):not(.editor-menu-trigger):not(.editor-modal-close):not(.ipod-wheel-btn):not(.ipod-wheel-center):not(.ipod-add-btn):not(.ipod-offset-btn):not(.pbs-choice-btn):not(.pbs-res-btn):not(.pbs-crop-btn):not(.pbs-ctrl-btn):not(.pbs-nav-arrow):not(.pbs-slot-x):not(#pbs-pickup-btn):not(.calendar__nav-arrow):not(.calendar__lang-toggle):not(.calendar__month-option):not(.share-btn):not(.tv-stb-btn-transport) {
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(236,235,229,1) 86%, rgba(216,208,196,1) 100%);
  border: 1px solid #003c74;
  border-radius: 3px;
  color: #000;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  box-shadow: none;
}

body.theme-winxp button:not(.window-close):not(.window-minimize):not(.window-maximize):not(#start-button):not(.dock-icon):not(.taskbar-btn):not(.videos-btn):not(.videos-btn-play):not(.editor-menu-trigger):not(.editor-modal-close):not(.ipod-wheel-btn):not(.ipod-wheel-center):not(.ipod-add-btn):not(.ipod-offset-btn):not(.pbs-choice-btn):not(.pbs-res-btn):not(.pbs-crop-btn):not(.pbs-ctrl-btn):not(.pbs-nav-arrow):not(.pbs-slot-x):not(#pbs-pickup-btn):not(.calendar__nav-arrow):not(.calendar__lang-toggle):not(.calendar__month-option):not(.share-btn):not(.tv-stb-btn-transport):hover {
  border-color: #003c74;
  box-shadow: inset -1px 1px #fff0cf, inset 1px 2px #fdd889, inset -2px 2px #fbc761, inset 2px -2px #e5a01a;
}

body.theme-winxp button:not(.window-close):not(.window-minimize):not(.window-maximize):not(#start-button):not(.dock-icon):not(.taskbar-btn):not(.videos-btn):not(.videos-btn-play):not(.editor-menu-trigger):not(.editor-modal-close):not(.ipod-wheel-btn):not(.ipod-wheel-center):not(.ipod-add-btn):not(.ipod-offset-btn):not(.pbs-choice-btn):not(.pbs-res-btn):not(.pbs-crop-btn):not(.pbs-ctrl-btn):not(.pbs-nav-arrow):not(.pbs-slot-x):not(#pbs-pickup-btn):not(.calendar__nav-arrow):not(.calendar__lang-toggle):not(.calendar__month-option):not(.share-btn):not(.tv-stb-btn-transport):focus-visible {
  box-shadow: inset -1px 1px #cee7ff, inset 1px 2px #98b8ea, inset -2px 2px #bcd4f6, inset 1px -1px #89ade4, inset 2px -2px #89ade4;
  outline: none;
}

body.theme-winxp button:not(.window-close):not(.window-minimize):not(.window-maximize):not(#start-button):not(.dock-icon):not(.taskbar-btn):not(.videos-btn):not(.videos-btn-play):not(.editor-menu-trigger):not(.editor-modal-close):not(.ipod-wheel-btn):not(.ipod-wheel-center):not(.ipod-add-btn):not(.ipod-offset-btn):not(.pbs-choice-btn):not(.pbs-res-btn):not(.pbs-crop-btn):not(.pbs-ctrl-btn):not(.pbs-nav-arrow):not(.pbs-slot-x):not(#pbs-pickup-btn):not(.calendar__nav-arrow):not(.calendar__lang-toggle):not(.calendar__month-option):not(.share-btn):not(.tv-stb-btn-transport):active {
  background: linear-gradient(180deg, rgba(205,202,195,1) 0%, rgba(227,227,219,1) 8%, rgba(229,229,222,1) 94%, rgba(242,242,241,1) 100%);
  box-shadow: inset -1px 1px #cee7ff, inset 1px 2px #98b8ea, inset -2px 2px #bcd4f6, inset 1px -1px #89ade4, inset 2px -2px #89ade4;
}

/* XP: Input/Select/Textarea styles */
body.theme-winxp input[type="text"],
body.theme-winxp input[type="search"],
body.theme-winxp input[type="email"],
body.theme-winxp input[type="password"],
body.theme-winxp input[type="url"],
body.theme-winxp input[type="number"],
body.theme-winxp textarea,
body.theme-winxp select {
  border: 1px solid #7f9db9;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  background: #fff;
}

body.theme-winxp input[type="text"]:focus,
body.theme-winxp input[type="search"]:focus,
body.theme-winxp input[type="email"]:focus,
body.theme-winxp input[type="password"]:focus,
body.theme-winxp input[type="url"]:focus,
body.theme-winxp input[type="number"]:focus,
body.theme-winxp textarea:focus,
body.theme-winxp select:focus {
  border-color: #316ac5;
  box-shadow: 0 0 0 1px #316ac5;
}

body.theme-winxp ::selection {
  background: #2267cb;
  color: #fff;
}

/* XP: Fieldset/GroupBox */
body.theme-winxp fieldset {
  background: #fff;
  border: 1px solid #d0d0bf;
  border-radius: 4px;
}

body.theme-winxp legend {
  color: #0046d5;
  font-family: 'Tahoma', sans-serif;
}

/* XP: Scrollbars (XP.css accurate) */
body.theme-winxp ::-webkit-scrollbar {
  width: 17px;
  height: 17px;
}

body.theme-winxp ::-webkit-scrollbar-track {
  background: linear-gradient(90deg, #d6dde5 0%, #e8edf4 50%, #d6dde5 100%);
}

body.theme-winxp ::-webkit-scrollbar-thumb {
  background-color: #c8d6fb;
  box-shadow: inset -3px 0 #bad1fc, inset 1px 1px #b7caf5;
  border: 1px solid white;
  border-radius: 2px;
}

body.theme-winxp ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #a8b8d0 0%, #b8c8f0 40%, #a8b8d0 100%);
}

body.theme-winxp ::-webkit-scrollbar-button {
  width: 17px;
  height: 17px;
  background: linear-gradient(180deg, #e8edf4 0%, #c8d0dc 100%);
  border: 1px solid #a0a8b4;
}

/* XP: Dock icons style for taskbar */
body.theme-winxp .dock-icon {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  box-shadow: none;
}

body.theme-winxp .dock-icon:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  transform: none;
}

body.theme-winxp .dock-icon.open {
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.2);
  box-shadow: inset 1px 1px 1px rgba(0,0,0,0.2);
}

/* XP: Open indicator dot - lighter for dark taskbar */
body.theme-winxp .dock-icon.open::after {
  background: #fff;
}

/* XP: Desktop icon label color */
body.theme-winxp .desktop-icon-label {
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-family: 'Tahoma', sans-serif;
}

/* XP: Smaller taskbar */
body.theme-winxp #dock {
  height: 30px;
  padding: 2px 4px;
  align-items: center;
  background: linear-gradient(180deg, #3168d5 0%, #4e8ad5 3%, #2255c5 30%, #1941a5 90%, #122e8a 100%);
  border-top: 1px solid #0c3cba;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

/* XP: Smaller dock icons for taskbar */
body.theme-winxp .dock-icon {
  width: 28px;
  height: 28px;
  padding: 2px;
}

body.theme-winxp .dock-icon img {
  width: 24px;
  height: 24px;
}

body.theme-winxp .desktop-icon[data-app="journal"] .desktop-icon-img {
  width: 64px;
  height: 64px;
}

/* Hide Studio icon in macOS dock (only visible in WinXP start menu) */
body:not(.theme-winxp) .dock-icon[data-app="camera"] {
  display: none;
}

body.theme-winxp .dock-icon[data-app="journal"] img {
  width: 32px;
  height: 32px;
}

body.theme-winxp .start-menu-item[data-app="journal"] img {
  width: 32px;
  height: 32px;
}

body.theme-winxp .dock-icon:hover {
  transform: none;
}

body.theme-winxp .dock-icon.open::after {
  bottom: -2px;
  width: 3px;
  height: 3px;
}

/* ========== WinXP TASKBAR BUTTONS ========== */

/* WinXP Taskbar Buttons Container */
body.theme-winxp #taskbar-buttons {
  display: flex;
  flex: 1;
  gap: 3px;
  height: 100%;
  align-items: center;
  margin-left: 2px;
}

/* Hide in macOS theme */
body.theme-macos #taskbar-buttons {
  display: none;
}

/* Individual taskbar button */
.taskbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  min-width: 140px;
  max-width: 180px;
  padding: 2px 12px;
  /* Blue gradient - slightly lighter than taskbar (#2255c5) */
  background: linear-gradient(180deg,
    #4a8ad8 0%,
    #3a78c8 30%,
    #2a68b8 60%,
    #2058a8 100%
  );
  border: 1px solid #1a4a8a;
  border-radius: 3px;
  color: #fff;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taskbar-btn img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: transparent;
}

.taskbar-btn:hover {
  background: linear-gradient(180deg, #5a9ae8 0%, #4a88d8 30%, #3a78c8 60%, #2a68b8 100%);
}

.taskbar-btn.active {
  background: linear-gradient(180deg, #1a4888 0%, #2a58a0 50%, #3a68b0 100%);
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.3);
}

/* Hide dock icons in WinXP (replaced by taskbar buttons) */
body.theme-winxp .dock-icon {
  display: none;
}

/* ========== START BUTTON (Windows XP only) ========== */

#start-button {
  display: none;
}

body.theme-winxp #start-button {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 2px 12px 2px 6px;
  margin-left: -4px;
  border: none;
  border-top: 1px solid #5cb85c;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, #5ab450 0%, #3c9a35 15%, #328f2c 50%, #2a8524 70%, #1d7519 100%);
  color: #fff;
  cursor: pointer;
  font-family: 'Franklin Gothic Medium', 'Trebuchet MS', sans-serif;
  font-size: 18px;
  font-weight: bold;
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    1px 0 2px rgba(0, 0, 0, 0.3);
  margin-right: 8px;
}

body.theme-winxp #start-button:hover {
  background: linear-gradient(180deg, #4CAE55 0%, #3D9E45 30%, #2E8E35 70%, #1F7E25 100%);
}

body.theme-winxp #start-button:active {
  background: linear-gradient(180deg, #2C8E35 0%, #1D7E25 30%, #0E6E15 70%, #005E05 100%);
}

.start-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.start-text {
  letter-spacing: 0.5px;
}

/* ========== START MENU (Windows XP only) ========== */

#start-menu {
  display: none;
}

#start-menu.hidden {
  display: none !important;
}

body.theme-winxp #start-menu {
  display: flex;
  flex-direction: column;
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 280px;
  background: #fff;
  border: none;
  border-radius: 6px 6px 0 0;
  box-shadow:
    inset -1px -1px #00138c,
    inset 1px 1px #0831d9,
    inset -2px -2px #001ea0,
    inset 2px 2px #166aee,
    0 -4px 16px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  margin-bottom: 2px;
}

body.theme-winxp #start-menu.hidden {
  display: none !important;
}

.start-menu-header {
  background: linear-gradient(180deg, #3168d5 0%, #4e8ad5 3%, #6faadc 5%, #87b8e0 14%, #418cd6 33%, #2562cc 47%, #1555cc 53%, #1d60d2 60%, #3174d6 70%, #4c8fd9 75%, #5f9fdd 85%, #69a5df 91%, #6ea5de 96%, #6fa4dd 100%);
  padding: 8px 12px;
  color: #fff;
  font-family: 'Trebuchet MS', 'Franklin Gothic Medium', sans-serif;
  font-size: 14px;
  font-weight: bold;
  text-shadow: 1px 1px #0f1089;
}

.start-menu-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.start-menu-apps {
  padding: 8px 0;
  background: #fff;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  cursor: pointer;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  color: #000;
  transition: background 0.1s;
}

.start-menu-item:hover {
  background: #316AC5;
  color: #fff;
}

.start-menu-item img {
  width: 24px;
  height: 24px;
}

/* ========== TASKBAR CLOCK (Windows XP only) ========== */

#taskbar-clock {
  display: none;
}

/* Hide the top menu bar on Windows XP */
body.theme-winxp #menu-bar {
  display: none;
}

body.theme-winxp #desktop {
  margin-top: 0;
  height: 100vh;
}

body.theme-winxp #taskbar-clock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-left: auto;
  padding: 0 12px;
  height: 100%;
  background: transparent;
  border-left: none;
  box-shadow: none;
  color: #fff;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  font-weight: normal;
  text-shadow: none;
  line-height: 1.2;
}

.taskbar-time {
  font-weight: bold;
}

.taskbar-date {
  font-size: 10px;
  opacity: 0.9;
}

/* ========== TEXT EDITOR (Text Editor) ========== */

.editor-content {
  display: flex;
  flex-direction: column;
  padding: 0;
  height: 100%;
}

.editor-menubar {
  display: flex;
  gap: 0;
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
  border-bottom: 1px solid #c0c0c0;
  padding: 2px 4px;
}

.editor-menu {
  position: relative;
}

.editor-menu-trigger {
  padding: 4px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  color: #333;
  border-radius: 3px;
}

.editor-menu-trigger:hover {
  background: rgba(0, 0, 0, 0.08);
}

.editor-menu-trigger.active {
  background: var(--accent-color);
  color: #fff;
}

.editor-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  background: #fff;
  border: 1px solid #c0c0c0;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 4px 0;
}

.editor-menu-dropdown.open {
  display: block;
}

.editor-menu-item {
  padding: 6px 16px;
  cursor: pointer;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  color: #333;
}

.editor-menu-item:hover {
  background: var(--accent-color);
  color: #fff;
}

.editor-menu-separator {
  height: 1px;
  background: #e0e0e0;
  margin: 4px 8px;
}

.editor-textarea {
  flex: 1;
  width: 100%;
  border: none;
  resize: none;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px;
  outline: none;
  background: #fff;
  color: #222;
  overflow-y: auto;
}

.editor-textarea:focus {
  outline: none;
}

.editor-textarea[contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: #999;
  pointer-events: none;
}

/* Formatting Toolbar */
.editor-toolbar {
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
  border-bottom: 1px solid #c0c0c0;
}

.editor-format-btn {
  width: 28px;
  height: 24px;
  border: 1px solid #c0c0c0;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-family: serif;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-format-btn:hover {
  background: #e8f0ff;
  border-color: var(--accent-color);
}

.editor-format-btn.active {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color-dark);
}

.editor-statusbar {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px;
  background: linear-gradient(180deg, #f0f0f0 0%, #e0e0e0 100%);
  border-top: 1px solid #c0c0c0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  color: #666;
}

/* Editor File Picker Modal */
.editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.editor-modal.hidden {
  display: none;
}

.editor-modal-content {
  width: 400px;
  max-height: 80vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 100%);
  border-bottom: 1px solid #c0c0c0;
}

.editor-modal-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.editor-modal-close {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: #666;
  border-radius: 4px;
}

.editor-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.editor-modal-path {
  padding: 8px 16px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  color: #666;
}

.editor-modal-files {
  flex: 1;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
}

.editor-modal-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
}

.editor-modal-file:hover {
  background: #e8f0ff;
}

.editor-modal-file.selected {
  background: var(--accent-color);
  color: #fff;
}

.editor-modal-file-icon {
  font-size: 18px;
}

.editor-modal-footer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
}

.editor-modal-filename {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #c0c0c0;
  border-radius: 4px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  outline: none;
}

.editor-modal-filename:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(107, 170, 220, 0.3);
}

.editor-modal-btn {
  padding: 6px 14px;
  border: 1px solid var(--accent-color-dark);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
  color: #fff;
  cursor: pointer;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 500;
}

.editor-modal-btn:hover {
  filter: brightness(1.1);
}

.editor-modal-btn.editor-modal-cancel {
  background: linear-gradient(180deg, #f0f0f0 0%, #d0d0d0 100%);
  border-color: #aaa;
  color: #333;
}

.editor-modal-btn.editor-modal-cancel:hover {
  background: linear-gradient(180deg, #e8e8e8 0%, #c8c8c8 100%);
}

/* Windows XP theme adjustments for editor */
body.theme-winxp .editor-menubar {
  background: #ECE9D8;
  border-bottom: 1px solid #ACA899;
}

body.theme-winxp .editor-menu-trigger:hover {
  background: #316AC5;
  color: #fff;
}

body.theme-winxp .editor-menu-dropdown {
  border: 1px solid #ACA899;
}

body.theme-winxp .editor-menu-item:hover {
  background: #316AC5;
}

body.theme-winxp .editor-statusbar {
  background: #ECE9D8;
  border-top: 1px solid #ACA899;
}

body.theme-winxp .editor-toolbar {
  background: #ECE9D8;
  border-bottom: 1px solid #ACA899;
}

body.theme-winxp .editor-modal-content {
  border: none;
  border-radius: 8px 8px 0 0;
  box-shadow:
    inset -1px -1px #00138c,
    inset 1px 1px #0831d9,
    inset -2px -2px #001ea0,
    inset 2px 2px #166aee,
    inset -3px -3px #003bda,
    inset 3px 3px #0855dd;
}

body.theme-winxp .editor-modal-header {
  background: linear-gradient(180deg, #3168d5 0%, #4e8ad5 3%, #6faadc 5%, #87b8e0 14%, #418cd6 33%, #2562cc 47%, #1555cc 53%, #1d60d2 60%, #3174d6 70%, #4c8fd9 75%, #5f9fdd 85%, #69a5df 91%, #6ea5de 96%, #6fa4dd 100%);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

body.theme-winxp .editor-modal-title {
  color: #fff;
  text-shadow: 1px 1px #0f1089;
  font-family: 'Trebuchet MS', 'Tahoma', sans-serif;
  font-weight: bold;
}

body.theme-winxp .editor-modal-close {
  color: #fff;
}

body.theme-winxp .editor-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ========== VIDEOS APP ========== */

.videos-content {
  display: flex;
  padding: 0;
  height: 100%;
  background: #1a1a1a;
}

.videos-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.videos-player-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
  overflow: hidden;
}

.videos-player-area.drag-over {
  background: rgba(100, 150, 255, 0.1);
  outline: 2px dashed #4a9eff;
  outline-offset: -4px;
}

.videos-player,
.videos-youtube {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.videos-player.active,
.videos-youtube.active {
  display: block;
}

/* Hide YouTube UI elements (title bar, More Videos, YouTube logo) by cropping */
.videos-player-area.youtube-active {
  overflow: hidden;
}

.videos-player-area.youtube-active iframe#videos-youtube {
  pointer-events: none;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 100% !important;
  height: 100% !important;
  transform: translate(-50%, -50%) scale(1.5) !important;
}

.videos-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #666;
  text-align: center;
  padding: 20px;
}

.videos-placeholder.hidden {
  display: none;
}

.videos-placeholder-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.videos-placeholder-text {
  font-size: 12px;
  max-width: 200px;
  line-height: 1.4;
}

.videos-controls {
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  padding: 8px 12px;
  border-top: 1px solid #444;
}

.videos-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  margin-bottom: 4px;
}

.videos-track-number {
  font-size: 11px;
  color: #888;
  min-width: 35px;
}

.videos-title {
  font-size: 12px;
  color: #ccc;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.videos-progress {
  width: 100%;
  height: 4px;
  margin-bottom: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: #444;
  border-radius: 2px;
  cursor: pointer;
}

.videos-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #4a9eff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.videos-progress::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #4a9eff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.videos-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.videos-controls-left,
.videos-controls-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.videos-controls-center {
  flex: 1;
  text-align: center;
}

.videos-time {
  font-size: 11px;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}

.videos-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #555;
  border-radius: 4px;
  background: linear-gradient(180deg, #444 0%, #333 100%);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.videos-btn:hover {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  border-color: #666;
}

.videos-btn:active {
  background: linear-gradient(180deg, #333 0%, #222 100%);
  transform: translateY(1px);
}

.videos-btn-play {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.videos-volume {
  width: 60px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: #444;
  border-radius: 2px;
  cursor: pointer;
}

.videos-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}

.videos-volume::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.videos-playlist {
  width: 180px;
  background: #222;
  border-left: 1px solid #444;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.videos-playlist.hidden {
  display: none;
}

.videos-playlist-header {
  padding: 8px 12px;
  background: linear-gradient(180deg, #333 0%, #2a2a2a 100%);
  border-bottom: 1px solid #444;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.videos-playlist-items {
  flex: 1;
  overflow-y: auto;
}

.videos-playlist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 11px;
  color: #ccc;
  border-bottom: 1px solid #333;
  transition: background 0.15s;
}

.videos-playlist-item:hover {
  background: #333;
}

.videos-playlist-item.active {
  background: #4a9eff;
  color: #fff;
}

.videos-playlist-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.videos-playlist-item-remove {
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.videos-playlist-item:hover .videos-playlist-item-remove {
  opacity: 1;
}

.videos-playlist-item-remove:hover {
  color: #ff6b6b;
}

/* macOS Aqua theme (QuickTime 7 style) for videos */
body.theme-macos .videos-content {
  background:
    /* Fine horizontal streaks - multiple frequencies for realism */
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.08) 0px,
      rgba(0,0,0,0.05) 1px,
      rgba(255,255,255,0.03) 2px
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0px,
      rgba(0,0,0,0.03) 3px,
      rgba(255,255,255,0.05) 5px,
      transparent 7px
    ),
    /* Highlight band in upper portion like real brushed metal */
    linear-gradient(180deg,
      #9a9a9a 0%,
      #b8b8b8 15%,
      #d6d6d6 28%,
      #e0e0e0 35%,
      #c8c8c8 50%,
      #a0a0a0 70%,
      #909090 85%,
      #989898 100%
    );
  font-family: 'Lucida Grande', 'Lucida Sans Unicode', sans-serif;
  font-size: 12px;
}

body.theme-macos .videos-player-area {
  border: 1px solid #666;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.6);
  margin: 6px;
  border-radius: 1px;
}

body.theme-macos .videos-player-area.drag-over {
  background: rgba(50, 120, 220, 0.15);
  outline: 2px dashed #3278dc;
  outline-offset: -4px;
}

body.theme-macos .videos-controls {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.08) 0px,
      rgba(0,0,0,0.05) 1px,
      rgba(255,255,255,0.03) 2px
    ),
    repeating-linear-gradient(
      180deg,
      transparent 0px,
      rgba(0,0,0,0.03) 3px,
      rgba(255,255,255,0.05) 5px,
      transparent 7px
    ),
    linear-gradient(180deg,
      #b0b0b0 0%,
      #c0c0c0 40%,
      #a8a8a8 100%
    );
  border-top: 1px solid #888;
}

body.theme-macos .videos-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #4a7dc9;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.95) 0%,
    rgba(255,255,255,0.7) 45%,
    #6cb4f5 55%,
    #3a8ae6 100%
  );
  color: #1a3a6a;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    0 1px 2px rgba(0,0,0,0.25);
  font-size: 11px;
}

body.theme-macos .videos-btn:hover {
  background: linear-gradient(180deg,
    rgba(255,255,255,1) 0%,
    rgba(255,255,255,0.8) 45%,
    #7ec4ff 55%,
    #4a9af0 100%
  );
  border-color: #3a6ab5;
}

body.theme-macos .videos-btn:active {
  background: linear-gradient(180deg,
    rgba(180,200,230,0.9) 0%,
    rgba(140,170,210,0.7) 45%,
    #4a8ad0 55%,
    #2a6abc 100%
  );
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.3),
    0 0 1px rgba(0,0,0,0.2);
  transform: none;
}

body.theme-macos .videos-btn-play {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

body.theme-macos .videos-progress {
  height: 6px;
  background: #888;
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

body.theme-macos .videos-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #6cb4f5 60%, #3a8ae6 100%);
  border: 1px solid #4a7dc9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  cursor: pointer;
}

body.theme-macos .videos-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #6cb4f5 60%, #3a8ae6 100%);
  border: 1px solid #4a7dc9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  cursor: pointer;
}

body.theme-macos .videos-volume {
  height: 6px;
  background: #888;
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

body.theme-macos .videos-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #d0d0d0 100%);
  border: 1px solid #888;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  cursor: pointer;
}

body.theme-macos .videos-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #d0d0d0 100%);
  border: 1px solid #888;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  cursor: pointer;
}

body.theme-macos .videos-time {
  color: #444;
}

body.theme-macos .videos-track-number {
  color: #555;
}

body.theme-macos .videos-title {
  color: #222;
}

body.theme-macos .videos-playlist {
  background: #fff;
  border-left: 1px solid #808080;
  box-shadow: inset 1px 0 0 #fff;
}

body.theme-macos .videos-playlist-header {
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 100%);
  border-bottom: 1px solid #aaa;
  color: #222;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

body.theme-macos .videos-playlist-item {
  color: #222;
  border-bottom: 1px solid #e0e0e0;
}

body.theme-macos .videos-playlist-item:nth-child(odd) {
  background: #fff;
}

body.theme-macos .videos-playlist-item:nth-child(even) {
  background: #EDF3FE;
}

body.theme-macos .videos-playlist-item:hover {
  background: #D4E4FC;
}

body.theme-macos .videos-playlist-item.active {
  background: linear-gradient(180deg, #6D97D8 0%, #3665B3 100%);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

body.theme-macos .videos-playlist-item.active .videos-track-number,
body.theme-macos .videos-playlist-item.active .videos-title,
body.theme-macos .videos-playlist-item.active .videos-playlist-item-name {
  color: #fff;
}

body.theme-macos .videos-placeholder {
  color: #666;
}

body.theme-macos .videos-playlist-item-remove:hover {
  color: #cc3333;
}

/* Windows XP Luna theme (WMP9 style) for videos */
body.theme-winxp .videos-content {
  background: #ECE9D8;
  font-family: Tahoma, 'Segoe UI', sans-serif;
  font-size: 11px;
}

body.theme-winxp .videos-player-area {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  box-shadow: inset 1px 1px 0 rgba(0,0,0,0.15);
  margin: 4px;
}

body.theme-winxp .videos-player-area.drag-over {
  background: rgba(49, 106, 197, 0.1);
  outline: 2px dashed #316AC5;
  outline-offset: -4px;
}

body.theme-winxp .videos-controls {
  background: linear-gradient(180deg, #F0EDE5 0%, #D6D2C4 100%);
  border-top: 1px solid #ACA899;
}

body.theme-winxp .videos-btn {
  border-radius: 3px;
  border: 1px solid #003C74;
  background: linear-gradient(180deg, #fff 0%, #ECE9D8 100%);
  color: #000;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 1px 1px rgba(0,0,0,0.15);
}

body.theme-winxp .videos-btn:hover {
  background: linear-gradient(180deg, #FFF8E8 0%, #FFD860 100%);
  border-color: #003C74;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 0 3px rgba(49,106,197,0.4);
}

body.theme-winxp .videos-btn:active {
  background: linear-gradient(180deg, #E0D8C0 0%, #C8C0A8 100%);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  transform: none;
}

body.theme-winxp .videos-btn-play {
  background: linear-gradient(180deg, #A8E6A0 0%, #388E3C 100%);
  color: #fff;
  border: 1px solid #2E7D32;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 1px 2px rgba(0,0,0,0.2);
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

body.theme-winxp .videos-btn-play:hover {
  background: linear-gradient(180deg, #B8F0B0 0%, #43A047 100%);
  border-color: #1B5E20;
}

body.theme-winxp .videos-progress {
  height: 6px;
  background: #D4D0C8;
  border-radius: 0;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
}

body.theme-winxp .videos-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #F5F4EF 0%, #D4D0C8 100%);
  border: 1px solid #808080;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  cursor: pointer;
}

body.theme-winxp .videos-progress::-moz-range-thumb {
  width: 10px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #F5F4EF 0%, #D4D0C8 100%);
  border: 1px solid #808080;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  cursor: pointer;
}

body.theme-winxp .videos-volume {
  height: 6px;
  background: #D4D0C8;
  border-radius: 0;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
}

body.theme-winxp .videos-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 14px;
  border-radius: 1px;
  background: linear-gradient(180deg, #F5F4EF 0%, #D4D0C8 100%);
  border: 1px solid #808080;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  cursor: pointer;
}

body.theme-winxp .videos-volume::-moz-range-thumb {
  width: 8px;
  height: 14px;
  border-radius: 1px;
  background: linear-gradient(180deg, #F5F4EF 0%, #D4D0C8 100%);
  border: 1px solid #808080;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  cursor: pointer;
}

body.theme-winxp .videos-time {
  color: #333;
}

body.theme-winxp .videos-track-number {
  color: #666;
}

body.theme-winxp .videos-title {
  color: #000;
}

body.theme-winxp .videos-playlist {
  background: #fff;
  border-left: 1px solid #ACA899;
}

body.theme-winxp .videos-playlist-header {
  background: linear-gradient(180deg, #F5F4EF 0%, #ECE9D8 100%);
  border-bottom: 1px solid #ACA899;
  color: #000;
  font-family: Tahoma, sans-serif;
  font-weight: bold;
}

body.theme-winxp .videos-playlist-item {
  color: #000;
  border-bottom: 1px solid #ECE9D8;
}

body.theme-winxp .videos-playlist-item:hover {
  background: #FFF4E0;
}

body.theme-winxp .videos-playlist-item.active {
  background: #316AC5;
  color: #fff;
}

body.theme-winxp .videos-playlist-item.active .videos-track-number,
body.theme-winxp .videos-playlist-item.active .videos-title,
body.theme-winxp .videos-playlist-item.active .videos-playlist-item-name {
  color: #fff;
}

body.theme-winxp .videos-placeholder {
  color: #666;
}

body.theme-winxp .videos-playlist-item-remove:hover {
  color: #cc0000;
}

/* Override for WinXP theme */
body.theme-winxp .videos-content {
  overflow: hidden;
  background: transparent;
}

/* ========== TV MODE (WinXP) ========== */

.tv-mode {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  justify-content: flex-end;
}

body.theme-winxp .tv-mode {
  display: flex;
}

body.theme-winxp #videos-main-original {
  display: none;
}

body.theme-winxp .videos-playlist {
  display: none !important;
}

/* Frameless Videos window in WinXP — only TV + STB visible */
body.theme-winxp #videos-window .window-header {
  display: none;
}

body.theme-winxp #videos-window,
body.theme-winxp #videos-window.focused {
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  overflow: visible !important;
  outline: none !important;
}

body.theme-winxp #videos-window .window-content {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
}

body.theme-winxp #videos-window .resize-handle {
  z-index: 11;
  opacity: 0.3;
}

body.theme-winxp #videos-window .resize-handle:hover {
  opacity: 0.7;
}

.tv-container {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
}

.tv-frame {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: transparent;
  overflow: hidden;
}

.tv-frame-overlay {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  z-index: 6;
  pointer-events: auto;
  cursor: grab;
  margin-bottom: -12.6%;
}

.tv-screen-area {
  position: absolute;
  top: 22%;
  left: 14%;
  width: 72%;
  height: 64%;
  overflow: hidden;
  z-index: 1;
  background: #000;
}

.tv-video-slot {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 1;
}

.tv-video-slot .videos-player-area {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

.tv-video-slot .videos-player-area video,
.tv-video-slot .videos-player-area iframe,
.tv-video-slot .videos-player-area .videos-youtube {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}

.tv-video-slot .videos-placeholder {
  display: none;
}

.tv-static {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}

.tv-static.active {
  opacity: 1;
}

.tv-scanlines {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  z-index: 3;
  pointer-events: none;
}

/* OSD overlays — above frame overlay */
.tv-osd-channel {
  position: absolute;
  font-family: 'VT323', monospace;
  color: #00ff88;
  text-shadow:
    0 0 8px rgba(0, 255, 136, 0.8),
    0 0 16px rgba(0, 255, 136, 0.4);
  z-index: 7;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  top: 25%;
  right: 18%;
  font-size: 20px;
  letter-spacing: 2px;
}

.tv-osd-channel.visible {
  opacity: 1;
}

/* TV Menu overlay */
.tv-menu-overlay {
  position: absolute;
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  max-height: 45%;
  background: rgba(0, 20, 10, 0.92);
  border: 2px solid #00ff88;
  z-index: 8;
  font-family: 'VT323', monospace;
  color: #00ff88;
  overflow-y: auto;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
  scrollbar-width: thin;
  scrollbar-color: #00ff88 transparent;
}

.tv-menu-overlay::-webkit-scrollbar {
  width: 4px;
}

.tv-menu-overlay::-webkit-scrollbar-track {
  background: transparent;
}

.tv-menu-overlay::-webkit-scrollbar-thumb {
  background: #00ff88;
  border-radius: 2px;
}

.tv-menu-overlay.hidden {
  display: none;
}

.tv-menu-header {
  text-align: center;
  font-size: 20px;
  padding: 6px;
  border-bottom: 1px solid #00ff88;
  letter-spacing: 4px;
}

.tv-menu-items {
  padding: 4px 0;
}

.tv-menu-item {
  padding: 4px 12px;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-menu-item:hover,
.tv-menu-item.selected {
  background: #00ff88;
  color: #000;
}

/* ========== DVD/VCR SET-TOP BOX ========== */

.tv-remote {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 0;
  width: 100%;
  background: transparent;
  margin-top: -4px;
  position: relative;
  z-index: 10;
}

.tv-stb {
  background:
    repeating-linear-gradient(90deg, transparent 0px, transparent 1px, rgba(255,255,255,0.02) 1px, rgba(255,255,255,0.02) 2px),
    repeating-linear-gradient(90deg, transparent 0px, transparent 3px, rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px),
    linear-gradient(180deg, #323238 0%, #28282e 20%, #1e1e24 60%, #141418 100%);
  border-radius: 0 0 4px 4px;
  padding: 10px 14px 6px;
  width: 100%;
  max-width: 100%;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.6),
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(60, 60, 66, 0.6);
  border-top: none;
  border-bottom-color: #0a0a0c;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- VFD Single-Line Display ---- */
.tv-stb-lcd {
  position: relative;
  background: linear-gradient(180deg, #060d06 0%, #0a120a 50%, #071007 100%);
  border-radius: 3px;
  padding: 6px 10px;
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.9),
    inset 0 -1px 3px rgba(0, 0, 0, 0.4),
    inset 1px 0 3px rgba(0, 0, 0, 0.3),
    inset -1px 0 3px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.04);
  border: 1px solid #050805;
  overflow: hidden;
  font-family: 'VT323', monospace;
}

.tv-stb-lcd-scanlines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.12) 1px,
    rgba(0, 0, 0, 0.12) 2px
  );
  pointer-events: none;
  z-index: 1;
}

/* Label header row */
.tv-stb-lcd-labels {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 2;
  margin-bottom: 1px;
}

.tv-stb-lcd-label {
  color: #00aa66;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.7;
  text-shadow: 0 0 4px rgba(0, 170, 102, 0.3);
}

.tv-stb-lcd-label-ch {
  flex-shrink: 0;
  min-width: 42px;
}

.tv-stb-lcd-label-time {
  flex-shrink: 0;
  min-width: 50px;
}

.tv-stb-lcd-label-title {
  flex: 1;
  min-width: 0;
}

/* Data row: CH | TIME | TITLE */
.tv-stb-lcd-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  position: relative;
  z-index: 2;
  white-space: nowrap;
  overflow: hidden;
}

.tv-stb-lcd-channel {
  color: #00ffaa;
  font-size: 16px;
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 42px;
  text-shadow:
    0 0 6px rgba(0, 255, 170, 0.7),
    0 0 14px rgba(0, 255, 170, 0.3),
    0 0 2px rgba(0, 255, 170, 0.9);
}

.tv-stb-lcd-time {
  color: #00dd88;
  font-size: 16px;
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 50px;
  text-shadow:
    0 0 5px rgba(0, 221, 136, 0.6),
    0 0 12px rgba(0, 221, 136, 0.25);
}

/* Title clipping wrapper */
.tv-stb-lcd-title-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: block;
}

.tv-stb-lcd-title {
  color: #00ff88;
  font-size: 16px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: inline-block;
  text-shadow:
    0 0 6px rgba(0, 255, 136, 0.6),
    0 0 16px rgba(0, 255, 136, 0.25),
    0 0 2px rgba(0, 255, 136, 0.8);
}

.tv-stb-lcd-title.scrolling {
  animation: vfd-scroll 8s linear infinite;
}

@keyframes vfd-scroll {
  0% { transform: translateX(0); }
  10% { transform: translateX(0); }
  90% { transform: translateX(var(--scroll-distance, -100px)); }
  100% { transform: translateX(var(--scroll-distance, -100px)); }
}

/* ---- Controls ---- */
.tv-stb-controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Transport buttons row */
.tv-stb-transport {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
  padding: 2px 4px;
}

/* ---- Base button ---- */
.tv-stb-btn {
  font-family: 'VT323', monospace;
  border: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none;
}

/*
 * Dark glossy square buttons — inspired by premium AV receiver style.
 * Outer: rounded square with dark gradient face
 * Inner: subtle top-light reflection + deep inset at bottom
 * Border: thin dark edge with faint bright rim on top for 3D pop
 */
.tv-stb-btn-transport {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: rgba(180, 185, 175, 0.55);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04) 0%,
      transparent 20%,
      transparent 80%,
      rgba(0, 0, 0, 0.15) 100%
    ),
    linear-gradient(180deg, #1c1c20 0%, #151518 40%, #101012 100%);
  border: 1px solid #0a0a0c;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.1s ease;
}

.tv-stb-btn-transport:hover {
  color: rgba(100, 220, 140, 0.8);
  background:
    linear-gradient(
      180deg,
      rgba(0, 255, 136, 0.06) 0%,
      transparent 30%,
      transparent 70%,
      rgba(0, 0, 0, 0.1) 100%
    ),
    linear-gradient(180deg, #1e1e22 0%, #181818 40%, #121214 100%);
  border-color: rgba(0, 255, 136, 0.12);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.6),
    0 0 8px rgba(0, 255, 136, 0.06),
    inset 0 1px 0 rgba(0, 255, 136, 0.06),
    inset 0 -1px 4px rgba(0, 0, 0, 0.25);
}

.tv-stb-btn-transport:active {
  color: rgba(0, 200, 100, 0.5);
  background: linear-gradient(180deg, #0e0e10 0%, #0c0c0e 100%);
  border-color: rgba(0, 255, 136, 0.08);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.7),
    inset 0 0 3px rgba(0, 0, 0, 0.3);
  transform: scale(0.96);
}

/* Menu button — push to right */
.tv-stb-btn-menu {
  margin-left: auto;
}

/* Power button — beside menu, red hover */
.tv-stb-btn-power {
  margin-left: 0;
}

.tv-stb-btn-power:hover {
  color: rgba(255, 80, 80, 0.9) !important;
  border-color: rgba(255, 60, 60, 0.2) !important;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.6),
    0 0 8px rgba(255, 60, 60, 0.12),
    inset 0 1px 0 rgba(255, 60, 60, 0.08),
    inset 0 -1px 4px rgba(0, 0, 0, 0.25) !important;
}

.tv-stb-btn-power:active {
  color: rgba(255, 50, 50, 0.7) !important;
}

/* ---- Footer: LED + Brand ---- */
.tv-stb-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 0;
}

.tv-stb-led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #cc3333, #661111);
  box-shadow: 0 0 3px rgba(200, 50, 50, 0.4);
  transition: all 0.3s ease;
}

.tv-stb-led.playing {
  background: radial-gradient(circle at 35% 35%, #44ffaa, #009955);
  box-shadow:
    0 0 4px rgba(0, 255, 136, 0.5),
    0 0 10px rgba(0, 255, 136, 0.2);
}

.tv-stb-brand {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 7px;
  font-weight: 600;
  color: rgba(150, 150, 158, 0.4);
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* ---- Responsive ---- */
body.theme-winxp .tv-frame {
  max-width: 100%;
}

@media (max-width: 768px) {
  .tv-stb {
    padding: 8px 10px 5px;
  }
  body.theme-winxp .tv-mode {
    padding: 4px 0;
  }
  body.theme-winxp .tv-osd-channel {
    font-size: 24px;
  }
}

/* ========== IPOD APP ========== */

#ipod-window {
  background: rgba(0, 0, 0, 0.36);
  box-shadow: none;
}


.ipod-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: transparent;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.ipod-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  height: 100%;
}

/* iPod Body */
.ipod-body {
  aspect-ratio: 340 / 570;
  height: 100%;
  box-sizing: border-box;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1);
  position: relative;
}

.ipod-body.theme-white {
  background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 50%, #e8e8e8 100%);
  border: 1px solid #c0c0c0;
}

.ipod-body.theme-black {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 50%, #1a1a1a 100%);
  border: 1px solid #000;
}

/* iPod Screen */
.ipod-screen {
  width: 100%;
  aspect-ratio: 290 / 230;
  flex-shrink: 0;
  background: linear-gradient(180deg, #e8eaec 0%, #d8dce0 100%);
  border-radius: 4px;
  border: 4px solid #555;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 0 rgba(255, 255, 255, 0.5);
}

.ipod-body.theme-black .ipod-screen {
  border-color: #444;
}

/* Status Bar */
.ipod-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px;
  background: linear-gradient(180deg, #d0d4d8 0%, #c0c4c8 100%);
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 13px;
  font-weight: bold;
  color: #333;
  border-bottom: 1px solid #b0b4b8;
}

.ipod-status-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ipod-play-icon {
  font-size: 8px;
}

.ipod-play-icon.hidden {
  display: none;
}

.ipod-battery {
  font-size: 10px;
}

/* Display Area */
.ipod-display {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Menu System */
.ipod-menu {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #e8eaec 0%, #d8dce0 100%);
}

.ipod-menu.hidden {
  display: none;
}

.ipod-menu-title {
  padding: 4px 8px;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 15px;
  font-weight: bold;
  color: #222;
  border-bottom: 1px solid #c0c4c8;
  background: linear-gradient(180deg, #f0f2f4 0%, #e8eaec 100%);
}

.ipod-menu-items {
  flex: 1;
  overflow-y: auto;
}

.ipod-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 14px;
  color: #222;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Fix 7: Ellipsis fallback for long menu item labels */
.ipod-menu-item > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.ipod-menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.ipod-menu-item.selected {
  background: linear-gradient(180deg, #4080d0 0%, #3060a0 100%);
  color: #fff;
}

.ipod-menu-item-arrow {
  font-size: 10px;
  opacity: 0.7;
}

.ipod-menu-item.selected .ipod-menu-item-arrow {
  opacity: 1;
}

/* Now Playing View — Classic iPod style */
.ipod-now-playing {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  background: linear-gradient(180deg, #e8eaec 0%, #d8dce0 100%);
}

.ipod-now-playing.hidden {
  display: none;
}

/* Album art — small centered square */
.ipod-np-album-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 95px;
  height: 95px;
  border-radius: 5px;
  margin-bottom: 4px;
  margin-top: 6px;
  background: linear-gradient(135deg, #666 0%, #888 50%, #666 100%);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.ipod-np-album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Song info: centered artist + title */
.ipod-np-info {
  flex: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin-bottom: auto;
}

.ipod-np-artist {
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 15px;
  font-weight: bold;
  color: #222;
}

.ipod-np-title {
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 13px;
  font-weight: normal;
  color: #444;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.ipod-np-title.marquee {
  animation: ipod-marquee 8s linear infinite;
}

@keyframes ipod-marquee {
  0%, 10% { transform: translateX(0); }
  90%, 100% { transform: translateX(-100%); }
}

/* Progress + time wrapper — dark bottom bar */
.ipod-np-progress-wrap {
  width: calc(100% + 20px);
  margin: 0 -10px -6px -10px;
  padding: 8px 10px 6px;
  background: linear-gradient(180deg, #555 0%, #3a3a3a 100%);
  border-top: 1px solid #666;
}

.ipod-np-progress {
  width: 100%;
  height: 7px;
  background: #888;
  border: 1px solid #666;
  border-radius: 4px;
  margin-bottom: 2px;
  overflow: visible;
  position: relative;
}

.ipod-np-progress-bar {
  height: 100%;
  background: linear-gradient(180deg, #ccc 0%, #aaa 100%);
  width: 0%;
  transition: width 0.5s linear;
  border-radius: 3px 0 0 3px;
  position: relative;
}

.ipod-np-progress-bar::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #ddd;
  border: 1px solid #999;
  border-radius: 1px;
}

.ipod-np-time {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 13px;
  color: #ccc;
  margin-top: 1px;
}

/* Cover Flow View */
.ipod-cover-flow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  perspective: 500px;
  overflow: hidden;
}

.ipod-cover-flow.hidden {
  display: none;
}

.ipod-cf-container {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ipod-cf-album {
  position: absolute;
  width: 105px;
  height: 105px;
  background: linear-gradient(135deg, #444 0%, #666 50%, #444 100%);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s ease, opacity 0.35s ease;
  cursor: pointer;
  overflow: hidden;
}

.ipod-cf-album img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ipod-cf-album.center {
  z-index: 10;
  transform: scale(1.2);
}

.ipod-cf-album.left-1 {
  transform: translateX(-60px) rotateY(45deg) scale(0.9);
  z-index: 5;
}

.ipod-cf-album.left-2 {
  transform: translateX(-100px) rotateY(45deg) scale(0.7);
  z-index: 4;
  opacity: 0.7;
}

.ipod-cf-album.right-1 {
  transform: translateX(60px) rotateY(-45deg) scale(0.9);
  z-index: 5;
}

.ipod-cf-album.right-2 {
  transform: translateX(100px) rotateY(-45deg) scale(0.7);
  z-index: 4;
  opacity: 0.7;
}

.ipod-cf-title {
  padding: 8px;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 13px;
  color: #fff;
  text-align: center;
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Click Wheel */
.ipod-wheel {
  width: 70%;
  aspect-ratio: 1 / 1;
  margin-top: 20px;
  position: relative;
  flex-shrink: 0;
}

.ipod-wheel-outer {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 50%, #c0c0c0 100%);
  position: relative;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

/* Fix 1: Wheel rotation visual feedback */
.ipod-wheel-outer.ipod-wheel-active {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    inset 0 0 20px rgba(255, 255, 255, 0.15);
}

.ipod-body.theme-black .ipod-wheel-outer.ipod-wheel-active {
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.1),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.ipod-body.theme-black .ipod-wheel-outer {
  background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 50%, #2a2a2a 100%);
}

.ipod-wheel-btn {
  position: absolute;
  background: transparent;
  border: none;
  font-family: 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s;
}

.ipod-wheel-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  display: block;
}

.ipod-wheel-btn:hover {
  color: #333;
}

.ipod-wheel-btn:active {
  color: #000;
}

.ipod-body.theme-black .ipod-wheel-btn {
  color: #aaa;
}

.ipod-body.theme-black .ipod-wheel-btn:hover {
  color: #fff;
}

.wheel-menu {
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
}

.wheel-back {
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
}

.wheel-forward {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
}

.wheel-play {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
}

.ipod-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 50%, #d8d8d8 100%);
  border: none;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.1s;
}

.ipod-wheel-center:hover {
  background: linear-gradient(180deg, #fff 0%, #f0f0f0 50%, #e0e0e0 100%);
}

.ipod-wheel-center:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.ipod-body.theme-black .ipod-wheel-center {
  background: linear-gradient(180deg, #5a5a5a 0%, #4a4a4a 50%, #3a3a3a 100%);
}

.ipod-body.theme-black .ipod-wheel-center:hover {
  background: linear-gradient(180deg, #6a6a6a 0%, #5a5a5a 50%, #4a4a4a 100%);
}

/* Add Song Form */
.ipod-add-song {
  display: flex;
  gap: 6px;
  width: 100%;
  flex-shrink: 0;
}

.ipod-add-song input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #999;
  border-radius: 4px;
  font-size: 11px;
  background: #fff;
  outline: none;
}

.ipod-add-song input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(107, 170, 220, 0.3);
}

.ipod-add-song button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--accent-color-dark);
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-color) 0%, var(--accent-color-dark) 100%);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

.ipod-add-song button:hover {
  filter: brightness(1.1);
}

.ipod-add-song button:active {
  filter: brightness(0.9);
}

/* Shuffle/Repeat Indicators */
.ipod-np-modes {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.ipod-mode-icon {
  font-size: 10px;
  color: #666;
  opacity: 0.4;
}

.ipod-mode-icon.active {
  opacity: 1;
  color: #4080d0;
}

/* Settings Menu Items */
.ipod-setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 12px;
  color: #222;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ipod-setting-value {
  color: #4080d0;
  font-weight: bold;
}

/* Windows XP theme: iPod uses standard WinXP window styling */
body.theme-winxp #ipod-window {
  box-shadow:
    inset -1px -1px #00138c,
    inset 1px 1px #0831d9,
    inset -2px -2px #001ea0,
    inset 2px 2px #166aee,
    inset -3px -3px #003bda,
    inset 3px 3px #0855dd;
}

body.theme-winxp .ipod-content {
  background: var(--window-bg);
}

/* Reset iPod wheel buttons to macOS style in WinXP */
body.theme-winxp .ipod-wheel-btn {
  background: transparent;
  border: none;
  box-shadow: none;
}

body.theme-winxp .ipod-wheel-center {
  background: linear-gradient(180deg, #f8f8f8 0%, #e8e8e8 50%, #d8d8d8 100%);
  border: none;
  border-radius: 50%;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Screen brightness filter */
.ipod-screen.dim-1 { filter: brightness(0.9); }
.ipod-screen.dim-2 { filter: brightness(0.8); }
.ipod-screen.dim-3 { filter: brightness(0.7); }
.ipod-screen.dim-4 { filter: brightness(0.6); }
.ipod-screen.dim-5 { filter: brightness(0.5); }

/* Lyrics View */
.ipod-lyrics {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #111;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ipod-lyrics.hidden {
  display: none;
}

.ipod-lyrics-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 0;
}

.ipod-lyrics-video-bg iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.5);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  filter: brightness(0.7);
  pointer-events: none;
}

.ipod-lyrics-container {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow: hidden;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ipod-lyrics-line {
  padding: 4px 8px;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  display: none;
}

.ipod-lyrics-line.visible {
  display: block;
}

.ipod-lyrics-line.active {
  font-size: 15px;
  color: #fff;
  text-shadow: 0 0 8px rgba(100, 180, 255, 0.8), 0 1px 4px rgba(0, 0, 0, 0.9);
}

.ipod-lyrics-line.past {
  display: none;
}

.ipod-lyrics-status {
  display: none;
}

.ipod-lyrics-offset {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}

.ipod-offset-btn {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.ipod-offset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.ipod-offset-label {
  white-space: nowrap;
}

/* Fix 2: Lyrics loading spinner */
.ipod-lyrics-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.ipod-lyrics-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: ipod-spin 0.7s linear infinite;
}

@keyframes ipod-spin {
  to { transform: rotate(360deg); }
}

.ipod-lyrics-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 16px;
}

.ipod-lyrics-empty-icon {
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* Fix 8: Cover Flow empty state */
.ipod-cf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'SVN Determination Sans', 'KVN 97', 'Chicago', 'Arial Narrow', sans-serif;
  font-size: 12px;
  text-align: center;
  gap: 8px;
}

.ipod-cf-empty-icon {
  font-size: 28px;
  opacity: 0.5;
}

.ipod-cf-empty-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

/* Fix 9: Menu slide transitions */
.ipod-menu {
  transition: none;
}

.ipod-menu.slide-in-right {
  animation: ipodSlideInRight 200ms ease forwards;
}

.ipod-menu.slide-in-left {
  animation: ipodSlideInLeft 200ms ease forwards;
}

.ipod-menu.slide-out-left {
  animation: ipodSlideOutLeft 200ms ease forwards;
}

.ipod-menu.slide-out-right {
  animation: ipodSlideOutRight 200ms ease forwards;
}

@keyframes ipodSlideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes ipodSlideInLeft {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes ipodSlideOutLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

@keyframes ipodSlideOutRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* ========== GAMES ========== */

.games-content {
  display: flex;
  height: 100%;
  background: #1a1a2e;
}

.games-sidebar {
  width: 160px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-right: 1px solid #2a2a4e;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.games-sidebar-title {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: bold;
  color: #8892b0;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid #2a2a4e;
}

.games-list {
  flex: 1;
  overflow-y: auto;
}

.games-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #ccd6f6;
  cursor: pointer;
  transition: background 0.2s;
}

.games-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.games-list-item.active {
  background: linear-gradient(90deg, #e94560 0%, #0f3460 100%);
  color: #fff;
}

.games-list-icon {
  font-size: 20px;
}

.games-list-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}

.games-list-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.games-main {
  flex: 1;
  display: flex;
  background: #064f35;
}

.games-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.games-iframe.hidden {
  display: none;
}

.games-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  text-align: center;
  color: #fff;
}

.games-coming-soon.hidden {
  display: none;
}

.games-coming-soon-icon {
  font-size: 72px;
  margin-bottom: 20px;
  animation: games-bounce 2s ease-in-out infinite;
}

.games-coming-soon-text {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #e94560, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.games-coming-soon-subtext {
  font-size: 14px;
  color: #8892b0;
}

.games-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  color: #fff;
  padding: 40px;
}

.games-placeholder-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: games-bounce 2s ease-in-out infinite;
}

.games-placeholder-text {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #e94560, #ff6b6b, #feca57);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.games-placeholder-subtext {
  font-size: 14px;
  color: #8892b0;
}

@keyframes games-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ========== MOBILE / RESPONSIVE ========== */

@media (max-width: 768px) {
  /* Prevent scroll and bounce */
  body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }

  /* Menu bar: taller for touch */
  #menu-bar {
    height: 28px;
    font-size: 13px;
    padding: 0 8px;
  }

  /* Desktop adjusts for menu bar height */
  #desktop {
    height: calc(100vh - 28px);
    margin-top: 28px;
  }

  /* Desktop icons: grid reflow */
  #desktop-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  body.theme-winxp #desktop-icons {
    right: 10px;
    left: 10px;
  }

  .desktop-icon {
    width: auto;
    padding: 8px 4px;
  }

  .desktop-icon-img {
    width: 48px;
    height: 48px;
    margin-bottom: 4px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  }

  .desktop-icon-label {
    font-size: 11px;
    font-weight: 500;
  }

  /* Windows: sized by JS for mobile */
  .window {
    border-radius: 8px !important;
    min-width: unset !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 100px) !important;
  }

  /* Photostrip and Photo Booth V2 are always fullscreen — override window constraints */
  #photostrip-window,
  #photobooth2-window {
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
  }

  .window.maximized {
    top: 28px !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100dvh - 88px) !important;
    border-radius: 0 !important;
  }

  /* WinXP: no menu bar, thinner taskbar */
  body.theme-winxp .window.maximized {
    top: 0 !important;
    height: calc(100dvh - 36px) !important;
  }

  /* Window controls: larger touch targets */
  .window-close,
  .window-minimize,
  .window-maximize {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px;
    min-height: 26px;
  }

  /* WinXP: keep buttons at 21px to fit 28px title bar */
  body.theme-winxp .window-close,
  body.theme-winxp .window-minimize,
  body.theme-winxp .window-maximize {
    width: 21px !important;
    height: 21px !important;
    min-width: 21px;
    min-height: 21px;
  }

  .window-header {
    padding: 8px 10px;
  }

  .window-title {
    font-size: 14px;
    margin-right: 0;
  }

  /* Resize handle: larger for touch */
  .resize-handle {
    width: 32px;
    height: 32px;
  }

  /* Window content: scrollable on mobile */
  .window-content {
    font-size: 14px;
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Dock: iPhone-style centered bottom dock */
  #dock {
    position: fixed !important;
    bottom: 8px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    border-radius: 20px !important;
    padding: 6px 12px !important;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
    flex-wrap: nowrap;
    height: auto;
    max-width: calc(100vw - 32px);
    align-items: center;
    backdrop-filter: blur(20px);
  }

  .dock-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }

  .dock-icon img {
    width: 40px;
    height: 40px;
  }

  /* No hover magnification on touch */
  .dock-icon:hover {
    transform: none;
  }

  .dock-icon:active {
    transform: scale(0.9);
  }

  .dock-icon.open::after {
    bottom: -2px;
    width: 4px;
    height: 4px;
  }

  /* WinXP dock overrides — full-width taskbar */
  body.theme-winxp #dock {
    height: 36px;
    padding: 0 4px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: none !important;
    border-radius: 0 !important;
    max-width: none;
    justify-content: flex-start;
  }

  body.theme-winxp .dock-icon {
    width: 28px;
    height: 28px;
  }

  body.theme-winxp .dock-icon img {
    width: 22px;
    height: 22px;
  }

  body.theme-winxp .dock-icon:hover {
    transform: none;
  }

  body.theme-winxp .dock-icon:active {
    transform: scale(0.9);
  }

  /* Start button: fill taskbar height */
  body.theme-winxp #start-button {
    height: 100%;
    font-size: 13px;
    padding: 1px 8px 1px 4px;
    margin-right: 4px;
    border-radius: 0 6px 6px 0;
  }

  body.theme-winxp #start-button .start-logo {
    width: 16px;
    height: 16px;
  }

  /* Taskbar buttons container: prevent overflow */
  body.theme-winxp #taskbar-buttons {
    overflow: hidden;
    min-width: 0;
  }

  /* Taskbar buttons: fill taskbar height, shrink width to fit */
  body.theme-winxp .taskbar-btn {
    min-width: 0;
    max-width: 100px;
    flex: 1 1 0;
    height: 28px;
    padding: 2px 6px;
    font-size: 10px;
  }

  body.theme-winxp .taskbar-btn img {
    width: 14px;
    height: 14px;
  }

  /* Clock: compact */
  body.theme-winxp #taskbar-clock {
    padding: 0 6px;
    font-size: 10px;
  }

  body.theme-winxp #taskbar-clock .taskbar-time {
    font-size: 11px;
  }

  body.theme-winxp #taskbar-clock .taskbar-date {
    font-size: 9px;
  }

  /* Start menu: fit narrow screens */
  body.theme-winxp #start-menu {
    width: min(280px, calc(100vw - 16px));
  }

  body.theme-winxp .start-menu-item {
    padding: 5px 12px;
    font-size: 11px;
  }

  body.theme-winxp .start-menu-item img {
    width: 20px;
    height: 20px;
  }

  /* Prevent iOS auto-zoom on inputs */
  #chat-input,
  .chat-input-area input,
  .editor-textarea,
  .crypto-search-input,
  .tasks-input-area input,
  .ipod-add-song input,
  .editor-modal-filename {
    font-size: 16px !important;
  }

  /* Editor toolbar: wrap on small screens */
  .editor-toolbar {
    flex-wrap: wrap;
  }

  /* Videos: controls wrap, smaller playlist */
  .videos-controls-row {
    flex-wrap: wrap;
    gap: 4px;
  }

  .videos-playlist {
    width: 100%;
    max-height: 120px;
    border-left: none;
    border-top: 1px solid #444;
  }

  .videos-content {
    flex-direction: column;
  }

  /* iPod: proper mobile layout without transform hack */
  .ipod-content {
    padding: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overflow: auto;
  }

  .ipod-container {
    max-height: none;
    overflow: visible;
    width: 100%;
  }

  .ipod-body {
    width: 80%;
    max-width: 280px;
    height: auto;
  }

  .ipod-wheel {
    margin-top: 12px;
  }

  .ipod-wheel-center {
    width: 60px;
    height: 60px;
  }

  .ipod-add-song {
    max-width: 280px;
  }

  /* Crypto: compact layout for mobile */
  .crypto-main {
    flex-direction: column;
  }

  .crypto-sidebar {
    width: 100%;
    max-height: 150px;
    border-right: none;
    border-bottom: 1px solid var(--window-border);
  }

  .crypto-chart-section {
    min-height: 200px;
  }

  /* Camera: fit mobile */
  .camera-viewfinder {
    max-height: 50vh;
  }

  .camera-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Chat: ensure input is visible */
  .chat-content {
    display: flex;
    flex-direction: column;
  }

  .chat-messages {
    flex: 1;
    min-height: 0;
  }

  /* Editor modal: fit mobile */
  .editor-modal-content {
    width: 90vw;
    max-height: 70vh;
  }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

body.theme-winxp #toast-container {
  bottom: 56px; /* 36px taskbar + 20px spacing */
}

.toast {
  pointer-events: auto;
  min-width: 250px;
  max-width: 380px;
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateX(100%);
  transition: none;
}

.toast-visible {
  animation: toast-slide-in 0.3s ease forwards;
}

.toast-dismiss {
  animation: toast-fade-out 0.25s ease forwards;
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-fade-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Type colors */
.toast-success { background: #2ecc40; }
.toast-error   { background: #e74c3c; }
.toast-info    { background: #3498db; }

/* --- macOS theme --- */
body.theme-macos .toast {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- WinXP theme --- */
body.theme-winxp .toast {
  border-radius: 2px;
  font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
  font-size: 12px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.25),
    inset -1px -1px 0 rgba(0, 0, 0, 0.15),
    1px 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  #toast-container {
    right: 10px;
    left: 10px;
  }
  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ============================================================
   SYSTEM NOTIFICATIONS
   ============================================================ */

#notification-container {
  position: fixed;
  top: 36px;
  right: 12px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
}

.system-notification {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(100%);
  transition: none;
  width: 340px;
  box-sizing: border-box;
}

.system-notification-visible {
  animation: notif-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.system-notification-dismiss {
  animation: notif-slide-out 0.3s ease forwards;
}

@keyframes notif-slide-in {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes notif-slide-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

.system-notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.system-notification-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.system-notification-title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-notification-body {
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-notification-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.system-notification:hover .system-notification-close {
  opacity: 0.7;
}

.system-notification-close:hover {
  opacity: 1 !important;
}

/* --- macOS theme notifications --- */
body.theme-macos .system-notification {
  background: rgba(30, 30, 30, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.theme-macos .system-notification-close {
  color: rgba(255, 255, 255, 0.5);
}

/* --- WinXP theme notifications (balloon tooltip style) --- */
body.theme-winxp #notification-container {
  top: auto;
  bottom: 56px;
  right: 12px;
}

body.theme-winxp .system-notification {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: 10px;
  font-family: 'Tahoma', 'MS Sans Serif', sans-serif;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25);
}

body.theme-winxp .system-notification-icon {
  border-radius: 4px;
}

body.theme-winxp .system-notification-title {
  font-size: 12px;
  font-weight: 700;
}

body.theme-winxp .system-notification-body {
  font-size: 11px;
}

body.theme-winxp .system-notification-close {
  color: #666;
}

@media (max-width: 768px) {
  #notification-container {
    right: 8px;
    left: 8px;
    max-width: none;
  }
  .system-notification {
    width: auto;
  }
}

/* Boot Screen */
#boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#boot-screen.fade-out {
  animation: bootFadeOut 0.8s ease forwards;
}

#boot-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes bootFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ============================================================
   LOGIN / USER SELECTION SCREEN — Authentic Windows XP
   ============================================================ */

#login-screen {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: grid;
  grid-template-rows: 8% 2px auto 2px 10%;
  background-color: #5A7EDC;
  font: 18px 'Tahoma', Tahoma, sans-serif;
  color: #fff;
  cursor: default;
  user-select: none;
  /* Emulate XP "sort-of-bold" rendering */
  text-shadow: 0px 0px #fff;
}

#login-screen.hidden {
  display: none;
}

#login-screen.fade-out {
  animation: bootFadeOut 0.6s ease forwards;
}

/* --- Header --- */
#login-header {
  grid-row: 1;
  background-color: #00309C;
}

#login-header-stripe {
  grid-row: 2;
  background: linear-gradient(45deg, #466DCD, #C7DDFF, #B0C9F7, #5A7EDC);
}

/* --- Center area --- */
#login-center {
  grid-row: 3;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 5% 5%, #91B1EF 0, #7698E6 6%, #5A7EDC 12%);
}

#login-center > * {
  margin-right: 2%;
}
#login-center > *:last-child {
  margin-right: 0;
}

/* Left side — logo + text */
#login-center-left {
  flex: 1 1 0;
  text-align: end;
}

#login-logo {
  width: 136px;
}

#login-text-under-logo {
  display: block;
  margin-top: 16px;
  margin-right: 22px;
}

/* Center divider */
#login-center-divider {
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, #5A7EDC, #90ADED, #5A7EDC);
}

/* Right side — user list */
#login-center-right {
  height: 100%;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: auto;
}

#login-user-listings {
  margin: auto 0;
}

#login-user-listings > * {
  margin-bottom: 15px;
}
#login-user-listings > *:last-child {
  margin-bottom: 0;
}

/* --- User card wrapper (border glow) --- */
.login-user-border-wrapper {
  width: 368px;
  background: linear-gradient(90deg, white, #5A7EDC 80%);
  border-radius: 6px;
  padding: 1px;
}

/* --- User row --- */
.login-user {
  position: relative;
  background-color: #5A7EDC;
  outline: 1px solid #5A7EDC;
  padding: 8px 0 8px 8px;
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: opacity 0.5s;
}

.login-user > * {
  transition: opacity 0.5s;
}

#login-center-right:hover .login-user > * {
  opacity: 0.5;
}

#login-center-right:hover .login-user:hover > * {
  opacity: 1;
}

/* Profile picture */
.login-profile-picture-wrapper {
  background-color: #fff;
  border-radius: 6px;
  width: 48px;
  height: 48px;
  padding: 2px;
  box-shadow: 1px 1px 2px rgba(15, 37, 104, 0.6);
  flex-shrink: 0;
}

.login-user:hover .login-profile-picture-wrapper {
  background-color: #FFEE00;
  box-shadow: 1px 1px 2px rgba(15, 37, 104, 0.6), inset 0 0 1px 1px #FFB600;
}

.login-profile-picture {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* User name */
.login-user-name {
  font-size: 18px;
}

/* --- Footer stripe --- */
#login-footer-stripe {
  grid-row: 4;
  background: linear-gradient(45deg, #003399, #F99736, #C2814D, #00309C);
}

/* --- Footer --- */
#login-footer {
  grid-row: 5;
  background: linear-gradient(90deg, #3833AC, #00309C);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 0 24px;
}

#login-shutdown-group {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

#login-shutdown-group:hover span {
  text-decoration: underline;
}

#login-shutdown-icon {
  height: 24px;
  box-shadow: 2px 2px 0 rgba(15, 37, 104, 0.6);
  flex-shrink: 0;
}

#login-account-message {
  font-size: 12px;
  text-align: right;
  line-height: 1.5;
  /* Disable the bold text hack for small text */
  text-shadow: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #login-screen {
    grid-template-rows: 0 0 1fr 2px 40px;
    font-size: 14px;
  }
  /* Hide header + stripe on mobile */
  #login-header,
  #login-header-stripe {
    display: none;
  }
  #login-center {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
  }
  #login-center > * {
    margin-right: 0;
  }
  /* Hide logo — keep only the welcome text */
  #login-center-left {
    flex: 0 0 auto;
    text-align: center;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #login-logo {
    width: 56px;
    margin-bottom: 0;
  }
  #login-text-under-logo {
    margin-right: 0;
    margin-top: 8px;
    margin-bottom: 32px;
    font-size: 13px;
    opacity: 0.85;
  }
  #login-center-divider {
    display: none;
  }
  #login-center-right {
    flex: 0 0 auto;
    height: auto;
    align-items: center;
    overflow: visible;
  }
  #login-user-listings {
    padding: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    margin: 0;
  }
  #login-user-listings > * {
    margin-bottom: 0;
  }
  .login-user-border-wrapper {
    width: auto;
    background: none;
    padding: 0;
  }
  .login-user {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px 24px 14px;
    background: none;
    outline: none;
    border-radius: 0;
    border: none;
  }
  .login-user:active {
    background: none;
  }
  .login-profile-picture-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 22px;
    padding: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }
  .login-profile-picture {
    width: 94px;
    height: 94px;
    border-radius: 19px;
  }
  .login-user:hover .login-profile-picture-wrapper {
    border-radius: 22px;
  }
  .login-user-name {
    font-size: 16px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
  #login-center-right:hover .login-user > * {
    opacity: 1;
  }
  #login-footer {
    padding: 0 16px;
    align-items: center;
  }
  #login-shutdown-group {
    font-size: 11px;
  }
  #login-shutdown-icon {
    height: 16px;
  }
  #login-account-message {
    display: none;
  }
}


