:root {
  color-scheme: dark;
  --page: #0c1b14;
  --panel: #13271d;
  --line: #335143;
  --text: #fff7e8;
  --muted: #bbccbf;
  --gold: #ffdc91;
  font-family: system-ui, sans-serif;
  color: var(--text);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; }

.shell {
  width: min(70rem, calc(100% - 4rem));
  margin-inline: auto;
}

.masthead { border-bottom: 1px solid var(--line); }

.wordmark {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 4.25rem;
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.wordmark span { color: var(--gold); font-size: 1.4rem; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  min-height: 22rem;
  margin-top: 2.5rem;
  padding: 2.75rem clamp(1.75rem, 5vw, 4.5rem);
  overflow: hidden;
  border: 1px solid #855d5c;
  border-radius: 1.25rem;
  background: radial-gradient(ellipse at 90% 0, #78382d, transparent 58%), #522327;
}

h1, h2 { margin: 0; font: 500 2rem / 1.1 Georgia, serif; }

h1 {
  font-size: clamp(3.2rem, 8vw, 6rem);
  letter-spacing: -.065em;
  line-height: .92;
}

.hero p { margin: 1.4rem 0 0; color: #f0d9c9; line-height: 1.5; }

.decoration {
  position: relative;
  justify-self: center;
  width: min(100%, 16rem);
  height: 15rem;
  color: var(--gold);
}

.spark { position: absolute; line-height: 1; }
.spark-large { top: 2%; right: 1%; font-size: 3rem; }
.spark-top { top: 19%; left: 6%; font-size: 1.4rem; }
.spark-bottom { right: 0; bottom: 8%; font-size: 1.2rem; }

.gift {
  position: absolute;
  left: 19%;
  bottom: 14%;
  width: 62%;
  height: 45%;
  border: 1px solid #ffdf9f;
  border-radius: .35rem;
  background: linear-gradient(125deg, #ffdf9f, #c88942);
  box-shadow: .85rem 1.15rem 0 #3717176b;
  transform: rotate(-12deg);
}

.gift::before {
  position: absolute;
  z-index: 1;
  inset: -.4rem -.45rem auto;
  height: 1.25rem;
  border: 1px solid #ffe8bd;
  border-radius: .25rem;
  background: #f6cf83;
  content: "";
}

.ribbon {
  position: absolute;
  z-index: 2;
  inset: -.4rem 42% -1px;
  background: #832f39;
}

.bow { position: absolute; inset: -.4rem 50% auto auto; }

.bow::before, .bow::after {
  position: absolute;
  bottom: 0;
  width: 2.85rem;
  height: 1.8rem;
  border: .32rem solid #e8797a;
  border-radius: 48% 61% 20% 52%;
  content: "";
}

.bow::before { right: 0; transform: rotate(21deg); transform-origin: right bottom; }
.bow::after { left: 0; transform: scaleX(-1) rotate(21deg); transform-origin: left bottom; }

.board {
  margin-block: 1.5rem 4rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel);
}

.board-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .9rem;
  padding: 1.35rem clamp(1rem, 4vw, 2rem);
}

.refresh {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: .45rem 1rem;
  border: 1px solid #637e6d;
  border-radius: .5rem;
  color: var(--text);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}

.refresh:hover { background: #254336; }
.refresh:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: .85rem .75rem;
  border-top: 1px solid var(--line);
  text-align: left;
}

th:first-child, td:first-child { padding-left: clamp(1rem, 4vw, 2rem); }
th:last-child, td:last-child { padding-right: clamp(1rem, 4vw, 2rem); text-align: right; }
th[scope="col"] { color: var(--muted); font-size: .875rem; font-weight: 600; }
th[scope="row"] { width: 100%; font-weight: 650; overflow-wrap: anywhere; }
th:last-child { white-space: nowrap; }

tbody tr:first-child { background: #26382a; }

.rank {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #233d30;
  font-variant-numeric: tabular-nums;
}

tbody tr:first-child .rank { background: var(--gold); color: #321f0a; font-weight: 750; }
.points { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }

.empty, .board-footer {
  margin: 0;
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.5;
}

.empty { padding-block: 2.5rem; }
.board-footer { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .875rem; }
.delayed { color: var(--gold); }

.collection-list { list-style: none; margin: 0; padding: 0; }

.collection-list li {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: .85rem;
  padding: .85rem clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
}

.collection-player, .collection-result { display: grid; gap: .25rem; }
.collection-player { min-width: 0; overflow-wrap: anywhere; }
.collection-result { flex-shrink: 0; text-align: right; }
.collection-player span, .collection-result time { color: var(--muted); font-size: .875rem; }
.collection-delta { font-weight: 650; }
.collection-delta.gain { color: var(--gold); }
.collection-delta.loss { color: #ffb6af; }

@media (max-width: 45rem) {
  .shell { width: calc(100% - 2rem); }
  .hero { min-height: 17rem; margin-top: 1.25rem; }
  .decoration { height: 10rem; }
}

@media (max-width: 32rem) {
  .hero {
    position: relative;
    grid-template-columns: 1fr;
    align-items: end;
    min-height: 15rem;
    padding: 1.45rem 1.25rem;
  }
  .hero-copy { position: relative; z-index: 1; }
  .decoration { position: absolute; inset: .4rem .5rem auto auto; width: 5.4rem; height: 6rem; }
  .spark-large { font-size: 1.6rem; }
  .spark-top, .spark-bottom { font-size: .8rem; }
  .gift { box-shadow: .3rem .4rem 0 #3717176b; }
  .gift::before { inset: -.2rem -.18rem auto; height: .55rem; }
  .ribbon { top: -.2rem; }
  .bow { top: -.2rem; }
  .bow::before, .bow::after { width: .9rem; height: .65rem; border-width: .14rem; }
  th, td { padding-inline: .4rem; }
}
