/**
 * Site-wide header and base typography
 * Load after mainstil.css
 */
body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1e293b;
}

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 0 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  position: relative;
}

.logo {
  flex-shrink: 0;
  max-width: 180px;
  order: 1;
}

.logo a {
  display: block;
}

.logo img {
  max-width: 100%;
  height: auto;
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  flex: 1;
  justify-content: center;
  order: 2;
}

.main-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  padding: 0.5rem 0.25rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.main-nav a:hover {
  color: #334155;
  background: #f1f5f9;
}

.user-info {
  position: static;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0;
  font-size: 0.875rem;
  z-index: 1;
  order: 3;
}

.user-info span {
  font-weight: 500;
  color: #475569;
  margin-right: 0.25rem;
}

.user-info a {
  display: inline-block;
  margin: 0;
  padding: 0.4rem 0.75rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.user-info a:hover {
  color: #334155;
  background: #f8fafc;
  border-color: #cbd5e1;
  text-decoration: none;
}

.user-info .admin-link,
.user-info .judge-link {
  border-color: #e2e8f0;
  color: #475569 !important;
}

.user-info .admin-link:hover,
.user-info .judge-link:hover {
  color: #334155 !important;
  background: #f8fafc;
  text-decoration: none !important;
}

.user-info .logout-link:hover {
  color: #b91c1c !important;
  border-color: #fecaca;
  background: #fef2f2;
  text-decoration: none !important;
}

.user-info .login-button,
.user-info a[href*="register"] {
  color: #334155 !important;
}

.user-info .login-button:hover,
.user-info a[href*="register"]:hover {
  color: #1e293b !important;
  background: #f1f5f9;
}

.main-content {
  font-size: 1rem;
}

.main-content h1 {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 0;
  margin-bottom: 0.75em;
  color: #1e293b;
}

.main-content h2 {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: #1e293b;
}

.main-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  color: #334155;
}

.main-footer {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.main-footer p {
  margin: 0;
}

@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .logo {
    max-width: 160px;
    margin: 0 auto;
    order: 2;
  }

  .main-nav {
    justify-content: center;
    order: 3;
  }

  .user-info {
    justify-content: center;
    order: 1;
  }
}
