/* LinkWave — современный дизайн с анимациями */
@font-face {
  font-family: 'GothamPro';
  src: url('/static/fonts/gothampro.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GothamPro';
  src: url('/static/fonts/gothampro_medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'GothamPro';
  src: url('/static/fonts/gothampro_bold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0d0800;
  --bg-card: rgba(26, 15, 0, 0.92);
  --bg-hover: rgba(40, 22, 0, 0.96);
  --border: rgba(139, 92, 246, 0.35);
  --text: #f5f0e8;
  --text-muted: #c4b8a8;
  --accent: #8B5CF6;
  --accent-dim: rgba(139, 92, 246, 0.35);
  --error: #fb7185;
  --success: #22c55e;
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'GothamPro', -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Фон с анимированным градиентом (оранжевая тема) */
.bg-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(255, 150, 0, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(255, 120, 0, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 50%, rgba(255, 150, 0, 0.04) 0%, transparent 60%),
    var(--bg);
  animation: bg-shift 20s ease-in-out infinite;
}
.bg-mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("/favicon.png");
  background-size: 180px 180px;
  background-repeat: repeat;
  background-position: center;
  opacity: 0.04;
  mix-blend-mode: screen;
}
@keyframes bg-shift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.95; }
}

.site-footer {
  position: relative;
  z-index: 2;
  padding: 0.75rem 1.5rem 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.site-footer a {
  color: var(--accent);
  text-decoration: none;
}
.site-footer a:hover {
  text-decoration: underline;
}

/* Центрирование auth-страниц (логин, регистрация) */
.auth-page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-page-wrap .login-card,
.auth-page-wrap .auth-card {
  margin: 0 auto;
}

/* Карточки с эффектом стекла */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}
.glass:hover {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #8B5CF6 50%, #a78bfa 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-discord {
  background: #5865F2;
  color: white;
}
.btn-discord:hover {
  background: #4752C4;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.4);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

/* Поля ввода */
input, textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.7; }

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* Анимации появления */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-fade-in { opacity: 0; animation: fadeInUp 0.6s ease both; }
.animate-scale-in { opacity: 0; animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* Nickname эффекты */
.nickname-glow { text-shadow: 0 0 20px var(--accent-dim); }
.nickname-pulse { animation: pulse 1.5s ease-in-out infinite; }
.nickname-gradient {
  display: inline-block;
  background: linear-gradient(90deg, #8B5CF6, #a78bfa, #8B5CF6);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
}
.nickname-typing {
  display: inline-block;
  border-right: 2px solid var(--accent);
  padding-right: 4px;
  white-space: nowrap;
  overflow: hidden;
  max-width: calc(var(--chars, 12) * 1ch);
  animation: typing 2.2s steps(var(--chars, 12)) 1 both, blink 0.8s step-end infinite;
}
@keyframes blink { 50% { border-color: transparent; } }

.nickname-wave span { display: inline-block; animation: wave-char 1.2s ease-in-out infinite; }
.nickname-wave span:nth-child(1) { animation-delay: 0s; }
.nickname-wave span:nth-child(2) { animation-delay: 0.05s; }
.nickname-wave span:nth-child(3) { animation-delay: 0.1s; }
.nickname-wave span:nth-child(4) { animation-delay: 0.15s; }
.nickname-wave span:nth-child(5) { animation-delay: 0.2s; }
.nickname-wave span:nth-child(6) { animation-delay: 0.25s; }
.nickname-wave span:nth-child(7) { animation-delay: 0.3s; }
.nickname-wave span:nth-child(8) { animation-delay: 0.35s; }
.nickname-wave span:nth-child(n+9) { animation-delay: 0.4s; }
@keyframes wave-char {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.nickname-glitch {
  position: relative;
  animation: glitch-main 3s infinite;
}
.nickname-glitch::before,
.nickname-glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  overflow: hidden;
  color: inherit;
  opacity: 0.8;
}
.nickname-glitch::before {
  clip-path: inset(0 0 55% 0);
  transform: translate(-1px, -1px);
  text-shadow: 2px 0 rgba(20,184,166,0.6);
}
.nickname-glitch::after {
  clip-path: inset(45% 0 0 0);
  transform: translate(1px, 1px);
  text-shadow: -2px 0 rgba(45,212,191,0.6);
}
@keyframes glitch-main {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, 2px); }
  98% { transform: translate(1px, -2px); }
}

.nickname-staggered { opacity: 0; animation: stagger-in 0.6s ease forwards; }
.nickname-staggered .char {
  display: inline-block;
  opacity: 0;
  animation: char-in 0.4s ease forwards;
}
.nickname-staggered .char:nth-child(n) { animation-delay: calc(0.05s * var(--i, 0)); }
.nickname-staggered .char:nth-child(1) { animation-delay: 0.05s; }
.nickname-staggered .char:nth-child(2) { animation-delay: 0.1s; }
.nickname-staggered .char:nth-child(3) { animation-delay: 0.15s; }
.nickname-staggered .char:nth-child(4) { animation-delay: 0.2s; }
.nickname-staggered .char:nth-child(5) { animation-delay: 0.25s; }
.nickname-staggered .char:nth-child(6) { animation-delay: 0.3s; }
.nickname-staggered .char:nth-child(7) { animation-delay: 0.35s; }
.nickname-staggered .char:nth-child(8) { animation-delay: 0.4s; }
.nickname-staggered .char:nth-child(n+9) { animation-delay: 0.45s; }
@keyframes char-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes typing {
  from { max-width: 0; }
  to { max-width: calc(var(--chars, 12) * 1ch); }
}

/* Новые эффекты */
.nickname-neon {
  text-shadow:
    0 0 6px rgba(20,184,166,0.6),
    0 0 18px rgba(20,184,166,0.5),
    0 0 32px rgba(45,212,191,0.4);
}
.nickname-shimmer {
  display: inline-block;
  background: linear-gradient(120deg, rgba(20,184,166,0.2), #e5f9ff, rgba(20,184,166,0.2));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 2.5s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.nickname-outline {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,150,0,0.9);
  text-shadow: 0 0 10px rgba(255,150,0,0.35);
}
.nickname-bounce {
  display: inline-block;
  animation: bounce 1.2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.nickname-floaty {
  display: inline-block;
  animation: float 3.5s ease-in-out infinite;
}

/* Background animations */
.bg-anim-gradient {
  background: linear-gradient(-45deg, #08080c, #1a1a2e, #16213e, #08080c) !important;
  background-size: 400% 400% !important;
  animation: bg-gradient 15s ease infinite;
}
@keyframes bg-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.bg-anim-orbs { overflow: hidden; }
.bg-anim-orbs::before, .bg-anim-orbs::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: orb-float 20s ease-in-out infinite;
}
.bg-anim-orbs::before {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255, 150, 0, 0.12) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.bg-anim-orbs::after {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  bottom: -50px; right: -50px;
  animation-direction: reverse;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -30px); }
}

.bg-anim-grid {
  background-image:
    linear-gradient(rgba(255, 150, 0, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 150, 0, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: grid-pulse 4s ease-in-out infinite;
}
@keyframes grid-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.bg-anim-dots {
  background-image: radial-gradient(rgba(167, 139, 250, 0.2) 1px, transparent 1px);
  background-size: 24px 24px;
  animation: dots-move 20s linear infinite;
}
@keyframes dots-move {
  0% { background-position: 0 0; }
  100% { background-position: 24px 24px; }
}

.bg-anim-waves { overflow: hidden; position: relative; }
.bg-anim-waves::before, .bg-anim-waves::after {
  content: ''; position: absolute; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(255, 150, 0, 0.06) 0%, transparent 50%);
  animation: wave-rotate 25s linear infinite;
}
.bg-anim-waves::after { animation-duration: 30s; animation-direction: reverse; opacity: 0.6; }
@keyframes wave-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.bg-anim-aurora {
  background: linear-gradient(120deg, transparent 0%, rgba(255, 150, 0, 0.05) 25%, rgba(255, 120, 0, 0.06) 50%, rgba(255, 150, 0, 0.04) 75%, transparent 100%) !important;
  background-size: 200% 200% !important;
  animation: aurora-shift 12s ease-in-out infinite;
}
@keyframes aurora-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.bg-anim-noise {
  position: relative;
}
.bg-anim-noise::after {
  content: ''; position: absolute; inset: 0; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noise-flicker 0.2s steps(1) infinite;
  pointer-events: none;
}
@keyframes noise-flicker {
  0%, 100% { opacity: 0.03; }
  50% { opacity: 0.05; }
}

.bg-anim-particles { overflow: hidden; position: relative; }
.bg-anim-particles::before, .bg-anim-particles::after, .bg-anim-particles .particle {
  content: ''; position: absolute; border-radius: 50%;
  background: rgba(167, 139, 250, 0.15);
}
.bg-anim-particles::before {
  width: 200px; height: 200px; top: 10%; left: 20%;
  animation: particle-float 15s ease-in-out infinite;
}
.bg-anim-particles::after {
  width: 120px; height: 120px; bottom: 20%; right: 15%;
  animation: particle-float 18s ease-in-out infinite reverse;
  animation-delay: -5s;
}
@keyframes particle-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  33% { transform: translate(30px, -20px) scale(1.1); opacity: 0.8; }
  66% { transform: translate(-20px, 15px) scale(0.9); opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .nickname-wave span, .nickname-glitch, .nickname-staggered .char,
  .bg-anim-gradient, .bg-anim-orbs::before, .bg-anim-orbs::after,
  .bg-anim-grid, .bg-anim-dots, .bg-anim-waves::before, .bg-anim-waves::after,
  .bg-anim-aurora, .bg-anim-noise::after, .bg-anim-particles::before, .bg-anim-particles::after, .bg-mesh,
  .animate-fade-in, .animate-scale-in { animation: none !important; }
  .animate-fade-in, .animate-scale-in { opacity: 1 !important; }
}

/* LinkWave — кастомные уведомления */
.lw-toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 90vw;
}
.lw-toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius, 12px);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  background: rgba(15, 10, 22, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.lw-toast.lw-toast-visible {
  opacity: 1;
  transform: translateY(0);
}
.lw-toast-success { border-color: rgba(34, 197, 94, 0.5); background: linear-gradient(135deg, rgba(15, 10, 22, 0.98), rgba(139, 92, 246, 0.12)); }
.lw-toast-error { border-color: rgba(239, 68, 68, 0.5); background: linear-gradient(135deg, rgba(15, 10, 22, 0.98), rgba(239, 68, 68, 0.12)); }
.lw-toast-warning { border-color: rgba(234, 179, 8, 0.5); background: linear-gradient(135deg, rgba(15, 10, 22, 0.98), rgba(234, 179, 8, 0.12)); }
.lw-toast-info { border-color: rgba(139, 92, 246, 0.5); background: linear-gradient(135deg, rgba(15, 10, 22, 0.98), rgba(139, 92, 246, 0.15)); }

.lw-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lw-confirm-overlay.lw-confirm-visible {
  opacity: 1;
  visibility: visible;
}
.lw-confirm-box {
  background: var(--bg-card, rgba(10, 23, 40, 0.98));
  border: 1px solid var(--border, rgba(139, 92, 246, 0.35));
  border-radius: var(--radius-lg, 20px);
  padding: 1.5rem 1.75rem;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}
.lw-confirm-visible .lw-confirm-box {
  transform: scale(1);
}
.lw-confirm-message {
  color: var(--text, #e5f9ff);
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.lw-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}
.lw-confirm-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lw-confirm-cancel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text, #e5f9ff);
}
.lw-confirm-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}
.lw-confirm-ok {
  background: var(--accent, #8B5CF6);
  border: none;
  color: #fff;
}
.lw-confirm-ok:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}
