﻿* {
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

body,
canvas {
  -webkit-touch-callout: none;
  touch-action: none;
}

.crt {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #000;
  opacity: 0;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.crt::before,
.crt::after,
.flash {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crt::before {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 2px,
      transparent 4px
    );
  opacity: 0.18;
  mix-blend-mode: screen;
}

.crt::after {
  background: radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
}

.flash {
  opacity: 0;
  mix-blend-mode: screen;
}

#inputBlocker {
  position: absolute;
  inset: 0;
  z-index: 999;
  -webkit-user-select: none;
  user-select: none;
}

#titleScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  color: #fff;
  transition: opacity 0.9s ease;
  overflow: hidden;
}

#titleGlitch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

#titleMain, #settingsPanel {
  position: relative;
  z-index: 2;
}

#titleScreen.hidden {
  opacity: 0;
  pointer-events: none;
}

#titleMain, #settingsPanel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 480px;
  padding: 24px;
}

#settingsPanel { display: none; }

#titleLogo {
  font-size: clamp(20px, 4vw, 36px);
  letter-spacing: 0.12em;
  text-shadow:
    0 0 12px rgba(255,255,255,0.6),
    0 0 28px rgba(180,180,255,0.3);
  animation: flicker 6s infinite;
}

#titleSub {
  font-size: clamp(7px, 1.4vw, 11px);
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 2;
}

#settingsTitle {
  font-size: clamp(10px, 1.8vw, 14px);
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

#titleMenu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 260px;
}

.pixelBtn {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.5vw, 12px);
  color: #fff;
  background: transparent;
  border: none;
  padding: 14px 20px;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-align: left;
  box-shadow:
    inset -3px -3px 0 0 rgba(255,255,255,0.15),
    inset  3px  3px 0 0 rgba(255,255,255,0.08),
    0 0 0 2px rgba(255,255,255,0.18);
  transition: background 0.1s, color 0.1s, box-shadow 0.1s;
  -webkit-user-select: none;
  user-select: none;
}

.pixelBtn:hover {
  background: rgba(255,255,255,0.1);
  box-shadow:
    inset -3px -3px 0 0 rgba(255,255,255,0.25),
    inset  3px  3px 0 0 rgba(255,255,255,0.15),
    0 0 0 2px rgba(255,255,255,0.5),
    0 0 18px rgba(255,255,255,0.12);
}

.pixelBtn:active {
  box-shadow:
    inset  3px  3px 0 0 rgba(0,0,0,0.4),
    0 0 0 2px rgba(255,255,255,0.3);
}

.settingRow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  font-size: clamp(7px, 1.2vw, 10px);
  color: rgba(255,255,255,0.7);
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.06),
    inset 2px 2px 0 0 rgba(255,255,255,0.03),
    0 0 0 1px rgba(255,255,255,0.08);
}

.settingRowTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settingPercent {
  color: rgba(255,255,255,0.9);
  min-width: 42px;
  text-align: right;
}

#titleAudioDefaultsBtn,
#gameAudioDefaultsBtn {
  width: 100%;
  text-align: center;
}

#volumeSlider,
#titleAmbienceSlider,
#titleEffectsSlider,
#titleTracksSlider,
#titleInventorySlider,
#titleWebsiteSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.25);
  outline: none;
  cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: #fff;
  cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
  width: 14px; height: 14px;
  background: #fff;
  border: none;
  cursor: pointer;
}

@keyframes flicker {
  0%,100% { opacity: 1; }
  92%      { opacity: 1; }
  93%      { opacity: 0.6; }
  94%      { opacity: 1; }
  96%      { opacity: 0.8; }
  97%      { opacity: 1; }
}

#albumScreen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(180deg, #0d0d0d 0%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, 'Helvetica Neue', 'Segoe UI', Arial, sans-serif;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease;
  overflow-y: auto;
}

#albumScreen.visible {
  opacity: 1;
  pointer-events: auto;
}

#albumContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 92%;
  max-width: 520px;
  padding: 40px 20px;
}

#albumHeader {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  width: 100%;
}

#albumArt {
  width: clamp(120px, 30vw, 200px);
  height: clamp(120px, 30vw, 200px);
  flex-shrink: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #08080f 50%, #1a1a2e 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 12px 50px rgba(0,0,0,0.9),
    0 0 80px rgba(120,100,180,0.06);
  position: relative;
  overflow: hidden;
}

#albumArt::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255,255,255,0.015) 2px,
      rgba(255,255,255,0.015) 4px
    );
}

#albumArtInner {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(20px, 5vw, 38px);
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 30px rgba(180,140,255,0.3);
  z-index: 1;
}

#albumMeta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#albumTitle {
  font-size: clamp(22px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

#albumArtist {
  font-size: clamp(12px, 2.2vw, 16px);
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  letter-spacing: 0.05em;
}

#albumInfo {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

#streamLinks {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

#streamLinks[hidden] {
  display: none !important;
}

.albumActionBtn {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: none;
  border-radius: 0;
  background: rgba(14,14,18,0.92);
  color: rgba(255,255,255,0.86);
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.1),
    inset 2px 2px 0 0 rgba(255,255,255,0.05),
    0 0 0 2px rgba(255,255,255,0.16);
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}

.albumActionBtn:hover {
  background: rgba(32,32,42,0.96);
  color: #fff;
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.18),
    inset 2px 2px 0 0 rgba(255,255,255,0.08),
    0 0 0 2px rgba(255,255,255,0.3),
    0 0 18px rgba(255,255,255,0.08);
}

#resetConfirmOverlay {
  position: fixed;
  inset: 0;
  z-index: 120000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.06), transparent 38%),
    rgba(0,0,0,0.88);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

#resetConfirmOverlay.open {
  opacity: 1;
  pointer-events: auto;
}

#resetConfirmCard {
  width: min(100%, 420px);
  padding: 22px 20px 18px;
  border: none;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(16,16,20,0.98) 0%, rgba(6,6,8,1) 100%);
  box-shadow:
    inset -3px -3px 0 0 rgba(255,255,255,0.1),
    inset 3px 3px 0 0 rgba(255,255,255,0.04),
    0 0 0 2px rgba(255,255,255,0.18),
    0 20px 60px rgba(0,0,0,0.7);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  transform: translateY(6px);
  transition: transform 0.12s ease;
}

#resetConfirmOverlay.open #resetConfirmCard {
  transform: translateY(0);
}

#resetConfirmEyebrow {
  font-size: 8px;
  letter-spacing: 0.16em;
  color: rgba(255,255,255,0.82);
  margin-bottom: 14px;
  text-shadow: 0 0 8px rgba(255,255,255,0.12);
}

#resetConfirmTitle {
  font-size: clamp(14px, 2.6vw, 18px);
  line-height: 1.5;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

#resetConfirmText {
  font-size: 8px;
  line-height: 1.9;
  color: rgba(255,255,255,0.62);
}

#resetConfirmActions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.resetConfirmBtn {
  flex: 1 1 160px;
  min-height: 42px;
  border: none;
  border-radius: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.12),
    inset 2px 2px 0 0 rgba(255,255,255,0.05),
    0 0 0 2px rgba(255,255,255,0.14);
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.resetConfirmBtn:hover {
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.18),
    inset 2px 2px 0 0 rgba(255,255,255,0.08),
    0 0 0 2px rgba(255,255,255,0.28);
}

.resetConfirmBtnGhost {
  background: rgba(28,28,34,0.94);
  color: rgba(255,255,255,0.86);
}

.resetConfirmBtnGhost:hover {
  background: rgba(42,42,50,0.98);
}

.resetConfirmBtnDanger {
  background: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.12),
    inset 2px 2px 0 0 rgba(255,255,255,0.05),
    0 0 0 2px rgba(255,255,255,0.18);
}

.resetConfirmBtnDanger:hover {
  background: rgba(255,255,255,0.2);
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.18),
    inset 2px 2px 0 0 rgba(255,255,255,0.08),
    0 0 0 2px rgba(255,255,255,0.28),
    0 0 14px rgba(255,255,255,0.12);
}

.streamBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
}

.streamBtn svg { flex-shrink: 0; }

#spotifyBtn {
  background: #1DB954;
}
#spotifyBtn:hover {
  background: #1ed760;
  transform: scale(1.04);
}

#appleMusicBtn {
  background: rgba(255,255,255,0.12);
}
#appleMusicBtn:hover {
  background: rgba(255,255,255,0.2);
  transform: scale(1.04);
}

#trackList {
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#trackList::-webkit-scrollbar { width: 3px; }
#trackList::-webkit-scrollbar-track { background: transparent; }
#trackList::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.trackRow {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.25s ease;
  font-size: clamp(11px, 1.8vw, 14px);
}

.trackRow:hover { background: rgba(255,255,255,0.06); }
.trackRow.active { background: rgba(180,140,255,0.1); }
.trackRow.active:hover { background: rgba(180,140,255,0.15); }

.trackNum {
  color: rgba(255,255,255,0.25);
  font-size: 12px;
  min-width: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
}

.trackNum .numText,
.trackNum .hoverPlay,
.trackNum .eqBars {
  transition: opacity 0.2s ease;
  position: absolute;
}

.trackNum .numText { opacity: 1; }
.trackNum .hoverPlay { opacity: 0; color: #fff; }
.trackNum .eqBars { opacity: 0; pointer-events: none; }

.trackRow:hover .trackNum .numText { opacity: 0; }
.trackRow:hover .trackNum .hoverPlay { opacity: 1; }

.trackRow.active.playing .trackNum .numText { opacity: 0; }
.trackRow.active.playing .trackNum .hoverPlay { opacity: 0; }
.trackRow.active.playing .trackNum .eqBars { opacity: 1; }
.trackRow.active.playing:hover .trackNum .eqBars { opacity: 1; }
.trackRow.active.playing:hover .trackNum .hoverPlay { opacity: 0; }

.trackRow.active .trackNum .numText { color: rgba(180,140,255,0.8); }

.eqBars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}

.eqBar {
  width: 3px;
  background: rgba(180,140,255,0.9);
  border-radius: 1px;
  animation: eqBounce 0.8s ease-in-out infinite alternate;
}

.eqBar:nth-child(1) { height: 40%; animation-delay: 0s; }
.eqBar:nth-child(2) { height: 70%; animation-delay: 0.2s; }
.eqBar:nth-child(3) { height: 50%; animation-delay: 0.4s; }

@keyframes eqBounce {
  0%   { height: 20%; }
  100% { height: 100%; }
}

/* â”€â”€ Track name colors â”€â”€ */
.trackName {
  flex: 1;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  transition: color 0.2s ease;
}

/* Active (playing) track name = purple-ish accent */
.trackRow.active.playing .trackName { color: rgba(180,140,255,0.9); }
/* Hovering the active playing row = white */
.trackRow.active.playing:hover .trackName { color: #fff; }
/* Active but paused = white */
.trackRow.active .trackName { color: #fff; }
/* Hover any row = white */
.trackRow:hover .trackName { color: #fff; }

.trackDur {
  color: rgba(255,255,255,0.2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s ease;
}

.trackRow:hover .trackDur { color: rgba(255,255,255,0.35); }

.trackRow.trackRowLockedRelease {
  cursor: default;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.trackRow.trackRowLockedRelease:hover {
  background: rgba(255,255,255,0.03);
}

.trackRowLockedRelease .trackNum,
.trackRowLockedRelease .trackDur {
  color: rgba(255,255,255,0.3);
}

.trackRowLockedRelease .trackName {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: rgba(255,255,255,0.82);
}

.trackReleaseSub {
  font-size: 10px;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.06em;
}

#playerBar {
  width: 100%;
  margin-top: 8px;
  padding: 16px 0 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#playerTop { width: 100%; text-align: center; }

#nowPlaying {
  font-size: clamp(10px, 1.8vw, 13px);
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  letter-spacing: 0.06em;
}

#progressRow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#timeElapsed, #timeDuration {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}
#timeElapsed { text-align: right; }
#timeDuration { text-align: left; }

#progressWrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s ease;
}

#progressWrap:hover { height: 8px; }

#progressFill {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 3px;
  transition: width 0.15s linear;
  position: relative;
}

/* Draggable thumb */
#progressThumb {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 6px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
  pointer-events: none;
}

#progressWrap:hover #progressThumb,
#progressWrap.dragging #progressThumb {
  transform: translateY(-50%) scale(1);
}

#progressWrap.dragging #progressFill {
  transition: none;
}

#playerControls {
  display: flex;
  gap: 28px;
  align-items: center;
  margin-top: 2px;
}

#websiteVolumeDock {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.websiteVolumeBtn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.82);
  background: rgba(18,18,18,0.9);
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.1),
    inset 2px 2px 0 0 rgba(255,255,255,0.05),
    0 0 0 2px rgba(255,255,255,0.14);
}

#websiteVolumePanel {
  width: 0;
  overflow: hidden;
  opacity: 0;
  transition: width 0.16s ease, opacity 0.16s ease;
}

#websiteVolumeDock.open #websiteVolumePanel,
#websiteVolumeDock:hover #websiteVolumePanel {
  width: 150px;
  opacity: 1;
}

.pCtrl {
  color: rgba(255,255,255,0.55);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.1s;
  border-radius: 50%;
}

.pCtrl:hover { color: #fff; transform: scale(1.12); }
.pCtrl:active { transform: scale(0.95); }

.pCtrlMain {
  background: #fff;
  color: #000;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  padding: 0;
}

.pCtrlMain:hover {
  background: rgba(255,255,255,0.9);
  color: #000;
  transform: scale(1.08);
}
.pCtrlMain:active { transform: scale(0.95); }

#controls {
  position: absolute;
  bottom: 14px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.28);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

#gameMenu {
  position: absolute;
  inset: 0;
  z-index: 5000;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  color: #fff;
  backdrop-filter: blur(4px);
}

#gameMenu.open { display: flex; }

#gameMenuInner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 340px;
  padding: 30px 24px;
}

#gameMenuTitle {
  font-size: 16px;
  letter-spacing: 0.14em;
  margin-bottom: 4px;
}

#gameMenu .settingRow {
  width: 100%;
}

#gameMenu .pixelBtn {
  width: 100%;
  text-align: center;
}

#gameMasterSlider,
#gameAmbienceSlider,
#gameEffectsSlider,
#gameTracksSlider,
#gameInventorySlider,
#websiteVolumeSlider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.25);
  outline: none;
  cursor: pointer;
}

#gameMasterSlider::-webkit-slider-thumb,
#gameAmbienceSlider::-webkit-slider-thumb,
#gameEffectsSlider::-webkit-slider-thumb,
#gameTracksSlider::-webkit-slider-thumb,
#gameInventorySlider::-webkit-slider-thumb,
#websiteVolumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  background: #fff;
  cursor: pointer;
}

#gameMasterSlider::-moz-range-thumb,
#gameAmbienceSlider::-moz-range-thumb,
#gameEffectsSlider::-moz-range-thumb,
#gameTracksSlider::-moz-range-thumb,
#gameInventorySlider::-moz-range-thumb,
#websiteVolumeSlider::-moz-range-thumb {
  width: 14px; height: 14px;
  background: #fff;
  border: none;
  cursor: pointer;
}


#inventoryOverlay {
  position: absolute;
  inset: 0;
  z-index: 4500;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  color: #fff;
  backdrop-filter: blur(3px);
}

#inventoryOverlay.open { display: flex; }

#inventoryInner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 320px;
  max-height: 80%;
  padding: 24px;
}

#inventoryHeader {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#inventoryTitle {
  font-size: 14px;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

#inventoryCloseBtn {
  padding: 10px 12px;
  font-size: 8px;
  text-align: center;
}

#inventoryList {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 240px;
}

.invRow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 9px;
  color: rgba(255,255,255,0.5);
  transition: background 0.15s, color 0.15s;
}

.invRow.collected {
  color: rgba(255,255,255,0.85);
  cursor: pointer;
}

.invRow.collected:hover {
  background: rgba(180,140,255,0.12);
  color: #fff;
}

.invRow.invPlaying {
  background: rgba(180,140,255,0.15);
  color: rgba(180,140,255,0.9);
}

.invIcon {
  width: 38px;
  text-align: center;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.invRow.collected .invIcon { color: rgba(180,140,255,0.8); }

.invName { flex: 1; }

.invLock {
  font-size: 8px;
  color: rgba(255,255,255,0.2);
}

#inventoryHint {
  font-size: 8px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.08em;
}

#inventoryPlayer {
  width: 100%;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  box-shadow:
    inset -2px -2px 0 0 rgba(255,255,255,0.06),
    inset 2px 2px 0 0 rgba(255,255,255,0.03),
    0 0 0 1px rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#inventoryPlayer.is-idle #inventoryProgressRow,
#inventoryPlayer.is-idle #inventoryVolumeRow {
  display: none;
}

#inventoryNowPlaying {
  font-size: 8px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.08em;
}

#inventoryProgressRow,
#inventoryVolumeRow {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 8px;
  color: rgba(255,255,255,0.5);
}

#inventoryTimeElapsed,
#inventoryTimeDuration,
#inventoryVolumePct {
  min-width: 34px;
  text-align: center;
}

#inventoryProgressSlider,
#inventoryVolumeSlider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.2);
  outline: none;
  cursor: pointer;
}

#inventoryProgressSlider::-webkit-slider-thumb,
#inventoryVolumeSlider::-webkit-slider-thumb,
#volumeSlider::-webkit-slider-thumb,
#titleAmbienceSlider::-webkit-slider-thumb,
#titleEffectsSlider::-webkit-slider-thumb,
#titleTracksSlider::-webkit-slider-thumb,
#titleInventorySlider::-webkit-slider-thumb,
#titleWebsiteSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: #fff;
  cursor: pointer;
}

#inventoryProgressSlider::-moz-range-thumb,
#inventoryVolumeSlider::-moz-range-thumb,
#volumeSlider::-moz-range-thumb,
#titleAmbienceSlider::-moz-range-thumb,
#titleEffectsSlider::-moz-range-thumb,
#titleTracksSlider::-moz-range-thumb,
#titleInventorySlider::-moz-range-thumb,
#titleWebsiteSlider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #fff;
  border: none;
  cursor: pointer;
}

#cookieConsent {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  background: rgba(20,20,20,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#cookieConsent.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
}

#cookieConsent .pixelBtn {
  font-size: 8px;
  padding: 8px 14px;
  white-space: nowrap;
}

body.is-mobile-ui #controls {
  left: 10px;
  right: 10px;
  bottom: 10px;
  font-size: 9px;
  gap: 6px;
}

body.is-mobile-ui #titleMain,
body.is-mobile-ui #settingsPanel {
  max-width: min(94vw, 420px);
  gap: 18px;
  padding: 18px 14px 20px;
}

body.is-mobile-ui #titleMenu {
  max-width: 100%;
  gap: 12px;
}

body.is-mobile-ui .pixelBtn {
  padding: 12px 14px;
  font-size: 9px;
}

body.is-mobile-ui #gameMenuInner {
  width: min(94vw, 360px);
  padding: 20px 14px 18px;
  gap: 10px;
}

body.is-mobile-ui #inventoryInner {
  width: min(94vw, 360px);
  max-height: 88%;
  padding: 18px 14px;
}

body.is-mobile-ui #inventoryHeader {
  align-items: flex-start;
}

body.is-mobile-ui #inventoryCloseBtn {
  min-width: 92px;
}

body.is-mobile-ui #inventoryList {
  max-height: 180px;
}

body.is-mobile-ui #albumContent {
  width: 94%;
  max-width: none;
  padding: 18px 12px 26px;
  gap: 18px;
}

body.is-mobile-ui #albumHeader {
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

body.is-mobile-ui #albumMeta {
  width: 100%;
  align-items: center;
  text-align: center;
}

body.is-mobile-ui #streamLinks {
  justify-content: center;
}

body.is-mobile-ui .streamBtn,
body.is-mobile-ui .albumActionBtn {
  width: 100%;
  justify-content: center;
}

body.is-mobile-ui #trackList {
  max-height: 220px;
}

body.is-mobile-ui .trackRow {
  gap: 10px;
  padding: 12px 10px;
}

body.is-mobile-ui #progressRow {
  gap: 6px;
}

body.is-mobile-ui #websiteVolumeDock {
  flex-direction: column;
  gap: 8px;
}

body.is-mobile-ui #websiteVolumeDock.open #websiteVolumePanel,
body.is-mobile-ui #websiteVolumeDock:hover #websiteVolumePanel {
  width: min(78vw, 220px);
}

body.is-mobile-ui #playerControls {
  gap: 20px;
}

body.is-mobile-ui #cookieConsent {
  width: min(94vw, 420px);
  left: 50%;
  bottom: 12px;
  padding: 12px;
  gap: 10px;
  flex-direction: column;
  align-items: stretch;
}

body.is-mobile-ui #cookieConsent .pixelBtn {
  width: 100%;
  text-align: center;
}

/* Mobile Touch Controls */
#gameCanvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(100vw, calc(100vh * 1.7777778));
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
}

#mobileControls {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 84px;
  z-index: 1200;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}

#mobileControls .mobilePanel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

#mobileJoystick {
  align-items: center;
  gap: 12px;
  width: min(48vw, 250px);
}

#mobileStickBase {
  position: relative;
  width: min(44vw, 190px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.08) 0 28%, rgba(255,255,255,0.03) 29% 100%),
    rgba(0,0,0,0.78);
  box-shadow:
    inset -4px -4px 0 0 rgba(255,255,255,0.08),
    inset 4px 4px 0 0 rgba(255,255,255,0.04),
    0 0 0 2px rgba(255,255,255,0.24),
    0 18px 30px rgba(0,0,0,0.38);
  touch-action: none;
}

#mobileStickBase::before,
#mobileStickBase::after {
  content: '';
  position: absolute;
  background: rgba(255,255,255,0.08);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#mobileStickBase::before {
  width: 70%;
  height: 2px;
}

#mobileStickBase::after {
  width: 2px;
  height: 70%;
}

#mobileStickKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
  box-shadow:
    inset -3px -3px 0 0 rgba(0,0,0,0.22),
    inset 3px 3px 0 0 rgba(255,255,255,0.1),
    0 0 0 2px rgba(255,255,255,0.26),
    0 10px 18px rgba(0,0,0,0.28);
  transition: transform 0.05s linear;
}

#mobileJoystickLabel {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.75);
}

#mobileActions {
  align-items: stretch;
  width: min(36vw, 184px);
}

.mobileControlBtn {
  min-height: 60px;
  border: none;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  box-shadow:
    inset -3px -3px 0 0 rgba(255,255,255,0.09),
    inset 3px 3px 0 0 rgba(255,255,255,0.04),
    0 0 0 2px rgba(255,255,255,0.22),
    0 14px 28px rgba(0,0,0,0.35);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.mobileControlBtn:active,
.mobileControlBtn.is-pressed {
  background: rgba(255,255,255,0.14);
  box-shadow:
    inset 3px 3px 0 0 rgba(0,0,0,0.4),
    0 0 0 2px rgba(255,255,255,0.38),
    0 0 24px rgba(255,255,255,0.12);
}

.mobileRunBtn,
.mobileActionBtn {
  min-width: 72px;
}

body.is-mobile-ui #mobileControls {
  display: flex;
}

body.is-mobile-ui #controls {
  bottom: 12px;
}

body.is-mobile-ui #gameCanvas {
  width: min(100vw, calc(100vh * 1.7777778));
}

@media (max-width: 900px) {
  #mobileControls {
    left: 10px;
    right: 10px;
    bottom: 94px;
    gap: 14px;
  }

  #mobileJoystick {
    width: min(52vw, 240px);
  }

  #mobileActions {
    width: min(38vw, 176px);
  }

  .mobileControlBtn {
    min-height: 56px;
    font-size: 9px;
    padding: 0 12px;
  }
}

@media (max-width: 640px) {
  #mobileControls {
    bottom: 106px;
    align-items: flex-end;
  }

  #mobileJoystick {
    width: min(56vw, 220px);
  }

  #mobileActions {
    width: min(34vw, 148px);
    gap: 10px;
  }

  .mobileControlBtn {
    min-height: 52px;
    font-size: 8px;
  }

  body.is-mobile-ui #controls {
    font-size: 8px;
  }
}
