/* ============================================================
   TsaqifAlk.xyz — Catppuccin Mocha Desktop Theme
   Pixel-match rifuki.dev visual output (vanilla CSS)
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --color-base: #1e1e2e;
  --color-mantle: #181825;
  --color-crust: #11111b;
  --color-surface0: #313244;
  --color-surface1: #45475a;
  --color-surface2: #585b70;
  --color-overlay0: #6c7086;
  --color-overlay1: #7f849c;
  --color-subtext0: #a6adc8;
  --color-subtext1: #bac2de;
  --color-text: #cdd6f4;
  --color-blue: #89b4fa;
  --color-mauve: #cba6f7;
  --color-green: #a6e3a1;
  --color-yellow: #f9e2af;
  --color-red: #f38ba8;
  --color-peach: #fab387;
  --color-lavender: #b4befe;
  --color-teal: #94e2d5;
  --color-sapphire: #74c7ec;
  --color-pink: #f5c2e7;
  --color-sky: #89dceb;
  --color-flamingo: #f2cdcd;

  --font-mono: 'JetBrains Mono', monospace;
  --window-blur: blur(24px);
  --window-bg: rgba(24, 24, 37, 0.9);
  --window-border: 1px solid rgba(49, 50, 68, 0.4);
  --window-shadow: 0 20px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.2);
  --window-radius: 12px;
  --titlebar-h: 36px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar — thin, Catppuccin */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-surface1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-surface2); }

/* Selection */
::selection {
  background: rgba(137, 180, 250, 0.3);
  color: var(--color-text);
}

/* User select none on everything */
* {
  -webkit-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* ============================================================
   BACKGROUND — Blobs + Grid + Vignette
   ============================================================ */

/* Animated gradient blobs */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  animation: blob-float 20s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.blob-1 {
  width: 500px; height: 500px;
  background: rgba(203, 166, 247, 0.13);
  top: 5%; left: 10%;
  animation-delay: 0s;
}
.blob-2 {
  width: 450px; height: 450px;
  background: rgba(137, 180, 250, 0.11);
  top: 60%; left: 70%;
  animation-delay: -5s;
}
.blob-3 {
  width: 400px; height: 400px;
  background: rgba(148, 226, 213, 0.1);
  top: 30%; left: 40%;
  animation-delay: -10s;
}
.blob-4 {
  width: 350px; height: 350px;
  background: rgba(243, 139, 168, 0.08);
  top: 70%; left: 20%;
  animation-delay: -15s;
}
.blob-5 {
  width: 380px; height: 380px;
  background: rgba(180, 190, 254, 0.09);
  top: 10%; left: 75%;
  animation-delay: -8s;
}

@keyframes blob-float {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(30px, -40px) scale(1.05); }
  50%  { transform: translate(-20px, 30px) scale(0.95); }
  75%  { transform: translate(40px, 20px) scale(1.02); }
  100% { transform: translate(-30px, -20px) scale(1); }
}

/* Grid overlay on desktop-workspace */
.desktop-workspace {
  position: absolute;
  inset: 36px 0 0 0;
  z-index: 1;
  overflow: hidden;
  background-image:
    linear-gradient(rgba(49, 50, 68, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 50, 68, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center center;
}

/* Star speckle texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 10%, rgba(255,255,255,0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.08) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 80%, rgba(255,255,255,0.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.12) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 45%, rgba(255,255,255,0.09) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 15%, rgba(255,255,255,0.11) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,0.07) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 35%, rgba(255,255,255,0.13) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 75%, rgba(255,255,255,0.1) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 25%, rgba(255,255,255,0.08) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 20% 70%, rgba(137,180,250,0.2) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 80% 30%, rgba(203,166,247,0.15) 0%, transparent 100%);
  background-size: 200px 200px;
}

/* Vignette */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
}

/* ============================================================
   TOPBAR — fixed, h-9, bg-crust/88, backdrop-blur(40px)
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(17, 17, 27, 0.88);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-bottom: 1px solid rgba(49, 50, 68, 0.2);
  font-size: 11px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--color-overlay0);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.topbar-btn:hover {
  background: rgba(49, 50, 68, 0.5);
  color: var(--color-blue);
}

.grid-btn {
  margin-right: 2px;
}

.topbar-clock {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-subtext1);
  letter-spacing: 0.02em;
}

.topbar-separator {
  width: 1px;
  height: 14px;
  background: rgba(49, 50, 68, 0.5);
  margin: 0 6px;
}

/* ============================================================
   WORKSPACE BUTTONS — topbar workspace tabs
   ============================================================ */
.ws-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 24px;
  border-radius: 6px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-overlay0);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.ws-btn:hover {
  background: rgba(49, 50, 68, 0.5);
  color: var(--color-subtext1);
}
.ws-btn.active {
  background: rgba(137, 180, 250, 0.15);
  color: var(--color-blue);
  border-bottom-color: rgba(137, 180, 250, 0.5);
}

.ws-btn svg {
  flex-shrink: 0;
}

/* ============================================================
   WINDOW BASE — bg-mantle/90 border-surface0/40 backdrop-blur(24px)
   ============================================================ */
.window {
  position: absolute;
  border-radius: var(--window-radius);
  background: rgba(24, 24, 37, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(49, 50, 68, 0.4);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.2),
    0 8px 10px -6px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fade-in 0.35s ease-out;
  will-change: transform;
}

/* Shadow on hover */
.window:hover {
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.25),
    0 8px 10px -6px rgba(0, 0, 0, 0.25);
}

/* Window Header / Titlebar — h-9, px-3.5, border-b surface0/25 */
.window-header {
  display: flex;
  align-items: center;
  height: var(--titlebar-h);
  padding: 0 14px;
  border-bottom: 1px solid rgba(49, 50, 68, 0.25);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}

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

/* Dragging state */
.window.dragging {
  opacity: 0.92;
  transition: none !important;
  will-change: transform;
}

/* Traffic light controls */
.window-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  position: relative;
}

/* Individual button — 12x12px rounded */
.ctrl {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ctrl.close    { background: #FF5F57; }
.ctrl.minimize { background: #FEBC2E; }
.ctrl.maximize { background: #28C840; }

/* Default: dimmed when window not hovered */
.window:not(:hover) .ctrl.close,
.window:not(:hover) .ctrl.minimize,
.window:not(:hover) .ctrl.maximize {
  opacity: 0.7;
}

/* Hover icons — show on controls group hover */
.ctrl .ctrl-icon {
  display: none;
  width: 8px;
  height: 8px;
}

.window-controls:hover .ctrl .ctrl-icon {
  display: block;
}

/* Icon SVGs inside buttons */
.ctrl-icon svg {
  width: 8px;
  height: 8px;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 2;
  fill: none;
}

.ctrl:hover {
  filter: brightness(0.85);
}

/* Window title */
.window-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-subtext1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.window-spacer {
  flex: 1;
}

.window-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-overlay1);
  margin-right: 4px;
}

.window-icon svg {
  width: 12px;
  height: 12px;
}

/* Window options button (⋯) — show on hover */
.window-options-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--color-overlay0);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
  margin-left: 4px;
  font-family: var(--font-mono);
  line-height: 1;
  letter-spacing: 1px;
}

.window:hover .window-options-btn {
  opacity: 1;
}

.window-options-btn:hover {
  background: rgba(49, 50, 68, 0.5);
  color: var(--color-subtext1);
}

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

/* ============================================================
   WINDOW POSITIONS — transform-based, matching rifuki.dev
   ============================================================ */

/* Left column */
#win-about {
  left: 1.56%;
  top: 20px;
  width: 25.78%;
  height: 49.5%;
  z-index: 1;
}

#win-chat {
  left: 1.56%;
  top: 56.9%;
  width: 25.78%;
  bottom: 20px;
  z-index: 2;
}

/* Middle column */
#win-terminal {
  left: 28.91%;
  top: 20px;
  width: 42.19%;
  height: 59.3%;
  z-index: 3;
}

/* Middle bottom row */
.mid-bottom-row {
  position: absolute;
  left: 28.91%;
  top: 66.7%;
  width: 42.19%;
  bottom: 20px;
  display: flex;
  gap: 3.7%;
  z-index: 4;
}

.mid-bottom-row .window {
  flex: 1;
  position: relative;
  height: 100%;
}

#win-life  { z-index: 4; }
#win-donut { z-index: 5; }
#win-sysinfo { z-index: 6; }

/* Right column */
#win-clock {
  left: 72.66%;
  top: 20px;
  width: 25.78%;
  height: 24.8%;
  z-index: 8;
}

#win-mikujam {
  left: 72.66%;
  top: 32.2%;
  width: 25.78%;
  bottom: 20px;
  z-index: 9;
}

/* ============================================================
   ABOUT WINDOW — with skill tags
   ============================================================ */
.about-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow-y: auto;
}

.about-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-mauve), var(--color-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-crust);
  overflow: hidden;
}

.about-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.about-info h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.about-info .about-role {
  font-size: 11px;
  color: var(--color-overlay1);
  font-weight: 500;
}

.about-bio {
  font-size: 12px;
  color: var(--color-subtext0);
  line-height: 1.5;
}

.about-bio p {
  margin-bottom: 2px;
}

/* Links grid layout (rifuki.dev style) */
.about-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
  border-top: 1px solid rgba(49, 50, 68, 0.25);
  padding-top: 10px;
  margin-top: 8px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(49, 50, 68, 0.3);
  border: 1px solid rgba(49, 50, 68, 0.4);
  color: var(--color-subtext1);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}
.link-card:hover {
  background: rgba(137, 180, 250, 0.15);
  color: var(--color-blue);
  border-color: rgba(137, 180, 250, 0.3);
}

.link-card svg {
  flex-shrink: 0;
}

/* Currently section (rifuki.dev style) */
.about-currently {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.section-header {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-overlay0);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.currently-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-subtext0);
  flex-wrap: wrap;
}

.currently-arrow {
  color: var(--color-overlay0);
  font-size: 12px;
}

.currently-label {
  color: var(--color-overlay1);
  font-size: 10px;
  font-weight: 500;
}

.pill-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(49, 50, 68, 0.4);
  border: 1px solid rgba(49, 50, 68, 0.5);
  color: var(--color-subtext1);
  font-size: 10px;
  font-weight: 500;
  transition: all 0.15s;
}

.pill-tag:hover {
  background: rgba(137, 180, 250, 0.12);
  border-color: rgba(137, 180, 250, 0.3);
  color: var(--color-blue);
}

/* ============================================================
   CHAT WINDOW
   ============================================================ */
.chat-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chisa-art-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  min-height: 0;
}

.chisa-art-area.expanded {
  flex: 0;
  min-height: 140px;
}

.chat-mode-buttons {
  display: flex;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(49, 50, 68, 0.2);
}

.chat-mode-btn {
  padding: 3px 8px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid rgba(49, 50, 68, 0.4);
  color: var(--color-subtext0);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-mode-btn:hover,
.chat-mode-btn.active {
  background: rgba(137, 180, 250, 0.12);
  color: var(--color-blue);
  border-color: rgba(137, 180, 250, 0.3);
}

.chat-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-mauve), var(--color-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-crust);
}

.chat-bubble {
  background: rgba(49, 50, 68, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
  max-width: 85%;
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-subtext1);
}

.chat-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-mauve);
  margin-bottom: 2px;
  display: block;
}

.chat-input-wrap {
  padding: 8px 10px;
  border-top: 1px solid rgba(49, 50, 68, 0.2);
  display: flex;
  gap: 6px;
}

.chat-input-wrap input {
  flex: 1;
  background: rgba(49, 50, 68, 0.3);
  border: 1px solid rgba(49, 50, 68, 0.5);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s;
}
.chat-input-wrap input:focus {
  border-color: var(--color-blue);
}

.chat-input-wrap button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(137, 180, 250, 0.15);
  border: 1px solid rgba(137, 180, 250, 0.3);
  color: var(--color-blue);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-input-wrap button:hover {
  background: rgba(137, 180, 250, 0.25);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}
.typing-indicator span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-overlay0);
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Freeroam */
.freeroam-content {
  display: none;
}

.freeroam-scene {
  position: relative;
  width: 100%;
  height: 100%;
}

.freeroam-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.freeroam-sparkles .sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: sparkle-fade 0.8s ease-out forwards;
  pointer-events: none;
}

@keyframes sparkle-fade {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.3) translateY(-12px); }
}

.interact-popup {
  position: absolute;
  font-size: 20px;
  animation: popup-rise 1s ease-out forwards;
  pointer-events: none;
  z-index: 20;
}

@keyframes popup-rise {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-30px) scale(1.3); }
}

.freeroam-text {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-overlay0);
  pointer-events: none;
}

/* Miku sprite */
.miku-sprite {
  width: 120px;
  height: 137px;
  background-image: url('/miku/spritesheet.webp');
  background-repeat: no-repeat;
  background-size: 1200px 1096px;
  background-position: 0 0;
  image-rendering: auto;
  flex-shrink: 0;
}

.miku-sprite-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.miku-sprite-freeroam {
  position: absolute;
  z-index: 10;
  pointer-events: auto;
  cursor: pointer;
}

/* ============================================================
   TERMINAL WINDOW — with heading + description
   ============================================================ */
.terminal-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-size: 12px;
  line-height: 1.6;
}

.term-env-select {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid rgba(49, 50, 68, 0.2);
}

.term-env-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0;
}

.term-env-desc {
  font-size: 11px;
  color: var(--color-overlay1);
  line-height: 1.4;
}

.term-env-options {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.term-env-btn {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(49, 50, 68, 0.4);
  border: 1px solid rgba(49, 50, 68, 0.5);
  color: var(--color-subtext0);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.term-env-btn:hover,
.term-env-btn.selected {
  background: rgba(203, 166, 247, 0.15);
  color: var(--color-mauve);
  border-color: rgba(203, 166, 247, 0.3);
}

.term-init-btn {
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(49, 50, 68, 0.3);
  border: 1px solid rgba(49, 50, 68, 0.4);
  color: var(--color-overlay1);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
  opacity: 0.5;
}
.term-init-btn.enabled {
  background: rgba(137, 180, 250, 0.15);
  border-color: rgba(137, 180, 250, 0.3);
  color: var(--color-blue);
  opacity: 1;
}
.term-init-btn.enabled:hover {
  background: rgba(137, 180, 250, 0.25);
}

.term-session {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.term-output {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-input-line {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-top: 1px solid rgba(49, 50, 68, 0.15);
}

.term-prompt {
  color: var(--color-green);
  font-weight: 600;
  margin-right: 6px;
  white-space: nowrap;
  font-size: 12px;
}

.term-input-line input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-text);
}

.term-line { margin: 0; }
.term-resp { color: var(--color-subtext0); }
.term-cmd-echo { color: var(--color-text); }
.term-info { color: var(--color-blue); }
.term-error { color: var(--color-red); }
.term-accent { color: var(--color-mauve); }
.term-prompt-text { color: var(--color-subtext0); font-size: 11px; }

/* ============================================================
   LIFE WINDOW
   ============================================================ */
.life-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.life-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-subtext0);
}

.life-gen {
  display: flex;
  gap: 4px;
}

.life-hint {
  font-size: 9px;
  color: var(--color-overlay0);
}

#lifeCanvas {
  flex: 1;
  width: 100%;
  display: block;
}

/* ============================================================
   DONUT WINDOW
   ============================================================ */
.donut-body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 8px;
}

.donut-pre {
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.1;
  color: var(--color-mauve);
  white-space: pre;
  text-align: center;
}

/* ============================================================
   SYSINFO WINDOW — HOST/KERN/UPTIME/CPU LOAD format
   ============================================================ */
.sysinfo-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  height: 100%;
  justify-content: center;
}

.sysinfo-bar-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sysinfo-accent {
  color: var(--color-blue) !important;
}

.sysinfo-bar {
  width: 100%;
  height: 4px;
  background: rgba(49, 50, 68, 0.4);
  border-radius: 2px;
  overflow: hidden;
}

.sysinfo-bar-fill {
  height: 100%;
  background: var(--color-blue);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.sysinfo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sysinfo-label {
  color: var(--color-overlay1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
}

.sysinfo-value {
  color: var(--color-text);
  font-weight: 500;
  font-size: 11px;
}

.sysinfo-pct {
  color: var(--color-overlay1);
  font-weight: 500;
  font-size: 11px;
  margin-left: 1px;
}

/* ============================================================
   CLOCK WINDOW — large time + greeting + date
   ============================================================ */
.clock-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 12px;
  gap: 2px;
}

.clock-greeting {
  font-size: 11px;
  color: var(--color-subtext0);
  font-weight: 500;
}

.greeting-prefix {
  color: var(--color-overlay0);
}

.clock-time {
  font-size: 40px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -1px;
  line-height: 1.1;
}

.clock-date {
  font-size: 11px;
  color: var(--color-overlay1);
  font-weight: 400;
}

.clock-tz {
  font-size: 9px;
  color: var(--color-overlay0);
}

/* ============================================================
   MIKUJAM MUSIC PLAYER
   ============================================================ */
.music-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.music-player {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.music-now-playing {
  display: flex;
  gap: 10px;
  padding: 10px 10px 6px;
  align-items: center;
}

.music-album-art {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  background: rgba(49, 50, 68, 0.4);
}

.music-album-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.music-info {
  flex: 1;
  min-width: 0;
}

.music-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.music-artist {
  font-size: 11px;
  color: var(--color-subtext0);
  font-weight: 400;
}

.music-embed {
  padding: 0 10px 4px;
}

.music-embed iframe,
.music-embed > div {
  width: 1px !important;
  height: 1px !important;
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  overflow: hidden;
}

.music-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 10px 6px;
}

.music-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(49, 50, 68, 0.4);
  border: 1px solid rgba(49, 50, 68, 0.5);
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.music-btn:hover {
  background: rgba(137, 180, 250, 0.15);
  color: var(--color-blue);
  border-color: rgba(137, 180, 250, 0.3);
}
.music-btn.play-btn {
  width: 34px;
  height: 34px;
}

.music-btn.game-btn {
  width: auto;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.game-btn-label {
  font-size: 10px;
}

.music-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 4px;
}

.music-time {
  font-size: 9px;
  color: var(--color-overlay0);
  font-weight: 500;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
}

/* Range slider */
.music-slider {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(49, 50, 68, 0.5);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.music-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-blue);
  cursor: pointer;
  border: none;
}

.music-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-blue);
  cursor: pointer;
  border: none;
}

/* Track counter */
.music-counter-row {
  display: flex;
  justify-content: center;
  padding: 2px 10px 4px;
}

.music-track-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 18px;
  border-radius: 9px;
  background: rgba(49, 50, 68, 0.4);
  font-size: 9px;
  font-weight: 700;
  color: var(--color-overlay1);
}

.music-tracks {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 10px;
}

.music-track {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 11px;
  color: var(--color-subtext1);
}
.music-track:hover {
  background: rgba(49, 50, 68, 0.35);
}
.music-track.active {
  background: rgba(137, 180, 250, 0.1);
  color: var(--color-blue);
}

.music-track .track-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
}

.music-track .track-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.music-track .track-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
}

.music-track .track-artist-label {
  color: var(--color-overlay0);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   DOCK — for minimized windows
   ============================================================ */
.dock {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(24, 24, 37, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(49, 50, 68, 0.35);
  border-radius: 14px;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: all 0.15s;
}
.dock-item:hover {
  background: rgba(49, 50, 68, 0.3);
  transform: translateY(-2px);
}

.dock-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-subtext0);
}

.dock-item span:last-child {
  font-size: 10px;
  color: var(--color-subtext0);
}

/* ============================================================
   COLOR HELPERS
   ============================================================ */
.hl-accent { color: var(--color-blue); }
.hl-purple { color: var(--color-mauve); }
.hl-pink   { color: var(--color-red); }
.hl-cyan   { color: var(--color-teal); }
.hl-green  { color: var(--color-green); }
.hl-yellow { color: var(--color-yellow); }
.hl-peach  { color: var(--color-peach); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes minimized-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.8); }
}

.window.minimized {
  animation: minimized-out 0.3s ease-in forwards;
}

/* ============================================================
   MOBILE RESPONSIVE (< 900px)
   ============================================================ */
@media (max-width: 900px) {
  html, body {
    height: 100vh;
    overflow: auto;
    overflow-x: hidden;
  }

  .desktop-workspace {
    position: relative;
    inset: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    padding-top: 46px;
    padding-bottom: 46px;
    min-height: 100vh;
  }

  .window {
    position: relative !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    height: auto !important;
    min-height: 120px;
  }

  #win-about, #win-chat, #win-terminal, #win-life,
  #win-donut, #win-sysinfo, #win-clock, #win-mikujam {
    position: relative !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
    z-index: auto;
  }

  #win-chat { min-height: 200px; }
  #win-terminal { min-height: 250px; }
  #win-clock { min-height: 100px; }
  #win-mikujam { min-height: 200px; flex: 1; }

  .mid-bottom-row {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 10px;
  }

  .mid-bottom-row .window {
    flex: 1;
    min-height: 140px;
  }

  .dock { display: none; }

  .blob {
    filter: blur(60px);
    opacity: 0.7;
  }
}

@media (max-width: 480px) {
  .mid-bottom-row {
    flex-direction: column;
  }
  .clock-time { font-size: 28px; }
  .about-links { justify-content: center; }
  .music-album-art { width: 40px; height: 40px; }
}

/* Utility */
.hidden { display: none !important; }
