:root {
  color-scheme: light;
  font-family: system-ui, "Microsoft YaHei", sans-serif;
  color: #152438;
  background: #f2f6fa;
  --border: #d8e2ed;
  --blue: #1459ae;
  --muted: #4e627a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--blue); }
.wrap { width: min(1080px, calc(100% - 32px)); margin-inline: auto; }
.masthead { background: #10243d; color: white; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.masthead a { color: white; text-decoration: none; }
.brand { font-weight: 750; letter-spacing: .02em; }
.page-heading { margin: 32px 0 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(25px, 5.5vw, 37px); }
h2 { font-size: 22px; }
.page-heading p, #list-status, #detail-status, #room-players { color: var(--muted); line-height: 1.6; }
.page-heading p { margin-top: 8px; }
form { display: flex; gap: 8px; max-width: 590px; margin-bottom: 24px; }
input, button { font: inherit; min-height: 44px; border-radius: 8px; }
input { border: 1px solid var(--border); color: inherit; padding: 0 12px; min-width: 0; flex: 1; }
button { border: 1px solid var(--border); color: var(--blue); background: white; padding: 0 13px; cursor: pointer; }
button[type=submit] { color: white; background: var(--blue); border-color: var(--blue); white-space: nowrap; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.rooms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 12px; }
#list-status { margin: 0 0 10px; }
.room, .score-card { background: white; border: 1px solid var(--border); border-radius: 12px; }
.room { display: block; text-decoration: none; color: inherit; padding: 16px; }
.room:hover { border-color: var(--blue); }
.room-heading, .detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge { background: #e3f5eb; color: #156445; padding: 3px 8px; border-radius: 6px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge.done { background: #e9eef4; color: #495d73; }
.room p { color: var(--muted); line-height: 1.5; margin-top: 9px; overflow-wrap: anywhere; }
.room mark { background: #e3edff; color: #154a90; border-radius: 3px; padding-inline: 2px; }
#pages { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 18px 0; }
.back { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.score-card { padding: 16px; margin-bottom: 24px; }
#room-players, #detail-status { margin-top: 8px; overflow-wrap: anywhere; }
.score-scroll { margin-top: 12px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 8px; border-bottom: 1px solid var(--border); }
th { font-size: 13px; white-space: nowrap; color: var(--muted); background: #f2f6fa; }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
td:nth-child(2) { min-width: 100px; overflow-wrap: anywhere; }
td:nth-child(3) { font-weight: 750; }
.team { display: inline-block; margin-inline-end: 5px; font-size: 12px; white-space: nowrap; }
.red { color: #a52138; }
.blue { color: #1459ae; }
@media (max-width: 520px) {
  .page-heading { margin-top: 22px; }
  .score-card { padding: 12px; }
  th, td { padding-inline: 6px; }
}
