:root {
  --bg-deep: #1b1523;
  --bg-panel: #2a2136;
  --bg-panel-light: #352a45;
  --bg-sidebar: #241d2e;
  --border-soft: #453a56;
  --text-main: #ece7f2;
  --text-dim: #a99cc0;
  --accent-k: #d861a8;      /*kanade  */
  --accent-yuki: #7f9fd6;   /* mafuyu */
  --accent-ena: #d8d8e0;    /* ena */
  --accent-amia: #f0a8c8;   /* mizuki */
  --accent-glow: #b06fd8;
  --online: #3ddc84;
  --font-ui: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}
body.desktop {
  font-family: var(--font-ui);
  color: var(--text-main);
  background:
    radial-gradient(circle at 20% 15%, rgba(216,97,168,0.18), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(127,159,214,0.16), transparent 45%),
    linear-gradient(160deg, #120e18 0%, #1b1523 55%, #241a30 100%);
  position: relative;
  min-height: 100vh;
  user-select: none;
}
/* ---------- menu bar ---------- */
.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 34px;
  background: rgba(20, 15, 27, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 13px;
  z-index: 500;
}
.menubar-left { display: flex; align-items: center; gap: 18px; }
.menu-logo { color: var(--accent-k); font-weight: 600; letter-spacing: 0.02em; }
.menu-item { color: var(--text-dim); cursor: default; }
.menubar-right { color: var(--text-dim); font-variant-numeric: tabular-nums; }
/* ---------- desktop icons ---------- */
.desktop-icons {
  position: fixed;
  top: 50px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 10;
}
.desktop-icon {
  background: none;
  border: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 8px;
}
.desktop-icon:hover { background: rgba(255,255,255,0.06); }
.icon-glyph {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: linear-gradient(145deg, var(--bg-panel-light), var(--bg-panel));
  border: 1px solid var(--border-soft);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.icon-chat { color: var(--accent-k); }
.icon-daw { color: var(--accent-yuki); }
.icon-player { color: var(--accent-amia); }
.icon-profile { color: var(--accent-k); font-weight: 700; }
.icon-label {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
/* ---------- generic window chrome ---------- */
.window {
  position: fixed;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.02);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 260px;
  min-height: 180px;
  z-index: 50;
}
.window.hidden { display: none; }
.window.focused { z-index: 200; box-shadow: 0 24px 70px rgba(0,0,0,0.65), 0 0 0 1px var(--accent-glow); }
.window-titlebar {
  height: 36px;
  background: linear-gradient(180deg, #2f2540, #251b32);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  cursor: grab;
  flex-shrink: 0;
}
.window-titlebar:active { cursor: grabbing; }
.window-title {
  font-size: 12.5px;
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.window-controls { display: flex; gap: 8px; }
.win-btn {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
}
.win-min { background: #e8b64c; }
.win-close { background: #e8607a; }
.win-btn:hover { filter: brightness(1.2); }
.window-body { flex: 1; min-height: 0; display: flex; }
/* ---------- taskbar ---------- */
.taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 40px;
  background: rgba(20, 15, 27, 0.9);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  z-index: 500;
  font-size: 12px;
}
.taskbar-label { color: var(--text-dim); }
.taskbar-apps { display: flex; gap: 8px; }
.taskbar-app {
  background: var(--bg-panel-light);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}
.taskbar-app:hover { border-color: var(--accent-glow); }
/* =========================================================
   CHAT WINDOW
   ========================================================= */
.chat-body { }
.chat-sidebar {
  width: 190px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  overflow-y: auto;
}
.server-name {
  padding: 0 12px 10px 12px;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chev { color: var(--text-dim); font-size: 10px; }
.channel-group-label {
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px 4px;
}
.channel-list, .member-list { list-style: none; margin: 0; padding: 0 6px; }
.channel {
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.channel:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.channel.active { background: var(--bg-panel-light); color: var(--text-main); }
.member-list { margin-top: 4px; }
.member {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  position: relative;
}
.member:hover { background: rgba(255,255,255,0.05); }
.member-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #1b1523;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.avatar-k { background: var(--accent-k); color: #fff; }
.avatar-yuki { background: var(--accent-yuki); }
.avatar-ena { background: var(--accent-ena); }
.avatar-amia { background: var(--accent-amia); }
.member-name { color: var(--text-main); }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--online);
  position: absolute;
  right: 8px;
  box-shadow: 0 0 0 2px var(--bg-sidebar);
}
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-header {
  height: 40px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  flex-shrink: 0;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msg {
  display: flex;
  gap: 10px;
}
.chat-msg .member-avatar { margin-top: 2px; }
.chat-msg-body { min-width: 0; }
.chat-msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.chat-msg-name { font-size: 13px; font-weight: 700; }
.chat-msg-time { font-size: 10.5px; color: var(--text-dim); }
.chat-msg-text { font-size: 13.5px; line-height: 1.5; color: var(--text-main); word-break: break-word; }
.chat-msg.self .chat-msg-name { color: var(--accent-glow); }
.chat-input-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-soft);
}
.chat-input-row input {
  flex: 1;
  background: var(--bg-panel-light);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent-glow); }
.send-btn {
  background: var(--accent-k);
  border: none;
  color: #fff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 14px;
}
/* =========================================================
   DAW WINDOW
   ========================================================= */
.daw-body { flex-direction: column; padding: 12px; gap: 10px; }
.daw-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.daw-transport {
  background: var(--bg-panel-light);
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  border-radius: 6px;
  width: 32px;
  height: 28px;
  cursor: pointer;
  font-size: 12px;
}
.daw-transport:hover { border-color: var(--accent-glow); }
.daw-timecode { font-variant-numeric: tabular-nums; color: var(--text-main); font-size: 13px; }
.daw-bpm b, .daw-key b { color: var(--text-main); }
.daw-tracks {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.daw-track {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 8px 10px;
}
.daw-track-label {
  width: 90px;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
}
.daw-waveform {
  position: relative;
  flex: 1;
  height: 34px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-panel);
}
.daw-waveform-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
}
.daw-waveform-bars span {
  flex: 1;
  border-radius: 1px;
  opacity: 0.85;
}
.daw-playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent-glow);
  left: 0;
  box-shadow: 0 0 6px var(--accent-glow);
}
/* =========================================================
   MUSIC PLAYER WINDOW
   ========================================================= */
.player-body {
  flex-direction: column;
  align-items: center;
  padding: 20px 18px;
  gap: 12px;
  overflow-y: auto;
}
.player-art {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  background-color: var(--accent-k);
  background-image: linear-gradient(145deg, var(--accent-k), var(--accent-yuki));
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
}
.player-meta { text-align: center; }
.player-track-title { font-size: 15px; font-weight: 700; }
.player-track-artist { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.player-progress { width: 100%; }
.player-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--bg-sidebar);
  border-radius: 3px;
  overflow: hidden;
}
.player-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-k);
}
.player-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.player-controls { display: flex; align-items: center; gap: 18px; }
.player-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 18px;
  cursor: pointer;
}
.player-btn-main {
  background: var(--accent-k);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 15px;
}
.player-playlist {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.player-playlist li {
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}
.player-playlist li:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.player-playlist li.playing { background: var(--bg-panel-light); color: var(--accent-amia); }
/* =========================================================
   PROFILE MODAL (discord-card replica)
   ========================================================= */
.profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 14, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.profile-overlay.open { display: flex; }
.profile-card {
  width: 360px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.profile-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  font-size: 13px;
}
.profile-banner {
  height: 100px;
  background-color: var(--accent-k);
  background-image: linear-gradient(120deg, var(--accent-k), var(--accent-glow), var(--accent-yuki));
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}
.profile-avatar-wrap {
  margin-top: -40px;
  padding-left: 20px;
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 5px solid var(--bg-panel);
  background-color: var(--accent-k);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
}
.profile-content { padding: 14px 20px 22px; }
.profile-name { margin: 8px 0 0; font-size: 20px; }
.profile-handle { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }
.profile-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.profile-badge {
  background: var(--bg-panel-light);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: 10.5px;
  padding: 3px 8px;
  color: var(--text-dim);
}
.profile-section {
  margin-top: 16px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
}
.profile-section h3 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.profile-section p { margin: 0; font-size: 13px; line-height: 1.6; }
.profile-fact-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 4px 0;
}
.profile-fact-label { color: var(--text-dim); }
.profile-fact-value { font-weight: 600; text-align: right; }
.countdown {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-amia);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.countdown-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.profile-gallery-tile,
.profile-gallery-img {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, var(--bg-panel-light), var(--bg-panel-light) 6px, var(--bg-panel) 6px, var(--bg-panel) 12px);
  border: 1px dashed var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  color: var(--text-dim);
  text-align: center;
  padding: 4px;
  object-fit: contain;
}
.profile-gallery-img:not(.no-image) {
  border-style: solid;
  padding: 0;
  color: transparent;
  background: var(--bg-sidebar);
}