/* COMP Score Generator — page styles.
   Extends styles.css tokens; interaction feel matches the quiz page. */

.score-page main { padding: 40px 16px 0; }

/* display:flex etc. below would otherwise beat the UA's [hidden] rule */
.score-page [hidden] { display: none !important; }

.score-page .btn-primary:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.score-shell {
  max-width: 640px;
  margin: 0 auto 80px;
  background: rgba(22, 27, 34, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  text-align: center;
  backdrop-filter: blur(6px);
}
@media (max-width: 640px) { .score-shell { padding: 30px 18px; } }

.score-shell h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 44px);
  margin: 0 0 10px;
}
.score-sub { color: var(--fg-muted); font-size: 15px; margin: 0 0 28px; }

.score-screen[hidden] { display: none; }

/* ---- flow progress tabs (iOS parity) ---- */
.score-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 4px 0 30px;
}
.score-tab {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-faint);
  padding-bottom: 10px;
  border-bottom: 3px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.score-tab.is-active { color: var(--fg); border-bottom-color: var(--comp-ring); }
.score-tab.is-done { color: var(--fg-muted); border-bottom-color: var(--comp); }
.score-tab.is-clickable { cursor: pointer; }
.score-tab.is-clickable:hover { color: var(--fg); }
@media (max-width: 480px) { .score-tab { font-size: 11px; } }

/* ---- search ---- */
.score-search-row { display: flex; gap: 10px; margin-bottom: 18px; }
.score-search-row input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--fg);
  font-size: 16px;
  padding: 13px 16px;
}
.score-search-row input::placeholder { color: var(--fg-faint); }
.score-search-row input:focus { outline: none; border-color: var(--comp-ring); }

.score-results { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.score-result {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  width: 100%;
}
.score-result:hover, .score-result:focus-visible { border-color: var(--comp-ring); background: var(--comp-wash); outline: none; }
.score-result img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--bg); }
.score-result .r-title { font-weight: 600; display: block; }
.score-result .r-artist { color: var(--fg-muted); font-size: 13.5px; display: block; }
.score-status { color: var(--fg-faint); font-size: 14px; min-height: 20px; }

/* ---- selected album mini header ---- */
.score-album-mini { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 24px; }
.score-album-mini img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.score-album-mini .m-title { font-family: var(--font-display); font-weight: 700; font-style: italic; }
.score-album-mini .m-artist { color: var(--fg-muted); font-size: 14px; }

/* ---- score type ---- */
.score-types { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.score-type-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 18px;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  width: 100%;
}
.score-type-btn:hover { border-color: var(--comp-ring); }
.score-type-btn.is-selected { border-color: var(--comp-ring); background: var(--comp-wash); }
/* fixed box: the badge PNGs have different aspect ratios (hexagon vs
   banner), a uniform box keeps the three labels left-aligned */
.score-type-btn img { flex-shrink: 0; width: 64px; height: 62px; object-fit: contain; }
.score-type-btn .t-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; display: block; }
.score-type-btn .t-sub { color: var(--fg-muted); font-size: 13.5px; display: block; }

/* ---- track rating ---- */
.score-track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 20px 22px;
  margin-bottom: 20px;
}
.score-track-title { font-family: var(--font-display); font-weight: 700; font-size: 21px; margin: 0 0 2px; }
.score-track-artist { color: var(--fg-muted); font-size: 14px; margin: 0 0 14px; }

.score-preview-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.btn-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--comp);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 9px 18px;
  font: 600 14px var(--font-sans);
  cursor: pointer;
}
.btn-preview:hover { box-shadow: 0 0 22px rgba(124, 58, 237, 0.35); }
.btn-preview.is-ghost { background: transparent; border: 1px solid var(--border); color: var(--fg-muted); }
.btn-preview.is-ghost:hover { border-color: var(--comp-ring); color: var(--fg); box-shadow: none; }

.score-faces { display: flex; justify-content: center; gap: clamp(4px, 2vw, 18px); }
.score-face {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--fg-muted);
  font-size: 11.5px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 84px;
}
.face-chip {
  /* official glyphs carry a heavier stroke than the old inline SVGs;
     rendering smaller keeps the outline weight of the previous faces */
  display: block;
  position: relative;
  width: 100%;
  max-width: 44px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto;
  transition: transform 0.12s ease;
}
/* iOS look from one flat white asset: ::before = whole glyph tinted the
   rating color (visible as the ring), ::after = the same glyph in white,
   clipped to the interior circle (eyes + mouth) so it paints over the
   colored features but not the ring. */
.face-chip::before,
.face-chip::after {
  content: '';
  position: absolute;
  inset: 0;
  -webkit-mask-image: var(--face-url);
  mask-image: var(--face-url);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.face-chip::before { background-color: var(--face-color); }
/* clip well inside the ring's inner edge — at 41% the white layer's
   antialiased ring pixels peeked through as a faint white outline */
.face-chip::after { background-color: #fff; clip-path: circle(37%); }
/* selected: the face fills solid with its color, white features stay —
   no white ring (the full glyph layer is hidden so its ring can't show) */
.face-chip.is-filled { background-color: var(--face-color); }
.face-chip.is-filled::before { display: none; }
.score-face:hover .face-chip { transform: scale(1.1); }
.score-face.is-selected { color: var(--fg); }
@media (max-width: 520px) {
  .score-face { font-size: 9.5px; }
}

.score-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 22px; }
.score-stepper .step-label { font-family: var(--font-display); font-weight: 700; font-size: 15px; min-width: 130px; }
.btn-step {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #000;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-step:disabled { opacity: 0.25; cursor: default; }

.score-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; max-width: 340px; margin: 16px auto 0; }
.score-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--border);
  cursor: pointer;
}
.score-dot.is-rated { background: var(--comp); }
.score-dot.is-current { box-shadow: 0 0 0 2px var(--comp-ring); }

/* ---- favorites ---- */
.score-fav-list { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-bottom: 8px; max-height: 380px; overflow-y: auto; }
.score-fav {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 16px;
  color: var(--fg);
  cursor: pointer;
  font: inherit;
  width: 100%;
}
.score-fav:hover { border-color: var(--comp-ring); }
.score-fav.is-favorite { border-color: #F4C01E88; background: rgba(244, 192, 30, 0.07); }
.score-fav .f-star { color: var(--fg-faint); font-size: 18px; width: 22px; flex-shrink: 0; }
.score-fav.is-favorite .f-star { color: #F4C01E; }
.score-fav .f-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.score-fav-count { color: var(--fg-faint); font-size: 13px; margin-bottom: 20px; }

/* ---- capture form ---- */
.score-capture { display: flex; flex-direction: column; gap: 12px; max-width: 380px; margin: 0 auto; }
.score-capture input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--fg);
  font-size: 16px;
  padding: 13px 16px;
}
.score-capture input::placeholder { color: var(--fg-faint); }
.score-capture input:focus { outline: none; border-color: var(--comp-ring); }
.score-error { color: var(--raspberry); font-size: 13.5px; min-height: 18px; }

/* ---- card reveal ---- */
.score-card-wrap { margin: 6px 0 20px; }
.score-card-wrap img { max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--border); }
.score-card-wrap img.is-story { max-height: 70vh; width: auto; }
.score-format-toggle { display: inline-flex; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 4px; margin-bottom: 18px; }
.score-format-toggle button {
  border: none; background: none;
  color: var(--fg-muted);
  font: 600 13.5px var(--font-sans);
  padding: 7px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
}
.score-format-toggle button.is-active { background: var(--comp); color: #fff; }
.score-card-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.score-actions { display: flex; justify-content: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: var(--r-pill);
  padding: 12px 24px;
  font: 600 14.5px var(--font-sans);
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--comp-ring); color: var(--fg); }

/* iOS-parity back arrow, bottom-left of each step */
.score-back-row { display: flex; justify-content: flex-start; margin-top: 26px; }

.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
