:root {
  --canvas-w: 1024px;
  --canvas-h: 768px;
  --taskbar-h: 30px;
  --taskbar-stack-h: var(--taskbar-h);
  --win-face: #c0c0c0;
  --win-face-app: #9a9a9a;
  --win-highlight: #ffffff;
  --win-shadow: #808080;
  --win-dark: #000000;
  --title-start: #000080;
  --title-end: #1084d0;
  --label-bg: #008080;
  --label-text: #ffffff;
  --desktop-font: "Tahoma", "MS Sans Serif", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  font-family: var(--desktop-font);
  font-size: 11px;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

html {
  background-color: #000000;
}

body.win95 {
  background-color: #000000;
  min-height: 100vh;
  min-height: 100dvh;
}

body.win95::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #000000;
  background-image: url("bliss-desktop.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.win95-viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  background-color: #000000;
}

.win95-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
}

.layout-switch {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 200;
  color: #fff;
  background: var(--label-bg);
  padding: 3px 8px;
  text-decoration: none;
  border: 1px solid var(--win-highlight);
  box-shadow: 1px 1px 0 var(--win-dark);
}

.layout-switch--menu {
  position: static;
  display: block;
  padding: 6px 10px;
  box-shadow: none;
  border: 0;
  background: transparent;
  color: inherit;
}

.desktop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: var(--taskbar-stack-h);
  height: auto;
  background-color: #000000;
  background-image: url("bliss-desktop.png");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  overflow: hidden;
}

/* Bass plane smoke trail (above icons, below plane sprite). */
.bass-plane-smoke-canvas {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}

/* Bass plane: flies above desktop icons; dragged icons still rise via .desk-icon.is-dragging. */
.bass-plane {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  width: 128px;
  height: auto;
  overflow: visible;
  cursor: default;
  pointer-events: auto;
  touch-action: manipulation;
  transform: translate(0, 0);
  will-change: transform;
}
.bass-plane:focus-visible {
  outline: 1px dotted #fff;
  outline-offset: 2px;
}
.bass-plane-body {
  display: block;
  position: relative;
  width: 100%;
  line-height: 0;
  transform-origin: 50% 52%;
}
.bass-plane-sprite {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}
/* No-click badge on fuselage (aft of wing, before tail); scales with sprite box */
.bass-plane-no-click {
  position: absolute;
  left: 61.5%;
  top: 48%;
  width: 16%;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 0.55px #111) drop-shadow(0 0 0.55px #111);
  z-index: 2;
}
.bass-plane-finger {
  position: absolute;
  left: 38%;
  top: 22%;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.15);
  transition: opacity 0.1s ease-out, transform 0.14s ease-out;
  z-index: 6;
  filter: drop-shadow(0 0 1px #000);
}
.bass-plane-finger.is-visible {
  opacity: 1;
  transform: scale(4.5);
}
/* Tail exhaust: blue meets orange at rudder base; rotates with .bass-plane-body */
.bass-plane-smoke-anchor {
  position: absolute;
  left: 94.8%;
  top: 46.2%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.bass-plane-burst {
  position: absolute;
  left: 35%;
  top: 40%;
  width: 8px;
  height: 8px;
  pointer-events: none;
  opacity: 0;
}
.bass-plane-burst.is-active {
  animation: bass-plane-explode 0.65s steps(6) forwards;
}
.bass-plane-burst::before,
.bass-plane-burst::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffcc00 35%, #ff6600 55%, transparent 70%);
  opacity: 0;
}
.bass-plane-burst.is-active::before {
  animation: bass-plane-flash 0.65s ease-out forwards;
}
.bass-plane-burst.is-active::after {
  inset: -20px;
  background: radial-gradient(circle, transparent 30%, #333 32%, #111 40%, transparent 55%);
  animation: bass-plane-smoke 0.65s ease-out forwards;
}
@keyframes bass-plane-flash {
  0% { opacity: 0; transform: scale(0.3); }
  25% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(1.8); }
}
@keyframes bass-plane-smoke {
  0% { opacity: 0; transform: scale(0.5); }
  40% { opacity: 0.85; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.4); }
}
@keyframes bass-plane-explode {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
.bass-plane.is-explode .bass-plane-body {
  opacity: 0;
  visibility: hidden;
}
.bass-plane.is-hidden,
.bass-plane.is-waiting {
  visibility: hidden;
  pointer-events: none;
}

.desktop-icons {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.desk-icon {
  position: absolute;
  width: 72px;
  padding: 0;
  margin: 0;
  border: 1px dotted transparent;
  background: transparent;
  color: var(--label-text);
  cursor: default;
  font: inherit;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}
.desk-icon.is-dragging {
  z-index: 60;
  opacity: 0.9;
}
/* Art desktop icons: width matches full teal label (Bookings is the widest). */
.desk-icon--art {
  width: 80px;
}
.desk-icon:focus-visible {
  outline: none;
}
.desk-icon-visual {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  transform-origin: center bottom;
  transition: transform 0.12s ease-out;
}
.desk-icon.selected .desk-icon-visual {
  transform: scale(1.07);
}
.desk-icon.press-pulse .desk-icon-visual {
  animation: desk-icon-vibrate 0.2s ease-out;
}
@keyframes desk-icon-vibrate {
  0% { transform: scale(var(--icon-scale, 1)); }
  15% { transform: scale(var(--icon-scale, 1)) translate(-1.5px, 1px); }
  30% { transform: scale(var(--icon-scale, 1)) translate(1.5px, -1px); }
  45% { transform: scale(var(--icon-scale, 1)) translate(-1px, -1px); }
  60% { transform: scale(var(--icon-scale, 1)) translate(1px, 0.5px); }
  100% { transform: scale(var(--icon-scale, 1)); }
}
.desk-icon.selected {
  --icon-scale: 1.07;
}
.desk-icon:not(.selected) {
  --icon-scale: 1;
}
.desk-icon .glyph {
  width: 32px;
  height: 32px;
  margin: 0 auto 4px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: grid;
  place-items: center;
}
.desk-icon .glyph img {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.desk-icon .label {
  display: inline-block;
  padding: 1px 3px;
  background: var(--label-bg);
  line-height: 1.2;
  word-break: break-word;
  align-self: center;
}
.desk-icon--art .label {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}
.desk-icon .glyph--art {
  width: 100%;
  height: 48px;
  margin: 0 0 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.desk-icon .glyph--art img,
.desk-icon .glyph--art .about-silhouette {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.desk-icon[data-icon-id="soundcloud"] .glyph--art img {
  width: 76.5%;
}
.glyph--about {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.glyph--about .about-silhouette {
  display: block;
  max-height: 100%;
}

.lock-icon.glyph--art {
  position: relative;
  overflow: visible;
  align-items: flex-end;
  width: 28px;
  height: 34px;
  margin-left: auto;
  margin-right: auto;
}
.lock-icon .lock-img {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 34px;
  transform: translateX(-50%);
  object-fit: contain;
  object-position: bottom center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}
.lock-icon .lock-img--closed {
  filter: brightness(0.82) contrast(1.08) saturate(0.92) hue-rotate(11deg);
}
html.member .lock-icon .lock-img--open {
  filter: brightness(1.15) contrast(1.05) saturate(1.08) hue-rotate(11deg);
}
html:not(.member) .lock-icon .lock-img--open {
  display: none;
}
html.member .lock-icon .lock-img--closed {
  display: none;
}

.bevel-out {
  border: 2px solid;
  border-color: var(--win-highlight) var(--win-dark) var(--win-dark) var(--win-highlight);
  background: var(--win-face);
}
.bevel-in {
  border: 2px solid;
  border-color: var(--win-dark) var(--win-highlight) var(--win-highlight) var(--win-dark);
  background: var(--win-face);
}

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 2px;
  min-height: var(--taskbar-h);
  height: var(--taskbar-h);
  padding: 2px 3px;
  padding-bottom: calc(2px + env(safe-area-inset-bottom, 0px));
  background: var(--win-face);
  border-top: 2px solid var(--win-highlight);
  z-index: 100;
  overflow: visible;
  box-sizing: border-box;
  min-width: 0;
}

.taskbar-quick {
  display: flex;
  align-items: stretch;
  gap: 2px;
  flex-shrink: 0;
}

.taskbar-grow {
  flex: 1 1 8px;
  min-width: 4px;
}

@media (max-width: 760px) {
  :root {
    --taskbar-inner-h: 28px;
  }

  .taskbar .app-launch-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .taskbar.bevel-out {
    border: 0;
    border-top: 2px solid var(--win-highlight);
    box-shadow: none;
    align-items: center;
    gap: 3px;
    padding: 3px 4px;
    padding-bottom: calc(3px + env(safe-area-inset-bottom, 0px));
    height: auto;
    min-height: calc(var(--taskbar-inner-h) + 8px + env(safe-area-inset-bottom, 0px));
  }

  .taskbar .start-btn {
    height: var(--taskbar-inner-h);
    align-self: center;
    flex-shrink: 0;
  }

  .start-btn-img {
    height: 24px;
    max-width: 56px;
  }

  .taskbar-quick,
  .tray.bevel-in {
    display: flex;
    align-items: center;
    align-self: center;
    height: var(--taskbar-inner-h);
    min-height: var(--taskbar-inner-h);
    max-height: var(--taskbar-inner-h);
    padding: 1px 2px;
    gap: 1px;
    box-sizing: border-box;
    flex-shrink: 0;
    background: var(--win-face);
    border: 2px solid;
    border-color: var(--win-shadow) var(--win-highlight) var(--win-highlight) var(--win-shadow);
  }

  .taskbar-quick {
    margin: 0;
  }

  .taskbar .app-launch {
    width: 28px;
    min-width: 28px;
    height: 100%;
    min-height: 0;
    padding: 0;
    margin: 0;
    gap: 0;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    background: var(--win-face);
  }

  .taskbar .app-launch img,
  .taskbar .app-launch svg {
    width: 16px;
    height: 16px;
  }

  .taskbar-grow {
    flex: 1 1 8px;
    min-width: 4px;
    align-self: stretch;
  }

  .taskbar-apps:not(:empty) {
    align-self: center;
    height: var(--taskbar-inner-h);
    max-height: var(--taskbar-inner-h);
    max-width: min(38%, 180px);
    margin-left: 2px;
    padding-left: 4px;
    align-items: center;
  }

  .taskbar-app {
    max-height: calc(var(--taskbar-inner-h) - 2px);
  }

  .tray {
    gap: 2px;
    padding: 0;
    margin: 0;
    max-width: none;
    align-self: center;
  }

  .tray-vol {
    display: flex;
    align-items: center;
    height: 100%;
  }

  .tray-vol button,
  .vol-popup-toggle {
    width: 26px;
    height: calc(var(--taskbar-inner-h) - 4px);
    min-width: 26px;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .tray-vol-icon {
    width: 16px;
    height: 16px;
  }

  .tray .tray-clock.bevel-in {
    border: 0;
    background: transparent;
    box-shadow: none;
    min-width: 0;
    height: auto;
    align-self: center;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    font-size: 10px;
    padding: 0 4px;
    line-height: 1.05;
  }

  .tray-clock .date {
    display: block;
    font-size: 9px;
  }

  .tray-clock .time {
    font-size: 10px;
  }
}

.taskbar .start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1px;
  margin: 0;
  border: 0;
  background: transparent;
  min-width: 0;
  height: 100%;
  cursor: default;
  flex-shrink: 0;
}
.taskbar .start-btn:focus-visible {
  outline: 1px dotted #000;
  outline-offset: 1px;
}
.start-btn-img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 76px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
  filter: contrast(1.06) saturate(1.08);
}
.taskbar .start-btn:active .start-btn-img {
  transform: translate(1px, 1px);
  filter: contrast(1.06) saturate(1.08) brightness(0.92);
}

.taskbar-apps {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  flex: 0 1 auto;
  max-width: min(52%, 420px);
  overflow-x: auto;
  overflow-y: hidden;
  margin-left: 4px;
  padding-left: 6px;
  border-left: 1px solid var(--win-shadow);
  box-shadow: -1px 0 0 var(--win-highlight);
  scrollbar-width: none;
}

.taskbar-apps:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.taskbar-apps::-webkit-scrollbar {
  display: none;
}
.taskbar-app {
  display: flex;
  align-items: stretch;
  min-width: 0;
  max-width: 132px;
  flex: 0 1 auto;
  padding: 1px;
  background: var(--win-face-app);
}
.taskbar-app.active {
  background: #8c8c8c;
  box-shadow: inset 1px 1px 0 var(--win-shadow), inset -1px -1px 0 var(--win-highlight);
}
.taskbar-app-main {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 5px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: default;
  text-align: left;
}
.taskbar-app-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.taskbar-app-close {
  width: 16px;
  padding: 0;
  margin-left: 1px;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  flex-shrink: 0;
  cursor: default;
  background: var(--win-face-app);
}
.taskbar-app.active .taskbar-app-close {
  background: #8c8c8c;
}

.taskbar .app-launch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  min-width: 28px;
  flex-shrink: 0;
  cursor: default;
  font: inherit;
  white-space: nowrap;
  background: var(--win-face);
}
.taskbar .app-launch img,
.taskbar .app-launch svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.taskbar .app-launch img.taskbar-icon {
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.tray {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 2px 0 4px;
  flex-shrink: 0;
}
.tray-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  line-height: 1.1;
  padding: 1px 6px;
  min-width: 72px;
  font-size: 11px;
}
.tray-clock .time {
  display: block;
  order: 1;
  white-space: nowrap;
}
.tray-clock .date {
  display: block;
  order: 2;
  font-size: 10px;
  white-space: nowrap;
}

.tray-vol {
  position: relative;
  z-index: 160;
  overflow: visible;
}
.tray-vol button {
  width: 22px;
  height: 22px;
  padding: 0;
  cursor: default;
  font: inherit;
}
.tray-vol-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tray-vol-icon {
  display: block;
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}
.vol-popup {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: 44px;
  min-height: 140px;
  padding: 8px 6px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 500;
  background: var(--win-face);
  pointer-events: auto;
}
.vol-popup.open { display: flex; }
.vol-popup input[type="range"] {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 28px;
  height: 92px;
  margin: 0 auto 2px;
  padding: 0 0 11px;
  box-sizing: content-box;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}
.vol-popup input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none;
  width: 3px;
  height: 92px;
  background: #fff;
  border: 1px solid #808080;
  box-shadow: inset 1px 0 0 #404040;
}
.vol-popup input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-left: -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #4db0f0 0%, #000080 72%);
  border: 1px solid #000040;
  box-shadow: 0 0 0 1px #a8a8a8;
}
.vol-popup input[type="range"]::-moz-range-track {
  width: 3px;
  height: 92px;
  background: #fff;
  border: 1px solid #808080;
  box-shadow: inset 1px 0 0 #404040;
}
.vol-popup input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid #000040;
  background: radial-gradient(circle at 32% 28%, #4db0f0 0%, #000080 72%);
  box-shadow: 0 0 0 1px #a8a8a8;
}
.vol-popup label { font-size: 10px; }
.vol-popup-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
}
.vol-popup-toggle img {
  display: block;
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

.start-menu {
  position: absolute;
  left: 2px;
  bottom: var(--taskbar-stack-h);
  display: none;
  flex-direction: row;
  align-items: stretch;
  padding: 2px;
  z-index: 120;
  box-shadow: 2px 2px 0 #404040;
}
.start-menu.open { display: flex; }
.start-menu-banner {
  width: 26px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #000080 0%, #1084d0 55%, #000080 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px 2px;
}
.start-menu-banner-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #e8e8e8;
  font-weight: bold;
  font-size: 16px;
  letter-spacing: 0.5px;
  line-height: 1;
  white-space: nowrap;
}
.start-menu-banner-text sup {
  font-size: 8px;
  vertical-align: super;
}
.start-menu-panel {
  min-width: 196px;
  background: var(--win-face);
  padding: 2px 0;
  display: flex;
  flex-direction: column;
}
.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 11px;
  cursor: default;
  color: #000;
}
.start-menu-item:hover,
.start-menu-item:focus-visible {
  background: #000080;
  color: #fff;
}
.start-menu-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.start-menu-icon img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.start-menu-sep {
  height: 2px;
  margin: 3px 4px;
  border: 0;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
  background: var(--win-face);
}
.start-menu-label u {
  text-decoration: underline;
  text-underline-offset: 1px;
}

.shutdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 250000;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.shutdown-overlay.open {
  display: flex;
}

body.system-shutdown .win95-viewport {
  visibility: hidden;
  pointer-events: none;
}

body.system-shutdown #pixel-cursor {
  display: none !important;
}
.shutdown-text {
  margin: 0;
  color: #fff;
  font-family: "VT323", "Courier New", monospace;
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.25;
  text-align: center;
  letter-spacing: 0.02em;
}

.field-honey {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.join-key-hint {
  margin: 0 0 12px;
  font-style: italic;
  line-height: 1.35;
}

.window.contact { top: 80px; left: 200px; width: 360px; }

.window {
  position: absolute;
  min-width: 320px;
  max-width: none;
  display: none;
  flex-direction: column;
  padding: 2px;
  background: var(--win-face);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  z-index: 10;
}
.window.open { display: flex; }

.window .titlebar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  background: linear-gradient(90deg, var(--title-start), var(--title-end));
  color: #fff;
  font-weight: bold;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.window .titlebar span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar-btns { display: flex; gap: 2px; }
.titlebar-btns button {
  width: 16px;
  height: 14px;
  padding: 0;
  line-height: 1;
  font-size: 10px;
  font-weight: bold;
  cursor: default;
}

.window .body {
  padding: 8px;
  background: var(--win-face);
  overflow: auto;
  max-height: 420px;
  font-size: 11px;
}
.window.music .body { display: flex; flex-direction: column; min-height: 280px; }

.mp3-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
}
.mp3-tabs.is-hidden,
#win-music.unreleased-mode .mp3-tabs {
  display: none !important;
}
#win-music.unreleased-mode [data-mp3-tab="sets"] {
  display: none !important;
}
.mp3-tabs button {
  padding: 4px 12px;
  font: inherit;
  cursor: default;
}
.mp3-tabs button.active {
  background: #fff;
}

.now {
  border: 1px inset var(--win-shadow);
  padding: 6px;
  margin-bottom: 8px;
  background: #fff;
}
.now .k { color: #666; font-size: 10px; }
.now .t { font-size: 14px; font-weight: bold; }
.transport { display: flex; gap: 4px; align-items: center; margin: 6px 0; flex-wrap: nowrap; }
.transport button { min-width: 36px; min-height: 24px; font: inherit; cursor: default; }
.meter {
  flex: 1;
  min-width: 80px;
  height: 12px;
  background: #fff;
  cursor: pointer;
}
.meter > i { display: block; height: 100%; width: 0; background: #000080; }
.lib-head { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 10px; }
.tracks {
  flex: 1;
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px inset var(--win-shadow);
}
.track {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid #ddd;
  background: #fff;
  color: #000;
  font: inherit;
  cursor: default;
}
.track.has-dl {
  grid-template-columns: 28px 1fr auto auto;
}
.track .n { color: #666; font-variant-numeric: tabular-nums; }
.track .track-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track .track-dur { font-variant-numeric: tabular-nums; white-space: nowrap; }
.track-dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  color: #000;
  cursor: default;
  line-height: 1.2;
}
.track-dl:hover { color: #000080; }
.track.on .track-dl,
.track.active .track-dl {
  border-color: #c0c0c0 #404040 #404040 #c0c0c0;
  color: #000;
}
.track.on,
.track.active { background: #000080; color: #fff; }
.track.on .n,
.track.active .n { color: #fff; }
.track.on .track-dur,
.track.active .track-dur { color: #fff; }
.via, .status { font-size: 10px; margin-top: 6px; color: #333; }
.go { margin-top: 8px; padding: 4px 12px; font: inherit; cursor: default; }

label { display: block; margin-bottom: 6px; }
input, textarea {
  width: 100%;
  margin-top: 2px;
  font: inherit;
  padding: 3px;
}

.bab { margin-top: 12px; }
.bab-k { font-size: 10px; margin-bottom: 6px; }
.bab-card {
  background: #121614;
  color: #e7f6e4;
  border: 1px solid #243028;
  border-radius: 12px;
  padding: 14px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}
.bab-head, .bab-dow, .bab-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}
.bab-head { align-items: center; margin-bottom: 8px; }
.bab-head span { grid-column: span 5; font-weight: 600; }
.bab-head button {
  background: #39ff14;
  color: #062406;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: default;
  height: 32px;
}
.bab-dow { color: #8aa090; font-size: 11px; margin-bottom: 4px; }
.bab-grid button {
  background: transparent;
  color: #e7f6e4;
  border: 0;
  border-radius: 8px;
  height: 36px;
  font: inherit;
  cursor: default;
}
.bab-grid .busy { color: #5d6b62; text-decoration: line-through; }
.bab-grid .past { color: #4a554c; opacity: 0.55; }
.bab-grid button:disabled {
  cursor: not-allowed;
  pointer-events: none;
}
.bab-grid .pick { background: #39ff14; color: #062406; font-weight: 700; }
.bab-grid .bab-pad { display: block; height: 36px; }
.bab-credit { text-align: center; font-size: 12px; margin: 8px 0 0; color: #8aa090; }

.game-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.game-bar button { font: inherit; padding: 2px 8px; cursor: default; }
.mine-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 1px;
}
.mine-grid button {
  aspect-ratio: 1;
  font: inherit;
  font-size: 14px;
  padding: 0;
  cursor: default;
}
.tile-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px inset var(--win-shadow);
}
.tile-board div {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid #ccc;
  font-size: 18px;
  font-weight: bold;
}
.tile-board div.on { background: #ddd; }
canvas.play {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  border: 1px inset var(--win-shadow);
}
.dpad { display: grid; justify-items: center; gap: 4px; margin-top: 6px; }
.dpad .row { display: flex; gap: 4px; }
.dpad button { min-width: 40px; min-height: 28px; font: inherit; }

#join-mail {
  margin-top: 8px;
  padding: 6px;
  background: #fff;
  border: 1px inset var(--win-shadow);
  font-size: 10px;
}
.join-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.join-switch button { font: inherit; cursor: default; }

#sc-widget {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
}

.window.music { top: 40px; left: 100px; width: 480px; }
.window.booking { top: 50px; left: 120px; width: 520px; }
.window.about { top: 60px; left: 140px; width: 320px; }
.window.join { top: 70px; left: 100px; width: 360px; }
.window.mines, .window.paddle, .window.tile, .window.snake {
  top: 48px;
  left: 280px;
  width: 360px;
}

/* --- Mobile (portrait phones, narrow viewports) --- */
@media (max-width: 640px) {
  :root {
    --taskbar-h: 34px;
  }

  body.win95::before,
  .desktop {
    background-image: url("bliss-mobile.png");
  }

  .taskbar-app {
    max-width: 96px;
  }

  .taskbar-app-main {
    font-size: 10px;
    padding: 0 4px;
  }

  .desk-icon--art {
    width: 64px;
  }

  .desk-icon .glyph--art {
    height: 40px;
  }

  .lock-icon.glyph--art {
    width: 24px;
    height: 29px;
  }

  .lock-icon .lock-img {
    width: 24px;
    height: 29px;
  }

  .desk-icon .label {
    font-size: 10px;
    line-height: 1.15;
  }

  .window {
    min-width: 0;
    width: calc(100vw - 12px) !important;
    max-width: calc(100vw - 12px);
    left: 6px !important;
    top: max(8px, env(safe-area-inset-top, 0px)) !important;
  }

  .window .body {
    max-height: min(420px, calc(100dvh - var(--taskbar-stack-h) - 72px));
    -webkit-overflow-scrolling: touch;
  }

  .window .titlebar-btns button {
    width: 22px;
    height: 20px;
    font-size: 12px;
  }

  .mp3-tabs button,
  .transport button,
  .dpad button {
    min-height: 36px;
    padding: 6px 10px;
  }

  .start-menu {
    left: 4px;
    max-width: calc(100vw - 8px);
  }

  .start-menu-panel {
    min-width: 0;
    flex: 1;
  }

  .bass-plane {
    width: 88px;
  }

  .layout-switch {
    top: max(6px, env(safe-area-inset-top, 0px));
    right: 6px;
    padding: 6px 10px;
    font-size: 12px;
  }
}
