/* ===== AUTH SCREEN ===== */
#authScreen {
  background: var(--bg-primary);
  display: none;
  z-index: 1000;
  overflow-y: auto;
  scroll-behavior: smooth;
}

#authScreen.active {
  display: block;
}

.auth-page-container {
  min-height: 100vh;
}

.text-highlight {
  color: #0066FF !important;
  font-weight: 700;
}

/* ===== NAVIGATION BAR ===== */
.auth-nav {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 0;
  z-index: 200;
  box-shadow: 0 2px 8px var(--shadow);
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.auth-nav-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.nav-brand-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--input-focus);
  transition: transform 0.3s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--input-bg);
}

.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ===== HERO SECTION ===== */
.auth-hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px var(--shadow-dark);
  text-align: center;
  transition: all 0.5s ease;
  position: relative;
  overflow: visible;
}

.auth-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 64px var(--shadow-dark);
}

.logo-area {
  margin-bottom: 32px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px var(--shadow);
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.logo-area h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.logo-area p {
  font-size: 14px;
  color: var(--text-tertiary);
}

.auth-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark-theme .google-btn {
  background: #2d3748;
  color: #ffffff;
  border-color: #4a5568;
}

.google-btn:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark-theme .google-btn:hover {
  background: #374151;
}

.google-text-hint {
  text-align: center;
  margin-top: -8px;
  margin-bottom: 24px;
}

.google-text-hint small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: transparent;
  display: block;
  margin-top: 4px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  color: var(--text-tertiary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.guest-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guest-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.guest-form input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.guest-btn {
  width: 100%;
  max-width: 220px;
  display: block;
  margin: 0 auto;
  padding: 12px;
  background: #f0f9ff;
  /* Soft Blue Fill */
  color: #1d4ed8;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.guest-btn:hover {
  background: #e0f2fe;
  transform: translateY(-1px);
}

.quick-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  margin: 16px auto 0;
  padding: 8px 16px;
  background: #fffbeb;
  /* Soft Amber Fill */
  color: #c2410c;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.quick-mode-btn svg {
  color: #f97316;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quick-mode-btn:hover {
  background: #fef3c7;
  transform: translateY(-1px);
}

.quick-mode-btn svg {
  color: #db2777;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quick-mode-btn:hover {
  background: #fce7f3;
  color: #be185d;
  transform: translateY(-1px);
}

.quick-mode-btn:hover svg {
  transform: scale(1.1) rotate(5deg);
  color: #ec4899;
  /* Fun interaction */
}

.install-app-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  z-index: 10;
}

.install-app-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(96, 165, 250, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.install-app-btn svg {
  transition: transform 0.3s ease;
}

.install-app-btn:hover svg {
  animation: installPulse 0.5s ease infinite;
}

@keyframes installPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Mobile: Keep in top-right but slightly smaller */
@media (max-width: 600px) {
  .install-app-btn {
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    font-size: 11px;
  }

  .install-app-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
  padding: 80px 24px;
  border-top: 1px solid var(--border-color);
}

.content-section:nth-child(even) {
  background: var(--bg-secondary);
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-container h2 {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.section-subtitle {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 16px;
  margin-bottom: 48px;
}

/* ===== LEADERBOARD PREVIEW ===== */
.leaderboard-preview-card {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px var(--shadow);
  transition: all 0.3s ease;
}

.leaderboard-preview-card:hover {
  box-shadow: 0 12px 32px var(--shadow-dark);
  transform: translateY(-2px);
}

.lb-preview-header {
  background: var(--bg-primary);
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.lb-preview-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.lb-preview-list {
  padding: 16px;
}

.lb-preview-loading {
  text-align: center;
  padding: 32px;
  color: var(--text-tertiary);
}

.lb-preview-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--bg-primary);
  transition: all 0.3s ease;
  animation: slideInLeft 0.4s ease forwards;
  opacity: 0;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.lb-preview-item:nth-child(1) {
  animation-delay: 0.1s;
}

.lb-preview-item:nth-child(2) {
  animation-delay: 0.2s;
}

.lb-preview-item:nth-child(3) {
  animation-delay: 0.3s;
}

.lb-preview-item:nth-child(4) {
  animation-delay: 0.4s;
}

.lb-preview-item:nth-child(5) {
  animation-delay: 0.5s;
}

.lb-preview-item:hover {
  background: var(--input-bg);
  transform: translateX(4px);
}

.lb-preview-rank {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-tertiary);
  min-width: 32px;
  text-align: center;
}

.lb-preview-item:nth-child(1) .lb-preview-rank {
  color: #FFD700;
}

.lb-preview-item:nth-child(2) .lb-preview-rank {
  color: #C0C0C0;
}

.lb-preview-item:nth-child(3) .lb-preview-rank {
  color: #CD7F32;
}

.lb-preview-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-preview-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

.lb-preview-avatar-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  color: var(--text-secondary);
}

.lb-preview-wpm {
  font-size: 18px;
  font-weight: 700;
  color: var(--input-focus);
}

.lb-preview-wpm-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 4px;
}

.lb-preview-footer {
  padding: 24px;
  text-align: center;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
}

.lb-preview-footer p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.lb-preview-cta {
  padding: 12px 24px;
  background: var(--button-primary);
  color: var(--button-primary-text);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lb-preview-cta:hover {
  background: var(--button-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

/* ===== FEATURES GRID ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 4 columns on desktop */
  gap: 20px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  transition: all 0.4s ease;
}

.content-section:nth-child(even) .feature-card {
  background: var(--bg-primary);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px var(--shadow-dark);
  border-color: var(--input-focus);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  border-radius: 50%;
  transition: all 0.4s ease;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--input-focus);
  transition: all 0.4s ease;
}

.feature-card:hover .feature-icon {
  transform: rotateY(360deg);
  background: var(--input-focus);
}

.feature-card:hover .feature-icon svg {
  color: #ffffff;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== FAQs COMPACT ===== */
.faqs-compact {
  max-width: 800px;
  margin: 0 auto 32px;
}

.faq-compact-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.content-section:nth-child(even) .faq-compact-item {
  background: var(--bg-primary);
}

.faq-compact-item:hover {
  border-color: var(--input-focus);
  box-shadow: 0 4px 12px var(--shadow);
}

.faq-compact-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s ease;
}

.faq-compact-question h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.faq-compact-icon {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-tertiary);
  transition: all 0.3s ease;
  min-width: 20px;
  text-align: center;
}

.faq-compact-item.active .faq-compact-icon {
  transform: rotate(45deg);
  color: var(--input-focus);
}

.faq-compact-answer {
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s ease;
  padding: 0 20px;
}

.faq-compact-item.active .faq-compact-answer {
  max-height: 300px;
  padding: 0 20px 18px 20px;
}

.faq-compact-answer p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  font-size: 14px;
}

.faqs-more {
  text-align: center;
}

.faqs-more-btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--button-primary);
  color: var(--button-primary-text);
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--shadow);
}

.faqs-more-btn:hover {
  background: var(--button-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-dark);
}

/* ===== FOOTER ===== */
.auth-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 32px 24px;
  text-align: center;
}

.footer-content p {
  color: var(--text-tertiary);
  margin: 0;
  font-size: 14px;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-container h2 {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .auth-nav-content {
    padding: 0 16px;
  }

  .auth-nav-links {
    gap: 12px;
  }

  .nav-link {
    font-size: 13px;
    padding: 6px 10px;
  }

  .nav-brand-name {
    display: none;
  }

  .auth-hero {
    min-height: auto;
    padding: 32px 16px;
  }

  .content-section {
    padding: 48px 16px;
  }

  .section-container h2 {
    font-size: 24px;
  }

  .section-subtitle {
    font-size: 14px;
    margin-bottom: 32px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .feature-card {
    padding: 24px 20px;
  }

  .lb-preview-item {
    padding: 12px;
  }

  .lb-preview-rank {
    font-size: 16px;
    min-width: 28px;
  }

  .lb-preview-wpm {
    font-size: 16px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .auth-nav {
    padding: 8px 0;
  }

  .nav-logo {
    width: 32px;
    height: 32px;
  }

  .auth-nav-links {
    gap: 8px;
  }

  .nav-link {
    font-size: 12px;
    padding: 5px 8px;
  }

  .nav-link::after {
    display: none;
  }

  /* Features grid - 2 columns on mobile */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-hero {
    padding: 24px 12px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .logo-area h1 {
    font-size: 20px;
  }

  .section-container h2 {
    font-size: 22px;
  }

  .leaderboard-preview-card {
    border-radius: 12px;
  }

  .lb-preview-header {
    padding: 16px;
  }

  .lb-preview-header h3 {
    font-size: 18px;
  }

  .lb-preview-list {
    padding: 12px;
  }

  .lb-preview-item {
    gap: 12px;
    padding: 10px;
  }

  .lb-preview-name {
    font-size: 14px;
  }

  .lb-preview-footer {
    padding: 20px 16px;
  }

  .feature-card h3 {
    font-size: 16px;
  }

  .feature-card p {
    font-size: 13px;
  }

  .faq-compact-question {
    padding: 14px 16px;
  }

  .faq-compact-question h3 {
    font-size: 14px;
  }

  .faq-compact-item.active .faq-compact-answer {
    padding: 0 16px 14px 16px;
  }
}