:root {
  color-scheme: dark;
  --bg: #0f1421;
  --surface: #181f30;
  --raised: #212a3d;
  --line: #333d52;
  --ink: #f1f1f3;
  --muted: #a7b0c1;
  --gold: #e8c785;
  --blue: #8eb9ff;
  --red: #ffa494;
  font:
    16px/1.5 'Segoe UI',
    'Microsoft YaHei',
    'PingFang SC',
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at top, #222d43 0, transparent 60vh), var(--bg);
  color: var(--ink);
  min-height: 100dvh;
}
button,
a,
input,
select {
  font: inherit;
}
a {
  color: var(--gold);
  text-underline-offset: 3px;
}
button {
  cursor: pointer;
  color: var(--ink);
  border: 1px solid #414b60;
  border-radius: 6px;
  padding: 0.44rem 0.82rem;
  background: var(--raised);
  transition:
    background 0.14s,
    border-color 0.14s;
}
button:hover:not(:disabled) {
  background: #303c51;
  border-color: #8795ab;
}
button:disabled {
  opacity: 0.49;
  cursor: default;
}
input,
select {
  min-width: 0;
  border: 1px solid #414b60;
  background: #111827;
  color: var(--ink);
  border-radius: 6px;
  padding: 0.55rem 0.66rem;
}
input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
button.primary {
  background: var(--gold);
  border: 1px solid #e8cf9d;
  color: #221e18;
  font-weight: 700;
}
button.primary:hover:not(:disabled) {
  background: #f2d9a5;
  border-color: #ffe6ba;
}
input::placeholder {
  color: #929db1;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(1.7rem, 3.6vw, 3rem);
  line-height: 1.15;
}
h2 {
  font-size: 1.19rem;
}
h3 {
  font-size: 1rem;
}
small,
.muted {
  color: var(--muted);
  font-size: 0.82rem;
}
label {
  font-size: 0.9rem;
  color: #c7cedc;
}
em,
i {
  font-style: normal;
}
button,
a {
  touch-action: manipulation;
}
.wide {
  width: 100%;
  margin-top: 5px;
}
.loading {
  padding: 10vh 7vw;
}
.empty {
  color: var(--muted);
  padding: 24px 0;
  line-height: 1.8;
}
.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #333a4e;
  background: #0f1522d9;
  padding: 0 max(20px, calc((100vw - 1480px) / 2));
  white-space: nowrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f1e6cf;
  background: none;
  border: 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 650;
}
.brand:hover:not(:disabled) {
  background: none;
}
.brand > b {
  font:
    700 1.28rem/1 'KaiTi',
    'SimSun',
    serif;
  width: 31px;
  height: 33px;
  border: 1px solid #b19865;
  color: var(--gold);
  display: grid;
  place-items: center;
  outline: 1px solid #685b45;
  outline-offset: -4px;
}
.brand em {
  color: #83765f;
  padding: 0 3px;
}
.top-right,
.row-actions,
.round-links,
.auth-tabs,
.unit-tabs {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.quiet,
.text-link {
  background: none;
  border: 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.86rem;
}
.network {
  font-size: 0.75rem;
  color: #b1cbbd;
}
.network:before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
}
.top-right {
  gap: 16px;
}
.text-link {
  padding: 12px 0 0;
  color: var(--gold);
}
.auth-wrap {
  max-width: 1200px;
  margin: clamp(30px, 9vh, 110px) auto;
  display: grid;
  grid-template-columns: 1.4fr minmax(340px, 1fr);
  padding: 0 24px;
}
.auth-art,
.hall-hero {
  background-image: linear-gradient(80deg, #09131cdb, #10152318), url('/assets/battlefield.jpg');
  background-size: cover;
  background-position: 58% center;
}
.auth-art {
  min-height: 505px;
  display: flex;
  align-items: flex-end;
  border: 1px solid #3f444e;
  border-right: 0;
  border-radius: 13px 0 0 13px;
  padding: clamp(26px, 4vw, 56px);
}
.auth-art h1 {
  font-family: 'KaiTi', 'STKaiti', 'SimSun', serif;
  letter-spacing: 0.09em;
  font-size: clamp(2.8rem, 5.5vw, 5.2rem);
  color: #fff4dc;
  margin: 0.38em 0;
  line-height: 1.13;
  text-shadow: 0 2px 14px #101218;
}
.auth-art p {
  color: #f2cf8b;
  letter-spacing: 0.16em;
  font-weight: 600;
}
.auth-art span {
  color: #e0d9cb;
  font-size: 0.9rem;
}
.auth-panel {
  background: #192131;
  border: 1px solid var(--line);
  border-radius: 0 13px 13px 0;
  padding: clamp(22px, 3.7vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-panel h2 {
  font-size: 1.6rem;
  margin-bottom: 18px;
}
.auth-tabs {
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.auth-tabs button,
.unit-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
}
.auth-tabs button.on,
.unit-tabs button.on {
  color: var(--gold);
  box-shadow: inset 0 -2px var(--gold);
}
form label,
fieldset label,
#dialog-body > label {
  display: grid;
  gap: 5px;
}
.auth-panel form {
  display: grid;
  gap: 13px;
}
.auth-panel input {
  width: 100%;
}
.inline-input {
  display: flex;
  gap: 6px;
}
.inline-input button {
  white-space: nowrap;
  font-size: 0.82rem;
}
.auth-panel .text-link {
  align-self: flex-start;
}
.lobby,
.room,
footer {
  max-width: 1480px;
  margin: auto;
  padding: 20px clamp(12px, 2vw, 30px);
}
.lobby {
  max-width: 1200px;
  padding-top: 32px;
}
.hall-hero,
.waiting-panel,
.settled,
.hall-list,
.scoreboard,
.team-panel,
.pool-panel {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hall-hero {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 30px 34px;
  background-position: 50% 63%;
}
.hall-hero h1 {
  color: #fff2d7;
}
.hall-hero p {
  color: #e0d9ca;
  margin-top: 10px;
}
.hall-hero i {
  padding: 0 6px;
  color: var(--gold);
}
.hall-list {
  margin-top: 18px;
  padding: 18px 20px;
}
.section-head,
.room-line,
.side-title,
.side-list label,
.report-summary,
.subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.section-head form,
.room-line > div,
#nick-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-head input {
  width: 135px;
}
.room-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 0.75fr 0.65fr auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.room-row:first-of-type {
  margin-top: 12px;
}
.room-row small,
.history-item small {
  display: block;
}
.room-row b,
.room-row strong,
.side-title b {
  overflow-wrap: anywhere;
}
.room-line {
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.room-exit {
  color: #ffc5ba;
  border-color: #895456;
  background: #34252f;
}
.exit-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }
.room-exit-notice { padding:8px 2px; }
.room-exit-notice p { margin:8px 0 16px; color:var(--muted); }
.recycle-note { margin:0 0 10px; color:var(--muted); text-align:center; font-size:.87rem; }
#recycle-clock { color:var(--gold); font-variant-numeric:tabular-nums; margin-inline:4px; }
.room-line button,
.round-links button,
footer button {
  font-size: 0.8rem;
  padding: 4px 9px;
}
.room-line span {
  font-size: 0.8rem;
  color: var(--muted);
}
.room-line b {
  font-size: 0.91rem;
}
.waiting-panel,
.settled {
  padding: clamp(22px, 4vw, 54px);
  max-width: 900px;
  margin: 30px auto;
}
.waiting-panel > p,
.settled > span {
  color: var(--muted);
  margin: 9px 0 18px;
}
.wait-seats {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin: 22px 0;
}
.wait-seats > b {
  font: italic bold 1.7rem Georgia;
}
.wait-seat {
  background: #1d283b;
  border: 1px solid #39465a;
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  padding: 20px 8px;
}
.blue {
  --accent: var(--blue);
}
.red {
  --accent: var(--red);
}
.wait-seat h2 {
  margin: 8px 0;
  color: var(--accent);
}
.wait-seat small,
.wait-seat span {
  color: var(--muted);
  font-size: 0.8rem;
}
.row-actions {
  justify-content: center;
}
.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 12px 16px;
  background: linear-gradient(100deg, #1b2a42, #181d2c 43%, #181d2c 60%, #38272d);
}
.score-team {
  display: grid;
  gap: 2px;
  color: var(--accent);
}
.score-team b {
  font-size: clamp(1rem, 1.6vw, 1.5rem);
}
.score-team span,
.score-center small {
  font-size: 0.77rem;
}
.score-center {
  display: grid;
  justify-items: center;
  gap: 0;
}
.score-center strong,
.final-score {
  font:
    700 2rem/1.25 Georgia,
    serif;
  color: #f3e7cc;
}
.score-center i {
  color: #a9a8ad;
}
.score-center span {
  font-size: 0.85rem;
  color: var(--gold);
}
.time-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 670px;
  margin: 13px auto;
  color: #bac6d6;
  font-size: 0.81rem;
}
[data-warning="warning"] { --clock-color: #edab58; }
[data-warning="urgent"] { --clock-color: #ff7479; }
#tactic-clock, #formation-clock { color: var(--clock-color, var(--gold)); }
.time-row progress {
  flex: 1;
  min-width: 0;
  accent-color: var(--clock-color, #739ffa);
  height: 8px;
}
.time-row b {
  color: var(--clock-color, #e6d5ae);
  min-width: 5ch;
  font-variant-numeric: tabular-nums;
}
.arena-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.68fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}
.team-panel,
.pool-panel {
  min-width: 0;
  padding: 14px;
}
.team-panel {
  border-top: 3px solid var(--accent);
}
.side-title {
  color: var(--accent);
  margin-bottom: 12px;
}
.side-title span {
  font-weight: 700;
}
.side-title b {
  font-size: 0.88rem;
  color: var(--ink);
}
.slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.slot {
  text-align: center;
}
.slot > small {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 4px;
}
.hero-card,
.pool-card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  background: #232c40;
  border: 1px solid #4a4651;
  border-radius: 5px;
  width: 100%;
  aspect-ratio: 0.68;
}
.hero-card img,
.pool-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-card b,
.pool-card span {
  position: absolute;
  inset: auto 0 0;
  color: #fff4df;
  background: linear-gradient(transparent, #0e1220ed 60%);
  padding: 14px 2px 4px;
  text-align: center;
  font-size: 0.86rem;
}
.hero-card i,
.pool-card i {
  position: absolute;
  top: 0;
  left: 0;
  background: #19202bd9;
  color: #f2ddab;
  padding: 0 3px;
  font:
    700 0.85rem/1.4 'SimSun',
    serif;
}
.hero-card.blank {
  display: grid;
  place-items: center;
  font: 1.2rem Georgia;
  color: #8896aa;
  border: 1px dashed #454e63;
}
.config-btn {
  margin: 10px 0;
  width: 100%;
  font-size: 0.78rem;
}
.side-list {
  border-top: 1px solid var(--line);
  padding: 9px 0;
  font-size: 0.8rem;
}
.side-list label {
  font-size: 0.8rem;
  color: #b7c7db;
}
.side-list em {
  font:
    0.75rem Consolas,
    monospace;
}
.side-list p {
  font-size: 0.79rem;
  color: var(--muted);
  margin-top: 3px;
}
.pool-tools {
  display: flex;
  gap: 5px;
  margin: 10px 0;
  flex-wrap: wrap;
}
.pool-tools input,
.pool-tools select {
  font-size: 0.79rem;
  padding: 5px 6px;
}
.pool-tools input {
  flex: 1 1 120px;
}
.pool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(77px, 1fr));
  gap: 6px;
  align-content: start;
  max-height: 53vh;
  overflow: auto;
  scrollbar-color: #475168 transparent;
  padding: 2px;
}
.pool-cards .empty {
  grid-column: 1/-1;
}
.pool-card {
  aspect-ratio: 0.65;
}
.pool-card span {
  line-height: 1.2;
  padding-bottom: 5px;
}
.pool-card small {
  display: block;
  color: #e0ceb1;
  font-size: 0.62rem;
  margin-top: 2px;
}
.pool-card em {
  position: absolute;
  right: 1px;
  top: 2px;
  background: #172523da;
  color: #daeedc;
  border-radius: 3px;
  padding: 1px 3px;
  font-size: 0.59rem;
}
.pool-card.off img {
  filter: grayscale(0.95) brightness(0.53);
}
.pool-card.off em {
  color: #efc1b8;
  background: #2d1d21;
}
.pool-card.past em {
  color: #ecd498;
  background: #30291e;
}
.compact {
  font-size: 0.77rem;
  padding: 3px 6px;
}
.round-links {
  justify-content: center;
  margin: 12px 0;
}
.prep {
  text-align: center;
  padding: 24px 14px;
}
.prep-actions {
  justify-content: center;
}
.battle-versus {
  display: grid;
  place-items: center;
  min-height: 180px;
  text-shadow: 0 0 18px #739ffa;
  font: italic 800 2.5rem Georgia, serif;
}
@media (prefers-reduced-motion: no-preference) {
  .battle-versus b {
    animation: battle-glow 2.4s ease-in-out infinite alternate;
  }
}
@keyframes battle-glow {
  from { text-shadow: 0 0 6px #739ffa66; }
  to { text-shadow: 0 0 22px #739ffabb; }
}
.settled {
  text-align: center;
}
.settled h1 {
  margin: 9px 0;
}
.final-score {
  font-size: 3rem;
  margin-bottom: 18px;
}
.settled .row-actions {
  margin-top: 16px;
}
.list-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  margin-top: 6px;
  font-size: 0.85rem;
}
.blue-text {
  color: var(--blue);
}
.red-text {
  color: var(--red);
}
footer {
  display: flex;
  justify-content: center;
  gap: 19px;
  align-items: center;
  color: var(--muted);
  font-size: 0.77rem;
}
footer a,
footer button {
  background: none;
  color: inherit;
  border: 0;
  text-decoration: none;
}
dialog {
  color: var(--ink);
  background: #192131;
  border: 1px solid #465066;
  box-shadow: 0 20px 100px #0008;
  border-radius: 12px;
  padding: 0;
  width: min(490px, calc(100vw - 22px));
  max-height: 91dvh;
  overflow: auto;
}
dialog.large {
  width: min(790px, calc(100vw - 18px));
}
dialog::backdrop {
  background: #050914bc;
  backdrop-filter: blur(3px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 17px;
  background: #1b2334;
  border-bottom: 1px solid var(--line);
}
.modal-head button {
  width: 32px;
  height: 32px;
  padding: 0;
  font: 1.45rem/1 sans-serif;
}
#dialog-body {
  padding: 15px 17px 20px;
}
#dialog-body > p {
  margin: 0 0 10px;
}
#notice {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 92vw;
  background: #332b1d;
  color: #ffebbf;
  border: 1px solid #ab8f55;
  padding: 9px 17px;
  border-radius: 7px;
  z-index: 30;
  box-shadow: 0 4px 18px #0005;
  font-size: 0.87rem;
}
.general-detail,
.form-hero {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 13px;
}
.general-detail img {
  width: 32%;
  border-radius: 4px;
}
.form-hero img {
  width: 62px;
  border-radius: 4px;
}
.general-detail p,
.form-hero p,
.subhead small,
.build-info small {
  color: var(--muted);
  font-size: 0.8rem;
}
.unit-tabs {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.unit-tabs button {
  font-size: 0.8rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
}
.form-grid input,
.form-grid select {
  width: 100%;
  font-size: 0.84rem;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  min-width: 0;
}
.subhead {
  font-size: 0.86rem;
  margin: 10px 0 5px;
}
.points {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.points input {
  width: 100%;
}
.checks {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  margin-top: 8px;
}
.checks label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.79rem;
}
.record-line {
  display: flex;
  gap: 18px;
  color: var(--gold);
}
#nick-form {
  margin: 12px 0;
  align-items: end;
}
.history-item,
.build-info {
  border-top: 1px solid var(--line);
  padding: 9px 0;
}
.history-item button {
  font-size: 0.75rem;
  padding: 3px 7px;
  margin: 5px 4px 0 0;
}
.journal {
  padding-left: 21px;
  margin: 0;
}
.journal li {
  font-size: 0.88rem;
  margin: 7px 0;
  color: #c3ccda;
}
.report-summary {
  background: #232b3e;
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 10px;
}
.report-summary b {
  color: var(--gold);
}
.report-summary span {
  font-size: 0.8rem;
}
.report-teams {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.build-info > * {
  display: block;
}
.build-info span,
.report-teams details {
  font-size: 0.76rem;
  color: #c0ccdc;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 0.75rem;
}
th,
td {
  padding: 4px 2px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
th:first-child {
  text-align: left;
}
.combat-log {
  margin-top: 16px;
}
summary {
  color: var(--gold);
  cursor: pointer;
}
.combat-log pre {
  background: #101726;
  padding: 11px;
  max-height: 46vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font:
    0.76rem/1.65 Consolas,
    'Microsoft YaHei',
    monospace;
}
@media (max-width: 920px) {
  .arena-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'blue red' 'center center';
  }
  .team-panel.blue {
    grid-area: blue;
  }
  .team-panel.red {
    grid-area: red;
  }
  .pool-panel {
    grid-area: center;
  }
  .slots {
    max-width: 270px;
    margin: auto;
  }
  .pool-cards {
    max-height: 430px;
  }
  .auth-wrap {
    grid-template-columns: 1fr 1fr;
  }
  .topbar {
    padding: 0 15px;
  }
  .room-row {
    grid-template-columns: 1fr 1fr 1fr auto;
  }
  .room-row > div:nth-child(4),
  .room-row > div:nth-child(5) {
    grid-row: 2;
  }
  .room-row button {
    grid-column: 4;
    grid-row: 1/3;
  }
}
@media (max-width: 620px) {
  .topbar {
    height: 53px;
    padding: 0 10px;
  }
  .top-right {
    gap: 2px;
  }
  .brand {
    font-size: 0.83rem;
    gap: 6px;
  }
  .brand > b {
    width: 25px;
    height: 26px;
    font-size: 1rem;
  }
  .network {
    font-size: 0.64rem;
  }
  .quiet {
    font-size: 0.76rem;
    padding: 4px;
  }
  .auth-wrap {
    display: block;
    padding: 0 12px;
    margin: 15px auto;
  }
  .auth-art {
    min-height: 155px;
    padding: 16px 21px;
    border-radius: 9px 9px 0 0;
    border-right: 1px solid var(--line);
    background-position: 65% center;
  }
  .auth-art h1 {
    font-size: 1.85rem;
    margin: 0.22em 0;
  }
  .auth-art h1 br {
    display: none;
  }
  .auth-art span,
  .auth-art p {
    font-size: 0.73rem;
  }
  .auth-panel {
    border-radius: 0 0 9px 9px;
    padding: 19px;
  }
  .auth-panel h2 {
    font-size: 1.23rem;
  }
  .lobby,
  .room {
    padding: 10px 8px;
  }
  .hall-hero {
    min-height: 120px;
    padding: 16px;
  }
  .hall-hero h1 {
    font-size: 1.65rem;
  }
  .hall-hero p {
    font-size: 0.78rem;
  }
  .hall-list {
    padding: 12px 9px;
  }
  .hall-list .section-head {
    flex-wrap: wrap;
  }
  .room-row {
    gap: 6px;
    font-size: 0.79rem;
  }
  .room-row button {
    padding: 4px 6px;
  }
  .room-row small {
    font-size: 0.68rem;
  }
  .section-head h2 {
    font-size: 1rem;
  }
  .room-line {
    gap: 6px;
  }
  .room-line > div {
    gap: 5px;
  }
  .room-line span,
  .room-line button {
    font-size: 0.69rem;
  }
  .room-line b {
    font-size: 0.77rem;
  }
  .scoreboard {
    padding: 8px 5px;
  }
  .score-center strong {
    font-size: 1.58rem;
  }
  .score-team span,
  .score-center small {
    font-size: 0.65rem;
  }
  .score-center span {
    font-size: 0.73rem;
  }
  .arena-grid {
    gap: 6px;
  }
  .team-panel,
  .pool-panel {
    padding: 8px;
  }
  .side-title,
  .slots {
    gap: 3px;
  }
  .side-title {
    margin-bottom: 6px;
  }
  .side-title span,
  .side-title b {
    font-size: 0.78rem;
  }
  .hero-card b {
    font-size: 0.65rem;
    padding-bottom: 2px;
  }
  .slot > small,
  .side-list label,
  .side-list p,
  .config-btn {
    font-size: 0.66rem;
  }
  .config-btn {
    padding: 4px;
    margin: 5px 0;
  }
  .side-list {
    padding: 4px 0;
  }
  .pool-cards {
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
    gap: 4px;
  }
  .time-row {
    margin: 7px 4px;
  }
  .wait-seats {
    grid-template-columns: 1fr 26px 1fr;
    gap: 5px;
  }
  .wait-seat {
    padding: 13px 5px;
  }
  .waiting-panel,
  .settled {
    margin: 12px 0;
    padding: 20px 12px;
  }
  .report-teams {
    grid-template-columns: 1fr;
  }
  .report-link {
    font-size: 0.72rem;
  }
  .points {
    gap: 4px;
  }
  .room-line > div {
    flex-wrap: wrap;
  }
  .form-grid {
    gap: 6px;
  }
  .modal-head,
  #dialog-body {
    padding: 10px;
  }
  .form-grid label,
  fieldset label {
    font-size: 0.79rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
#dialog-notice {
  color: var(--gold);
  margin: 10px 16px;
  font-size: 0.86rem;
}

.progress-title { margin: 12px 0 6px; font-weight: 600; }
.round-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(65px,100%),1fr)); gap: 4px; }
.round-card { display: grid; gap: 3px; padding: 4px 2px; min-width: 0; text-align: center; }
.round-card:disabled { opacity: .78; }
.round-card small { font-size: 11px; }
.round-card.won { border: 2px solid #cfab55; color: #f0d68e; }
.round-card.lost { border: 2px solid #833d45; color: #e9a8a8; }
.mini-team { display: flex; height: 28px; justify-content: center; }
.mini-team img { width: 31%; max-width: 26px; height: 100%; object-fit: cover; object-position: top; }
.tactic-unit[draggable="true"] { cursor: grab; }

.score-team { justify-items: start; min-width: 0; }
.score-team.red { justify-items: end; }
.score-meta, .turn-line { display: flex; align-items: center; justify-content: center; gap: 12px; }
.score-meta small { color: #c6cfde; }
.score-meta strong { font-size: 1.35rem; }
.turn-line { margin: 2px 0; }
.turn-line h1 {
  margin: 0;
  color: var(--accent, var(--gold));
  font-size: clamp(1.22rem, 2vw, 1.8rem);
  font-weight: 750;
  letter-spacing: .04em;
  text-shadow: 0 0 18px color-mix(in srgb, currentColor 25%, transparent);
}
.turn-clock {
  display: grid;
  align-content: center;
  border-left: 1px solid #475066;
  padding-left: 12px;
  color: var(--clock-color, #f4ead9);
  font: 700 clamp(1.25rem, 2vw, 1.8rem)/1 Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.turn-clock progress { width: 100%; height: 3px; margin-top: 3px; accent-color: currentColor; }
.turn-clock { grid-template-columns: 5ch; }
.score-center .pick-count { color: #d5dfef; font-variant-numeric: tabular-nums; }
.draft-order {
  display: flex;
  gap: 4px;
  padding: 0;
  margin: 8px 0 0;
  list-style: none;
}
.draft-order li {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  color: #9ca9ba;
  background: #192131;
  border-bottom: 2px solid #354056;
  font-size: .8rem;
}
.draft-order i { width: 7px; height: 7px; border: 1px solid currentColor; transform: rotate(45deg); }
.draft-order .done { color: #bbc7d5; }
.draft-order .done i { width: auto; height: auto; border: 0; font-style: normal; color: var(--accent); transform: none; }
.draft-order [aria-current] {
  background: linear-gradient(100deg, #1b2333, color-mix(in srgb, var(--accent) 18%, #182131));
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.draft-order [aria-current] i { background: currentColor; }
.draft-order small { font: 600 .75rem Consolas, monospace; }
.team-panel.active-team {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  border-top-color: var(--accent);
  box-shadow: 0 0 13px color-mix(in srgb, var(--accent) 12%, transparent);
}
.side-title .turn-tag {
  flex-shrink: 0;
  font-size: .7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-radius: 3px;
  padding: 1px 6px;
}
.hero-card.blank.next-slot {
  border-color: var(--accent);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 15%, #222b3d), #1a2334);
}
.next-slot b { position: static; background: none; padding: 0; color: var(--accent); }
.pool-ban { --action-color: #ff9c9f; }
.pool-pick { --action-color: var(--accent); }
:is(.pool-ban, .pool-pick) .pool-card:not(.off):is(:hover, :focus-visible) { border-color: var(--action-color); }
:is(.pool-ban, .pool-pick) .pool-card:not(.off):is(:hover, :focus-visible)::after {
  position: absolute;
  inset: 35% 0 auto;
  color: var(--action-color);
  background: #101522ef;
  padding: 4px 0;
  font-size: .85rem;
  font-weight: 700;
  pointer-events: none;
}
.pool-ban .pool-card:not(.off):is(:hover, :focus-visible)::after { content: "⊘ 禁用"; }
.pool-pick .pool-card:not(.off):is(:hover, :focus-visible)::after { content: "✓ 选择"; }
@media (max-width: 620px) {
  .scoreboard:has(.turn-line) { grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 5px; }
  .scoreboard:has(.turn-line) .score-center { display: contents; }
  .scoreboard:has(.turn-line) .score-meta { grid-area: 1/2; flex-direction: column; gap: 0; }
  .scoreboard:has(.turn-line) .score-team.red { grid-area: 1/3; }
  .turn-line, .pick-count { grid-column: 1/-1; }
  .draft-order { gap: 2px; }
  .draft-order li { flex-wrap: wrap; gap: 3px; padding: 4px 0; font-size: .68rem; }
  .draft-order i { width: 4px; height: 4px; }
  .draft-order small { font-size: .65rem; }
}
