:root {
  --desktop-bg: #008080;
  --desktop-pattern: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  --win-bg: #c0c0c0;
  --win-surface: #ffffff;
  --win-border: #ffffff;
  --win-shadow: #404040;
  --titlebar-bg: linear-gradient(90deg, #000080, #1084d0);
  --titlebar-text: #ffffff;
  --accent: #000080;
  --accent-soft: #dbeafe;
  --text-main: #111827;
  --text-muted: #4b5563;
  --taskbar-bg: #c0c0c0;
  --taskbar-text: #000000;
  --font-heading: 'Chakra Petch', sans-serif;
  --font-body: 'Sarabun', sans-serif;
  --win-radius: 0px;
}

/* 16 Distinct OS & Social Era Themes */
body[data-theme="win95-dialup"] {
  --desktop-bg: #008080;
  --win-bg: #c0c0c0;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(90deg, #000080, #1084d0);
  --accent: #000080;
  --accent-soft: #e0e7ff;
  --taskbar-bg: #c0c0c0;
  --taskbar-text: #000000;
  --font-heading: 'Press Start 2P', 'Chakra Petch', monospace;
  --win-radius: 0px;
}

body[data-theme="pantip-classic"] {
  --desktop-bg: #131538;
  --win-bg: #1e2154;
  --win-surface: #252968;
  --titlebar-bg: linear-gradient(90deg, #312e81, #4f46e5);
  --accent: #facc15;
  --accent-soft: #312e81;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --taskbar-bg: #1a1c4b;
  --taskbar-text: #fde047;
  --font-heading: 'Pridi', serif;
  --win-radius: 4px;
}

body[data-theme="pirch-icq"] {
  --desktop-bg: #2f4f4f;
  --win-bg: #d4d0c8;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(90deg, #15803d, #22c55e);
  --accent: #15803d;
  --accent-soft: #dcfce7;
  --taskbar-bg: #d4d0c8;
  --taskbar-text: #111111;
  --font-heading: 'JetBrains Mono', 'Chakra Petch', monospace;
  --win-radius: 2px;
}

body[data-theme="geocities-marquee"] {
  --desktop-bg: #1e0936;
  --win-bg: #3b0764;
  --win-surface: #4c1d95;
  --titlebar-bg: linear-gradient(90deg, #db2777, #9333ea);
  --accent: #fde047;
  --accent-soft: #581c87;
  --text-main: #fdf4ff;
  --text-muted: #f5d0fe;
  --taskbar-bg: #2e1065;
  --taskbar-text: #fde047;
  --font-heading: 'Mitr', sans-serif;
  --win-radius: 8px;
}

body[data-theme="pramool-dekd"] {
  --desktop-bg: #431407;
  --win-bg: #fff7ed;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(90deg, #ea580c, #f97316);
  --accent: #ea580c;
  --accent-soft: #ffedd5;
  --taskbar-bg: #fed7aa;
  --taskbar-text: #7c2d12;
  --font-heading: 'Kanit', sans-serif;
  --win-radius: 10px;
}

body[data-theme="msn-xp"] {
  --desktop-bg: #1e6bb8;
  --win-bg: #e0f2fe;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(180deg, #0058e6 0%, #3a93ff 12%, #0058e6 100%);
  --accent: #0284c7;
  --accent-soft: #bae6fd;
  --taskbar-bg: #245edb;
  --taskbar-text: #ffffff;
  --font-heading: 'Prompt', sans-serif;
  --win-radius: 10px;
}

body[data-theme="hi5-glitter"] {
  --desktop-bg: #2a082e;
  --win-bg: #3b0764;
  --win-surface: #4a044e;
  --titlebar-bg: linear-gradient(90deg, #ec4899, #f43f5e, #a855f7);
  --accent: #f472b6;
  --accent-soft: #701a75;
  --text-main: #fdf2f8;
  --text-muted: #fbcfe8;
  --taskbar-bg: #500724;
  --taskbar-text: #fbcfe8;
  --font-heading: 'Charmonman', 'Mitr', cursive;
  --win-radius: 14px;
}

body[data-theme="camfrog-youtube"] {
  --desktop-bg: #090d16;
  --win-bg: #1e293b;
  --win-surface: #0f172a;
  --titlebar-bg: linear-gradient(90deg, #dc2626, #0284c7);
  --accent: #ef4444;
  --accent-soft: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --taskbar-bg: #0f172a;
  --taskbar-text: #e2e8f0;
  --font-heading: 'Chakra Petch', sans-serif;
  --win-radius: 8px;
}

body[data-theme="facebook-early"] {
  --desktop-bg: #d8dfea;
  --win-bg: #edf0f5;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(90deg, #3b5998, #4c70ba);
  --accent: #3b5998;
  --accent-soft: #dbeafe;
  --taskbar-bg: #3b5998;
  --taskbar-text: #ffffff;
  --font-heading: 'Prompt', sans-serif;
  --win-radius: 8px;
}

body[data-theme="ninegag-ig"] {
  --desktop-bg: #292524;
  --win-bg: #fef3c7;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(90deg, #78350f, #d97706);
  --accent: #b45309;
  --accent-soft: #fde68a;
  --taskbar-bg: #1c1917;
  --taskbar-text: #fde68a;
  --font-heading: 'Kanit', sans-serif;
  --win-radius: 12px;
}

body[data-theme="line-sticker"] {
  --desktop-bg: #58739c;
  --win-bg: #eef2f6;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(90deg, #00b900, #22c55e);
  --accent: #00b900;
  --accent-soft: #dcfce7;
  --taskbar-bg: #064e3b;
  --taskbar-text: #ffffff;
  --font-heading: 'Mitr', sans-serif;
  --win-radius: 14px;
}

body[data-theme="fblive-cf"] {
  --desktop-bg: #18191a;
  --win-bg: #242526;
  --win-surface: #3a3b3c;
  --titlebar-bg: linear-gradient(90deg, #e41e3f, #be123c);
  --accent: #fb7185;
  --accent-soft: #4c0519;
  --text-main: #f3f4f6;
  --text-muted: #d1d5db;
  --taskbar-bg: #111827;
  --taskbar-text: #ffffff;
  --font-heading: 'Prompt', sans-serif;
  --win-radius: 12px;
}

body[data-theme="twitter-trends"] {
  --desktop-bg: #15202b;
  --win-bg: #192734;
  --win-surface: #22303c;
  --titlebar-bg: linear-gradient(90deg, #1da1f2, #0284c7);
  --accent: #38bdf8;
  --accent-soft: #0c4a6e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --taskbar-bg: #0f172a;
  --taskbar-text: #38bdf8;
  --font-heading: 'Prompt', sans-serif;
  --win-radius: 14px;
}

body[data-theme="lockdown-groups"] {
  --desktop-bg: #1f2937;
  --win-bg: #fffbeb;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(90deg, #b91c1c, #f59e0b);
  --accent: #b91c1c;
  --accent-soft: #fef3c7;
  --taskbar-bg: #7f1d1d;
  --taskbar-text: #fde047;
  --font-heading: 'Kanit', sans-serif;
  --win-radius: 14px;
}

body[data-theme="clubhouse-crypto"] {
  --desktop-bg: #e7e3d4;
  --win-bg: #f2efe4;
  --win-surface: #ffffff;
  --titlebar-bg: linear-gradient(90deg, #1c1917, #44403c);
  --accent: #059669;
  --accent-soft: #d1fae5;
  --taskbar-bg: #292524;
  --taskbar-text: #f5f5f4;
  --font-heading: 'Prompt', sans-serif;
  --win-radius: 18px;
}

body[data-theme="tiktok-ai-era"] {
  --desktop-bg: #070913;
  --win-bg: #111827;
  --win-surface: #1e1b4b;
  --titlebar-bg: linear-gradient(90deg, #ec4899, #6366f1, #06b6d4);
  --accent: #2dd4bf;
  --accent-soft: #312e81;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --taskbar-bg: #090d16;
  --taskbar-text: #2dd4bf;
  --font-heading: 'Chakra Petch', sans-serif;
  --win-radius: 16px;
}

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

body {
  background-color: var(--desktop-bg);
  background-image: var(--desktop-pattern);
  background-size: 20px 20px;
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
  padding: 14px 18px 66px;
  transition: background-color 0.35s ease, color 0.3s ease;
}

/* Desktop Shortcut Icons Row at Top */
.desktop-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.desktop-shortcuts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.desktop-badge {
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(6px);
}

.top-action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.os-btn {
  font-family: 'Prompt', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 6px;
  border: 2px outset #ffffff;
  background: var(--win-bg);
  color: var(--text-main);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease;
}

.os-btn:hover {
  transform: translateY(-1px);
}

.os-btn-nudge {
  background: #e11d48;
  color: #ffffff;
  border-color: #fda4af;
}

/* Main OS Window Container */
.os-window {
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
  background: var(--win-bg);
  border-radius: var(--win-radius);
  border: 2px solid var(--win-border);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), inset 1px 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
  transition: all 0.3s ease;
}

@keyframes msnNudgeShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  10% { transform: translate(-12px, -6px) rotate(-1.5deg); }
  20% { transform: translate(12px, 6px) rotate(1.5deg); }
  30% { transform: translate(-10px, 5px) rotate(-1deg); }
  40% { transform: translate(10px, -5px) rotate(1deg); }
  50% { transform: translate(-8px, -4px) rotate(-1.2deg); }
  60% { transform: translate(8px, 4px) rotate(1.2deg); }
  70% { transform: translate(-6px, 3px) rotate(-0.5deg); }
  80% { transform: translate(6px, -3px) rotate(0.5deg); }
  90% { transform: translate(-3px, 2px) rotate(0deg); }
}

.os-window.nudge-shaking {
  animation: msnNudgeShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* Window Title Bar */
.window-titlebar {
  background: var(--titlebar-bg);
  color: var(--titlebar-text);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.window-title-text {
  font-family: 'Prompt', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.win-ctrl-box {
  width: 22px;
  height: 20px;
  background: #e5e7eb;
  color: #111;
  border: 1px outset #fff;
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  display: grid;
  place-items: center;
  border-radius: 2px;
  cursor: pointer;
}

.win-ctrl-close {
  background: #ef4444;
  color: #fff;
}

/* Address / Menu Bar inside OS Window */
.window-address-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(128, 128, 128, 0.35);
  flex-wrap: wrap;
}

.url-box {
  flex: 1;
  min-width: 220px;
  background: var(--win-surface);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px inset rgba(128, 128, 128, 0.5);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}

/* 2-Pane Split Inside the OS Window */
.window-body-grid {
  display: grid;
  grid-template-columns: 1.02fr 1.28fr;
  gap: 16px;
  padding: 16px;
}

@media (max-width: 920px) {
  .window-body-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Pane: Monitor Illustration + Live Netizen Chat Feed */
.left-monitor-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.svg-screen-frame {
  background: var(--win-surface);
  border-radius: 8px;
  border: 2px inset rgba(128, 128, 128, 0.35);
  padding: 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.year-badge-overlay {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 6px;
  padding: 0 4px;
}

.year-ad {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent);
}

.year-be {
  font-family: 'Prompt', sans-serif;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
}

.svg-holder {
  width: 100%;
  max-width: 420px;
}

.svg-holder svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* Simulated Netizen Chat / Comment Stream Box */
.chat-stream-box {
  background: var(--win-surface);
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.35);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-stream-header {
  font-family: 'Prompt', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(128, 128, 128, 0.35);
  padding-bottom: 5px;
}

.chat-message-row {
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--text-main);
}

.chat-user {
  font-weight: 700;
  color: var(--accent);
  margin-right: 6px;
}

/* Right Pane: Encyclopedia & Specs */
.right-info-pane {
  background: var(--win-surface);
  border-radius: 8px;
  border: 1px solid rgba(128, 128, 128, 0.35);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.era-heading-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  line-height: 1.3;
  color: var(--text-main);
}

.era-subtitle {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 3px;
}

.specs-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.spec-chip {
  background: var(--accent-soft);
  padding: 9px 12px;
  border-radius: 6px;
  border-left: 4px solid var(--accent);
}

.spec-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.spec-val {
  font-family: 'Prompt', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.era-story-box {
  font-size: 0.96rem;
  line-height: 1.68;
  color: var(--text-main);
}

.highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed rgba(128, 128, 128, 0.35);
}

.highlights-list li {
  font-size: 0.88rem;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.highlights-list li::before {
  content: "💻";
  flex-shrink: 0;
}

/* Window Status Bar */
.window-statusbar {
  background: rgba(0, 0, 0, 0.12);
  border-top: 1px solid rgba(128, 128, 128, 0.4);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Prompt', sans-serif;
  font-size: 0.78rem;
  color: var(--text-main);
}

/* Bottom OS Taskbar Timeline */
.os-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: var(--taskbar-bg);
  color: var(--taskbar-text);
  border-top: 2px solid rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
}

.start-btn {
  background: #16a34a;
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 6px;
  border: 2px outset #86efac;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.taskbar-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  padding: 4px 2px;
}

.task-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px outset rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.14);
  color: var(--taskbar-text);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.task-tab.active {
  background: #fde047;
  color: #111827;
  border-style: inset;
  transform: translateY(1px);
}

.tray-clock {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  border: 1px inset rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  flex-shrink: 0;
}
