/* ── WINDOW: square shape ── */
.window {
  border: 4mm ridge var(--window-border);
  display: flex;
  flex-direction: column;
  border-radius: 0px;
  position: absolute;
  backdrop-filter: blur(12px);
  background-color: var(--window-bg);
  padding: 16px;
  width: fit-content;
}

.windowheader {
  width: 100%;
  display: flex;
  align-items: center;
  cursor: grab;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 8px;
  user-select: none;
}

.headertext {
  margin: 0px;
  color: var(--text-mid);
  font-weight: 500;
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 13px;
}

.closebutton {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ff5f57;
  border: 1px solid rgba(0,0,0,0.2);
  cursor: pointer;
  margin-left: 6px;
  flex-shrink: 0;
  user-select: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.closebutton:hover {
  background-color: #e0443c;
  transform: scale(1.15);
}

.window-content {
  padding: 12px 8px 8px 8px;
  min-width: 340px;
  min-height: 200px;
}

#desktopApps {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
}

.app-icon {
  text-align: center;
  padding: 10px;
  width: 88px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  user-select: none;
}

.app-icon:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

.app-icon.selected {
  background: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent-border);
}

.app-icon-img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  filter: drop-shadow(0 4px 12px rgba(120, 80, 200, 0.35));
  display: block;
  margin: 0 auto;
}

.app-icon-label {
  margin: 6px 0 0 0;
  color: #fff;
  font-size: 11px;
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.calc-btn {
  padding: 18px;
  border-radius: 10px;
  border: none;
  background: var(--calc-btn);
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 600;
  font-family: 'Plus Jakarta Sans', monospace;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.calc-btn:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

.calc-btn:active {
  transform: scale(0.96);
}

.calc-op {
  background: var(--calc-op);
  color: var(--text-mid);
}

.calc-eq {
  background: var(--calc-eq);
  color: var(--display-color);
}

.sw-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--sw-btn);
  color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.sw-btn:hover {
  opacity: 0.85;
  transform: scale(1.04);
}

.app-icon-emoji-img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--dock-emoji-bg);
  border: 1px solid var(--dock-emoji-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto;
  filter: drop-shadow(0 4px 12px rgba(120, 80, 200, 0.35));
}

/* ── Dock: rounded, transparent ── */
#dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 18px;
  background: var(--dock-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--dock-border);
  border-radius: 22px;
  z-index: 9998;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.dock-item:hover {
  transform: translateY(-12px) scale(1.25);
}

.dock-item:hover .dock-label {
  opacity: 1;
  transform: translateY(0px);
}

.dock-img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  filter: drop-shadow(0 4px 10px rgba(120, 80, 200, 0.4));
  display: block;
}

.dock-emoji {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--dock-emoji-bg);
  border: 1px solid var(--dock-emoji-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  filter: drop-shadow(0 4px 10px rgba(120, 80, 200, 0.4));
}

.dock-label {
  font-size: 10px;
  color: #fff;
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.dock-separator {
  width: 1px;
  height: 40px;
  background: var(--accent-border);
  margin: 0 4px;
  align-self: center;
}

.about-icon {
  position: fixed;
  bottom: 100px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 9997;
  transition: transform 0.15s ease;
}

.about-icon:hover {
  transform: translateY(-3px);
}

.about-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgb(120, 80, 220), rgb(80, 40, 160));
  border: 1px solid rgba(177, 156, 217, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 14px rgba(120, 80, 200, 0.5));
  gap: 2px;
}

.about-icon-box span:first-child { font-size: 20px; }
.about-icon-box span:last-child {
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.05em;
  font-family: 'Plus Jakarta Sans', monospace;
}

.about-icon-label {
  font-size: 11px;
  color: #fff;
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Widgets row (clock + activity) ── */
#widgetRow {
  position: fixed;
  top: 70px;
  right: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  z-index: 9996;
}

/* ── Analog Clock Widget ── */
#clockWidget {
  width: 120px;
  background: var(--dock-bg);
  border: 1px solid var(--dock-border);
  border-radius: 16px;
  padding: 12px;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'Plus Jakarta Sans', monospace;
}

#clockWidget .widget-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0;
}

#analogClock {
  border-radius: 50%;
}

/* ── Activity Widget ── */
#activityWidget {
  width: 160px;
  background: var(--dock-bg);
  border: 1px solid var(--dock-border);
  border-radius: 16px;
  padding: 12px 14px;
  backdrop-filter: blur(20px);
  font-family: 'Plus Jakarta Sans', monospace;
}

.widget-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.widget-count {
  font-size: 11px;
  color: var(--text-mid);
  margin-bottom: 4px;
}

#widgetCount {
  font-weight: 700;
  color: var(--text-dark);
}

.widget-last {
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid var(--accent-border);
  padding-top: 8px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Quote Widget ── */
#quoteWidget {
  width: 160px;
  background: var(--dock-bg);
  border: 1px solid var(--dock-border);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(20px);
  font-family: 'Plus Jakarta Sans', monospace;
}

#quoteWidget .widget-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

#quoteText {
  font-size: 11px;
  color: var(--text-dark);
  line-height: 1.6;
  font-style: italic;
}

#quoteAuthor {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: right;
}

/* ── Random Moon ── */
#randomMoon {
  position: fixed;
  font-size: 22px;
  cursor: pointer;
  z-index: 9995;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  transition: transform 0.2s ease, opacity 0.4s ease;
  user-select: none;
  display: none;
  animation: moonPulse 2s ease-in-out infinite;
}

@keyframes moonPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

#randomMoon:hover {
  transform: scale(1.3) !important;
}

/* ── Lumi Pet ── */
#lumiPet {
  position: fixed;
  bottom: 100px;
  left: 20px;
  z-index: 99997;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#lumiBubble {
  display: none;
  position: absolute;
  bottom: 80px;
  left: 0;
  width: 220px;
  background: var(--window-bg);
  border: 2px solid var(--accent-border);
  border-radius: 16px;
  padding: 12px 14px;
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 12px;
  color: var(--text-dark);
  line-height: 1.6;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

#lumiBubbleText {
  margin-bottom: 10px;
  color: var(--text-dark);
}

#lumiInput {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--accent-border);
  background: var(--accent-light);
  color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 11px;
  outline: none;
}

#lumiBubble button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 11px;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', monospace;
}

#lumiBody {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--btn-bg);
  border: 2px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 0 18px var(--accent-glow);
  transition: transform 0.2s ease;
}

#lumiBody:hover { transform: scale(1.1); }

.lumi-label {
  font-size: 10px;
  color: #fff;
  font-family: 'Plus Jakarta Sans', monospace;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ── CSS Variables ── */
body {
  --accent: rgb(177, 156, 217);
  --accent-rgba: rgba(177, 156, 217, 0.25);
  --accent-light: rgba(177, 156, 217, 0.15);
  --accent-border: rgba(177, 156, 217, 0.35);
  --accent-glow: rgba(120, 80, 200, 0.4);
  --window-bg: rgba(230, 220, 255, 0.75);
  --window-border: rgb(210, 180, 255);
  --text-dark: rgb(60, 20, 120);
  --text-mid: rgb(100, 60, 160);
  --text-muted: rgb(150, 120, 200);
  --btn-bg: linear-gradient(135deg, rgb(150, 100, 220), rgb(100, 60, 180));
  --calc-btn: rgba(200, 185, 240, 0.5);
  --calc-op: rgba(177, 156, 217, 0.45);
  --calc-eq: rgb(150, 100, 220);
  --sw-btn: rgba(177, 156, 217, 0.45);
  --dock-bg: rgba(177, 156, 217, 0.15);
  --dock-border: rgba(177, 156, 217, 0.25);
  --dock-emoji-bg: rgba(177, 156, 217, 0.2);
  --dock-emoji-border: rgba(177, 156, 217, 0.35);
  --display-bg: #1a0a2e;
  --display-color: #c4b5fd;
  --trail-color: 168, 139, 250;
  --clock-face: rgba(177, 156, 217, 0.15);
  --clock-hand: rgb(150, 100, 220);
  --clock-hand2: rgb(210, 180, 255);
  --clock-second: rgb(255, 100, 150);
}

body.blue-theme {
  --accent: rgb(100, 160, 255);
  --accent-rgba: rgba(60, 120, 255, 0.2);
  --accent-light: rgba(60, 120, 255, 0.15);
  --accent-border: rgba(60, 120, 255, 0.35);
  --accent-glow: rgba(30, 80, 200, 0.4);
  --window-bg: rgba(200, 220, 255, 0.75);
  --window-border: rgb(180, 210, 255);
  --text-dark: rgb(10, 30, 100);
  --text-mid: rgb(30, 70, 160);
  --text-muted: rgb(80, 120, 210);
  --btn-bg: linear-gradient(135deg, rgb(60, 120, 255), rgb(30, 70, 200));
  --calc-btn: rgba(180, 200, 255, 0.5);
  --calc-op: rgba(100, 160, 255, 0.45);
  --calc-eq: rgb(60, 120, 255);
  --sw-btn: rgba(100, 160, 255, 0.45);
  --dock-bg: rgba(60, 120, 255, 0.15);
  --dock-border: rgba(60, 120, 255, 0.25);
  --dock-emoji-bg: rgba(60, 120, 255, 0.18);
  --dock-emoji-border: rgba(60, 120, 255, 0.35);
  --display-bg: #061030;
  --display-color: #93c5fd;
  --trail-color: 100, 160, 255;
  --clock-face: rgba(60, 120, 255, 0.15);
  --clock-hand: rgb(60, 120, 255);
  --clock-hand2: rgb(180, 210, 255);
  --clock-second: rgb(100, 220, 255);
}

body.black-theme {
  --accent: rgb(200, 200, 200);
  --accent-rgba: rgba(255, 255, 255, 0.08);
  --accent-light: rgba(255, 255, 255, 0.08);
  --accent-border: rgba(255, 255, 255, 0.15);
  --accent-glow: rgba(255, 255, 255, 0.12);
  --window-bg: rgba(10, 10, 10, 0.82);
  --window-border: rgba(255, 255, 255, 0.2);
  --text-dark: rgb(240, 240, 240);
  --text-mid: rgb(180, 180, 180);
  --text-muted: rgb(120, 120, 120);
  --btn-bg: linear-gradient(135deg, rgb(40, 40, 40), rgb(10, 10, 10));
  --calc-btn: rgba(255, 255, 255, 0.07);
  --calc-op: rgba(255, 255, 255, 0.1);
  --calc-eq: rgb(60, 60, 60);
  --sw-btn: rgba(255, 255, 255, 0.07);
  --dock-bg: rgba(255, 255, 255, 0.06);
  --dock-border: rgba(255, 255, 255, 0.12);
  --dock-emoji-bg: rgba(255, 255, 255, 0.06);
  --dock-emoji-border: rgba(255, 255, 255, 0.12);
  --display-bg: #000000;
  --display-color: #ffffff;
  --trail-color: 255, 255, 255;
  --clock-face: rgba(255, 255, 255, 0.06);
  --clock-hand: rgb(220, 220, 220);
  --clock-hand2: rgb(160, 160, 160);
  --clock-second: rgb(255, 80, 80);
}

/* ── Theme overrides ── */
.window {
  border-color: var(--window-border) !important;
  background-color: var(--window-bg) !important;
}

#top {
  background-color: var(--accent-rgba) !important;
}

#dock {
  background: var(--dock-bg) !important;
  border-color: var(--dock-border) !important;
}

.dock-emoji {
  background: var(--dock-emoji-bg) !important;
  border-color: var(--dock-emoji-border) !important;
}

.calc-btn {
  background: var(--calc-btn) !important;
  color: var(--text-dark) !important;
}

.calc-op {
  background: var(--calc-op) !important;
  color: var(--text-mid) !important;
}

.calc-eq {
  background: var(--calc-eq) !important;
  color: var(--display-color) !important;
}

.sw-btn {
  background: var(--sw-btn) !important;
  color: var(--text-dark) !important;
}

.app-icon-emoji-img {
  background: var(--dock-emoji-bg) !important;
  border-color: var(--dock-emoji-border) !important;
}

.app-icon.selected {
  background: var(--accent-light) !important;
  box-shadow: 0 0 0 2px var(--accent-border) !important;
}

body.black-theme #bgVideo { display: none; }
body.black-theme #trailCanvas { display: block !important; background: #000; }