html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
  background: #f4f2ff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Navbar ──────────────────────────────────────── */
.site-navbar {
  background: linear-gradient(135deg, #5b21b6 0%, #1d4ed8 100%);
  box-shadow: 0 2px 12px rgba(91,33,182,0.35);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.site-navbar .navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.site-navbar .nav-link {
  color: rgba(255,255,255,0.88) !important;
  font-weight: 500;
  transition: color 0.15s;
}

.site-navbar .nav-link:hover {
  color: #fff !important;
}

.site-navbar .nav-link.text-danger {
  color: #fca5a5 !important;
}

.site-navbar .nav-link.text-danger:hover {
  color: #f87171 !important;
}

.site-navbar .navbar-toggler {
  border-color: rgba(255,255,255,0.4);
}

.site-navbar .navbar-toggler-icon {
  filter: invert(1);
}

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  background: linear-gradient(135deg, #5b21b6 0%, #1d4ed8 100%);
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 1rem;
  margin-top: 3rem;
  font-size: 0.875rem;
}

/* ── Page headings ───────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, #5b21b6 0%, #1d4ed8 100%);
  color: white;
  border-radius: 16px;
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(91,33,182,0.25);
}

.page-hero h1 {
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.page-hero p {
  opacity: 0.85;
  margin-bottom: 0;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(124,58,237,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6d28d9, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124,58,237,0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ── Cards ───────────────────────────────────────── */
.card {
  border: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border-radius: 12px;
}

/* ── Focus ring ──────────────────────────────────── */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #7c3aed;
}

/* ── Champion overlay ────────────────────────────── */
.champion-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 30, 0.82);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlayFadeIn 0.4s ease;
  backdrop-filter: blur(4px);
}

.champion-card {
  background: linear-gradient(150deg, #4c1d95 0%, #1e3a8a 60%, #0e7490 100%);
  color: white;
  border-radius: 24px;
  padding: 3rem 3.5rem;
  text-align: center;
  max-width: 520px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.1) inset;
  animation: cardZoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.champion-trophy {
  font-size: 5rem;
  display: block;
  animation: trophyBounce 0.8s cubic-bezier(0.36,0.07,0.19,0.97) both,
             trophyFloat 2.5s ease-in-out 0.8s infinite;
  filter: drop-shadow(0 4px 12px rgba(250,204,21,0.5));
}

.champion-headline {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #fde68a;
  margin: 1rem 0 0.5rem;
}

.champion-name {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0,0,0,0.4);
  background: linear-gradient(135deg, #fde68a, #f59e0b, #fde68a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.champion-game {
  margin-top: 0.75rem;
  opacity: 0.75;
  font-size: 0.9rem;
}

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

@keyframes cardZoomIn {
  from { opacity: 0; transform: scale(0.6) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes trophyBounce {
  0%   { transform: scale(0) rotate(-15deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  80%  { transform: scale(0.95) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes trophyFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Mobile / PWA ────────────────────────────────── */
@media (max-width: 767px) {
  /* Safe area insets for notched phones */
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Shrink brand text so it fits on small screens */
  .site-navbar .navbar-brand {
    font-size: 1rem;
  }

  /* Bigger tap targets in the collapsed nav */
  .site-navbar .nav-link {
    padding: 0.65rem 0.5rem;
    font-size: 1rem;
  }

  /* Page hero: tighter on mobile */
  .page-hero {
    padding: 1.25rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
  }

  .page-hero h1 {
    font-size: 1.4rem;
  }

  /* Champion card: full-width on small screens */
  .champion-card {
    padding: 2rem 1.5rem;
    border-radius: 16px;
  }

  .champion-name {
    font-size: 2rem;
  }

  .champion-trophy {
    font-size: 3.5rem;
  }

  /* Tables: allow horizontal scroll instead of squishing */
  .table-responsive-mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Tighter container padding */
  .container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Help page sidebar hidden on mobile — already d-none d-lg-block */
  .help-section {
    padding: 1.25rem;
  }

  /* Footer: smaller on mobile */
  .site-footer {
    margin-top: 2rem;
    font-size: 0.78rem;
  }
}
