:root {
  --bg: #071633;
  --card: #102550;
  --card-2: #0c1e42;
  --text: #f8fbff;
  --primary: #e63946;
  --accent: #1faa59;
  --accent-2: #f4c430;
  --usa-blue: #1f4fbf;
  --danger: #c62828;
}

* {
  box-sizing: border-box;
  font-family: "Fredoka", sans-serif;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 16%, rgba(230, 57, 70, 0.28) 0%, rgba(7, 22, 51, 0) 36%),
    radial-gradient(circle at 84% 18%, rgba(31, 79, 191, 0.32) 0%, rgba(7, 22, 51, 0) 34%),
    radial-gradient(circle at 45% 90%, rgba(31, 170, 89, 0.25) 0%, rgba(7, 22, 51, 0) 42%),
    linear-gradient(165deg, #091b3e 0%, #081632 45%, #060f24 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(244, 196, 48, 0.14);
  filter: blur(2px);
  z-index: -1;
  animation: floatBall 11s infinite ease-in-out;
}

body::before {
  top: -60px;
  left: -40px;
}

body::after {
  right: -60px;
  bottom: -80px;
  animation-delay: 1.5s;
}

@keyframes floatBall {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(12px); }
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  background: linear-gradient(90deg, #c81d2f 0%, #1faa59 48%, #1f4fbf 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.24);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-toggle {
  display: none;
}

.burger-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(8, 19, 47, 0.45);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.burger-btn:hover {
  transform: translateY(-1px);
  background: rgba(8, 19, 47, 0.62);
}

.burger-btn span {
  width: 18px;
  height: 2px;
  background: #fff;
  display: block;
  border-radius: 4px;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav h1 {
  margin: 8px 0;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.mascot-line {
  margin: 0 0 6px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.9);
}

nav a,
.auth a {
  color: #f6fbff;
  margin-right: 10px;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease;
}

nav a:hover,
.auth a:hover {
  background: rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 999px;
}

.hero {
  background: linear-gradient(130deg, #c81d2f 0%, #f4c430 38%, #1faa59 66%, #1f4fbf 100%);
  border-radius: 18px;
  padding: 18px;
  margin: 12px 0 16px;
  box-shadow: 0 12px 30px rgba(7, 15, 60, 0.35);
  animation: pulseGlow 3s infinite ease-in-out;
}

.match-day-block {
  margin-bottom: 18px;
}

.match-day-accordion {
  margin-bottom: 12px;
}

.match-day-accordion > summary {
  list-style: none;
}

.match-day-accordion > summary::-webkit-details-marker {
  display: none;
}

.match-day-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(120, 162, 255, 0.52);
  background: rgba(9, 30, 74, 0.82);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.match-day-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 196, 48, 0.7);
}

.match-day-accordion[open] .match-day-pill {
  background: linear-gradient(120deg, rgba(31, 79, 191, 0.86), rgba(31, 170, 89, 0.82));
  border-color: rgba(244, 196, 48, 0.8);
}

.match-day-title {
  margin: 0;
  font-size: 1.08rem;
  text-transform: capitalize;
}

.match-day-count {
  font-size: 0.86rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(4, 13, 35, 0.35);
}

.match-day-content {
  margin-top: 10px;
  animation: slideDay 0.25s ease;
}

@keyframes slideDay {
  0% { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 8px 20px rgba(7, 15, 60, 0.35); }
  50% { box-shadow: 0 12px 38px rgba(244, 196, 48, 0.42); }
}

.alert {
  padding: 12px;
  border-radius: 12px;
}

.alert.error { background: #8f2331; }
.alert.success { background: #14784a; }

.cards,
.groups-grid {
  display: grid;
  gap: 14px;
}

.groups-grid {
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

.card {
  background: linear-gradient(145deg, var(--card), var(--card-2));
  border: 1px solid rgba(100, 156, 255, 0.42);
  padding: 14px;
  border-radius: 14px;
}

.teams-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
}

.versus {
  background: var(--accent-2);
  color: #202020;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
}

.flag {
  width: 28px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid #d1e6ff;
}

.group-pill {
  display: inline-block;
  margin-top: 6px;
  background: linear-gradient(120deg, var(--accent), #2dcf73);
  color: #072b22;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

input,
select,
button {
  border-radius: 10px;
  border: 1px solid rgba(120, 162, 255, 0.52);
  padding: 8px 10px;
}

input {
  background: #0d224d;
  color: var(--text);
}

select {
  background: #0d224d;
  color: var(--text);
}

button {
  background: linear-gradient(135deg, #e63946, #f4c430);
  color: #1f1f1f;
  cursor: pointer;
  font-weight: 700;
}

.panel-form,
.grid-form {
  display: grid;
  gap: 12px;
  max-width: 650px;
}

label {
  display: grid;
  gap: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #11264e;
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  padding: 10px;
  border: 1px solid rgba(94, 139, 245, 0.55);
  text-align: left;
}

.team-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-mini.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4b400;
  color: #1f2937;
  font-weight: 700;
}

.admin-match {
  border-top: 1px solid rgba(94, 139, 245, 0.55);
  padding: 10px 0;
}

.group-admin-row input {
  width: 60px;
}

.admin-groups-table {
  margin-bottom: 16px;
}

.admin-groups-table .group-admin-row {
  justify-content: flex-start;
}

.team-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.team-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 29, 69, 0.84);
  border: 1px solid rgba(94, 139, 245, 0.45);
  border-radius: 10px;
  padding: 8px;
}

.team-list-item small {
  margin-left: auto;
  opacity: 0.9;
}

.import-form {
  margin-bottom: 10px;
}

.profile-layout {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.profile-avatar,
.profile-avatar.placeholder {
  width: 88px;
  height: 88px;
  border-radius: 50%;
}

.profile-avatar {
  object-fit: cover;
  border: 3px solid #fff;
}

.profile-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: #f7b500;
  color: #1d1d1d;
}

.stats-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-box {
  background: #0d224d;
  padding: 10px;
  border-radius: 10px;
  min-width: 110px;
  text-align: center;
}

.stat-box span {
  display: block;
  font-size: 0.85rem;
  opacity: 0.9;
}

.podium-row td {
  background: rgba(244, 196, 48, 0.14);
}

.badges-inline {
  margin-left: 8px;
  font-size: 0.8rem;
  background: rgba(31, 170, 89, 0.2);
  border: 1px solid rgba(31, 170, 89, 0.52);
  border-radius: 999px;
  padding: 2px 8px;
}

.alert-card {
  border-color: #f4c430;
  background: linear-gradient(145deg, #614109, #472f08);
}

.welcome-page {
  min-height: 100vh;
  background: #030b1f;
}

.welcome-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
}

.welcome-video-wrap {
  position: relative;
  width: min(1200px, 96vw);
  height: min(76vh, 720px);
  border-radius: 24px;
  overflow: visible;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  background: linear-gradient(130deg, #091b3e 0%, #0b2356 48%, #0d3a2f 100%);
}

.welcome-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #071633;
  border-radius: 24px;
}

.welcome-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(4, 13, 35, 0.12), rgba(4, 13, 35, 0.82));
  border-radius: 24px;
}

.welcome-content {
  position: absolute;
  left: 40px;
  bottom: 34px;
  max-width: 560px;
  z-index: 9;
}

.welcome-content h1 {
  margin: 0 0 8px;
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.welcome-content p {
  margin: 0 0 16px;
  color: rgba(248, 251, 255, 0.95);
  font-size: 1.04rem;
}

.welcome-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.welcome-btn {
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-btn.primary {
  background: linear-gradient(135deg, #e63946, #f4c430);
  color: #111827;
}

.welcome-btn.secondary {
  background: rgba(6, 14, 37, 0.46);
  color: #f8fbff;
}

.mascot {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
  opacity: 0;
  animation: mascotIn 900ms ease-out forwards;
}

@keyframes mascotIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mascot-left {
  left: -170px;
  top: 58%;
  transform: translateY(-50%);
  width: clamp(210px, 24vw, 340px);
  animation-delay: 80ms;
}

.mascot-right {
  right: -170px;
  top: 58%;
  transform: translateY(-50%);
  width: clamp(210px, 24vw, 340px);
  animation-delay: 180ms;
}

.mascot-bottom {
  left: 56%;
  bottom: -96px;
  transform: translateX(-50%);
  width: clamp(130px, 18vw, 230px);
  animation-delay: 260ms;
}

.site-mascot {
  position: fixed;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.45));
  opacity: 0.95;
}

.site-mascot-left {
  left: -34px;
  bottom: 16px;
  width: clamp(120px, 12vw, 190px);
}

.site-mascot-bottom {
  left: 52%;
  bottom: -28px;
  transform: translateX(-50%);
  width: clamp(95px, 9.5vw, 150px);
}

.site-mascot-right-center {
  right: -22px;
  bottom: 50%;
  transform: translateY(50%);
  width: clamp(95px, 10vw, 160px);
}

@media (max-width: 880px) {
  .mascot-left,
  .mascot-right {
    width: clamp(120px, 18vw, 190px);
    top: 53%;
  }
  .mascot-left { left: -70px; }
  .mascot-right { right: -70px; }
  .mascot-bottom {
    width: clamp(115px, 20vw, 210px);
    bottom: -40px;
  }
  .welcome-content {
    left: 20px;
    right: 20px;
    max-width: 100%;
  }

  .site-mascot-left {
    width: clamp(90px, 22vw, 130px);
    left: -24px;
    bottom: 10px;
  }

  .site-mascot-bottom {
    width: clamp(78px, 20vw, 115px);
    bottom: -16px;
    left: 58%;
  }
}

@media (max-width: 900px) {
  .container {
    padding: 12px;
  }

  .nav {
    align-items: center;
    justify-content: space-between;
  }

  .burger-btn {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background: rgba(8, 19, 47, 0.58);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    margin-top: 8px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    transition: max-height 0.35s ease, opacity 0.25s ease, transform 0.28s ease;
  }

  .topbar.nav-open .nav-panel {
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  nav a,
  .auth a {
    margin-right: 0;
  }

  .auth {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    padding: 14px;
    margin: 10px 0 14px;
  }

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

  .inline-form {
    gap: 6px;
  }

  .group-admin-row input {
    width: 54px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  th,
  td {
    padding: 8px;
  }

  .profile-layout {
    align-items: flex-start;
  }

  .site-mascot,
  .site-mascot-left,
  .site-mascot-bottom,
  .site-mascot-right-center {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .welcome-video-wrap {
    width: 98vw;
    height: 72vh;
  }

  .welcome-content h1 {
    font-size: 2rem;
  }

  .welcome-actions {
    width: 100%;
  }

  .welcome-btn {
    padding: 9px 14px;
    font-size: 0.95rem;
  }

  .match-day-title {
    font-size: 1rem;
  }

  .site-mascot {
    opacity: 0.88;
  }
}
