/* 結算頁：上面是標題和精彩重播，下面是名次、稱號和按鈕；寬螢幕左右分開。顏色只給名次最高的一列和大按鈕。 */

.results {
  box-sizing: border-box;
  position: relative;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(18px + var(--safe-t)) calc(16px + var(--safe-r)) calc(24px + var(--safe-b)) calc(16px + var(--safe-l));
}

.r-head { text-align: center; }
.r-kicker { margin: 0; color: var(--muted); font-size: 14px; letter-spacing: .3em; }
.r-head h1 { margin: 2px 0 6px; font-size: 30px; letter-spacing: .08em; }
.r-verdict {
  margin: 0;
  color: var(--yellow);
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- the replay */

.r-replay { display: flex; flex-direction: column; gap: 8px; }
.r-view {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 34vh;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101112;
}
.r-picture { display: block; width: 100%; height: 100%; }
.r-caption { margin: 0; color: var(--soft); font-size: 15px; text-align: center; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- the standings */

.r-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.r-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.r-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left-width: 8px;
  border-radius: 10px;
  background: var(--solid);
}
.r-team.team0 { border-left-color: #3b86e0; }
.r-team.team1 { border-left-color: #f0862a; }
.r-team.won { border-color: var(--yellow); }
.r-team.won.team0 { border-left-color: #3b86e0; }
.r-team.won.team1 { border-left-color: #f0862a; }
.r-team-name { font-size: 16px; font-weight: 700; }
.r-team-points { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; }

.r-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.r-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--solid);
}
.r-row.won { border-color: var(--yellow); background: #2a2616; }
.r-row.mine { box-shadow: inset 4px 0 0 var(--soft); }
.r-who { min-width: 0; }
.r-who p { margin: 0; }
.r-name { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.r-name .person-name { overflow-wrap: anywhere; }
.r-label { margin-top: 2px; color: var(--yellow); font-size: 14px; font-weight: 700; }
.r-title { margin-top: 2px; font-size: 16px; }
.r-note { color: var(--muted); font-size: 13px; }
.r-points { flex: none; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.r-actions { display: flex; flex-direction: column; gap: 10px; }
.r-actions .big { width: 100%; }
.r-actions .quiet { background: transparent; }
.r-wait { margin: 0; color: var(--muted); text-align: center; }
.r-sent { margin: 0; color: var(--soft); font-size: 15px; text-align: center; }

/* ---------------------------------------------------------------- the share card's preview */

.r-sheet {
  position: fixed;
  z-index: 20;
  inset: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(12px + var(--safe-b)) calc(16px + var(--safe-l));
  background: #0c0d0e;
}
.r-card {
  flex: 1 1 0;
  min-height: 0;
  max-width: 100%;
  aspect-ratio: 1080 / 1920;
  object-fit: contain;
  border-radius: 10px;
}
.r-share-text {
  flex: none;
  box-sizing: border-box;
  width: min(100%, 440px);
  max-height: 7.5em;
  margin: 0;
  overflow-y: auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--solid);
  color: var(--soft);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.r-link { flex: none; width: min(100%, 440px); }
.r-sheet-bar { display: flex; gap: 10px; width: min(100%, 440px); }
.r-sheet-bar .big { flex: 1 1 0; min-height: 52px; padding: 0 12px; font-size: 18px; }

/* ---------------------------------------------------------------- wide screens: the replay beside the standings */

@media (min-width: 820px) and (min-aspect-ratio: 5 / 4) {
  .results {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 24px;
    align-content: start;
  }
  .r-head { grid-column: 1 / -1; }
  .r-view { max-height: none; }
  .r-replay { align-self: start; }
  .r-side { grid-column: 2; grid-row: 2; }
  .r-replay { grid-column: 1; grid-row: 2; }
  .r-replay[hidden] + .r-side { grid-column: 1 / -1; width: 100%; max-width: 560px; justify-self: center; }
}

/* a phone held sideways: the same, with less height to spare */
@media (max-height: 520px) and (min-aspect-ratio: 5 / 4) {
  .results {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: 16px;
    align-content: start;
  }
  .r-head { grid-column: 1 / -1; }
  .r-head h1 { display: inline; font-size: 22px; }
  .r-kicker { display: none; }
  .r-view { max-height: none; }
  .r-replay { grid-column: 1; grid-row: 2; align-self: start; }
  .r-side { grid-column: 2; grid-row: 2; }
  .r-replay[hidden] + .r-side { grid-column: 1 / -1; width: 100%; max-width: 560px; justify-self: center; }
}
