:root {
  --ink: #eef2fb;
  --muted: #8d9ab5;
  --muted-strong: #b9c4d9;
  --canvas: #0b1020;
  --surface: #121a2e;
  --surface-raised: #18233c;
  --surface-soft: #10182a;
  --line: #263451;
  --line-bright: #344463;
  --yellow: #f4bf38;
  --yellow-soft: rgba(244, 191, 56, 0.14);
  --red: #ff765f;
  --red-soft: rgba(255, 118, 95, 0.14);
  --blue: #62a7ff;
  --blue-soft: rgba(98, 167, 255, 0.14);
  --green: #6de0af;
  --shadow: 0 22px 60px rgba(3, 7, 18, 0.28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 82% 6%, rgba(43, 78, 145, 0.22), transparent 30rem),
    radial-gradient(circle at 0% 32%, rgba(35, 69, 116, 0.12), transparent 27rem),
    var(--canvas);
}

button,
input,
select {
  font: inherit;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar,
.page,
.footer {
  width: min(1440px, calc(100% - 72px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  border-bottom: 1px solid rgba(67, 85, 120, 0.38);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(244, 191, 56, 0.68);
  border-radius: 12px 4px 12px 4px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-overline,
.brand-title {
  display: block;
}

.brand-overline {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-title {
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.topbar-actions,
.mode-pill,
.connection-label,
.loaded-badge {
  display: inline-flex;
  align-items: center;
}

.topbar-actions {
  gap: 20px;
}

.mode-pill {
  gap: 7px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(244, 191, 56, 0.24);
  border-radius: 999px;
  color: #f5d477;
  background: rgba(244, 191, 56, 0.06);
  font-size: 11px;
  font-weight: 700;
}

.mode-dot,
.connection-dot,
.loaded-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(244, 191, 56, 0.11);
}

.text-button,
.secondary-button,
.primary-button,
.icon-button {
  border: 0;
}

.text-button {
  padding: 8px 0;
  color: var(--muted-strong);
  background: transparent;
  font-size: 12px;
  transition: color 160ms ease;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--ink);
}

.page {
  padding: 70px 0 40px;
}

.settings-page {
  min-height: calc(100vh - 150px);
}

.settings-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.settings-header h1 {
  margin: 13px 0 10px;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 56px);
  letter-spacing: -0.06em;
  line-height: 1;
}

.settings-copy {
  max-width: 590px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.settings-card {
  max-width: 920px;
  padding: 25px;
}

.settings-current {
  max-width: 230px;
  color: var(--yellow);
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}

.settings-template-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 24px;
}

.settings-template-switcher .template-tab {
  min-height: 82px;
  padding: 14px;
}

.settings-template-switcher .template-tab strong {
  font-size: 12px;
}

.settings-template-switcher .template-tab small {
  font-size: 9px;
}

.settings-note {
  max-width: 680px;
  margin: 17px 0 0;
  color: #71809b;
  font-size: 10px;
  line-height: 1.55;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 195px;
  padding: 8px 4px 28px;
}

.eyebrow,
.section-number,
.paper-kicker {
  margin: 0;
  color: var(--yellow);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 18px 0 12px;
  color: #f7f9fd;
  font-size: clamp(37px, 5.6vw, 77px);
  font-weight: 770;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.hero-orbit {
  position: relative;
  width: 190px;
  height: 150px;
  margin-right: 80px;
  opacity: 0.9;
}

.orbit-line {
  position: absolute;
  display: block;
  border: 1px solid rgba(98, 167, 255, 0.42);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.orbit-line-one {
  inset: 24px -4px 20px 4px;
}

.orbit-line-two {
  inset: 6px 26px 3px -28px;
  border-color: rgba(244, 191, 56, 0.42);
  transform: rotate(39deg);
}

.orbit-core {
  position: absolute;
  top: 48px;
  left: 70px;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(244, 191, 56, 0.7);
  border-radius: 50%;
  color: var(--yellow);
  background: var(--surface);
  box-shadow: 0 0 0 9px rgba(244, 191, 56, 0.06), 0 0 40px rgba(98, 167, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.card,
.rules-card {
  border: 1px solid rgba(50, 68, 101, 0.86);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(23, 34, 58, 0.94), rgba(13, 21, 38, 0.98));
  box-shadow: var(--shadow);
}

.import-card {
  padding: 24px 27px 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.compact-heading {
  align-items: center;
}

.section-heading h2,
.rules-card h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 730;
  letter-spacing: -0.035em;
}

.connection-label {
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.connection-dot {
  width: 6px;
  height: 6px;
  background: #ed8e71;
  box-shadow: 0 0 0 4px rgba(237, 142, 113, 0.1);
}

.import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 13px;
  align-items: end;
  margin-top: 22px;
}

.input-field,
.search-field,
.select-field {
  display: grid;
  gap: 8px;
}

.input-field > span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 680;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: rgba(7, 12, 26, 0.4);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input {
  padding: 0 14px;
}

input::placeholder {
  color: #6d7a95;
}

select {
  padding: 0 32px 0 12px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8493ad 50%), linear-gradient(135deg, #8493ad 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(244, 191, 56, 0.15);
  outline: none;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 760;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  min-width: 150px;
  color: #171304;
  background: var(--yellow);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #ffd15c;
  transform: translateY(-1px);
}

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

.primary-button.is-loading {
  cursor: wait;
  opacity: 0.8;
}

.button-arrow {
  font-size: 16px;
  line-height: 1;
}

.secondary-button {
  border: 1px solid var(--line-bright);
  color: var(--muted-strong);
  background: rgba(9, 15, 30, 0.32);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--yellow);
  color: var(--ink);
  background: var(--yellow-soft);
}

.import-note,
.preview-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.import-note {
  margin-top: 15px;
}

.import-note[data-tone="error"] {
  color: #ffb2a3;
}

.import-note[data-tone="error"] .note-icon {
  border-color: rgba(255, 118, 95, 0.45);
  color: var(--red);
}

.import-note[data-tone="success"] {
  color: #a8e9cf;
}

.import-note[data-tone="success"] .note-icon {
  border-color: rgba(109, 224, 175, 0.45);
  color: var(--green);
}

.source-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(50, 68, 101, 0.68);
}

.source-picker select {
  min-height: 42px;
}

.source-picker-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.snapshot-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid rgba(98, 167, 255, 0.25);
  border-radius: 999px;
  color: #99bde8;
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 760;
  white-space: nowrap;
}

.note-icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid rgba(98, 167, 255, 0.38);
  border-radius: 50%;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.event-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  padding: 58px 4px 30px;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.event-title-block h2 {
  margin: 11px 0 8px;
  font-size: clamp(25px, 3vw, 37px);
  font-weight: 750;
  letter-spacing: -0.055em;
}

.loaded-badge {
  gap: 7px;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 7px;
  color: var(--green);
  background: rgba(109, 224, 175, 0.08);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.loaded-dot {
  width: 5px;
  height: 5px;
  background: var(--green);
  box-shadow: none;
}

.event-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.meta-separator {
  color: #51617c;
}

.event-meta a {
  color: var(--blue);
  text-decoration: none;
}

.event-meta a:hover {
  text-decoration: underline;
}

.event-stats {
  display: flex;
  gap: 8px;
}

.stat-block {
  min-width: 118px;
  padding: 13px 15px 12px;
  border: 1px solid rgba(50, 68, 101, 0.86);
  border-radius: 12px;
  background: rgba(18, 28, 49, 0.72);
}

.stat-block span,
.stat-block small {
  display: block;
}

.stat-block span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
}

.stat-block strong {
  display: block;
  margin: 6px 0 1px;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.06em;
}

.stat-block small {
  color: #687995;
  font-size: 9px;
}

.stat-block-accent {
  border-color: rgba(244, 191, 56, 0.32);
  background: var(--yellow-soft);
}

.stat-block-accent strong {
  color: var(--yellow);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(385px, 0.76fr);
  gap: 19px;
  align-items: start;
}

.deliverables-card {
  margin-bottom: 19px;
  padding: 22px 25px 20px;
}

.deliverables-heading {
  align-items: center;
}

.deliverables-tip {
  color: #71809b;
  font-size: 10px;
}

.deliverable-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 21px;
}

.summary-layout-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 150px;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid rgba(50, 68, 101, 0.82);
  border-radius: 10px;
  background: rgba(8, 14, 28, 0.22);
}

.summary-layout-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.summary-layout-copy .paper-kicker {
  margin: 0;
}

.summary-layout-copy strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.summary-layout-copy small {
  color: #71809b;
  font-size: 9px;
}

.compact-field {
  margin: 0;
}

.deliverable-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  min-height: 70px;
  padding: 12px 13px;
  border: 1px solid rgba(50, 68, 101, 0.82);
  border-radius: 11px;
  background: rgba(8, 14, 28, 0.22);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.deliverable-option:hover {
  border-color: rgba(244, 191, 56, 0.35);
  background: rgba(244, 191, 56, 0.05);
}

.deliverable-option.is-selected {
  border-color: rgba(244, 191, 56, 0.4);
  background: var(--yellow-soft);
}

.deliverable-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.deliverable-icon {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(244, 191, 56, 0.33);
  border-radius: 8px;
  color: var(--yellow);
  background: rgba(244, 191, 56, 0.08);
  font-size: 11px;
  font-weight: 840;
}

.deliverable-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.deliverable-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deliverable-copy small {
  overflow: hidden;
  color: #74839f;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkmark {
  display: grid;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-left: auto;
  place-items: center;
  border: 1px solid #445674;
  border-radius: 6px;
  color: transparent;
  font-size: 11px;
  font-weight: 900;
}

.deliverable-option.is-selected .checkmark {
  border-color: var(--yellow);
  color: #171304;
  background: var(--yellow);
}

.deliverables-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  color: #71809b;
  font-size: 10px;
}

.export-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.export-button {
  min-height: 42px;
  padding-inline: 14px;
}

.matches-card,
.preview-card {
  min-width: 0;
  padding: 25px 25px 20px;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(145px, 0.68fr) minmax(145px, 0.68fr);
  gap: 9px;
  margin: 24px 0 16px;
}

.search-field {
  position: relative;
}

.search-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  pointer-events: none;
  transform: rotate(-20deg);
}

.search-field input {
  padding-left: 36px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(42, 59, 91, 0.78);
  border-radius: 12px;
  background: rgba(7, 12, 24, 0.2);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(42, 59, 91, 0.66);
  vertical-align: middle;
}

th {
  color: #7483a0;
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

td {
  color: var(--muted-strong);
  font-size: 11px;
}

.empty-state {
  padding: 30px 12px;
  color: var(--muted);
  text-align: center;
}

tbody tr {
  transition: background 160ms ease;
}

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

tbody tr:hover,
tbody tr.is-selected {
  background: rgba(98, 167, 255, 0.065);
}

tbody tr.is-selected {
  box-shadow: inset 2px 0 0 var(--yellow);
}

tbody tr.is-cancelled {
  background: rgba(255, 118, 95, 0.045);
}

tbody tr.is-cancelled td:not(:last-child) {
  color: #7d899e;
  text-decoration: line-through;
  text-decoration-color: rgba(255, 118, 95, 0.76);
  text-decoration-thickness: 1.5px;
}

.match-index-cell {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.match-index {
  color: var(--yellow);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.match-status-badge {
  padding: 3px 5px;
  border: 1px solid rgba(255, 118, 95, 0.4);
  border-radius: 4px;
  color: #ffad9c;
  background: rgba(255, 118, 95, 0.11);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.match-fighters {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.fighter-line {
  display: grid;
  gap: 2px;
}

.match-fighters strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 720;
}

.match-fighters .fighter-club {
  color: #73829e;
  font-size: 9px;
  line-height: 1.25;
}

.class-cell {
  display: grid;
  gap: 3px;
}

.class-cell strong {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 680;
}

.class-cell span {
  color: #6f7d97;
  font-size: 10px;
}

.template-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.template-tag.extra {
  color: #f4d177;
  background: var(--yellow-soft);
}

.template-tag.three {
  color: #a6caff;
  background: var(--blue-soft);
}

.row-action {
  width: 31px;
  height: 31px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #8090ad;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.row-action:hover,
.row-action:focus-visible {
  border-color: rgba(244, 191, 56, 0.32);
  color: var(--yellow);
  background: var(--yellow-soft);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-action {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #8090ad;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.status-action:hover,
.status-action:focus-visible {
  border-color: rgba(255, 118, 95, 0.36);
  color: #ff9f8b;
  background: rgba(255, 118, 95, 0.1);
}

.status-action.is-cancelled {
  color: #8bd0ad;
}

.status-action.is-cancelled:hover,
.status-action.is-cancelled:focus-visible {
  border-color: rgba(139, 208, 173, 0.38);
  color: #b8f0d1;
  background: rgba(139, 208, 173, 0.1);
}

.table-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 2px 0;
  color: #75839e;
  font-size: 10px;
}

.table-hint {
  color: #596984;
}

.preview-card {
  position: sticky;
  top: 20px;
}

.preview-heading {
  align-items: center;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  color: var(--muted-strong);
  background: rgba(6, 12, 25, 0.24);
  font-size: 18px;
  line-height: 1;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: var(--yellow);
  color: var(--yellow);
  background: var(--yellow-soft);
}

.preview-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}

.preview-type-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 15px 0 12px;
}

.preview-type-tab {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid rgba(50, 68, 101, 0.82);
  border-radius: 8px;
  color: #7d8dab;
  background: rgba(8, 14, 28, 0.24);
  font-size: 10px;
  font-weight: 760;
  text-align: center;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.preview-type-tab:hover,
.preview-type-tab.is-selected {
  border-color: rgba(244, 191, 56, 0.42);
  color: var(--ink);
  background: var(--yellow-soft);
}

.template-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(244, 191, 56, 0.25);
  border-radius: 6px;
  color: #f3d77f;
  background: var(--yellow-soft);
  font-size: 10px;
  font-weight: 760;
}

.preview-match-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 660;
}

.template-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 15px;
}

.template-tab {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid rgba(50, 68, 101, 0.82);
  border-radius: 8px;
  color: #7d8dab;
  background: rgba(8, 14, 28, 0.24);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.template-tab:hover,
.template-tab.is-selected {
  border-color: rgba(244, 191, 56, 0.42);
  color: var(--ink);
  background: var(--yellow-soft);
}

.template-tab strong {
  overflow: hidden;
  color: inherit;
  font-size: 10px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-tab small {
  overflow: hidden;
  color: #657590;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-tab.is-selected small {
  color: #b59a50;
}

.preview-card > h3 {
  margin: 12px 0 18px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 690;
  letter-spacing: -0.03em;
}

.preview-card > h3 span {
  margin: 0 4px;
  color: var(--yellow);
}

.judges-form {
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid rgba(50, 68, 101, 0.82);
  border-radius: 10px;
  background: rgba(8, 14, 28, 0.24);
}

.summary-preview {
  overflow: auto;
  margin: 0 0 16px;
  padding: 10px;
  border: 1px solid rgba(50, 68, 101, 0.82);
  border-radius: 10px;
  background: #fff;
  color: #17233a;
}

.summary-preview-shell {
  min-width: 560px;
}

.summary-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 4px 9px;
  border-bottom: 2px solid #172640;
}

.summary-preview-header .paper-kicker {
  margin: 0 0 4px;
  color: #61718c;
  font-size: 7px;
}

.summary-preview-header h4 {
  margin: 0;
  color: #172640;
  font-size: 15px;
  line-height: 1.05;
}

.summary-preview-header p {
  margin: 4px 0 0;
  color: #61718c;
  font-size: 8px;
}

.summary-preview-page-label {
  color: #61718c;
  font-size: 8px;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}

.summary-preview-table {
  width: 100%;
  margin-top: 9px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8px;
}

.summary-preview-table th,
.summary-preview-table td {
  border: 1px solid #c9d1dd;
  padding: 7px 6px;
  vertical-align: middle;
}

.summary-preview-table th {
  color: #fff;
  background: #172640;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.summary-preview-table td strong,
.summary-preview-table td span {
  display: block;
}

.summary-preview-table td strong {
  color: #172640;
  font-size: 8px;
  line-height: 1.2;
}

.summary-preview-table td span {
  margin-top: 3px;
  color: #61718c;
  font-size: 7px;
  line-height: 1.2;
}

.summary-preview-table .summary-red {
  border-left: 3px solid #ff765f;
  background: #fff0ed;
}

.summary-preview-table .summary-blue {
  border-right: 3px solid #62a7ff;
  background: #edf5ff;
}

.summary-preview-table .summary-info {
  color: #172640;
  font-weight: 750;
  text-align: center;
}

.summary-preview-table .judge-head,
.summary-preview-table .judge-cell {
  text-align: center;
}

.summary-preview-table tr.summary-cancelled td {
  color: #7e8796;
  background: #f1f2f4;
  text-decoration: line-through;
  text-decoration-color: rgba(197, 71, 58, 0.7);
  text-decoration-thickness: 1.5px;
}

.summary-preview-table tr.summary-cancelled td strong,
.summary-preview-table tr.summary-cancelled td span {
  color: #7e8796;
}

.summary-preview-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: #61718c;
  font-size: 10px;
  text-align: center;
}

.judges-form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.judges-form-heading .section-number {
  margin-bottom: 5px;
}

.judges-form-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.judge-assignment-status {
  max-width: 145px;
  color: #71809b;
  font-size: 9px;
  line-height: 1.4;
  text-align: right;
}

.judge-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.judge-field-match {
  grid-column: 1 / -1;
}

.judge-field > span {
  display: flex;
  gap: 5px;
}

.judge-field small {
  color: #71809b;
  font-size: 9px;
  font-weight: 550;
}

.judge-field input:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.judge-note {
  margin: 10px 0 0;
  color: #71809b;
  font-size: 9px;
  line-height: 1.45;
}

.template-reference {
  overflow: hidden;
  border: 1px solid rgba(50, 68, 101, 0.82);
  border-radius: 10px;
  background: rgba(8, 14, 28, 0.34);
}

.template-reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border-bottom: 1px solid rgba(50, 68, 101, 0.66);
}

.template-reference-head .paper-kicker {
  margin: 0 0 5px;
}

.template-reference-head strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 760;
}

.template-source-badge {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgba(244, 191, 56, 0.34);
  border-radius: 5px;
  color: var(--yellow);
  font-size: 8px;
  font-weight: 740;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.template-reference img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
}

.scorecard-paper {
  padding: 16px;
  border: 1px solid #d6dbe5;
  border-radius: 11px;
  color: #17233a;
  background: #f8fafc;
  box-shadow: 0 12px 28px rgba(2, 6, 19, 0.28);
}

.paper-topline,
.paper-fighters,
.paper-bottomline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.paper-topline {
  align-items: start;
  padding-bottom: 13px;
  border-bottom: 1px solid #cfd7e4;
}

.paper-kicker {
  margin-bottom: 5px;
  color: #38517d;
  font-size: 8px;
  letter-spacing: 0.14em;
}

.paper-topline strong {
  display: block;
  max-width: 170px;
  overflow: hidden;
  color: #12203a;
  font-size: 12px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-topline span {
  display: block;
  margin-top: 4px;
  color: #61708a;
  font-size: 8px;
}

.paper-match {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.paper-match span {
  margin: 0;
  color: #75839b;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.12em;
}

.paper-match strong {
  color: #182846;
  font-size: 25px;
  letter-spacing: -0.07em;
}

.paper-fighters {
  align-items: stretch;
  padding: 13px 0;
}

.paper-fighter {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
  padding: 8px 9px;
  border-radius: 6px;
}

.red-fighter {
  border-left: 3px solid var(--red);
  background: var(--red-soft);
}

.blue-fighter {
  border-right: 3px solid var(--blue);
  background: var(--blue-soft);
  text-align: right;
}

.fighter-corner {
  color: #66748b;
  font-size: 7px;
  font-weight: 820;
  letter-spacing: 0.1em;
}

.red-fighter .fighter-corner {
  color: #d95c4b;
}

.blue-fighter .fighter-corner {
  color: #3c7fc8;
}

.paper-fighter strong {
  overflow: hidden;
  color: #152440;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-fighter > span:last-child {
  overflow: hidden;
  color: #64728a;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-mark {
  align-self: center;
  color: #99a5b6;
  font-size: 8px;
  font-weight: 820;
}

.paper-rounds {
  display: grid;
  gap: 8px;
}

.paper-empty {
  padding: 22px 12px;
  border: 1px dashed #c2ccda;
  border-radius: 7px;
  color: #67758c;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.paper-round {
  padding: 8px 9px 9px;
  border: 1px solid #d8dfe9;
  border-radius: 7px;
}

.paper-round-head,
.paper-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.paper-round-head {
  padding-bottom: 6px;
  border-bottom: 1px solid #e3e7ee;
}

.paper-round-head strong {
  color: #263b60;
  font-size: 9px;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.paper-round-head span {
  color: #8490a1;
  font-size: 8px;
}

.paper-score-row {
  padding-top: 7px;
}

.paper-score-row > span {
  color: #67758c;
  font-size: 8px;
}

.score-pair {
  display: flex;
  gap: 4px;
}

.score-box {
  display: block;
  width: 22px;
  height: 18px;
  border: 1px solid #c3ccda;
  border-radius: 4px;
  background: #fff;
}

.score-box.red {
  border-color: rgba(217, 92, 75, 0.48);
}

.score-box.blue {
  border-color: rgba(60, 127, 200, 0.48);
}

.paper-bottomline {
  flex-wrap: wrap;
  padding-top: 13px;
  color: #65738b;
  font-size: 8px;
}

.preview-note {
  margin-top: 15px;
  color: #7a89a3;
}

.preview-note-mark {
  color: var(--yellow);
  font-size: 16px;
  line-height: 0.8;
}

.competition-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 17px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.competition-dialog::backdrop {
  background: rgba(3, 6, 14, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-card {
  padding: 25px;
  border: 1px solid rgba(68, 88, 126, 0.95);
  border-radius: 17px;
  background: linear-gradient(145deg, #17233d, #0e172b);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-heading h2 {
  margin: 8px 0 0;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.dialog-copy {
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.dialog-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px 11px;
}

.dialog-fields .input-field > span {
  display: flex;
  gap: 5px;
}

.dialog-fields .input-field small {
  color: #71809b;
  font-size: 9px;
  font-weight: 500;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 25px;
}

.rules-card {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.5fr);
  gap: 35px;
  align-items: center;
  margin-top: 19px;
  padding: 23px 26px;
}

.rule-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.rule-item {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 12px 13px;
  border: 1px solid rgba(50, 68, 101, 0.72);
  border-radius: 10px;
  background: rgba(9, 15, 29, 0.24);
}

.rule-item-highlight {
  border-color: rgba(244, 191, 56, 0.39);
  background: var(--yellow-soft);
}

.rule-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 670;
}

.rule-item strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 770;
  letter-spacing: -0.04em;
}

.rule-item-highlight strong {
  color: var(--yellow);
}

.rule-item small {
  overflow: hidden;
  color: #71809a;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 27px 10px 8px;
  color: #64738f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flow-strip b {
  color: var(--yellow);
  font-size: 16px;
  font-weight: 500;
}

.flow-final {
  color: var(--muted-strong);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px 28px;
  color: #53627e;
  font-size: 10px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(370px, calc(100% - 48px));
  padding: 13px 15px;
  border: 1px solid rgba(244, 191, 56, 0.36);
  border-radius: 10px;
  color: #f7dc8b;
  background: #17233c;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .preview-card {
    position: static;
  }

  .scorecard-paper {
    max-width: 720px;
  }

  .rules-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 820px) {
  .topbar,
  .page,
  .footer {
    width: min(100% - 32px, 680px);
  }

  .topbar {
    min-height: 72px;
  }

  .text-button {
    display: none;
  }

  .settings-button {
    display: inline-flex;
  }

  .page {
    padding-top: 45px;
  }

  .hero {
    min-height: 0;
    padding-bottom: 42px;
  }

  .hero-orbit {
    position: absolute;
    right: -32px;
    bottom: 2px;
    transform: scale(0.62);
    transform-origin: bottom right;
  }

  .event-header {
    display: grid;
    gap: 23px;
    padding-top: 41px;
  }

  .settings-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-picker-row {
    grid-template-columns: 1fr;
  }

  .source-picker-actions {
    justify-content: space-between;
  }

  .event-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-block {
    min-width: 0;
  }

  .filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .rule-list {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .summary-layout-controls {
    grid-template-columns: 1fr 1fr;
  }

  .summary-layout-copy {
    grid-column: 1 / -1;
  }
}

@media (max-width: 540px) {
  .import-card,
  .matches-card,
  .preview-card,
  .deliverables-card,
  .rules-card,
  .settings-card {
    padding: 19px 16px 17px;
    border-radius: 14px;
  }

  .compact-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .connection-label {
    max-width: 130px;
    text-align: right;
  }

  .import-row {
    grid-template-columns: 1fr;
  }

  .source-picker-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .source-picker-actions .secondary-button {
    width: 100%;
  }

  .primary-button {
    width: 100%;
  }

  .event-meta a {
    width: 100%;
  }

  .event-stats {
    gap: 6px;
  }

  .stat-block {
    padding: 11px 9px;
  }

  .stat-block strong {
    font-size: 21px;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .judge-fields {
    grid-template-columns: 1fr;
  }

  .judge-field-match {
    grid-column: auto;
  }

  .search-field {
    grid-column: auto;
  }

  .table-footer,
  .footer {
    display: grid;
    gap: 7px;
  }

  .table-hint {
    order: -1;
  }

  .scorecard-paper {
    padding: 11px;
  }

  .paper-fighter strong {
    font-size: 10px;
  }

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

  .deliverables-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .export-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .summary-layout-controls {
    grid-template-columns: 1fr;
  }

  .summary-layout-copy {
    grid-column: auto;
  }

  .dialog-card {
    padding: 19px 16px 17px;
  }

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

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

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

  .settings-template-switcher {
    grid-template-columns: 1fr;
  }

  .flow-strip {
    flex-wrap: wrap;
    gap: 9px;
    font-size: 8px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .hero,
  .import-card,
  .event-header,
  .deliverables-card,
  .matches-card,
  .rules-card,
  .flow-strip,
  .footer,
  .preview-heading,
  .preview-context,
  .preview-card > h3,
  .preview-note,
  .toast {
    display: none !important;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .workspace-grid {
    display: block;
  }

  .preview-card {
    border: 0;
    box-shadow: none;
  }

  .scorecard-paper {
    max-width: none;
    box-shadow: none;
  }
}
