/* Kinda Critic v2: title page composition (kindacritic/ui_title.py).
 * Layout only. The components (backdrop, overview, badges, score cards) keep their own CSS;
 * this file places them: overview left and achievements right inside the header band on
 * desktop, stacked on a phone with the achievements scrolling sideways. Tokens only. */

.tp-title { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.1;
            letter-spacing: -.02em; }
.tp-meta { display: flex; flex-wrap: wrap; margin-top: 10px; color: var(--ink-2);
           font-size: 15px; line-height: 1.5; }
.tp-meta span + span::before { content: "\00b7"; margin: 0 .6em; color: var(--ink-muted); }

.tp-panels { margin-top: 22px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr);
             align-items: stretch; }
.tp-panels > * { min-width: 0; }
.tp-ranks { margin-top: 14px; }

/* The achievements panel matches the overview panel's surface. */
.tp-ach { background: color-mix(in srgb, var(--surface) 88%, transparent);
          border: 1px solid var(--hairline); border-radius: var(--r-lg);
          padding: 16px 16px 8px; }
.tp-ach-h { margin: 0 0 10px; font-size: var(--t-label); font-weight: 700;
            letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.tp-ach .badge-row { padding-bottom: 8px; gap: 6px; }
/* Inside the panel the badges lose their own card: the panel is the card. */
.tp-ach .badge--lg { flex: 1 0 112px; background: none; border: 0; padding: 4px 4px 8px; }
.tp-ach .badge--lg:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }

@media (min-width: 900px) {
  .tp-panels--ach { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  /* Score left with a compact histogram beside it, as in the target and the gpt-image-2.5
   * pass: a tall chart made the panel twice the height it needs. */
  .tp-panels--ach .ov-main { grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: end; }
  .tp-panels--ach .ov-chart { max-width: 300px; }
  /* One row of four compact medallions, the way the target shows them. */
  .tp-ach .badge-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px;
                       overflow: visible; }
  .tp-ach .badge--lg { flex: none; padding: 4px 2px 6px; }
  .tp-ach .badge-medal { width: 52px; height: 52px; }
  .tp-ach .badge-tier { margin-top: 8px; font-size: 10px; }
  .tp-ach .badge-title { font-size: 14px; }
  .tp-ach .badge-caption { font-size: 12px; }
}

.tp-h2 { margin: 0 0 14px; font-size: 24px; letter-spacing: -.01em; }
/* Whatever follows the band clears the poster that hangs 40px below it. */
.bd-header + * { margin-top: 60px; }

@media (max-width: 640px) {
  .tp-title { font-size: 28px; }
  .tp-meta { font-size: 14px; }
  .tp-ach { padding: 14px 0 6px 14px; }
  .tp-ach .badge-row { padding-right: 14px; scroll-snap-type: x mandatory; }
  .tp-ach .badge--lg { flex: 0 0 132px; }
  .tp-h2 { font-size: 20px; }
  .bd-header + * { margin-top: 28px; }
}
