@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,650;6..72,750&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --paper: #000000;
  --paper-strong: #000000;
  --ink: #FFCC00;
  --muted: rgba(255, 204, 0, 0.68);
  --line: rgba(255, 204, 0, 0.34);
  --mint: #FFCC00;
  --mint-soft: rgba(255, 204, 0, 0.14);
  --gold: #FFCC00;
  --gold-soft: rgba(255, 204, 0, 0.18);
  --coral: #FFCC00;
  --coral-soft: rgba(255, 204, 0, 0.12);
  --violet: #FFCC00;
  --violet-soft: rgba(255, 204, 0, 0.2);
  --blue: #FFCC00;
  --blue-soft: rgba(255, 204, 0, 0.16);
  --shadow: 0 16px 42px rgba(255, 204, 0, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 204, 0, 0.18), transparent 26%),
    linear-gradient(135deg, rgba(255, 204, 0, 0.08), transparent 38%),
    repeating-linear-gradient(90deg, rgba(255, 204, 0, 0.045) 0, rgba(255, 204, 0, 0.045) 1px, transparent 1px, transparent 26px),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 20px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 12px, var(--ink) 12px 14px, transparent 14px 20px, var(--ink) 20px 22px, transparent 22px 28px, var(--ink) 28px 30px, transparent 30px),
    radial-gradient(circle at 68% 34%, var(--gold) 0 9px, transparent 10px),
    var(--mint-soft);
  box-shadow: 5px 5px 0 var(--ink);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2rem, 3vw, 3.8rem);
  line-height: 0.95;
}

h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.8rem;
  line-height: 1.05;
}

h3 {
  font-size: 1.02rem;
  line-height: 1.1;
}

.session-block {
  min-width: 240px;
  display: flex;
  justify-content: flex-end;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.top-action {
  width: auto;
  min-width: 142px;
  text-align: center;
  text-decoration: none;
}

.user-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.82);
  box-shadow: var(--shadow);
}

.user-chip strong {
  font-size: 0.92rem;
}

.credit-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.rules-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  box-shadow: 6px 6px 0 rgba(255, 204, 0, 0.18);
}

.rules-strip div {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--paper-strong);
  border-right: 1px solid var(--ink);
  font-weight: 600;
}

.rules-strip div:nth-child(2) {
  background: var(--paper-strong);
}

.rules-strip div:nth-child(3) {
  background: var(--paper-strong);
}

.rules-strip div:nth-child(4) {
  background: var(--paper-strong);
  border-right: 0;
}

.community-note {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.community-note strong,
.community-note a {
  color: var(--ink);
}

.community-note a {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
  margin-top: 24px;
}

.queue-column,
.control-column {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-button,
.ghost-button,
.primary-button,
.danger-button,
.listen-button,
.tag-button,
.tiny-button {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper-strong);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.filter-button,
.ghost-button,
.tiny-button {
  min-height: 36px;
  padding: 7px 11px;
  font-weight: 700;
}

.filter-button.is-active,
.primary-button {
  background: var(--ink);
  color: var(--paper);
}

.primary-button,
.danger-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  font-weight: 800;
}

.primary-button.top-action {
  width: auto;
}

.queue-action {
  width: auto;
  min-height: 36px;
  padding: 7px 12px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.danger-button {
  background: var(--gold-soft);
}

.listen-button {
  min-width: 84px;
  min-height: 36px;
  padding: 7px 11px;
  font-weight: 800;
  background: var(--gold-soft);
}

button:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(255, 204, 0, 0.22);
}

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

.song-list {
  display: grid;
  gap: 12px;
}

.song-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(0, 0, 0, 0.86);
  box-shadow: 0 8px 22px rgba(255, 204, 0, 0.08);
}

.song-card.is-selected {
  border-color: var(--ink);
  box-shadow: 5px 5px 0 rgba(255, 204, 0, 0.2);
}

.song-art {
  position: relative;
  overflow: hidden;
  width: 76px;
  height: 76px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
}

.song-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.song-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.song-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.song-title-row h3 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reward-pill {
  flex: 0 0 auto;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--blue-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.song-card[data-tier="boost_2"] .reward-pill {
  background: var(--gold-soft);
}

.song-card[data-tier="boost_5"] .reward-pill {
  background: var(--coral-soft);
}

.song-card[data-tier="boost_10"] .reward-pill {
  background: var(--violet-soft);
}

.song-meta,
.status-copy,
.helper-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.song-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.control-column {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(0, 0, 0, 0.9);
  box-shadow: var(--shadow);
}

.panel h2,
.panel h3 {
  margin-bottom: 10px;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  background: var(--paper-strong);
  color: var(--ink);
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(255, 204, 0, 0.48);
}

.field textarea {
  min-height: 78px;
  resize: vertical;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-switch button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.auth-switch button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.player-frame {
  width: 100%;
  min-height: 172px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
}

.timer-shell {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.timer-bar {
  overflow: hidden;
  height: 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}

.timer-fill {
  width: 0%;
  height: 100%;
  background: var(--mint);
  transition: width 300ms ease;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.tag-button {
  min-height: 38px;
  padding: 7px 9px;
  font-size: 0.84rem;
  font-weight: 800;
  background: var(--paper);
  color: var(--ink);
}

.tag-button.is-active {
  background: var(--gold-soft);
}

.tier-list {
  display: grid;
  gap: 8px;
}

.tier-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--paper);
}

.tier-option input {
  margin-top: 3px;
}

.tier-option strong {
  display: block;
}

.tier-option span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.notice {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px;
  margin: 10px 0;
  background: var(--gold-soft);
  font-size: 0.88rem;
  font-weight: 650;
}

.empty-state {
  border: 1px dashed var(--muted);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  color: var(--muted);
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.admin-item {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.leaderboard-list {
  display: grid;
  gap: 8px;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--paper);
}

.leaderboard-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.leaderboard-item span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--gold-soft);
  font-weight: 800;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tiny-button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 0.78rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 36px));
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 7px 7px 0 rgba(255, 204, 0, 0.22);
}

.listen-page {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.publish-page {
  width: min(760px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 34px;
}

.listen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.listen-stage {
  display: grid;
  gap: 16px;
}

.publish-stage {
  display: grid;
  gap: 16px;
}

.publish-panel {
  padding: 18px;
}

.listen-hero {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 204, 0, 0.16), transparent 38%),
    linear-gradient(225deg, rgba(255, 204, 0, 0.24), transparent 34%),
    var(--paper-strong);
  box-shadow: 6px 6px 0 rgba(255, 204, 0, 0.18);
}

.listen-hero h1 {
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  overflow-wrap: anywhere;
}

.listen-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.focus-player {
  width: 100%;
  height: min(52vh, 430px);
  min-height: 352px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  box-shadow: 6px 6px 0 rgba(255, 204, 0, 0.18);
}

.focus-player iframe,
.focus-player > div {
  width: 100%;
  height: 100%;
  border: 0;
}

.listen-actions {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(0, 0, 0, 0.92);
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .control-column {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 12px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .session-block {
    min-width: 0;
    justify-content: stretch;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .top-action {
    width: 100%;
  }

  .heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .queue-action {
    width: 100%;
  }

  .rules-strip {
    grid-template-columns: 1fr;
  }

  .rules-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .rules-strip div:last-child {
    border-bottom: 0;
  }

  .song-card {
    grid-template-columns: 58px 1fr;
  }

  .song-art {
    width: 58px;
    height: 58px;
  }

  .song-title-row,
  .song-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .listen-button {
    width: 100%;
  }

  .listen-header {
    align-items: stretch;
    flex-direction: column;
  }

  .focus-player {
    height: 380px;
    min-height: 320px;
  }
}
