:root {
  --bg: #0b1020;
  --panel: #111827;
  --panel-2: #162033;
  --panel-3: #1a2942;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --txt: #ffffff;
  --muted: #aaaabc;
  --dim: rgba(255, 255, 255, 0.55);
  --purple: #6800ff;
  --purple-2: #8c4dff;
  --cyan: #9dccff;
  --green: #35e09d;
  --yellow: #ffd66b;
  --red: #ff6b8a;
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Poppins, Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  min-height: 100%;
  background: #0b1020;
  color: var(--txt);
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(104, 0, 255, 0.12), transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(80, 145, 255, 0.12), transparent 32%),
    linear-gradient(135deg, #0b1020 0%, #111a34 48%, #0d1830 100%);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -12%, rgba(104, 0, 255, 0.14), transparent 36%),
    radial-gradient(circle at 92% 10%, rgba(92, 165, 255, 0.13), transparent 32%),
    linear-gradient(135deg, #0b1020 0%, #111a34 52%, #0d1830 100%);
}

.app-bg::before {
  content: "";
  position: absolute;
  inset: -80px;
  pointer-events: none;
  opacity: 0.58;
  background-image:
    linear-gradient(rgba(150, 175, 255, 0.085) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 175, 255, 0.085) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px, 52px 52px, 18px 18px, 18px 18px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  animation: gamedexBalancedGrid 54s linear infinite;
}

.app-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.045), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.20) 78%, rgba(0, 0, 0, 0.34) 100%);
}

.stars-twinkle,
.stars-twinkle::before,
.stars-twinkle::after {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  background: none !important;
  animation: none !important;
}

.fx-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.42;
}

.fx-glow::before,
.fx-glow::after {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  border-radius: 999px;
  filter: blur(135px);
  opacity: 0.15;
}

.fx-glow::before {
  left: -185px;
  top: -145px;
  background: #3b82ff;
}

.fx-glow::after {
  right: -190px;
  bottom: -60px;
  background: #6800ff;
}

body > :not(.app-bg):not(.stars-twinkle):not(.fx-glow):not(script) {
  position: relative;
  z-index: 1;
}

.loader-card,
.app-shell,
.auth-shell,
.auth-card,
.profile-shell,
.settings-shell,
.maintenance-shell {
  position: relative;
  z-index: 2;
}

.container {
  width: min(100%, 540px);
  margin: 0 auto;
  padding: 0 16px;
}

.btn {
  height: 46px;
  border-radius: 14px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-purple {
  background: linear-gradient(135deg, var(--purple), var(--purple-2));
  color: #fff;
  box-shadow: 0 14px 28px rgba(104, 0, 255, 0.24);
}

.btn-dark {
  background: #101014;
  border: 1px solid var(--line-strong);
  color: #fff;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  color: rgba(255, 255, 255, 0.86);
}

.btn-danger {
  background: rgba(255, 107, 138, 0.13);
  border: 1px solid rgba(255, 107, 138, 0.35);
  color: #ffd8e0;
  box-shadow: none;
}

.btn-icon {
  width: 46px;
  min-width: 46px;
  padding: 0;
  border-radius: 16px;
}

.btn-small {
  height: 38px;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 11px;
}

.chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(104, 0, 255, 0.14);
  border: 1px solid rgba(104, 0, 255, 0.34);
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #dfd2ff;
  text-transform: uppercase;
}

.chip-green {
  background: rgba(53, 224, 157, 0.12);
  border-color: rgba(53, 224, 157, 0.32);
  color: #baffdf;
}

.chip-red {
  background: rgba(255, 107, 138, 0.12);
  border-color: rgba(255, 107, 138, 0.35);
  color: #ffd7df;
}

.chip-yellow {
  background: rgba(255, 214, 107, 0.12);
  border-color: rgba(255, 214, 107, 0.34);
  color: #ffe7a8;
}

.hairline {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(235, 225, 255, 0.42), transparent);
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0d0d13;
  color: #fff;
  outline: none;
  resize: vertical;
}

.input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(104, 0, 255, 0.13);
}

select.input {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.78) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.label {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.field {
  display: grid;
  gap: 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-bottom));
  transform: translateX(-50%) translateY(18px);
  z-index: 300;
  max-width: min(92vw, 430px);
  padding: 12px 14px;
  border-radius: 16px;
  background: #18181f;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.48);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.logo-ring,
.logo-ring img,
.brand-logo,
.maintenance-logo {
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

@keyframes gamedexBalancedGrid {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }

  100% {
    background-position: 104px 104px, 104px 104px, 36px 36px, 36px 36px;
  }
}

@media (min-width: 900px) {
  .container {
    width: min(100%, 1120px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
