:root,
[data-theme="light"] {
  /* Light Theme */
  --bg-primary: #eaeaea;
  --bg-dither: #dcdcdc;
  --card-bg: #ffffff;
  --text-primary: #1d1d1f;
  --text-muted: #57575c;
  --border-color: #000000;
  /* Solid black borders */
  --accent-color: #d35400;
  /* rust orange */

  /* Fonts */
  --font-title: 'Pangolin', cursive, sans-serif;
  --font-body: 'Pangolin', cursive, sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* retro box shadow */
  --box-shadow-retro: 5px 5px 0px 0px #000000;
  --box-shadow-retro-hover: 5px 5px 0px 0px #000000;
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-primary: #121214;
  --bg-dither: #1d1d21;
  --card-bg: #1c1c1f;
  --text-primary: #f5f5f7;
  --text-muted: #a0a0a5;
  --border-color: #000000;
  --accent-color: #ff9f0a;
  /* amber */

  /* Fonts */
  --font-title: 'Space Mono', monospace;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* XP Theme Styles */
[data-theme="xp"] {
  --bg-primary: #2485e9;
  /* fallback Sky blue */
  --card-bg: #ece9d8;
  /* XP window beige */
  --text-primary: #000000;
  --text-muted: #555555;
  --border-color: #004eef;
  /* Luna blue border */
  --accent-color: #388e3c;
  /* XP Green */
  --font-title: 'Space Mono', monospace;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --box-shadow-retro: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

/* iOS Theme Styles */
[data-theme="ios"] {
  --bg-primary: #3b3b3b;
  /* Linen base */
  --card-bg: rgba(255, 255, 255, 0.9);
  /* Translucent white alert */
  --text-primary: #000000;
  --text-muted: #666666;
  --border-color: rgba(0, 0, 0, 0.15);
  --accent-color: #007aff;
  /* iOS Blue */
  --font-title: 'Space Grotesk', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --box-shadow-retro: 0px 10px 30px rgba(0, 0, 0, 0.2);
}

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

img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  pointer-events: none;
  -webkit-touch-callout: none;
}

@font-face {
  font-family: 'PPNeueBit';
  src: url('public/ppneuebit-bold.otf') format('opentype');
  font-weight: bold;
  font-style: normal;
}


/* Body and Wallpaper setups */
body {
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.5;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;

  /* Standard 8x8 checkerboard dither pattern */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='4' height='4' fill='%23dcdcdc'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23dcdcdc'/%3E%3C/svg%3E");
  background-size: 8px 8px;
}

[data-theme="dark"] body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='4' height='4' fill='%231d1d21'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%231d1d21'/%3E%3C/svg%3E");
}

/* Windows XP Bliss Wallpaper: Actual image with pixel checkerboard dither pattern overlay */
[data-theme="xp"] body {
  display: block;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='4' height='4' fill='%231d1d21' fill-opacity='0.12'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%231d1d21' fill-opacity='0.12'/%3E%3C/svg%3E"),
    var(--xp-wallpaper, url("public/wallpapers/bliss.jpg"));
  background-size: 8px 8px, cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: hidden;
  /* Lock viewport for virtual desktop */
}

/* iOS Linen Wallpaper: Dithered linen texture */
[data-theme="ios"] body {
  display: block;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='4' height='4' fill='%23000000' fill-opacity='0.18'/%3E%3Crect x='4' y='4' width='4' height='4' fill='%23000000' fill-opacity='0.18'/%3E%3C/svg%3E"),
    linear-gradient(to bottom, #4a545d 0%, #2c353e 100%);
  background-size: 8px 8px, 100% 100%;
  background-attachment: fixed;
  overflow: hidden;
  /* Lock viewport for iOS home screen */
}

/* Header Navbar - visible in light/dark standard themes, hidden in OS themes */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  background-color: var(--card-bg);
  border-bottom: 2px solid var(--border-color);
  padding: 6px 16px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="xp"] .header,
[data-theme="ios"] .header {
  display: none !important;
  /* Hide top bar on OS emulations */
}

@media (min-width: 400px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
  }
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-link {
  text-decoration: none;
  color: var(--text-primary);
}

.logo-light-img,
.logo-dark-img {
  height: 32px;
  width: auto;
  display: none;
}

[data-theme="light"] .logo-light-img {
  display: block;
}

[data-theme="dark"] .logo-dark-img {
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  padding: 2px 4px;
  transition: color 0.2s ease;
}

.nav-link:hover {
  text-decoration: underline;
}

/* Base Wrapper - centers main content in flow */
.wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 850px;
  padding: 24px 16px;
  box-sizing: border-box;
  align-items: center;
}

[data-theme="xp"] .wrapper,
[data-theme="ios"] .wrapper {
  display: block;
  max-width: none;
  padding: 0;
  width: 0;
  height: 0;
  min-height: 0;
  overflow: visible;
  /* Let children boxes float absolutely */
}

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  align-items: center;
}

.content-container {
  position: relative;
  width: 100%;
  min-height: 800px;
}

.wiggly-divider {
  position: absolute;
  left: 380px;
  top: 0;
  height: 600px;
  width: 10px;
  background-color: var(--border-color);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='20'%3E%3Cpath d='M 5 0 Q 10 5 5 10 T 5 20' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
  -webkit-mask-repeat: repeat-y;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='20'%3E%3Cpath d='M 5 0 Q 10 5 5 10 T 5 20' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
  mask-repeat: repeat-y;
}

[data-theme="xp"] .wiggly-divider,
[data-theme="ios"] .wiggly-divider {
  display: none;
}

/* Hide OS specific windows in standard themes */
[data-theme="light"] #win-files,
[data-theme="dark"] #win-files,
[data-theme="light"] #win-folder,
[data-theme="dark"] #win-folder {
  display: none !important;
}

/* Box (Standard Mode vs. OS Draggable Window Mode) */
.box {
  background-color: var(--card-bg);
  border: 2px solid var(--border-color);
  box-shadow: var(--box-shadow-retro);
  padding: 14px;
  width: 320px;
  box-sizing: border-box;
  position: absolute;
}

#win-welcome {
  top: 0;
  left: 0;
}

#win-links {
  top: 380px;
  left: 0;
}

#win-image {
  top: 0;
  left: 450px;
  width: 480px;
}

.box.image-box {
  padding: 0;
}

[data-theme="xp"] .box.image-box,
[data-theme="ios"] .box.image-box {
  width: 480px;
  resize: horizontal;
  overflow: hidden;
}

[data-theme="xp"] .box.image-box .img-os,
[data-theme="ios"] .box.image-box .img-os {
  width: 100%;
  height: auto;
  display: block;
}

/* Clippy-style Note */
.clippy-note {
  position: absolute;
  top: 29%;
  left: 27%;
  background-color: #ffffe1;
  border: 1px solid #000000;
  padding: 6px 12px;
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: #000000;
  -webkit-font-smoothing: none;
  font-smooth: never;
  border-radius: 7px;
  z-index: 5;
  animation: float 40s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}

[data-theme="xp"] .clippy-note,
[data-theme="ios"] .clippy-note {
  display: none !important;
}

@keyframes float {

  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  }

  50% {
    transform: translate3d(0, -8px, 0) rotate(1.5deg);
    box-shadow: 4px 10px 12px rgba(0, 0, 0, 0.15);
  }
}

.floating {
  animation: float 40s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}

.clippy-note::before {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 15px;
  border-width: 10px 10px 0 0;
  border-style: solid;
  border-color: #000000 transparent transparent transparent;
}

.clippy-note::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 16px;
  border-width: 8px 8px 0 0;
  border-style: solid;
  border-color: #ffffe1 transparent transparent transparent;
}

/* Drag-active style when theme is XP or iOS */
[data-theme="xp"] .box,
[data-theme="ios"] .box {
  position: absolute;
  width: 320px;
  z-index: 10;
  padding: 0;
  /* padding handled inside titlebar/body */
  border-radius: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  flex: none;
}

/* XP Luna Window Border */
[data-theme="xp"] .box {
  border: 3px solid #004eef;
  border-radius: 5px 5px 0 0;
  background-color: #ece9d8;
}

/* iOS Dialog Box Rounded style */
[data-theme="ios"] .box {
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Box internal header styling */
.box h1,
.box h2 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
  text-transform: lowercase;
}

/* Hide flow header H2 in OS modes since titlebar carries the title */
[data-theme="xp"] .box h2,
[data-theme="ios"] .box h2 {
  display: none !important;
}

.box p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.window-body {
  padding: 14px;
}

.image-box-body {
  padding: 0 !important;
  line-height: 0;
}

.box-image {
  width: 100%;
  height: auto;
  display: block;
}

.img-os {
  display: none;
}

[data-theme="xp"] .img-standard,
[data-theme="ios"] .img-standard {
  display: none;
}

[data-theme="xp"] .img-os,
[data-theme="ios"] .img-os {
  display: block;
}

[data-theme="ios"] .box-image {
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
}

/* OS Window Titlebar - hidden by default, visible in OS modes */
.window-titlebar {
  display: none;
  user-select: none;
}

[data-theme="xp"] .window-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, #0058e6 0%, #004be0 40%, #0076f7 100%);
  padding: 4px 8px;
  color: #ffffff;
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: move;
  border-bottom: 1px solid #0022a7;
  border-radius: 3px 3px 0 0;
}

[data-theme="ios"] .window-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, #f0f0f0, #d5d5d5);
  border-bottom: 1px solid #b5b5b5;
  padding: 8px 12px;
  color: #333333;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: move;
  border-radius: 11px 11px 0 0;
}

/* Window Buttons */
.window-controls {
  display: flex;
  gap: 4px;
}

.win-btn {
  width: 16px;
  height: 16px;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* XP Close and Minimize controls */
[data-theme="xp"] .win-close {
  background: linear-gradient(to bottom, #f37b5a, #e62208);
  border: 1px solid #7d0000;
  border-radius: 3px;
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  position: relative;
  box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.4);
}

[data-theme="xp"] .win-close::after {
  content: 'X';
  font-family: Arial, sans-serif;
  font-size: 9px;
}

[data-theme="xp"] .win-close:hover {
  background: linear-gradient(to bottom, #f8a088, #ff3311);
}

[data-theme="xp"] .win-min {
  background: linear-gradient(to bottom, #5d98f7, #004ee0);
  border: 1px solid #002780;
  border-radius: 3px;
  color: #fff;
  position: relative;
  box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.4);
}

[data-theme="xp"] .win-min::after {
  content: '_';
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: bold;
  position: relative;
  top: -4px;
}

/* iOS Close and Minimize controls */
[data-theme="ios"] .win-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="ios"] .win-close {
  background-color: #ff5f56;
}

[data-theme="ios"] .win-min {
  background-color: #ffbd2e;
}

/* Links panel lists */
.links-inline {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.8;
  text-align: left;
  color: var(--text-primary);
}

.links-inline a {
  color: var(--text-primary);
  text-decoration: underline;
  font-weight: 500;
  transition: transform 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  display: inline-block;
}

.links-inline a:hover {
  transform: scale(1.05);
  color: #ffffff;
}

[data-theme="light"] .links-inline a:hover {
  color: #000000;
}

.links-inline a.glitter-text {
  font-family: 'Comic Sans MS', 'Chalkboard SE', cursive, sans-serif;
  font-size: 0.65rem;
  color: #ff99cc;
  text-decoration: none;
  font-weight: normal;
  animation: glitter 1.5s infinite;
  display: inline-block;
  transition: transform 0.2s, color 0.2s ease;
}

.links-inline a.glitter-text:hover {
  transform: scale(1.05);
  color: #ffffff;
  animation-play-state: paused;
}

/* Light Theme overrides for glitter text to remain readable */
[data-theme="light"] .links-inline a.glitter-text {
  color: #c71585;
  /* Darker pink / magenta */
  animation: glitter-light 1.5s infinite;
}

[data-theme="light"] .links-inline a.glitter-text:hover {
  color: #000000;
}

@keyframes glitter {
  0% {
    text-shadow: 0 0 2px #ff99cc, 0 0 4px #ff99cc;
    color: #ff99cc;
  }

  50% {
    text-shadow: 0 0 5px #ff00ff, 0 0 10px #ff00ff;
    color: #ffffff;
  }

  100% {
    text-shadow: 0 0 2px #ff99cc, 0 0 4px #ff99cc;
    color: #ff99cc;
  }
}

@keyframes glitter-light {
  0% {
    text-shadow: 0 0 2px #c71585, 0 0 4px #c71585;
    color: #c71585;
  }

  50% {
    text-shadow: 0 0 5px #800080, 0 0 10px #800080;
    color: #000000;
  }

  100% {
    text-shadow: 0 0 2px #c71585, 0 0 4px #c71585;
    color: #c71585;
  }
}

.shake-link {
  display: inline-block;
}

.shake {
  animation: shakeX 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shakeX {

  10%,
  90% {
    transform: translate3d(-2px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(3px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-5px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(5px, 0, 0);
  }
}

.nuh-uh-float {
  position: fixed;
  color: #ff3333;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: bold;
  pointer-events: none;
  opacity: 0.8;
  animation: floatUp 1s ease-out forwards;
  z-index: 10000;
  text-shadow: 1px 1px 0 #000;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.8;
  }

  100% {
    transform: translateY(-40px) scale(1.2);
    opacity: 0;
  }
}

/* Theme Switcher select style */
.theme-selector {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background-color: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
}

.theme-selector:hover {
  box-shadow: 2px 2px 0px 0px var(--border-color);
}

/* Subpage styling corrections (preserve compatibility with subpages) */
.card-content {
  background-color: var(--card-bg) !important;
  border: 2px solid var(--border-color) !important;
  box-shadow: 5px 5px 0px 0px #000000 !important;
}

/* Draggable desktop environment container */
.desktop-screen {
  display: none;
  /* Hidden in light/dark standard themes */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  padding: 20px;
  box-sizing: border-box;
  z-index: 1;
  pointer-events: none;
  /* Click through to background bliss */
}

[data-theme="xp"] .desktop-screen,
[data-theme="ios"] .desktop-screen {
  display: block;
  /* Visible in OS themes */
}

/* Icons container layout on home screen */
.desktop-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, 76px);
  grid-template-rows: repeat(auto-fill, 74px);
  /* Explicitly small grid rows */
  gap: 16px;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  /* Allow interactions on desktop icons */
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 76px;
  height: 74px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 2px;
}

/* XP Desktop Icons styling */
[data-theme="xp"] .desktop-icon:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.4);
}

/* Custom Standard Theme Layout Overrides (Precise Overlap Layout) */

[data-theme="light"] .content-container,
[data-theme="dark"] .content-container {
  display: block !important;
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  min-height: 700px;
}

[data-theme="light"] .box,
[data-theme="dark"] .box {
  position: absolute !important;
  margin: 0;
}

[data-theme="light"] .wiggly-divider,
[data-theme="dark"] .wiggly-divider {
  display: none !important;
}

[data-theme="light"] #win-links,
[data-theme="dark"] #win-links {
  display: none !important;
}

[data-theme="xp"] #win-graphic-links,
[data-theme="ios"] #win-graphic-links {
  display: none !important;
}

[data-theme="light"] .os-welcome,
[data-theme="dark"] .os-welcome {
  display: none !important;
}

[data-theme="xp"] .standard-welcome,
[data-theme="ios"] .standard-welcome {
  display: none !important;
}

[data-theme="light"] .img-os-container,
[data-theme="dark"] .img-os-container {
  display: none !important;
}

/* Absolute Positioning for Exact Match */
[data-theme="light"] #win-image,
[data-theme="dark"] #win-image {
  top: 40px !important;
  left: 10px !important;
  width: 320px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  z-index: 10 !important;
}

[data-theme="light"] #win-welcome,
[data-theme="dark"] #win-welcome {
  top: 310px !important;
  left: 0px !important;
  width: 330px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  z-index: 5 !important;
}

/* Add transition for theme switching */
#win-welcome,
#win-graphic-links,
.killedrome-logo-overlay {
  transition: filter 0.3s ease;
}

/* Invert colors in dark mode */
[data-theme="dark"] #win-welcome,
[data-theme="dark"] #win-graphic-links,
[data-theme="dark"] .killedrome-logo-overlay {
  filter: invert(1);
}

[data-theme="light"] #win-welcome .window-body,
[data-theme="dark"] #win-welcome .window-body {
  padding: 0;
}

[data-theme="light"] #win-graphic-links,
[data-theme="dark"] #win-graphic-links {
  top: 40px !important;
  left: 340px !important;
  width: 470px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  z-index: 1 !important;
}

/* Image Box Standard overrides */
.img-standard {
  position: relative;
  width: 100%;
}

.main-akvile {
  border: 1px dotted #cee3eb;
  width: 100%;
  display: block;
}

.killedrome-logo-overlay {
  position: absolute;
  top: -50px;
  left: -120px;
  width: 350px;
  z-index: 10;
  pointer-events: none;
}

.clippy-note-new {
  position: absolute;
  top: 28%;
  left: 20%;
  background-color: #ffffe1;
  border: 1px solid #000000;
  padding: 4px 8px;
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 0.65rem;
  color: #000000;
  border-radius: 7px;
  z-index: 5;
  animation: float 40s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.clippy-note-new::before {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 15px;
  border-width: 10px 10px 0 0;
  border-style: solid;
  border-color: #000000 transparent transparent transparent;
}

.clippy-note-new::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 16px;
  border-width: 8px 8px 0 0;
  border-style: solid;
  border-color: #ffffe1 transparent transparent transparent;
}

/* Welcome Box Standard */
[data-theme="light"] #win-welcome h2,
[data-theme="dark"] #win-welcome h2 {
  background-color: #cee3eb;
  background-image: url('public/starpng.png');
  background-size: 14px 14px;
  background-position: 6px center;
  background-repeat: no-repeat;
  border: 1px dotted #000;
  padding: 0 0 0 26px;
  margin: 0;
  color: #000;
  font-family: 'PPNeueBit', sans-serif;
  font-size: 1.15rem;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-transform: none;
}

[data-theme="light"] #win-welcome p,
[data-theme="dark"] #win-welcome p {
  background-color: #fff;
  border: 1px dotted #000;
  padding: 12px 14px;
  margin: 0 0 0 auto;
  width: 320px;
  box-sizing: border-box;
  font-family: 'PPNeueBit', sans-serif;
  font-size: 1.2rem;
  color: #000;
  line-height: 1.1;
  text-align: center;
}

/* Graphic Links Box */
.graphic-links-box {
  position: absolute;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.map-graphic {
  width: 465px;
  display: block;
}

.graphic-links-text {
  position: absolute;
  bottom: -15px;
  right: -10px;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0px;
  z-index: 10;
}

.graphic-links-text a {
  color: #cee3eb;
  font-family: 'PPNeueBit', sans-serif;
  font-size: 2.3rem;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.21), 1px 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 0.7;
  margin-bottom: 3px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.graphic-links-text a:hover {
  transform: scale(1.05);
  color: #ffffff;
}

[data-theme="xp"] .desktop-icon.selected {
  background-color: rgba(0, 45, 150, 0.4);
  border: 1px solid rgba(0, 45, 150, 0.6);
}

[data-theme="xp"] .desktop-icon.selected .icon-label {
  background-color: #0b61ff;
  text-shadow: none;
  display: block;
  max-height: none;
  overflow: visible;
  position: relative;
  z-index: 10;
}

[data-theme="xp"] .desktop-icon.selected .icon-image {
  opacity: 0.6;
}

/* Wrap text label on XP icons to prevent cropping */
[data-theme="xp"] .icon-label {
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
  font-size: 0.72rem;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000000;
  margin-top: 3px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.15;
  max-height: 2.3rem;
  width: 72px;
}

.thumbnail-icon img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 2px;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  display: block;
}

[data-theme="ios"] .thumbnail-icon img {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 12px;
  box-shadow: none;
}

/* iOS Desktop Icons (springboard) styling */
[data-theme="ios"] .desktop-icons {
  grid-template-columns: repeat(4, 68px);
  /* 4-icon grid layout */
  grid-template-rows: repeat(auto-fill, 95px);
  justify-content: center;
  padding-top: 40px;
}

[data-theme="ios"] .desktop-icon {
  width: 64px;
  height: 95px;
}

[data-theme="ios"] .icon-image {
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: transform 0.1s ease;
}

[data-theme="ios"] .desktop-icon:active .icon-image {
  transform: scale(0.92);
}

/* Wrap text label on iOS icons to prevent cropping */
[data-theme="ios"] .icon-label {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  color: #ffffff;
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.15;
  max-height: 2.2rem;
  width: 64px;
}

/* OS Window Z-indexing */
.box.window-focused {
  z-index: 200 !important;
}

/* XP Taskbar styling at the bottom */
.taskbar {
  display: none;
}

[data-theme="xp"] .taskbar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: linear-gradient(to bottom, #245edb 0%, #3f8cf3 9%, #245edb 18%, #1b4ca1 100%);
  border-top: 1px solid #1a356e;
  z-index: 9999;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.25);
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
  user-select: none;
}

/* Classic XP Flat Start Button */
.xp-start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  background: linear-gradient(to bottom, #3f9b3f, #2d7a2d);
  border: none;
  border-right: 1px solid #1a4f1a;
  border-radius: 0 16px 16px 0;
  cursor: pointer;
  padding: 0 16px 0 12px;
  color: #fff;
  font-family: 'Trebuchet MS', Arial, sans-serif;
  font-style: italic;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  transition: filter 0.1s;
}

.xp-start-btn:hover {
  filter: brightness(1.15);
}

.xp-start-btn:active {
  filter: brightness(0.9);
  box-shadow: 1px 0 2px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.xp-start-icon {
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.6));
}

/* Start Menu popup panel */
.xp-start-menu {
  display: none;
  position: fixed;
  bottom: 30px;
  left: 0;
  width: 280px;
  background-color: #3f8cf3;
  border: 2px solid #245edb;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
  z-index: 9998;
  font-family: Tahoma, 'MS Sans Serif', sans-serif;
}

.xp-start-header {
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #1b5cd7 0%, #3f8cf3 100%);
  padding: 14px 14px 20px 14px;
  color: #ffffff;
  font-weight: bold;
  border-bottom: 2px solid #004ee0;
  border-top: 1px solid #73a8f7;
  border-left: 1px solid #73a8f7;
  border-right: 1px solid #73a8f7;
  border-radius: 5px 5px 0 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.xp-username {
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-size: 1.15rem;
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.xp-start-body {
  display: grid;
  grid-template-columns: 1fr 100px;
  background-color: #ffffff;
}

.xp-start-left {
  padding: 8px 0;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
}

.xp-start-left a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: #333333;
  font-size: 0.75rem;
  font-weight: bold;
}

.xp-start-left a:hover {
  background-color: #3f8cf3;
  color: #ffffff;
}

.xp-start-right {
  background-color: #d3e5fa;
  border-left: 1px solid #95bcf2;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.xp-start-right .item {
  padding: 8px 12px;
  font-size: 0.72rem;
  color: #0022a7;
  font-weight: bold;
}

.xp-start-right .theme-selector-container {
  padding: 8px 12px;
}

.xp-start-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: linear-gradient(to bottom, #1b5cd7, #1546a3);
  padding: 6px 12px;
  border-top: 1px solid #1a356e;
  height: 36px;
}

.xp-logoff-btn {
  background: linear-gradient(to bottom, #ebc22f, #dca11e);
  color: #ffffff;
  border: 1px solid #9a6d07;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
}

.xp-logoff-btn:hover {
  background: linear-gradient(to bottom, #f6d14b, #ebc22f);
}

/* Taskbar middle tabs and tray clock */
.xp-taskbar-tabs {
  display: flex;
  gap: 4px;
  flex-grow: 1;
  padding: 0 10px;
  height: 100%;
  align-items: center;
}

.xp-taskbar-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(to bottom, #386ac5 0%, #4b88eb 10%, #386ac5 30%, #244fa2 100%);
  border: 1px solid #1b3d80;
  color: #ffffff;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xp-taskbar-tab.active {
  background: linear-gradient(to bottom, #1c3e80 0%, #285bb3 10%, #1c3e80 30%, #0d2350 100%);
}

.xp-tray-clock {
  background-color: #0f89e5;
  border-left: 1px solid #1a356e;
  color: #ffffff;
  padding: 0 10px;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  height: 100%;
}

/* Classic iOS Dock styling at bottom */
.ios-dock {
  display: none;
}

[data-theme="ios"] .ios-dock {
  display: flex;
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 340px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1) 40%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.4) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 10px;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

[data-theme="ios"] .ios-dock .dock-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

[data-theme="ios"] .ios-dock .dock-icon:active {
  transform: scale(0.9);
}

[data-theme="ios"] .ios-dock .icon-image {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dock-icon-select {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 4px;
}

/* Boot Screen Overlay styling */
.boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

/* XP Boot Layout */
.xp-boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.xp-boot-logo {
  color: #ffffff;
  text-align: center;
}

.xp-boot-logo-text {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: -0.05em;
  position: relative;
}

.xp-boot-logo-text span {
  color: #ff9f0a;
  font-size: 1.2rem;
  vertical-align: super;
  margin-left: 2px;
}

.xp-boot-subtext {
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #a0a0a5;
  margin-top: 5px;
  font-weight: bold;
}

.xp-boot-loader {
  width: 140px;
  height: 12px;
  border: 2px solid #5a5a5a;
  border-radius: 4px;
  padding: 1px;
  background-color: #000000;
  overflow: hidden;
  position: relative;
  margin-top: 40px;
}

.xp-boot-bar {
  width: 32px;
  height: 100%;
  background: linear-gradient(to right, #004ee0, #3a8cff, #004ee0);
  position: absolute;
  animation: xp-loading-animation 1.5s infinite linear;
  border-radius: 1px;
}

@keyframes xp-loading-animation {
  0% {
    left: -36px;
  }

  100% {
    left: 140px;
  }
}

/* iOS Boot Layout */
.ios-boot-content {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ios-apple-logo {
  animation: ios-pulse-animation 2s infinite ease-in-out;
}

@keyframes ios-pulse-animation {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* -------------------------------------------
 * Directory Index Boxes (OS Themes)
 * ------------------------------------------- */
.index-box {
  width: 440px;
  min-height: 300px;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.folder-box {
  width: 600px;
}

[data-theme="xp"] .index-box,
[data-theme="ios"] .index-box {
  resize: both;
  overflow: hidden;
}

.directory-index-body {
  background-color: #ffffff;
  color: #000000;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.directory-index-body h1 {
  font-size: 1.4em;
  margin-top: 4px;
  margin-bottom: 8px;
  font-weight: normal;
}

.directory-index-body pre {
  margin: 12px 0;
  line-height: 1.4;
  white-space: pre-wrap;
}

.directory-index-body a {
  color: #0000ee;
  text-decoration: none;
}

.directory-index-body a:hover {
  text-decoration: underline;
}

.directory-index-body hr {
  border: 0;
  border-bottom: 1px solid #cccccc;
  margin: 8px 0;
}

/* -------------------------------------------
 * Hide Standard Content in OS Mode
 * ------------------------------------------- */
[data-theme="xp"] #win-welcome,
[data-theme="ios"] #win-welcome,
[data-theme="xp"] #win-links,
[data-theme="ios"] #win-links {
  display: none !important;
}

[data-theme="xp"] .desktop-icon[data-open="win-welcome"],
[data-theme="ios"] .desktop-icon[data-open="win-welcome"],
[data-theme="xp"] .desktop-icon[data-open="win-links"],
[data-theme="ios"] .desktop-icon[data-open="win-links"],
[data-theme="xp"] a.desktop-icon[href="shop.html"],
[data-theme="ios"] a.desktop-icon[href="shop.html"] {
  display: none !important;
}

/* -------------------------------------------
 * Image Lightbox Overlay
 * ------------------------------------------- */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(2px);
  z-index: 999999;
  display: flex;
  /* overridden by inline style */
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 90vw;
  max-height: 90vh;
}

#lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 0.95rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 2.5rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
  line-height: 1;
}

.lightbox-close:hover {
  color: #ffffff;
}

/* Fullscreen Button */
.fullscreen-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 6px;
  cursor: pointer;
  z-index: 10;
  display: none;
  transition: background-color 0.2s;
}

.fullscreen-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.image-box-body {
  position: relative;
}

[data-theme="xp"] .image-box-body:hover .fullscreen-btn,
[data-theme="ios"] .image-box-body:hover .fullscreen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tooltip styles for welcome text */
.tooltip-wrapper {
  position: relative;
  display: inline-block;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
}

.tooltip-text {
  visibility: hidden;
  width: max-content;
  background-color: var(--card-bg, #fff);
  color: var(--text-primary, #000);
  text-align: center;
  border: 1px solid var(--border-color, #000);
  box-shadow: 2px 2px 0px 0px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-family: var(--font-mono, monospace);
  font-weight: normal;
  text-decoration: none;

  /* Position the tooltip above the text */
  position: absolute;
  z-index: 10000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s, visibility 0.2s;
}

.tooltip-wrapper:hover .tooltip-text,
.click-tooltip-wrapper.active .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-text em {
  font-style: italic;
}

/* Click tooltip wrapper specific styles */
.click-tooltip-wrapper {
  position: relative;
}

.click-tooltip-wrapper .tooltip-text {
  bottom: auto;
  top: 115%;
}