/* ============================================================
   FM WAVE · OUTSIDE — Windows 95/98 Style
   ============================================================ */

:root {
  --silver: #c0c0c0;
  --white:  #ffffff;
  --gray:   #808080;
  --dark:   #404040;
  --black:  #000000;
  --navy:   #000080;
  --blue:   #1084d0;
  --text:   #000000;
}

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

body {
  background: #008080;
  font-family: 'MS Sans Serif', 'Microsoft Sans Serif', Tahoma, Arial, sans-serif;
  font-size: 11px;
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* ── Window ── */
.win-window {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 24px);
  max-width: 420px;
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dark) var(--dark) var(--white);
  box-shadow: 2px 2px 0 var(--black);
  z-index: 100;
}

/* ── Title bar ── */
.title-bar {
  background: linear-gradient(to right, var(--navy) 0%, var(--blue) 100%);
  padding: 3px 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  cursor: move;
}
.title-icon { font-size: 14px; line-height: 1; }
.title-text {
  flex: 1;
  color: var(--white);
  font-weight: bold;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.title-btns { display: flex; gap: 2px; flex-shrink: 0; }
.title-btn {
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dark) var(--dark) var(--white);
  width: 18px;
  height: 16px;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  font-family: Arial, sans-serif;
}
.title-btn:active {
  border-color: var(--dark) var(--white) var(--white) var(--dark);
  padding: 1px 0 0 1px;
}

/* ── Menu bar ── */
.menu-bar {
  display: flex;
  border-bottom: 1px solid var(--gray);
  padding: 1px 0;
  position: relative;
}
.menu-item {
  padding: 2px 10px;
  cursor: default;
  font-size: 11px;
}
.menu-item:hover {
  background: var(--navy);
  color: var(--white);
}

/* ── Window body ── */
.win-body { padding: 8px; }

/* ── Section label ── */
.sec-label { font-size: 11px; margin-bottom: 5px; }

/* ── Extra genres (visible only when maximized) ── */
.genre-btn-extra { display: none; }
body.win-expanded .genre-btn-extra { display: inline-block; }

/* ── Genre buttons ── */
.genre-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.genre-btn {
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--gray) var(--gray) var(--white);
  padding: 3px 10px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  color: var(--text);
  border-left-width: 4px;
}
.genre-btn:active {
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  padding: 4px 9px 2px 11px;
}
.genre-btn.active {
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  padding: 4px 9px 2px 11px;
}

/* ── Group box ── */
.group-box {
  border: 1px solid var(--gray);
  border-top: none;
  padding: 14px 8px 8px;
  position: relative;
  margin-bottom: 8px;
}
.group-label {
  position: absolute;
  top: -8px;
  left: 8px;
  background: var(--silver);
  padding: 0 4px;
  font-size: 11px;
}

/* ── Now playing ── */
.np-idle {
  text-align: center;
  padding: 20px;
  color: var(--gray);
  font-size: 11px;
  font-style: italic;
}
.np-content { display: none; margin-bottom: 8px; }

.np-top {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.np-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 2px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  flex-shrink: 0;
  background: var(--dark);
}
.np-info      { flex: 1; min-width: 0; padding-top: 2px; }
.np-genre-tag { font-size: 10px; color: var(--navy); font-weight: bold; margin-bottom: 3px; }
.np-title {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.np-channel { font-size: 10px; color: var(--gray); }

/* ── Digital display (Winamp-style) ── */
.digital-display {
  background: #000;
  border: 2px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  padding: 5px 8px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 62px;
}
.dig-time {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  color: #00ee00;
  letter-spacing: 2px;
  line-height: 1;
  text-shadow: 0 0 6px #00ee00;
}
.dig-meta {
  font-family: 'Courier New', monospace;
  font-size: 8px;
  color: #007700;
  letter-spacing: 1px;
  line-height: 1.4;
}

/* ── Visualizer ── */
.visualizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 44px;
  background: #000;
  border: 2px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  padding: 3px 4px 2px;
  margin-bottom: 6px;
}
.vis-bar {
  flex: 1;
  background: #00cc00;
  height: 2px;
  min-height: 2px;
  transition: height 0.08s ease-out;
  position: relative;
}
.vis-bar::after {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: #00ff44;
}

/* ── Progress bar ── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.progress-time {
  font-size: 10px;
  font-family: 'Courier New', monospace;
  flex-shrink: 0;
  min-width: 34px;
}
.progress-bar {
  flex: 1;
  height: 16px;
  background: var(--white);
  border: 2px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  cursor: pointer;
  overflow: hidden;
}
/* Classic Win95 chunky block progress */
.progress-fill {
  height: 100%;
  width: 0%;
  transition: width .5s linear;
  background: repeating-linear-gradient(
    90deg,
    var(--navy)   0px,
    var(--navy)  12px,
    var(--white) 12px,
    var(--white) 14px
  );
}

/* ── Controls ── */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}
.ctrl-btn {
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--gray) var(--gray) var(--white);
  padding: 4px 18px;
  font-size: 14px;
  cursor: pointer;
  min-width: 44px;
  text-align: center;
  color: var(--black);
}
.ctrl-btn:active {
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  padding: 5px 17px 3px 19px;
}

/* ── Volume ── */
.vol-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.vol-label { font-size: 11px; flex-shrink: 0; }
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 20px;
  background: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--white);
  border: 1px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 20px;
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--gray) var(--gray) var(--white);
  margin-top: -8px;
  cursor: pointer;
}
.vol-val { font-size: 11px; min-width: 26px; }

/* ── Shuffle info ── */
.shuffle-info {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  color: var(--gray);
}
.shuffle-dot {
  width: 6px;
  height: 6px;
  background: var(--navy);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.15} }

/* ── Status bar ── */
.status-bar {
  display: flex;
  gap: 2px;
  padding: 2px 4px;
  border-top: 1px solid var(--gray);
}
.status-panel {
  border: 1px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  padding: 1px 6px;
  font-size: 10px;
  min-height: 17px;
  line-height: 15px;
}
.status-panel.flex1 { flex: 1; }
.status-panel.fixed { flex-shrink: 0; }

/* ── Keyboard hint ── */
.kb-hint {
  text-align: center;
  font-size: 10px;
  color: var(--gray);
  margin-top: 4px;
  padding: 0 8px 4px;
}

/* ── Desktop icons ── */
.desktop-icons {
  position: fixed;
  top: 14px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 10;
}
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  cursor: default;
  user-select: none;
  padding: 3px;
}
.desktop-icon:hover { background: rgba(0,0,128,.35); outline: 1px dotted white; }
.icon-img  { font-size: 26px; line-height: 1; margin-bottom: 4px; }
.icon-label {
  font-size: 10px;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 2px black;
  word-break: break-all;
  line-height: 1.3;
}

/* ── Taskbar ── */
.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--silver);
  border-top: 2px solid var(--white);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  z-index: 1000;
}
.start-btn {
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dark) var(--dark) var(--white);
  padding: 1px 10px 1px 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.start-btn:active {
  border-color: var(--dark) var(--white) var(--white) var(--dark);
  padding: 2px 9px 0 7px;
}
.start-logo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.start-logo span {
  display: block;
}
.start-logo span:nth-child(1) { background: #f00; }
.start-logo span:nth-child(2) { background: #0a0; }
.start-logo span:nth-child(3) { background: #00f; }
.start-logo span:nth-child(4) { background: #fa0; }

.taskbar-divider {
  width: 2px;
  height: 20px;
  border-left: 1px solid var(--gray);
  border-right: 1px solid var(--white);
  margin: 0 2px;
  flex-shrink: 0;
}
.taskbar-apps { flex: 1; display: flex; gap: 2px; overflow: hidden; }
.taskbar-app {
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dark) var(--dark) var(--white);
  padding: 1px 8px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  height: 22px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.taskbar-app.active {
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  background: var(--silver);
  background-image: repeating-linear-gradient(
    90deg, transparent, transparent 2px,
    rgba(0,0,0,.05) 2px, rgba(0,0,0,.05) 4px
  );
}
.taskbar-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  padding: 2px 8px;
  height: 22px;
  flex-shrink: 0;
  font-size: 11px;
}
.tray-vol { font-size: 13px; line-height: 1; }
#tray-lang {
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}
#tray-lang:hover {
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  background: var(--face);
}
#tray-lang:active {
  border-color: var(--white) var(--gray) var(--gray) var(--white);
}

/* ── Quick Launch ── */
.quick-launch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  border-right: 2px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  margin-right: 2px;
  flex-shrink: 0;
}
.ql-btn {
  width: 22px;
  height: 22px;
  background: var(--silver);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.ql-btn:hover  { border-color: var(--white) var(--dark) var(--dark) var(--white); }
.ql-btn:active { border-color: var(--dark) var(--white) var(--white) var(--dark); }

/* ── Tray extra icons ── */
.tray-icon { display: flex; align-items: center; padding: 0 3px; cursor: default; }

/* ── Responsive ── */
@media (max-width: 700px) {
  .desktop-icons { display: none; }
}
@media (max-width: 480px) {
  body { padding: 0 0 28px; }
  .win-window { border-left: none; border-right: none; box-shadow: none; }
  .np-thumb { width: 48px; height: 48px; }
  .genre-btn { font-size: 10px; padding: 3px 7px; }
}

/* ── Inactive title bar ── */
.title-bar.inactive {
  background: var(--gray);
}

/* ── Menu item wrap (for dropdowns) ── */
.menu-item-wrap { position: relative; }
.menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dark) var(--dark) var(--white);
  box-shadow: 2px 2px 0 var(--black);
  z-index: 500;
  min-width: 170px;
  display: none;
}
.menu-dropdown-item {
  padding: 3px 20px 3px 10px;
  font-size: 11px;
  cursor: default;
  white-space: nowrap;
}
.menu-dropdown-item:hover { background: var(--navy); color: var(--white); }
.menu-dropdown-item.disabled { color: var(--gray); pointer-events: none; }
.menu-dropdown-sep {
  height: 1px;
  background: var(--gray);
  margin: 2px 4px;
  border-bottom: 1px solid var(--white);
}

/* ── Extra windows (My Computer, Recycle Bin) ── */
.extra-window {
  position: fixed;
  display: none;
  z-index: 150;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  max-width: calc(100vw - 24px);
}

/* ── File icons inside windows ── */
.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px;
}
.file-icon {
  width: 64px;
  text-align: center;
  cursor: default;
  padding: 4px;
  user-select: none;
}
.file-icon:hover { background: rgba(0,0,128,.15); outline: 1px dotted var(--navy); }
.file-icon .icon-img { font-size: 24px; line-height: 1; margin-bottom: 4px; }
.icon-label-dark { font-size: 10px; color: var(--text); line-height: 1.3; word-break: break-word; }

/* ── Modal overlay ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-window {
  position: static !important;
  transform: none !important;
  width: 260px;
}
.modal-body {
  text-align: center;
  padding: 16px 12px;
}
.modal-icon { font-size: 28px; margin-bottom: 8px; }

/* ── Loading progress bar ── */
.loading-progress {
  margin-top: 10px;
  height: 16px;
  background: var(--white);
  border: 2px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  overflow: hidden;
}
.loading-fill {
  height: 100%;
  width: 200%;
  background: repeating-linear-gradient(
    90deg,
    var(--navy) 0px, var(--navy) 12px,
    var(--white) 12px, var(--white) 14px
  );
  animation: load-slide 1s linear infinite;
}
@keyframes load-slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Context menu ── */
.context-menu {
  position: fixed;
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dark) var(--dark) var(--white);
  box-shadow: 2px 2px 0 var(--black);
  z-index: 3000;
  min-width: 160px;
}
.context-menu-item {
  padding: 3px 20px 3px 10px;
  font-size: 11px;
  cursor: default;
  white-space: nowrap;
}
.context-menu-item:hover { background: var(--navy); color: var(--white); }
.context-menu-sep {
  height: 1px;
  background: var(--gray);
  margin: 2px 4px;
  border-bottom: 1px solid var(--white);
}

/* ── Start menu ── */
.start-menu {
  position: fixed;
  bottom: 28px;
  left: 0;
  z-index: 2000;
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--dark) var(--dark) var(--white);
  box-shadow: 2px 2px 0 var(--black);
  display: none;
  flex-direction: row;
}
.start-menu-sidebar {
  background: linear-gradient(to top, #000080, #555);
  color: var(--white);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 3px;
  padding: 8px 4px;
  user-select: none;
}
.start-menu-items {
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 4px 0;
}
.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 8px;
  font-size: 11px;
  cursor: default;
  white-space: nowrap;
}
.start-menu-item:hover { background: var(--navy); color: var(--white); }
.start-menu-sep {
  height: 1px;
  background: var(--gray);
  margin: 3px 4px;
  border-bottom: 1px solid var(--white);
}

/* ── Genre listbox (expanded / retro list view) ── */
.genre-listbox-wrap { display: none; margin-bottom: 8px; }
body.win-expanded .genre-grid        { display: none; }
body.win-expanded .genre-listbox-wrap { display: block; }

/* ── Extra vis bars: hidden by default, shown when expanded ── */
.vis-bar-extra { display: none; }
body.win-expanded .vis-bar-extra { display: block; }

/* ── Expanded: visualizer centered ── */
body.win-expanded .visualizer {
  justify-content: center;
  gap: 2px;
  height: 56px;
}
body.win-expanded .vis-bar {
  flex: 0 0 10px;
  max-width: 10px;
}

.genre-listbox-header {
  display: flex;
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--gray) var(--gray) var(--white);
  border-bottom: 1px solid var(--gray);
}
.glh-cell {
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  border-right: 1px solid var(--gray);
  white-space: nowrap;
}
.glh-swatch { flex: 0 0 18px; }
.glh-name   { flex: 1; }
.glh-type   { flex: 0 0 38px; text-align: center; border-right: none; }

.genre-listbox {
  height: 160px;
  overflow-y: scroll;
  background: var(--white);
  border: 2px solid;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
}
.genre-list-row {
  display: flex;
  align-items: center;
  padding: 1px 0;
  cursor: default;
  font-size: 11px;
  white-space: nowrap;
  user-select: none;
}
.genre-list-row:nth-child(even) { background: #f4f4f4; }
.genre-list-row:hover  { background: var(--navy); color: var(--white); }
.genre-list-row.active { background: var(--navy); color: var(--white); }
.genre-list-row:hover .genre-list-swatch,
.genre-list-row.active .genre-list-swatch { border-color: rgba(255,255,255,.5); }
.genre-list-swatch {
  width: 10px;
  height: 10px;
  border: 1px solid var(--gray);
  flex: 0 0 10px;
  margin: 0 4px 0 4px;
}
.genre-list-name { flex: 1; padding: 0 4px; }
.genre-list-type {
  flex: 0 0 38px;
  text-align: center;
  color: var(--gray);
  font-size: 10px;
  padding-right: 4px;
}
.genre-list-row.active .genre-list-type { color: #aaddff; }

/* ── Resize handles ── */
.resize-handle {
  position: absolute;
  z-index: 200;
}
.resize-handle[data-dir="n"]  { top: -3px;    left: 8px;    right: 8px;   height: 6px;  cursor: n-resize; }
.resize-handle[data-dir="s"]  { bottom: -3px; left: 8px;    right: 8px;   height: 6px;  cursor: s-resize; }
.resize-handle[data-dir="e"]  { right: -3px;  top: 8px;     bottom: 8px;  width: 6px;   cursor: e-resize; }
.resize-handle[data-dir="w"]  { left: -3px;   top: 8px;     bottom: 8px;  width: 6px;   cursor: w-resize; }
.resize-handle[data-dir="nw"] { top: -3px;    left: -3px;   width: 10px;  height: 10px; cursor: nw-resize; }
.resize-handle[data-dir="ne"] { top: -3px;    right: -3px;  width: 10px;  height: 10px; cursor: ne-resize; }
.resize-handle[data-dir="se"] { bottom: -3px; right: -3px;  width: 10px;  height: 10px; cursor: se-resize; }
.resize-handle[data-dir="sw"] { bottom: -3px; left: -3px;   width: 10px;  height: 10px; cursor: sw-resize; }

/* ── #10: Desktop background dither pattern ── */
body {
  background-image: radial-gradient(rgba(0,0,0,0.10) 1px, transparent 1px);
  background-size: 3px 3px;
}

/* ── #6: Win95 keyboard focus ring ── */
button:focus-visible {
  outline: 1px dotted var(--black);
  outline-offset: -3px;
}
input[type="range"]:focus-visible {
  outline: 1px dotted var(--black);
}

/* ── #4: Genre button active state (clearer pressed look) ── */
.genre-btn.active {
  background: #b0b0b0;
  border-color: var(--gray) var(--white) var(--white) var(--gray);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.18);
  padding: 4px 9px 2px 11px;
}

/* ── #7: Win95-style tooltips ── */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--silver);
  border: 1px solid var(--black);
  padding: 2px 6px;
  font-size: 10px;
  font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 1px 1px 0 var(--black);
  color: var(--black);
}

/* ── #8: Win95-style scrollbar ── */
.genre-listbox::-webkit-scrollbar { width: 16px; }
.genre-listbox::-webkit-scrollbar-track {
  background: var(--silver);
  border-left: 1px solid var(--gray);
}
.genre-listbox::-webkit-scrollbar-thumb {
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--gray) var(--gray) var(--white);
  min-height: 20px;
}
.genre-listbox::-webkit-scrollbar-button {
  background: var(--silver);
  border: 2px solid;
  border-color: var(--white) var(--gray) var(--gray) var(--white);
  display: block;
  height: 16px;
  width: 16px;
}
.genre-listbox::-webkit-scrollbar-button:active {
  border-color: var(--gray) var(--white) var(--white) var(--gray);
}

/* ── #9: Title bar grip dots ── */
.title-grip {
  display: grid;
  grid-template-columns: repeat(2, 2px);
  grid-template-rows: repeat(4, 2px);
  gap: 2px;
  align-content: center;
  justify-content: center;
  width: 10px;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 4px;
}
.title-grip-dot {
  width: 2px;
  height: 2px;
  background: rgba(255,255,255,0.4);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.45);
}

/* ── #11: Visualizer uses current genre color ── */
.vis-bar        { background: var(--vis-color, #00cc00); }
.vis-bar::after { background: var(--vis-color, #00ff44); filter: brightness(1.35); }

/* ── #12: FM station label in digital display ── */
.dig-station {
  font-family: 'Courier New', monospace;
  font-size: 8px;
  color: #009900;
  letter-spacing: 1px;
  line-height: 1;
  margin-bottom: 2px;
}

/* ============================================================
   Mobile / PWA — 携帯型 Win95 マシン スタイル (≤600px)
   ============================================================ */
@media (max-width: 600px) {

  /* ── Hide resize handles and extras ── */
  .resize-handle,
  .title-grip,
  .kb-hint,
  .extra-window,
  #btn-maximize,
  #status-track { display: none !important; }

  /* ── Body ── */
  body {
    overflow: hidden;
    padding: 0;
    background-image: radial-gradient(rgba(0,0,0,0.14) 1px, transparent 1px);
    background-size: 3px 3px;
  }

  /* ── Desktop icons: horizontal row, top-left ── */
  .desktop-icons {
    display: flex !important;
    flex-direction: row !important;
    top: 4px !important;
    left: 6px !important;
    transform: none !important;
    gap: 8px !important;
    z-index: 5 !important;
    width: auto !important;
  }
  .desktop-icon { width: 50px !important; }
  .desktop-icons .icon-label { font-size: 9px !important; }

  /* ── Taskbar: visible, simplified ── */
  .taskbar { display: flex !important; }
  .quick-launch,
  .taskbar-divider { display: none !important; }
  .tray-icon,
  .tray-vol { display: none !important; }
  .taskbar-tray { padding: 2px 6px; }
  .taskbar-app { max-width: 130px !important; font-size: 10px !important; }

  /* ── Main window: Win95 windowed style ── */
  #win-fmwave {
    position: fixed !important;
    left: 50% !important;
    top: calc(50% + 14px) !important;
    transform: translate(-50%, -50%) !important;
    width: calc(100% - 16px) !important;
    max-width: 400px !important;
    height: auto !important;
    max-height: calc(100dvh - 90px) !important;
    border: 2px solid !important;
    border-color: var(--white) var(--dark) var(--dark) var(--white) !important;
    box-shadow: 2px 2px 0 var(--black) !important;
    overflow: hidden !important;
  }

  /* ── Title bar: thick navy, prominent ── */
  .title-bar {
    cursor: default !important;
    padding: 10px 12px !important;
    flex-shrink: 0;
    border-bottom: 2px solid var(--navy);
  }
  .title-text { font-size: 13px !important; letter-spacing: 0.3px; }
  .title-icon { font-size: 16px !important; }
  .title-btn  { width: 26px !important; height: 22px !important; font-size: 12px !important; }

  /* ── Scrollable win-body ── */
  .win-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px !important;
    max-height: calc(100dvh - 190px);
  }

  /* ── Genre: listbox on mobile (hide grid, show retro listbox) ── */
  .genre-grid        { display: none !important; }
  .genre-listbox-wrap { display: block !important; }
  body.win-expanded .genre-grid        { display: none !important; }
  body.win-expanded .genre-listbox-wrap { display: block !important; }

  /* ── Listbox: fixed height, always scrollable ── */
  .genre-listbox {
    height: 130px !important;
    overflow-y: scroll !important;
    border: 2px solid !important;
    border-color: var(--gray) var(--white) var(--white) var(--gray) !important;
  }
  .genre-list-row {
    padding: 5px 0 !important;
    font-size: 12px !important;
    min-height: 32px !important;
    touch-action: manipulation;
  }
  .genre-list-swatch {
    width: 12px !important;
    height: 12px !important;
    flex: 0 0 12px !important;
    margin: 0 6px !important;
  }

  /* ── Win95 chunky scrollbar on listbox ── */
  .genre-listbox::-webkit-scrollbar       { width: 18px; }
  .genre-listbox::-webkit-scrollbar-track { background: var(--silver); border-left: 1px solid var(--gray); }
  .genre-listbox::-webkit-scrollbar-thumb {
    background: var(--silver);
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
    min-height: 24px;
  }
  .genre-listbox::-webkit-scrollbar-button {
    background: var(--silver);
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
    display: block;
    height: 18px;
    width: 18px;
  }

  /* ── Group boxes: deep Win95 3D bevel ── */
  .group-box {
    border: 2px solid !important;
    border-color: var(--gray) var(--white) var(--white) var(--gray) !important;
    box-shadow:
      inset  1px  1px 0 rgba(255,255,255,0.9),
      inset -1px -1px 0 rgba(0,0,0,0.25) !important;
    padding: 18px 10px 10px !important;
    margin-bottom: 0 !important;
  }
  .group-label {
    font-size: 11px;
    font-weight: bold;
    top: -9px;
    left: 10px;
  }

  /* ── Now playing ── */
  .np-top { gap: 8px; }
  .np-thumb {
    width: 72px !important;
    height: 72px !important;
    border: 2px solid !important;
    border-color: var(--gray) var(--white) var(--white) var(--gray) !important;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  }
  .np-title   { font-size: 12px !important; font-weight: bold; }
  .np-channel { font-size: 10px; }
  .np-genre-tag { font-size: 10px; margin-bottom: 4px; }

  /* ── Digital display: prominent black box ── */
  .digital-display {
    min-width: 70px !important;
    padding: 6px 8px !important;
    border: 2px solid !important;
    border-color: var(--gray) var(--white) var(--white) var(--gray) !important;
    gap: 3px !important;
  }
  .dig-time    { font-size: 18px !important; }
  .dig-station { font-size: 9px !important; }

  /* ── Visualizer: tall Winamp-style ── */
  .visualizer {
    height: 56px !important;
    border: 2px solid !important;
    border-color: var(--gray) var(--white) var(--white) var(--gray) !important;
    margin-bottom: 0;
  }

  /* ── Progress bar ── */
  .progress-wrap { margin-bottom: 4px; }
  .progress-bar  { height: 20px; }
  .progress-time { font-size: 10px; min-width: 38px; }

  /* ── Controls: Win95 凸型パネルで囲む ── */
  .controls {
    gap: 5px !important;
    margin-bottom: 0 !important;
    padding: 6px 8px;
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
    box-shadow: inset -1px -1px 0 var(--dark), 1px 1px 0 var(--black);
    background: var(--silver);
  }
  .ctrl-btn {
    padding: 8px 14px !important;
    font-size: 16px !important;
    min-height: 44px !important;
    min-width: 46px !important;
    touch-action: manipulation;
    border: 2px solid !important;
    border-color: var(--white) var(--gray) var(--gray) var(--white) !important;
    box-shadow: 1px 1px 0 var(--black);
  }
  .ctrl-btn:active {
    border-color: var(--gray) var(--white) var(--white) var(--gray) !important;
    box-shadow: none !important;
    padding: 9px 13px 7px 15px !important;
  }

  /* ── Volume: Win95 inset trough ── */
  .vol-wrap { margin-bottom: 2px; }
  input[type="range"] { height: 26px; }
  input[type="range"]::-webkit-slider-runnable-track {
    height: 5px;
    border: 1px solid;
    border-color: var(--gray) var(--white) var(--white) var(--gray);
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 14px;
    height: 24px;
    margin-top: -10px;
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
  }

  /* ── Status bar ── */
  .status-bar   { padding: 3px 6px; flex-shrink: 0; }
  .status-panel { font-size: 10px; min-height: 18px; line-height: 16px; }

  /* ── Modals ── */
  .modal-window { width: calc(100vw - 24px) !important; max-width: 340px; }
  .modal-body   { padding: 12px 10px; }

  /* ── Tooltips: disable on touch ── */
  [data-tip]:hover::after { display: none; }
}
