/* Moodhoney Radio palette: night black, warm cream, honey gold, ember browns. */
:root {
  --bg: #0a0a0a;
  --ink: #f5f0e8;
  --gold: #d4a017;
  --gold-soft: rgba(212, 160, 23, 0.35);
  --ember: #1a1008;
  --ember-2: #120c06;
  --line: rgba(255, 255, 255, 0.08);
  --card: rgba(255, 255, 255, 0.035);
  --muted: rgba(245, 240, 232, 0.55);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: clip; touch-action: manipulation; } /* no double-tap zoom while tapping answers */
body {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(180, 100, 30, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, #0a0a0a 0%, var(--ember) 30%, var(--ember-2) 70%, #0a0a0a 100%) fixed;
  -webkit-tap-highlight-color: rgba(212, 160, 23, 0.15);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.glow {
  position: fixed; top: 10%; left: 50%; width: 520px; height: 520px; max-width: 100vw;
  transform: translateX(-50%); border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(200, 120, 40, 0.08) 0%, transparent 70%);
  animation: pulse 8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: .6; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.1); } }

.screen {
  position: relative; z-index: 1; max-width: 640px; margin: 0 auto;
  padding: 28px 18px 24px; display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.hidden { display: none !important; }
.brand { width: 420px; max-width: 86vw; height: auto; filter: drop-shadow(0 4px 30px rgba(200, 120, 40, 0.25)); }
.brand.small { width: 220px; }
.tagline { font-size: 12px; font-weight: 300; letter-spacing: 6px; text-transform: uppercase; color: var(--gold-soft); margin-top: -26px; }
.title { font-size: clamp(34px, 9vw, 54px); font-weight: 800; letter-spacing: -1px; text-align: center; }
.title::after { content: ''; display: block; height: 5px; width: 64%; margin: 8px auto 0; background: var(--gold); border-radius: 3px; }
.lede { text-align: center; color: var(--muted); line-height: 1.55; max-width: 460px; }
.source { text-align: center; font-size: 13px; line-height: 1.55; color: var(--muted); max-width: 460px; margin-top: -8px; }
.source a { color: var(--gold); text-decoration: none; }
.source a:hover { text-decoration: underline; }
.scale-key { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.scale-key b { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px; border-radius: 6px; background: var(--gold); color: var(--bg); font-weight: 800; }

.card {
  width: 100%; max-width: 420px; padding: 20px; display: grid; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(20px); box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
label { font-size: 11px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
input {
  font: inherit; font-size: 18px; color: var(--ink); background: rgba(0, 0, 0, .4);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; outline: none;
}
input:focus { border-color: var(--gold); }
.error { color: #ff9b7a; font-size: 14px; min-height: 1em; }
.btn { font: inherit; font-weight: 600; font-size: 16px; padding: 13px 22px; border-radius: 999px; border: 1px solid var(--gold); cursor: pointer; }
.btn.gold { background: var(--gold); color: var(--bg); }
.btn.gold:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--gold); }
.link { font: inherit; background: none; border: 0; color: var(--gold); cursor: pointer; font-size: 14px; padding: 8px; }
.link:disabled { opacity: .3; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row.center { justify-content: center; }
.muted { color: var(--muted); }

/* Quiz */
.topbar { width: 100%; display: flex; align-items: center; gap: 12px; }
.mini-logo { width: 38px; height: 38px; border-radius: 9px; }
.progress-wrap { flex: 1; }
.progress-text { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
#q-points { color: var(--gold); font-weight: 600; }
.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
#q-bar { height: 100%; width: 0; background: var(--gold); transition: width .3s; }

.album { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.album.enter { animation: enter .35s ease-out; }
@keyframes enter { from { opacity: 0; } to { opacity: 1; } } /* opacity only: a moving layer can shave italic overhangs */
/* Phone: cover (rank tag in the corner), titles, then the badge drawings, all above the answer bar. */
.album .info { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.cover-wrap {
  position: relative; flex: none; width: min(320px, 70vw, 34vh); aspect-ratio: 1; border-radius: 6px;
  background: rgba(255,255,255,.04); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); overflow: hidden;
}
.cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.rank {
  position: absolute; left: 10px; top: 10px; padding: 4px 10px 5px; border-radius: 10px;
  background: rgba(10, 10, 10, .82); border: 1px solid var(--gold-soft); backdrop-filter: blur(6px);
  font-size: 26px; font-weight: 800; line-height: 1; color: var(--gold);
}
.rank::before { content: '#'; font-size: 15px; vertical-align: top; margin-right: 1px; opacity: .7; }
.artist, .album-title { max-width: 100%; overflow-wrap: anywhere; padding-right: .2em; }
.artist { font-size: 24px; font-weight: 800; margin-top: 6px; }
.album-title { font-size: 17px; font-weight: 400; font-style: italic; color: var(--ink); opacity: .9; }
.meta { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold-soft); }
.badges { width: 100%; max-width: 520px; margin: 6px 0 2px; border-radius: 10px; background: #fff; padding: 6px; }
.blurb { line-height: 1.6; font-size: 16px; max-width: 520px; }
.credit { font-size: 13px; color: var(--muted); }
.credit a { color: var(--gold); text-decoration: none; }
.credit a:hover { text-decoration: underline; }

.answers {
  width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  position: sticky; bottom: 0; z-index: 2; padding: 12px 0 calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent 0%, #0a0a0a 28%);
}
.answer {
  font: inherit; font-size: 12.5px; line-height: 1.25; color: var(--ink); text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px;
  background: #1a1008; border: 1px solid var(--line); border-radius: 14px; transition: border-color .15s, background .15s, transform .1s;
}
.answer b { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 10px; font-size: 20px; border: 1px solid var(--gold); color: var(--gold); }
.answer:hover { border-color: var(--gold-soft); }
.answer:active { transform: scale(.98); }
.answer.chosen { border-color: var(--gold); background: rgba(212, 160, 23, .12); }
.answer.chosen b { background: var(--gold); color: var(--bg); }
.nav { width: 100%; display: flex; justify-content: space-between; }
.q-status { grid-column: 1 / -1; font-size: 13px; color: var(--gold); text-align: center; }
.q-status:empty { display: none; }

/* Laptop and up: cover on the left, everything else beside it, all visible without scrolling. */
@media (min-width: 720px), (min-width: 560px) and (min-aspect-ratio: 1/1) {
  #quiz.screen { max-width: 1040px; }
  .album { flex-direction: row; align-items: flex-start; gap: 36px; text-align: left; }
  .album .info { align-items: flex-start; flex: 1 1 0; width: auto; }
  .cover-wrap { width: min(420px, 40vw, calc(100vh - 230px)); min-width: 240px; }
  .answer { flex-direction: row; justify-content: center; font-size: 14px; padding: 12px; gap: 10px; }
  .artist { font-size: 32px; margin-top: 0; }
  .album-title { font-size: 20px; }
  .badges { max-width: 560px; }
  .answers { max-width: 1040px; }
}

/* Leaderboard */
.result { text-align: center; }
.tier-label { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); }
.tier { font-size: 30px; font-weight: 800; }
.score { font-size: 46px; font-weight: 800; color: var(--gold); }
.score small { font-size: 18px; color: var(--muted); font-weight: 400; }
.section-title { align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); }
.lb { width: 100%; list-style: none; display: grid; gap: 8px; }
.lb li {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 4px 12px;
  padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.lb li.me { border-color: var(--gold); background: rgba(212, 160, 23, .08); }
.lb .pos { font-weight: 800; font-size: 20px; color: var(--gold); text-align: center; }
.lb li:nth-child(1) .pos::after { content: ' ★'; font-size: 12px; }
.lb .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb .who small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.lb .pts { font-weight: 800; font-size: 20px; }
.lb .pts small { font-size: 12px; color: var(--muted); font-weight: 400; }
.lb .bar { grid-column: 2 / 4; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.lb .bar div { height: 100%; background: var(--gold); }
.stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }
.stats .section-title { margin-bottom: 8px; }
.mini-list { list-style: none; display: grid; gap: 8px; }
.mini-list li { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.mini-list img { width: 42px; height: 42px; border-radius: 4px; object-fit: cover; }
.mini-list small { display: block; color: var(--muted); }

.footer { position: relative; z-index: 1; text-align: center; font-size: 11px; color: rgba(245, 240, 232, .35); padding: 18px 18px 28px; line-height: 1.6; }
.footer a { color: var(--gold-soft); }

/* Share my Top 9 */
.share-head { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.share-title { font-size: 20px; font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.unlock { text-align: center; justify-items: center; }
#share-btn { justify-self: center; margin-top: 6px; }
.share-panel { display: grid; gap: 12px; justify-items: center; }
.share-img { width: 100%; max-width: 360px; aspect-ratio: 1080 / 1350; border-radius: 10px; background: rgba(255,255,255,.04); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
a.btn { text-decoration: none; display: inline-block; }
.share-url { width: 100%; font-size: 13px; text-align: center; padding: 8px 10px; color: var(--muted); }
