:root {
  --court: #1d1d1b;
  --court-deep: #121211;
  --sand: #f7f6f4;
  --ink: #1d1d1b;
  --muted: #6a6864;
  --accent: #e98e19;
  --accent-soft: #fbe4c2;
  --line: #e3e1dc;
  --white: #ffffff;
  --live: #c1121f;
  --live-soft: #fde8ea;
  --win: #1f7a3a;
  --win-soft: #e3f5e9;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--sand);
  color: var(--ink);
}
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

a { color: var(--court); font-weight: 700; }
.shell {
  min-height: 100vh;
  display: grid;
  align-content: stretch;
}
@media (min-width: 900px) {
  .shell { grid-template-columns: 1.15fr 1fr; }
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(233, 142, 25, 0.28), transparent 55%),
    linear-gradient(160deg, var(--court-deep), var(--court) 55%, #2a241c);
  color: var(--white);
  padding: 3rem 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1rem;
  min-height: 52vh;
}
.hero-logo {
  position: relative;
  width: min(420px, 86vw);
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
  animation: brandRise 0.8s ease-out both;
}
.hero-copy {
  position: relative;
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  max-width: 28rem;
  animation: brandRise 0.8s ease-out 0.12s both;
}
.brand-word {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 0.95;
}
.brand-tag {
  margin: 0;
  color: #f3f2ef;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
@keyframes brandRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel, .auth {
  padding: 2rem 1.5rem 3rem;
  max-width: 32rem;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}
.panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 40vh;
}
@media (min-width: 900px) {
  .panel { min-height: 100vh; }
}
.lead, .sub {
  color: var(--muted);
  line-height: 1.5;
}
.actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.5rem;
  width: 100%;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 1.25rem;
  border-radius: 14px;
  border: 1.5px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn-primary { background: var(--accent); color: var(--court); }
.btn-secondary { background: var(--white); color: var(--court); border-color: var(--court); }
.btn:hover { transform: translateY(-1px); }
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}
.btn:disabled:hover { transform: none; }

.form {
  display: grid;
  gap: 0.9rem;
  text-align: left;
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
}
.license-entry {
  display: grid;
  gap: 0.35rem;
}
.license-entry > span {
  font-weight: 700;
  font-size: 0.85rem;
}
.license-entry[hidden],
#licensePanel[hidden],
.tab-btn[hidden] {
  display: none !important;
}
.license-code-boxes {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 24rem;
}
.license-code-boxes input[type="text"] {
  width: 5.4rem;
  min-width: 0;
  flex: 1 1 4.2rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 0.15rem;
}
.license-dash {
  flex: none;
  font-weight: 700;
  color: var(--muted);
}
.license-meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 36rem;
}
.license-meter {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.05rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--sand);
}
.license-meter strong {
  font-family: "Bebas Neue", sans-serif;
  font-size: 3.2rem;
  font-weight: 400;
  line-height: 0.85;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.license-meter span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.license-meter-bar {
  height: 0.45rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: var(--white);
  overflow: hidden;
}
.license-meter-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}
.license-meter.is-empty strong {
  color: var(--muted);
}
.license-meter.is-empty .license-meter-bar i {
  background: var(--line);
}
.license-code-list,
.license-user-table {
  display: grid;
  gap: 0.45rem;
}
.license-code-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.license-code-row code,
.license-user-table td:nth-child(3) {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: ui-monospace, Consolas, monospace;
}
.license-user-table {
  width: 100%;
  overflow-x: auto;
}
.license-user-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.license-user-table th,
.license-user-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.license-user-table th {
  font-size: 0.75rem;
  color: var(--muted);
}
label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.85rem;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="datetime-local"] {
  min-height: 3rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 0.9rem;
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.file-pick-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.file-pick {
  position: relative;
  flex: none;
  justify-self: start;
  width: fit-content;
  overflow: hidden;
  cursor: pointer;
}
.file-pick input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.file-pick-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--ink);
}
.file-pick-name:empty { display: none; }
.team-with-logo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  box-sizing: border-box;
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  height: 1.75rem;
  min-height: 1.75rem;
  max-height: 1.75rem;
  min-width: 0;
  overflow: hidden;
  line-height: 1.75rem;
}
.team-with-logo-name {
  flex: 1 1 auto;
  min-width: 0;
  height: 1.75rem;
  max-height: 1.75rem;
  line-height: 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-logo,
.team-logo.team-logo-fallback {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  max-width: 1.75rem;
  min-height: 1.75rem;
  max-height: 1.75rem;
  flex: 0 0 1.75rem;
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--white);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}
.team-logo.team-logo-fallback {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  color: var(--court);
  background: var(--accent-soft);
}
.team-logo > img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}
.team-logo-lg,
.team-logo-lg.team-logo-fallback {
  width: 4.5rem;
  height: 4.5rem;
  min-width: 4.5rem;
  max-width: 4.5rem;
  min-height: 4.5rem;
  max-height: 4.5rem;
  flex-basis: 4.5rem;
  border-radius: 12px;
  font-size: 1.15rem;
}
.team-with-logo-col {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.15rem;
  text-align: center;
  width: 100%;
  height: 3.05rem;
  min-height: 3.05rem;
  max-height: 3.05rem;
  line-height: 1;
  overflow: hidden;
}
.team-with-logo-col .team-with-logo-name {
  width: 100%;
  height: 1.05rem;
  max-height: 1.05rem;
  line-height: 1.05rem;
  font-size: 0.68rem;
  text-align: center;
  flex: none;
}
.team-with-logo-col .team-logo,
.team-with-logo-col .team-logo.team-logo-fallback {
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  max-width: 1.65rem;
  min-height: 1.65rem;
  max-height: 1.65rem;
  flex-basis: 1.65rem;
  font-size: 0.62rem;
}
.team-logo-editor {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.team-vs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.roles {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.roles legend {
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.role {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  font-weight: 400;
  text-align: left;
}
.role:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.role strong { display: block; margin-bottom: 0.15rem; }
.role span { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.role strong { color: var(--ink); }

.error {
  display: none !important;
}
.error-toast {
  position: fixed;
  left: 1.25rem;
  bottom: calc(var(--chrome-bottom, 1.25rem) + 1rem);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  width: min(22rem, calc(100vw - 2.5rem));
  margin: 0;
  padding: 1rem 1.1rem;
  background: var(--live);
  color: var(--white);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(80, 8, 12, 0.28);
}
.error-toast[hidden] {
  display: none !important;
}
.error-toast-text {
  margin: 0;
  color: var(--white);
  font-size: 0.95rem;
  line-height: 1.4;
}
.error-toast-ok {
  appearance: none;
  border: 1.5px solid var(--white);
  background: transparent;
  color: var(--white);
  border-radius: 999px;
  min-height: 2.2rem;
  padding: 0 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.error-toast-ok:hover {
  background: rgba(255, 255, 255, 0.16);
}
.switch, .foot, .back {
  color: var(--muted);
  font-weight: 400;
}
.switch a, .foot a { color: var(--court); }
.back {
  display: inline-block;
  margin-bottom: 1rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 400;
}
.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  margin: 0 auto 0.5rem;
}
.brand-lockup img,
.brand-lockup .logo-stacked,
.logo-stacked {
  width: min(168px, 46vw);
  height: auto;
  display: block;
  margin: 0 auto;
}
.app-shell {
  min-height: 100vh;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--chrome-top, 0px) + 1.25rem) 1.25rem calc(var(--chrome-bottom, 3.25rem) + 1.25rem);
  box-sizing: border-box;
}
.app-shell-wide {
  max-width: none;
  width: 100%;
  min-height: 100vh;
  padding: calc(var(--chrome-top, 0px) + 1rem) 1.25rem calc(var(--chrome-bottom, 3.25rem) + 1rem);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.app-shell-wide .app-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.75rem 1.25rem;
  background: var(--sand);
  border-bottom: 1px solid var(--line);
  box-sizing: border-box;
}
.topbar-manager {
  flex-wrap: wrap;
  row-gap: 0.75rem;
}
.topbar-logo {
  width: min(96px, 28vw);
  margin: 0;
}
.topbar-logo.logo-horizontal {
  width: min(220px, 52vw);
  height: auto;
}
.logo-for-dark { display: none; }
html[data-theme="dark"] .logo-for-light { display: none; }
html[data-theme="dark"] .logo-for-dark { display: block; }
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  flex: 1 1 auto;
}
.tab-btn {
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  min-height: 2.4rem;
  padding: 0 0.95rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.tab-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--court);
}
.tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
}
.tab-panel.is-active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.tab-panel[hidden] {
  display: none !important;
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  min-width: 0;
}
.topbar-meta strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .topbar-manager {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .topbar-manager .topbar-meta {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    justify-content: flex-end;
    gap: 0.4rem;
  }
  .topbar-meta { gap: 0.4rem; }
  .topbar-meta strong { flex: 0 1 auto; }
  .topbar-meta .btn,
  .topbar-meta .theme-switch { flex: 0 0 auto; }
  .tab-nav { justify-content: flex-start; }
}
.btn-small {
  min-height: 2.4rem;
  padding: 0 0.9rem;
  font-size: 0.85rem;
}
.app-main { display: grid; gap: 1.25rem; }
.page-title {
  margin: 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2rem, 6vw, 2.8rem);
  letter-spacing: 0.5px;
  text-align: center;
}
.panel-block {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  display: grid;
  gap: 0.9rem;
  text-align: left;
  align-content: start;
}
.panel-block h2 {
  margin: 0;
  font-size: 1.25rem;
}
.split-grid .panel-block {
  height: auto;
  overflow: visible;
  padding: 1.5rem;
  box-shadow: 0 8px 28px rgba(29, 29, 27, 0.06);
}
.form-wide { max-width: none; }
.card-list { display: grid; gap: 0.75rem; }
.tournament-list-scroll {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  height: auto;
  overflow: visible;
}
.tournament-card,
.empty-card {
  display: grid;
  gap: 0.35rem;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: var(--sand);
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.tournament-card:disabled {
  cursor: default;
}
.tournament-card strong { font-size: 1.05rem; }
.tournament-card-stack {
  justify-items: center;
  text-align: center;
  gap: 0.55rem;
  padding: 1.15rem 1rem;
}
.tournament-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.75rem;
  align-items: center;
  height: auto;
  box-sizing: border-box;
  overflow: visible;
  cursor: default;
}
.tournament-card-main {
  display: grid;
  gap: 0.3rem;
  justify-items: start;
  text-align: left;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.tournament-card-main .tournament-card-title,
.tournament-card-main .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.tournament-card-title:has(.team-with-logo) {
  display: flex;
  align-items: center;
  width: 100%;
  height: 1.75rem;
  min-height: 1.75rem;
  max-height: 1.75rem;
  line-height: 1.75rem;
  overflow: hidden;
}
.pill-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
}
.pill-wrap-left {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.35rem;
  width: auto;
}
.tournament-card-stack .pill {
  justify-self: center;
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}
.tournament-card-title {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.btn-delete-tournament {
  white-space: nowrap;
  min-width: 4.5rem;
  flex: none;
  z-index: 1;
}
.tournament-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0 auto 0.5rem;
  width: min(88%, 56rem);
  box-sizing: border-box;
  text-align: center;
}
.tournament-header-live {
  width: min(98%, 88rem);
  justify-content: space-between;
  text-align: left;
}
.tournament-title-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 0;
  max-width: 100%;
  flex: none;
}
.tournament-header-live .tournament-title-row {
  justify-content: flex-start;
  flex: 1;
}
.tournament-title-row .page-title {
  margin: 0;
  min-width: 0;
  flex: 1 1 auto;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tournament-header-live .tournament-title-row .page-title {
  text-align: left;
}
.tournament-header .btn {
  flex: none;
  white-space: nowrap;
}
.tournament-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: none;
}
.btn-gear {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  flex: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.btn-gear:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.btn-gear svg {
  display: block;
}
body.modal-open {
  overflow: hidden;
}
.modal-card.modal-card-details {
  width: min(96vw, 72rem);
  max-width: min(96vw, 72rem);
  max-height: min(94vh, 58rem);
  min-height: min(78vh, 48rem);
  padding: 1.15rem 1.35rem 1.25rem;
  gap: 0.85rem;
}
.modal-details-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.modal-eyebrow {
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 700;
}
.modal-details-head h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
}
.modal-details-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  overflow: auto;
  padding-right: 0;
  min-height: 0;
  align-content: start;
}
.details-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.details-tab-panel,
.tournament-details-page {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.details-staff {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 800px) {
  .details-staff {
    grid-template-columns: 1fr 1fr;
  }
}
.detail-section {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sand);
  min-width: 0;
}
.detail-section h4 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.staff-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.staff-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.15rem;
  padding: 0.25rem 0.55rem 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-weight: 700;
  font-size: 0.88rem;
}
.staff-chip svg {
  flex: none;
  color: var(--muted);
}
.staff-chip-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.1rem;
}
.staff-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  margin-top: 0.2rem;
  align-items: center;
}
.staff-add input {
  min-height: 2.4rem;
}
.detail-grid {
  display: grid;
  gap: 0.45rem 1rem;
}
@media (min-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .detail-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.detail-row {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.detail-value {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}
.detail-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.detail-scoring {
  display: grid;
  gap: 0.3rem;
}
.detail-scoring-head,
.detail-scoring-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr 1fr;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.82rem;
}
.detail-scoring-head {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.68rem;
}
.detail-scoring-row {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.45rem;
}
.detail-order {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.28rem;
}
.detail-order li {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.86rem;
}
.detail-groups {
  display: grid;
  gap: 0.55rem;
}
.detail-chip-block {
  display: grid;
  gap: 0.35rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}
.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.detail-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #f0c98a;
  font-size: 0.78rem;
  font-weight: 700;
}
.team-slots-scroll {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  height: auto;
  overflow: visible;
  overflow-anchor: none;
}
.team-slots-scroll .tournament-card {
  box-sizing: border-box;
}
.team-slot-empty {
  min-height: 4.85rem;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: transparent;
}
.meta { color: var(--muted); font-size: 0.9rem; }
.timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.75rem 0 1rem;
}
.timeline-step {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  border: 0;
  background: transparent;
  cursor: default;
  min-width: 4.2rem;
  font: inherit;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}
.phases-timeline .timeline-step {
  pointer-events: auto;
  cursor: pointer;
}
.timeline-num {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  background: var(--white);
  font-weight: 700;
  color: var(--ink);
}
.timeline-step.active .timeline-num,
.timeline-step.done .timeline-num {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--court);
}
.timeline-step.active .timeline-label {
  color: var(--ink);
  font-weight: 700;
}
.timeline-label {
  font-size: 0.78rem;
  font-weight: 700;
}
.timeline-line {
  width: 1.6rem;
  height: 2px;
  background: var(--line);
  margin-bottom: 1.1rem;
}
.wizard-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1rem;
}
.wizard-nav .btn {
  min-width: 8.5rem;
}
.stack-gap { display: grid; gap: 0.75rem; }
.field-label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: left;
}
.soft-hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0.25rem 0;
}
.system-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 720px) {
  .system-options { grid-template-columns: 1fr; }
}
.system-card {
  display: grid;
  gap: 0.25rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: var(--sand);
  cursor: pointer;
}
.system-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.system-card input { margin-bottom: 0.25rem; }
.panel-centered-half {
  width: min(50%, 34rem);
  max-width: 50vw;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.panel-centered-wide {
  width: min(88%, 56rem);
  max-width: 92vw;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.two-col-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1.1rem;
  align-items: start;
}
.two-col-left,
.two-col-right {
  min-width: 0;
}
.is-hidden {
  display: none !important;
}
@media (max-width: 820px) {
  .panel-centered-half,
  .panel-centered-wide,
  .tournament-header {
    width: 100%;
    max-width: 100%;
  }
  .two-col-panel {
    grid-template-columns: 1fr;
  }
}
.team-origin {
  display: block;
  margin-top: 0.15rem;
}
.live-group-roster {
  display: grid;
  gap: 0.55rem;
  margin: 0.35rem 0 0.85rem;
}
.live-group-roster-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.live-group-roster-head .btn {
  width: auto;
  flex-shrink: 0;
}
.start-phase-layout {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.group-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.group-actions-row .btn {
  width: auto;
  flex: 1 1 8rem;
}
.field-label-narrow {
  max-width: 12rem;
}
.groups-editor {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr;
}
.groups-editor.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.groups-editor.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .groups-editor.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .groups-editor.cols-2,
  .groups-editor.cols-3 {
    grid-template-columns: 1fr;
  }
}
.group-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  display: grid;
  gap: 0.65rem;
  background: var(--sand);
}
.group-box .team-check-list {
  background: var(--white);
  overflow: auto;
  overflow-anchor: none;
}
.adv-table { width: 100%; border-collapse: separate; border-spacing: 0 0.35rem; }
.adv-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0.45rem 0.15rem;
}
.adv-table td {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.4rem 0.45rem;
  vertical-align: middle;
}
.adv-table td:first-child,
.adv-table th:first-child { width: 2.2rem; text-align: center; }
.adv-table td:first-child { border-left: 1px solid var(--line); border-radius: 10px 0 0 10px; }
.adv-table td:last-child { border-right: 1px solid var(--line); border-radius: 0 10px 10px 0; }
.adv-table tr.is-advancing td { background: var(--accent-soft); border-color: #f0c98a; }
.adv-table input:disabled { cursor: default; }
.match-rules-points .field-label input[type="number"] {
  min-height: 3rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 0.9rem;
  font: inherit;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.scoring-creator {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.scoring-head,
.scoring-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(8rem, 1.2fr) repeat(2, minmax(7rem, 1fr));
  gap: 0.65rem;
  align-items: center;
}
.scoring-head {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted, #6b6b66);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 0.2rem;
}
.scoring-row {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 0.8rem;
}
.scoring-result {
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.scoring-field {
  margin: 0;
}
.scoring-field input[type="number"] {
  min-height: 2.6rem;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 0.75rem;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 820px) {
  .scoring-head { display: none; }
  .scoring-row {
    grid-template-columns: 1fr 1fr;
  }
  .scoring-result,
  .scoring-row > .meta {
    grid-column: 1 / -1;
  }
}
.classification-track {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.classification-wagon {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--white);
  box-shadow: 0 2px 0 rgba(29, 29, 27, 0.04);
  cursor: grab;
  user-select: none;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}
.classification-wagon.is-dragging {
  cursor: grabbing;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.classification-wagon.is-drop-target {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.wagon-rank {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--court);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.wagon-handle {
  width: 1rem;
  height: 1.35rem;
  background:
    linear-gradient(var(--court), var(--court)) 0 0/100% 2px,
    linear-gradient(var(--court), var(--court)) 0 6px/100% 2px,
    linear-gradient(var(--court), var(--court)) 0 12px/100% 2px;
  background-repeat: no-repeat;
  opacity: 0.45;
}
.wagon-copy {
  display: grid;
  gap: 0.15rem;
  text-align: left;
}
.wagon-copy strong {
  font-size: 1.05rem;
}
.timeline-step.locked {
  opacity: 0.4;
  cursor: not-allowed;
}
.timeline-step:disabled {
  pointer-events: none;
}
.team-picker {
  display: grid;
  gap: 0.65rem;
}
.team-picker input[type="search"] {
  min-height: 3rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 0.9rem;
  font: inherit;
  font-size: 1rem;
  width: 100%;
}
.team-check-list {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.5rem;
  background: var(--sand);
  overflow-anchor: none;
}
.team-check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid transparent;
  cursor: pointer;
}
.team-check-row:not(:has(input)) {
  grid-template-columns: 1fr;
}
.team-check-row:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.team-check-row.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #ececec;
  border-color: transparent;
}
.team-check-row.is-disabled:has(input:checked) {
  border-color: transparent;
  background: #ececec;
}
.team-check-row.is-disabled input {
  pointer-events: none;
}
.team-check-row strong {
  display: block;
}
.config-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: var(--sand);
  display: grid;
  gap: 0.75rem;
  text-align: left;
}
.config-card h3 {
  margin: 0;
  font-size: 1rem;
}
.config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.config-grid .meta {
  display: block;
  margin-bottom: 0.15rem;
}
.config-grid-wide {
  grid-column: 1 / -1;
}
.section-subtitle {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
}
.team-check-row .meta {
  display: block;
  margin-top: 0.15rem;
  font-weight: 400;
}
.match-rules .field-label input[type="number"] {
  min-height: 3rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 0.9rem;
  font: inherit;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .config-grid { grid-template-columns: 1fr 1fr; }
}
.pill {
  display: inline-flex;
  align-self: start;
  justify-self: start;
  width: fit-content;
  max-width: max-content;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--court);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.2;
}
.pill-planned,
.pill-draft,
.pill-upcoming,
.pill-scheduled {
  background: #ece2ff;
  color: #5b21b6;
}
.pill-live {
  background: #d8f5e3;
  color: #0f7a3c;
}
.pill-finished {
  background: #e5e7eb;
  color: #4b5563;
}
.pill-public {
  background: #d8f5e3;
  color: #0f7a3c;
}
.pill-private {
  background: #ece2ff;
  color: #5b21b6;
}
.tournament-card-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}
.visibility-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}
.visibility-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}
.visibility-switch button.is-active {
  background: var(--court);
  color: #fff;
}
.visibility-switch button.is-active.is-private {
  background: #5b21b6;
}
.tournament-title-copy {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.tournament-visibility-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.guest-result { display: none; }
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  height: auto;
}
@media (max-width: 820px) {
  .split-grid {
    grid-template-columns: 1fr;
  }
}
select {
  min-height: 3rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 0.9rem;
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  width: 100%;
}
input[type="number"] {
  min-height: 3rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 0.9rem;
  font: inherit;
  font-weight: 400;
  font-size: 1rem;
  width: 100%;
}
.player-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  display: grid;
}
.players-block {
  display: grid;
  gap: 0.75rem;
}
.players-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.player-add-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: center;
}
.player-add-row input {
  min-height: 3rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--white);
  padding: 0 0.9rem;
  font: inherit;
  font-size: 1rem;
  width: 100%;
}
.player-add-fields {
  display: grid;
  gap: 0.65rem;
}
.team-delete-btn {
  margin-top: 0.35rem;
  justify-self: start;
}
.player-add-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.8rem auto;
  gap: 0.65rem;
  align-items: stretch;
}
.player-add-meta select,
.player-add-meta input[type="number"] {
  min-width: 0;
  height: 3rem;
  min-height: 3rem;
  max-height: 3rem;
  padding: 0 0.9rem;
  line-height: 1.2;
  font-size: 1rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background-color: var(--white);
}
.player-add-meta select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%231d1d1b' d='M1.2 1.3 6 6.1l4.8-4.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.75rem 0.5rem;
}
@media (max-width: 560px) {
  .player-add-meta {
    grid-template-columns: 1fr;
  }
}
.added-players {
  display: grid;
  gap: 0.45rem;
}
.player-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  font-weight: 700;
}
.player-chip-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}
.player-chip-copy .meta {
  font-weight: 400;
}
.player-chip-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}
.start-time {
  font-weight: 700;
  color: var(--ink);
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  border: 1.5px solid var(--line);
  background: var(--sand);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--ink);
}
.chip-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.big-inline {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
}
.back-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(29, 29, 27, 0.45);
  display: grid;
  align-items: end;
  padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--sand);
  border-radius: 18px 18px 14px 14px;
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
}
.modal-card-center {
  align-self: center;
  border-radius: 18px;
  background: var(--white);
  border: 1px solid var(--line);
}
.modal-card-center:not(.modal-card-details) {
  justify-items: center;
  text-align: center;
}
.modal-card-center h3 {
  margin: 0;
  font-size: 1.25rem;
}
.modal-card-center:not(.modal-card-details) h3,
.modal-card-center:not(.modal-card-details) p {
  text-align: center;
  width: 100%;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.modal-card-center:not(.modal-card-details) .modal-actions {
  justify-content: center;
  width: 100%;
}
.modal-card-phase {
  max-width: 36rem;
  width: min(92vw, 36rem);
}
.modal-card-start-phase {
  max-width: 56rem;
  width: min(96vw, 56rem);
}
.phase-advance-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  justify-items: stretch;
  text-align: left;
}
.phase-advance-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.phase-advance-grid .phase-advance-group {
  width: 100%;
}
@media (max-width: 900px) {
  .phase-advance-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .phase-advance-grid,
  .phase-advance-grid.cols-3 {
    grid-template-columns: 1fr;
  }
}
.phase-modal-body .start-phase-layout,
.phase-modal-body #startPhaseGroups,
.phase-modal-body .groups-editor,
.phase-modal-body .phase-advance-grid {
  width: 100%;
}
.modal-card-roster {
  max-width: min(92vw, 72rem);
  width: 100%;
  justify-items: stretch;
  text-align: left;
  padding: 1.25rem 1.35rem 1.1rem;
}
.modal-card-roster h3,
.modal-card-roster > .meta {
  text-align: left;
}
.roster-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  text-align: left;
  margin: 0.75rem 0 0.35rem;
}
@media (max-width: 820px) {
  .roster-grid {
    grid-template-columns: 1fr;
  }
}
.roster-col {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  align-content: start;
}
.roster-col h4 {
  margin: 0;
  font-size: 1rem;
}
.roster-list {
  overflow: auto;
  overflow-anchor: none;
}
.team-check-list.roster-list {
  --roster-row: 2.75rem;
  --roster-gap: 0.45rem;
  --roster-pad: 1rem;
  --roster-rows: 5;
  gap: var(--roster-gap);
  grid-auto-rows: var(--roster-row);
  max-height: calc(
    var(--roster-rows) * var(--roster-row) + (var(--roster-rows) - 1) * var(--roster-gap) + var(--roster-pad)
  );
}
.team-check-list.roster-list .team-check-row {
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.team-slots-scroll.roster-list {
  --roster-row: 3.35rem;
  --roster-gap: 0.5rem;
  --roster-rows: 5;
  gap: var(--roster-gap);
  grid-auto-rows: var(--roster-row);
  overflow: auto;
  max-height: calc(var(--roster-rows) * var(--roster-row) + (var(--roster-rows) - 1) * var(--roster-gap));
}
.roster-team-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.55rem;
  height: 100%;
  min-height: 0;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--sand);
  box-sizing: border-box;
  overflow: hidden;
}
.roster-team-name {
  min-width: 0;
}
.roster-team-name .team-with-logo {
  width: 100%;
}
.roster-team-name .team-with-logo-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-team-card.has-group {
  height: auto;
  min-height: var(--roster-row, 3.35rem);
  overflow: visible;
}
.roster-team-actions select[data-roster-group] {
  min-height: 2.15rem;
  height: 2.15rem;
  min-width: 7.5rem;
  max-width: 9.5rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0 0.45rem;
}
.staff-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.85rem;
}
@media (max-width: 820px) {
  .staff-setup-grid {
    grid-template-columns: 1fr;
  }
}
.roster-replace {
  display: grid;
  grid-template-columns: minmax(5.5rem, 8.5rem) auto auto;
  gap: 0.35rem;
  align-items: center;
}
.roster-replace select {
  min-height: 2.15rem;
  height: 2.15rem;
  padding: 0 0.55rem;
}
.roster-team-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
}
.roster-team-card .btn-small {
  min-height: 2.15rem;
  height: 2.15rem;
  padding: 0 0.7rem;
}
.big-score {
  font-family: "Bebas Neue", sans-serif;
  font-size: 3.5rem;
  text-align: center;
  margin: 0;
}
.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.hero-meta {
  display: grid;
  gap: 0.4rem;
  justify-items: center;
  text-align: center;
}
.auth h2 {
  margin: 0.25rem 0 1rem;
  font-size: 1.7rem;
  text-align: center;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  display: grid;
  gap: 0.85rem;
  text-align: left;
  max-width: 24rem;
  margin: 0 auto;
  width: 100%;
}
.card .label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}
.ok {
  margin: 0;
  color: var(--court);
  font-size: 0.92rem;
}

/* Live tournament */
.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  width: min(96%, 72rem);
  margin: 0 auto;
}
.live-layout-wide {
  width: min(98%, 88rem);
}
.live-matches-col {
  min-width: 0;
}
.live-matches-col h2 {
  margin-top: 0;
}
.live-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
}
.live-view-head h2 {
  margin: 0;
}
.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0.15rem 0;
}
.phase-chip-name {
  font-size: 1.05rem;
}
.phase-info-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  flex: none;
}
.phase-info-i > span {
  display: block;
  font-style: normal;
  line-height: 1;
  transform: translateY(-0.02em);
}
.phase-chip:hover .phase-info-i {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.phase-modal-body {
  width: 100%;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
  text-align: center;
}
.phase-modal-body > p {
  margin: 0;
  max-width: 26rem;
}
.phase-advance-rules {
  width: min(26rem, 100%);
  display: grid;
  gap: 0.65rem;
  justify-items: stretch;
  text-align: center;
}
.phase-advance-rules h4 {
  margin: 0;
}
.phase-rule-box {
  display: grid;
  gap: 0.4rem;
  justify-items: stretch;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--sand);
  text-align: left;
}
.phase-rule-box > strong,
.phase-rule-box > p {
  margin: 0;
  text-align: center;
}
.phase-history-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sand);
  text-align: left;
}
.phase-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.phase-history-head h3,
.phase-history-block h4 {
  margin: 0;
}
.phase-history-card > p {
  margin: 0;
}
.phase-history-block {
  display: grid;
  gap: 0.45rem;
}
.phase-history-points {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.3rem;
}
.phase-history-card .phase-advance-list li {
  grid-template-columns: minmax(0, 1fr);
}
.phase-advance-group {
  width: min(24rem, 100%);
  display: grid;
  gap: 0.35rem;
  justify-items: stretch;
  text-align: center;
}
.phase-advance-group h4 {
  margin: 0;
  text-align: center;
}
.phase-advance-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.phase-advance-list li {
  display: block;
  width: 100%;
}
.phase-advance-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.4rem;
  row-gap: 0.05rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-sizing: border-box;
  text-align: left;
  font-weight: 400;
  cursor: pointer;
}
.phase-advance-pick input {
  grid-row: 1 / span 2;
  margin: 0;
}
.phase-advance-pick.is-static {
  grid-template-columns: minmax(0, 1fr);
  cursor: default;
}
.phase-advance-pick:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.phase-advance-team,
.phase-advance-list .team-with-logo,
.phase-advance-pick .team-with-logo {
  min-width: 0;
  justify-content: flex-start;
}
.phase-advance-list .meta,
.phase-advance-pick .meta {
  white-space: nowrap;
}
.phase-advance-pick .meta {
  grid-column: 2;
}
.live-main-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem;
  background: var(--sand);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
}
.live-main-tab {
  min-width: 5.6rem;
  justify-content: center;
}
.vf-courts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.15rem;
  align-items: start;
}
.vf-court {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}
.vf-court-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.vf-court-head h3 {
  margin: 0;
  font-size: 1.05rem;
}
.vf-court-floor {
  position: relative;
  aspect-ratio: 9 / 16;
  display: grid;
  grid-template-rows: 1fr 0.42rem 1fr;
  background:
    linear-gradient(#ffffff 0 0) left / 3px 100% no-repeat,
    linear-gradient(#ffffff 0 0) right / 3px 100% no-repeat,
    linear-gradient(#ffffff 0 0) top / 100% 3px no-repeat,
    linear-gradient(#ffffff 0 0) bottom / 100% 3px no-repeat,
    #c9842a;
  border: 4px solid #f4efe6;
  border-radius: 8px;
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.vf-court-half {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0.7rem 0.65rem;
  min-height: 0;
}
.vf-court-half::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px solid #fff;
}
.vf-court-a::before {
  bottom: 27%;
}
.vf-court-b::before {
  top: 27%;
}
.vf-court-net {
  position: relative;
  background: #1d1d1b;
  box-shadow: 0 0 0 2px #fff;
}
.vf-court-net::before,
.vf-court-net::after {
  content: "";
  position: absolute;
  top: -0.55rem;
  bottom: -0.55rem;
  width: 3px;
  background: #c1121f;
}
.vf-court-net::before { left: 0; }
.vf-court-net::after { right: 0; }
.vf-court-team {
  position: relative;
  z-index: 1;
  max-width: 92%;
  text-align: center;
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.vf-court-team .team-with-logo {
  justify-content: center;
  color: #fff;
}
.vf-court-team .team-with-logo-name {
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vf-court-empty,
.vf-court-team .tbd {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}
.vf-court-score {
  margin: 0;
  text-align: center;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
}
.vf-court.is-idle .vf-court-floor {
  filter: grayscale(1);
  opacity: 0.48;
}
.vf-court.is-idle .vf-court-score {
  display: none;
}
.standings-panel {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.15rem;
  width: 100%;
  min-width: 0;
}
.standings-board {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}
.standings-wrap {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 0.15rem;
}
.standings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.45rem;
  font-size: 0.95rem;
}
.standings-table th,
.standings-table td {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.standings-table th:not(.standings-team),
.standings-table td:not(.standings-team) {
  width: 1%;
}
.standings-table thead th {
  padding: 0 0.4rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  white-space: normal;
  line-height: 1.15;
  vertical-align: bottom;
  max-width: 7.2rem;
}
.standings-table thead th.standings-pos,
.standings-table thead th.standings-team {
  max-width: none;
  white-space: nowrap;
}
.standings-table tbody td {
  padding: 0.55rem 0.35rem;
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.standings-table tbody td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 12px 0 0 12px;
  padding-left: 0.7rem;
}
.standings-table tbody td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 12px 12px 0;
  padding-right: 0.7rem;
}
.standings-table tbody tr.is-gold td {
  background: #fff6dc;
  border-color: #ead59a;
}
.standings-table tbody tr.is-silver td {
  background: #f4f5f7;
  border-color: #d5d8de;
}
.standings-table tbody tr.is-bronze td {
  background: #f8efe6;
  border-color: #e4cbb4;
}
.standings-table tbody tr.is-gold td:first-child { box-shadow: inset 4px 0 0 #d4a017; }
.standings-table tbody tr.is-silver td:first-child { box-shadow: inset 4px 0 0 #8d96a3; }
.standings-table tbody tr.is-bronze td:first-child { box-shadow: inset 4px 0 0 #b8763a; }
.standings-table .standings-pos { padding-left: 0.85rem; }
.standings-table .standings-team {
  text-align: left;
  font-weight: 700;
  font-size: 1.02rem;
  padding-left: 0.35rem;
  padding-right: 0.85rem;
  max-width: 28rem;
  overflow: hidden;
}
.standings-team .team-with-logo-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.standings-rank {
  display: inline-grid;
  place-items: center;
  min-width: 2.15rem;
  width: auto;
  padding: 0 0.4rem;
  height: 2.15rem;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  background: var(--sand);
  color: var(--ink);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
}
.standings-table tr.is-gold .standings-rank {
  background: #f0c94a;
  border-color: #d4a017;
  color: #3a2e08;
}
.standings-table tr.is-silver .standings-rank {
  background: #d5dae1;
  border-color: #8d96a3;
  color: #24303c;
}
.standings-table tr.is-bronze .standings-rank {
  background: #e0b184;
  border-color: #b8763a;
  color: #3a2410;
}
.standings-cell {
  display: inline-grid;
  place-items: center;
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 0.35rem;
  border-radius: 7px;
  border: 1.5px solid var(--line);
  background: var(--sand);
  color: var(--ink);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
}
.standings-cell.is-win {
  color: var(--win);
  background: var(--win-soft);
  border-color: var(--win);
}
.standings-cell.is-loss {
  color: var(--live);
  background: var(--live-soft);
  border-color: var(--live);
}
.standings-cell.standings-ratio {
  min-width: 3.6rem;
  padding: 0 0.45rem;
  background: var(--white);
  font-size: 1.05rem;
}
.standings-table tr.is-gold .standings-cell.standings-ratio,
.standings-table tr.is-silver .standings-cell.standings-ratio,
.standings-table tr.is-bronze .standings-cell.standings-ratio {
  background: rgba(255, 255, 255, 0.72);
}
.standings-points-pill {
  display: inline-grid;
  place-items: center;
  min-width: 2.45rem;
  height: 2.45rem;
  padding: 0 0.45rem;
  border-radius: 7px;
  border: 1.5px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1;
}
.standings-legend {
  display: grid;
  gap: 0.45rem;
  padding: 0.8rem 0.95rem;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--sand);
}
.standings-legend-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.standings-legend-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.standings-flow-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid rgba(233, 142, 25, 0.45);
  background: var(--white);
  color: var(--court);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}
.standings-flow-arrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
}
.standings-key {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.35rem 1.25rem;
  margin: 0;
}
.standings-key div {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  min-width: 0;
}
.standings-key dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.standings-key dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}
.cross-wrap { width: max-content; max-width: 100%; overflow-x: auto; }
.cross-caption {
  caption-side: bottom;
  text-align: left;
  padding: 0.75rem 0.1rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.cross-table {
  --cross-w: 8.5rem;
  --cross-h: 6.25rem;
  width: max-content;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0.4rem;
}
.cross-corner,
.cross-row {
  width: 9.5rem;
  background: var(--white);
  text-align: left;
  font-weight: 700;
  white-space: normal;
  line-height: 1.2;
  padding: 0.35rem 0.4rem 0.35rem 0;
  vertical-align: middle;
}
.cross-corner {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: bottom;
}
.cross-row { font-size: 0.92rem; color: var(--ink); }
.cross-col {
  width: var(--cross-w);
  min-width: var(--cross-w);
  max-width: var(--cross-w);
  text-align: center;
  vertical-align: bottom;
  padding: 0 0.15rem 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: normal;
}
.cross-col .team-with-logo-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cross-col .team-with-logo,
.cross-row .team-with-logo,
.standings-team .team-with-logo {
  display: inline-flex;
}
.cross-col .team-with-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}
.cross-table td {
  width: var(--cross-w);
  min-width: var(--cross-w);
  max-width: var(--cross-w);
  height: var(--cross-h);
  padding: 0;
  text-align: center;
  vertical-align: middle;
}
.cross-score,
.cross-self {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  width: var(--cross-w);
  height: var(--cross-h);
  min-width: var(--cross-w);
  max-width: var(--cross-w);
  min-height: var(--cross-h);
  max-height: var(--cross-h);
  box-sizing: border-box;
  padding: 0.3rem 0.25rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--sand);
  color: var(--ink);
  overflow: hidden;
}
.cross-tally {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
}
.cross-sets {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  max-width: 100%;
  overflow: hidden;
}
.cross-score.is-win { color: var(--win); background: var(--win-soft); border-color: var(--win); }
.cross-score.is-loss { color: var(--live); background: var(--live-soft); border-color: var(--live); }
.cross-score.is-live { color: var(--court); background: var(--accent-soft); border-color: var(--accent); }
.cross-score.is-pending {
  background: var(--white);
  color: #b7b3ab;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.4rem;
}
.cross-self {
  background: #d9d6d0;
  border-color: #c9c5bd;
}
.config-card-stack {
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.config-card-stack h3 { display: none; }
.config-stack {
  display: grid;
  gap: 0.65rem;
}
.config-stack > div {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.config-stack > div:last-child { border-bottom: 0; padding-bottom: 0; }
.group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.35rem 0 1rem;
}
.group-tab {
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.group-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.match-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.55rem;
}
.match-list-toolbar .live-section-title {
  margin: 0;
}
.match-list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.match-team-filter-label {
  display: block;
  margin: 0;
}
select.match-team-filter {
  width: auto;
  min-width: 12rem;
  max-width: 18rem;
  min-height: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
}
.match-drag {
  width: 0.85rem;
  height: 2.2rem;
  flex: none;
  align-self: center;
  border: 0;
  padding: 0;
  cursor: grab;
  background-color: transparent;
  background-image:
    linear-gradient(var(--muted), var(--muted)),
    linear-gradient(var(--muted), var(--muted)),
    linear-gradient(var(--muted), var(--muted)),
    linear-gradient(var(--muted), var(--muted));
  background-size: 100% 2px;
  background-position: 0 0.15rem, 0 0.7rem, 0 1.25rem, 0 1.8rem;
  background-repeat: no-repeat;
}
.match-drag:active { cursor: grabbing; }
.match-row.is-dragging { opacity: 0.55; }
.match-row.is-drop-target {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.status-filter {
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.status-filter .meta {
  font-weight: 700;
  margin-left: 0.15rem;
}
.status-filter.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.match-list {
  display: grid;
  gap: 0.5rem;
}
.match-row {
  display: grid;
  gap: 0.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
}
.match-row.is-finished {
  background: #eceae6;
}
.match-row.is-finished .match-names,
.match-row.is-finished .set-board .point-cell {
  opacity: 0.72;
}
.match-row.is-finished .set-board {
  pointer-events: none;
}
.match-row.is-finished.is-editing-score {
  background: var(--white);
}
.match-row.is-finished.is-editing-score .match-names,
.match-row.is-finished.is-editing-score .set-board .point-cell {
  opacity: 1;
}
.match-row.is-finished.is-editing-score .set-board {
  pointer-events: auto;
}
.match-row-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}
.match-row-waiting {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
}
.match-names {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 2.45rem) minmax(0, 2.45rem);
  column-gap: 0.95rem;
  row-gap: 0.3rem;
  align-items: center;
  min-width: 0;
  flex: 1 1 10rem;
}
.match-id-line {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}
.match-id-sep {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  flex: none;
}
.match-id-line .match-court,
.match-id-line .match-court-name {
  margin-top: 0;
  min-width: 0;
}
.match-id-line .match-court-label {
  text-transform: none;
}
.match-id-line .match-court select {
  width: auto;
  min-width: 6.5rem;
  max-width: 12rem;
  height: 2rem;
  min-height: 2rem;
}
.match-number {
  grid-column: 1;
  grid-row: 2 / span 2;
  display: grid;
  place-items: center;
  align-self: stretch;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}
.match-names .match-points-team:nth-of-type(1) {
  grid-column: 2;
  grid-row: 2;
}
.match-names .match-points-team:nth-of-type(2) {
  grid-column: 2;
  grid-row: 3;
}
.match-points-corner { min-height: 0.9rem; }
.match-points-head {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1;
}
.match-sets-head {
  color: var(--ink);
}
.match-points-team {
  display: flex;
  align-items: center;
  align-self: center;
  width: 100%;
  min-width: 0;
  height: 1.75rem;
  min-height: 1.75rem;
  max-height: 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.75rem;
  overflow: hidden;
  padding-right: 0.25rem;
}
.match-points-team .team-with-logo-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-cup-round {
  margin-left: 0.4rem;
  flex: none;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
input.point-cell[type="text"],
.set-result-cell {
  width: 2.45rem;
  min-width: 2.45rem;
  max-width: 2.45rem;
  height: 2.45rem;
  min-height: 2.45rem;
  max-height: 2.45rem;
  box-sizing: border-box;
  text-align: center;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 2.45rem;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  background: var(--sand);
  color: var(--ink);
  padding: 0;
  margin: 0;
}
.set-result-cell {
  display: grid;
  place-items: center;
  line-height: 1;
}
input.point-cell[type="text"] {
  display: inline-block;
  -moz-appearance: textfield;
  appearance: textfield;
  caret-color: #1d1d1b;
  cursor: text;
}
input.point-cell[type="text"]:hover:not(:disabled):not(.is-set-won):not(.is-set-lost) {
  border-color: #b5b2ab;
  background: var(--white);
  cursor: text;
}
input.point-cell.is-set-won {
  background: var(--win-soft);
  border-color: var(--win);
  color: var(--win);
}
input.point-cell.is-set-lost {
  background: var(--live-soft);
  border-color: var(--live);
  color: var(--live);
}
.set-board {
  --set-cols: 3;
  --set-head: 1.05rem;
  --set-cell: 2.45rem;
  --set-row-gap: 0.3rem;
  display: grid;
  grid-template-columns: repeat(var(--set-cols), var(--set-cell)) var(--set-cell);
  grid-template-rows: var(--set-head) var(--set-cell) var(--set-cell);
  gap: var(--set-row-gap) 0.35rem;
  align-items: center;
  justify-items: center;
}
.set-result-cell {
  background: var(--accent-soft);
  border-color: var(--accent);
  font-size: 1.55rem;
  font-weight: 700;
  -webkit-text-stroke: 0.35px currentColor;
}
input.point-cell::-webkit-outer-spin-button,
input.point-cell::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.point-cell:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  background: var(--white);
  caret-color: #1d1d1b;
}
input.point-cell.is-set-won:focus {
  background: var(--win-soft);
  border-color: var(--win);
}
input.point-cell.is-set-lost:focus {
  background: var(--live-soft);
  border-color: var(--live);
}
input.point-cell:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.match-row-right {
  --set-head: 1.05rem;
  --set-cell: 2.45rem;
  --set-row-gap: 0.3rem;
  --set-mid: calc(var(--set-head) + var(--set-row-gap) + (var(--set-cell) * 2 + var(--set-row-gap) - 2.45rem) / 2);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-left: auto;
  flex: 0 0 auto;
}
.match-court {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
  margin-top: var(--set-mid);
}
.match-court-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
}
.match-court select {
  min-height: 2.45rem;
  height: 2.45rem;
  width: 13.5rem;
  min-width: 13.5rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0 0.7rem;
}
.match-court-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.match-row-right .btn-confirm-score {
  margin-top: var(--set-mid);
  flex: none;
  width: 7.5rem;
  min-width: 7.5rem;
  height: 2.45rem;
  min-height: 2.45rem;
  box-sizing: border-box;
  text-align: center;
  justify-content: center;
  padding: 0 0.7rem;
}
.match-round-mini {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: end;
  min-width: 0;
}
.match-row-waiting .match-court {
  margin-top: 0;
}
.match-row-waiting .match-round-mini {
  grid-column: 1 / -1;
  justify-self: start;
  align-self: center;
}
.btn-confirm-score {
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
  min-width: auto;
  border-radius: 8px;
  white-space: nowrap;
}
.match-waiting {
  margin: 0;
  font-size: 0.9rem;
}
.match-set-hint {
  margin: 0;
  color: var(--live);
  font-size: 0.82rem;
  min-height: 0;
}
.match-set-hint:empty { display: none; }
.deb {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.1rem;
}
.deb-board {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.65rem 0.75rem 0.7rem;
  min-width: 0;
}
.deb-stage {
  position: relative;
  width: 100%;
  min-width: min-content;
}
.deb-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}
.deb-grid {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(var(--deb-cols), minmax(13rem, 1fr)) minmax(13rem, 1fr);
  column-gap: 1.15rem;
  row-gap: 0.2rem;
  min-width: min-content;
  align-items: stretch;
}
.deb-heading,
.deb-title,
.deb-coltitle,
.bracket-round-title {
  color: var(--muted);
}
.deb-heading {
  margin: 0 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.deb-title {
  margin: 0 0 0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}
.deb-coltitle {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  padding: 0;
  margin: 0;
}
.deb-card-wrap {
  width: 100%;
  display: grid;
  gap: 0.12rem;
}
.deb-cell {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  z-index: 1;
}
.deb-cell.is-empty {
  visibility: hidden;
}
.deb-cell .bracket-match,
.deb-final .bracket-match {
  width: 100%;
  padding: 0.38rem 0.5rem;
}
.deb-cell .bracket-slot,
.deb-final .bracket-slot {
  font-size: 0.8rem;
  min-height: 1.15rem;
}
.deb-final {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  min-width: 0;
  padding-left: 0.15rem;
}
.deb-final .bracket-match {
  border-color: #e0b089;
  background: #fff6ee;
}
.deb-third {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.65rem 0.75rem;
  max-width: 22rem;
}
.deb-third .bracket-match {
  border-color: #d8c4a8;
}
@media (max-width: 820px) {
  .deb-grid {
    grid-template-columns: repeat(var(--deb-cols), minmax(11rem, 1fr)) minmax(11rem, 1fr);
  }
}
.bracket-edit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.7rem;
}
.bracket-mobile-tools { display: none; }
.bracket-wrap {
  overflow-x: auto;
  margin: 0 0 1.1rem;
  padding-bottom: 0.35rem;
}
.bracket-stage {
  position: relative;
  width: 100%;
  min-width: min-content;
}
.bracket-grid {
  --bracket-row: 8rem;
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  grid-template-columns: repeat(var(--bracket-cols), minmax(15rem, 1fr));
  grid-template-rows: repeat(var(--bracket-rows), var(--bracket-row));
  column-gap: 1.7rem;
  align-items: stretch;
}
.bracket-grid.is-compact {
  --bracket-row: 7.2rem;
  grid-template-columns: repeat(var(--bracket-cols), minmax(13rem, 1fr));
  column-gap: 1.35rem;
}
.bracket-grid.is-editing {
  --bracket-row: 9.2rem;
}
.bracket-round-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  height: auto;
  margin: 0 0 0.35rem;
  align-self: end;
}
.bracket-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 0;
  z-index: 1;
}
.bracket-match {
  position: relative;
  z-index: 1;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  display: grid;
  gap: 0.4rem;
  width: 100%;
}
select.bracket-team-select {
  min-height: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  border-width: 1px;
  font-size: 0.78rem;
  font-weight: 700;
}
.bracket-match-stage {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.bracket-match-cap {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.bracket-match-court {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0.1rem;
}
.deb-cell .bracket-match-cap,
.bracket-cell .bracket-match-cap,
.deb-final .bracket-match-cap,
.deb-third .bracket-match-cap {
  margin-bottom: 0.05rem;
}
.bracket.is-compact .bracket-match {
  padding: 0.52rem 0.62rem;
  border-radius: 10px;
  gap: 0.28rem;
}
.bracket.is-compact .bracket-slot {
  font-size: 0.82rem;
  height: 1.75rem;
  min-height: 1.75rem;
  max-height: 1.75rem;
}
.bracket-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  height: 1.75rem;
  min-height: 1.75rem;
  max-height: 1.75rem;
  overflow: hidden;
}
.bracket-slot strong,
.bracket-slot .team-with-logo,
.bracket-slot .team-with-logo-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bracket-slot.is-winner strong { color: var(--accent); }
.bracket-slot .score-mini {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.1rem;
  min-width: 1.1rem;
  text-align: right;
}
.bracket-slot .tbd { color: var(--muted); font-style: italic; }
@media (max-width: 720px) {
  .bracket-grid {
    --bracket-row: 7.4rem;
    grid-template-columns: repeat(var(--bracket-cols), minmax(12rem, 1fr));
    column-gap: 1.15rem;
  }
  .bracket-grid.is-compact { --bracket-row: 6.8rem; }
}
.live-section-title {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}
.app-version {
  justify-self: end;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
  user-select: none;
}
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem 1rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.25rem;
  background: var(--sand);
  border-top: 1px solid var(--line);
  box-sizing: border-box;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.site-footer-copy {
  justify-self: start;
  min-width: 0;
}
.site-footer-link {
  justify-self: center;
  color: var(--court);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.site-footer-link:hover { color: var(--accent); }
.auth {
  padding-bottom: calc(var(--chrome-bottom, 3.25rem) + 1.5rem);
}
@media (max-width: 720px) {
  .tournament-card-row {
    grid-template-columns: 1fr;
    row-gap: 0.65rem;
  }
  .tournament-card-stack .tournament-card-title,
  .tournament-card-stack .meta,
  .tournament-card-main .tournament-card-title,
  .tournament-card-main .meta {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .is-spectator .live-layout,
  .is-spectator .live-layout-wide {
    width: 100%;
  }
  .is-spectator .live-view-head {
    align-items: stretch;
  }
  .is-spectator .live-main-tabs {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 16px;
  }
  .is-spectator .live-main-tab {
    flex: none;
    min-width: auto;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .is-spectator .match-row-bar,
  .is-spectator .match-row-waiting,
  .is-spectator .match-row-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    overflow: visible;
  }
  .is-spectator .match-names {
    width: 100%;
    flex: none;
  }
  .is-spectator .set-board,
  .is-spectator .match-row-right .match-court {
    display: none;
  }
  .is-spectator .guest-result {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
  }
  .is-spectator .guest-sets {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1;
  }
  .is-spectator .guest-points {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
  }
  .is-spectator .page-title {
    font-size: 1.7rem;
    white-space: nowrap;
  }
  html { --chrome-bottom: 0px !important; }
  .site-footer {
    position: static;
    z-index: auto;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }
  .site-footer-copy,
  .app-version { justify-self: center; }
}
@media (max-width: 900px) {
  .live-layout,
  .live-layout-wide,
  .tournament-header-live {
    grid-template-columns: 1fr;
    width: min(96%, 48rem);
  }
  .match-row-bar {
    flex-wrap: wrap;
    row-gap: 0.55rem;
  }
  .match-row-right {
    justify-content: flex-start;
    margin-left: 0;
    max-width: 100%;
    overflow-x: auto;
  }
  .match-list-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 640px) {
  .match-points-team { font-size: 0.95rem; }
  .match-row-right,
  .set-board {
    --set-cell: 2.2rem;
  }
  .match-names {
    grid-template-rows: auto 2.2rem 2.2rem;
  }
  .set-board {
    grid-template-rows: 1.05rem 2.2rem 2.2rem;
  }
  .set-board {
    grid-template-columns: repeat(var(--set-cols), 2.2rem) 2.2rem;
  }
  input.point-cell[type="text"],
  .set-result-cell {
    width: 2.2rem;
    min-width: 2.2rem;
    max-width: 2.2rem;
    height: 2.2rem;
    min-height: 2.2rem;
    max-height: 2.2rem;
    font-size: 1.1rem;
    line-height: 2.2rem;
  }
  input.point-cell[type="text"] {
    line-height: 2.2rem;
  }
  .set-result-cell {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
  }
}

@media (max-width: 900px) and (pointer: coarse) {
  .app-shell-wide {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .tournament-header,
  .tournament-header-live,
  .live-layout,
  .live-layout-wide,
  .panel-block,
  .live-matches-col,
  .match-list,
  .match-list-toolbar,
  .match-list-tools,
  .match-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .tournament-header,
  .tournament-header-live {
    flex-wrap: wrap;
  }
  .tournament-title-row {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .tournament-title-row .page-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tournament-header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .live-view-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }
  .live-main-tabs {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
    scrollbar-width: thin;
    scrollbar-color: #8a867e transparent;
    border-radius: 16px;
    padding-bottom: 0.55rem;
  }
  .live-main-tabs::-webkit-scrollbar {
    display: block;
    height: 5px;
  }
  .live-main-tabs::-webkit-scrollbar-thumb {
    background: #8a867e;
    border-radius: 999px;
  }
  .live-main-tabs.can-scroll-right {
    mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
  }
  .live-main-tabs.can-scroll-left:not(.can-scroll-right) {
    mask-image: linear-gradient(to right, transparent, #000 1.5rem);
  }
  .live-main-tabs.can-scroll-left.can-scroll-right {
    mask-image: linear-gradient(to right, transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
  }
  .live-main-tab {
    flex: none;
    min-width: auto;
  }
  .phase-chip {
    margin-left: 0;
    max-width: 100%;
    min-width: 0;
  }
  .phase-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .group-tabs,
  .status-filters {
    flex-wrap: wrap;
    max-width: 100%;
  }
  select.match-team-filter {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .match-row-bar,
  .match-row-waiting,
  .match-row-right,
  .match-names {
    min-width: 0;
    max-width: 100%;
  }
  .is-spectator .match-row-bar,
  .is-spectator .match-row-waiting,
  .is-spectator .match-row-right {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    overflow: visible;
  }
  .is-spectator .set-board,
  .is-spectator .match-row-right .match-court {
    display: none;
  }
  .is-spectator .guest-result {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
  }
  .is-spectator .guest-sets {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1;
  }
  .is-spectator .guest-points {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
  }
  .bracket-mobile-tools {
    display: block;
    margin: 0 0 0.85rem;
  }
  .bracket-open-btn {
    display: flex;
    width: 100%;
    justify-content: center;
  }
  .bracket-inline { display: none; }
  .bracket-viewer .bracket-inline { display: block; }
  html { --chrome-bottom: 0px !important; }
  .site-footer {
    position: static;
    z-index: auto;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    margin-top: 0.5rem;
  }
  .match-names {
    width: 100%;
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }
  .match-points-team {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.45rem;
    width: 100%;
    height: 1.75rem;
    max-height: 1.75rem;
    overflow: hidden;
  }
  .match-points-team .team-with-logo,
  .match-points-team .tbd {
    grid-column: 1;
    width: 100%;
    height: 1.75rem;
    max-height: 1.75rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .match-points-team .match-cup-round {
    grid-column: 2;
    margin: 0;
    justify-self: end;
    align-self: center;
  }
  .is-spectator .guest-result {
    margin-left: calc(2.4rem + 0.95rem);
    width: calc(100% - 2.4rem - 0.95rem);
  }
  .grid-inline { display: none; }
  .bracket-viewer .grid-inline { display: block; }
}

.bracket-viewer[hidden] { display: none !important; }
.bracket-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--sand);
}
body.bracket-viewer-open { overflow: hidden; }
.bracket-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.bracket-viewer-bar strong {
  display: block;
  font-size: 1rem;
}
.bracket-viewer-bar .meta { margin: 0.1rem 0 0; }
.bracket-viewer-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}
.bracket-viewer-canvas {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  padding: 0.35rem;
}
.bracket-viewer .bracket-wrap,
.bracket-viewer .deb-board,
.bracket-viewer .cross-wrap {
  overflow: visible;
  width: max-content;
  max-width: none;
  margin: 0;
}
.bracket-viewer .cross-corner,
.bracket-viewer .cross-row {
  background: transparent;
}
.bracket-viewer .bracket-stage,
.bracket-viewer .deb-stage,
.bracket-viewer .bracket-grid,
.bracket-viewer .deb-grid {
  width: max-content;
  max-width: none;
}
.bracket-viewer .bracket-grid {
  --bracket-row: 8rem;
  grid-template-columns: repeat(var(--bracket-cols), 15rem);
  column-gap: 1.7rem;
}
.bracket-viewer .bracket-grid.is-compact {
  --bracket-row: 7.2rem;
  grid-template-columns: repeat(var(--bracket-cols), 13rem);
  column-gap: 1.35rem;
}
.bracket-viewer .bracket-grid.is-editing {
  --bracket-row: 9.2rem;
}
.bracket-viewer .deb-grid {
  grid-template-columns: repeat(var(--deb-cols), 13rem) 13rem;
  column-gap: 1.15rem;
}

.theme-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  width: 3.15rem;
  height: 1.7rem;
  flex: none;
  padding: 0;
  border: 1.5px solid #1d1d1b;
  border-radius: 999px;
  background: #e7e4de;
  cursor: pointer;
}
.theme-switch > .theme-switch-sun,
.theme-switch > .theme-switch-moon {
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
  color: #e98e19;
}
.theme-switch > .theme-switch-moon { color: #1d1d1b; }
.theme-switch > .theme-switch-sun { opacity: 0; }
.theme-switch.is-dark > .theme-switch-sun { opacity: 1; }
.theme-switch.is-dark > .theme-switch-moon { opacity: 0; }
.theme-switch svg { display: block; }
.theme-switch-knob {
  position: absolute;
  z-index: 1;
  top: 0.12rem;
  left: 0.12rem;
  width: calc(50% - 0.18rem);
  height: calc(100% - 0.24rem);
  border-radius: 50%;
  border: 1.5px solid #1d1d1b;
  background: #fff;
  color: #e98e19;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  transition: left 0.2s ease;
}
.theme-switch-knob .theme-switch-moon { display: none; }
.theme-switch.is-dark .theme-switch-knob {
  left: calc(50% + 0.06rem);
  right: auto;
  background: #fff;
  border-color: #1d1d1b;
  color: #1d1d1b;
}
.theme-switch.is-dark .theme-switch-knob .theme-switch-sun { display: none; }
.theme-switch.is-dark .theme-switch-knob .theme-switch-moon { display: grid; }
html[data-theme="dark"] .theme-switch {
  background: #171614;
  border-color: #d5d0c8;
}
html[data-theme="dark"] .set-result-cell {
  background: #4e4b46;
  color: #fff;
  border-color: #d5d0c8;
  -webkit-text-stroke: 0;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --sand: #2e2c29;
  --ink: #f7f4ee;
  --muted: #d8d2c8;
  --line: #8a847a;
  --white: #3d3b37;
  --accent: #f0a33a;
  --accent-soft: #6a4a22;
  --live: #ff8b94;
  --live-soft: #6a3036;
  --win: #6ee7a0;
  --win-soft: #24583c;
}
html[data-theme="dark"] a,
html[data-theme="dark"] .site-footer-link,
html[data-theme="dark"] .switch a,
html[data-theme="dark"] .foot a {
  color: #f0a33a;
}
html[data-theme="dark"] .back-link { color: var(--muted); }
html[data-theme="dark"] .btn-secondary {
  color: var(--ink);
  border-color: #8a8378;
}
html[data-theme="dark"] .tab-btn { color: var(--ink); }
html[data-theme="dark"] .tab-btn.is-active,
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .timeline-step.active .timeline-num,
html[data-theme="dark"] .timeline-step.done .timeline-num {
  color: #1d1d1b;
}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color: var(--ink);
  background: #4a4743;
  border-color: #a0988c;
}
html[data-theme="dark"] ::placeholder { color: #b7b1a6; }
html[data-theme="dark"] .team-logo.team-logo-fallback,
html[data-theme="dark"] .standings-flow-pill,
html[data-theme="dark"] .ok,
html[data-theme="dark"] .cross-score.is-live,
html[data-theme="dark"] .pill {
  color: var(--ink);
}
html[data-theme="dark"] .pill-planned,
html[data-theme="dark"] .pill-draft,
html[data-theme="dark"] .pill-upcoming,
html[data-theme="dark"] .pill-scheduled,
html[data-theme="dark"] .pill-private {
  background: #3d3354;
  color: #e4d4ff;
}
html[data-theme="dark"] .pill-live,
html[data-theme="dark"] .pill-public {
  background: #24583c;
  color: #b6f0cb;
}
html[data-theme="dark"] .pill-finished {
  background: #4a4a4e;
  color: #e4e4e8;
}
html[data-theme="dark"] .wagon-handle {
  background:
    linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 2px,
    linear-gradient(var(--ink), var(--ink)) 0 6px / 100% 2px,
    linear-gradient(var(--ink), var(--ink)) 0 12px / 100% 2px;
  background-repeat: no-repeat;
}
html[data-theme="dark"] .standings-table tbody tr.is-gold td {
  background: #4e4324;
  border-color: #8a7340;
}
html[data-theme="dark"] .standings-table tbody tr.is-silver td {
  background: #3e444c;
  border-color: #6a727e;
}
html[data-theme="dark"] .standings-table tbody tr.is-bronze td {
  background: #4e3c2e;
  border-color: #8a6848;
}
html[data-theme="dark"] .standings-table tr.is-gold .standings-cell.standings-ratio,
html[data-theme="dark"] .standings-table tr.is-silver .standings-cell.standings-ratio,
html[data-theme="dark"] .standings-table tr.is-bronze .standings-cell.standings-ratio {
  background: rgba(46, 44, 41, 0.45);
}
html[data-theme="dark"] .match-row.is-finished,
html[data-theme="dark"] .team-check-row.is-disabled,
html[data-theme="dark"] .team-check-row.is-disabled:has(input:checked) {
  background: #34322f;
}
html[data-theme="dark"] .cross-self {
  background: #4a4844;
  border-color: #8a847a;
}
html[data-theme="dark"] .cross-score.is-pending { color: #d5d0c8; }
html[data-theme="dark"] .deb-final .bracket-match {
  background: #4a3c30;
  border-color: #8a6a50;
}
html[data-theme="dark"] .detail-chip { border-color: #8a6840; }
@media (max-width: 720px) {
  .cross-table { --cross-w: 5.5rem; --cross-h: 5.5rem; }
}

#printSheet {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 8mm 9mm 8mm;
  }
  body.is-printing > *:not(#printSheet) {
    display: none !important;
  }
  body.is-printing #printSheet {
    display: block !important;
  }
}

#printSheet {
  --ink: #1c1b19;
  --muted: #5c5852;
  --line: #cfc9bf;
  --white: #fff;
  --sand: #fff;
  --accent: #c56b00;
  --accent-soft: #fff4e5;
  --win: #146c3a;
  --win-soft: #e7f6ee;
  --live: #9b1c1c;
  color: #1c1b19;
  background: #fff;
  font-family: "Segoe UI", system-ui, sans-serif;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.print-head {
  margin: 0 0 2mm;
}
.print-head h1 {
  margin: 0;
  font-size: 13pt;
  line-height: 1.15;
  color: #1c1b19;
}
.print-head p {
  margin: 0.4mm 0 0;
  font-size: 8.5pt;
  color: #5c5852;
}
.print-group {
  margin: 1.6mm 0 0.6mm;
  font-size: 10pt;
  line-height: 1.2;
  break-after: avoid;
  page-break-after: avoid;
  color: #1c1b19;
}
.print-empty {
  margin: 2mm 0;
  font-size: 10pt;
  color: #5c5852;
}
#printSheet.is-matches .print-section + .print-section {
  break-before: page;
  page-break-before: always;
}
#printSheet.is-matches .print-match {
  display: grid;
  grid-template-columns: 8mm minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 2mm;
  height: 15.2mm;
  box-sizing: border-box;
  border-bottom: 0.25mm solid #d9d4cc;
  break-inside: avoid;
  page-break-inside: avoid;
}
#printSheet.is-matches .print-no {
  font-weight: 800;
  font-size: 11pt;
  text-align: center;
  color: #1c1b19;
}
#printSheet.is-matches .print-teams {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 0.2mm;
}
#printSheet.is-matches .print-teams strong {
  font-size: 10.5pt;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1c1b19;
}
#printSheet.is-matches .print-teams .print-meta {
  font-size: 7pt;
  line-height: 1.1;
  color: #5c5852;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#printSheet.is-matches .print-set-head {
  display: grid;
  grid-template-columns: 8mm minmax(0, 1fr) auto;
  column-gap: 2mm;
  align-items: end;
  height: 4mm;
  break-after: avoid;
  page-break-after: avoid;
}
#printSheet.is-matches .print-set-labels,
#printSheet.is-matches .print-sets {
  display: grid;
  grid-template-columns: repeat(var(--print-slots, 5), 11.5mm) 14.5mm;
  column-gap: 1.1mm;
  align-items: center;
}
#printSheet.is-matches .print-set-labels {
  font-size: 6.5pt;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  color: #6b6560;
}
#printSheet.is-matches .print-set-labels span {
  white-space: nowrap;
}
#printSheet.is-matches .print-set {
  display: flex;
  flex-direction: column;
  height: 11.2mm;
  border: 0.25mm solid #b7b1a7;
  border-radius: 0.4mm;
  background: #fff;
  overflow: hidden;
}
#printSheet.is-matches .print-set i {
  flex: 1 1 50%;
  border-bottom: 0.2mm solid #e2ddd6;
}
#printSheet.is-matches .print-set i:last-child {
  border-bottom: 0;
}
#printSheet.is-matches .print-result {
  display: flex;
  flex-direction: column;
  height: 12.2mm;
  margin-left: 1.6mm;
  border: 0.55mm solid #1c1b19;
  border-radius: 0.4mm;
  background: #e7e2d8;
  overflow: hidden;
}
#printSheet.is-matches .print-result i {
  flex: 1 1 50%;
  border-bottom: 0.35mm solid #1c1b19;
}
#printSheet.is-matches .print-result i:last-child {
  border-bottom: 0;
}
#printSheet.is-matches .print-set-labels .is-result {
  margin-left: 1.6mm;
  color: #1c1b19;
  font-weight: 800;
}
#printSheet.is-grid .print-grid-block + .print-grid-block {
  break-before: page;
  page-break-before: always;
}
#printSheet.is-grid .cross-wrap { overflow: visible; }
#printSheet.is-grid .cross-table {
  --cross-w: var(--print-cross-w, 22mm);
  --cross-h: var(--print-cross-h, 18mm);
  width: auto;
  max-width: 100%;
  border-spacing: 1.15mm;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 8pt;
  color: #1c1b19;
}
#printSheet.is-grid .cross-row,
#printSheet.is-grid .cross-corner {
  width: var(--print-name, 38mm);
  min-width: var(--print-name, 38mm);
  max-width: var(--print-name, 38mm);
  font-size: 8.5pt;
  font-weight: 600;
  line-height: 1.2;
  background: transparent !important;
  color: #1c1b19 !important;
  padding: 0 1.6mm 0 0;
}
#printSheet.is-grid .cross-corner {
  font-size: 7pt;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #6b6560 !important;
}
#printSheet.is-grid .cross-col {
  font-size: 8pt;
  font-weight: 600;
  line-height: 1.15;
  color: #1c1b19;
  white-space: normal;
}
#printSheet.is-grid .cross-caption {
  caption-side: bottom;
  margin: 2.5mm 0 0;
  font-size: 8pt;
  line-height: 1.3;
  text-align: left;
  color: #6b6560;
}
#printSheet.is-grid .cross-score {
  justify-content: center;
  align-items: center;
  gap: 1mm;
  padding: 1.2mm 0.8mm;
}
#printSheet.is-grid .cross-tally {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 11pt;
  font-weight: 700;
  line-height: 1;
  height: 4.6mm;
  font-variant-numeric: tabular-nums;
  color: #1c1b19;
}
#printSheet.is-grid .cross-sets {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  min-height: calc(var(--print-set-lines, 3) * var(--print-set-line, 2.6mm));
  height: calc(var(--print-set-lines, 3) * var(--print-set-line, 2.6mm));
  max-height: calc(var(--print-set-lines, 3) * var(--print-set-line, 2.6mm));
  overflow: hidden;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 7pt;
  font-weight: 500;
  line-height: var(--print-set-line, 2.6mm);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #4a463f;
}
#printSheet.is-grid .cross-sets span {
  display: block;
  height: var(--print-set-line, 2.6mm);
  line-height: var(--print-set-line, 2.6mm);
}
#printSheet.is-grid .cross-col,
#printSheet.is-grid .cross-table td,
#printSheet.is-grid .cross-score,
#printSheet.is-grid .cross-self {
  color: #1c1b19 !important;
  background: #fff !important;
  border-color: #d4cfc6 !important;
  box-shadow: none !important;
}
#printSheet.is-grid .cross-score,
#printSheet.is-grid .cross-self {
  border-radius: 0.8mm;
  border-width: 0.3mm;
  border-style: solid;
}
#printSheet.is-grid .cross-score.is-win,
#printSheet.is-grid .cross-score.is-loss,
#printSheet.is-grid .cross-score.is-live,
#printSheet.is-grid .cross-score.is-pending {
  border-color: #c8c2b8 !important;
}
#printSheet.is-grid .cross-score.is-loss,
#printSheet.is-grid .cross-score.is-loss .cross-tally {
  color: #1c1b19 !important;
}
#printSheet.is-grid .cross-score.is-pending,
#printSheet.is-grid .cross-score.is-pending .cross-tally {
  color: #8a847a !important;
  background: #fff !important;
}
#printSheet.is-grid .cross-self {
  background: #f4f1eb !important;
  border-color: transparent !important;
}
#printSheet.is-table .standings-wrap { overflow: visible; }
#printSheet.is-table .print-table-block {
  break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 6mm;
}
#printSheet.is-table .standings-board { margin: 0; }
#printSheet.is-table .standings-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 9.5pt;
  color: #1c1b19;
}
#printSheet.is-table .standings-table th,
#printSheet.is-table .standings-table td {
  height: var(--print-row, 8mm);
  padding: 0 1.6mm;
  border: 0;
  border-bottom: 0.2mm solid #e4dfd7;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #1c1b19 !important;
  background: #fff !important;
  font-family: "Segoe UI", system-ui, sans-serif;
}
#printSheet.is-table .standings-table thead th {
  height: auto;
  padding: 0 1.6mm 1.5mm;
  font-size: 7pt;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b6560 !important;
  background: transparent !important;
  border-bottom: 0.4mm solid #1c1b19;
}
#printSheet.is-table .standings-table .standings-team {
  font-size: 10pt;
  font-weight: 600;
  text-align: left;
  max-width: none;
}
#printSheet.is-table .standings-rank,
#printSheet.is-table .standings-cell,
#printSheet.is-table .standings-points-pill {
  display: inline;
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: #1c1b19 !important;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
}
#printSheet.is-table .standings-table tr.is-gold .standings-rank,
#printSheet.is-table .standings-table tr.is-silver .standings-rank,
#printSheet.is-table .standings-table tr.is-bronze .standings-rank,
#printSheet.is-table .standings-points-pill {
  font-weight: 800;
}
#printSheet.is-table .standings-table tbody tr.is-gold td,
#printSheet.is-table .standings-table tbody tr.is-silver td,
#printSheet.is-table .standings-table tbody tr.is-bronze td,
#printSheet.is-table .standings-table tbody tr.is-gold td:first-child,
#printSheet.is-table .standings-table tbody tr.is-silver td:first-child,
#printSheet.is-table .standings-table tbody tr.is-bronze td:first-child {
  background: #fff !important;
  box-shadow: none !important;
  border-color: #e4dfd7 !important;
}
#printSheet.is-table .print-order {
  margin: 1.5mm 0 0;
  font-size: 8pt;
  color: #6b6560;
}
#printSheet .team-logo,
#printSheet .team-logo.team-logo-fallback {
  display: none !important;
}
#printSheet .team-with-logo,
#printSheet .team-with-logo-name {
  display: inline;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  line-height: inherit;
  color: #1c1b19;
}
