.home-layout {
  display: flex;
  flex-direction: column;
  width: min(1600px, 96vw);
  min-height: calc(100vh - 68px);
  padding: clamp(16px, 3vh, 24px) 0 30px;
}

.leaderboard-section { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 20px;
}
.section-heading h1 {
  margin: 0;
  font-size: clamp(38px, 4.5vw, 52px);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1;
}
.wreath-frame {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--gold);
}
.wreath-sprig {
  position: absolute;
  z-index: 2;
  width: 138px;
  height: 138px;
  background: url("./wreath-sprig.svg") center / contain no-repeat;
  clip-path: polygon(0 0, 100% 0, 100% 50%, 50% 50%, 50% 100%, 0 100%);
  pointer-events: none;
}
.wreath-sprig-top-left { top: -24px; left: -24px; }
.wreath-sprig-top-right { top: -24px; right: -24px; transform: rotate(90deg); }
.wreath-sprig-bottom-right { right: -24px; bottom: -24px; transform: rotate(180deg); }
.wreath-sprig-bottom-left { bottom: -24px; left: -24px; transform: rotate(270deg); }
#leaderboard-content { position: relative; z-index: 1; display: flex; flex: 1; flex-direction: column; }

.leaderboard-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: 3px solid var(--red);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--surface-raised), 0 16px 34px rgb(3 13 8 / 26%);
}
.leaderboard-head, .leaderboard-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 170px;
  align-items: center;
}
.leaderboard-head {
  min-height: 58px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.leaderboard-head span:last-child, .team-score { text-align: right; }
.leaderboard-row {
  flex: 1;
  min-height: clamp(96px, 10vh, 110px);
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  transition: background-color .15s ease;
}
.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-row:nth-child(even) { background: #1d392d; }
.leaderboard-row:hover, .leaderboard-row:nth-child(even):hover { background: var(--surface-raised); }
.rank { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.rank-1 { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--gold); border-radius: 50%; background: var(--red); color: var(--paper); font-weight: 750; }
.team-name { overflow-wrap: anywhere; font-size: 19px; font-weight: 600; }
.team-score { color: var(--red); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-unit { margin-left: 6px; color: var(--muted); font-size: 10px; font-weight: 500; }
.privacy-note { margin: 38px 2px 0; color: var(--muted); font-size: 11px; }
.state-card { flex: 1; }
.empty-state { min-height: 280px; display: grid; place-items: center; padding: 36px 20px; text-align: center; }
.empty-state strong { display: block; font-size: 21px; font-weight: 620; }

@media (max-width: 800px) {
  .home-layout { width: min(720px, calc(100% - 36px)); padding: 20px 0 32px; }
  .wreath-frame { padding: 20px; }
  .wreath-sprig { width: 116px; height: 116px; }
  .section-heading h1 { font-size: 42px; }
  .leaderboard-row { min-height: 88px; }
}

@media (max-width: 520px) {
  .home-layout { width: calc(100% - 28px); min-height: calc(100vh - 62px); padding-top: 16px; }
  .section-heading { align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
  .section-heading h1 { font-size: 36px; }
  .wreath-frame { padding: 12px; }
  .wreath-sprig { width: 76px; height: 76px; }
  .wreath-sprig-top-left { top: -14px; left: -14px; }
  .wreath-sprig-top-right { top: -14px; right: -14px; }
  .wreath-sprig-bottom-right { right: -14px; bottom: -14px; }
  .wreath-sprig-bottom-left { bottom: -14px; left: -14px; }
  .privacy-note { margin-top: 27px; }
  .leaderboard-head, .leaderboard-row { grid-template-columns: 38px minmax(0, 1fr) 76px; padding-right: 11px; padding-left: 11px; }
  .leaderboard-head { min-height: 43px; font-size: 8px; }
  .leaderboard-row { min-height: 78px; }
  .rank-1 { width: 28px; height: 28px; }
  .rank, .team-name, .team-score { font-size: 14px; }
  .score-unit { margin-left: 3px; font-size: 8px; }
  .empty-state { min-height: 210px; }
}
