/* =========================================================
   Tournament Site — Result Page Stylesheet
   Loaded AFTER styles.css and home.css so it inherits the same
   header, bottom-nav, and color/type tokens. This file only
   adds rules specific to the Result (Leaderboard) tab.
   ========================================================= */

.result-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.result-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  text-align: center;
}

/* Wraps the dynamically-rendered leaderboard sections; keeps the same
   36px rhythm the sections used to get from .result-main's flex gap
   when they were direct children. */
[data-leaderboard-list] {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.result-empty-note {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  padding: 24px 0;
}

/* ---------- Leaderboard slot (one per match time) ---------- */

.leaderboard-slot {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.leaderboard-slot__time {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--crimson);
  margin: 0;
}

.leaderboard-slot__description {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: -8px 0 0;
  max-width: 460px;
}

.leaderboard-slot__frame {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
  background: var(--panel-raised);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-slot__image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  -webkit-user-select: none;
  user-select: none;
}

/* Placeholder shown until the admin uploads a leaderboard image */
.leaderboard-slot__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 56px 20px;
  color: var(--text-muted);
}

.leaderboard-slot__empty svg {
  width: 30px;
  height: 30px;
  stroke: var(--text-muted);
  fill: none;
}

.leaderboard-slot__empty p {
  margin: 0;
  font-size: 13px;
  font-family: var(--font-body);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .result-main {
    padding: 28px 16px calc(var(--nav-height-mobile) + 32px);
    gap: 28px;
  }

  .leaderboard-slot {
    padding: 22px 18px;
  }

  .leaderboard-slot__time {
    font-size: 32px;
  }
}

@media (max-width: 480px) {
  .result-title {
    font-size: 20px;
  }

  .leaderboard-slot__time {
    font-size: 28px;
  }

  .leaderboard-slot__empty {
    padding: 40px 16px;
  }
}

/* ---------- Results table (leaderboard entries set to "Enter kills & placement") ---------- */

.leaderboard-table__wrap {
  width: 100%;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.leaderboard-table th {
  text-align: right;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 12px 12px 10px;
  white-space: nowrap;
}

.leaderboard-table td {
  text-align: right;
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  white-space: nowrap;
}

.leaderboard-table th:first-child,
.leaderboard-table td:first-child,
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  text-align: left;
}

.leaderboard-table td.leaderboard-table__team {
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.leaderboard-table td.leaderboard-table__pts {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--cyan);
}

.leaderboard-table__rules {
  margin: 0;
  padding: 10px 12px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .leaderboard-table {
    font-size: 13px;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding-left: 8px;
    padding-right: 8px;
  }
}
