:root {
  color-scheme: light;
  --bg: #f7f5fb;
  --panel: #fff;
  --line: #e6e0ee;
  --muted: #655f73;
  --text: #252137;
  --accent: #62478e;
  --accent-wash: #eee7f7;
  --jade: #345d55;
  --shadow: 0 12px 36px #3823510b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 12% 5%, #fff9f3, transparent 38rem), var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.frame { max-width: 1136px; margin-inline: auto; padding-inline: 24px; }
.bar { border-bottom: 1px solid var(--line); background: #ffffffbf; }
.top { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 760; }
.brand-logo { display: block; object-fit: contain; }
.cup { color: var(--accent); }
.admin-link, .jump a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
}
.admin-link:hover, .jump a:hover { background: var(--accent-wash); color: var(--accent); }

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow: hidden;
  min-height: 220px;
  margin: 26px 0 16px;
  padding: 24px 8% 24px 38px;
  border: 1px solid #e8e0ef;
  border-radius: 24px;
  background: radial-gradient(ellipse at 84% 6%, #e4d9f5, transparent 62%),
    linear-gradient(113deg, #fffaf3, #f8f1f8 58%, #f0eaf8);
  box-shadow: var(--shadow);
}
.hero-copy { position: relative; z-index: 1; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.signal { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #8a6bb0; }
.hero h1 { margin: 7px 0 0; font-size: clamp(40px, 7vw, 66px); line-height: 1.08; letter-spacing: -.05em; }
.hero em { color: var(--accent); font-style: normal; letter-spacing: 0; }
.hero p { margin: 10px 0 0; color: var(--muted); }
.hero-art {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex: 0 0 150px;
  aspect-ratio: 1;
  border: 1px solid #fff;
  border-radius: 38px;
  background: linear-gradient(145deg, #fff, #f9f5fe);
  box-shadow: 0 14px 38px #5a3b8021, 0 0 0 13px #ffffff50;
}
.hero-art img { display: block; width: 70%; height: auto; object-fit: contain; }

.stages { display: flex; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.stages a { flex: 1; padding: 10px 3px; border-radius: 10px; color: var(--muted); text-align: center; font-weight: 650; }
.stages a span:not(.stage-label) { margin-right: 8px; font: 12px ui-monospace, monospace; }
.stages a:hover { background: #f7f3fa; }
.stages [aria-current=page] { background: var(--accent-wash); color: var(--accent); }
.section-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.section-head h2 { margin: 0; font-size: 23px; }
.section-head p, .muted { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.jump { display: flex; gap: 7px; }

.group, .upcoming {
  margin: 0 0 17px;
  overflow: hidden;
  scroll-margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.group h3 { margin: 0; font-size: 17px; }
.group h3 span { margin-left: 10px; color: var(--muted); font-size: 13px; font-weight: 500; }
.time-pending { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.scoring-rules { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); font-size: 13px; }
.scoring-rules h2 { margin: 0; color: var(--accent); font-size: 17px; }
.scoring-rules p, .scoring-rules ol { margin: 8px 0; }
.progress { padding: 3px 9px; border-radius: 999px; background: #e9f4ee; color: var(--jade); font-size: 12px; white-space: nowrap; }
.scroller { overflow-x: auto; }
.scroller:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; border-bottom: 1px solid #eeeaf3; text-align: center; }
thead { --row-bg: #f6f2fa; background: var(--row-bg); color: var(--muted); font-size: 12px; }
tbody tr { --row-bg: var(--panel); background: var(--row-bg); }
tbody tr:nth-child(even) { --row-bg: #fbf9fd; }
tbody tr:hover { --row-bg: #f6f2fa; }
tbody tr:last-child td { border-bottom: 0; }
.who, .game-id { text-align: left; }
.who { padding-left: 16px; font-weight: 700; }
.game-id { color: var(--muted); font-size: 13px; }
.total { background: #eee7f7; color: var(--accent); font-weight: 750; }
.missing { color: #736b80; }
.stream a { color: var(--jade); font-weight: 650; }
.stream a:hover { text-decoration: underline; }

.upcoming { width: 100%; padding: 36px 20px; text-align: center; }
.upcoming h2 { margin: 0 0 6px; font-size: 24px; }
.upcoming p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.actions output { color: var(--jade); font-size: 13px; }
input { padding: 6px; border: 1px solid #cfc4de; border-radius: 7px; background: #fff; color: var(--text); font: inherit; }
.points { width: 52px; text-align: center; }
.url { width: 205px; }
button { padding: 7px 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
.check-in, .check-in-label { display: inline-block; min-width: 62px; padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.check-in { border: 1px solid var(--line); background: var(--accent-wash); color: var(--accent); }
.check-in-label { color: var(--muted); }
.check-in[aria-pressed=true], .check-in-label.checked { background: #e9f4ee; color: var(--jade); }
.foot { display: flex; justify-content: space-between; gap: 12px; padding-block: 16px 28px; color: var(--muted); font-size: 12px; }

@media (max-width: 620px) {
  .frame { padding-inline: 13px; }
  .hero { min-height: 162px; margin-top: 15px; padding: 20px 18px; gap: 8px; }
  .hero-art { flex-basis: clamp(61px, 19vw, 98px); border-radius: 21px; box-shadow: 0 8px 22px #5a3b801a, 0 0 0 5px #ffffff50; }
  .stages a span:not(.stage-label) { margin-right: 5px; }
  .group-head { padding-inline: 11px; }
  .group h3 span { margin-left: 7px; }
  .who { position: sticky; left: 0; z-index: 1; max-width: 145px; overflow: hidden; background: var(--row-bg); box-shadow: 1px 0 var(--line); text-overflow: ellipsis; }
}

.final-status { color: var(--muted); font-size: 12px; }
.final-match-point { color: var(--accent); font-weight: 700; }
.final-champion { color: var(--jade); font-weight: 750; }
