:root {
  --paper: #f4f6f3;
  --surface: #ffffff;
  --surface-muted: #e9eeea;
  --ink: #16201b;
  --ink-soft: #58645e;
  --line: #ccd5cf;
  --line-strong: #9ba9a0;
  --forest: #175b43;
  --forest-dark: #0e412f;
  --mint: #cfe6db;
  --amber: #b56b18;
  --amber-soft: #f4e2c9;
  --red: #a43838;
  --red-soft: #f6dada;
  --blue: #315d80;
  --shadow: 0 12px 32px rgba(25, 45, 34, 0.08);
  --radius: 8px;
  --font-sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  --font-number: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(49, 93, 128, 0.32);
  outline-offset: 2px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--forest-dark);
  background: var(--forest-dark);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
}

.brand-mark-small {
  width: 34px;
  height: 34px;
  font-size: 19px;
}

.brand-compact {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
}

.connection-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.connection-badge[data-status="online"] .connection-dot {
  background: var(--forest);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 20px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  border-color: var(--forest-dark);
  background: var(--forest);
  color: #fff;
}

.button-primary:not(:disabled):hover {
  background: var(--forest-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:not(:disabled):hover {
  border-color: var(--forest);
  color: var(--forest);
}

.button-accent {
  border-color: #7f4b12;
  background: var(--amber);
  color: #fff;
}

.button-accent:not(:disabled):hover {
  background: #8f5314;
}

.button-danger {
  border-color: #7d2020;
  background: #b83d3d;
  color: #fff;
}

.button-danger:not(:disabled):hover {
  background: #942d2d;
}

.button-full {
  width: 100%;
}

.button-link {
  white-space: nowrap;
}

.text-button {
  min-height: 40px;
  border: 0;
  padding: 4px 8px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 700;
}

.text-button:hover {
  color: var(--red);
}

.stack-form {
  display: grid;
  gap: 10px;
}

.stack-form label,
.control-selectors label > span,
.hidden-judges-form label > span,
.duration-setting-form label > span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
}

input::placeholder {
  color: #8b9790;
}

input:focus,
select:focus {
  border-color: var(--forest);
  outline: 3px solid rgba(23, 91, 67, 0.14);
}

.form-error {
  min-height: 19px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.supporting-text {
  margin: 10px 0 26px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  transform: translateY(16px);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  opacity: 0;
  padding: 14px 18px;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast[data-type="success"] { border-left-color: var(--forest); }
.toast[data-type="error"] { border-left-color: var(--red); }
.toast.is-visible { transform: translateY(0); opacity: 1; }

/* Entry */
.entry-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background-color: var(--paper);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
}

.entry-shell {
  width: min(760px, 100%);
  border-top: 5px solid var(--forest);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 48px;
}

.entry-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 40px;
}

.entry-header h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.15;
}

.entry-actions {
  border-top: 1px solid var(--line);
}

.entry-link {
  display: grid;
  min-height: 90px;
  grid-template-columns: 44px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  transition: background-color 140ms ease;
}

.entry-link:hover {
  background: var(--surface-muted);
}

.entry-link-primary {
  color: var(--forest-dark);
}

.entry-link-index {
  color: var(--line-strong);
  font-family: var(--font-number);
  font-size: 17px;
  font-weight: 800;
}

.entry-link strong,
.entry-link small {
  display: block;
}

.entry-link strong {
  margin-bottom: 5px;
  font-size: 18px;
}

.entry-link small {
  color: var(--ink-soft);
  font-size: 13px;
}

.entry-arrow {
  color: var(--forest);
  font-size: 24px;
  text-align: right;
}

/* Judge */
.mobile-header,
.admin-header {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 0 max(18px, env(safe-area-inset-left));
}

.judge-shell {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 42px 20px calc(32px + env(safe-area-inset-bottom));
}

.judge-login {
  width: min(420px, 100%);
  margin: 8vh auto 0;
}

.judge-login h1,
.judge-status-panel h1,
.performance-heading h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
}

.judge-identity-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
  padding-bottom: 14px;
}

.judge-identity-row > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.meta-label {
  color: var(--ink-soft);
  font-size: 12px;
}

.department-tag,
.track-label {
  display: inline-flex;
  width: max-content;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
}

.judge-status-panel {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.judge-status-panel .supporting-text {
  max-width: 360px;
  margin-bottom: 0;
}

.status-symbol {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 2px solid var(--forest);
  border-radius: 50%;
  margin-bottom: 24px;
  color: var(--forest);
  font-size: 42px;
  font-weight: 800;
}

.judge-status-panel[data-state="avoid"] .status-symbol {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: #7d4c17;
}

.judge-status-panel[data-state="submitted"] .status-symbol {
  background: var(--mint);
}

.score-workspace {
  padding-bottom: 14px;
}

.performance-heading {
  display: flex;
  min-height: 92px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 20px;
}

.performance-heading h1 {
  overflow-wrap: anywhere;
  margin-top: 10px;
}

.countdown,
.admin-countdown {
  flex: 0 0 auto;
  color: var(--ink-soft);
  text-align: right;
}

.countdown span,
.countdown strong,
.admin-countdown span,
.admin-countdown strong {
  display: block;
}

.countdown span,
.admin-countdown span {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
}

.countdown strong,
.admin-countdown strong {
  color: var(--forest-dark);
  font-family: var(--font-number);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}

.countdown[data-urgent="true"] strong,
.screen-timer[data-urgent="true"] strong {
  color: var(--red);
}

.score-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.score-fieldset legend {
  width: 100%;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(48px, 1fr));
  gap: 10px;
}

.score-choice {
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-number);
  font-size: 26px;
  font-weight: 800;
}

.score-choice:hover {
  border-color: var(--forest);
}

.score-choice[aria-pressed="true"] {
  border-color: var(--forest-dark);
  background: var(--forest);
  color: #fff;
}

.custom-score {
  display: grid;
  grid-template-columns: auto minmax(150px, 220px);
  align-items: center;
  gap: 8px 12px;
  margin-top: 16px;
}

.custom-score > label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.custom-score-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.custom-score-control input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font-family: var(--font-number);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.custom-score-control span {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.custom-score .form-error {
  grid-column: 2;
  min-height: 18px;
  margin: -2px 0 0;
  font-size: 12px;
}

.selected-score {
  display: flex;
  min-height: 74px;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin: 18px 0 12px;
  color: var(--ink-soft);
  font-size: 13px;
}

.selected-score strong {
  color: var(--forest-dark);
  font-family: var(--font-number);
  font-size: 50px;
  font-variant-numeric: tabular-nums;
}

.submit-note {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(13, 24, 18, 0.58);
  padding: 20px;
}

.confirm-dialog {
  width: min(430px, 100%);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  padding: 28px;
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 24px;
}

.confirm-dialog > p:not(.eyebrow) {
  margin: 12px 0 24px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Scoreboard */
.screen-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
  background-color: #071a4f;
  background-image:
    linear-gradient(rgba(68, 206, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 206, 255, 0.12) 1px, transparent 1px);
  background-size: 36px 36px;
}

.screen-header {
  display: flex;
  min-height: 112px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 3px solid #43d9ff;
  background: #0b237d;
  box-shadow: 0 8px 0 rgba(0, 8, 45, 0.45);
  padding: 18px 32px;
}

.screen-header .eyebrow {
  color: #57e5ff;
}

.screen-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 2.5vw, 42px);
  line-height: 1.1;
  text-shadow: 3px 3px 0 #07133f;
}

.screen-live-status {
  display: flex;
  align-items: center;
  gap: 28px;
}

.screen-current {
  max-width: 420px;
  text-align: right;
}

.screen-current span,
.screen-current strong,
.screen-timer span,
.screen-timer strong {
  display: block;
}

.screen-current span,
.screen-timer span {
  margin-bottom: 4px;
  color: #a9d9ff;
  font-size: 12px;
  font-weight: 700;
}

.screen-current strong {
  overflow: hidden;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}

.screen-timer {
  min-width: 108px;
  border-left: 1px solid rgba(126, 222, 255, 0.55);
  padding-left: 28px;
  text-align: right;
}

.screen-timer strong {
  color: #ffd43b;
  font-family: var(--font-number);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
}

.scoreboard-shell {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 16px 24px 8px;
}

.scoreboard-meta {
  display: flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.scoreboard-meta p {
  margin: 4px 0 0;
  color: #c8e8ff;
  font-size: 13px;
}

.segmented-view {
  display: inline-flex;
  min-height: 34px;
  overflow: hidden;
  border: 2px solid #4edfff;
  background: #081853;
  box-shadow: 4px 4px 0 #020a2f;
}

.segment {
  min-width: 72px;
  border: 0;
  border-right: 1px solid #4edfff;
  border-radius: 0;
  background: #102f9d;
  padding: 7px 16px;
  color: #d9f2ff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.segment:last-child {
  border-right: 0;
}

.segment:hover {
  background: #1948db;
  color: #fff;
}

.segment.is-active {
  background: #ff4f91;
  color: #fff;
}

.segment:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--focus-ring);
  outline-offset: -3px;
}

.score-table-wrap {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  border: 3px solid #45dcff;
  background: #0b237d;
  box-shadow: 8px 8px 0 rgba(0, 7, 42, 0.66);
}

.score-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.score-table th,
.score-table td {
  border-right: 1px solid rgba(102, 215, 255, 0.42);
  border-bottom: 1px solid rgba(102, 215, 255, 0.42);
  padding: 3px 8px;
  text-align: center;
  vertical-align: middle;
}

.score-table tbody tr {
  height: var(--score-row-height, 64px);
}

.score-table tbody th,
.score-table tbody td {
  height: var(--score-row-height, 64px);
}

.score-table thead th {
  position: sticky;
  z-index: 4;
  top: 0;
  height: 56px;
  background: #1239b7;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.score-table th:first-child,
.score-table td:first-child {
  position: sticky;
  z-index: 2;
  left: 0;
  width: 230px;
  text-align: left;
}

.score-table thead th:first-child {
  z-index: 5;
}

.score-table th:last-child,
.score-table td:last-child {
  width: 116px;
  border-right: 0;
}

.score-table tbody th {
  background: #0e2d96;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
}

.score-table tbody tr[data-active="true"] th,
.score-table tbody tr[data-active="true"] td {
  background-color: #1746c9;
}

.score-table tbody tr[data-active="true"] th {
  box-shadow: inset 7px 0 0 #ffcf33;
}

.score-table tbody td {
  background: #0b267f;
  color: #fff;
  font-family: var(--font-number);
  font-size: 31px;
  font-weight: 800;
}

.score-table .judge-heading {
  overflow-wrap: anywhere;
}

.score-table .performance-track {
  display: inline-block;
  min-width: 40px;
  margin-right: 8px;
  vertical-align: middle;
  color: #50e2ff;
  font-size: 16px;
  font-weight: 800;
}

.score-table .performance-name {
  display: inline-block;
  vertical-align: middle;
  line-height: 1.25;
  text-align: left;
}

.score-cell[data-state="pending"] {
  color: #8eb5e8;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
}

.score-cell[data-state="avoid"] {
  background: #101f5c;
  color: #7ea3d5;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 700;
}

.score-cell[data-state="hidden"] {
  background: #7a306e;
  color: #ffe99b;
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
}

.score-cell[data-state="submitted"] {
  color: #ffdb3d;
  text-shadow: 1px 1px 0 #020a2f;
}

.score-cell.is-updated {
  animation: cell-update 900ms ease-out;
}

.score-total {
  background: #ffcc28 !important;
  color: #081443 !important;
  font-size: 34px !important;
  text-shadow: none;
}

.table-empty {
  position: absolute;
  z-index: 7;
  inset: 49px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(7, 26, 79, 0.96);
  color: #b8d9ff;
}

.table-empty strong {
  margin-bottom: 8px;
  color: #fff;
  font-size: 22px;
}

.screen-footer {
  display: flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  gap: 24px;
  border-top: 2px solid #43d9ff;
  background: #081853;
  color: #b8d9ff;
  padding: 6px 28px;
  font-size: 12px;
}

.screen-footer span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.screen-footer strong {
  margin-left: auto;
  color: #ffd43b;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #49e2ff;
}

.legend-pending { background: #789bd0; }
.legend-hidden { background: #ff70ad; }

/* Admin */
.admin-header {
  position: sticky;
  z-index: 20;
  top: 0;
  padding-right: 24px;
  padding-left: 24px;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.admin-login {
  width: min(420px, 100%);
  margin: 10vh auto 0;
  border-top: 4px solid var(--forest);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 34px;
}

.admin-login h1 {
  margin: 0 0 28px;
  font-size: 28px;
}

.admin-title-row,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.admin-title-row {
  align-items: center;
  margin-bottom: 28px;
}

.admin-title-row h1 {
  margin: 0;
  font-size: 32px;
}

.control-band,
.admin-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.control-band {
  border-top: 4px solid var(--forest);
  padding: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
}

.round-state,
.setting-status {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink-soft);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
}

.round-state[data-state="open"] {
  border-color: var(--forest);
  background: var(--mint);
  color: var(--forest-dark);
}

.round-state[data-state="closed"] {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: #704313;
}

.control-selectors {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(280px, 1.3fr);
  gap: 16px;
  margin-top: 24px;
}

.control-selectors label,
.hidden-judges-form label,
.duration-setting-form label {
  display: grid;
  gap: 7px;
}

.control-status-line {
  display: grid;
  grid-template-columns: 1fr auto minmax(150px, 0.3fr);
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 24px;
  padding: 20px 0;
}

.control-status-line > div:first-child span,
.control-status-line > div:first-child strong,
.control-status-line > div:last-child span,
.control-status-line > div:last-child strong {
  display: block;
}

.control-status-line span {
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.control-status-line strong {
  font-size: 18px;
}

.control-status-line > div:last-child {
  text-align: right;
}

.control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.8fr);
  gap: 20px;
  margin-top: 20px;
}

.admin-section {
  min-width: 0;
  padding: 24px;
}

.section-note {
  margin: 12px 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.hidden-judges-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 12px;
}

.duration-setting-form {
  display: grid;
  grid-template-columns: minmax(180px, 280px) auto;
  align-items: end;
  gap: 12px;
}

.settings-divider {
  height: 1px;
  margin: 28px 0;
  background: var(--line);
}

.judge-progress-list {
  display: grid;
  margin-top: 18px;
}

.judge-progress-item {
  display: grid;
  min-height: 45px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.judge-progress-item:last-child {
  border-bottom: 0;
}

.judge-progress-name {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.judge-progress-name small {
  margin-left: 7px;
  color: var(--ink-soft);
  font-weight: 500;
}

.judge-progress-status {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.judge-progress-status[data-state="submitted"] { color: var(--forest); }
.judge-progress-status[data-state="avoid"] { color: var(--amber); }
.muted-empty { margin: 14px 0; color: var(--ink-soft); }

@keyframes cell-update {
  0% { background-color: #b9dccb; }
  100% { background-color: #fff; }
}

@media (max-width: 900px) {
  .admin-grid,
  .hidden-judges-form,
  .duration-setting-form {
    grid-template-columns: 1fr;
  }

  .hidden-judges-form .button {
    width: 100%;
  }

  .screen-header {
    min-width: 1180px;
  }
}

@media (max-width: 640px) {
  .entry-page {
    align-items: stretch;
    padding: 0;
    background-image: none;
  }

  .entry-shell {
    min-height: 100vh;
    box-shadow: none;
    padding: 32px 22px;
  }

  .entry-header {
    margin: 48px 0;
  }

  .entry-header h1 {
    font-size: 30px;
  }

  .mobile-header {
    min-height: 58px;
  }

  .judge-shell {
    padding: 28px 16px calc(22px + env(safe-area-inset-bottom));
  }

  .judge-login {
    margin-top: 5vh;
  }

  .judge-login h1,
  .judge-status-panel h1,
  .performance-heading h1 {
    font-size: 25px;
  }

  .judge-identity-row {
    margin-bottom: 24px;
  }

  .judge-status-panel {
    min-height: calc(100vh - 190px);
  }

  .score-grid {
    grid-template-columns: repeat(5, minmax(48px, 1fr));
    gap: 8px;
  }

  .score-choice {
    font-size: 24px;
  }

  .admin-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .admin-header .brand-compact > span:last-child {
    display: none;
  }

  .admin-shell {
    width: calc(100% - 28px);
    padding-top: 24px;
  }

  .admin-login {
    margin-top: 4vh;
    padding: 24px;
  }

  .admin-title-row {
    align-items: flex-start;
  }

  .admin-title-row h1 {
    font-size: 25px;
  }

  .control-band,
  .admin-section {
    padding: 18px;
  }

  .control-selectors,
  .control-status-line {
    grid-template-columns: 1fr;
  }

  .control-status-line {
    gap: 16px;
  }

  .control-status-line > div:last-child,
  .admin-countdown {
    text-align: left;
  }

  .control-actions .button {
    width: 100%;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 370px) {
  .score-grid {
    gap: 6px;
  }

  .score-choice {
    font-size: 21px;
  }

  .performance-heading {
    gap: 10px;
  }

  .countdown strong {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
