/* Kyou.Fun - Modern Dark Gaming Theme */
:root {
  /* Primary palette - more sophisticated, less saturated */
  --neon-cyan: #38bdf8;
  --neon-pink: #f472b6;
  --neon-purple: #a78bfa;
  --neon-green: #4ade80;
  --neon-yellow: #fbbf24;
  --neon-orange: #fb923c;
  
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-hover: #818cf8;
  --primary-light: #a5b4fc;
  --secondary: #ec4899;
  --accent: #8b5cf6;

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Dark theme - refined, less harsh */
  --bg-base: #0f0f1a;
  --bg-elevated: #16161f;
  --bg-overlay: #1e1e2e;
  --bg-card: rgba(24, 24, 36, 0.85);
  --bg-card-hover: rgba(30, 30, 46, 0.9);
  
  /* Text with better contrast hierarchy */
  --text: #e2e8f0;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  
  /* Borders - subtle and refined */
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-medium: rgba(148, 163, 184, 0.15);
  --border-strong: rgba(148, 163, 184, 0.25);
  --border-accent: rgba(99, 102, 241, 0.4);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  
  /* Shadows - refined, less dramatic */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.35);
  
  /* Glows - subtle, not overwhelming */
  --glow-primary: 0 0 20px rgba(99, 102, 241, 0.25);
  --glow-success: 0 0 20px rgba(34, 197, 94, 0.2);
  --glow-error: 0 0 20px rgba(239, 68, 68, 0.2);
  
  /* Border radius - modern, not too rounded */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Utility helpers (we don't ship Tailwind) */
.hidden {
  display: none !important;
}

/* Screen reader only - accessible but invisible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-base);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.starry-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0f0f1a 0%, #12121f 50%, #0f0f1a 100%);
  overflow: hidden;
}

.stars {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
}

/* Refined star field - subtle, not overwhelming */
.stars::before,
.stars::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    /* Subtle white stars */
    radial-gradient(1px 1px at 10% 10%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 30% 20%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 40% 40%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 50% 10%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 60% 50%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 70% 30%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 80% 60%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 90% 20%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 15% 70%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 25% 80%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 35% 90%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 45% 65%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 55% 85%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 65% 75%, rgba(255, 255, 255, 0.2), transparent),
    /* A few subtle accent stars */
    radial-gradient(1.5px 1.5px at 18% 25%, rgba(99, 102, 241, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 68% 15%, rgba(139, 92, 246, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 82% 75%, rgba(99, 102, 241, 0.3), transparent);
  background-size: 600px 600px;
  background-repeat: repeat;
  animation: starfield 180s linear infinite;
  opacity: 0.7;
}

.stars::after {
  background-image: 
    radial-gradient(1px 1px at 15% 45%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 35% 15%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 55% 75%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 75% 35%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 85% 65%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 25% 55%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 45% 85%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 95% 15%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1.5px 1.5px at 32% 38%, rgba(139, 92, 246, 0.3), transparent),
    radial-gradient(1.5px 1.5px at 72% 18%, rgba(99, 102, 241, 0.25), transparent);
  background-size: 800px 800px;
  animation: starfield 240s linear infinite reverse;
  opacity: 0.5;
}

@keyframes starfield {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-600px, -600px);
  }
}

/* Subtle gradient overlay */
.starry-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .stars::before,
  .stars::after {
    animation: none;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.65rem 0;
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
}

.social-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  margin-right: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Discord */
.social-link-discord {
  color: #5865F2;
  border-color: rgba(88, 101, 242, 0.3);
  background: rgba(88, 101, 242, 0.1);
}

.social-link-discord:hover {
  background: rgba(88, 101, 242, 0.2);
  border-color: #5865F2;
  color: #7289DA;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

/* Ko-fi */
.social-link-kofi {
  color: #FF5E5B;
  border-color: rgba(255, 94, 91, 0.3);
  background: rgba(255, 94, 91, 0.1);
}

.social-link-kofi:hover {
  background: rgba(255, 94, 91, 0.2);
  border-color: #FF5E5B;
  color: #FF8E88;
  box-shadow: 0 4px 12px rgba(255, 94, 91, 0.4);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity 0.2s;
}

.logo img {
  height: 66px;
  width: auto;
  display: block;
}

.logo span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo:hover {
  opacity: 0.8;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: nowrap;
}

nav ul li {
  flex-shrink: 0;
  white-space: nowrap;
}

nav ul li.mobile-social-links {
  display: none;
}

@media (max-width: 900px) {
  header .container {
    position: relative;
  }

  .social-links {
    display: none;
  }

  nav ul li.mobile-social-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
  }

  nav ul li.mobile-social-links a.social-link {
    width: 44px;
    height: 44px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  nav ul {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px) saturate(180%);
    box-shadow: var(--shadow-xl);
    z-index: 60;
  }

  nav a {
    display: block;
    padding: 0.85rem 1rem;
  }

  /* Style audio toggle and profile in mobile nav */
  .audio-control-nav {
    padding: 0.5rem 1rem;
  }

  .audio-toggle-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
  }

  .audio-toggle-btn::after {
    content: 'Son';
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
  }

  .audio-toggle-btn:hover::after {
    color: var(--text-primary);
  }

  .user-profile-nav {
    padding: 0.5rem 1rem;
  }

  .profile-button {
    width: 100%;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0.85rem 0;
    border-radius: var(--radius-md);
  }

  .profile-button:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: none;
    box-shadow: none;
  }

  .profile-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    min-width: 0;
    padding: 0;
    margin-top: 0.5rem;
  }

  .locale-selector-nav {
    padding: 0.5rem 1rem;
  }

  .locale-select {
    width: 100%;
    padding: 0.85rem 1rem;
  }

  body.mobile-nav-open nav ul {
    display: flex;
  }
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s;
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--primary);
  transition: transform 0.2s;
}

nav a:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

nav a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Audio Control */
.audio-control-nav {
  display: flex;
  align-items: center;
}

.audio-toggle-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.audio-toggle-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.audio-icon {
  display: block;
  transition: transform 0.2s;
}

.audio-toggle-btn:hover .audio-icon {
  transform: scale(1.1);
}

/* Hide both icons by default, show only one via JS */
.audio-icon.audio-on,
.audio-icon.audio-off {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-disabled {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-disabled:hover {
  transform: none;
}

/* Cards with Glassmorphism */
.card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-medium);
  background: rgba(30, 41, 59, 0.6);
}

/* Main content */
main {
  flex: 1;
  min-height: 0;
}

/* Footer */
footer {
  padding: var(--space-lg) 0;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  background: rgba(15, 15, 26, 0.6);
  backdrop-filter: blur(12px);
  margin-top: auto;
}

footer p {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--primary-light);
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-overlay);
  border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Modern Buttons */
.btn, button:not(.unstyled) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  display: none;
}


.btn:hover,
button:not(.unstyled):hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}


.btn:active,
button:not(.unstyled):active {
  transform: translateY(0);
}

.btn:focus-visible,
button:not(.unstyled):focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
  box-shadow: var(--shadow-lg), var(--glow-primary);
}

.btn-secondary {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
  color: var(--primary-light);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
}

.btn-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.btn-success:hover {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.5);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--error);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Icons inside buttons */
.btn i,
button:not(.unstyled) i {
  font-size: 0.95em;
}

/* Modern Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-overlay);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

/* Modern Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}
.card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
/* User Profile Navigation */
.user-profile-nav {
  position: relative;
}

.profile-dropdown {
  position: relative;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-button:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

.profile-button:focus {
  outline: none;
}

.profile-button:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.10),
    0 12px 30px rgba(0, 0, 0, 0.22);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.profile-avatar-placeholder {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
}

.profile-dropdown .profile-name {
  display: block;
  font-size: 0.875rem;
  min-width: 0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  transition: transform 0.2s;
}

.profile-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s;
  z-index: 100;
}

.profile-dropdown:hover .profile-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.locale-selector-nav {
  display: flex;
  align-items: center;
}

.locale-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.locale-select:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: rgba(99, 102, 241, 0.1);
}

.locale-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
  20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake-animation {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Pulse animation for success */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse-animation {
  animation: pulse 0.6s ease-in-out;
}

/* Button press animation */
@keyframes buttonPress {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.button-press-animation {
  animation: buttonPress 0.2s ease-out;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-right {
  animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.slide-in-left {
  animation: slideInLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scale in animation */
@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bounce animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

.bounce-animation {
  animation: bounce 1s ease-in-out;
}

/* Loading spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* Glow pulse for important elements */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 4px rgba(99, 102, 241, 0.3);
  }
  50% {
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4), 0 0 20px rgba(99, 102, 241, 0.15);
  }
}

.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

/* Respecting reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .shake-animation,
  .pulse-animation,
  .button-press-animation,
  .fade-in,
  .slide-in-right,
  .slide-in-left,
  .scale-in,
  .bounce-animation,
  .spinner,
  .glow-pulse {
    animation: none !important;
  }
}

/* ============================================
   KEYBOARD NAVIGATION & FOCUS
   ============================================ */

/* Enhanced focus indicators for keyboard navigation */
body.keyboard-navigation *:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

body.keyboard-navigation button:focus,
body.keyboard-navigation a:focus,
body.keyboard-navigation input:focus,
body.keyboard-navigation select:focus,
body.keyboard-navigation textarea:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Keyboard focused game card */
.game-card.keyboard-focused {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), var(--shadow-xl);
  transform: translateY(-6px) scale(1.01);
  z-index: 10;
}

/* Skip to content link for accessibility */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--bg-base);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-to-content:focus {
  top: 1rem;
}

/* ============================================
   TOOLTIPS
   ============================================ */

.kyou-tooltip {
  position: absolute;
  z-index: 10001;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  line-height: 1.4;
  max-width: 250px;
  border: 1px solid var(--border-medium);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  white-space: nowrap;
}

.kyou-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: rgba(15, 23, 42, 0.95);
}

.kyou-tooltip.tooltip-bottom::before {
  bottom: auto;
  top: 100%;
  border-bottom-color: transparent;
  border-top-color: rgba(15, 23, 42, 0.95);
}

@keyframes tooltipShow {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tooltipHide {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-5px);
  }
}

.kyou-tooltip.tooltip-show {
  animation: tooltipShow 0.2s ease-out forwards;
}

.kyou-tooltip.tooltip-hide {
  animation: tooltipHide 0.2s ease-out forwards;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.dropdown-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
  border-left-color: var(--primary);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.dropdown-item:hover svg {
  opacity: 1;
}

.dropdown-item.logout {
  color: #ef4444;
}

.dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.5rem 0;
}