@font-face {
  font-family: "StepPrime Score";
  src: url("/static/Oswald-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "StepPrime UI";
  src: url("/static/Roboto-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

/* Phoenix2_HD palette, shared with account.css. */
:root {
  color-scheme: dark;
  --ink: #040805;
  --panel: #0d1510;
  --line: #24402a;
  --text: #f2fbef;
  --muted: #b8cabb;
  --signal: #46ff3c;
  --gold: #f4dc16;
  --single: #ff7a7a;
  --double: #8dff7a;
  --danger: #ff6f6f;
  --ui-font: "StepPrime UI", "Segoe UI", system-ui, sans-serif;
  --score-font: "StepPrime Score", "Segoe UI", sans-serif;
  --body-font: "Segoe UI", system-ui, sans-serif;
  font-family: var(--body-font);
  color: var(--text);
  background: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; overflow-x: clip; }
body { width: min(100%, 339px); }
::selection { background: var(--signal); color: var(--ink); }
h1, h2, h3, p, dl, dd { margin: 0; }
.overlay-frame { width: 100%; height: 576px; max-height: 100dvh; padding: 12px; display: grid; grid-template-rows: minmax(0, 1fr) 18px; gap: 8px; }
#overlay-content { display: grid; grid-template-rows: 44px 170px minmax(0, 1fr); gap: 12px; }
.overlay-player { display: flex; align-items: center; gap: 10px; }
.overlay-avatar, .avatar-fallback { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border: 2px solid var(--gold); border-radius: 6px; overflow: clip; background: var(--panel); font-size: 24px; font-weight: 700; color: var(--gold); }
.overlay-avatar .avatar-fallback { width: 100%; height: 100%; flex-basis: auto; border: 0; border-radius: 3px; }
.avatar-fallback img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.player-copy { flex: 1; }
.player-copy h1 { font-size: 19px; line-height: 1.2; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-copy p { margin-top: 3px; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlay-pumbility { padding: 10px 12px; border-top: 2px solid var(--signal); border-radius: 6px; background: var(--panel); box-shadow: 0 -4px 12px -6px var(--signal); }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.section-heading h2 { font-family: var(--ui-font); font-size: 12px; font-weight: 700; letter-spacing: .08em; line-height: 18px; text-transform: uppercase; }
.section-heading > span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.pumbility-overview { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 56px; }
.pumbility-value { color: var(--gold); font-family: var(--score-font); font-size: 34px; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.total-tier { display: flex; align-items: center; gap: 4px; max-width: 130px; }
.pumbility-tier-icon { width: 38px; height: 38px; object-fit: contain; flex-shrink: 0; }
.total-tier span { font-size: 10px; line-height: 1.3; font-weight: 700; overflow-wrap: anywhere; }
.mode-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode-totals > div { display: flex; align-items: baseline; gap: 8px; }
.mode-totals dt { font-size: 11px; color: var(--muted); }
.mode-totals dd { font-family: var(--score-font); font-size: 22px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.next-tier { margin-top: 8px; }
.next-tier progress { appearance: none; display: block; width: 100%; height: 3px; border: 0; background: var(--line); color: var(--signal); }
.next-tier progress::-webkit-progress-bar { background: var(--line); }
.next-tier progress::-webkit-progress-value { background: var(--signal); }
.next-tier progress::-moz-progress-bar { background: var(--signal); }
.next-tier p { margin-top: 5px; font-size: 10px; line-height: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-tier b { color: var(--text); }
.overlay-attempts { display: flex; flex-direction: column; }
.overlay-score-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-rows: repeat(4, 64px); }
.overlay-attempt { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.overlay-attempt:last-child { border-bottom: 0; }
.song-art { display: grid; place-items: center; width: 52px; height: 36px; flex: 0 0 52px; overflow: clip; border-radius: 4px; background: var(--panel); color: var(--muted); }
.song-thumbnail { width: 100%; height: 100%; object-fit: cover; }
.attempt-copy { flex: 1; }
.attempt-copy h3 { font-size: 12px; line-height: 15px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attempt-meta { display: flex; align-items: center; gap: 7px; height: 16px; }
.chart-level { font-size: 11px; line-height: 14px; font-weight: 800; color: var(--single); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 95px; }
.chart-level.is-double { color: var(--double); }
.status-pill, .failed-label { font-size: 9px; line-height: 14px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.status-pill.is-live { color: var(--signal); }
.status-pill.is-danger, .failed-label { color: var(--danger); }
.attempt-result { display: flex; align-items: center; gap: 8px; height: 22px; }
.attempt-result strong { font-family: var(--score-font); font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1; }
.score-grade { width: 48px; height: auto; }
.score-grade.is-failed { opacity: .55; }
.score-plate { width: 49px; height: auto; max-height: 22px; object-fit: contain; }
.score-plate-text { font-size: 10px; }
.overlay-empty { grid-row: 1 / -1; align-self: center; color: var(--muted); text-align: center; padding: 24px; font-size: 12px; line-height: 1.6; }
.overlay-empty p { color: var(--text); margin-bottom: 6px; }
.overlay-empty span { display: block; }
.overlay-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted); }
.overlay-footer > :first-child { font-weight: 700; }
#overlay-sync.is-stale { color: var(--danger); }
@media (max-width: 300px) {
  .overlay-frame { padding: 8px; }
  .pumbility-value { font-size: 28px; }
  .total-tier { max-width: 104px; }
  .pumbility-tier-icon { width: 28px; height: 28px; }
  .mode-totals > div { flex-direction: column; gap: 0; }
  .mode-totals dd { font-size: 19px; }
  .song-art { width: 40px; flex-basis: 40px; }
  .attempt-result { gap: 5px; }
  .score-plate { width: 40px; }
}
