/*
 * InkDuel Application Styles
 * Clean, minimal, intentional
 */

@import url("/assets/navigation-43450668.css");
@import url("/assets/landing-b405d6dc.css");
@import url("/assets/leaderboards-56ca4820.css");
@import url("/assets/game-17093eb4.css");
@import url("/assets/games-d64512e6.css");
@import url("/assets/game_show-c64fc377.css");
@import url("/assets/players-37b0d1a1.css");
@import url("/assets/daily_limit-ea43d240.css");
@import url("/assets/auth-0745df63.css");
@import url("/assets/pricing-1b9f023a.css");
@import url("/assets/daily_fills-b6e73835.css");
@import url("/assets/drills-1e201bbb.css");
@import url("/assets/footer-1aa718e8.css");
@import url("/assets/daily_challenges-2a895e0a.css");
@import url("/assets/daily_challenge_archive-f6e8097d.css");
@import url("/assets/community-3d29402e.css");
@import url("/assets/feedback-0b77329c.css");
@import url("/assets/profile-2e1c1916.css");
@import url("/assets/nudges-91d0dd6e.css");
@import url("/assets/legal-d669362b.css");
@import url("/assets/sections-3ffdfeab.css");
@import url("/assets/countdown-be93491a.css");
@import url("/assets/challenges-e3a133d1.css");
@import url("/assets/versus-a5c8988c.css");
@import url("/assets/showcase-78b9561d.css");

/* Prevent horizontal overflow on mobile */
html, body {
  overflow-x: hidden;
}

/* Base Typography */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: #fafaf9;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.01em;
  line-height: 1.2;
}

p {
  line-height: 1.6;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

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

/* Becomes visible on focus (for skip links) */
.sr-only-focusable:focus {
  position: fixed;
  top: 0;
  left: 0;
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: #1a1a2e;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
}

/* Focus states */
*:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

/* Disabled button states */
button:disabled,
input[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Animation classes */
.new-sentence {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile touch targets */
@media (max-width: 768px) {
  button, 
  a[class*="btn"], 
  input[type="submit"] {
    min-height: 44px;
  }

  /* Prevent iOS zoom on input focus */
  input, textarea, select {
    font-size: 16px;
  }
}

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

/* Judge avatars (shared across game + daily fill views) */
.judge-avatar {
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

.judge-avatar--small {
  width: 36px;
  height: 36px;
}

.judge-avatar--medium {
  width: 52px;
  height: 52px;
}

.judge-avatar--large {
  width: 72px;
  height: 72px;
}

.judge-avatar--xlarge {
  width: 96px;
  height: 96px;
}

/* Per-judge portrait crop adjustments */
.judge-avatar--rex {
  object-position: 30% center;
}

/* Opponent avatars */
.opponent-avatar {
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}

.opponent-avatar--small { width: 36px; height: 36px; }
.opponent-avatar--medium { width: 52px; height: 52px; }
.opponent-avatar--large { width: 72px; height: 72px; }
.opponent-avatar--xlarge { width: 96px; height: 96px; }

/* Character popup cards (judge/opponent profile on click) */
.character-popup-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.character-popup-trigger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.character-popup-trigger:hover {
  transform: scale(1.08);
}

.character-popup-trigger:active {
  transform: scale(0.96);
}

.character-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

.character-popup--visible {
  display: block;
  animation: popupFadeIn 0.15s ease-out;
}

@keyframes popupFadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.character-popup-card {
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  min-width: 220px;
  max-width: 280px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.character-popup-card::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #fafaf9;
  border-right: 1px solid #e7e5e4;
  border-bottom: 1px solid #e7e5e4;
}

.character-popup-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.character-popup-name {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.character-popup-role {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.character-popup-bio {
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
  margin: 4px 0 0;
  font-style: italic;
}

.character-popup-stat {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

/* Profile XP Card */
.profile-xp-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
}

.profile-xp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.profile-xp-title {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.profile-xp-tier {
  font-size: 1.125rem;
  font-weight: 700;
  color: #92400e;
  font-style: italic;
}

.profile-xp-level {
  font-size: 0.875rem;
  font-weight: 600;
  color: #b45309;
}

.profile-xp-total {
  font-size: 0.875rem;
  font-weight: 700;
  color: #b45309;
}

.profile-xp-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.375rem;
}

.profile-xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  border-radius: 4px;
  transition: width 0.6s ease-out;
}

.profile-xp-bar-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.profile-xp-streaks {
  display: flex;
  gap: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(217, 119, 6, 0.15);
}

.profile-streak-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.profile-streak-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.profile-streak-label {
  font-size: 0.6875rem;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Homepage player stats ribbon */
.player-stats-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 13px;
}

.ribbon-xp {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  color: #92400e;
}

.ribbon-xp-bar {
  width: 48px;
  height: 5px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 3px;
  overflow: hidden;
}

.ribbon-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  border-radius: 3px;
}

.ribbon-divider {
  width: 1px;
  height: 16px;
  background: rgba(217, 119, 6, 0.2);
}

.ribbon-streak {
  font-weight: 600;
  color: #16a34a;
}

.ribbon-daily-streak {
  font-weight: 600;
  color: #ea580c;
}

.ribbon-last-game {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 500;
  color: #475569;
  font-size: 12px;
}

.ribbon-last-game .returning-result-badge {
  font-size: 10px;
  padding: 1px 6px;
}

@media (max-width: 640px) {
  .player-stats-ribbon {
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    font-size: 12px;
  }
}

/* Print styles */
@media print {
  button, nav, footer {
    display: none !important;
  }
}
