:root {
  --paper: #f6f1e8;
  --paper-2: #efe8db;
  --line: #e3dccf;
  --line-2: #d9d0bf;
  --ink: #1c1917;
  --muted: #6b6560;
  --faint: #b8b0a3;
  --disabled: #8a8378;
  --brass: #b7791f;
  --brass-dark: #8f5d15;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brass); }
a:hover { color: var(--brass-dark); }

.col {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 40px 32px 36px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 400px) {
  .col { padding: 28px 20px 28px; }
}

.results-grid { display: flex; flex-direction: column; gap: 36px; }
.results-grid > div { display: flex; flex-direction: column; gap: 36px; }

/* Desktop: wider column, results in two columns. */
@media (min-width: 900px) {
  .col { max-width: 640px; padding: 64px 40px 48px; }
  .col.wide { max-width: 1040px; }
  h1 { font-size: 60px; }
  h1.results { font-size: 48px; }
  .results-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .rating button { height: 68px; font-size: 30px; }
  .play { width: 128px; height: 128px; border-radius: 64px; }
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input {
  appearance: none; width: 100%; height: 56px; border-radius: 6px;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--serif); font-size: 28px; letter-spacing: 0.2em; text-transform: uppercase;
  padding: 0 16px; outline: none;
}
.field input:focus { border-color: var(--brass); box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.2); }
.field input::placeholder { color: var(--faint); letter-spacing: 0.2em; }
.field .help { font-size: 13px; color: var(--muted); }
.field .err { font-size: 13px; color: #9b2c2c; }

.who { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.who b { color: var(--ink); font-weight: 600; letter-spacing: 0.08em; }
.linkbtn { appearance: none; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); cursor: pointer; }
.linkbtn:hover { color: var(--brass-dark); }


.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 32px;
}
.screen.spread { justify-content: space-between; }

.wordmark {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark svg { flex-shrink: 0; }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 52px;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
h1.results { font-size: 42px; line-height: 1.05; }
@media (max-width: 400px) {
  h1 { font-size: 42px; }
  h1.results { font-size: 36px; }
}

.lede { margin: 0; font-size: 17px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }

.stack { display: flex; flex-direction: column; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.gap-18 { gap: 18px; }
.gap-28 { gap: 28px; }

.step { display: flex; gap: 14px; align-items: flex-start; }
.step .num {
  width: 28px; height: 28px; border-radius: 14px;
  border: 1.5px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 16px; flex-shrink: 0;
}
.step .txt { padding-top: 3px; }

.btn {
  appearance: none;
  border: 0;
  width: 100%;
  height: 56px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.btn:hover { background: #000; }
.btn:disabled { background: var(--line); color: var(--disabled); cursor: not-allowed; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  height: 48px;
  font-size: 15px;
  font-weight: 400;
}
.btn.ghost:hover { background: var(--paper-2); }

.note { font-size: 13px; line-height: 1.4; color: var(--muted); text-align: center; }

.roundhead { display: flex; justify-content: space-between; align-items: baseline; }
.roundhead .count { font-family: var(--serif); font-size: 20px; }
.roundhead .count span { color: var(--muted); }

.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar > div { height: 100%; background: var(--ink); width: 0; transition: width 240ms ease; }
.bar.audio { height: 4px; }
.bar.audio > div { background: var(--brass); transition: width 200ms linear; }

.player { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.piece-label { font-family: var(--serif); font-style: italic; font-size: 26px; color: var(--muted); }
.play {
  appearance: none; border: 0; padding: 0;
  width: 112px; height: 112px; border-radius: 56px;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.play:hover { background: #000; }
.play:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }
.time { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.time span { color: var(--faint); }
.player .wide { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }

.rate-q { font-size: 15px; text-align: center; }
.rating { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.rating button {
  appearance: none;
  height: 60px;
  border-radius: 6px;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 26px;
  cursor: pointer;
  padding: 0;
}
.rating button:hover { background: var(--paper-2); }
.rating button[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--paper); }
.rating button:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.rate-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.section-title {
  font-size: 13px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}

.compass { width: 100%; height: auto; display: block; }

.rank { display: grid; grid-template-columns: 96px minmax(0, 1fr) 40px; gap: 12px; align-items: center; }
.rank .name { font-family: var(--serif); font-size: 19px; }
.rank .track { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.rank .track > div { height: 100%; background: var(--ink); }
.rank.top .track > div { background: var(--brass); }
.rank .score { font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.rank .sub { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -6px; }

.traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 999px; font-size: 14px; background: var(--ink); color: var(--paper); }
.chip.out { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
.chip.none { background: transparent; color: var(--muted); padding-left: 0; }

.reveal { display: flex; flex-direction: column; }
.reveal .row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 72px; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.reveal .row:last-child { border-bottom: 1px solid var(--line); }
.reveal .sc { font-family: var(--serif); font-size: 22px; }
.reveal .sc.hi { color: var(--brass); }
.reveal .t { font-size: 15px; }
.reveal .c { font-size: 13px; color: var(--muted); }
.reveal .r { font-size: 13px; color: var(--muted); text-align: right; }
.reveal .c a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); }
.reveal .c a:hover { color: var(--brass-dark); }

.friend-banner {
  padding: 14px 16px; border-radius: 6px; background: var(--paper-2);
  font-size: 14px; line-height: 1.45; color: var(--ink);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 6px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity 200ms;
}
.toast.show { opacity: 1; }

.credits { font-size: 12px; color: var(--muted); line-height: 1.5; }
