:root {
  color-scheme: light;
  --bg: #e9f8dc;
  --panel: #ffffff;
  --ink: #1d2522;
  --muted: #65706b;
  --line: #c8dcc0;
  --brand: #008eb3;
  --brand-dark: #063c44;
  --court: #1d7c51;
  --accent: #f0d932;
  --danger: #c84630;
  --soft: #f3faee;
  --row-muted: #f1f3f1;
  --scheduled: #946200;
  --played: #1d7c51;
  --open: #69736f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 8%, rgba(240, 217, 50, 0.24), transparent 24%),
    linear-gradient(180deg, #dff4cf 0%, var(--bg) 280px, #f7fbf0 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.topbar {
  align-items: center;
  background:
    linear-gradient(90deg, #083a2a 0%, #0d4d38 55%, #0b3f32 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  min-height: 92px;
  padding: 18px clamp(16px, 4vw, 48px);
  gap: 20px;
}

.brand-block {
  align-items: center;
  display: flex;
  gap: 16px;
  min-width: 0;
}

.club-logo {
  aspect-ratio: 1;
  background: #ffffff;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  flex: 0 0 auto;
  height: 74px;
  object-fit: contain;
  padding: 3px;
  width: 74px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 4.8vw, 54px);
}

.total-participants {
  color: #d9f7c9;
  display: inline-block;
  font-size: clamp(14px, 1.45vw, 22px);
  font-weight: 700;
  margin-left: 12px;
  vertical-align: middle;
}

.header-match-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(5, minmax(78px, 1fr));
  margin-top: 10px;
  max-width: 640px;
}

.header-match-stat {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  color: #ffffff;
  min-width: 0;
  padding: 7px 9px;
}

.header-match-stat strong {
  color: #ffffff;
  display: block;
  font-size: clamp(18px, 2.1vw, 28px);
  line-height: 1;
}

.header-match-stat span {
  color: #d9f7c9;
  display: block;
  font-size: clamp(10px, 0.95vw, 12px);
  font-weight: 800;
  line-height: 1.12;
  margin-top: 4px;
  text-transform: uppercase;
}

.header-match-stat--played strong {
  color: #8cf0a7;
}

.header-match-stat--open strong {
  color: #f5df6f;
}

.header-match-stat--unscheduled strong {
  color: #ffb8a8;
}

.header-match-stat--average strong {
  color: #c9f4ff;
}

.final-date {
  color: #ffffff;
  display: inline-block;
  font-size: clamp(22px, 3.2vw, 40px);
  font-weight: 900;
  margin-left: 8px;
  white-space: nowrap;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.topbar .eyebrow {
  color: #d9f7c9;
  font-size: clamp(16px, 2vw, 22px);
}

.header-notice {
  background: #f0d932;
  border: 2px solid #ffffff;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  color: #082f25;
  flex: 1 1 280px;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 900;
  line-height: 1.15;
  max-width: 640px;
  padding: 10px 16px;
  text-align: center;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

nav a,
button {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
  text-decoration: none;
}

.topbar nav a {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

nav a.active,
button {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.topbar nav a.active {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--brand-dark);
}

button.secondary {
  background: #ffffff;
  color: var(--brand-dark);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

button.small {
  min-height: 32px;
  padding: 6px 10px;
}

main {
  padding: 24px clamp(16px, 4vw, 48px) 48px;
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 22px;
}

.login-main {
  display: grid;
  min-height: calc(100vh - 126px);
  place-items: center;
}

.login-panel {
  max-width: 420px;
  width: min(100%, 420px);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-error {
  background: #fff1f1;
  border: 1px solid #e4aaaa;
  border-radius: 6px;
  color: #8a2525;
  font-weight: 700;
  margin: 0 0 16px;
  padding: 10px 12px;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 7px;
}

select,
input,
textarea {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  min-height: 118px;
  resize: vertical;
}

.overview-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 22px;
}

.summary-card,
.panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(35, 79, 54, 0.1);
}

.summary-card {
  border-top: 4px solid var(--brand);
  padding: 18px;
  position: relative;
}

.summary-card::after {
  background: var(--accent);
  border-radius: 999px;
  content: "";
  height: 10px;
  position: absolute;
  right: 18px;
  top: 18px;
  width: 10px;
}

.summary-card dl {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.summary-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.summary-card dt,
.summary-card dd {
  font-size: clamp(12px, 0.9vw, 14px);
  white-space: nowrap;
}

.summary-card dd {
  overflow: hidden;
  text-overflow: ellipsis;
}

dt {
  color: var(--muted);
}

dd {
  font-weight: 700;
  margin: 0;
  text-align: right;
  word-break: break-word;
}

.panel {
  margin-top: 20px;
  overflow: hidden;
}

.section-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.notice,
.empty-state {
  background: var(--soft);
  color: var(--brand-dark);
  padding: 12px 18px;
}

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

.save-status {
  display: block;
  font-weight: 700;
  margin-top: 6px;
}

.save-status[data-tone="success"] {
  color: #1f7a3a;
}

.save-status[data-tone="warning"] {
  color: #8a5a00;
}

.save-status[data-tone="error"] {
  color: #a12828;
}

.empty-state {
  margin-top: 10px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.participant-tools {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px);
  padding: 16px 18px;
}

.settings-tools {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(160px, 220px) minmax(140px, 180px) minmax(260px, 1fr);
  padding: 16px 18px;
}

.settings-actions {
  align-content: center;
  display: grid;
  gap: 4px;
}

.participant-actions {
  align-content: start;
  display: grid;
  gap: 10px;
}

.helper-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.compact-panel .section-heading {
  padding-block: 14px;
}

.participant-list {
  column-gap: 12px;
  column-width: 520px;
  padding: 0 18px 16px;
}

.participant-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(160px, 1.35fr) minmax(116px, 0.75fr) minmax(150px, 1fr) minmax(58px, max-content) 30px;
  break-inside: avoid;
  margin: 0 0 7px;
  min-height: 36px;
  padding: 5px 6px;
  width: 100%;
}

.participant-item input,
.participant-age {
  font-size: 14px;
}

.participant-item input {
  min-height: 30px;
  padding: 4px 6px;
}

.participant-name-input {
  font-weight: 700;
}

.participant-disciplines-input {
  min-width: 132px;
}

.participant-age {
  color: var(--muted);
  min-width: max-content;
  white-space: nowrap;
}

.icon-delete {
  align-items: center;
  background: #fff1ef;
  border: 1px solid rgba(200, 70, 48, 0.32);
  border-radius: 50%;
  color: var(--danger);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 18px;
  height: 26px;
  justify-content: center;
  line-height: 1;
  min-height: 26px;
  padding: 0;
  width: 26px;
}

.compact-empty {
  margin: 0 18px 16px;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap.is-hidden {
  display: none;
}

table {
  border-collapse: collapse;
  min-width: 780px;
  width: 100%;
}

.standings-table {
  min-width: 900px;
  table-layout: fixed;
}

.standings-table th:nth-child(1),
.standings-table td:nth-child(1) {
  width: 7%;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  width: 28%;
  white-space: nowrap;
}

.standings-table th:nth-child(3),
.standings-table td:nth-child(3),
.standings-table th:nth-child(4),
.standings-table td:nth-child(4) {
  width: 10%;
}

.standings-table th:nth-child(5),
.standings-table td:nth-child(5) {
  width: 13%;
}

.standings-table th:nth-child(6),
.standings-table td:nth-child(6) {
  width: 10%;
}

.standings-table th:nth-child(7),
.standings-table td:nth-child(7) {
  width: 11%;
}

.standings-table th:nth-child(8),
.standings-table td:nth-child(8) {
  width: 11%;
}

body:has(#adminMatchesBody) .standings-table th:nth-child(1),
body:has(#adminMatchesBody) .standings-table td:nth-child(1) {
  width: 7%;
}

body:has(#adminMatchesBody) .standings-table th:nth-child(2),
body:has(#adminMatchesBody) .standings-table td:nth-child(2) {
  width: 30%;
}

body:has(#adminMatchesBody) .standings-table th:nth-child(7),
body:has(#adminMatchesBody) .standings-table td:nth-child(7) {
  width: 10%;
}

table.hide-group-column th:nth-child(2),
table.hide-group-column td:nth-child(2) {
  display: none;
}

body:has(#adminMatchesBody) table {
  min-width: 1080px;
  table-layout: fixed;
}

body:has(#adminMatchesBody) table.hide-group-column {
  min-width: 984px;
}

body:has(#adminMatchesBody) th:nth-child(1),
body:has(#adminMatchesBody) td:nth-child(1) {
  width: 150px;
}

body:has(#adminMatchesBody) th:nth-child(2),
body:has(#adminMatchesBody) td:nth-child(2) {
  width: 96px;
}

body:has(#adminMatchesBody) th:nth-child(3),
body:has(#adminMatchesBody) td:nth-child(3),
body:has(#adminMatchesBody) th:nth-child(4),
body:has(#adminMatchesBody) td:nth-child(4) {
  width: 150px;
}

body:has(#adminMatchesBody) th:nth-child(5),
body:has(#adminMatchesBody) td:nth-child(5) {
  width: 176px;
}

body:has(#adminMatchesBody) th:nth-child(6),
body:has(#adminMatchesBody) td:nth-child(6),
body:has(#adminMatchesBody) th:nth-child(7),
body:has(#adminMatchesBody) td:nth-child(7),
body:has(#adminMatchesBody) th:nth-child(8),
body:has(#adminMatchesBody) td:nth-child(8) {
  width: 112px;
}

body:has(#adminMatchesBody) th:nth-child(9),
body:has(#adminMatchesBody) td:nth-child(9) {
  width: 96px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

body:has(#adminMatchesBody) th,
body:has(#adminMatchesBody) td {
  padding: 8px 10px;
}

body:has(#adminMatchesBody) .status {
  font-size: 12px;
  min-width: 72px;
  padding: 4px 8px;
}

body:has(#adminMatchesBody) .score-input {
  min-width: 0;
  padding-inline: 8px;
  text-align: center;
}

th {
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

tbody tr.group-tone-light {
  background: #ffffff;
}

tbody tr.group-tone-muted {
  background: var(--row-muted);
}

.group-badge {
  background: #e6f5f7;
  border: 1px solid rgba(0, 142, 179, 0.28);
  border-radius: 999px;
  color: var(--brand-dark);
  display: inline-block;
  font-weight: 700;
  min-width: 82px;
  padding: 5px 10px;
  text-align: center;
}

.standings-block + .standings-block {
  border-top: 1px solid var(--line);
}

.standings-block h3 {
  padding: 16px 18px 0;
}

.status {
  border-radius: 999px;
  color: #ffffff;
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  min-width: 82px;
  padding: 5px 9px;
  text-align: center;
}

.status.open {
  background: var(--open);
}

.status.scheduled {
  background: var(--scheduled);
}

.status.played {
  background: var(--played);
}

.score-input {
  max-width: 72px;
}

.finals-public-page {
  background:
    linear-gradient(180deg, rgba(12, 64, 50, 0.1), rgba(255, 255, 255, 0) 340px),
    linear-gradient(135deg, #fff7d6 0%, #e6f7ec 46%, #f8fbff 100%);
}

.finals-main {
  display: grid;
  gap: 22px;
}

.final-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(8, 58, 42, 0.96), rgba(13, 77, 56, 0.86)),
    linear-gradient(90deg, #f6d76f, #ffffff);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(43, 75, 52, 0.22);
  color: #ffffff;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(128px, 220px);
  min-height: 160px;
  overflow: hidden;
  padding: clamp(22px, 4vw, 44px);
  position: relative;
}

.final-hero::before {
  background: repeating-linear-gradient(135deg, rgba(240, 217, 50, 0.24) 0 12px, transparent 12px 26px);
  content: "";
  inset: 0;
  opacity: 0.35;
  position: absolute;
}

.final-hero__content,
.final-hero__trophy {
  position: relative;
}

.final-hero__content {
  align-items: center;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  width: 100%;
}

.final-hero .eyebrow {
  color: #f5df6f;
}

.final-hero h2 {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.02;
  max-width: 780px;
  text-align: left;
}

.final-hero__notice {
  color: #fff6b7;
  font-size: clamp(15px, 2vw, 21px);
  font-weight: 800;
  line-height: 1.25;
  max-width: 760px;
  text-align: center;
}

.final-hero__trophy {
  color: #f5d450;
  font-size: clamp(96px, 15vw, 190px);
  line-height: 1;
  text-align: center;
  text-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.final-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.final-hero__stats div {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  min-width: 150px;
  padding: 12px 14px;
}

.final-hero__stats strong {
  color: #f5df6f;
  display: block;
  font-size: 32px;
  line-height: 1;
}

.final-hero__stats span {
  color: #f3fff5;
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}

.finals-grid {
  display: grid;
  gap: 16px;
  grid-auto-rows: 1fr;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.final-card {
  background:
    linear-gradient(180deg, rgba(255, 250, 226, 0.98), rgba(255, 255, 255, 0.98)),
    #ffffff;
  border: 1px solid #dfc253;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(92, 75, 22, 0.16);
  display: grid;
  gap: 16px;
  grid-template-rows: auto minmax(136px, auto) auto auto;
  min-height: 260px;
  overflow: hidden;
  padding: 20px;
  position: relative;
}

.final-card::before {
  background: linear-gradient(90deg, #c89d24, #fff2a8, #c89d24);
  content: "";
  height: 5px;
  inset: 0 0 auto;
  position: absolute;
}

.final-card__shine {
  color: rgba(200, 157, 36, 0.11);
  font-size: 150px;
  line-height: 1;
  position: absolute;
  right: -16px;
  top: 28px;
}

.final-card__header {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
  min-height: 70px;
  position: relative;
}

.final-medal {
  align-items: center;
  background: #fff7d3;
  border: 1px solid #e3c75b;
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 30px;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.final-card h2 {
  color: #173c2e;
  font-size: 22px;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finalists {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  min-height: 192px;
  position: relative;
}

.finalists strong {
  align-items: center;
  background: #ffffff;
  border: 1px solid #eadb91;
  border-radius: 8px;
  color: #173c2e;
  display: flex;
  font-size: 16px;
  justify-content: center;
  min-height: 58px;
  overflow: hidden;
  padding: 12px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.finalists span {
  color: #946200;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.final-result {
  align-items: center;
  background: #0f513d;
  border-radius: 8px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 86px;
  padding: 14px 16px;
  position: relative;
}

.final-result span {
  color: #dff6d2;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.final-result strong {
  color: #f5df6f;
  font-size: 24px;
  white-space: nowrap;
}

.final-card__footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: auto;
  min-height: 34px;
  position: relative;
}

.final-winner,
.final-empty {
  color: #42504a;
  font-weight: 700;
}

.final-empty {
  background: #fff8dc;
  border: 1px solid #eadb91;
  border-radius: 8px;
  padding: 14px;
  position: relative;
}

.finals-admin-page {
  background: #f4f7f4;
}

.finals-admin-page .header-notice {
  font-size: clamp(16px, 1.7vw, 22px);
}

.finals-admin-panel {
  box-shadow: none;
}

.finals-admin-table {
  min-width: 1060px;
  table-layout: fixed;
}

.finals-admin-table th:nth-child(1),
.finals-admin-table td:nth-child(1) {
  width: 170px;
}

.finals-admin-table th:nth-child(2),
.finals-admin-table td:nth-child(2),
.finals-admin-table th:nth-child(3),
.finals-admin-table td:nth-child(3) {
  width: 190px;
}

.finals-admin-table th:nth-child(4),
.finals-admin-table td:nth-child(4) {
  width: 176px;
}

.finals-admin-table th:nth-child(5),
.finals-admin-table td:nth-child(5),
.finals-admin-table th:nth-child(6),
.finals-admin-table td:nth-child(6),
.finals-admin-table th:nth-child(7),
.finals-admin-table td:nth-child(7) {
  width: 112px;
}

.finals-admin-table th:nth-child(8),
.finals-admin-table td:nth-child(8) {
  width: 110px;
}

@media (max-width: 760px) {
  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    min-height: 0;
    gap: 10px;
    padding: 10px 12px;
  }

  .header-notice {
    flex-basis: auto;
    font-size: 16px;
    line-height: 1.1;
    max-width: none;
    padding: 7px 10px;
    width: 100%;
  }

  nav {
    width: 100%;
  }

  nav a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  main {
    padding: 16px 12px 32px;
  }

  h1 {
    font-size: 28px;
  }

  h2 {
    font-size: 20px;
  }

  .overview-grid,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .overview-grid {
    display: none;
  }

  .brand-block {
    gap: 12px;
  }

  .header-match-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }

  .header-match-stat {
    padding: 8px 9px;
  }

  .club-logo {
    height: 58px;
    width: 58px;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  button,
  nav a,
  select,
  input,
  textarea {
    min-height: 46px;
  }

  .participant-tools {
    grid-template-columns: 1fr;
    padding: 14px 12px;
  }

  .settings-tools {
    align-items: stretch;
    grid-template-columns: 1fr;
    padding: 14px 12px;
  }

  .participant-list {
    column-width: auto;
    columns: 1;
    padding: 0 12px 14px;
  }

  .participant-item {
    grid-template-columns: minmax(0, 1fr) minmax(104px, 0.65fr) minmax(118px, 0.8fr) minmax(54px, max-content) 30px;
  }

  .final-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 20px 22px;
  }

  .final-hero__content {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(132px, 0.88fr);
  }

  .final-hero h2 {
    font-size: clamp(25px, 7.4vw, 32px);
  }

  .final-hero__notice {
    font-size: clamp(12px, 3.4vw, 15px);
  }

  .final-hero__trophy {
    font-size: 82px;
    text-align: left;
  }

  .final-hero__stats div {
    flex: 1 1 140px;
  }

  .finals-grid {
    grid-template-columns: 1fr;
  }

  .finalists {
    min-height: 192px;
  }
}

@media (max-width: 520px) {
  .participant-item {
    grid-template-columns: minmax(0, 1fr) 30px;
  }

  .participant-name-input,
  .participant-birth-input,
  .participant-disciplines-input,
  .participant-age {
    grid-column: 1 / -1;
  }

  .icon-delete {
    grid-column: 2;
    grid-row: 1;
  }

  .participant-age {
    justify-self: start;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 12px;
    overflow: hidden;
  }

  td {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(112px, 38%) 1fr;
    min-height: 48px;
    padding: 10px 12px;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
  }

  td:has(.score-input) {
    align-items: center;
    grid-template-columns: minmax(112px, 38%) 1fr;
  }

  .score-input {
    max-width: none;
  }

  #standings .table-wrap {
    overflow-x: auto;
  }

  #standings table {
    min-width: 420px;
  }

  #standings thead {
    display: table-header-group;
  }

  #standings tbody {
    display: table-row-group;
  }

  #standings tr {
    border: 0;
    border-radius: 0;
    display: table-row;
    margin: 0;
  }

  #standings td {
    border-bottom: 1px solid var(--line);
    display: table-cell;
    font-size: 13px;
    min-height: 0;
    padding: 8px 6px;
    vertical-align: middle;
    width: auto;
  }

  #standings th {
    font-size: 11px;
    padding: 8px 6px;
  }

  #standings td::before {
    content: none;
  }

  #standings th:nth-child(5),
  #standings td:nth-child(5),
  #standings th:nth-child(6),
  #standings td:nth-child(6),
  #standings th:nth-child(7),
  #standings td:nth-child(7) {
    display: none;
  }

  body:has(#adminMatchesBody) table {
    min-width: 0;
  }

  body:has(#adminMatchesBody) #adminMatchesBody tr {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td {
    border: 0;
    display: block;
    min-height: 0;
    padding: 0;
    width: auto;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td::before {
    display: block;
    font-size: 10px;
    margin-bottom: 4px;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(1) {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    grid-column: 1 / 3;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(1)::before,
  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(2)::before {
    content: none;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(2) {
    grid-column: 3;
    justify-self: end;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(3),
  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(4) {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    grid-column: 1 / -1;
    padding: 8px 10px;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(5) {
    grid-column: 1 / -1;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(6),
  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(7),
  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(8) {
    grid-column: span 1;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(9) {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 8px;
  }

  body:has(#adminMatchesBody) #adminMatchesBody td:nth-child(9)::before {
    margin: 0;
  }

  body:has(#adminMatchesBody) #adminMatchesBody input {
    font-size: 16px;
    min-height: 46px;
  }

  body:has(#adminMatchesBody) #adminMatchesBody .score-input {
    font-size: 18px;
    font-weight: 800;
    min-height: 52px;
    padding: 8px 4px;
    text-align: center;
  }

  body:has(#adminMatchesBody) #adminMatchesBody .group-badge {
    min-width: 0;
    padding: 4px 8px;
  }

  .final-card {
    min-height: 0;
    padding: 16px;
  }

  .final-medal {
    height: 48px;
    width: 48px;
  }

  .final-card h2 {
    font-size: clamp(18px, 5.2vw, 22px);
  }

  .final-result {
    align-items: stretch;
    flex-direction: column;
  }

  .final-result strong {
    font-size: 22px;
  }

  .finals-admin-table {
    min-width: 0;
  }

  .finals-admin-table tr {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
  }

  .finals-admin-table td {
    border: 0;
    display: block;
    min-height: 0;
    padding: 0;
    width: auto;
  }

  .finals-admin-table td:nth-child(n) {
    width: auto;
  }

  .finals-admin-table td::before {
    display: block;
    font-size: 10px;
    margin-bottom: 4px;
  }

  .finals-admin-table td:nth-child(1),
  .finals-admin-table td:nth-child(2),
  .finals-admin-table td:nth-child(3),
  .finals-admin-table td:nth-child(4),
  .finals-admin-table td:nth-child(8) {
    grid-column: 1 / -1;
  }

  .finals-admin-table td:nth-child(2),
  .finals-admin-table td:nth-child(3) {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    padding: 8px 10px;
  }

  .finals-admin-table td:nth-child(5),
  .finals-admin-table td:nth-child(6),
  .finals-admin-table td:nth-child(7) {
    grid-column: span 1;
  }

  .finals-admin-table input {
    font-size: 18px;
    font-weight: 800;
    min-height: 52px;
    text-align: center;
  }

  .finals-admin-table td:nth-child(4) input {
    text-align: left;
  }
}
