/* Results screen (a screen of a room, and of solo mode, in app.html). Colors, buttons and the backdrop come from /shared/theme.css. */

/* Every rule here starts with :where([data-styles~="results"]): the game's screens are all on one page (app.html), with
   every screen's stylesheet loaded, and that keeps this one's rules to the screens that name it in their data-styles.
   (:where adds no weight, so the rules count for just what they did before it. A rule for the screen itself has no
   space after it.) */

/* As wide as the screen, with what's on it in the middle (948px across at most): a room's curtain hangs from it, and
   should fill a computer's screen as it comes down and goes up, not just the middle of it */
:where([data-styles~="results"]) .results {
  display: grid;
  gap: 18px;
  /* Room at the top for the home and mute buttons */
  padding: calc(72px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px), calc(50% - 474px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px), calc(50% - 474px));
}

@media (min-width: 860px) {
  :where([data-styles~="results"]) .results {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: 24px;
  }

  :where([data-styles~="results"]) .winner-card {
    grid-row: span 2;
    position: sticky;
    top: 72px;
  }
}

/* A phone on its side (in a browser): a room's winner card wider and shorter - the circle smaller, beside who won and the
   buttons - so Play again is on the screen without scrolling */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 560px) {
  :where([data-styles~="results"]) .results.curtain { padding-top: calc(64px + env(safe-area-inset-top, 0px)); gap: 14px; }

  :where([data-styles~="results"]) .results.curtain .winner-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    column-gap: 22px;
    row-gap: 8px;
    padding: 16px 22px 18px;
    text-align: left;
    top: 64px;
  }

  :where([data-styles~="results"]) .results.curtain .winner-card > .eyebrow { grid-column: 1 / -1; justify-self: center; margin: 0; }
  :where([data-styles~="results"]) .results.curtain .winner { grid-row: 2 / span 3; width: min(34vh, 140px); padding: 16px; font-size: 22px; }
  :where([data-styles~="results"]) .results.curtain .winner-card h1 { font-size: 30px; }
  :where([data-styles~="results"]) .results.curtain .winner-tag { font-size: 15px; }
  :where([data-styles~="results"]) .results.curtain .end-actions { justify-content: flex-start; margin-top: 2px; }
}

:where([data-styles~="results"]) .winner-card, :where([data-styles~="results"]) .panel {
  min-width: 0;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

:where([data-styles~="results"]) .winner-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 20px 24px;
  text-align: center;
  animation: popIn 0.6s ease-out;
}

:where([data-styles~="results"]) .winner {
  position: relative;
  display: grid;
  place-items: center;
  width: min(52vw, 210px);
  aspect-ratio: 1 / 1;
  padding: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700);
  color: #2c3e50;
  font-weight: 800;
  font-size: clamp(22px, 6vw, 30px);
  line-height: 1.1;
  overflow-wrap: anywhere;
  hyphens: auto;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Only the shine turns - the name stays upright. It's the circle itself, rounded (a circle looks the same however it's
   turned), so the circle can let its glow out. Not a bigger square cut down to the circle: turning, its corners swept
   out past the screen's edges, and the results scrolled sideways. */
:where([data-styles~="results"]) .winner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(transparent, rgba(255, 255, 255, 0.35), transparent 35%);
  animation: winnerShine 3s linear infinite;
}

/* The glow round it, breathing: drawn once, and only faded and grown (a glowing shadow redrawn every frame was work for
   the phone the whole time the results were up) */
:where([data-styles~="results"]) .winner::after {
  content: "";
  position: absolute;
  inset: -26px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 215, 0, 0.55), rgba(255, 215, 0, 0.22) 62%, rgba(255, 215, 0, 0));
  pointer-events: none;
  animation: winnerGlow 2s ease-in-out infinite;
}

/* Still while the curtain comes down */
:where([data-styles~="results"]) .results.dropping .winner::before,
:where([data-styles~="results"]) .results.dropping .winner::after { animation-play-state: paused; }

:where([data-styles~="results"]) .winner span { position: relative; }

@keyframes winnerGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes winnerShine {
  to { transform: rotate(360deg); }
}

:where([data-styles~="results"]) .winner-card h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(30px, 8vw, 44px);
  line-height: 1.05;
  text-wrap: balance;
  overflow-wrap: anywhere;
  hyphens: auto;
}

:where([data-styles~="results"]) .winner-tag {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--on-dark-muted);
}

:where([data-styles~="results"]) .end-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

:where([data-styles~="results"]) .end-actions .btn { min-width: 140px; }

:where([data-styles~="results"]) .panel {
  padding: 18px 18px 8px;
}

:where([data-styles~="results"]) .panel h2 {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

:where([data-styles~="results"]) .panel-note {
  margin: 0 0 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

:where([data-styles~="results"]) .ranking, :where([data-styles~="results"]) .word-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

:where([data-styles~="results"]) .rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

:where([data-styles~="results"]) .rank-row:last-child, :where([data-styles~="results"]) .word-row:last-child { border-bottom: 0; }
:where([data-styles~="results"]) .rank-row.you { font-weight: 800; }

:where([data-styles~="results"]) .rank-row .place {
  min-width: 26px;
  flex: none;
  text-align: center;
  font-weight: 800;
}

:where([data-styles~="results"]) .rank-row .name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 🏁 for whoever got through every word first, which ended the round */
:where([data-styles~="results"]) .rank-row .finished { flex: none; }

/* At most half the row, so the name always has some: "20 pts · 10/10 solved" takes two lines on a narrow screen */
:where([data-styles~="results"]) .rank-row .stats {
  max-width: 50%;
  text-align: right;
  font-size: 14px;
  color: var(--on-dark-muted);
  font-variant-numeric: tabular-nums;
}

/* The narrowest screens (a phone zoomed in, or with the largest text): too narrow for that - the names were squeezed
   to nothing and the points ran off the screen, which then scrolled sideways. So the name has the first line, and the
   points (and the 🏁) go under it. */
@media (max-width: 300px) {
  :where([data-styles~="results"]) .rank-row { flex-wrap: wrap; row-gap: 2px; }
  :where([data-styles~="results"]) .rank-row .name { flex-basis: calc(100% - 80px); }
  :where([data-styles~="results"]) .rank-row .stats { flex: 1 1 0; max-width: none; }
}

/* Who got it first (or what it was worth) as wide as it needs, up to not quite half the row - a long name goes onto
   another line rather than squeezing the word. (Solo's results' rows; a room's fold open - below.) */
:where([data-styles~="results"]) .word-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(45%);
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* A long word on a narrow screen breaks onto another line rather than running into the time beside it */
:where([data-styles~="results"]) .word-row .word {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

:where([data-styles~="results"]) .word-row .scramble {
  grid-column: 1;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--on-dark-muted);
}

:where([data-styles~="results"]) .word-row .first {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  text-align: right;
  overflow-wrap: anywhere;
  font-size: 14px;
  color: var(--on-dark-muted);
}

:where([data-styles~="results"]) .word-row .first.none { opacity: 0.6; }

/* ---------- The podium: 5 or more in the round, the top 3 over their steps (results.js) ---------- */
:where([data-styles~="results"]) .podium {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  align-items: end;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 0;
  list-style: none;
}
:where([data-styles~="results"]) .podium[hidden] { display: none; }
:where([data-styles~="results"]) .podium-spot {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
:where([data-styles~="results"]) .podium-spot .avatar { width: 42px; height: 42px; font-size: 17px; }
:where([data-styles~="results"]) .podium-spot.p1 .avatar { width: 52px; height: 52px; font-size: 21px; box-shadow: 0 0 0 3px #facc15; }
:where([data-styles~="results"]) .podium-spot .name {
  max-width: 100%;
  margin-top: 2px;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:where([data-styles~="results"]) .podium-spot .stats { font-size: 13px; color: var(--on-dark-muted); font-variant-numeric: tabular-nums; }
:where([data-styles~="results"]) .podium-spot .add-mini { margin-top: 2px; }
:where([data-styles~="results"]) .podium-spot .step {
  width: 100%;
  margin-top: 4px;
  padding-top: 6px;
  display: grid;
  justify-items: center;
  align-content: start;
  border-radius: 10px 10px 4px 4px;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 900;
  font-size: 18px;
  color: var(--on-dark-muted);
}
:where([data-styles~="results"]) .podium-spot.p1 .step { height: 62px; background: rgba(250, 204, 21, 0.26); }
:where([data-styles~="results"]) .podium-spot.p2 .step { height: 44px; }
:where([data-styles~="results"]) .podium-spot.p3 .step { height: 30px; }
:where([data-styles~="results"]) .podium-spot.you .name { color: #c7d2fe; }

/* The rest of the standings, cut at 8th (and yours) in a big room: a gap before your row, and Show all */
:where([data-styles~="results"]) .rank-gap {
  padding: 2px 0;
  text-align: center;
  letter-spacing: 0.3em;
  color: var(--on-dark-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
:where([data-styles~="results"]) .rank-more { display: flex; justify-content: center; padding: 10px 0 8px; }
:where([data-styles~="results"]) .rank-more-btn {
  appearance: none;
  position: relative;
  padding: 7px 16px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
:where([data-styles~="results"]) .rank-more-btn::after { content: ""; position: absolute; inset: -6px 0; }
:where([data-styles~="results"]) .rank-more-btn:is(:active, .is-pressed) { scale: 0.96; }

/* ---------- The words: By word | By player, tabs that slide (/shared/tabs.js) ---------- */
:where([data-styles~="results"]) .words-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  --tabs-gap: 2px;
  margin: 4px 0 10px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-user-select: none;
  user-select: none;
}
:where([data-styles~="results"]) .words-tabs button {
  appearance: none;
  height: 36px;
  padding: 0 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--on-dark-muted);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
/* On the red curtain in either look: a white pill, its tab's words dark */
:where([data-styles~="results"]) .words-tabs { --tab-pill: #ffffff; }
:where([data-styles~="results"]) .words-tabs.tabs > [data-tab].is-lit { color: #1f1530; }
:where([data-styles~="results"]) .words-tabs .tabs-count { background: rgba(255, 255, 255, 0.14); color: var(--on-dark-muted); }
:where([data-styles~="results"]) .words-tabs.tabs > [data-tab].is-lit .tabs-count { background: rgba(31, 21, 48, 0.1); color: #1f1530; }
:where([data-styles~="results"]) .words-key { display: flex; flex-wrap: wrap; gap: 4px 14px; }
:where([data-styles~="results"]) .words-key span { display: inline-flex; align-items: center; gap: 6px; }

/* A word (or a player) folded to a line that opens what's under it with a tap */
:where([data-styles~="results"]) .word-row.fold { display: block; padding: 0; }
:where([data-styles~="results"]) .word-head {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 2px 12px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
:where([data-styles~="results"]) .word-head:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
:where([data-styles~="results"]) .word-head:is(:active, .is-pressed) { opacity: 0.75; }
/* A long word on a narrow screen breaks onto another line rather than running into the count beside it */
:where([data-styles~="results"]) .word-row.fold .word { min-width: 0; }
:where([data-styles~="results"]) .word-row.fold .scramble {
  margin-left: 8px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--on-dark-muted);
}
:where([data-styles~="results"]) .tally {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--on-dark-muted);
  font-variant-numeric: tabular-nums;
}
:where([data-styles~="results"]) .meter { width: 40px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
:where([data-styles~="results"]) .meter i { display: block; height: 100%; border-radius: inherit; background: #6ee7b7; }
html.colorblind :where([data-styles~="results"]) .meter i { background: var(--good-pale); }
:where([data-styles~="results"]) .chev {
  grid-column: 3;
  grid-row: 1 / span 2;
  width: 8px;
  height: 8px;
  justify-self: center;
  border-right: 2px solid var(--on-dark-muted);
  border-bottom: 2px solid var(--on-dark-muted);
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate 0.25s ease, translate 0.25s ease;
}
:where([data-styles~="results"]) .open > .word-head .chev { rotate: 225deg; translate: 0 2px; }
:where([data-styles~="results"]) .yours { grid-column: 1 / span 2; font-size: 13px; color: var(--on-dark-muted); }
:where([data-styles~="results"]) .yours b { font-weight: 800; letter-spacing: 0.04em; }
:where([data-styles~="results"]) .yours b.hit { color: #6ee7b7; }
html.colorblind :where([data-styles~="results"]) .yours b.hit { color: var(--good-pale); }
:where([data-styles~="results"]) .yours b.other { color: #fcd34d; }

/* Opening: what's under it slides open (a grid row from nothing to its height) */
:where([data-styles~="results"]) .fold-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.28s cubic-bezier(0.25, 1, 0.5, 1); }
:where([data-styles~="results"]) .open > .fold-body { grid-template-rows: 1fr; }
:where([data-styles~="results"]) .fold-in { min-height: 0; overflow: hidden; }
:where([data-styles~="results"]) .word-detail { display: grid; gap: 8px; padding: 0 0 12px; }
:where([data-styles~="results"]) .word-row .word-detail .first { grid-column: auto; grid-row: auto; margin: 0; text-align: left; font-size: 13px; color: var(--on-dark-muted); }

/* What everyone spelled: the word, its points, how many - and "only one" for a word just one player found - then their
   names as chips, you lit up */
:where([data-styles~="results"]) .made {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
:where([data-styles~="results"]) .made-line {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 13px;
  line-height: 1.35;
}
:where([data-styles~="results"]) .made-top { display: flex; align-items: baseline; gap: 8px; }
:where([data-styles~="results"]) .made-word { min-width: 0; font-weight: 800; letter-spacing: 0.06em; overflow-wrap: anywhere; }
:where([data-styles~="results"]) .made-pts { font-weight: 800; color: #6ee7b7; }
html.colorblind :where([data-styles~="results"]) .made-pts { color: var(--good-pale); }
/* Another word than the hidden one */
:where([data-styles~="results"]) .made-line.other .made-pts { color: #fcd34d; }
:where([data-styles~="results"]) .made-only {
  align-self: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fcd34d;
  color: #3b2a05;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
:where([data-styles~="results"]) .made-count { margin-left: auto; color: var(--on-dark-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
:where([data-styles~="results"]) .made-by { display: flex; flex-wrap: wrap; gap: 4px; }
:where([data-styles~="results"]) .name-chip {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
:where([data-styles~="results"]) .name-chip .avatar { flex: none; width: 18px; height: 18px; font-size: 9px; }
:where([data-styles~="results"]) .name-chip.you { background: rgba(99, 102, 241, 0.45); font-weight: 800; }
:where([data-styles~="results"]) .made-none { padding: 2px 2px; font-size: 13px; color: var(--on-dark-muted); }

/* By player: each player's round as ten squares, opened to the words themselves */
:where([data-styles~="results"]) .player-row .word-head { grid-template-columns: minmax(0, 1fr) auto 14px; }
:where([data-styles~="results"]) .player-row .who { min-width: 0; display: flex; align-items: center; gap: 8px; }
:where([data-styles~="results"]) .player-row .place { min-width: 18px; text-align: center; font-weight: 800; font-size: 13px; color: var(--on-dark-muted); font-variant-numeric: tabular-nums; }
:where([data-styles~="results"]) .player-row .avatar { flex: none; width: 26px; height: 26px; font-size: 12px; }
:where([data-styles~="results"]) .player-row .name { min-width: 0; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:where([data-styles~="results"]) .player-row .name small { display: block; font-weight: 500; font-size: 12px; color: var(--on-dark-muted); }
:where([data-styles~="results"]) .player-row.you .name { color: #c7d2fe; }
:where([data-styles~="results"]) .squares { display: flex; gap: 2px; }
:where([data-styles~="results"]) .sq { display: inline-block; width: 9px; height: 14px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
:where([data-styles~="results"]) .sq.hit { background: #34d399; }
html.colorblind :where([data-styles~="results"]) .sq.hit { background: var(--go-light); }
:where([data-styles~="results"]) .sq.other { background: #fbbf24; }
:where([data-styles~="results"]) .their-words {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
  padding: 0 0 12px;
  list-style: none;
}
:where([data-styles~="results"]) .their-words li {
  min-width: 0;
  padding: 6px 2px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-dark-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  overflow-wrap: anywhere;
}
:where([data-styles~="results"]) .their-words li.hit { background: rgba(52, 211, 153, 0.2); color: #6ee7b7; }
html.colorblind :where([data-styles~="results"]) .their-words li.hit { background: var(--good-tint); color: var(--good-pale); }
:where([data-styles~="results"]) .their-words li.other { background: rgba(251, 191, 36, 0.2); color: #fcd34d; }
@media (max-width: 340px) {
  :where([data-styles~="results"]) .sq { width: 7px; }
  :where([data-styles~="results"]) .their-words { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  :where([data-styles~="results"]) .fold-body, :where([data-styles~="results"]) .chev { transition: none; }
}
html.reduce-motion :where([data-styles~="results"]) :is(.fold-body, .chev) { transition: none; }

:where([data-styles~="results"]) .empty-note {
  padding: 10px 0 14px;
  color: var(--on-dark-muted);
}


/* ---------- The curtain (a room's results, results.js) ---------- */

/* Red velvet hung across the whole screen behind the results: folds catching the light, a little darker at the top,
   where the light doesn't reach, and at the foot, where the cloth gathers - and a gold fringe along the bottom */
:where([data-styles~="results"]) .results.curtain::before,
:where([data-styles~="results"]) .results.curtain::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  z-index: -1;
  pointer-events: none;
}

:where([data-styles~="results"]) .results.curtain::before {
  top: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 28%, rgba(255, 196, 140, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(24, 0, 6, 0.6) 0%, rgba(24, 0, 6, 0) 24%, rgba(24, 0, 6, 0) 66%, rgba(24, 0, 6, 0.62) 100%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.22) 0, rgba(0, 0, 0, 0) 46px, rgba(255, 255, 255, 0.04) 92px, rgba(0, 0, 0, 0) 138px, rgba(0, 0, 0, 0.22) 184px),
    repeating-linear-gradient(90deg, #4c0711 0, #840d1b 12px, #bb1829 25px, #dc2e3d 32px, #bb1829 39px, #840d1b 52px, #4c0711 64px);
}

:where([data-styles~="results"]) .results.curtain::after {
  bottom: 0;
  height: calc(14px + env(safe-area-inset-bottom, 0px));
  background:
    linear-gradient(#f7d774, #b8860b) top / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, #e9c25a 0 2px, rgba(184, 134, 11, 0.85) 2px 4px, transparent 4px 6px) bottom / 100% calc(100% - 5px) no-repeat;
}

/* The cards are a deep wine on the velvet, edged in gold */
:where([data-styles~="results"]) .results.curtain .winner-card,
:where([data-styles~="results"]) .results.curtain .panel {
  background: rgba(30, 4, 10, 0.6);
  border-color: rgba(247, 215, 116, 0.28);
}

/* While the curtain moves, the results are held to the screen, a screen tall, over everything else (results.js) */
:where([data-styles~="results"]) .results.pinned {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
}

/* Down over the round (dropCurtain in results.js), which stays up under it, frozen where it was (game-state.css) and
   darkening - bouncing to a stop, with a thump as it lands 58% of the way in (sfx.curtain). Back to the lobby, it goes up
   again (/shared/slide.js). */
:where([data-styles~="results"]) .results.dropping { animation: curtain-drop 1s both; }

:where([data-styles~="results"]) .game-state.held {
  display: block;
  animation: curtain-shade 1s ease-in both;
}

@keyframes curtain-drop {
  0% { transform: translateY(-100%); animation-timing-function: cubic-bezier(0.5, 0, 0.9, 0.5); }
  58% { transform: translateY(0); animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1); }
  72% { transform: translateY(-3.5%); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  84% { transform: translateY(0); animation-timing-function: cubic-bezier(0.2, 0.6, 0.4, 1); }
  92% { transform: translateY(-1%); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
  100% { transform: translateY(0); }
}

@keyframes curtain-shade { to { opacity: 0.35; } }


/* After a Heads-up between friends: the score between them (results.js), as solo's standing is said (solo.css) */
:where([data-styles~="results"]) .series-pill {
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--glass);
  font-weight: 800;
  font-size: 17px;
  line-height: 1.3;
  text-wrap: balance;
}
:where([data-styles~="results"]) .series-pill.great { background: var(--good-tint); color: var(--good-pale); }

/* Pulled past the top or the bottom by a finger (results.js): the cards follow it, by --results-pull, and spring back
   into place as it lets go (.pull-settle) - the curtain stays where it is behind them. By translate, so it goes along with
   whatever else moves them. */
:where([data-styles~="results"]) .results > * { translate: 0 var(--results-pull, 0px); }
:where([data-styles~="results"]) .results.pull-settle > * { transition: translate 0.5s cubic-bezier(0.25, 1, 0.5, 1); }

/* ...so the phone's own bounce is off here: a room's results (its screen's class is 'end' then - lobby.js) */
html:has(.page > .page-body.end[data-styles~="results"]) { overscroll-behavior-y: none; }

/* ---------- Christmas (html.xmas - /shared/christmas.js): the podium's steps are wrapped presents ---------- */

/* Each step a box with a ribbon down its middle, a lid over its top, a bow on that in the ribbon's color (results.js
   puts one on each step, always; it's only seen while the look is on) and its place on a round tag: red with gold for
   1st, green with pink for 2nd, blue with white for 3rd. A little taller than the plain steps, for the lid and the tag,
   and further under the points, for the bow.
   These are a drawing's colors, so they're the same in both looks. */
:where([data-styles~="results"]) .podium-spot .step-bow { display: none; }
html.xmas :where([data-styles~="results"]) .podium-spot .step {
  --box: #d8343f;
  --lid: #e8475a;
  --rib: #f6c445;
  position: relative;
  height: 70px;
  margin-top: 18px;
  padding-top: 15px;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(90deg, transparent 42%, var(--rib) 42% 58%, transparent 58%), var(--box);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.14);
}
html.xmas :where([data-styles~="results"]) .podium-spot.p2 .step { --box: #17905c; --lid: #1fa86c; --rib: #ff6f7d; height: 54px; }
html.xmas :where([data-styles~="results"]) .podium-spot.p3 .step { --box: #1c86d6; --lid: #3a9ee6; --rib: #ffffff; height: 44px; }
/* The lid: a band a little wider than the box, the ribbon carrying on over it */
html.xmas :where([data-styles~="results"]) .podium-spot .step::before {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 0;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent 42%, var(--rib) 42% 58%, transparent 58%), var(--lid);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
}
html.xmas :where([data-styles~="results"]) .podium-spot .step-bow {
  position: absolute;
  left: 50%;
  top: -15px;
  z-index: 1;
  display: block;
  width: 42px;
  translate: -50% 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
/* The place (or the 🏆) on a round white tag tied on the ribbon */
html.xmas :where([data-styles~="results"]) .podium-spot .step > b {
  position: relative;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 2px var(--box), 0 2px 4px rgba(0, 0, 0, 0.22);
  color: var(--box);
  font-size: 15px;
  line-height: 1;
}
