
:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: #151d30;
  --panel-light: #1d2940;
  --text: #f4f7ff;
  --muted: #9eabc2;
  --blue: #4387ff;
  --border: #293750;
  --danger: #ff8585;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
  margin-bottom: 12px;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.muted, .hint, .footer-note {
  color: var(--muted);
}

.hint, .footer-note {
  font-size: 0.85rem;
}

.topbar {
  height: 68px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 750;
}

.logo {
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  font-size: 1.8rem;
  font-weight: 850;
  box-shadow: 0 8px 30px #4387ff30;
}

.small-logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 1.2rem;
}

.app-shell {
  width: min(100% - 28px, 760px);
  margin: 0 auto;
  padding: 34px 0 24px;
}

.intro {
  padding: 12px 4px 24px;
}

.eyebrow {
  color: #83b0ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 10px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 16px;
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  margin-bottom: 14px;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: #57d8a1;
  border-radius: 50%;
  margin-bottom: 14px;
}

input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid #35445e;
  border-radius: 12px;
  background: #0e1526;
  color: var(--text);
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px #4387ff25;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.9rem;
}

.primary, .secondary, .quiet {
  border: 0;
  border-radius: 12px;
  padding: 12px 17px;
  font-weight: 700;
  transition: background 0.15s, transform 0.15s;
}

.primary {
  color: white;
  background: var(--blue);
}

.primary:hover {
  background: #5a96ff;
}

.secondary {
  color: var(--text);
  background: var(--panel-light);
  border: 1px solid #35445e;
}

.quiet {
  color: var(--muted);
  background: transparent;
  padding: 8px 10px;
}

.full {
  width: 100%;
  margin-top: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

#reader {
  width: 100%;
  overflow: hidden;
  border-radius: 14px;
  background: #080d17;
}

#reader video {
  border-radius: 14px;
  object-fit: cover;
}

#reader:empty {
  min-height: 10px;
}

.search-form {
  display: flex;
  gap: 9px;
}

.search-form input {
  flex: 1;
}

.message {
  font-size: 0.92rem;
  margin: 10px 0 0;
}

.error {
  color: var(--danger);
}

.matches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.match-button {
  background: var(--panel-light);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
}

.player-panel {
  text-align: center;
  padding-top: 28px;
  padding-bottom: 28px;
}

.disc {
  width: 160px;
  height: 160px;
  margin: 20px auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: repeating-radial-gradient(
    circle, #202d43 0 3px, #101827 4px 7px
  );
  border: 6px solid #30415d;
  box-shadow: 0 15px 40px #0005;
}

.disc span {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
}

.disc.playing {
  animation: spin 5s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.player-controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.play-button {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 5px solid var(--blue);
  background: #172744;
  color: white;
  font-size: 2.4rem;
  display: grid;
  place-items: center;
  padding: 0 0 4px 3px;
}

.play-button:active {
  transform: scale(0.96);
}

.count {
  color: var(--muted);
  font-size: 0.85rem;
}

.library {
  max-height: 430px;
  overflow-y: auto;
  margin-top: 12px;
}

.library-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.library-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.93rem;
}

.small-button {
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-panel {
  width: min(100%, 410px);
  padding: 32px;
}

.login-panel .logo {
  margin-bottom: 24px;
}

.login-panel h1 {
  font-size: 2.5rem;
}

.login-panel form {
  margin-top: 26px;
}

.login-panel .footer-note {
  text-align: center;
  margin: 24px 0 0;
}

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

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 760px);
    padding-top: 22px;
  }

  .panel {
    padding: 17px;
    border-radius: 18px;
  }

  .search-form {
    flex-direction: column;
  }

  .search-form button {
    width: 100%;
  }

  .disc {
    width: 140px;
    height: 140px;
  }

  .play-button {
    width: 82px;
    height: 82px;
  }
}


.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
}

.skip-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-light);
  color: var(--text);
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.skip-button span {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 800;
  top: 21px;
}

.skip-button:hover:not(:disabled) {
  background: #30415d;
}

.skip-button:active:not(:disabled) {
  transform: scale(0.94);
}

.skip-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.play-button {
  flex-shrink: 0;
}