:root {
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: 36 28% 96%;
  --foreground: 220 18% 8%;
  --card: 36 22% 99%;
  --card-foreground: 220 18% 8%;
  --popover: 36 22% 99%;
  --popover-foreground: 220 18% 8%;
  --primary: 6 92% 48%;
  --primary-foreground: 0 0% 100%;
  --secondary: 24 90% 54%;
  --secondary-foreground: 24 35% 8%;
  --muted: 32 18% 90%;
  --muted-foreground: 220 9% 34%;
  --accent: 28 96% 54%;
  --accent-foreground: 24 35% 8%;
  --destructive: 0 84% 45%;
  --destructive-foreground: 0 0% 100%;
  --success: 142 70% 34%;
  --success-foreground: 0 0% 100%;
  --warning: 31 90% 40%;
  --warning-foreground: 24 35% 8%;
  --info: 199 89% 38%;
  --info-foreground: 0 0% 100%;
  --border: 28 18% 82%;
  --input: 28 18% 76%;
  --ring: 6 92% 48%;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px hsl(var(--foreground) / 0.05);
  --shadow-md: 0 4px 12px hsl(var(--foreground) / 0.08);
  --shadow-lg: 0 12px 32px hsl(var(--foreground) / 0.12);
  --shadow-elegant: 0 16px 44px hsl(var(--primary) / 0.28), 0 0 32px hsl(var(--accent) / 0.18);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dark {
  --background: 222 28% 4%;
  --foreground: 28 24% 96%;
  --card: 222 24% 8%;
  --card-foreground: 28 24% 96%;
  --popover: 222 24% 9%;
  --popover-foreground: 28 24% 96%;
  --primary: 6 94% 52%;
  --primary-foreground: 0 0% 100%;
  --secondary: 24 96% 56%;
  --secondary-foreground: 24 35% 8%;
  --muted: 222 18% 14%;
  --muted-foreground: 28 12% 70%;
  --accent: 28 98% 55%;
  --accent-foreground: 24 35% 8%;
  --destructive: 0 84% 62%;
  --destructive-foreground: 0 0% 100%;
  --success: 142 72% 46%;
  --success-foreground: 142 45% 8%;
  --warning: 38 92% 56%;
  --warning-foreground: 30 30% 8%;
  --info: 199 89% 58%;
  --info-foreground: 210 35% 8%;
  --border: 222 18% 18%;
  --input: 222 18% 22%;
  --ring: 24 96% 56%;
}

* {
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

body {
  margin: 0;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 50% -10%, hsl(var(--primary) / 0.16), transparent 34rem),
    radial-gradient(circle at 100% 30%, hsl(var(--accent) / 0.12), transparent 24rem),
    hsl(var(--background));
}

button,
input {
  font: inherit;
}

button {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.field-control {
  font-size: max(16px, 1rem);
}

.esports-logo-shell {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.esports-logo-shell::before {
  content: "";
  position: absolute;
  inset: 10%;
  z-index: -1;
  border-radius: 999px;
  background: radial-gradient(circle, hsl(var(--accent) / 0.36), hsl(var(--primary) / 0.18) 44%, transparent 72%);
  filter: blur(10px);
  transform: scale(1.08);
}

.esports-logo-shell svg {
  display: block;
  filter: saturate(1.08) contrast(1.04);
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, hsl(var(--primary) / 0.20), transparent 15rem),
    radial-gradient(circle at 50% 58%, hsl(var(--accent) / 0.12), transparent 19rem),
    hsl(0 0% 0%);
  color: hsl(var(--foreground));
  animation: splashExit 520ms ease 1.82s forwards;
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(92vw, 28rem);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  animation: splashReveal 700ms ease-out both;
}

.splash-logo-stage {
  position: relative;
  display: flex;
  height: 10.5rem;
  width: 10.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: radial-gradient(circle, hsl(var(--primary) / 0.16), transparent 68%);
  filter: drop-shadow(0 0 28px hsl(var(--primary) / 0.34)) drop-shadow(0 0 42px hsl(var(--accent) / 0.18));
  animation: splashLogoPulse 1600ms ease-in-out infinite;
}

.splash-logo-stage .esports-logo-shell {
  height: 8.5rem;
  width: 8.5rem;
}

.splash-logo-stage .esports-logo-shell::before {
  inset: 0;
  background: radial-gradient(circle, hsl(var(--accent) / 0.60), hsl(var(--primary) / 0.30) 45%, transparent 72%);
  filter: blur(18px);
}

.splash-logo-ring {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.splash-logo-ring-one {
  inset: 0.25rem;
  border: 1px solid hsl(var(--primary) / 0.42);
  box-shadow: 0 0 28px hsl(var(--primary) / 0.26), inset 0 0 18px hsl(var(--accent) / 0.12);
  animation: splashRingSpin 3800ms linear infinite;
}

.splash-logo-ring-one::before,
.splash-logo-ring-two::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.22rem;
  height: 0.45rem;
  width: 1.5rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent)));
  box-shadow: 0 0 18px hsl(var(--accent) / 0.70);
}

.splash-logo-ring-two {
  inset: 1.25rem;
  border: 1px dashed hsl(var(--accent) / 0.42);
  animation: splashRingSpin 5200ms linear infinite reverse;
}

.splash-title-group {
  margin-top: 1.15rem;
  display: grid;
  gap: 0.45rem;
}

.splash-title {
  margin: 0;
  background: linear-gradient(90deg, hsl(var(--foreground)), hsl(var(--accent)) 48%, hsl(var(--primary)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(2rem, 9vw, 3.35rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.95;
  text-shadow: 0 0 34px hsl(var(--primary) / 0.28);
}

.splash-subtitle {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: clamp(0.95rem, 3.8vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.splash-ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.72;
  pointer-events: none;
  animation: splashGlowDrift 1800ms ease-in-out infinite alternate;
}

.splash-ambient-primary {
  height: 18rem;
  width: 18rem;
  background: hsl(var(--primary) / 0.22);
  left: 50%;
  top: 22%;
  transform: translate(-50%, -50%);
}

.splash-ambient-accent {
  height: 13rem;
  width: 13rem;
  background: hsl(var(--accent) / 0.18);
  bottom: 18%;
  right: 12%;
  animation-delay: 220ms;
}

.splash-scanline {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, hsl(var(--primary) / 0.08) 1px, transparent 1px),
    linear-gradient(0deg, hsl(var(--accent) / 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  opacity: 0.5;
  animation: splashGridMove 1400ms linear infinite;
}

.gaming-banner {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(135deg, hsl(var(--primary) / 0.22), hsl(var(--accent) / 0.12) 48%, hsl(var(--card)) 100%),
    hsl(var(--card));
}

.gaming-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, hsl(var(--foreground) / 0.08) 1px, transparent 1px),
    linear-gradient(0deg, hsl(var(--foreground) / 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, black, transparent 75%);
}

.gaming-banner::after {
  content: "";
  position: absolute;
  right: 2rem;
  top: 50%;
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  transform: translateY(-50%);
  background: radial-gradient(circle, hsl(var(--primary) / 0.32), transparent 68%);
  filter: blur(4px);
  z-index: -1;
}

@keyframes splashReveal {
  from {
    opacity: 0;
    transform: translateY(0.8rem) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes splashExit {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes splashLogoPulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 24px hsl(var(--primary) / 0.36)) drop-shadow(0 0 36px hsl(var(--accent) / 0.18));
  }
  50% {
    transform: scale(1.045);
    filter: drop-shadow(0 0 38px hsl(var(--primary) / 0.52)) drop-shadow(0 0 58px hsl(var(--accent) / 0.32));
  }
}

@keyframes splashRingSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes splashGlowDrift {
  from {
    opacity: 0.52;
    scale: 0.96;
  }
  to {
    opacity: 0.92;
    scale: 1.08;
  }
}

@keyframes splashGridMove {
  to {
    background-position: 34px 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
