/* Post-launch UI polish (2026-09). Keep this layer scoped to approved visual refinements. */

:root {
  --ink-soft: #42554b;
}

body {
  /* Prefer BIZ UDPGothic for dense Japanese data views; keep native fallbacks. */
  font-family: "BIZ UDPGothic", "Hiragino Sans", Meiryo, "Yu Gothic UI", "Yu Gothic", sans-serif;
  line-height: 1.5;
}

/* Give stacked title/subtitle pairs a little more breathing room. */
.brand strong {
  line-height: 1.2;
}

.brand small {
  margin-top: 2px;
  line-height: 1.3;
}

.page-title p,
.top-summary-copy > p:last-child {
  line-height: 1.5;
}

/* Shared return path: explicit on-page navigation in addition to the clickable brand. */
.page-home-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin: 2px 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.page-home-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* TOP: keep the shallow-photo concept, but reveal more of the horse. */
.top-hero {
  height: 220px;
}

.top-summary-week {
  font-size: 12px;
}

.top-summary h1 {
  font-size: 23px;
}

.top-summary-copy > p:last-child {
  font-size: 13px;
}

/* Keep TOP section actions visually consistent with the rest of the UI. */
.top-featured-panel .text-button,
.top-ranking-panel .text-button {
  text-decoration: none !important;
}

/* Make first and third place immediately distinguishable on TOP only. */
.top-rank-position.is-gold {
  color: #b48300;
}

.top-rank-position.is-bronze {
  color: #73461f;
}

/* Center only the points heading; numeric values stay right-aligned for comparison. */
.top-rank-header span:last-child,
.rank-table-header span:last-child {
  text-align: center;
}

/* The horse-face mask is visually thinner than the line icons; expand it on all sides. */
.nav-horse {
  width: 23px;
  height: 23px;
  transform: scale(1.06);
  filter:
    drop-shadow(.8px 0 currentColor)
    drop-shadow(-.8px 0 currentColor)
    drop-shadow(0 .8px currentColor)
    drop-shadow(0 -.8px currentColor);
}

/* Timeline: denser controls, clearer race separation and readable stacked headings. */
.timeline-controls input,
.timeline-controls .check,
.timeline-owner-select {
  min-height: 36px;
}

.timeline-controls input,
.timeline-controls .check {
  padding-top: 6px;
  padding-bottom: 6px;
}

.timeline-controls .check {
  min-width: 90px;
  justify-content: center;
  gap: 6px;
  padding-right: 10px;
  padding-left: 10px;
}

.race-group-head p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
}

.race-group-head h3 {
  margin-top: 6px;
  line-height: 1.3;
}

.race-link {
  margin-top: 14px;
  margin-bottom: 14px;
  font-size: 13px;
}

/* A rule separates races within a day; it does not close the day itself. */
.date-section .race-group:last-child {
  border-bottom: 0;
}

/* Horses: keep filters away from the container edge and strengthen hierarchy. */
.horse-filter-panel {
  padding-right: 14px;
  padding-left: 14px;
}

.horse-table-header {
  background: #f6f8f6;
  color: #42554b;
}

.horse-list-affiliation,
.horse-list-trainer {
  color: #65776d;
  font-size: 14px;
}

.horse-list-father,
.horse-list-mother {
  color: #52645b;
}

/* Keep all five owner chips on one line on normal PC widths. */
@media (min-width: 1100px) {
  .horse-filters-desktop {
    grid-template-columns: minmax(0, 1fr) 116px 160px 210px;
    gap: 12px;
  }

  .horse-filters-desktop .chip-row {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .horse-filters-desktop .owner-chip {
    padding-right: 9px;
    padding-left: 9px;
    white-space: nowrap;
  }
}

/* Past results: the selected season is a primary heading, not helper text. */
.past-season-caption {
  margin: 24px 0 14px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
}

@media (max-width: 780px) {
  .page-home-link {
    margin: 0 0 10px;
    font-size: 12px;
  }

  .top-hero {
    height: 148px;
  }

  .top-summary h1 {
    font-size: 23px;
  }

  .timeline-owner-select,
  .timeline-controls input,
  .timeline-controls .check {
    min-height: 36px;
    height: 36px;
    font-size: 12px;
  }

  .timeline-controls .check {
    min-width: 90px;
    gap: 6px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .race-group-head p {
    font-size: 13px;
  }

  .race-group-head h3 {
    margin-top: 5px;
  }

  .race-link {
    margin-top: 12px;
    margin-bottom: 12px;
    font-size: 12px;
  }

  .horse-filter-panel {
    padding-right: 10px;
    padding-left: 10px;
  }

  .horse-list-affiliation,
  .horse-list-trainer {
    font-size: 12px;
  }

  .past-season-caption {
    margin-top: 20px;
    font-size: 18px;
  }
}
