/* Advanced Match Analysis — dossier layout.
   Surfaces come from the DS (plinth hero, bevel panels, band, chip, kicker);
   this sheet only lays out page content. Timeline chip geometry is computed by
   replay_analysis.js; the category outline palette lives here as tokens. */

.replay-analysis-page { background: #070b11; }
.analysis-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }

.analysis-shell {
  --analysis-title: #fff2d2;
  --analysis-ink: #fff6dd;
  --analysis-rule: rgba(213, 177, 101, .16);
  --analysis-rule-strong: rgba(213, 177, 101, .4);
  --analysis-well: rgba(6, 11, 21, .55);
  --analysis-tile: rgba(3, 8, 14, .46);
  --analysis-tile-border: rgba(255, 255, 255, .07);
  --analysis-label: .62rem;
  /* Timeline category outlines (locked palette). */
  --tl-unit: rgba(255, 255, 255, .14);
  --tl-unit-key: rgba(255, 255, 255, .3);
  --tl-hero: rgba(150, 190, 245, .75);
  --tl-myth: rgba(244, 178, 208, .75);
  --tl-building: rgba(236, 140, 128, .62);
  --tl-tech: rgba(240, 172, 100, .7);
  --tl-power: rgba(150, 226, 150, .8);
  --tl-major: #e8c46f;
  --phase-archaic-band: rgba(150, 104, 50, .15);
  --phase-classical-band: rgba(142, 149, 165, .12);
  --phase-heroic-band: rgba(205, 166, 62, .18);
  --phase-mythic-band: rgba(78, 74, 150, .18);
}

/* Shared micro-label used across dossiers, facts and sections. */
.analysis-hero-facts dt,
.analysis-dossier-label,
.analysis-moment-label span,
.analysis-match-clock span,
.analysis-hero-map figcaption span,
.analysis-win-probability-labels em {
  font-size: var(--text-micro);
  font-style: normal;
  font-weight: 800;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

/* ── Bevel panels ── */
.analysis-panel > .ps-surface-in,
.analysis-dossier > .ps-surface-in,
.analysis-chart-panel > .ps-surface-in { position: relative; z-index: 3; padding: 7px; }
.analysis-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; padding: 15px 19px 14px; }
.analysis-panel-head.is-ruled { padding-bottom: 16px; border-bottom: 1px solid rgba(213, 177, 101, .18); }
.analysis-panel-head h2,
.analysis-chart-head h2 { margin: 4px 0 0; color: var(--analysis-title); font-family: var(--font-title); font-size: clamp(1.4rem, 2vw, 1.8rem); font-weight: 400; letter-spacing: .04em; }
.analysis-panel-head > p { max-width: 52ch; margin: 0; color: var(--parchment-soft); font-size: .9rem; }
.analysis-player-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.analysis-player-columns > * { min-width: 0; padding: 16px 15px 20px; border-right: 1px solid rgba(213, 177, 101, .14); }
.analysis-player-columns > :last-child { border-right: 0; }
.analysis-player-columns h3 { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; color: var(--analysis-ink); font-family: var(--font-title); font-size: 1.05rem; font-weight: 400; }
.analysis-player-columns h3 i { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--player-accent); }
.analysis-player-columns h3 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-player-columns h4 { margin: 4px 0 0; color: #9ba6b4; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.analysis-dossier-empty { margin: 0; color: var(--parchment-soft); font-size: .82rem; }

/* ── Hero (plinth) ── */
.analysis-hero-body { display: grid; gap: 26px; }
.analysis-hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 24px 32px; }
.analysis-hero-copy { display: grid; flex: 1 1 380px; gap: 16px; min-width: 0; }
.analysis-hero-title { font-size: clamp(2.1rem, 3.6vw, 3.1rem); line-height: 1.02; overflow-wrap: anywhere; text-wrap: balance; }
.analysis-hero-facts { display: flex; flex-wrap: wrap; gap: 10px 0; margin: 0; }
.analysis-hero-facts > div { display: grid; gap: 2px; margin: 0 20px 0 0; padding: 0 20px 0 0; border-right: 1px solid rgba(213, 177, 101, .24); }
.analysis-hero-facts > div:last-child { border-right: 0; }
.analysis-hero-facts dt { color: var(--gold-300); }
.analysis-hero-facts dd { margin: 0; color: var(--parchment-100); font-size: 1rem; }
/* ── Action bar (above the hero) ──
   Layered frame echoing the hero: hairline dark outer ring, gold border, an
   inset gold keyline and a soft drop shadow. Corner/typeface/gradient follow
   site-action-link. Scoped to the bar so shared button rules are untouched. */
.analysis-action-bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 30px; margin-bottom: -2px; }
.analysis-action-group { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.analysis-action-bar [data-replay-share] { display: contents; }
.analysis-action-bar .share-confirmation { flex-basis: 100%; margin: 0; text-align: center; }
.ps-page .analysis-action-bar .analysis-action,
.ps-page .analysis-action-bar [data-share-open] {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 2.85rem; padding: 0 1.25rem;
  border: 1px solid rgba(226, 184, 94, .62); border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 231, 158, .1), rgba(0, 0, 0, .2)), rgba(8, 16, 30, .88);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 176, .18),
    inset 0 0 0 3px rgba(4, 9, 18, .55),
    inset 0 0 0 4px rgba(226, 184, 94, .2),
    0 0 0 1px rgba(5, 6, 12, .9),
    0 8px 16px -4px rgba(0, 0, 0, .7);
  color: #fff2c8; font-family: var(--font-title); font-size: .86rem; font-weight: 400; letter-spacing: .09em; line-height: 1;
  text-decoration: none; text-transform: uppercase; white-space: nowrap; cursor: pointer;
  transition: border-color 170ms ease, background 170ms ease, box-shadow 170ms ease, color 170ms ease;
}
.ps-page .analysis-action-bar .analysis-action:hover,
.ps-page .analysis-action-bar [data-share-open]:hover,
.ps-page .analysis-action-bar .analysis-action:focus-visible,
.ps-page .analysis-action-bar [data-share-open]:focus-visible {
  border-color: rgba(244, 204, 120, .95); color: #fff6dd; transform: none;
  background: linear-gradient(180deg, rgba(255, 231, 158, .18), rgba(0, 0, 0, .12)), rgba(14, 26, 46, .94);
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 176, .28),
    inset 0 0 0 3px rgba(4, 9, 18, .5),
    inset 0 0 0 4px rgba(244, 204, 120, .4),
    0 0 0 1px rgba(5, 6, 12, .9),
    0 8px 16px -4px rgba(0, 0, 0, .7);
}
.ps-page .analysis-action-bar .analysis-action:focus-visible,
.ps-page .analysis-action-bar [data-share-open]:focus-visible { outline: 2px solid var(--gold-300, #e8c46f); outline-offset: 3px; }
.analysis-action-bar .analysis-action:disabled { opacity: .55; cursor: not-allowed; }
.analysis-action-bar .analysis-action[hidden],
.analysis-action-bar [data-share-open][hidden] { display: none; }

/* Primary: same frame, filled gold. */
.ps-page .analysis-action-bar .analysis-action-primary {
  border-color: #8c5f1f; color: #29160a;
  background: linear-gradient(180deg, #f8da98, #d9a050 55%, #c28b3c);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 215, .75),
    inset 0 0 0 3px rgba(255, 240, 190, .16),
    inset 0 0 0 4px rgba(110, 66, 14, .35),
    0 0 0 1px rgba(5, 6, 12, .9),
    0 8px 16px -4px rgba(0, 0, 0, .7);
}
.ps-page .analysis-action-bar .analysis-action-primary:hover,
.ps-page .analysis-action-bar .analysis-action-primary:focus-visible {
  border-color: #fff0bc; color: #29160a;
  background: linear-gradient(180deg, #fde5ab, #e0aa58 55%, #cb9440);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 215, .85),
    inset 0 0 0 3px rgba(255, 240, 190, .24),
    inset 0 0 0 4px rgba(110, 66, 14, .4),
    0 0 0 1px rgba(5, 6, 12, .9),
    0 8px 16px -4px rgba(0, 0, 0, .7);
}
.analysis-action-glyph { width: 1.2rem; height: 1.2rem; flex: 0 0 auto; object-fit: contain; }

/* Back: the AoM arrow is a small leading glyph, not a framed tile. */
.analysis-action-icon { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; margin-left: -.15rem; background: url("../assets/images/ui/BackButton_Default.93f7f4076d9c.png") center / contain no-repeat; }
.analysis-action-back:hover .analysis-action-icon,
.analysis-action-back:focus-visible .analysis-action-icon { background-image: url("../assets/images/ui/BackButton_Hovered.52aceae9117f.png"); }

/* Share: plain gold share glyph (Icon_Share_Gold.png) after the label. */
.analysis-action-bar [data-share-open]::after {
  content: ""; width: 1.3rem; height: 1.3rem; flex: 0 0 auto;
  background: url("../assets/images/ui/Icon_Share_Gold.49afeadcf59c.png") center / contain no-repeat;
  background-image: image-set(
    url("../assets/optimized/images/ui/Icon_Share_Gold.cc1706aec8a0.webp") type("image/webp"),
    url("../assets/images/ui/Icon_Share_Gold.49afeadcf59c.png") type("image/png")
  );
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .55));
}
.analysis-action-bar [data-share-open]:hover::after,
.analysis-action-bar [data-share-open]:focus-visible::after { filter: brightness(1.15) drop-shadow(0 1px 1px rgba(0, 0, 0, .55)); }

@media (max-width: 560px) {
  .analysis-action-bar { gap: 10px 14px; }
  .analysis-action-group { gap: 8px; }
  .ps-page .analysis-action-bar .analysis-action,
  .ps-page .analysis-action-bar [data-share-open] { padding: 0 .8rem; gap: .45rem; font-size: .76rem; letter-spacing: .05em; }
}
.analysis-hero-map { flex: 1 1 400px; min-width: 260px; max-width: 460px; margin: 0; border: 3px solid var(--gold-500); border-radius: 4px; background: #05060c; box-shadow: 0 0 0 1px rgba(5, 6, 12, .9), 0 0 0 4px rgba(232, 196, 111, .28), 0 24px 48px -12px rgba(0, 0, 0, .8); }
.analysis-hero-map img,
.analysis-hero-map-fallback { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.analysis-hero-map img { filter: saturate(1.14) contrast(1.06) brightness(1.12); }
.analysis-hero-map-fallback { background: radial-gradient(circle at 35% 25%, rgba(190, 154, 73, .22), transparent 32%), linear-gradient(145deg, #16212c, #070c12); }
.analysis-hero-map figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 14px; border-top: 1px solid rgba(232, 196, 111, .45); background: rgba(10, 17, 32, .95); }
.analysis-hero-map figcaption span { color: var(--gold-300); }
.analysis-hero-map figcaption strong { color: var(--analysis-title); font-family: var(--font-title); font-size: 1.5rem; font-weight: 400; letter-spacing: .06em; text-align: right; }

.analysis-official-result-notice { display: flex; align-items: flex-start; gap: 9px; max-width: 46rem; padding: 9px 11px; border-left: 3px solid #d4a14b; background: rgba(108, 71, 28, .2); color: #dfd7c5; font-size: .79rem; line-height: 1.4; }
.analysis-official-result-notice img { width: 22px; height: 22px; flex: 0 0 auto; object-fit: contain; }
.analysis-official-result-notice strong,
.analysis-official-result-notice span { display: block; }
.analysis-official-result-notice strong { color: #f2d99c; }
.analysis-official-result-notice span { margin-top: 2px; color: #c8c1b0; }

.analysis-matchup { display: grid; gap: 14px; padding-top: 22px; border-top: 2px solid var(--analysis-rule-strong); }
.analysis-matchup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; align-items: center; }
.analysis-matchup-grid.is-two-sided { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.analysis-matchup-side { display: grid; gap: 10px; min-width: 0; }
.analysis-matchup-side.is-right { justify-items: end; text-align: right; }
.analysis-matchup-result { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--parchment-soft); font-size: var(--text-eyebrow); font-weight: 800; letter-spacing: var(--tracking-widest); text-transform: uppercase; }
.analysis-matchup-side.is-right .analysis-matchup-result { flex-direction: row-reverse; }
.analysis-matchup-side.is-winner .analysis-matchup-result { color: var(--status-win); }
.analysis-matchup-side.is-loser .analysis-matchup-result { color: var(--status-loss); }
.analysis-matchup-result img { width: 26px; height: 26px; object-fit: contain; }
.analysis-matchup-result small { color: var(--parchment-soft); font-size: .84rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.analysis-matchup-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
.analysis-matchup-side.is-right .analysis-matchup-player { flex-direction: row-reverse; }
.analysis-matchup-player img { width: 52px; height: 52px; flex: none; border: 2px solid var(--player-accent); border-radius: 50%; box-shadow: 0 0 0 1px rgba(232, 196, 111, .5), 0 4px 12px rgba(0, 0, 0, .5); object-fit: cover; }
.analysis-matchup-player > div { display: grid; gap: 1px; min-width: 0; }
.analysis-matchup-player strong { overflow: hidden; color: var(--analysis-ink); font-family: var(--font-title); font-size: 1.5rem; font-weight: 400; letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.analysis-matchup-player > div > span { color: var(--parchment-soft); font-size: .88rem; }
.analysis-shell em.is-up { color: var(--status-win); font-style: normal; }
.analysis-shell em.is-down { color: var(--status-loss); font-style: normal; }
/* Team sides stack several players, so each line steps down a size. */
.analysis-hero .analysis-matchup-side:has(.analysis-matchup-player + .analysis-matchup-player) .analysis-matchup-player strong { font-size: 1.15rem; }
.analysis-hero .analysis-matchup-side:has(.analysis-matchup-player + .analysis-matchup-player) .analysis-matchup-player img { width: 40px; height: 40px; }
.analysis-match-clock { display: grid; justify-items: center; gap: 2px; padding: 10px 22px; border: 1px solid var(--analysis-rule-strong); border-radius: 6px; background: rgba(6, 11, 21, .6); }
.analysis-match-clock strong { color: var(--gold-100); font-family: var(--font-title); font-size: 2rem; font-weight: 400; line-height: 1; }
.analysis-match-clock span { color: var(--parchment-soft); }
.analysis-win-probability { display: grid; gap: 6px; }
.analysis-win-probability-labels { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; color: var(--parchment-muted); font-size: .86rem; }
.analysis-win-probability-labels strong { color: var(--analysis-ink); }
.analysis-win-probability-labels em { color: var(--gold-300); }
.analysis-win-probability-bar { display: flex; height: 8px; overflow: hidden; border: 1px solid rgba(213, 177, 101, .35); border-radius: 999px; background: #05060c; }
.analysis-win-probability-bar span { opacity: .85; }
.analysis-win-probability-bar span:last-child { flex: 1; }
.analysis-win-probability-bar i { width: 2px; flex: none; background: #05060c; }

/* ── Key moments ── */
.analysis-moments-band { display: flex; align-items: baseline; gap: 12px; }
.analysis-moments-band span { margin-left: auto; color: var(--parchment-soft); font-size: .66rem; font-weight: 400; letter-spacing: .1em; }
.analysis-moments-track { position: relative; height: 22px; margin: 14px 22px 0; border-bottom: 1px solid rgba(213, 177, 101, .3); }
.analysis-moments-mark { position: absolute; bottom: -5px; width: 9px; height: 9px; background: var(--player-accent); box-shadow: 0 0 0 1px #05060c, 0 0 8px var(--player-accent); transform: translateX(-50%) rotate(45deg); }
.analysis-moments-start,
.analysis-moments-end { position: absolute; top: 0; color: var(--parchment-soft); font-size: .66rem; }
.analysis-moments-start { left: 0; }
.analysis-moments-end { right: 0; }
.analysis-moments-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.analysis-moments-grid article { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 16px 16px 18px; border-right: 1px solid rgba(213, 177, 101, .14); }
.analysis-moments-grid article:last-child { border-right: 0; }
.analysis-moment-label { display: flex; align-items: center; gap: 8px; }
.analysis-moment-label img { width: 30px; height: 30px; flex: none; border-radius: 3px; object-fit: contain; }
.analysis-moment-label span { color: var(--parchment-muted); line-height: 1.25; }
.analysis-moment-time { color: var(--gold-100); font-family: var(--font-title); font-size: 1.7rem; font-weight: 400; line-height: 1; }
.analysis-moment-player { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--analysis-ink); font-size: .86rem; }
.analysis-moment-player i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--player-accent); }
.analysis-moment-player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-moment-detail { color: var(--parchment-soft); font-size: .8rem; }

/* ── Player dossiers ── Six aligned rows via subgrid. */
.analysis-dossiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.analysis-dossier { display: grid; grid-row: span 5; grid-template-rows: subgrid; min-width: 0; box-shadow: inset 0 3px 0 var(--player-accent), 0 30px 70px -22px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(232, 196, 111, .5), inset 0 0 0 6px rgba(6, 11, 21, .55), inset 0 0 0 7px rgba(213, 177, 101, .28); }
.analysis-dossier > .ps-surface-in { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; gap: 0; }
.analysis-dossier-head { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px 13px 16px; border-bottom: 1px solid rgba(213, 177, 101, .2); background: linear-gradient(180deg, rgba(31, 50, 82, .6), rgba(16, 27, 46, .2)); box-shadow: inset 0 3px 0 var(--player-accent); }
.analysis-dossier-head > img { width: 56px; height: 56px; flex: none; border: 2px solid var(--player-accent); border-radius: 50%; box-shadow: 0 0 0 1px rgba(232, 196, 111, .5); object-fit: cover; }
.analysis-dossier-identity { display: grid; flex: 1; gap: 2px; min-width: 0; }
.analysis-dossier-identity h2 { overflow: hidden; margin: 0; font-family: var(--font-title); font-size: 1.35rem; font-weight: 400; letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.analysis-dossier-identity h2 > a,
.analysis-dossier-identity h2 > span { color: var(--analysis-ink); }
.analysis-dossier-identity > span { color: var(--parchment-soft); font-size: .86rem; }
.analysis-dossier-rating { display: grid; justify-items: end; gap: 4px; color: var(--analysis-ink); font-size: .9rem; white-space: nowrap; }
/* DS ResultPill (design-system/components/stats/ResultPill.jsx). */
.analysis-result-pill { display: inline-block; padding: .06rem .32rem; border: 1px solid color-mix(in srgb, var(--pill-color) 55%, transparent); border-radius: var(--radius-pill); background: color-mix(in srgb, var(--pill-color) 16%, transparent); color: var(--pill-color); font-size: .6rem; font-weight: 900; letter-spacing: .07em; line-height: 1.3; text-transform: uppercase; --pill-color: var(--parchment-soft); }
.analysis-result-pill.is-win { --pill-color: var(--status-win); }
.analysis-result-pill.is-loss { --pill-color: var(--status-loss); }
/* Post-game stats: every player-card stat, same rows for every player.
   The match leader in each stat gets the gold value and diamond. */
/* Fixed three columns keep the rows grouped: EAPM + favorite unit, then the
   score block, then counts. Narrow cards (team games, phones) use two. */
.analysis-dossier > .ps-surface-in { container-type: inline-size; }
.analysis-dossier-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; margin: 0; border-bottom: 1px solid var(--analysis-rule); }
.analysis-dossier-metrics > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 8px; row-gap: 2px; min-width: 0; padding: 11px 13px; border-bottom: 1px solid rgba(213, 177, 101, .08); }
.analysis-dossier-metrics dt,
.analysis-dossier-metrics dd,
.analysis-dossier-metrics small { grid-column: 1 / -1; }
.analysis-dossier-metrics dt { color: var(--parchment-soft); font-size: var(--analysis-label); font-weight: 800; letter-spacing: var(--tracking-wider); text-transform: uppercase; }
.analysis-dossier-metrics dd { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--analysis-ink); font-family: var(--font-title); font-size: 1.2rem; }
.analysis-dossier-metrics dd i { width: 6px; height: 6px; flex: none; background: var(--gold-300); transform: rotate(45deg); }
.analysis-dossier-metrics .is-leader dd { color: #ffe0a3; }
.analysis-dossier-metrics small { color: var(--parchment-soft); font-size: .76rem; }
/* Favorite unit: icon beside the label/name, spanning two columns when it can. */
.analysis-dossier-metrics .is-favorite { grid-column: span 2; }
.analysis-dossier-metrics .is-favorite img { grid-row: 1 / span 3; width: 40px; height: 40px; border: 1px solid rgba(213, 177, 101, .4); border-radius: 4px; background: rgba(20, 34, 58, .8); object-fit: contain; }
.analysis-dossier-metrics .is-favorite dt,
.analysis-dossier-metrics .is-favorite dd,
.analysis-dossier-metrics .is-favorite small { grid-column: 2; }
@container (max-width: 420px) {
  .analysis-dossier-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-dossier-metrics .is-favorite { grid-column: span 1; }
}
.analysis-dossier-section { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 14px 13px 16px; border-bottom: 1px solid var(--analysis-rule); }
.analysis-dossier-label { color: var(--gold-300); }
.analysis-age-row { display: grid; grid-template-columns: 24px 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.analysis-age-row.is-unreached { opacity: .45; }
.analysis-age-row-age { width: 24px; height: 24px; object-fit: contain; }
.analysis-age-row-god { width: 34px; height: 34px; border: 1px solid rgba(213, 177, 101, .4); border-radius: 4px; background: rgba(20, 34, 58, .8); object-fit: cover; }
.analysis-age-row > span { display: grid; min-width: 0; }
.analysis-age-row strong { color: var(--analysis-ink); font-size: .92rem; }
.analysis-age-row small { color: var(--parchment-soft); font-size: .76rem; }
.analysis-age-row time { color: var(--gold-100); font-family: var(--font-title); font-size: 1.05rem; }
.analysis-opening { display: grid; gap: 1px; }
.analysis-opening strong { color: var(--analysis-ink); font-size: .92rem; }
.analysis-opening span { color: var(--parchment-soft); font-size: .8rem; line-height: 1.4; }
.analysis-pattern { display: flex; justify-content: space-between; gap: 10px; padding-top: 6px; border-top: 1px solid rgba(213, 177, 101, .1); font-size: .84rem; }
.analysis-pattern span:first-child { color: var(--parchment-muted); }
.analysis-pattern span:last-child { color: var(--analysis-ink); text-align: right; }
.analysis-dossier-awards { display: flex; flex-wrap: wrap; align-content: start; gap: 6px; padding: 14px 13px 18px; }
.analysis-dossier-awards .analysis-award-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; color: var(--gold-100); font-size: .68rem; letter-spacing: .05em; }
.analysis-award-chip img { width: 20px; height: 20px; object-fit: contain; }

/* ── Timeline ── */
.analysis-timeline-filters .ps-chip { cursor: pointer; }
.analysis-timeline-filters .ps-chip[aria-pressed="true"] { border-color: var(--gold-400); background: linear-gradient(180deg, rgba(31, 50, 82, .95), rgba(14, 24, 42, .95)); color: var(--gold-100); }
.analysis-timeline-filters .ps-chip[aria-pressed="false"] { border-color: rgba(213, 177, 101, .3); background: transparent; color: var(--parchment-soft); }
.analysis-timeline-filters .ps-chip:focus-visible { outline: 2px solid rgba(226, 194, 116, .75); outline-offset: 2px; }
.analysis-timeline-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-height: 44px; margin: 0 19px 12px; padding: 6px 12px; border: 1px solid rgba(213, 177, 101, .24); border-radius: 6px; background: var(--analysis-well); }
.analysis-timeline-readout img { width: 30px; height: 30px; border-radius: 3px; object-fit: contain; }
.analysis-timeline-readout strong { color: var(--gold-100); font-family: var(--font-title); font-size: 1.15rem; font-weight: 400; }
.analysis-timeline-readout i { width: 8px; height: 8px; border-radius: 50%; background: var(--player-accent); }
.analysis-timeline-readout .is-player { color: var(--analysis-ink); font-size: .94rem; }
.analysis-timeline-readout .is-detail { color: var(--parchment-muted); font-size: .94rem; }
.analysis-timeline-readout-empty { color: var(--parchment-soft); font-size: .88rem; }
.analysis-timeline-stage { margin: 0 19px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(2, 6, 11, .42); }
.analysis-timeline-stage.is-vertical { overflow: hidden; }
.analysis-timeline-stage.is-horizontal { overflow-x: auto; }
.analysis-timeline-stage [tabindex]:focus-visible { outline: 2px solid rgba(226, 194, 116, .75); outline-offset: 1px; }
.analysis-timeline-empty { padding: 24px; color: var(--parchment-soft); text-align: center; }

.analysis-tl-chip { position: absolute; box-sizing: border-box; display: flex; align-items: center; gap: 7px; border: 1px solid var(--tl-outline, var(--tl-unit)); background: rgba(4, 9, 15, .9); box-shadow: 0 5px 12px rgba(0, 0, 0, .28); cursor: default; }
.analysis-tl-chip.is-unit { --tl-outline: var(--tl-unit); }
.analysis-tl-chip.is-hero { --tl-outline: var(--tl-hero); }
.analysis-tl-chip.is-myth { --tl-outline: var(--tl-myth); }
.analysis-tl-chip.is-building { --tl-outline: var(--tl-building); }
.analysis-tl-chip.is-tech { --tl-outline: var(--tl-tech); }
.analysis-tl-chip.is-power { --tl-outline: var(--tl-power); }
/* Queued but never recorded as researched: dashed outline (the player-colour
   accent edge stays solid). */
.analysis-tl-chip.is-prequeued { border-style: dashed; }
.analysis-tl-chip.is-major { --tl-outline: var(--tl-major); box-shadow: 0 0 0 1px rgba(232, 196, 111, .45), 0 0 14px 3px rgba(232, 196, 111, .26); }
.analysis-tl-chip.is-major img { filter: drop-shadow(0 0 6px rgba(255, 214, 120, .6)); }
.analysis-tl-chip.is-active { z-index: 8 !important; box-shadow: 0 0 0 2px #fff0bc, 0 0 14px rgba(232, 196, 111, .6); }
.analysis-tl-chip img { flex: none; object-fit: contain; }
.analysis-tl-chip-text { display: grid; gap: 2px; min-width: 0; }
.analysis-tl-chip-text { overflow: hidden; }
.analysis-tl-chip-text strong { color: #e4e8ed; font-size: .72rem; line-height: 1.05; }
.analysis-tl-chip.is-major .analysis-tl-chip-text strong { color: #ffe0a3; font-size: .86rem; }
.analysis-tl-chip-text small { overflow: hidden; color: #8e99a8; font-size: .64rem; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.analysis-tl-count { position: absolute; z-index: 1; padding: 1px 6px; border: 1px solid rgba(232, 196, 111, .7); border-radius: 999px; background: #1a2438; box-shadow: 0 2px 6px rgba(0, 0, 0, .6); color: #ffe0a3; font-size: .64rem; font-weight: 800; line-height: 1.3; }
.analysis-tl-layer { position: absolute; z-index: 2; box-sizing: border-box; border: 1px solid rgba(255, 255, 255, .2); background: linear-gradient(180deg, rgba(26, 36, 54, .96), rgba(10, 15, 24, .96)); box-shadow: 0 4px 10px rgba(0, 0, 0, .35); pointer-events: none; }
.analysis-tl-band { position: absolute; pointer-events: none; }
.analysis-tl-band.phase-archaic { background: var(--phase-archaic-band); }
.analysis-tl-band.phase-classical { background: var(--phase-classical-band); }
.analysis-tl-band.phase-heroic { background: var(--phase-heroic-band); }
.analysis-tl-band.phase-mythic { background: var(--phase-mythic-band); }
.analysis-tl-band-label { position: absolute; color: rgba(241, 228, 198, .55); font-size: .62rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.analysis-tl-age { position: absolute; z-index: 2; cursor: default; }
/* Minor-god plaque: the icon is deliberately larger than event icons. */
.analysis-tl-age-plaque { position: absolute; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.analysis-tl-age-plaque img { box-sizing: border-box; width: 40px; max-width: none; height: 40px; flex: none; border: 1px solid rgba(235, 220, 178, .8); border-radius: 4px; background: rgba(5, 10, 17, .96); box-shadow: 0 3px 8px rgba(0, 0, 0, .5); object-fit: contain; }
.analysis-tl-age-plaque > span { display: grid; gap: 1px; padding: 3px 8px; border: 1px solid rgba(222, 190, 112, .42); background: #080d14; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.analysis-tl-age-plaque strong { color: #f0dca8; font-size: .74rem; line-height: 1.15; }
.analysis-tl-age-plaque small { color: rgba(241, 228, 198, .6); font-size: .6rem; line-height: 1.15; }
.analysis-tl-age:hover .analysis-tl-age-plaque > span,
.analysis-tl-age:focus-visible .analysis-tl-age-plaque > span { border-color: rgba(240, 217, 153, .8); }

/* Hover/focus bubble: black well, gold text. Fixed and above page chrome and
   the Agora dock (9000), below menus and overlays (9010+), so it can extend
   past its lane or board without being clipped. */
.analysis-tl-bubble { position: fixed; z-index: 9005; padding: 2px 6px; border: 1px solid rgba(222, 190, 112, .42); background: #080d14; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); color: #f0dca8; font-size: .62rem; line-height: 1.2; white-space: nowrap; pointer-events: none; }
.analysis-tl-bubble[hidden] { display: none; }
.analysis-tl-chip:hover,
.analysis-tl-chip:focus-visible { z-index: 9 !important; }
.analysis-tl-rug { position: absolute; background: var(--player-accent); opacity: .85; pointer-events: none; }

/* 1v1: vertical lanes around a 68px clock. */
.analysis-vt-head,
.analysis-vt-body { display: grid; grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr); }
.analysis-vt-head { position: relative; z-index: 6; min-height: 58px; border-bottom: 1px solid rgba(255, 255, 255, .09); background: #0b121b; box-shadow: 0 4px 12px rgba(0, 0, 0, .28); }
.analysis-vt-player { display: flex; justify-content: flex-end; align-items: center; gap: 10px; min-width: 0; padding: 9px 14px; border-top: 3px solid var(--player-accent); background: color-mix(in srgb, var(--player-accent) 8%, #0b121b); text-align: right; }
.analysis-vt-player.is-right { flex-direction: row-reverse; text-align: left; }
.analysis-vt-player img { width: 36px; height: 36px; flex: none; border: 2px solid var(--player-accent); border-radius: 50%; object-fit: cover; }
.analysis-vt-player > span { display: grid; gap: 2px; min-width: 0; }
.analysis-vt-player strong { overflow: hidden; color: #eee3c7; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.analysis-vt-player small { color: #8a96a7; font-size: .72rem; }
.analysis-shell .is-result-win { color: var(--status-win); }
.analysis-shell .is-result-loss { color: var(--status-loss); }
.analysis-vt-clock-head { display: grid; place-items: center; padding: 8px 3px; border-inline: 1px solid rgba(255, 255, 255, .08); color: #8996a7; font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.analysis-vt-lane { position: relative; min-width: 0; overflow: hidden; }
.analysis-vt-grid { position: absolute; inset: 0; background-image: linear-gradient(180deg, rgba(255, 255, 255, .045) 1px, transparent 1px); pointer-events: none; }
.analysis-vt-lane .analysis-tl-band { right: 0; left: 0; }
.analysis-vt-lane .analysis-tl-band-label { writing-mode: vertical-rl; }
.analysis-vt-lane .analysis-tl-age { right: 0; left: 0; height: 4px; margin-top: -2px; background: linear-gradient(90deg, #b67a2c, #f0d999 50%, #b67a2c); box-shadow: 0 1px 0 rgba(0, 0, 0, .8), 0 -1px 0 rgba(0, 0, 0, .6); }
.analysis-vt-lane .analysis-tl-age-plaque { top: 50%; transform: translateY(-50%); }
.analysis-vt-lane.is-left .analysis-tl-age-plaque { left: 4px; }
.analysis-vt-lane.is-right .analysis-tl-age-plaque { right: 4px; flex-direction: row-reverse; text-align: right; }
.analysis-vt-lane .analysis-tl-rug { width: 9px; height: 2px; margin-top: -1px; }
.analysis-vt-lane .analysis-tl-chip { transform: translateY(-50%); }
.analysis-vt-axis { position: relative; z-index: 4; border-inline: 1px solid rgba(255, 255, 255, .08); background: rgba(7, 12, 19, .94); }
.analysis-vt-axis::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(224, 203, 147, .28); }
.analysis-vt-tick { position: absolute; right: 0; left: 0; height: 1px; background: rgba(224, 203, 147, .28); }
.analysis-vt-tick time { position: absolute; top: 0; left: 50%; padding: 3px 5px; border: 1px solid rgba(224, 203, 147, .2); background: #0a111a; color: #aeb6c2; font-size: .66rem; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; transform: translate(-50%, -50%); }

/* Team games: horizontal scrolling board, equal-height rows. */
.analysis-ht-board { min-width: 100%; }
.analysis-ht-head { position: relative; z-index: 6; display: flex; background: #0b121b; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.analysis-ht-player-col { position: sticky; left: 0; z-index: 7; flex: 0 0 148px; box-sizing: border-box; padding: 11px 12px; border-right: 1px solid rgba(255, 255, 255, .08); background: #0b121b; color: #8190a1; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.analysis-ht-ruler { position: relative; flex: none; height: 34px; }
.analysis-ht-tick { position: absolute; top: 0; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); }
.analysis-ht-tick::before { content: ""; width: 1px; height: 7px; background: rgba(223, 205, 157, .38); }
.analysis-ht-tick time { margin-top: 6px; color: #8d99a9; font-size: .66rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analysis-ht-row { display: flex; border-top: 3px solid var(--analysis-rule-strong); box-shadow: inset 0 1px 0 rgba(0, 0, 0, .7); }
.analysis-ht-player { position: sticky; left: 0; z-index: 5; display: flex; flex: 0 0 148px; flex-direction: column; justify-content: center; gap: 3px; box-sizing: border-box; min-width: 0; padding: 10px 12px; border-right: 1px solid rgba(255, 255, 255, .08); border-left: 3px solid var(--player-accent); background: #0c1320; }
.analysis-ht-player img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.analysis-ht-player strong { overflow: hidden; color: #eee3c7; font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.analysis-ht-player small { color: #8a96a7; font-size: .68rem; }
.analysis-ht-track { position: relative; flex: none; overflow: hidden; }
.analysis-ht-grid { position: absolute; inset: 0; background-image: linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px); pointer-events: none; }
.analysis-ht-track .analysis-tl-band { top: 0; bottom: 0; }
.analysis-ht-track .analysis-tl-band-label { bottom: 7px; }
.analysis-ht-track .analysis-tl-age { top: 0; bottom: 0; width: 4px; margin-left: -2px; background: linear-gradient(180deg, #f0d999, #b67a2c); box-shadow: 1px 0 0 rgba(0, 0, 0, .8), -1px 0 0 rgba(0, 0, 0, .6); }
/* Centre the 38px icon on the 4px rule (rule centre = 2px). */
.analysis-ht-track .analysis-tl-age-plaque { top: 4px; left: -17px; }
.analysis-ht-track .analysis-tl-age-plaque img { width: 38px; height: 38px; }
.analysis-ht-track .analysis-tl-rug { bottom: 0; width: 2px; height: 7px; margin-left: -1px; }
.analysis-ht-track .analysis-tl-chip { justify-content: center; transform: translate(-50%, -50%); }
.analysis-ht-track .analysis-tl-count { right: -7px; bottom: -7px; min-width: 14px; padding: 0 3px; font-size: .56rem; line-height: 1.35; text-align: center; }

.analysis-timeline-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 12px 19px 0; padding: 10px 14px; border: 1px solid rgba(213, 177, 101, .2); background: var(--analysis-well); }
.analysis-timeline-key > span { display: flex; align-items: center; gap: 7px; color: var(--parchment-muted); font-size: .8rem; }
.analysis-timeline-key > .analysis-timeline-key-title { color: var(--gold-300); font-size: var(--analysis-label); font-weight: 800; letter-spacing: var(--tracking-wider); text-transform: uppercase; }
.analysis-key-swatch { width: 16px; height: 16px; box-sizing: border-box; border: 2px solid var(--swatch); background: rgba(4, 9, 15, .9); }
.analysis-key-swatch.is-major { --swatch: #e8c46f; background: rgba(70, 52, 22, .97); box-shadow: 0 0 8px rgba(232, 196, 111, .45); }
.analysis-key-swatch.is-unit { --swatch: var(--tl-unit-key); }
.analysis-key-swatch.is-hero { --swatch: rgba(150, 190, 245, .9); }
.analysis-key-swatch.is-myth { --swatch: rgba(244, 178, 208, .9); }
.analysis-key-swatch.is-building { --swatch: rgba(236, 140, 128, .85); }
.analysis-key-swatch.is-tech { --swatch: rgba(240, 172, 100, .9); }
.analysis-key-swatch.is-power { --swatch: rgba(150, 226, 150, .9); }
.analysis-key-swatch.is-prequeued { --swatch: rgba(240, 172, 100, .9); border-style: dashed; }
.analysis-key-batch { position: relative; width: 20px; height: 18px; }
.analysis-key-batch b { position: absolute; width: 14px; height: 14px; box-sizing: border-box; }
.analysis-key-batch b:first-child { top: 0; right: 0; border: 1px solid rgba(255, 255, 255, .25); background: #1a2438; opacity: .6; }
.analysis-key-batch b:last-child { bottom: 0; left: 0; border: 1px solid rgba(255, 255, 255, .35); background: rgba(4, 9, 15, .95); }
.analysis-key-age { width: 4px; height: 16px; background: linear-gradient(180deg, #f0d999, #b67a2c); }
.analysis-footnote { margin: 0; padding: 12px 19px 13px; color: var(--parchment-soft); font-size: .8rem; line-height: 1.5; }

/* ── Match flow ── */
.analysis-chart-stage { display: grid; grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr); align-items: start; gap: 18px; }
.analysis-chart-panel { position: relative; min-width: 0; }
.analysis-chart-panel.is-primary { grid-column: 1; grid-row: 1; }
.analysis-chart-panel.is-sidebar { grid-column: 2; grid-row: 1; cursor: pointer; }
.analysis-chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 18px; padding: 13px 15px 12px; }
.analysis-chart-head small { max-width: 46ch; color: var(--parchment-soft); font-size: .84rem; line-height: 1.45; }
.analysis-chart-panel.is-primary .analysis-chart-head h2 { font-size: 1.45rem; }
.analysis-chart-panel.is-sidebar .analysis-chart-head { padding: 7px 9px 8px; }
.analysis-chart-panel.is-sidebar .analysis-chart-head h2 { font-size: 1.05rem; }
.analysis-chart-panel.is-sidebar .analysis-chart-head small,
.analysis-chart-panel.is-sidebar .analysis-chart-legend { display: none; }
.analysis-chart-interactive { position: relative; min-width: 0; margin: 0 9px 9px; }
.analysis-chart-panel.is-sidebar .analysis-chart-interactive { margin: 0 5px 5px; }
.analysis-chart { display: block; width: 100%; outline: none; cursor: crosshair; }
.analysis-chart-panel.is-primary .analysis-chart { height: 410px; }
.analysis-chart-panel.is-sidebar .analysis-chart { height: 150px; pointer-events: none; }
.analysis-chart:focus-visible { box-shadow: 0 0 0 2px rgba(225, 192, 111, .5); }
.analysis-chart-select { position: absolute; z-index: 5; inset: 0; display: block; width: 100%; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.analysis-chart-panel.is-primary .analysis-chart-select { display: none; }
.analysis-chart-panel.is-sidebar .analysis-chart-select:hover,
.analysis-chart-panel.is-sidebar .analysis-chart-select:focus-visible { outline: none; box-shadow: inset 0 0 0 1px rgba(235, 199, 119, .7), 0 0 24px rgba(225, 173, 76, .18); }
.analysis-chart-legend { display: flex; flex-wrap: wrap; gap: 6px; min-height: 35px; margin-bottom: 8px; }
.analysis-chart-legend button { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 10px; border: 1px solid rgba(255, 255, 255, .12); border-bottom: 2px solid var(--series-color, #d6b65c); background: rgba(5, 10, 17, .72); color: #d8dde4; font-family: var(--font-body); font-size: .86rem; cursor: pointer; }
.analysis-chart-legend button:hover,
.analysis-chart-legend button:focus-visible { border-color: rgba(227, 197, 123, .55); outline: none; }
.analysis-chart-legend button[aria-pressed="false"] { opacity: .42; }
.analysis-chart-legend img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.analysis-chart-legend span { overflow: hidden; max-width: 150px; text-overflow: ellipsis; white-space: nowrap; }
.analysis-chart-power-key { display: flex; align-items: center; gap: 7px; padding: 6px; color: #9ba6b5; font-size: .78rem; }
.analysis-chart-power-key i { width: 8px; height: 8px; background: #e1c26d; transform: rotate(45deg); }
.analysis-chart-tooltip { position: fixed; z-index: 9005; min-width: 180px; padding: 8px 10px; border: 1px solid rgba(222, 190, 112, .42); background: #080d14; box-shadow: var(--shadow-menu, 0 8px 24px rgba(0, 0, 0, .42)); color: var(--parchment-muted); pointer-events: none; }
.analysis-chart-tooltip[hidden] { display: none; }
.analysis-chart-tooltip > strong { display: block; margin-bottom: 5px; color: var(--gold-300); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
.analysis-chart-tooltip span { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 6px; margin-top: 4px; font-size: .84rem; }
.analysis-chart-tooltip i { width: 8px; height: 8px; border-radius: 50%; background: var(--series-color); }
.analysis-chart-tooltip b { color: var(--analysis-ink); font-weight: 700; }
.analysis-chart-tooltip span.is-power { grid-template-columns: 8px 22px minmax(0, 1fr); padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, .08); color: #c3cbd4; font-size: .78rem; }
.analysis-chart-tooltip .is-power img { width: 22px; height: 22px; object-fit: contain; }
.analysis-chart-tooltip .is-power em { font-style: normal; }
.analysis-chart-tooltip { max-width: min(290px, calc(100vw - 16px)); }
.analysis-chart-tooltip span.is-more { display: block; padding-top: 5px; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--parchment-soft); font-size: .74rem; }

/* ── Market ── */
.analysis-market > summary { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 9px 13px; list-style: none; cursor: pointer; }
.analysis-market > summary::-webkit-details-marker { display: none; }
.analysis-market > summary > span:first-child { display: grid; gap: 3px; }
.analysis-market > summary strong { color: var(--analysis-title); font-family: var(--font-title); font-size: clamp(1.4rem, 2vw, 1.8rem); font-weight: 400; letter-spacing: .04em; }
.analysis-market-summary { display: flex; align-items: center; gap: 10px; color: #aab4c1; font-size: .92rem; }
.analysis-market-summary i { color: var(--gold-300); font-size: 1.2rem; font-style: normal; transition: transform .15s ease; }
.analysis-market[open] .analysis-market-summary i { transform: rotate(90deg); }
.analysis-market > summary:focus-visible { outline: 2px solid rgba(226, 194, 116, .75); outline-offset: -2px; }
.analysis-market > .analysis-player-columns { border-top: 1px solid rgba(213, 177, 101, .18); }
.analysis-market-player { display: grid; align-content: start; gap: 12px; }
.analysis-market-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.analysis-market-columns section { display: grid; align-content: start; gap: 6px; min-width: 0; }
.analysis-market-columns h4 { margin: 0; }
.analysis-market-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 4px 8px 4px 4px; border: 1px solid var(--analysis-tile-border); background: var(--analysis-tile); }
.analysis-market-row img { width: 36px; height: 36px; object-fit: contain; }
.analysis-market-row span { color: #c3cbd4; font-size: .8rem; }
.analysis-market-row strong { color: #eddaa3; font-size: .84rem; }
.analysis-market-total { display: flex; justify-content: space-between; gap: 10px; padding-top: 9px; border-top: 1px solid rgba(213, 177, 101, .14); color: var(--parchment-muted); font-size: .86rem; }
.analysis-market-total strong { color: var(--analysis-ink); }
.analysis-market-empty { margin: 0; padding: 16px 13px 13px; border-top: 1px solid rgba(213, 177, 101, .18); color: var(--parchment-soft); font-size: .9rem; }

/* ── Composition ── */
.analysis-composition-player { display: grid; align-content: start; gap: 10px; }
.analysis-composition-player-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.analysis-composition-player-head > span { flex: none; color: var(--gold-300); font-size: var(--text-micro); font-weight: 800; letter-spacing: var(--tracking-wider); text-transform: uppercase; }
/* Tiles are flex items so a tile never narrows below its longest word:
   names wrap only at spaces ("Throwing / Axeman"), and a long single word
   (Cheiroballista, Tlacanexquimilli) widens its tile instead of splitting. */
.analysis-entity-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.analysis-entity-grid > div { display: grid; flex: 1 1 124px; grid-template-columns: 26px 1fr auto; align-items: center; gap: 6px; max-width: 100%; min-height: 34px; padding: 5px 6px; border: 1px solid var(--analysis-tile-border); background: var(--analysis-tile); }
.analysis-entity-grid img { width: 24px; height: 24px; object-fit: contain; }
.analysis-entity-grid span { color: #c3cbd4; font-size: .74rem; line-height: 1.12; hyphens: manual; }
.analysis-entity-grid strong { color: #eddaa3; font-size: .84rem; }
.analysis-entity-grid > p { flex: 1 1 100%; }
.analysis-composition-group { border-top: 1px solid var(--analysis-rule); }
.analysis-composition-group > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; color: var(--gold-100); font-size: .8rem; font-weight: 800; letter-spacing: var(--tracking-wide); list-style: none; text-transform: uppercase; cursor: pointer; }
.analysis-composition-group > summary::-webkit-details-marker { display: none; }
.analysis-composition-group > summary i { display: inline-block; font-style: normal; transition: transform .15s ease; }
.analysis-composition-group[open] > summary i { transform: rotate(90deg); }
.analysis-composition-group > summary > span:last-child { color: var(--parchment-soft); font-weight: 400; letter-spacing: 0; text-transform: none; }
.analysis-composition-group > .analysis-entity-grid { padding: 2px 0 10px; }
.analysis-composition-player { scroll-margin-top: 76px; }

/* ── Status surfaces kept from the previous layout ── */
.analysis-freshness-notice { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(280px, 1.5fr); align-items: center; gap: 24px; padding: 22px 26px; border-left: 4px solid #d4a14b; background: linear-gradient(110deg, rgba(99, 61, 24, .42), rgba(20, 28, 38, .92)); }
.analysis-freshness-notice h2 { margin: 3px 0 0; color: #f0dfb7; font-size: 1.15rem; }
.analysis-freshness-notice p:last-child { margin: 0; color: #c8c1b0; line-height: 1.6; }
.analysis-empty-state { padding: 52px 24px; text-align: center; }
.analysis-empty-state img { width: 100px; opacity: .65; }
.analysis-empty-state h2 { color: #eee1bd; }
.analysis-empty-state p,
.analysis-empty-state span { color: #9ba5b3; }

@media (prefers-reduced-motion: reduce) {
  .analysis-market-summary i,
  .analysis-composition-group > summary i { transition: none; }
}

@media (max-width: 1050px) {
  .analysis-chart-stage { grid-template-columns: minmax(0, 1fr) 230px; }
  .analysis-chart-panel.is-primary .analysis-chart { height: 340px; }
}

@media (max-width: 780px) {
  .analysis-matchup-grid.is-two-sided { grid-template-columns: minmax(0, 1fr); }
  .analysis-matchup-grid.is-two-sided .analysis-match-clock { grid-row: 1; justify-self: center; }
  .analysis-matchup-side.is-right { justify-items: start; text-align: left; }
  .analysis-matchup-side.is-right .analysis-matchup-result,
  .analysis-matchup-side.is-right .analysis-matchup-player { flex-direction: row; }
  .analysis-chart-stage { grid-template-columns: minmax(0, 1fr); }
  .analysis-chart-panel.is-primary,
  .analysis-chart-panel.is-sidebar { grid-column: 1; }
  .analysis-chart-panel.is-sidebar { grid-row: 2; }
  .analysis-chart-panel.is-primary .analysis-chart { height: 300px; }
  .analysis-panel-head { flex-direction: column; align-items: flex-start; }
  .analysis-vt-head,
  .analysis-vt-body { grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr); }
  .analysis-ht-player-col,
  .analysis-ht-player { flex-basis: 110px; }
  .analysis-freshness-notice { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 520px) {
  .analysis-hero-facts > div { margin-right: 14px; padding-right: 14px; }
  .analysis-hero-map { min-width: 0; }
  .analysis-matchup-player strong { font-size: 1.2rem; }
  .analysis-match-clock strong { font-size: 1.6rem; }
  .analysis-timeline-readout,
  .analysis-timeline-stage,
  .analysis-timeline-key { margin-inline: 8px; }
  .analysis-footnote { padding-inline: 8px; }
  .analysis-vt-head,
  .analysis-vt-body { grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr); }
  .analysis-vt-player { gap: 6px; padding: 7px 6px; }
  .analysis-vt-player img { width: 26px; height: 26px; }
  .analysis-vt-player small { display: none; }
  .analysis-vt-clock-head { font-size: .52rem; letter-spacing: .03em; }
  .analysis-vt-tick time { padding-inline: 3px; font-size: .58rem; }
  .analysis-ht-player-col,
  .analysis-ht-player { flex-basis: 90px; }
  .analysis-ht-player img { display: none; }
  .analysis-tl-age-plaque { gap: 4px; }
  .analysis-vt-lane .analysis-tl-age-plaque img { width: 32px; height: 32px; }
  .analysis-tl-age-plaque > span { padding: 2px 5px; }
  .analysis-tl-age-plaque strong { font-size: .66rem; }
  .analysis-market-columns { grid-template-columns: 1fr; }
}
