:root {
  color-scheme: dark;
  --background: #10100f;
  --surface: #171715;
  --surface-hover: #1d1d1a;
  --text: #f1ede6;
  --muted: #9c978f;
  --line: #302e2a;
  --accent: #e7683f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.site-nav a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 96px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.menu-item {
  display: flex;
  align-items: flex-end;
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: clamp(1.15rem, 2.4vw, 1.65rem);
  font-weight: 650;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.menu-item:hover,
.menu-item:focus-visible {
  border-color: var(--accent);
  background: var(--surface-hover);
  outline: none;
  transform: translateY(-2px);
}

.empty-stage {
  min-height: 56vh;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel h2 {
  margin: 0 0 20px;
  font-size: 1.15rem;
  font-weight: 650;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--background);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  outline: none;
}

.button {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #16110f;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
}

.button:hover,
.button:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button--secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--text);
}

.form-status,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.form-status {
  min-height: 1.5em;
  margin: 12px 0 0;
}

.form-status.is-error {
  color: #ff8b75;
}

.account-line {
  margin: 0 0 8px;
}

.registration-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.registration-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--background);
}

.registration-item p {
  margin: 0;
  white-space: pre-wrap;
}

.registration-actions {
  display: flex;
  gap: 8px;
}

.link-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 36px;
}

.matches-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.matches-nav a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  padding: 8px 10px;
}

.matches-nav a:hover,
.matches-nav a:focus-visible,
.matches-nav a.is-active {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.matches-cover {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 0;
}

.matches-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 8px;
  object-fit: cover;
}

.link-group h2 {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.link-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.link-list li {
  border-bottom: 1px solid var(--line);
}

.tier-badge {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.match-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 10px 2px;
  text-align: left;
}

.match-toggle:hover .match-name,
.match-toggle:focus-visible .match-name {
  color: var(--accent);
}

.match-toggle:focus-visible {
  outline: none;
}

.match-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 550;
}

.match-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.match-toggle-indicator {
  width: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.match-details {
  padding: 0 2px 14px;
}

.match-details[hidden] {
  display: none;
}

.link-description {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.match-visit {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.tier-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: -12px 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.tier-legend strong {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .page {
    padding-top: 36px;
  }

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

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

  .link-groups {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .tier-badge {
    padding: 0 2px 4px;
  }

  .menu-item {
    min-height: 150px;
  }
}
