:root {
  --bg-1: #05070f;
  --bg-2: #0a1022;
  --panel: #0c1427cc;
  --panel-strong: #0f1930;
  --text: #ecf7ff;
  --muted: #9bc4d8;
  --line: #2a3e63;
  --cyan: #37f5ff;
  --blue: #4a6bff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Rajdhani", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgb(55 245 255 / 0.14), transparent 35%),
    radial-gradient(circle at 88% 14%, rgb(255 63 143 / 0.14), transparent 38%),
    radial-gradient(circle at 80% 90%, rgb(74 107 255 / 0.18), transparent 36%),
    linear-gradient(130deg, var(--bg-1), var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

html {
  scrollbar-width: thin;
  scrollbar-color: #36e9ff #0a1731;
}

body::-webkit-scrollbar,
.teams::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-track,
.teams::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #09162d, #0a1327);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.teams::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3bf4ff, #4a6bff);
  border-radius: 999px;
  border: 2px solid #08142a;
  box-shadow: 0 0 12px rgb(55 245 255 / 0.5);
}

body::-webkit-scrollbar-thumb:hover,
.teams::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #64f8ff, #6b87ff);
}

.app {
  position: relative;
  max-width: 940px;
  margin: 0 auto;
  padding: 2.2rem 1rem 3rem;
}

.hidden {
  display: none !important;
}

.brand-logo {
  width: 220px;
  height: 220px;
  display: block;
  margin: 0 auto 0.6rem;
  filter: drop-shadow(0 0 16px rgb(55 245 255 / 0.5));
}

.menu {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.menu-link {
  text-decoration: none;
  color: var(--cyan);
  background: rgb(10 18 36 / 0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.52rem 1rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgb(55 245 255 / 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.menu-btn {
  cursor: pointer;
  font: inherit;
}

.menu-link:hover {
  transform: translateY(-1px);
  border-color: rgb(55 245 255 / 0.5);
  box-shadow: 0 0 16px rgb(55 245 255 / 0.2), inset 0 0 0 1px rgb(55 245 255 / 0.2);
}

.menu-link.active {
  color: #081020;
  background: linear-gradient(120deg, var(--cyan), #9bf7ff);
  border-color: transparent;
  box-shadow: 0 0 22px rgb(55 245 255 / 0.45);
}

.panel {
  margin-top: 1.5rem;
  background: linear-gradient(160deg, var(--panel), rgb(7 14 30 / 0.8));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.05rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 34px rgb(0 0 0 / 0.36), inset 0 0 0 1px rgb(74 107 255 / 0.12);
}

.view.panel {
  display: grid;
  gap: 0.85rem;
}

#view-login.panel,
#view-register.panel {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.panel h2 {
  margin: 0 0 0.8rem;
  color: #f5fbff;
}

.stack {
  display: grid;
  gap: 0.5rem;
}

.auth-subtitle {
  margin-top: -0.25rem;
  margin-bottom: 0.15rem;
}

.auth-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.auth-form {
  max-width: 100%;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
}

#view-favorites .row {
  margin-bottom: 0.1rem;
}

.muted {
  margin: 0;
  color: var(--muted);
}

label {
  color: #cde8f4;
  font-weight: 600;
}

select,
input,
button {
  border-radius: 11px;
  border: 1px solid var(--line);
  padding: 0.72rem 0.82rem;
  font-size: 1rem;
}

input,
select {
  width: 100%;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgb(55 245 255 / 0.17);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--panel-strong) inset;
  box-shadow: 0 0 0 1000px var(--panel-strong) inset;
  border: 1px solid var(--line);
  transition: background-color 9999s ease-in-out 0s;
}

button {
  border-color: transparent;
  background: linear-gradient(120deg, var(--blue), var(--cyan));
  color: #041026;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 0 22px rgb(74 107 255 / 0.35);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgb(55 245 255 / 0.42);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.secondary {
  background: linear-gradient(120deg, rgb(13 29 56), rgb(9 22 44));
  color: #bdefff;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgb(55 245 255 / 0.08);
}

.events-actions {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

.events-status {
  margin: 0;
  min-height: 1.1rem;
  font-size: 0.93rem;
  color: #8fdff3;
  text-align: right;
  text-shadow: 0 0 10px rgb(55 245 255 / 0.2);
}

.status {
  min-height: 1.6rem;
  margin-top: 0.9rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-align: right;
  color: var(--muted);
  text-shadow: 0 0 12px rgb(55 245 255 / 0.18);
}

.events {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, rgb(13 25 47 / 0.9), rgb(9 16 34 / 0.95));
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0.75rem 0.95rem;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.02), 0 8px 20px rgb(0 0 0 / 0.35);
  animation: enter 320ms ease both;
  animation-delay: var(--delay, 0ms);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgb(55 245 255 / 0.7), rgb(74 107 255 / 0.1));
  pointer-events: none;
}

.card-f1 {
  background: linear-gradient(
    165deg,
    var(--f1-panel-bg, rgb(39 13 24 / 0.9)),
    rgb(11 14 26 / 0.96)
  );
  border-color: var(--f1-accent, #ff6f2f);
  box-shadow: inset 0 0 0 1px var(--f1-accent, #ff6f2f), 0 8px 24px rgb(0 0 0 / 0.35);
}

.card-f1::before {
  background: linear-gradient(90deg, var(--f1-accent, #ff6f2f), transparent);
}

.card h3 {
  margin: 0;
  font-size: 1.08rem;
  color: #f3fbff;
}

.match-title-row {
  display: grid;
  grid-template-columns: 112px 1fr 112px;
  gap: 0.9rem;
  align-items: center;
  min-height: 112px;
}

.match-title {
  text-align: center;
  line-height: 1.2;
  font-size: 1.2rem;
}

.match-center {
  display: grid;
  gap: 0.38rem;
}

.badge-row {
  display: flex;
  justify-content: center;
}

.sport-badge {
  display: inline-block;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 800;
  text-transform: uppercase;
}

.sport-badge-soccer {
  color: #9feefe;
  border: 1px solid rgb(55 245 255 / 0.45);
  background: rgb(8 30 45 / 0.55);
}

.sport-badge-f1 {
  color: #041026;
  border: 1px solid transparent;
  background: var(--f1-accent, #ff6f2f);
  text-shadow: none;
  box-shadow: 0 0 14px var(--f1-accent, #ff6f2f);
}

.f1-title {
  margin-top: 0.12rem;
  color: var(--f1-badge-text, #ffd7b8);
  text-shadow: 0 0 14px var(--f1-accent, #ff6f2f);
}

.f1-title-row {
  display: grid;
  grid-template-columns: 112px 1fr 112px;
  gap: 0.9rem;
  align-items: center;
  min-height: 112px;
}

.f1-logo-spacer {
  width: 112px;
  height: 112px;
}

.f1-main-logo {
  filter: drop-shadow(0 0 12px rgb(55 245 255 / 0.35));
}

.f1-tags {
  margin-top: 0.1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.f1-tag {
  display: inline-block;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--tag-accent, rgb(255 111 47 / 0.55));
  color: var(--tag-text, #ffb27d);
  font-weight: 700;
  font-size: 0.82rem;
  text-shadow: 0 0 10px var(--tag-accent, #ff9b3d);
  background: var(--tag-bg, rgb(62 20 23 / 0.55));
  box-shadow: inset 0 0 0 1px var(--tag-accent, #ff9b3d);
}

.favorite-team {
  color: var(--cyan);
  text-shadow: 0 0 12px rgb(55 245 255 / 0.65);
}

.match-vs {
  color: #ff9b3d;
  text-shadow: 0 0 12px rgb(255 155 61 / 0.7);
}

.team-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

.meta {
  margin-top: 0.2rem;
  color: var(--cyan);
  font-size: 0.95rem;
  text-align: center;
}

.meta-sep {
  color: #ff9b3d;
  text-shadow: 0 0 10px rgb(255 155 61 / 0.7);
}

.teams {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0.95rem;
  min-height: 3rem;
  max-height: 300px;
  overflow: auto;
  background: linear-gradient(160deg, rgb(8 17 34 / 0.86), rgb(8 15 30 / 0.9));
  display: grid;
  gap: 0.45rem;
  scrollbar-width: thin;
  scrollbar-color: #36e9ff #0a1731;
}

.team-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #d7edff;
  padding: 0.18rem 0.25rem;
  border-radius: 8px;
}

.team-option:hover {
  background: rgb(55 245 255 / 0.08);
}

.team-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .brand-logo {
    width: 120px;
    height: 120px;
  }

  .match-title-row {
    grid-template-columns: 88px 1fr 88px;
    min-height: 92px;
    gap: 0.6rem;
  }

  .f1-title-row {
    grid-template-columns: 88px 1fr 88px;
    min-height: 92px;
    gap: 0.6rem;
  }

  .f1-logo-spacer {
    width: 88px;
    height: 88px;
  }

  .team-logo {
    width: 88px;
    height: 88px;
  }

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

  .row {
    align-items: stretch;
  }

  .row button,
  .row select {
    width: 100%;
  }
}
