/* Weekly results: the fireworks hero with the podium, places 4-10 and earlier weeks (/weekly-results/ and
   /sr/nedeljni-rezultati/, rendered by the backend from weeklyResults_*.ftlh), and the weekly top on the home pages
   (js/weekly-top.js draws the same markup). Self-contained: the home page has no club theme. */

.wr-hero,
.wr-main {
  --wr-ink: #070b14;
  --wr-text: #e9eef7;
  --wr-muted: #9eabc4;
  --wr-line: rgba(255, 255, 255, 0.09);
  --wr-gold: #f5c842;
  --wr-gold-soft: #ffe08a;
}

.wr-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Hero: fireworks sky and the podium ---------------------------------- */

.wr-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(2.25rem, 5vw, 3.5rem) 1rem 0;
  color: #fff;
  text-align: center;
  background: var(--wr-ink);
}

.wr-sky {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: linear-gradient(180deg, #04060d 0%, #12132e 70%, #241a38 100%);
}

.wr-sky-poster,
.wr-sky .fireworks-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 0;
}

.wr-sky .fireworks-canvas {
  opacity: 0;
  transition: opacity 0.8s ease;
}

.wr-sky.is-live .fireworks-canvas {
  opacity: 1;
}

/* The floor under the steps: the sky fades into the page */
.wr-sky::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 38%;
  background:
    radial-gradient(ellipse 45% 70% at 50% 100%, rgba(255, 200, 90, 0.18), transparent 70%),
    linear-gradient(180deg, rgba(7, 11, 20, 0) 0%, rgba(7, 11, 20, 0.85) 100%);
}

.wr-hero-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.wr-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(245, 200, 66, 0.14);
  border: 1px solid rgba(245, 200, 66, 0.45);
  color: var(--wr-gold-soft);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wr-hero h1,
.wr-hero h2 {
  margin: 0.85rem auto 0.4rem;
  max-width: 820px;
  color: #fff;
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  font-weight: 800;
  line-height: 1.12;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.wr-week {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.5em;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fff4c2, #f5c842 45%, #ffcf6b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wr-week[hidden] {
  display: none;
}

.wr-sub {
  max-width: 620px;
  margin: 0 auto;
  color: rgba(233, 238, 247, 0.82);
  font-size: 1rem;
  line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

/* The podium: second, first, third on their steps */
.wr-podium {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  align-items: end;
  gap: clamp(0.4rem, 2.2vw, 1.5rem);
  max-width: 980px;
  margin: clamp(1.75rem, 4vw, 2.75rem) auto 0;
  padding: 0;
  list-style: none;
}

.wr-place {
  display: flex;
  flex-direction: column;
  min-width: 0;
  --metal: #c3cbd3;
  --metal-light: #f4f6f8;
  --metal-dark: #7d8893;
  --metal-ink: #3a434c;
  --step: 7rem;
}

.wr-place-1 {
  --metal: #f5c842;
  --metal-light: #ffe9a3;
  --metal-dark: #a8770a;
  --metal-ink: #5b3f00;
  --step: 9rem;
}

.wr-place-3 {
  --metal: #cd7f32;
  --metal-light: #f8cba4;
  --metal-dark: #74431a;
  --metal-ink: #3d2008;
  --step: 5.75rem;
}

.wr-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  min-height: 13.5rem;
  padding: 1.1rem 0.75rem 1rem;
  border-radius: 18px;
  border: 2px solid var(--metal);
  background: linear-gradient(135deg, #004d40 0%, #0092a4 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.wr-place-1 .wr-card {
  min-height: 15rem;
  border-width: 3px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 42px rgba(245, 200, 66, 0.38);
}

.wr-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The shade of the game's card, darker at the bottom for the name */
.wr-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0.74) 100%);
}

.wr-card.is-classic::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.35) 100%);
}

.wr-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: clamp(2.2rem, 5vw, 3.5rem);
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.wr-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #f5c842, #b8860b);
  color: #1a1405;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.wr-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wr-avatar.is-hidden {
  background: linear-gradient(135deg, #8a94a6, #4b5466);
  color: #fff;
}

.wr-card .wr-avatar {
  width: clamp(3.4rem, 8vw, 5.5rem);
  height: clamp(3.4rem, 8vw, 5.5rem);
  margin-bottom: auto;
  border-width: 3px;
  font-size: clamp(1.15rem, 2.6vw, 1.9rem);
  box-shadow: 0 0 0 3px var(--metal), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.wr-place-1 .wr-card .wr-avatar {
  width: clamp(3.9rem, 9.5vw, 6.5rem);
  height: clamp(3.9rem, 9.5vw, 6.5rem);
}

.wr-card .wr-name {
  max-width: 100%;
  margin-top: 0.6rem;
  overflow: hidden;
  color: #fff;
  font-size: clamp(0.88rem, 2.1vw, 1.25rem);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.wr-name em {
  font-style: italic;
  font-weight: 600;
  opacity: 0.85;
}

.wr-points {
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.72rem, 1.6vw, 0.9rem);
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.wr-points strong {
  color: var(--wr-gold-soft);
  font-size: 1.35em;
  font-weight: 800;
}

.wr-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  height: var(--step);
  margin-top: 0.55rem;
  border-radius: 12px 12px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 16%, rgba(0, 0, 0, 0.18) 100%),
    linear-gradient(90deg, var(--metal-dark) 0%, var(--metal) 50%, var(--metal-dark) 100%);
  box-shadow: inset 0 3px 0 var(--metal-light), 0 -2px 18px rgba(0, 0, 0, 0.3);
}

.wr-step-num {
  color: var(--metal-ink);
  font-size: clamp(1.9rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 0.95;
  text-shadow: 1px 2px 0 rgba(255, 255, 255, 0.45);
}

.wr-step-prize {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  font-weight: 800;
}

.wr-step-prize img {
  width: 0.95em;
  height: 0.95em;
}

/* The podium rises when the page opens */
@media (prefers-reduced-motion: no-preference) {
  .wr-podium .wr-place {
    animation: wr-rise 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .wr-podium .wr-place-1 {
    animation-delay: 0.25s;
  }

  .wr-podium .wr-place-3 {
    animation-delay: 0.12s;
  }

  .wr-place-1 .wr-card::before {
    content: "";
    position: absolute;
    top: -60%;
    left: -40%;
    z-index: 1;
    width: 40%;
    height: 220%;
    background: linear-gradient(90deg, transparent, rgba(255, 240, 190, 0.32), transparent);
    transform: rotate(18deg);
    animation: wr-shine 5.5s ease-in-out 1.4s infinite;
    pointer-events: none;
  }
}

@keyframes wr-rise {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes wr-shine {
  0%,
  70% {
    left: -40%;
  }

  100% {
    left: 130%;
  }
}

/* ---- Below the hero ------------------------------------------------------------ */

.wr-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem 1rem;
  color: var(--wr-text);
}

.wr-section {
  margin: 0 0 2.5rem;
}

.wr-section h2 {
  margin: 0 0 1rem;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
}

.wr-section h3 {
  margin: 1.5rem 0 0.5rem;
  color: var(--wr-gold-soft);
  font-size: 1.1rem;
}

.wr-board {
  border-radius: 18px;
  border: 1px solid var(--wr-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  padding: 0.5rem 0.75rem 0.25rem;
}

.wr-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.45rem;
  table-layout: fixed;
}

.wr-table caption {
  caption-side: bottom;
  padding: 0.5rem 0.25rem 0.6rem;
  color: var(--wr-muted);
  font-size: 0.82rem;
  text-align: left;
}

.wr-table th {
  padding: 0.4rem 0.75rem 0;
  color: var(--wr-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.wr-table th.wr-pos {
  width: 4.2rem;
}

.wr-table th.num {
  width: 6.5rem;
  text-align: right;
}

.wr-table td {
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.045);
  vertical-align: middle;
}

.wr-table td:first-child {
  border-radius: 12px 0 0 12px;
}

.wr-table td:last-child {
  border-radius: 0 12px 12px 0;
}

.wr-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.08);
}

.wr-table td.num {
  color: var(--wr-text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.wr-table td.wr-pts {
  color: var(--wr-gold-soft);
}

.wr-pesos img {
  width: 14px;
  height: 14px;
  margin-right: 0.3rem;
  vertical-align: -2px;
}

.wr-pos span {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 800;
}

.wr-who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.wr-who .wr-name {
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wr-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 2.5rem;
}

.wr-pager a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 200, 66, 0.4);
  color: var(--wr-gold-soft);
  font-weight: 700;
  text-decoration: none;
}

.wr-pager a:hover,
.wr-pager a:focus-visible {
  background: rgba(245, 200, 66, 0.12);
}

.wr-empty {
  color: var(--wr-muted);
}

/* Earlier weeks: a card with the top three each */
.wr-earlier {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wr-earlier-card {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--wr-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.wr-earlier-title {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--wr-gold-soft);
  font-weight: 800;
  text-decoration: none;
}

.wr-earlier-title:hover,
.wr-earlier-title:focus-visible {
  text-decoration: underline;
}

.wr-earlier ol {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wr-earlier ol li {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
}

.wr-earlier .wr-avatar {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.8rem;
}

.wr-earlier .wr-name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wr-earlier-pts {
  color: var(--wr-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.wr-medal {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4f6f8, #7d8893);
  color: #222;
  font-size: 0.75rem;
  font-weight: 800;
}

.wr-medal-1 {
  background: linear-gradient(135deg, #ffe9a3, #a8770a);
}

.wr-medal-3 {
  background: linear-gradient(135deg, #f8cba4, #74431a);
}

.wr-prose p {
  color: rgba(233, 238, 247, 0.86);
  line-height: 1.7;
}

.wr-prose a,
.wr-archive a {
  color: var(--wr-gold-soft);
}

.wr-archive {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wr-archive a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--wr-line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  text-decoration: none;
}

.wr-archive a:hover,
.wr-archive a:focus-visible {
  border-color: rgba(245, 200, 66, 0.45);
}

/* ---- Home pages: the weekly top under "Watch a round" (js/weekly-top.js) -------- */

.wr-home .wr-hero {
  padding-bottom: 1.75rem;
}

.wr-home [data-weekly-top] {
  min-height: 20rem;
}

.wr-home [data-weekly-top].is-empty {
  min-height: 0;
}

.wr-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1rem;
  max-width: 980px;
  margin: 1.5rem auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.wr-mini li {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 11, 20, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.wr-mini-pos {
  min-width: 1.6rem;
  color: rgba(233, 238, 247, 0.7);
  font-weight: 800;
  text-align: center;
}

.wr-mini .wr-avatar {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.8rem;
}

.wr-mini .wr-name {
  overflow: hidden;
  color: #fff;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wr-mini-pts {
  color: #ffe08a;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.wr-home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.wr-home-actions .btn-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

/* ---- Narrow screens ---------------------------------------------------------- */

@media (max-width: 900px) {
  .wr-card {
    min-height: 11.5rem;
  }

  .wr-place-1 .wr-card {
    min-height: 13rem;
  }

  .wr-place {
    --step: 6rem;
  }

  .wr-place-1 {
    --step: 7.5rem;
  }

  .wr-place-3 {
    --step: 5rem;
  }
}

@media (max-width: 600px) {
  .wr-hero {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
  }

  .wr-sub {
    font-size: 0.92rem;
  }

  .wr-card {
    min-height: 9.5rem;
    padding: 0.7rem 0.35rem 0.65rem;
    border-radius: 14px;
  }

  .wr-place-1 .wr-card {
    min-height: 10.75rem;
  }

  .wr-card .wr-name {
    margin-top: 0.4rem;
  }

  .wr-place {
    --step: 4.25rem;
  }

  .wr-place-1 {
    --step: 5.75rem;
  }

  .wr-place-3 {
    --step: 3.4rem;
  }

  .wr-step {
    margin-top: 0.4rem;
    border-radius: 9px 9px 0 0;
  }

  .wr-place-3 .wr-step-prize {
    display: none;
  }

  .wr-mini {
    grid-template-columns: minmax(0, 1fr);
  }

  .wr-table th.wr-pos {
    width: 3rem;
  }

  .wr-table th.num {
    width: 4.6rem;
  }

  .wr-table th,
  .wr-table td {
    padding-right: 0.45rem;
    padding-left: 0.45rem;
  }

  .wr-who {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .wr-board {
    padding: 0.35rem 0.4rem 0.1rem;
  }

  .wr-table th.num {
    width: 3.9rem;
  }

  .wr-pesos img {
    display: none;
  }

  .wr-pos span {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.85rem;
  }

  .wr-who .wr-avatar {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 0.8rem;
  }

  .wr-badge {
    top: 0.3rem;
    right: 0.3rem;
  }
}
