/* Arimo: metric-compatible with Arial, the lettering of the political compass chart */
@font-face { font-family: "Arimo"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/fonts/arimo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Arimo"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/fonts/arimo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Arimo"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/fonts/arimo-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Arimo"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(assets/fonts/arimo-greek.woff2) format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }

/* ------------------------------------------------------------------ tokens */

:root {
  /* The political compass quadrants */
  --q-tl: #FF7575;
  --q-tr: #42AAFF;
  --q-bl: #9AED97;
  --q-br: #C09AEC;

  --ink: #000000;
  --ink-2: #4D4D4D;
  --muted: #6B6B6B;
  --paper: #FFFFFF;
  --side: #F2F2F2;
  --side-line: #CFCFCF;
  --field-line: #9A9A9A;
  --grid: rgba(0, 0, 0, 0.16);
  --danger: #C40000;

  --font: "Arimo", Arial, Helvetica, sans-serif;
  --side-w: 360px;

  color-scheme: light;
}

/* -------------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--paper); }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr auto;
  grid-template-areas:
    "head  stage"
    "axes  stage"
    "song  stage"
    "list  stage"
    "foot  stage";
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--q-tr); color: var(--ink); }

a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }

button, input, textarea { font: inherit; color: inherit; }

input, textarea { caret-color: var(--ink); }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; }
.icon-fill { fill: currentColor; stroke: none; }

/* ----------------------------------------------------------------- sidebar */

.side {
  background: var(--side);
  border-right: 1px solid var(--side-line);
  padding: 22px 26px;
}

.side + .side { border-top: 1px solid var(--side-line); }

.side-head  { grid-area: head; padding-top: 26px; }
.side-axes  { grid-area: axes; }
.side-song  { grid-area: song; }
.side-list  { grid-area: list; }
.side-foot  { grid-area: foot; font-size: 12.5px; color: var(--muted); padding-top: 14px; padding-bottom: 18px; }

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }

.lede { margin-top: 12px; color: var(--ink-2); font-size: 14px; max-width: 34ch; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  color: var(--ink);
}

.head-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; }
.link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }

.side-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

.side-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.field { display: block; margin-bottom: 10px; }

.field-label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }

input[type="text"], textarea {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--field-line);
  border-radius: 0;
  padding: 7px 9px;
  font-size: 15px;
}

input[type="text"]::placeholder, textarea::placeholder { color: var(--muted); }

input[type="text"]:hover, textarea:hover { border-color: var(--ink-2); }

input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.axis-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

/* Buttons: plain chart-page buttons, black on white */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  transition: background-color 0.12s, color 0.12s;
}

.btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; border-color: var(--field-line); color: var(--muted); }

.btn-primary { width: 100%; margin-top: 4px; }

.btn.is-loading, .btn.is-loading:disabled { border-color: var(--ink); color: var(--ink); background: var(--paper); cursor: progress; }
.btn.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Dot colour */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 3px 0 2px 3px; }

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--c);
  cursor: pointer;
  position: relative;
}

.swatch[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.reward-swatches { display: contents; }
.swatch-custom { background: conic-gradient(var(--q-tl), var(--q-tr), var(--q-br), var(--q-bl), var(--q-tl)); }
.swatch-custom.is-set { background: var(--c); }
.swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border-radius: 50%; }

/* Song list */
.song-list { list-style: none; margin: 0 -8px; max-height: 340px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--field-line) transparent; }

.song-item {
  display: grid;
  grid-template-columns: 14px 28px minmax(0, 1fr) auto 26px;
  align-items: center;
  gap: 9px;
  padding: 6px 4px 6px 8px;
  cursor: pointer;
  border: 1px solid transparent;
}

.song-item:hover { background: rgba(0, 0, 0, 0.04); }
.song-item.is-selected { background: var(--paper); border-color: var(--ink); }

.flair-chip { width: 12px; height: 12px; border: 1.5px solid var(--ink); background: var(--c); flex-shrink: 0; }

/* Album art; a grey square holds the space until it loads or if there's none */
.song-cover { width: 28px; height: 28px; object-fit: cover; border: 1px solid var(--ink); background: var(--side); display: block; }
.song-cover.is-empty { border-color: var(--side-line); }

.song-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.song-name b { font-weight: 700; }
.song-name span { color: var(--ink-2); }

.song-score { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

.song-remove {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
}

.song-remove:hover { color: var(--ink); background: rgba(0, 0, 0, 0.07); }

.empty-note { color: var(--muted); font-size: 14px; }
.empty-note[hidden] { display: none; }

/* ------------------------------------------------------------------- stage */

.stage {
  grid-area: stage;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 40px 40px;
  min-width: 0;
}

/* Taller than the window (e.g. zoomed in): scroll with the page instead of
   staying pinned, or the result below the compass can never be reached */
.stage.is-unpinned { position: static; max-height: none; }

.compass-wrap, .result {
  width: 100%;
  max-width: max(320px, min(800px, calc(100vh - 175px)));
}

.compass-wrap { position: relative; }

#graph { display: block; width: 100%; height: auto; overflow: visible; }

.quad.q-tl { fill: var(--q-tl); }
.quad.q-tr { fill: var(--q-tr); }
.quad.q-bl { fill: var(--q-bl); }
.quad.q-br { fill: var(--q-br); }

.grid-lines line { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.axes line { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.frame { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* --s: SVG units per screen pixel, so type and dots keep their screen size as the chart scales */
.pole { font-family: var(--font); font-weight: 700; font-size: calc(20px * var(--s, 1)); fill: var(--ink); }
.pole.pending { fill: var(--muted); }

.flair { font-family: var(--font); font-weight: 700; font-size: calc(12.5px * var(--s, 1)); fill: rgba(0, 0, 0, 0.82); }

.song-dot {
  r: calc(6.5px * var(--s, 1));
  stroke: var(--ink);
  stroke-width: calc(1.5px * var(--s, 1));
  cursor: pointer;
}

.song-dot.is-selected { r: calc(8.5px * var(--s, 1)); stroke-width: calc(2.5px * var(--s, 1)); }
.song-label {
  font-family: var(--font);
  font-size: calc(12.5px * var(--s, 1));
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: calc(3.5px * var(--s, 1));
  stroke-linejoin: round;
  pointer-events: none;
  user-select: none;
}

.song-label.is-selected { font-weight: 700; }

/* No room for the label: show it only while the song is hovered or selected */
.song-label.is-crowded { display: none; }
.song-label.is-crowded.is-selected, .song-label.is-crowded.is-previewed { display: inline; }

.song-leader { stroke: var(--ink); stroke-width: calc(1px * var(--s, 1)); pointer-events: none; }

.empty-state {
  position: absolute;
  /* the plot square inside the viewBox margins (52/804 and 48/796) */
  left: 6.47%; right: 6.47%; top: 6.03%; bottom: 6.03%;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.empty-state[hidden] { display: none; }

.empty-state p {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 10px 14px;
  font-weight: 700;
  font-size: 15px;
  max-width: 80%;
  text-align: center;
}

/* Result: the political compass test result, per song */
.result {
  margin-top: 10px;
  padding: 0 6.47%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.result-body { min-width: 0; }

.result-hint { color: var(--muted); font-size: 14px; padding-top: 2px; }

.result-head { display: flex; align-items: center; gap: 12px; }
.result-cover { width: 56px; height: 56px; object-fit: cover; border: 2px solid var(--ink); flex-shrink: 0; display: block; }
.result-cover.is-empty { display: none; }
.result-title { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.result-title span { font-weight: 400; color: var(--ink-2); }

.result-scores { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 36px; }
.result-scores dt { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.result-scores dd { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }

/* 30-second preview */
.preview { margin-top: 12px; display: flex; align-items: center; gap: 10px; max-width: 360px; }
.preview-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.preview-btn:hover { background: var(--ink); color: var(--paper); }
.preview-track { flex: 1; min-width: 60px; height: 6px; background: var(--side); border: 1px solid var(--side-line); }
.preview-bar { width: 0; height: 100%; background: var(--q-tr); }
.preview-link { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; text-underline-offset: 3px; }
.preview-link:hover { color: var(--ink); }
.preview-note { margin-top: 12px; font-size: 13px; color: var(--muted); }

.result-flair { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.result-flair .flair-chip { width: 16px; height: 16px; border-width: 2px; }

.result-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.btn-secondary { flex-shrink: 0; border-width: 1px; font-weight: 400; padding: 7px 12px; font-size: 14px; }

/* ------------------------------------------------------------------ modals */

.modal-root { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: 16px; }
.modal-root.active { display: grid; }
.modal-root.closing { opacity: 0; transition: opacity 0.15s; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4); }

.modal {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 26px 28px;
  animation: modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; padding-right: 32px; }
.modal p { color: var(--ink-2); margin-bottom: 12px; max-width: 65ch; }
.modal ol { padding-left: 20px; margin-bottom: 14px; color: var(--ink-2); }
.modal li { margin-bottom: 7px; }
.modal-meta { font-size: 13px; margin-bottom: 0 !important; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  cursor: pointer;
}

.modal-close:hover { background: rgba(0, 0, 0, 0.07); }

.modal textarea { min-height: 200px; resize: vertical; font-size: 14px; line-height: 1.5; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-actions .btn { width: auto; margin: 0; }
.modal-actions .btn-quiet { border-color: transparent; }
.modal-actions .btn-quiet:hover:not(:disabled) { background: rgba(0, 0, 0, 0.07); color: var(--ink); }

/* Why is it here? */
.why-btn { display: block; margin-top: 10px; }
.modal .why-status { color: var(--muted); }
.why-axis { margin-top: 20px; }
.why-axis h3 { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; font-weight: 700; padding-bottom: 5px; border-bottom: 2px solid var(--ink); }
.modal .why-legend { font-size: 13.5px; color: var(--muted); }
.why-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.modal .why-pole { display: flex; align-items: center; gap: 7px; margin: 14px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.why-chip { width: 11px; height: 11px; border: 1.5px solid var(--ink); }
.why-chip.pos { background: var(--pos); }
.why-chip.neg { background: var(--neg); }
.modal .why-none { font-size: 13.5px; color: var(--muted); }
.why-lines { list-style: none; display: grid; gap: 10px; }
.modal .why-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 0; font-size: 14px; }
.why-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
/* A mini axis: centre mark in the middle, bar grows toward the pole */
.why-track { grid-column: 1 / -1; position: relative; height: 9px; background: var(--side); }
.why-track::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); }
.why-bar { position: absolute; top: 0; bottom: 0; border: 1px solid var(--ink); }
.why-bar.pos { left: 50%; background: var(--pos); }
.why-bar.neg { right: 50%; background: var(--neg); }

/* Stats, word list and phrases */
.site-stats { margin-top: 8px; font-size: 13px; color: var(--muted); }
.site-stats[hidden], .axis-link[hidden] { display: none; }
.axis-link { display: block; margin-top: 12px; }
.axis-link + .axis-link { margin-top: 8px; }
.modal .word-target { font-size: 13.5px; margin: 10px 0 8px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 300px; overflow-y: auto; }
.word-chip {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 4px 10px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.word-chip:hover { background: var(--ink); color: var(--paper); }
.phrase-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.phrase-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--side-line);
  background: var(--paper);
  padding: 5px 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.phrase-tab:hover { border-color: var(--ink-2); }
.phrase-tab[aria-selected="true"] { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--c); }
.modal .phrase-note { font-size: 13.5px; color: var(--muted); }
.phrase-list { list-style: none; padding: 0 !important; max-height: 340px; overflow-y: auto; border-top: 2px solid var(--ink); }
.modal .phrase-list li { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--side-line); font-size: 14px; }
.modal .phrase-list li.is-unused { color: var(--muted); }
.modal .phrase-list li.phrase-divider { padding-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); border-bottom: 2px solid var(--ink); }

/* Playlist import */
.import-link { display: block; margin-top: 12px; }
.modal .import-note { font-size: 13.5px; }
.import-status { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.import-status span:last-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-bar { background: var(--q-bl); transition: width 0.25s; }
.import-skipped { list-style: none; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--side-line); max-height: 180px; overflow-y: auto; font-size: 13.5px; color: var(--ink-2); }
.import-skipped[hidden] { display: none; }
.import-skipped li { padding: 2px 0; }
.import-skipped li span { color: var(--muted); }

/* Generation progress, drawn on the chart */
.build-progress {
  position: absolute;
  left: 6.47%; right: 6.47%; top: 6.03%; bottom: 6.03%;
  display: grid;
  place-items: center;
  padding: 16px;
}

.build-card {
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 20px 22px;
}

.build-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.build-note { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }

.progress-list { display: grid; gap: 10px; margin-top: 16px; }
.progress-divider { border: 0; border-top: 1px solid var(--side-line); margin: 4px 0; }

.progress-row { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 4px 10px; }

.progress-icon { width: 14px; height: 14px; border: 1.5px solid var(--field-line); }

.progress-row[data-state="loading"] .progress-icon { border: 2px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.progress-row[data-state="complete"] .progress-icon { border-color: var(--ink); background: var(--q-bl); }
.progress-row[data-state="error"] .progress-icon { border-color: var(--ink); background: var(--q-tl); }

.progress-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-status { font-size: 12.5px; color: var(--muted); }

.progress-track { grid-column: 2 / 4; height: 6px; border: 1px solid var(--ink); background: var(--paper); }
.progress-bar { height: 100%; width: 0; background: var(--ink); }

.progress-row[data-state="loading"] .progress-bar { width: 85%; transition: width 8s cubic-bezier(0.1, 0.6, 0.3, 1); background: var(--q-tr); }
.progress-row[data-state="complete"] .progress-bar { width: 100%; background: var(--q-bl); transition: width 0.25s; }
.progress-row[data-state="error"] .progress-bar { width: 100%; background: var(--q-tl); }

/* ------------------------------------------------------------------ toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1100;
  display: grid;
  gap: 8px;
  justify-items: center;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 9px 14px;
  font-size: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  animation: modal-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error { background: var(--danger); }
.toast.leaving { opacity: 0; transition: opacity 0.2s; }

/* ------------------------------------------------------------ achievements */

.ach-art { width: 48px; height: 48px; flex-shrink: 0; display: block; font-family: var(--font); }

.ach-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1150;
  display: grid;
  gap: 8px;
  width: 300px;
  max-width: calc(100vw - 32px);
}

.ach-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--r);
  cursor: pointer;
  animation: ach-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ach-toast.leaving { opacity: 0; transform: translateX(12px); transition: opacity 0.2s, transform 0.2s; }
@keyframes ach-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

.ach-toast-text { display: grid; gap: 1px; min-width: 0; }
.ach-toast-kicker { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); }
.ach-toast-name { font-size: 16px; font-weight: 700; }
.ach-toast-reward { font-size: 12.5px; color: var(--ink-2); }

.modal.modal-wide { max-width: 720px; }
.ach-head-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ach-sound { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.ach-sound input { accent-color: var(--ink); }
.ach-progress-track { height: 8px; background: var(--side); border: 1px solid var(--side-line); margin-bottom: 6px; }
.ach-progress-bar { height: 100%; background: var(--q-bl); }
.ach-group { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); margin: 20px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--ink); }
.ach-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.modal .ach-card { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px; border: 1px solid var(--side-line); background: var(--side); }
.ach-card.is-unlocked { background: var(--paper); border-color: var(--ink); }
.ach-card:not(.is-unlocked) .ach-art { filter: grayscale(1); opacity: 0.4; }
.ach-card-text { min-width: 0; display: grid; gap: 3px; justify-items: start; }
.modal .ach-card-name { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.ach-card:not(.is-unlocked) .ach-card-name { color: var(--ink-2); }
.ach-rarity { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 1px 6px; border: 1px solid var(--ink); background: var(--r); }
.ach-card:not(.is-unlocked) .ach-rarity { background: transparent; border-color: var(--field-line); color: var(--muted); }
.modal .ach-card-desc { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.ach-progress { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ach-reward { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); }
.ach-reward-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--ink); background: var(--c); }

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-template-areas: "head" "axes" "stage" "song" "list" "foot";
  }

  .stage { position: static; max-height: none; }
  .side { border-right: 0; padding: 18px 16px; }
  .side-head { padding-top: 20px; padding-bottom: 14px; }
  .side-axes { border-bottom: 1px solid var(--side-line); }
  .side-song { border-top: 1px solid var(--side-line); }

  .stage { padding: 20px 8px 24px; }
  .compass-wrap, .result { max-width: 640px; }
  .result { padding: 0 16px; flex-wrap: wrap; }

  .song-list { max-height: none; }
  .song-remove { color: var(--ink-2); }
}

@media (max-width: 420px) {
  .brand-name { font-size: 20px; }
  .result-actions { flex-direction: row; width: 100%; }
  .result .btn-secondary { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
