@font-face {
  font-family: 'Geist Pixel Square';
  src: url('./GeistPixel-Square.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0a0a;
  --fg: #f2f2f2;
  --line: #f2f2f2;
  --panel-bg: rgba(10, 10, 10, 0.84);
  --panel-line: rgba(242, 242, 242, 0.3);
  --loader-dot: 12px;
  --loader-gap: 5px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Geist Pixel Square', monospace;
  font-size: 12px !important;
}

html, body {
  width: 100%;
  height: 100%;
  font-size: 12px !important;
  overflow: clip;
  background: var(--bg);
  color: var(--fg);
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.left-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.top-label {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  padding: 8px 10px;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  pointer-events: none;
  transform: translate3d(-9999px, -9999px, 0);
}

.now-playing {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  display: flex;
  align-items: stretch;
  min-width: 260px;
  max-width: 360px;
  pointer-events: none;
  transform: translate3d(-9999px, -9999px, 0);
}

.album-cover {
  width: 64px;
  min-width: 64px;
  height: 64px;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--fg);
  background: var(--bg);
}

.track-meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
}

.meta-label {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.8;
}

.track-title {
  font-size: 12px;
  line-height: 1.2;
  text-transform: none;
}

.track-artist {
  opacity: 0.72;
  line-height: 1.2;
}

.tooltip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate3d(0, 0, 0);
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: none;
  z-index: 20;
  max-width: 220px;
  pointer-events: none;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg);
  transition: opacity 380ms ease, visibility 380ms ease;
  opacity: 1;
  visibility: visible;
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pixel-morph {
  --loader-cols: 13;
  display: grid;
  grid-template-columns: repeat(var(--loader-cols), var(--loader-dot));
  grid-auto-rows: var(--loader-dot);
  gap: var(--loader-gap);
  align-items: center;
  justify-items: center;
  transform: translate3d(0, -8px, 0);
}

.pixel-dot {
  width: var(--loader-dot);
  height: var(--loader-dot);
  border-radius: 0;
  background: #2a2d37;
  opacity: 0.12;
  transform: scale(0.68);
  will-change: transform, opacity, background-color, box-shadow;
}

.loading-label {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg);
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
}

.spotify-panel {
  position: absolute;
  right: 110px;
  top: 50%;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  transform: translate3d(0, -50%, 0);
  z-index: 40;
}

.spotify-panel-inner {
  border: 1px solid var(--panel-line);
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: min(640px, calc(100vh - 48px));
  overflow: hidden;
}

.spotify-eyebrow {
  opacity: 0.7;
  letter-spacing: 0.06em;
}

.spotify-panel h2 {
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
}

.spotify-subtitle {
  font-size: 12px;
  opacity: 0.9;
}

.spotify-owner-auth {
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  text-align: left;
  padding: 6px 8px;
  cursor: pointer;
}

.spotify-owner-auth:hover,
.spotify-owner-auth:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.spotify-owner-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spotify-status {
  font-size: 12px;
  opacity: 0.85;
  min-height: 0;
  display: none;
}

.spotify-owner-connect {
  justify-self: start;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg);
  padding: 4px 8px;
  cursor: pointer;
}

.spotify-owner-connect:hover,
.spotify-owner-connect:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.spotify-list {
  border: 1px solid var(--panel-line);
  min-height: 120px;
  flex: 0 0 40%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  display: grid;
  gap: 6px;
}

.spotify-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  text-align: left;
  padding: 6px;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  animation: row-enter 260ms ease forwards;
  min-width: 0;
}

.spotify-row:hover,
.spotify-row:focus-visible,
.spotify-row.is-active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.spotify-row-cover {
  width: 44px;
  height: 44px;
  border: 1px solid var(--panel-line);
  background: #151515 center / cover no-repeat;
}

.spotify-row-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.spotify-row-title {
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-row-sub {
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-songs-shell {
  position: relative;
  border: 1px solid var(--panel-line);
  background: rgba(255, 255, 255, 0.02);
  min-height: 0;
  flex: 1 1 auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.spotify-songs-title {
  opacity: 0.78;
}

.spotify-songs {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 4px;
}

.spotify-song-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  color: var(--fg);
  text-decoration: none;
  padding: 4px 6px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.015);
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  animation: row-enter 220ms ease forwards;
  min-width: 0;
}

.spotify-song-row:link,
.spotify-song-row:visited {
  color: var(--fg);
  text-decoration: none;
}

.spotify-song-row:hover,
.spotify-song-row:focus-visible {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.spotify-song-index {
  opacity: 0.6;
}

.spotify-song-name {
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotify-empty {
  opacity: 0.7;
  padding: 6px;
}

.spotify-songs-shell.is-loading .spotify-songs {
  opacity: 0.4;
}

.spotify-panel.is-shell-loading {
  opacity: 0;
  transform: translate3d(0, -46%, 0);
}

.spotify-panel.is-shell-ready {
  opacity: 1;
  transform: translate3d(0, -50%, 0);
  transition: opacity 320ms ease, transform 320ms ease;
}

@keyframes row-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 1024px) {
  .spotify-panel {
    right: 40px;
    max-height: calc(100vh - 32px);
    width: min(340px, calc(100vw - 32px));
  }
}

@media (max-width: 800px) {
  .left-stage {
    width: 100%;
  }

  .spotify-panel {
    top: auto;
    bottom: 12px;
    right: 12px;
    transform: none;
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
  }

  .spotify-panel.is-shell-loading,
  .spotify-panel.is-shell-ready {
    transform: none;
  }
}
