:root {
  --bg: #101214;
  --panel: rgba(14, 17, 19, 0.88);
  --panel-light: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.11);
  --text: #f8f4eb;
  --muted: rgba(248, 244, 235, 0.68);
  --accent: #e0af5a;
  --danger: #ff8b8b;
  --accent-soft: rgba(224, 175, 90, 0.16);
  --accent-strong: rgba(224, 175, 90, 0.3);
  --panel-deep: rgba(255, 255, 255, 0.04);
  --panel-elevated: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(8, 10, 11, 0.7), rgba(8, 10, 11, 0.78)),
    radial-gradient(circle at top, rgba(224, 175, 90, 0.12), transparent 34%),
    url("background.png") center center / cover no-repeat fixed;
}

.page-live {
  overflow: visible;
}

.page {
  min-height: 100vh;
}

.simple-shell {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  gap: 24px;
}

.page-admin .simple-shell {
  width: min(1440px, calc(100% - 32px));
  gap: 28px;
}

.admin-login-card {
  width: min(720px, 100%);
  margin: auto;
}

.page-live .simple-shell {
  width: min(1440px, calc(100% - 32px));
  gap: 28px;
  min-height: 100vh;
  padding: 16px 0;
}

.simple-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px;
  backdrop-filter: blur(10px);
}

.simple-card.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.live-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 16px;
  min-height: calc(100vh - 32px);
  padding: 24px;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    var(--panel);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.live-access-card {
  width: min(560px, 100%);
  margin: auto;
  align-self: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0 0 10px;
}

.event-title {
  margin: 0 0 18px;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

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

.brand-logo {
  display: block;
  width: 112px;
  height: 112px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.32));
}

.brand-lockup-hero {
  margin-bottom: 18px;
}

.brand-lockup .eyebrow {
  margin-bottom: 8px;
}

.brand-lockup .event-title,
.brand-lockup .admin-title {
  margin-bottom: 0;
}

.brand-lockup-compact {
  gap: 14px;
}

.brand-lockup-compact .brand-logo {
  width: 64px;
  height: 64px;
}

.brand-lockup-live {
  gap: 14px;
}

.brand-lockup-live .brand-logo {
  width: 76px;
  height: 76px;
}

.utility-brand-logo {
  display: block;
  width: 104px;
  height: 104px;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.3));
}

.admin-title {
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.live-section-title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

.intro-text,
.form-note {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 8px;
}

.info-banner {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(216, 160, 59, 0.24);
  background: rgba(216, 160, 59, 0.08);
}

.info-banner strong {
  font-size: 1rem;
  color: var(--text);
}

.simple-form {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.field {
  display: grid;
  gap: 6px;
}

.form-separator {
  height: 1px;
  margin: 2px 0 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0)
  );
}

.field span {
  font-weight: 700;
}

.checkbox-field {
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
}

.field select option {
  color: #111;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: var(--danger);
}

.submit-row,
.admin-head,
.admin-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.live-head,
.live-status {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.live-head {
  margin-bottom: 0;
  align-items: flex-start;
}

.live-current-block,
.live-standings-block {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.live-groups-shell,
.live-bracket-shell {
  min-height: 0;
}

.live-bracket-shell {
  display: grid;
  gap: 14px;
}

.live-stage-head {
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.live-stage-indicator {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.live-stage-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: rgba(248, 244, 235, 0.52);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.live-stage-pill:hover,
.live-stage-pill:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #fff4dd;
  outline: none;
}

.live-stage-pill.is-active {
  background: rgba(224, 175, 90, 0.2);
  color: #fff4dd;
  box-shadow: inset 0 0 0 1px rgba(224, 175, 90, 0.18);
}

.live-stage-pill.is-active:hover,
.live-stage-pill.is-active:focus-visible {
  background: rgba(224, 175, 90, 0.28);
}

.live-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.live-stage-content {
  display: grid;
  min-height: 0;
}

.live-stage-panel {
  display: none;
  min-height: 0;
  animation: cardAppear 220ms ease;
}

.live-stage-panel.is-active {
  display: grid;
}

.live-current-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.live-current-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.live-current-card.is-live-now {
  background:
    linear-gradient(180deg, rgba(224, 175, 90, 0.15), rgba(224, 175, 90, 0.08)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(224, 175, 90, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(224, 175, 90, 0.08);
}

.live-current-card strong {
  font-size: 1.2rem;
  line-height: 1.2;
}

.live-table-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.live-table-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(224, 175, 90, 0.15);
  color: #fff0cf;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.live-current-section,
.live-upcoming-section {
  display: grid;
  gap: 8px;
  align-content: start;
}

.live-current-highlight {
  padding: 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.live-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 244, 235, 0.55);
}

.live-muted {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.live-upcoming-list {
  display: grid;
  gap: 8px;
}

.live-match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.live-match-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff3d2;
  letter-spacing: 0.04em;
}

.live-match-score span:nth-child(2) {
  color: rgba(255, 255, 255, 0.55);
}

.live-team-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff8ea;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.live-versus {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.live-upcoming-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.live-upcoming-item .live-team-pill {
  min-height: 38px;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.05);
}

.live-upcoming-item.live-current-highlight {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.05);
}

.live-empty {
  width: 100%;
}

.page-live .section-head {
  margin-bottom: 0;
}

.page-live .bracket-match {
  cursor: default;
}

.page-live .bracket-scroll {
  min-height: 0;
  overflow: auto hidden;
}

.page-live .simple-table-wrap {
  overflow: hidden;
}

.page-live .simple-table th,
.page-live .simple-table td {
  padding: 8px 8px;
  font-size: 0.92rem;
}

.page-live .simple-table thead th {
  background: rgba(12, 14, 16, 0.96);
}

.page-live .simple-table th {
  color: rgba(248, 244, 235, 0.54);
}

.page-live .standings-card {
  padding: 18px;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.page-live .group-card-head {
  gap: 8px;
  align-items: baseline;
}

.page-live .standings-table-wrap {
  min-height: 0;
}

.admin-mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  margin: 6px 0 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 10px;
  z-index: 20;
  width: fit-content;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.admin-mode-button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.admin-mode-button.is-active {
  background: rgba(215, 166, 86, 0.18);
  color: var(--text);
}

.admin-view-panel {
  display: none;
}

.admin-view-panel.is-active {
  display: grid;
  gap: 24px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.surface-block {
  padding: 26px 0 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.overview-stats-block {
  padding-top: 0;
  border-top: 0;
}

.page-admin #adminGroupsPanel .surface-block:first-child,
.page-admin #adminResultsPanel .surface-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.overview-table-block {
  display: grid;
  gap: 0;
}

.table-toolbar h3 {
  margin: 0;
}

.admin-head {
  margin-bottom: 4px;
}

.admin-actions {
  justify-content: flex-end;
}

.action-toast {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(82, 196, 124, 0.14);
  border: 1px solid rgba(82, 196, 124, 0.28);
  color: var(--text);
}

.stats-grid {
  display: grid;
  gap: 12px;
  margin: 4px 0 0;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-box {
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.stat-box strong {
  font-size: 1.75rem;
  margin-bottom: 6px;
}

.status-box strong {
  font-size: 1.2rem;
  line-height: 1.15;
}

.status-box span {
  line-height: 1.4;
}

.status-box[data-status="registration"],
.status-box[data-status="groups_ready"] {
  background: rgba(255, 255, 255, 0.06);
}

.status-box[data-status="groups"] {
  background: rgba(79, 164, 255, 0.14);
  border-color: rgba(79, 164, 255, 0.28);
}

.status-box[data-status="groups_complete"] {
  background: rgba(224, 175, 90, 0.14);
  border-color: rgba(224, 175, 90, 0.28);
}

.status-box[data-status="bracket"] {
  background: rgba(186, 106, 255, 0.14);
  border-color: rgba(186, 106, 255, 0.28);
}

.status-box[data-status="completed"] {
  background: rgba(82, 196, 124, 0.14);
  border-color: rgba(82, 196, 124, 0.3);
}

.simple-table-wrap {
  overflow-x: auto;
  margin-top: 0;
}

.simple-table thead th {
  position: sticky;
  top: 0;
  background: rgba(22, 22, 22, 0.94);
  z-index: 1;
}

.simple-table th {
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
}

.simple-table td {
  font-size: 0.96rem;
}

.simple-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.section-head h3 {
  margin: 0;
  font-size: 1.18rem;
}

.button-primary,
.button-secondary,
.button-edit,
.button-delete {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: #171717;
  font-weight: 800;
  border: 0;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.button-primary:disabled,
.button-secondary:disabled,
.button-edit:disabled,
.button-delete:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  filter: grayscale(0.4);
}

.button-primary:disabled:hover,
.button-secondary:disabled:hover {
  background: var(--accent);
}

.button-secondary:disabled:hover {
  background: rgba(255, 255, 255, 0.08);
}

.button-delete {
  background: rgba(188, 52, 52, 0.2);
  color: #ffd6d6;
  border-color: rgba(255, 114, 114, 0.34);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button-delete:hover {
  background: rgba(214, 70, 70, 0.3);
  border-color: rgba(255, 144, 144, 0.54);
  transform: translateY(-1px);
}

.button-edit {
  background: rgba(216, 160, 59, 0.16);
  color: #fff1ce;
  border-color: rgba(216, 160, 59, 0.34);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button-edit:hover {
  background: rgba(216, 160, 59, 0.26);
  border-color: rgba(236, 189, 93, 0.5);
  transform: translateY(-1px);
}

.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
}

.success-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 40;
}

.modal-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: rgba(24, 24, 24, 0.96);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.modal-close {
  flex-shrink: 0;
}

.success-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.success-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 1;
}

.throw-ball {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3d8 0 26%, #e4a643 30%, #9a5d17 88%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
  opacity: 0;
  will-change: transform, opacity;
}

.hit-cup {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 96px;
  height: 130px;
  z-index: 2;
  transform: translate(-50%, -50%);
  background: linear-gradient(180deg, #d93c32, #9e1f1f);
  clip-path: polygon(12% 0%, 88% 0%, 74% 100%, 26% 100%);
  border-radius: 10px 10px 18px 18px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
  will-change: transform, opacity;
}

.cup-rim {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 58px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 239, 219, 0.45);
}

.cup-splash {
  position: absolute;
  left: 50%;
  top: calc(52% - 42px);
  width: 180px;
  height: 90px;
  z-index: 3;
  transform: translateX(-50%) scale(0.2);
  opacity: 0;
  background:
    radial-gradient(circle at 20% 75%, rgba(255, 226, 154, 0.9), transparent 18%),
    radial-gradient(circle at 50% 30%, rgba(255, 226, 154, 0.95), transparent 24%),
    radial-gradient(circle at 80% 72%, rgba(255, 226, 154, 0.9), transparent 16%);
  filter: blur(2px);
}

.confetti-layer {
  position: absolute;
  left: 0;
  top: -20%;
  width: 100%;
  height: 120%;
  opacity: 0;
}

.confetti-layer::before,
.confetti-layer::after {
  content: "";
  position: absolute;
  top: 0;
  width: 10px;
  height: 22px;
  border-radius: 999px;
  background: #f0b23d;
  box-shadow:
    0 0 0 #f0b23d,
    60px 20px 0 #ffffff,
    120px -10px 0 #d93c32,
    180px 40px 0 #f0b23d,
    240px 10px 0 #ffffff,
    300px -20px 0 #d93c32,
    360px 30px 0 #f0b23d,
    460px -10px 0 #ffffff,
    560px 34px 0 #d93c32,
    660px 6px 0 #f0b23d,
    760px 28px 0 #ffffff,
    860px -18px 0 #d93c32,
    960px 24px 0 #f0b23d,
    1060px -6px 0 #ffffff,
    1160px 22px 0 #d93c32,
    1260px -16px 0 #f0b23d,
    1360px 18px 0 #ffffff,
    1460px 0 0 #d93c32,
    1560px 32px 0 #f0b23d,
    1660px -12px 0 #ffffff,
    1760px 20px 0 #d93c32,
    1860px -8px 0 #f0b23d,
    1920px 18px 0 #ffffff;
}

.confetti-layer::after {
  left: 0;
  background: #ffffff;
  box-shadow:
    0 12px 0 #ffffff,
    70px -10px 0 #d93c32,
    140px 30px 0 #f0b23d,
    210px -15px 0 #ffffff,
    280px 24px 0 #d93c32,
    350px 4px 0 #f0b23d,
    420px -18px 0 #ffffff,
    520px 18px 0 #d93c32,
    620px -8px 0 #f0b23d,
    720px 26px 0 #ffffff,
    820px -14px 0 #d93c32,
    920px 12px 0 #f0b23d,
    1020px -20px 0 #ffffff,
    1120px 30px 0 #d93c32,
    1220px 6px 0 #f0b23d,
    1320px -12px 0 #ffffff,
    1420px 20px 0 #d93c32,
    1520px -4px 0 #f0b23d,
    1620px 28px 0 #ffffff,
    1720px -16px 0 #d93c32,
    1820px 14px 0 #f0b23d,
    1880px -10px 0 #ffffff,
    1940px 22px 0 #d93c32;
}

.success-overlay.is-animating .hit-cup {
  animation: cupHit 0.55s ease 1.08s forwards;
}

.success-overlay.is-animating .cup-splash {
  animation: splashOut 0.55s ease 1.12s forwards;
}

.success-overlay.is-animating .confetti-left,
.success-overlay.is-animating .confetti-right {
  animation: confettiDrop 1.7s linear 1.12s forwards;
}

.success-overlay.is-animating .success-stage {
  animation: stageFade 0.26s ease 1.42s forwards;
}

.success-overlay.is-animating .confirmation-card {
  animation: cardAppear 0.35s ease 1.4s forwards;
}

.confirmation-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  padding: 24px;
  border-radius: 18px;
  background: #1f1f1f;
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(16px);
}

.recap-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin: 18px 0;
}

.recap-list dt {
  color: var(--accent);
  font-weight: 700;
}

.recap-list dd {
  margin: 0;
}

.admin-dashboard.is-locked {
  display: none;
}

.group-board-block,
.group-assignment-block,
.results-overview-block,
.results-standings-block,
.group-matches-block {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

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

.results-standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.page-live .results-standings-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.results-overview-card,
.standings-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.results-overview-card strong,
.standings-card .group-card-head strong {
  font-size: 1.02rem;
}

.results-overview-card > span {
  color: var(--muted);
}

.standings-table-wrap {
  margin-top: 0;
}

.standings-table {
  table-layout: fixed;
  width: 100%;
}

.standings-table th,
.standings-table td {
  padding: 10px 8px;
}

.standings-table th:nth-child(1),
.standings-table td:nth-child(1) {
  width: 36px;
  text-align: right;
}

.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  width: auto;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standings-table th:nth-child(3),
.standings-table td:nth-child(3),
.standings-table th:nth-child(4),
.standings-table td:nth-child(4),
.standings-table th:nth-child(5),
.standings-table td:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-left: 6px;
  padding-right: 6px;
}

.standings-table th:nth-child(3),
.standings-table td:nth-child(3) {
  width: 44px;
}

.standings-table th:nth-child(4),
.standings-table td:nth-child(4) {
  width: 48px;
}

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

.results-rounds {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.results-round-card {
  display: grid;
  gap: 8px;
  padding: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  overflow: hidden;
  transition: background 160ms ease, border-color 160ms ease;
}

.results-round-card.is-active-overview-match {
  background: rgba(216, 160, 59, 0.16);
  border-color: rgba(216, 160, 59, 0.34);
}

.results-round-card.is-played-overview-match {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.results-round-toggle {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: background 160ms ease;
}

.results-round-toggle:hover,
.results-round-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.results-round-card.is-active-overview-match .results-round-toggle:hover,
.results-round-card.is-active-overview-match .results-round-toggle:focus-visible {
  background: rgba(216, 160, 59, 0.12);
}

.results-round-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.round-card-score {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.round-card-score span {
  color: var(--muted);
  font-weight: 600;
}

.results-round-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  padding: 0 14px 14px;
}

.results-round-editor .score-field span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.results-round-editor .score-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.results-round-editor .score-field-compact {
  align-content: end;
}

.results-round-editor .score-field-compact span {
  display: block;
  text-align: center;
  font-weight: 800;
  color: #fff5db;
}

.results-round-editor .score-field-compact input {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
}

.results-round-editor .score-field-compact input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.results-round-editor .button-primary,
.results-round-editor .button-compact {
  grid-column: 1 / -1;
}

.results-round-editor .match-note {
  grid-column: 1 / -1;
  min-height: 18px;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .results-round-editor {
    grid-template-columns: 1fr 1fr;
  }
  .results-round-editor .button-primary,
  .results-round-editor .button-compact {
    grid-column: 1 / -1;
  }

  .page-live {
    overflow: visible;
  }

  .page-live .simple-shell {
    min-height: 0;
    padding: 12px 0;
  }

  .live-card {
    grid-template-rows: none;
    min-height: 0;
    overflow: visible;
    padding: 18px;
    gap: 14px;
  }

  .live-card > * {
    min-height: 0;
  }
}

.results-round-card strong {
  font-size: 0.9rem;
}

.results-round-matches {
  display: grid;
  gap: 4px;
}

.results-round-matches small {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-round-matches span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  word-break: break-word;
}

.group-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.group-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.group-card.is-unassigned {
  background: rgba(216, 160, 59, 0.08);
  border-color: rgba(216, 160, 59, 0.18);
}

.group-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-card-head strong {
  font-size: 1.02rem;
}

.group-card-head span,
.group-team small,
.group-empty {
  color: var(--muted);
}

.group-card-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.group-card-picker {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.group-card-picker select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.6) 50%),
                    linear-gradient(-45deg, transparent 50%, rgba(255,255,255,0.6) 50%);
  background-position: right 14px top 50%, right 8px top 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.group-card-picker select:hover,
.group-card-picker select:focus-visible {
  background-color: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
  outline: none;
}

.group-card-picker select:disabled {
  opacity: 0.5;
  cursor: wait;
}

.group-card-picker option {
  background: #1a1a1a;
  color: var(--text);
}

.group-matches-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.match-group-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.group-match-list {
  display: grid;
  align-content: start;
  gap: 8px;
}

.group-match {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.group-match.is-active-match {
  background: rgba(215, 166, 86, 0.13);
  border-color: rgba(215, 166, 86, 0.28);
  box-shadow: none;
}

.group-match strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.group-match-top {
  display: grid;
  gap: 4px;
}

.group-match-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 6px;
}

.score-field {
  display: grid;
  gap: 6px;
}

.score-field span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.score-field input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(216, 160, 59, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
}

.button-compact {
  min-height: 42px;
  padding: 0 14px;
}

.match-note {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.group-match-order {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.group-team {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.group-team-info {
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.group-team-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.group-team-remove:hover,
.group-team-remove:focus-visible {
  background: rgba(255, 139, 139, 0.18);
  border-color: rgba(255, 139, 139, 0.45);
  color: #ffd6d6;
  outline: none;
}

.group-team-remove:disabled {
  opacity: 0.4;
  cursor: wait;
}

.group-team-name {
  display: block;
  font-weight: 800;
  color: #fff5db;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-empty {
  align-self: start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
}

.simple-table th,
.simple-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.team-name-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(215, 166, 86, 0.1);
  border: 1px solid rgba(215, 166, 86, 0.18);
  color: #fff3d2;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-select-wrap {
  display: block;
  min-width: 138px;
}

.group-select {
  width: 100%;
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(216, 160, 59, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
}

.group-select option {
  color: #111;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table-actions .button-edit,
.table-actions .button-delete {
  min-height: 40px;
  padding: 0 14px;
}

.chart-block {
  margin-top: 0;
}

.drink-chart {
  display: grid;
  gap: 12px;
}

.drink-bar {
  display: grid;
  gap: 6px;
}

.drink-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.drink-bar-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.drink-bar-fill {
  height: 100%;
  background: var(--accent);
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(216, 160, 59, 0.18);
  color: var(--text);
}

.error-shell,
.diagnose-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.error-card,
.diagnose-card {
  width: min(720px, 100%);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.error-code {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
}

.error-actions,
.diagnose-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.diagnose-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  background: var(--panel-light);
  border: 1px solid var(--border);
}

@keyframes cupHit {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 1;
  }
  25% {
    transform: translate(-50%, -50%) rotate(-8deg);
  }
  50% {
    transform: translate(-50%, -50%) rotate(7deg);
  }
  75% {
    transform: translate(-50%, -50%) rotate(-4deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0;
  }
}

@keyframes splashOut {
  0% {
    transform: translateX(-50%) scale(0.2);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(1.15) translateY(-12px);
    opacity: 0;
  }
}

@keyframes confettiDrop {
  0% {
    opacity: 0;
    transform: translateY(-40px);
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh);
  }
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stageFade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .brand-lockup-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .brand-lockup-hero .brand-logo {
    width: 88px;
    height: 88px;
  }

  .brand-lockup-compact .brand-logo,
  .brand-lockup-live .brand-logo {
    width: 58px;
    height: 58px;
  }

  .simple-shell {
    width: min(100% - 20px, 100%);
    padding: 20px 0;
  }

  .simple-card,
  .confirmation-card,
  .error-card,
  .diagnose-card {
    padding: 22px;
  }

  .page-admin .simple-shell {
    width: min(100% - 20px, 100%);
  }

  .page-live .simple-shell {
    width: min(100% - 20px, 100%);
    min-height: 100vh;
    padding: 10px 0;
  }

  .submit-row,
  .admin-head,
  .admin-actions {
    align-items: stretch;
  }

  .page-admin .admin-mode-switch {
    display: flex;
    width: 100%;
    overflow-x: auto;
    padding: 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    scrollbar-width: none;
  }

  .page-admin .admin-mode-switch::-webkit-scrollbar {
    display: none;
  }

  .page-admin .admin-mode-button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .button-primary,
  .button-secondary {
    width: 100%;
  }

  .page-admin .admin-actions .button-secondary,
  .page-admin .table-actions .button-edit,
  .page-admin .table-actions .button-delete {
    width: auto;
  }

  .page-admin .simple-card {
    padding: 18px;
  }

  .page-admin .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-admin .simple-table th,
  .page-admin .simple-table td {
    padding: 10px 8px;
    font-size: 0.92rem;
  }

  .page-admin .group-board {
    grid-template-columns: 1fr;
  }

  .page-admin .results-overview-grid {
    grid-template-columns: 1fr;
  }

  .page-live .live-current-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .page-live .live-match-teams {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .page-live .live-team-pill {
    min-height: 42px;
    font-size: 0.98rem;
  }

  .page-live .live-versus {
    justify-self: center;
  }

  .page-live .live-upcoming-item {
    grid-template-columns: 1fr;
  }

  .page-admin .results-standings-grid {
    grid-template-columns: 1fr;
  }

  .page-live .results-standings-grid {
    grid-template-columns: 1fr;
  }

  .page-live .live-card {
    min-height: calc(100vh - 20px);
    padding: 16px;
    gap: 12px;
  }

  .page-live .event-title {
    margin-bottom: 0;
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .page-live .live-timer-block {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 14px;
    text-align: center;
  }

  .page-live .live-timer-state {
    width: 100%;
    text-align: center;
  }

  .page-live .live-stage-pill {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.72rem;
  }

  .page-live .live-current-card,
  .page-live .standings-card {
    padding: 14px;
  }

  .page-live .simple-table th,
  .page-live .simple-table td {
    padding: 7px 6px;
    font-size: 0.84rem;
  }

  .page-admin .group-matches-list {
    grid-template-columns: 1fr;
  }

  .page-admin .team-name-badge {
    min-height: 32px;
    padding: 5px 10px;
  }

  .page-admin .group-select-wrap {
    min-width: 124px;
  }

  .page-admin .group-match-score {
    grid-template-columns: 1fr;
  }

  .page-admin .table-actions {
    flex-wrap: wrap;
    white-space: normal;
    min-width: 144px;
  }

  .page-admin .table-actions .button-edit,
  .page-admin .table-actions .button-delete {
    flex: 1 1 100%;
    min-height: 38px;
    padding: 0 12px;
  }

  .page-admin .modal-card {
    padding: 20px;
  }

  .page-admin .modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .recap-list {
    grid-template-columns: 1fr;
  }

  .page-admin .bracket {
    gap: 18px;
  }

  .page-admin .bracket-round {
    min-width: 180px;
  }
}

.settings-bracket-mode {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.settings-bracket-mode legend {
  padding: 0;
  margin: 0 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-backup-zone {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(79, 164, 255, 0.08);
  border: 1px solid rgba(79, 164, 255, 0.16);
}

.settings-backup-zone strong {
  display: block;
  margin-bottom: 4px;
}

.settings-backup-actions {
  justify-content: flex-start;
}

.settings-danger-zone {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 139, 139, 0.08);
  border: 1px solid rgba(255, 139, 139, 0.16);
}

.settings-danger-zone strong {
  display: block;
  margin-bottom: 4px;
}

.settings-danger-actions {
  justify-content: flex-start;
}

.segmented-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.segmented-option {
  display: block;
  cursor: pointer;
  position: relative;
}

.segmented-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.segmented-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.segmented-option:hover .segmented-card {
  background: rgba(255, 255, 255, 0.05);
}

.segmented-option input[type="radio"]:focus-visible + .segmented-card {
  outline: 2px solid rgba(215, 166, 86, 0.7);
  outline-offset: 2px;
}

.segmented-option input[type="radio"]:checked + .segmented-card {
  background: rgba(215, 166, 86, 0.16);
  border-color: rgba(215, 166, 86, 0.42);
  box-shadow: 0 0 0 1px rgba(215, 166, 86, 0.12);
}

.segmented-title {
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}

.segmented-meta {
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.segmented-option input[type="radio"]:checked + .segmented-card .segmented-meta {
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 520px) {
  .segmented-toggle {
    grid-template-columns: 1fr;
  }
}

.round-timer-block .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.round-timer-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.round-timer-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.round-timer-display {
  font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: var(--muted);
  min-width: 140px;
  text-align: center;
}

.round-timer-display.is-running {
  background: rgba(215, 166, 86, 0.18);
  border-color: rgba(215, 166, 86, 0.42);
  color: var(--text);
}

.round-timer-display.is-ended {
  background: rgba(255, 139, 139, 0.18);
  border-color: rgba(255, 139, 139, 0.42);
  color: var(--text);
}

.live-timer-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0;
  border-top: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.live-timer-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(248, 244, 235, 0.55);
}

.live-timer-display {
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.8rem, 7vw, 4.2rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1;
  color: #fff7ea;
  flex: 1 1 auto;
  text-align: center;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.26);
}

.live-timer-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.live-connection-status,
.bracket-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.live-connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.live-connection-status.is-current {
  color: #8ee0a7;
  background: rgba(82, 196, 124, 0.12);
  border-color: rgba(82, 196, 124, 0.3);
}

.live-connection-status.is-connecting,
.live-connection-status.is-stale,
.bracket-state-badge.is-preview {
  color: #f2cb87;
  background: rgba(224, 175, 90, 0.12);
  border-color: rgba(224, 175, 90, 0.3);
}

.live-connection-status.is-offline {
  color: #ffadad;
  background: rgba(255, 139, 139, 0.13);
  border-color: rgba(255, 139, 139, 0.36);
}

.bracket-state-badge {
  min-height: 30px;
  margin: 2px 0 8px;
  padding: 0 10px;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.bracket-state-badge.is-locked {
  color: #8ee0a7;
  background: rgba(82, 196, 124, 0.12);
  border-color: rgba(82, 196, 124, 0.3);
}

.live-sound-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.live-sound-icon:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.live-sound-icon:active {
  transform: scale(0.95);
}

.live-sound-icon.is-active {
  background: rgba(215, 166, 86, 0.22);
  border-color: rgba(215, 166, 86, 0.45);
  cursor: default;
}

.live-sound-icon.is-active:hover {
  background: rgba(215, 166, 86, 0.22);
  border-color: rgba(215, 166, 86, 0.45);
}

.live-timer-block.is-running {
  background:
    linear-gradient(180deg, rgba(224, 175, 90, 0.17), rgba(224, 175, 90, 0.08)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(224, 175, 90, 0.36);
}

.live-timer-block.is-running .live-timer-state {
  color: #fff1d3;
  background: rgba(224, 175, 90, 0.15);
  border-color: rgba(224, 175, 90, 0.28);
}

.live-timer-block.is-ended {
  background:
    linear-gradient(180deg, rgba(255, 139, 139, 0.16), rgba(255, 139, 139, 0.08)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 139, 139, 0.5);
}

.live-timer-block.is-ended .live-timer-state {
  color: var(--danger);
  background: rgba(255, 139, 139, 0.12);
  border-color: rgba(255, 139, 139, 0.24);
}

.bracket-block {
  display: grid;
  gap: 14px;
}

.bracket-block .section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.bracket-mode-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.bracket-mode-button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.bracket-mode-button.is-active {
  background: rgba(215, 166, 86, 0.18);
  color: var(--text);
}

.bracket-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.qualification-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.qualification-summary.is-empty {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.qualification-summary-group {
  display: grid;
  gap: 6px;
}

.qualification-summary-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.qualification-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qualification-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.qualification-chip.is-wildcard {
  background: rgba(216, 160, 59, 0.14);
  border-color: rgba(216, 160, 59, 0.26);
}

.qualification-chip-seed {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.qualification-chip-name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.88rem;
}

.bracket-scroll {
  overflow-x: auto;
  padding: 8px 4px 16px;
  margin: 0 -4px;
}

.bracket {
  display: flex;
  align-items: stretch;
  gap: 36px;
  min-width: max-content;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  flex: 0 0 220px;
  position: relative;
}

.bracket-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: stretch;
  min-height: 140px;
  padding: 6px 0;
}

.bracket-cell .bracket-match {
  width: 100%;
}

.bracket-round-label {
  position: absolute;
  top: -22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.bracket-match {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.bracket-match:not(.is-disabled):hover,
.bracket-match:not(.is-disabled):focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  outline: none;
}

.bracket-match:not(.is-disabled):active {
  transform: scale(0.99);
}

.bracket-match.is-disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.bracket-match.has-result {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.14);
}

.bracket-slot-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.bracket-slot-row .bracket-slot {
  flex: 1 1 auto;
  min-width: 0;
}

.bracket-score {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}

.bracket-modal-score {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.bracket-match-meta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.bracket-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 38px;
  font-size: 0.92rem;
  line-height: 1.25;
}

.bracket-slot.is-tbd {
  color: var(--muted);
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
}

.bracket-slot.is-winner {
  background: rgba(215, 166, 86, 0.16);
  border-color: rgba(215, 166, 86, 0.42);
  color: var(--text);
  font-weight: 700;
}

.bracket-slot-seed {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.bracket-slot-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Incoming horizontal stub on each match (from previous round) */
.bracket-round + .bracket-round .bracket-cell::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 18px;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}

/* Brace going right: upper half of a pair (top cell) */
.bracket-round:not([data-last-round="true"]) .bracket-cell[data-cell-position="top"]::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 50%;
  bottom: 0;
  width: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-top-right-radius: 6px;
}

/* Brace going right: lower half of a pair (bottom cell) */
.bracket-round:not([data-last-round="true"]) .bracket-cell[data-cell-position="bottom"]::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: 50%;
  top: 0;
  width: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom-right-radius: 6px;
}

.bracket-empty {
  padding: 18px;
  color: var(--muted);
  font-style: italic;
}

.payment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.payment-toggle:hover,
.payment-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
  outline: none;
}

.payment-toggle.is-paid {
  background: rgba(120, 220, 140, 0.16);
  border-color: rgba(120, 220, 140, 0.5);
  color: #d5f7dc;
}

.payment-toggle.is-paid:hover,
.payment-toggle.is-paid:focus-visible {
  background: rgba(120, 220, 140, 0.22);
  border-color: rgba(120, 220, 140, 0.65);
}

.payment-toggle-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 900;
  font-size: 0.72rem;
  color: transparent;
}

.payment-toggle.is-paid .payment-toggle-dot {
  background: rgba(120, 220, 140, 0.5);
  border-color: rgba(120, 220, 140, 0.85);
  color: #0f2a17;
}

.payment-toggle:disabled {
  opacity: 0.5;
  cursor: wait;
}

.checkbox-field {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

.checkbox-field span {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}

.results-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.results-shuffle-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.results-shuffle-button:hover,
.results-shuffle-button:focus-visible {
  background: rgba(215, 166, 86, 0.18);
  border-color: rgba(215, 166, 86, 0.4);
  color: var(--text);
  outline: none;
}

.results-shuffle-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.page-timer {
  min-height: 100vh;
}

.timer-shell {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}

.timer-stage {
  margin-block: auto;
}

.timer-sound-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}

.timer-brand-logo {
  position: absolute;
  top: 22px;
  left: 24px;
  z-index: 5;
  width: clamp(68px, 10vw, 104px);
  height: clamp(68px, 10vw, 104px);
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.34));
}

.timer-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: min(84vmin, 720px);
  max-width: 100%;
}

.timer-label {
  font-size: clamp(0.9rem, 1.6vw, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.timer-stage.is-running .timer-label {
  color: var(--accent);
}

.timer-stage.is-ended .timer-label {
  color: var(--danger);
}

.timer-ring-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.timer-ring {
  width: 100%;
  height: 100%;
  display: block;
}

.timer-ring-track {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 10;
}

.timer-ring-progress {
  stroke: var(--accent);
  stroke-width: 12;
  stroke-linecap: round;
  transition:
    stroke-dashoffset 260ms ease,
    stroke 260ms ease;
  filter: drop-shadow(0 0 18px rgba(215, 166, 86, 0.35));
}

.timer-stage.is-idle .timer-ring-progress {
  stroke: rgba(255, 255, 255, 0.25);
  filter: none;
}

.timer-stage.is-ended .timer-ring-progress {
  stroke: var(--danger);
  filter: drop-shadow(0 0 22px rgba(255, 139, 139, 0.4));
}

.timer-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.timer-time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: clamp(3.4rem, 17vmin, 12rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
}

.timer-stage.is-ended .timer-time {
  color: var(--danger);
}

.timer-substate {
  font-size: clamp(0.9rem, 1.8vmin, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.timer-stage.is-running .timer-substate {
  color: var(--accent);
}

.timer-stage.is-ended .timer-substate {
  color: var(--danger);
}

@media (max-width: 640px) {
  .timer-shell {
    padding: 16px;
  }
  .timer-brand-logo {
    top: 12px;
    left: 12px;
    width: 62px;
    height: 62px;
  }
  .timer-sound-icon {
    top: 14px;
    right: 14px;
  }
}
