/* Home page (index.html): sport-poster layout.
   Flat colour fields, Anton for display, Barlow for text. No gradients, no shadows. */

#page-home .container {
  width: auto;
  max-width: none;
  margin: 0;
  padding: var(--gutter) var(--gutter) 0;
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  gap: 8px;
  padding: 16px var(--gutter) 8px;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0;
}

.hero__intro { max-width: 52ch; }

.hero__note {
  margin: 6px 0 0;
  font-size: clamp(17px, 1.3vw, 20px);
  font-weight: 500;
  line-height: 1.25;
  color: var(--sky);
}

.hero__note a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.hero__lead {
  max-width: 34ch;
  margin: 0;
  font-size: clamp(17px, 1.3vw, 20px);
  font-weight: 500;
  line-height: 1.25;
}

.hero__actions {
  display: flex;
  gap: 8px;
  flex: none;
}

/* Live pulse: four flat fields */
.pulse {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.3fr 1.5fr;
  gap: 8px;
}

.pulse__tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 112px;
  margin: 0;
  padding: 12px 16px;
  background: var(--ink-2);
  color: #fff;
}

.pulse__tile--round { background: var(--sky); color: var(--ink); text-decoration: none; cursor: pointer; }
.pulse__tile--round:hover { filter: brightness(1.06); }
#latestRoundSection { scroll-margin-top: 72px; }
html { scroll-behavior: smooth; }

.pulse__foot { display: flex; flex-direction: column; }

.pulse__label {
  font-size: 16px;
  font-weight: 600;
}

.pulse__value {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 3.4vw, 52px);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.005em;
}

.pulse__value--name { font-size: clamp(26px, 2.4vw, 36px); overflow-wrap: anywhere; }

.pulse__meta {
  font-size: 16px;
  font-weight: 400;
  opacity: 0.8;
}

.pulse__tile--count {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  align-content: center;
  background: var(--ground);
  color: var(--ink);
}

.pulse__tile--count > div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
}

.pulse__tile--count dt { font-size: 16px; font-weight: 500; }
.pulse__tile--count dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 2.4vw, 36px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* min-width 0 / overflow hidden: the oversized single-line word must not stretch its flex/grid parent */
.hero__mark {
  min-width: 0;
  margin: 0 0 8px;
  overflow: hidden;
}

.hero__mark .hero__name { margin: 0; }

/* The monument: set by landing.js to span the whole width */
.hero__name {
  margin: 0 0 8px;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22vw;
  line-height: 0.88;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
}

.hero__name:not(.is-fitted) { visibility: hidden; }

.hero__letter { display: inline-block; padding-top: 0.04em; }

/* Anton's side bearing would push the M in from the margin: pull it back */
.hero__letter:first-child { margin-left: -0.033em; }

/* Until its turn in the intro (landing.js) a letter waits invisible off the right edge */
.hero__name.is-anim .hero__letter:not(.is-in) { opacity: 0; }

@keyframes rise {
  from { transform: translateY(105%); }
  to { transform: translateY(0); }
}

body:not(.loading) .pulse__tile,
body:not(.loading) .hero__lead,
body:not(.loading) .hero__actions {
  animation: lift 0.7s var(--ease) both;
}

body:not(.loading) .hero__actions { animation-delay: 0.1s; }
body:not(.loading) .pulse__tile:nth-child(1) { animation-delay: 0.15s; }
body:not(.loading) .pulse__tile:nth-child(2) { animation-delay: 0.23s; }
body:not(.loading) .pulse__tile:nth-child(3) { animation-delay: 0.31s; }
body:not(.loading) .pulse__tile:nth-child(4) { animation-delay: 0.39s; }

@keyframes lift {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Content sections: bordered panels, sidebar on the right ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas: "main side";
  gap: var(--gutter);
  align-items: start;
}

.layout__main { grid-area: main; display: flex; flex-direction: column; gap: var(--gutter); min-width: 0; }

.layout__side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
  position: sticky;
  top: 72px;
}

.panel {
  padding: 14px 14px 16px;
  background: #fff;
  border: 2px solid var(--ink);
}

.panel--narrow { width: 100%; max-width: 860px; margin: 0 auto; }

.duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gutter);
  align-items: start;
}

#page-home .section-header {
  margin: 0 0 12px;
  text-align: center;
}

#page-home #mainContainer h2 {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--ink);
}

#page-home #mainContainer h2 span { color: var(--ink-3); }

.section-description {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--ink-3);
}

/* ---------- Upsets: one compact line each ---------- */
#page-home .upset-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

#page-home .upset-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  max-width: none;
  padding: 8px 14px 6px;
  background: var(--ink);
  color: #fff;
  text-align: left;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#page-home .upset-card:hover { background: var(--sky); color: var(--ink); }

#page-home .upset-label {
  order: 2;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sky);
  white-space: nowrap;
}

#page-home .upset-card:hover .upset-label { color: var(--ink); }

#page-home .upset-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

#page-home .upset-player {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 2px 10px;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.7vw, 24px);
  font-weight: 400;
  line-height: 1.1;
  text-transform: uppercase;
}

#page-home .upset-player:last-child { justify-content: flex-end; text-align: right; }

#page-home .upset-team,
#page-home .upset-rating {
  display: inline;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  color: rgba(255, 255, 255, 0.78);
}

#page-home .upset-card:hover .upset-team,
#page-home .upset-card:hover .upset-rating { color: var(--ink); }

#page-home .upset-score {
  padding: 4px 8px 2px;
  border-radius: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
}

#page-home .upset-card:hover .upset-score { background: var(--ink); color: var(--sky); }

#upcomingMatchesContainer { display: none; }

/* ---------- Tablet / phone ---------- */
/* The fourth card only exists where the tiles wrap into two columns */
.pulse__tile--eff { display: none; }

@media (max-width: 1000px) {
  .pulse__tile--eff { display: flex; }
  .duo { grid-template-columns: minmax(0, 1fr); }
  .pulse { grid-template-columns: 1fr 1fr; }
  .pulse__tile { min-height: 104px; }
}

@media (max-width: 700px) {
  #page-home { --gutter: 16px; font-size: 16px; }
  #page-home .container { padding-top: 56px; }
  .duo, .upsets { margin-top: 40px; }
  .hero { padding-top: 16px; gap: 6px; }
  .hero__top { flex-direction: column; gap: 14px; padding-bottom: 8px; }
  .hero__actions { width: 100%; }
  .hero__actions .btn { flex: 1; justify-content: center; }
  .pulse { gap: 6px; }
  .pulse__tile { min-height: 96px; padding: 10px 12px; }
  .pulse__tile--count { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .pulse__tile--count dt { font-size: 13px; line-height: 1.15; }
  .pulse__tile--count dd { font-size: 28px; }
  #page-home .upset-card { grid-template-columns: 1fr; gap: 2px; }
  #page-home .upset-label { order: 0; }
  #page-home .upset-match { grid-template-columns: 1fr auto; gap: 4px 10px; }
  #page-home .upset-player:last-child { justify-content: flex-start; text-align: left; grid-column: 1; }
  #page-home .upset-score { grid-column: 2; grid-row: 1 / span 2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

#page-home .match-stats-container {
  max-width: 820px;
  margin: 0 auto;
}

/* Sidebar lists, compact */
#page-home .layout__side .top-players-list { gap: 4px; }
#page-home .layout__side .top-player-row { padding: 6px 10px 4px; gap: 8px; }
#page-home .layout__side .tp-rank { width: 20px; font-size: 20px; }
#page-home .layout__side .tp-name { font-size: 15px; }
#page-home .layout__side .tp-team { font-size: 13px; }
#page-home .layout__side .tp-gain { padding: 4px 6px 2px; font-size: 16px; }
#page-home .layout__side .section-description { margin-top: 8px; font-size: 13px; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "side"; }
  .layout__side { position: static; }
}

@media (max-width: 1000px) {
  .duo { grid-template-columns: minmax(0, 1fr); }
}

/* Hero wordmark: single line with the ball-rally intro and the KOŠICKÁ tag above it */

/* The ball arcs above the word, so only the sides are clipped */
.hero__mark { overflow-x: clip; overflow-y: visible; position: relative; }
.hero__mark .hero__name { overflow-x: clip; overflow-y: visible; }

.hero__letter { transform-origin: 50% 100%; }

/* KOŠICKÁ: a quarter of the wordmark's size, in the accent colour, flush with the M */
.hero__kosicka {
  display: block;
  /* tucked into the top of MINILIGA by a few pixels */
  margin: 0 0 calc(var(--wm, 100px) * -0.1) -0.033em;
  position: relative;
  z-index: 2;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: calc(var(--wm, 100px) * 0.25);
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-highlight);
  /* a ground-coloured outline keeps the light blue readable where it crosses the white letters */
  -webkit-text-stroke: 0.14em var(--ink);
  paint-order: stroke fill;
}
.hero__k { display: inline-block; }
.hero__mark.is-anim .hero__k:not(.is-in) { opacity: 0; }

.hero__ball {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transform-origin: 50% 100%;
  will-change: transform, translate;
}
.hero__ball.is-live { opacity: 1; }
