/* Liga UNDER — brand shell + clean data surfaces.
   Design rule (spec §8): brand boldly in the shell (header, nav, titles, blue-vs-red combat
   cards), but keep live data (tables, standings, scores) clean and highly readable on light
   surfaces. Phone-first: base styles target a narrow screen; min-width queries enhance. */

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

:root {
  /* Brand: primary BLUE, secondary WHITE (organizer-confirmed). Cream/coral are decorative. */
  --navy: #16205f;
  --blue: #2746c7;
  --blue-deep: #1b2a8a;
  --blue-bright: #2f9fe0;
  --cream: #f6f0e2;
  --coral: #ec5a72;

  /* Functional taekwondo colors for the two fighters. */
  --red: #d8253b;
  --red-soft: #fcebed;
  --fighter-blue: #1f6fd0;
  --blue-soft: #e9f1fc;

  /* Neutrals for readable data surfaces. */
  --ink: #16181f;
  --muted: #687087;
  --paper: #ffffff;
  --line: #e4e7ef;
  --bg: #eef0f6;

  --ok: #1f9d57; /* green for fills/dots/large text */
  --ok-text: #157a43; /* darker green for small text on white (WCAG AA) */
  --warn: #e08a1e;
  --hero-accent: #cfe9ff; /* light cyan for text on the navy/blue hero (high contrast) */

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 6px 22px rgba(20, 28, 64, 0.10);
  --shadow-card: 0 2px 10px rgba(20, 28, 64, 0.07);

  --header-h: 116px; /* measured at runtime; used for the full-screen Home hero */
  --display: "Oswald", "Arial Narrow", "Helvetica Neue", Impact, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--body);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  /* Cream-tinted page with a faint, cheap texture (echo of the poster's paper, kept subtle). */
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(47, 159, 224, 0.06), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(39, 70, 199, 0.05), transparent 35%);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------------- header / nav ---------------- */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-deep) 55%, var(--blue) 100%);
  color: #fff;
  box-shadow: var(--shadow);
  /* A rough, torn-paper-like bottom edge echoing the poster. */
  border-bottom: 4px solid var(--blue-bright);
}

.app-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 0.6rem 1rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
}
.brand:hover {
  text-decoration: none;
}
.brand__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
.brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lang-switch {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-btn:hover {
  color: #fff;
}
.lang-btn.is-active {
  background: #fff;
  color: var(--navy);
}

.app-header__nav-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 0.4rem 1rem 0.5rem;
}
.app-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  /* Fade the right edge so a tab cut off on a very narrow phone is visibly scrollable. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
}
.app-nav::-webkit-scrollbar {
  display: none;
}
.nav-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  border-radius: 8px 8px 0 0;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.nav-link:hover {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
}
.nav-link.is-active {
  color: #fff;
  border-bottom-color: var(--blue-bright);
  background: rgba(255, 255, 255, 0.1);
}

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0;
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.3rem; /* phone: compact — just the dot (label collapsed) */
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, padding 0.2s ease;
}
/* The label is collapsed (zero width) by default and animates open on reveal. */
.status-pill__label {
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.28s ease, opacity 0.2s ease, margin-left 0.28s ease;
}
/* A failed refresh tints the chip red; the dot already turns red. */
.status-pill--error {
  background: rgba(216, 37, 59, 0.32);
}
/* On tap (any screen) the chip expands to reveal the ticking "Updated Xs" label. */
.status-pill--detail {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.25rem 0.6rem;
}
.status-pill--detail .status-pill__label {
  max-width: 9rem;
  opacity: 1;
  margin-left: 0.4rem;
}
@media (prefers-reduced-motion: reduce) {
  .status-pill,
  .status-pill__label {
    transition: none;
  }
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--live {
  background: #54e08a;
  box-shadow: 0 0 0 0 rgba(84, 224, 138, 0.7);
  animation: pulse 1.8s infinite;
}
.status-dot--refresh {
  background: #fff; /* neutral "working" colour; red is reserved for an out-of-sync error */
}
.status-dot--error {
  background: var(--red);
}
.status-dot--demo {
  background: var(--coral);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(84, 224, 138, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(84, 224, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(84, 224, 138, 0); }
}

/* ---------------- main layout ---------------- */

.view {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.1rem 1rem 2.5rem;
}

.page__title,
.home__title {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
}
.page__title {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.1rem;
  margin-bottom: 1.1rem;
}
.card__title {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.8rem;
}
.note {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.7rem;
}
.empty-state {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1rem;
  text-align: center;
  color: var(--muted);
}

.btn {
  display: inline-block;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  border: none;
}
.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(39, 70, 199, 0.35);
}
.btn--primary:hover {
  background: var(--blue-deep);
  text-decoration: none;
}

/* ---------------- Home (full-screen immersive landing) ---------------- */

/* On Home the whole page is a dark-blue canvas and the view goes edge to edge. */
body.is-home {
  background: var(--navy);
}
body.is-home .view {
  max-width: none;
  padding: 0;
}

.home {
  position: relative;
  min-height: 100%;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(135% 75% at 50% -8%, rgba(47, 159, 224, 0.4), transparent 55%),
    linear-gradient(180deg, var(--blue-deep) 0%, var(--navy) 62%);
}

/* Hero fills the screen below the header. */
.home__hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.4rem 4.5rem;
}
.home__hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 720px;
}
.home__kicker {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue-bright);
  margin-bottom: 0.9rem;
}
.home__logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.5));
}
.home__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.86;
  margin-top: 0.6rem;
}
.home__title-top {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.9);
}
.home__title-main {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  font-size: 4.6rem;
  color: #fff;
  text-shadow: 0 6px 26px rgba(0, 0, 0, 0.4);
}
.home__tagline {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.02rem;
  color: var(--blue-bright);
  margin-top: 0.9rem;
}
.home__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 1.7rem 0;
}
/* Date as a refined underlined line, not a pill. */
.home__date {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  font-size: 1.35rem;
  color: #fff;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}
.home__place {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.75);
}
.home__place:hover {
  color: #fff;
  text-decoration: none;
}
.btn--hero {
  margin-top: 0.4rem;
  font-size: 1.05rem;
  padding: 0.9rem 2rem;
  background: var(--blue-bright);
  color: var(--navy);
  box-shadow: 0 8px 22px rgba(47, 159, 224, 0.4);
}
.btn--hero:hover {
  background: #fff;
  text-decoration: none;
}

/* Scroll-down hint at the foot of the hero. */
.home__scroll {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.6rem;
}
.home__scroll-chevron {
  display: block;
  width: 13px;
  height: 13px;
  border-right: 2px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
  transform: rotate(45deg);
  animation: home-bounce 1.8s ease-in-out infinite;
}
@keyframes home-bounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.45; }
  50% { transform: rotate(45deg) translate(3px, 3px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .home__scroll-chevron { animation: none; }
}

/* Below-hero content: same dark canvas, thin dividers, no cards or pills. */
.home__sections {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.4rem 4rem;
}
.home__strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2.6rem;
  padding: 2.4rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.home__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.home__stat-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.1rem;
  line-height: 1;
  color: #fff;
}
.home__stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.65);
}
.home__block {
  padding: 2.6rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}
.home__block-title {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-bright);
  margin-bottom: 1.4rem;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.countdown__unit {
  text-align: center;
  min-width: 54px;
}
.countdown__value {
  display: block;
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown__label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
}
.countdown__started {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1.3rem;
  color: var(--blue-bright);
  text-align: center;
}

.home__ig {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
}
.home__ig:hover {
  color: var(--blue-bright);
  text-decoration: none;
}
.home__ig-icon {
  font-size: 1.3rem;
}
.home__sponsors {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.6rem 1.8rem;
}
.home__sponsors li {
  font-size: 0.95rem;
  font-weight: 600;
}
.home__sponsor {
  color: rgba(255, 255, 255, 0.8);
}
.home__sponsor:hover {
  color: var(--blue-bright);
  text-decoration: none;
}

/* ---------------- combat cards ---------------- */

.combat-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.combat-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.8rem 0.9rem;
  overflow: hidden;
}
.combat-card.is-current {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 2px rgba(47, 159, 224, 0.35), var(--shadow-card);
}
.combat-card.is-next {
  border-color: var(--warn);
}
.combat-card__ribbon {
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  padding: 0.18rem 0.7rem;
  border-bottom-left-radius: 10px;
}
.combat-card__ribbon--current {
  background: var(--blue);
}
.combat-card__ribbon--next {
  background: var(--warn);
}

.combat-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
/* Reserve space for the corner ribbon only on cards that have one, so the status pill
   sits flush right on every other card. */
.combat-card.is-current .combat-card__head,
.combat-card.is-next .combat-card__head {
  padding-right: 3.6rem;
}
.combat-card__meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.combat-card__body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
}
.fighter {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  min-width: 0;
}
.fighter--red {
  text-align: left;
  border-left: 4px solid var(--red);
  background: linear-gradient(90deg, var(--red-soft), transparent);
}
.fighter--blue {
  text-align: right;
  border-right: 4px solid var(--fighter-blue);
  background: linear-gradient(270deg, var(--blue-soft), transparent);
}
.fighter__name {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}
.fighter--red .fighter__name:hover,
.fighter--blue .fighter__name:hover {
  color: var(--blue);
}
.fighter__club {
  font-size: 0.74rem;
  color: var(--muted);
}
.fighter__tag {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ok-text);
}
.fighter.is-winner .fighter__name {
  color: var(--ok-text);
}

.combat-card__score {
  text-align: center;
  min-width: 76px;
}
.round {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.round__label {
  font-weight: 600;
  margin-right: 0.25rem;
}
.round__pts {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.round__win {
  font-size: 0.7rem;
  font-weight: 600;
}
.round__win--red {
  color: var(--red);
}
.round__win--blue {
  color: var(--fighter-blue);
}
.result {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 0.1rem;
}
.vs {
  font-family: var(--display);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* status badges */
.badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge--scheduled {
  background: #eef0f6;
  color: var(--muted);
}
.badge--ongoing {
  background: var(--blue);
  color: #fff;
}
.badge--finished {
  background: #e4f6ec;
  color: var(--ok-text);
}
.badge--cancelled {
  background: #fdecee;
  color: var(--red);
}

/* Tatami filter: pills with a live dot per active tatami. On phones the row scrolls sideways
   (with a fade hint); on wider/computer screens it wraps to multiple lines (see media query). */
.tatami-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tatami-bar::-webkit-scrollbar {
  display: none;
}
/* Edge fades, applied only on the side(s) that can still be scrolled (toggled in JS). */
.tatami-bar.is-fade-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent);
}
.tatami-bar.is-fade-left {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 18px);
  mask-image: linear-gradient(to right, transparent, #000 18px);
}
.tatami-bar.is-fade-left.is-fade-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.tatami-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--navy);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tatami-pill:hover {
  border-color: var(--blue);
}
.tatami-pill.is-active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.tatami-pill__live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54e08a;
  box-shadow: 0 0 0 0 rgba(84, 224, 138, 0.7);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}

.field-block {
  margin-bottom: 1.6rem;
}
.field-block__title {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 3px solid var(--blue-bright);
}

/* ---------------- tables (standings + matrix) ---------------- */

.group-picker {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.group-picker label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.select {
  font-size: 0.95rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
.group-classification {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  color: var(--blue);
  margin-bottom: 0.8rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  border-collapse: collapse;
  width: 100%;
}
.standings th,
.standings td {
  padding: 0.5rem 0.45rem;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.standings thead th {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: #f7f8fc;
}
.standings thead abbr {
  text-decoration: none;
  cursor: help;
}
.standings .num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.standings .left {
  text-align: left;
}
.standings .strong {
  font-weight: 700;
  color: var(--navy);
}
.standings tbody tr:nth-child(odd) {
  background: #fbfcfe;
}
.standings tbody tr:first-child td {
  font-weight: 600;
}

.matrix th,
.matrix td {
  border: 1px solid var(--line);
  text-align: center;
  font-size: 0.8rem;
  padding: 0.35rem;
  min-width: 44px;
}
.matrix__corner {
  font-size: 0.66rem;
  color: var(--muted);
  background: #f7f8fc;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 2;
}
.matrix__col,
.matrix__row {
  font-weight: 700;
  white-space: nowrap;
}
.matrix__col { /* top header row = Red fighters */
  background: var(--red-soft);
  color: var(--red);
}
.matrix__row { /* left header column = Blue fighters */
  background: var(--blue-soft);
  color: var(--fighter-blue);
}
.matrix__col a { color: var(--red); }
.matrix__row a { color: var(--fighter-blue); }
.matrix__axis--blue { color: var(--fighter-blue); }
.matrix__axis--red { color: var(--red); }
/* Result numbers coloured by side: first = Red fighter, second = Blue fighter. */
.matrix__rn--red { color: var(--red); }
.matrix__rn--blue { color: var(--fighter-blue); }
.matrix__row {
  position: sticky;
  left: 0;
  z-index: 1;
}
.matrix__cell--diag {
  background: repeating-linear-gradient(45deg, #eef0f6, #eef0f6 5px, #f7f8fc 5px, #f7f8fc 10px);
}
.matrix__result {
  display: inline-block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.matrix__result.status-scheduled {
  color: var(--muted);
  font-weight: 500;
}
.matrix__result.status-ongoing {
  color: var(--blue);
}
.matrix__result.status-finished {
  color: var(--navy);
}
.matrix__result + .matrix__result {
  margin-left: 0.3rem;
  padding-left: 0.3rem;
  border-left: 1px solid var(--line);
}

/* ---------------- athletes ---------------- */

.search-input {
  width: 100%;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  margin-bottom: 1rem;
}
.search-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(39, 70, 199, 0.15);
}
.result-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.result-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  color: var(--ink);
}
.result-item:hover {
  border-color: var(--blue);
  text-decoration: none;
  background: var(--blue-soft);
}
.result-item__name {
  font-weight: 700;
}
.result-item__meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}
.profile__head {
  margin-bottom: 1rem;
}
.profile__name {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.05;
}
.profile__meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.profile__group-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.profile__group-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.profile__group-link {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.05rem;
  font-weight: 600;
}
.profile__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}
.pstat {
  background: #f7f8fc;
  border-radius: var(--radius-sm);
  padding: 0.55rem;
  text-align: center;
}
.pstat--strong {
  background: var(--blue-soft);
}
.pstat__value {
  display: block;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pstat__label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-top: 0.25rem;
}

.past-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
}
.past-row.outcome-won {
  border-left-color: var(--ok);
}
.past-row.outcome-lost {
  border-left-color: var(--red);
}
.past-row.outcome-drawn {
  border-left-color: var(--warn);
}
.past-row__outcome {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.82rem;
  min-width: 4.6rem;
}
.outcome-won .past-row__outcome {
  color: var(--ok-text);
}
.outcome-lost .past-row__outcome {
  color: var(--red);
}
.outcome-drawn .past-row__outcome {
  color: var(--warn);
}
.past-row__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.past-row__vs {
  color: var(--muted);
  font-size: 0.8rem;
}
.past-row__opp {
  font-weight: 600;
}

/* ---------------- wider screens ---------------- */

@media (min-width: 600px) {
  .page__title {
    font-size: 2.1rem;
  }
  /* Roomier screens show the chip background and the "Live" label by default. */
  .status-pill {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.6rem;
  }
  .status-pill__label {
    max-width: 9rem;
    opacity: 1;
    margin-left: 0.4rem;
  }
  .home__title-top {
    font-size: 2.1rem;
  }
  .home__title-main {
    font-size: 6.2rem;
  }
  .home__tagline {
    font-size: 1.15rem;
  }
  .countdown__value {
    font-size: 3.6rem;
  }
  .profile__stats {
    grid-template-columns: repeat(5, 1fr);
  }
  .combat-card__score {
    min-width: 96px;
  }
}

@media (min-width: 820px) {
  .brand__name {
    font-size: 1.7rem;
  }
  .nav-link {
    font-size: 1.05rem;
  }
  /* On computers, wrap the tatami pills instead of scrolling sideways. */
  .tatami-bar {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}
