  :root {
    --bg: #04141f;
    --panel: #0d2330;
    --ink: #f2eefa;
    --muted: #9b93ad;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: radial-gradient(1200px 600px at 50% -12%, #103e56 0%, var(--bg) 60%);
    color: var(--ink);
    font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
  }
  .wrap { max-width: 1220px; margin: 0 auto; padding: 36px 24px 80px; }

  header { text-align: center; margin-bottom: 6px; }
  h1 {
    font-size: clamp(30px, 5vw, 52px);
    letter-spacing: -0.02em;
    color: #dcefff;
    font-weight: 800;
  }
  .sub { color: var(--muted); margin-top: 8px; font-size: 15px; }
  .sub b { color: #d8cfee; }

  /* album cover strip */
  .covers { display: flex; justify-content: center; flex-wrap: wrap; margin: 22px 0 4px; padding: 0 10px; }
  .covers img {
    width: 58px; height: 58px; border-radius: 10px; margin: 0 -7px;
    border: 2px solid var(--ec, #ffffff2a); box-shadow: 0 8px 24px rgba(0,0,0,.55);
    cursor: pointer; transition: transform .18s ease, border-color .18s;
    object-fit: cover;
  }
  .covers img:nth-child(odd)  { transform: rotate(-4deg); }
  .covers img:nth-child(even) { transform: rotate(4deg) translateY(4px); }
  .covers img:hover { transform: rotate(0) scale(1.55) !important; z-index: 5; position: relative; border-color: #fff; }
  .covers img.solo { border-color: #ffd166; box-shadow: 0 0 18px #ffd16688; }
  .covers-hint { text-align: center; color: #5e5575; font-size: 11.5px; margin-top: 10px; }

  /* metric pills — docked to the axis they control */
  .pill {
    border: 1px dashed #4d4470; background: #1b1727; color: #cfc6e4;
    padding: 8px 14px; border-radius: 999px; cursor: pointer;
    font-size: 13.5px; font-weight: 600; transition: all .2s ease;
    user-select: none;
  }
  .pill:hover { border-color: #7ab8ff; transform: translateY(-1px) scale(1.04); background: #173247; }
  .pill.active {
    background: linear-gradient(90deg, #2f6fd0, #4fa3c2);
    border: 1px solid #7ab8ff; color: #fff;
    box-shadow: 0 0 18px rgba(90, 150, 255, .45);
  }
  .pill.activeY {
    background: linear-gradient(90deg, #2f6fd0, #4fa3c2);
    border: 1px solid #7ab8ff; color: #fff;
    box-shadow: 0 0 18px rgba(90, 150, 255, .45);
  }
  .chart-zone { position: relative; margin-top: 18px; }
  .chart-main { width: 100%; }
  .axis-picker .picker-cap {
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  }
  .axis-picker .picker-cap span {
    color: #8d84a8; font-weight: 600; letter-spacing: 0; text-transform: none; font-style: italic;
  }
  .axis-picker.y {
    position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
    display: flex; flex-direction: column; gap: 6px; align-items: flex-end;
    width: 178px; padding-right: 12px;
  }
  .axis-picker.y .picker-cap { color: #7ab8ff; text-align: right; margin-bottom: 4px; }
  .axis-picker.y .pill { padding: 6px 12px; font-size: 12.5px; }
  .axis-picker.x {
    display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; align-items: center;
    margin-top: 12px;
  }
  .axis-picker.x .picker-cap { color: #7ab8ff; width: 100%; text-align: center; margin-bottom: 2px; }
  @keyframes capNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
  .picker-cap b { display: inline-block; animation: capNudge 2.2s ease-in-out infinite; }
  @media (max-width: 1610px) {
    .axis-picker.y {
      position: static; transform: none; width: auto; padding-right: 0;
      flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center;
      margin-bottom: 10px; gap: 7px;
    }
    .axis-picker.y .picker-cap { width: 100%; text-align: center; }
    .axis-picker.y .picker-cap br { display: none; }
    .axis-picker.y .picker-cap span::before { content: "· "; }
    .side-boards { display: none; }
  }
  .xblurb {
    flex: 1; text-align: center; color: var(--muted); font-size: 13px;
    font-style: italic; font-weight: 500; line-height: 1.35; padding: 0 10px;
  }
  .yblurb {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%) rotate(180deg);
    writing-mode: vertical-rl; max-height: 68%;
    color: var(--muted); font-size: 12.5px; font-style: italic; line-height: 1.3;
    text-align: center;
  }

  /* chart */
  .chart-card {
    position: relative; margin-top: 18px;
    background: linear-gradient(180deg, #0c2331 0%, #08161f 100%);
    border: 1px solid #173a4a; border-radius: 18px;
    padding: 14px 12px 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
  }
  .axis-labels {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; font-weight: 700; padding: 6px 8px 2px 80px;
  }
  .axis-labels .lo { color: #8fb4ff; }
  .axis-labels .hi { color: #ff9ec4; }
  #stage { position: relative; width: 100%; height: 620px; }
  .gridline {
    position: absolute; top: 26px; bottom: 30px; width: 1px;
    background: #ffffff10;
  }
  .gridlineH {
    position: absolute; left: 80px; right: 20px; height: 1px;
    background: #ffffff10;
  }
  .gridtick {
    position: absolute; bottom: 8px; transform: translateX(-50%);
    color: #5e5575; font-size: 11px;
  }
  .gridtickY {
    position: absolute; left: 60px; transform: translateY(-50%);
    color: #5e5575; font-size: 11px;
  }
  .ylab {
    position: absolute; writing-mode: vertical-rl; transform: rotate(180deg);
    font-size: 14px; font-weight: 700; left: 8px;
  }
  .ylab.hi { top: 12px; color: #ff9ec4; }
  .ylab.lo { bottom: 16px; color: #8fb4ff; }
  .ylab .up { display: inline-block; transform: rotate(90deg); }
  .corner {
    position: absolute; font-size: 10.5px; color: #ffffff42; pointer-events: none;
    font-style: italic; max-width: 230px; line-height: 1.3; z-index: 1;
  }
  .dot {
    position: absolute; border-radius: 50%;
    width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px;
    cursor: pointer;
    background-size: cover; background-position: center;
    transition: left 1s cubic-bezier(.22,1,.36,1), top 1s cubic-bezier(.22,1,.36,1),
                opacity .35s ease, transform .15s ease;
  }
  .dot:hover { transform: scale(2.2); z-index: 50; }
  .dot.dim { opacity: .06; pointer-events: none; }
  .dot-label {
    position: absolute; font-size: 11px; color: #cdc3e6; white-space: nowrap;
    transform: translate(-50%, -24px); pointer-events: none;
    text-shadow: 0 1px 4px #000;
    transition: left 1s cubic-bezier(.22,1,.36,1), top 1s cubic-bezier(.22,1,.36,1), opacity .4s;
    font-weight: 600;
  }

  /* tooltip */
  #tip {
    position: fixed; z-index: 100; pointer-events: none;
    background: #1d1830f2; border: 1px solid #4d4170;
    border-radius: 12px; padding: 12px 14px; max-width: 330px;
    font-size: 13px; line-height: 1.45;
    box-shadow: 0 12px 40px rgba(0,0,0,.6);
    opacity: 0; transition: opacity .12s;
  }
  #tip .t-head { display: flex; gap: 10px; align-items: center; }
  #tip .t-cover { width: 46px; height: 46px; border-radius: 8px; flex: none; object-fit: cover; border: 1px solid #ffffff30; }
  #tip .t-title { font-weight: 800; font-size: 14.5px; }
  #tip .t-album { font-size: 12px; margin-top: 1px; }
  #tip .t-score { font-weight: 700; color: #ffd9ec; }
  #tip .t-note { color: #b7add0; font-style: italic; margin-top: 7px; }
  #tip .t-metric { margin-top: 7px; }
  #tip .t-play {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 9px;
    background: #1DB954; color: #fff; font-weight: 800; font-size: 12px;
    padding: 5px 12px; border-radius: 999px; text-decoration: none; transition: transform .12s;
  }
  #tip .t-play:hover { transform: scale(1.06); }
  #tip .t-play.yt { background: #cc0000; }
  #tip .t-actions { display: flex; gap: 8px; }

  /* simplified leaderboard in the right gutter */
  .side-boards {
    position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
    width: 196px; padding-left: 14px; display: flex; flex-direction: column; gap: 20px;
  }
  .sb-cap {
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .06em; margin-bottom: 6px;
  }
  .sb-cap.x { color: #7ab8ff; }
  .sb-cap.y { color: #7ab8ff; }
  .sb-cap span { color: #6a6184; font-weight: 600; text-transform: none; letter-spacing: 0; }
  .sb-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 12px; }
  .sb-row img, .sb-dot { width: 18px; height: 18px; border-radius: 5px; flex: none; object-fit: cover; }
  .sb-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; font-weight: 600; }
  .sb-v { color: #ffd9ec; font-weight: 800; font-size: 11.5px; }

  .corner.tl { left: 86px; top: 8px; }
  .corner.tr { right: 24px; top: 8px; text-align: right; }
  .corner.bl { left: 86px; bottom: 36px; }
  .corner.br { right: 24px; bottom: 36px; text-align: right; }

  /* tabs */
  .tabs { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }
  .tab {
    background: #1b1727; border: 1px solid #3a3450; color: #cfc6e4;
    padding: 10px 22px; border-radius: 12px; font-size: 14.5px; font-weight: 700; cursor: pointer;
    transition: all .2s;
  }
  .tab:hover { border-color: #6f5fa8; transform: translateY(-1px); }
  .tab.active {
    background: linear-gradient(90deg, #2f6fd0, #4fa3c2); border-color: #7ab8ff; color: #fff;
    box-shadow: 0 0 18px rgba(90, 150, 255, .45);
  }
  .page.hidden { display: none; }

  /* aura page */
  .aura-intro { text-align: center; color: var(--muted); margin: 26px auto 18px; max-width: 640px; font-size: 15px; line-height: 1.55; }
  .picker { position: relative; max-width: 520px; margin: 0 auto; }
  #songSearch {
    width: 100%; padding: 13px 18px; border-radius: 14px; border: 1px solid #3a3450;
    background: #1b1727; color: var(--ink); font-size: 15px; outline: none;
  }
  #songSearch:focus { border-color: #7ab8ff; box-shadow: 0 0 14px rgba(90,150,255,.3); }
  #suggest {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; display: none;
    background: #1d1830; border: 1px solid #4d4170; border-radius: 12px;
    max-height: 320px; overflow-y: auto;
    box-shadow: 0 14px 40px rgba(0,0,0,.6);
  }
  .sg { display: flex; align-items: center; gap: 10px; padding: 9px 13px; cursor: pointer; font-size: 14px; }
  .sg:hover { background: #2b2344; }
  .sg img, .sg .cv-fallback { width: 28px; height: 28px; border-radius: 6px; flex: none; }
  .sg-al { margin-left: auto; font-size: 11.5px; }
  #chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px auto; max-width: 700px; min-height: 38px; }
  .chip {
    display: flex; align-items: center; gap: 8px; background: #1b1727; border: 1px solid #3a3450;
    padding: 6px 12px 6px 7px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  }
  .chip img { width: 24px; height: 24px; border-radius: 50%; }
  .chip .x { cursor: pointer; color: #6a6184; font-size: 12px; }
  .chip .x:hover { color: #ff9ec4; }
  #auraBtn {
    display: block; margin: 6px auto 0; padding: 13px 30px; border-radius: 999px; border: none;
    font-size: 15.5px; font-weight: 800; cursor: pointer; color: #fff;
    background: linear-gradient(90deg, #2f6fd0, #4fa3c2);
    box-shadow: 0 0 22px rgba(180,100,255,.4); transition: all .2s;
  }
  #auraBtn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
  #auraBtn:not(:disabled):hover { transform: translateY(-2px) scale(1.02); }
  .aura-card {
    margin: 28px auto 0; max-width: 780px; background: linear-gradient(180deg, #0c2331, #08161f);
    border: 1px solid #173a4a; border-radius: 18px; padding: 26px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
  }
  .aura-headline { text-align: center; font-size: 17px; margin-bottom: 22px; line-height: 1.5; }
  .aura-flex { display: flex; gap: 30px; align-items: center; justify-content: center; flex-wrap: wrap; }
  .donut-wrap { position: relative; width: 220px; height: 220px; }
  #auraResult circle { transition: stroke-dasharray 1.1s cubic-bezier(.22,1,.36,1); }
  .donut-center {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 40px; pointer-events: none;
  }
  .donut-center small { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: 2px; max-width: 130px; text-align: center; line-height: 1.25; }
  .aura-bars { flex: 1; min-width: 280px; max-width: 380px; }
  .aura-row { display: flex; align-items: center; gap: 9px; margin: 11px 0; font-size: 13.5px; }
  .ar-emoji { width: 22px; text-align: center; }
  .ar-name { width: 152px; font-weight: 700; line-height: 1.2; }
  .ar-track { flex: 1; height: 9px; background: #ffffff0e; border-radius: 9px; overflow: hidden; }
  .ar-fill { height: 100%; width: 0; border-radius: 9px; transition: width 1.1s cubic-bezier(.22,1,.36,1); }
  .ar-pct { width: 42px; text-align: right; font-weight: 800; }
  .aura-songs { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
  .aura-songs img { width: 26px; height: 26px; border-radius: 6px; border: 1px solid #ffffff22; }
  .aura-songs span { color: #7d7494; font-size: 11.5px; margin-left: 6px; }
  .aura-story { margin-top: 26px; border-top: 1px dashed #ffffff18; padding-top: 20px; }
  .as-head {
    text-align: center; font-size: 13px; font-weight: 800; letter-spacing: .14em;
    text-transform: uppercase; color: #c9b8ff; margin-bottom: 10px;
  }
  .as-signs { text-align: center; font-size: 12.5px; color: #9b93ad; margin-bottom: 14px; }
  .aura-story p {
    font-size: 14.5px; line-height: 1.8; color: #d8cfee;
    margin: 0 auto 14px; max-width: 620px; text-align: left;
  }
  .as-sub {
    text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: #c9b8ff; margin: 22px 0 10px;
  }
  .as-todo { list-style: none; max-width: 620px; margin: 0 auto; padding: 0; }
  .as-todo li {
    font-size: 14px; line-height: 1.6; color: #e8def8; padding: 8px 0 8px 2px;
    border-bottom: 1px dashed #ffffff10;
  }
  .as-todo li:last-child { border-bottom: none; }
  .as-todo li::before { content: "✦ "; color: #ffd166; }
  .as-prophecy { color: #ffd9ec !important; }
  .aura-loading { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 52px 0 32px; }
  .orb {
    width: 64px; height: 64px; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e8def8, #a64fc2 55%, #4a2c8f);
    box-shadow: 0 0 30px #a64fc288, 0 0 70px #6d4fc266;
    animation: orbPulse 1.1s ease-in-out infinite alternate, orbHue 3s linear infinite;
  }
  @keyframes orbPulse { from { transform: scale(.88); } to { transform: scale(1.12); box-shadow: 0 0 45px #d44fc2aa, 0 0 90px #6d4fc288; } }
  @keyframes orbHue { to { filter: hue-rotate(360deg); } }
  .al-text {
    color: #c9b8ff; font-size: 14.5px; font-weight: 700; letter-spacing: .04em;
    animation: alFade 1s ease-in-out infinite alternate;
  }
  @keyframes alFade { from { opacity: .5; } to { opacity: 1; } }
  .catalogue { max-width: 920px; margin: 40px auto 0; }
  .cat-head {
    text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: #6a6184; margin-bottom: 6px;
  }
  .cat-era { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; margin: 20px 0 8px; }
  .cat-era img { width: 22px; height: 22px; border-radius: 5px; }
  .cat-era span { color: #6a6184; font-weight: 600; font-size: 11.5px; }
  .cat-songs { display: flex; flex-wrap: wrap; gap: 6px; }
  .cat-song {
    font-size: 12px; padding: 5px 11px; border-radius: 999px;
    border: 1px solid #2e2845; background: #181425; color: #c8bfdd;
    cursor: pointer; transition: all .15s; font-family: inherit;
  }
  .cat-song:hover { border-color: #7ab8ff; transform: translateY(-1px); }
  .cat-song.picked {
    background: linear-gradient(90deg, #2f6fd0, #4fa3c2);
    color: #fff; border-color: #7ab8ff;
  }
  .cat-song.maxed { opacity: .35; pointer-events: none; }

  .home-btn {
    position: fixed; top: 16px; left: 16px; z-index: 60;
    display: flex; align-items: center; gap: 7px;
    padding: 8px 15px; border-radius: 999px;
    background: rgba(8, 20, 28, .55); backdrop-filter: blur(6px);
    border: 1px solid #ffffff1f; color: #cfe6f2;
    font-size: 13px; font-weight: 700; text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
  }
  .home-btn:hover { background: rgba(20, 44, 58, .7); border-color: #4fa3c2aa; color: #fff; }
  .made-by {
    position: fixed; top: 16px; right: 16px; z-index: 60;
    color: #cdc3e0; font-size: 13px; font-weight: 600;
    background: rgba(20, 16, 32, .55); padding: 7px 14px; border-radius: 999px;
    border: 1px solid #2e2845; backdrop-filter: blur(4px);
  }
  .made-by a { color: #fff; font-weight: 800; text-decoration: none; border-bottom: 1px solid #ffffff66; }
  @media (max-width: 700px) {
    .home-btn { top: 10px; left: 10px; padding: 8px 13px; font-size: 13px; }
    .made-by { display: none; }
  }

  footer { text-align: center; color: #564e6e; font-size: 12px; margin-top: 34px; line-height: 1.6; }

  /* mobile adaptations — same layout, scaled for small screens */
  @media (max-width: 700px) {
    .wrap { padding: 20px 12px 60px; }
    .sub { font-size: 13.5px; }
    .covers img { width: 44px; height: 44px; border-radius: 8px; margin: 0 -5px; }
    .tabs { gap: 8px; }
    .tab { padding: 8px 16px; font-size: 13px; }
    .pill { padding: 7px 11px; font-size: 12px; }
    .axis-picker.y .pill { padding: 6px 10px; font-size: 11.5px; }
    .chart-card { padding: 10px 8px 4px; border-radius: 14px; }
    #stage { height: 460px; }
    .yblurb, .corner { display: none; }
    .gridlineH { left: 52px; }
    .gridtickY { left: 32px; }
    .ylab { font-size: 12px; }
    .axis-labels { padding: 4px 6px 2px 52px; font-size: 12px; }
    .xblurb { font-size: 11px; padding: 0 6px; }
    .dot-label { font-size: 10px; }
    #tip { max-width: min(330px, calc(100vw - 24px)); font-size: 12.5px; }
    .aura-intro { font-size: 13.5px; margin: 18px auto 14px; }
    .aura-card { padding: 18px 14px; }
    .aura-headline { font-size: 15px; }
    .ar-name { width: 126px; font-size: 12px; }
  }
