/* Accepted BoothFuel beta review surface, layered onto the existing CF client. */
:root {
  --bg: #0e0e10;
  --bg-raised: #151518;
  --surface: #1a1a1f;
  --surface-2: #202027;
  --surface-3: #26262c;
  --line: #2c2c34;
  --line-strong: #51515c;
  --text: #f2f0eb;
  --muted: #b8b7bd;
  --muted-2: #8f8f99;
  --coral: #ff5a3c;
  --coral-hover: #ff765d;
  --coral-soft: #361c1a;
  --focus: #ffcf6b;
  --rail-w: 188px;
  --player-h: 82px;
  --mobile-tabs-h: 64px;
  --radius: 16px;
  --radius-lg: 24px;
}

body {
  background: radial-gradient(circle at 20% -10%, rgb(255 90 60 / 8%), transparent 34%), var(--bg);
  font-size: 15px;
}

.wordmark { font-weight: 900; }
.auth-brand .brand-mark { display: none; }
.auth-brand { margin-bottom: 20px; }
.auth-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgb(255 255 255 / 3.5%), rgb(255 255 255 / 1%)), #151518;
  box-shadow: 0 24px 80px rgb(0 0 0 / 38%);
}
.auth-panel > .eyebrow { display: none; }
.auth-panel h1 { font-size: clamp(28px, 5vw, 36px); line-height: 1.05; }
.auth-panel .lead { margin: 8px 0 22px; font-size: 16px; }
.auth-panel .field label { color: var(--muted); font-size: 13px; }
.auth-panel .field input { border-radius: 14px; background: #101014; }

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 0 20px;
  max-width: 1480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 20px calc(var(--player-h) + 38px);
}
.desktop-rail {
  position: sticky;
  inset: auto;
  top: 18px;
  grid-column: 1;
  grid-row: 1 / span 2;
  width: auto;
  height: calc(100vh - 36px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgb(21 21 24 / 88%);
  backdrop-filter: none;
}
.rail-brand { padding: 0 4px; }
.rail-brand .wordmark { font-size: 21px; }
.rail-nav { gap: 8px; margin-top: 22px; }
.nav-button {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 800;
}
.nav-button svg { display: none; }
.nav-button[aria-current="page"] {
  background: rgb(255 90 60 / 14%);
  box-shadow: inset 3px 0 0 var(--coral);
  color: var(--text);
}
.topbar {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-bottom: 20px;
}
.mobile-brand { display: none; }
.progress-copy { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; }
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: min(48vw, 360px);
  min-height: 44px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #151518;
  color: var(--text);
  cursor: pointer;
}
.account-chip .account-avatar { width: 34px; height: 34px; }
#account-email { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.main-view { grid-column: 2; width: 100%; max-width: none; margin: 0; padding: 0 0 30px; }
.app-shell.has-banner .main-view { padding-top: 70px; }
.connection-banner { left: calc(var(--rail-w) + 44px); right: 24px; }
.page-header { align-items: end; margin-bottom: 16px; }
.page-header h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.05; }
.page-header p { margin-top: 5px; }

.review-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); gap: 18px; align-items: start; }
.hero-card, .next-card, .source-card, .settings-section, .queue-options, .source-details {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgb(255 255 255 / 3.5%), rgb(255 255 255 / 1%)), #151518;
}
.hero-card { display: grid; grid-template-columns: minmax(148px, 240px) minmax(0, 1fr); gap: 18px; min-height: 304px; padding: 18px; overflow: hidden; }
.hero-art-wrap { min-width: 0; align-self: start; }
.hero-art { width: 100%; aspect-ratio: 1; border: 1px solid rgb(255 255 255 / 8%); border-radius: 16px; object-fit: cover; box-shadow: 0 18px 46px rgb(0 0 0 / 38%); }
.hero-copy { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hero-facts { margin: 0; }
.fact-chip { color: var(--muted); }
.hero-title { margin: 0; font-size: clamp(25px, 3.2vw, 44px); line-height: 1.02; letter-spacing: -.055em; overflow-wrap: anywhere; }
.hero-byline { margin: 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.hero-review { margin: 0; color: var(--muted-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.hero-actions .button { flex: 1; min-height: 44px; padding-inline: 14px; }
.hero-actions .hero-play { flex-basis: 100%; min-height: 52px; }
.next-card { padding: 18px; }
.next-card > h2 { margin: 0 0 12px; font-size: 17px; }
.next-track-row { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 11px; min-height: 66px; padding: 8px; border-radius: 16px; }
.next-track-row .art-wrap { width: 52px; height: 52px; }
.next-track-row .cover-art, .next-track-row .missing-art { border-radius: 12px; }
.next-track-row .track-title { font-size: 14px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 1; }
.next-track-row .track-byline { margin-top: 2px; }
.next-track-row .track-end { min-width: 0; gap: 5px; }
.next-track-row .track-facts { margin: 0; color: var(--muted); font-size: 12px; }
.next-track-row .row-play { opacity: 1; inset: auto 4px 4px auto; width: 40px; height: 40px; border-radius: 50%; }
.next-track-row .state-chip { display: none; }
.next-empty { color: var(--muted); }
.source-chip { min-height: 26px; font-size: 10px; }
.source-dispersion { color: #ffcf6b; border-color: rgb(255 207 107 / 45%); }
.source-inflyte { color: #ff765d; border-color: rgb(255 118 93 / 45%); }
.source-trackstack { color: #8ce3a4; border-color: rgb(140 227 164 / 45%); }
.queue-options, .source-details { margin-top: 16px; padding: 0 16px; }
.queue-options summary, .source-details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); font-weight: 800; }
.queue-options .page-actions { justify-content: start; padding-bottom: 12px; }
.queue-options > p { margin: 0 0 14px; color: var(--muted-2); font-size: 13px; }

.sources-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.source-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.source-card-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.source-card h2 { margin: 0; font-size: 17px; }
.source-card p { margin: 0; color: var(--muted); font-size: 14px; }
.source-card .source-truth { color: var(--muted-2); font-size: 12px; }
.dropbox-card { margin-top: 12px; }
.dropbox-card .button { align-self: start; }
.source-details .arrival-panel { margin: 0 0 16px; }

.settings-layout { gap: 12px; }
.settings-section { padding: 20px; border: 1px solid var(--line); }
.settings-section:first-child { border-top: 1px solid var(--line); }
.account-section .section-head { margin-bottom: 0; }
.capability-card, .keeper-row, .history-card { border-radius: 16px; background: #151518; }

.player-bar {
  inset: auto auto 12px 50%;
  width: min(760px, calc(100vw - 20px));
  height: auto;
  min-height: 72px;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, .9fr) auto;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #151518;
  box-shadow: 0 20px 80px rgb(0 0 0 / 65%);
  transform: translateX(-50%);
  backdrop-filter: none;
}
.player-track { min-height: 52px; gap: 10px; }
.player-track::after { content: "↗"; display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); font-size: 20px; }
.mini-art { width: 52px; height: 52px; border: 1px solid rgb(255 255 255 / 8%); border-radius: 13px; object-fit: cover; }
.play-button { background: var(--coral); color: #17100e; }
.player-progress-wrap { grid-template-columns: 38px minmax(70px, 1fr) 42px; }
.player-volume { display: none; }
.player-decisions .decision-button { min-width: 58px; padding-inline: 10px; }
.seek-control, .js-mobile-seek { min-height: 44px; }
.toast-region { bottom: calc(var(--player-h) + 24px); }

.now-dialog { background: radial-gradient(circle at 50% 0%, rgb(255 90 60 / 14%), transparent 42%), var(--bg); overflow-y: auto; }
.now-dialog[open] { display: block; }
.mobile-now { width: min(100%, 700px); min-height: 100dvh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.mobile-now-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; margin-bottom: 12px; }
.mobile-now-art { width: min(100%, 42vh, 360px); aspect-ratio: 1; align-self: center; margin: 0 auto 20px; }
.mobile-now-art img, .mobile-now-art .missing-art { width: 100%; height: 100%; border-radius: 24px; object-fit: cover; box-shadow: var(--shadow); }
.mobile-now h1 { margin: 0; font-size: clamp(25px, 5vw, 38px); line-height: 1.06; letter-spacing: -.04em; overflow-wrap: anywhere; }
.mobile-now .artist { margin: 8px 0 0; color: var(--muted); }
.mobile-now .label { color: var(--muted-2); }
.mobile-progress { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; align-items: center; gap: 10px; margin-top: 20px; }
.mobile-progress input { width: 100%; }
.mobile-transport { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 14px 0 10px; }
.mobile-transport .play-button { width: 58px; height: 58px; }
.mobile-decisions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mobile-decisions .decision-button { min-height: 50px; }
.mobile-rating { margin-top: 14px; }

@media (min-width: 900px) and (max-width: 1199px) {
  :root { --rail-w: 168px; }
  .app-shell { padding-inline: 14px; gap: 0 14px; }
  .hero-card { grid-template-columns: 150px minmax(0, 1fr); padding: 14px; }
  .review-grid { grid-template-columns: minmax(0, 1fr) minmax(270px, .9fr); gap: 12px; }
  .player-progress-wrap { display: none; }
  .player-bar { grid-template-columns: minmax(150px, 1fr) auto auto; }
}

@media (max-width: 899px) {
  :root { --player-h: 72px; --mobile-tabs-h: 64px; }
  body { background: var(--bg); }
  .app-shell { display: block; padding: 12px 14px calc(var(--mobile-tabs-h) + var(--player-h) + 48px); }
  .desktop-rail, .desktop-progress { display: none; }
  .topbar { margin-bottom: 12px; }
  .mobile-brand { display: block; min-width: 0; }
  .mobile-brand .wordmark { font-size: 20px; }
  .mobile-brand .progress-copy { margin-top: 4px; }
  .main-view { padding: 0 0 30px; }
  .app-shell.has-banner .main-view { padding-top: 76px; }
  .connection-banner { top: 12px; left: 12px; right: 12px; }
  .page-header { margin: 0 0 14px; }
  .page-header h1 { font-size: 26px; }
  .review-grid { grid-template-columns: 1fr; gap: 12px; }
  .hero-card { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; min-height: 0; padding: 14px; border-radius: 20px; }
  .hero-title { font-size: 24px; }
  .hero-byline { font-size: 13px; }
  .next-card { padding: 14px; border-radius: 20px; }
  .sources-grid { grid-template-columns: 1fr; }
  .settings-section { padding: 16px; }
  .player-bar {
    bottom: calc(var(--mobile-tabs-h) + 12px + env(safe-area-inset-bottom, 0px));
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: var(--player-h);
    padding: 8px 10px;
    border-radius: 22px;
    background: #151518;
  }
  .player-progress-wrap, .player-decisions, .desktop-only { display: none !important; }
  .player-track { grid-column: 1; }
  .player-transport { grid-column: 2; }
  .mini-art { width: 44px; height: 44px; }
  .mini-meta strong, .mini-meta span { max-width: 100%; }
  .mobile-tabs {
    position: fixed;
    z-index: 65;
    inset: auto 0 0;
    height: var(--mobile-tabs-h);
    display: flex;
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line);
    background: #0e0e10;
  }
  .mobile-tabs .nav-button { flex: 1 1 0; min-width: 0; min-height: 64px; display: grid; place-items: center; padding: 0 3px; border-radius: 0; box-shadow: none; font-size: 12px; text-align: center; }
  .mobile-tabs .nav-button[aria-current="page"] { background: rgb(255 90 60 / 10%); box-shadow: inset 0 2px 0 var(--coral); }
  .mobile-tabs .nav-button[aria-current="page"]::after { display: none; }
  .toast-region { bottom: calc(var(--mobile-tabs-h) + var(--player-h) + 24px); }
  .mobile-now-art { width: min(100%, 42vh, 340px); }
}

@media (max-width: 600px) {
  .main-view { padding-inline: 0; }
  .page-header { margin: 0 0 14px; }
  .page-header h1 { font-size: 26px; }
  .page-actions { margin-top: 12px; }
  .next-track-row { grid-template-columns: 52px minmax(0, 1fr); }
  .next-track-row .track-end { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; width: 100%; }
  .next-track-row .track-title { white-space: normal; -webkit-line-clamp: 2; }
  .history-summary, .keeper-row { grid-template-columns: 52px minmax(0, 1fr); }
  .history-stats, .keeper-state { grid-column: 2; text-align: left; }
  .section-head { gap: 12px; }
  .source-card { padding: 16px; }
}

@media (max-width: 374px) {
  .app-shell { padding-inline: 10px; }
  #account-email { display: none; }
  .account-chip { padding-right: 5px; }
  .page-header h1 { font-size: 24px; }
  .hero-card { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .hero-art { border-radius: 12px; }
  .hero-title { font-size: 19px; line-height: 1.05; }
  .hero-review { display: none; }
  .hero-copy { gap: 10px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-actions .hero-play { grid-column: 1 / -1; min-height: 44px; }
  .hero-actions .button { min-width: 0; padding-inline: 9px; }
  .next-track-row { grid-template-columns: 48px minmax(0, 1fr); gap: 8px; padding-inline: 4px; }
  .next-track-row .art-wrap { width: 48px; height: 48px; }
  .player-track { gap: 7px; }
  .player-track::after { flex-basis: 40px; width: 40px; height: 40px; }
  .mini-meta strong { font-size: 12px; }
  .mini-meta span { display: none; }
  .mobile-tabs .nav-button { font-size: 11px; }
  .mobile-now { padding-inline: 14px; }
  .mobile-transport { gap: 8px; justify-content: space-between; }
  .section-head { display: block; }
  .section-head .button { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
