/* CSS Reset for consistent box-sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  /* Color Palette */
  --color-robot-blue: #88CCF1;
  --color-bow-tie-coral: #FF9E7D;
  --color-cloud-white: #F4F9FC;
  --color-lavender-mist: #E0C3FC;
  --color-deep-ink: #2C3E50;
  --color-cream-puff: #FFF5E1;

  /* Typography */
  --font-heading: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;

  /* Spacing & sizing */
  --radius-default: 12px;
  --border-thick: 2px solid var(--color-deep-ink);
}

/* Prevent horizontal scroll on all pages */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--color-deep-ink);
  background-color: var(--color-cloud-white);
  /* CSS gradient background - soft watercolor-inspired effect */
  background: 
    radial-gradient(ellipse at 10% 20%, rgba(136, 204, 241, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 15%, rgba(224, 195, 252, 0.45) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 60%, rgba(255, 158, 125, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 15% 80%, rgba(136, 204, 241, 0.35) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 245, 225, 0.5) 0%, transparent 70%),
    linear-gradient(180deg, var(--color-cloud-white) 0%, #faf8f5 50%, #f5f0eb 100%);
  background-attachment: fixed;
  /* Original image background - uncomment to revert:
  background-image: url("watercolor_background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  */
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-robot-blue);
  margin: 0.5rem 0;
}

a {
  color: var(--color-deep-ink);
  text-decoration: none;
}

a:hover {
  color: var(--color-bow-tie-coral);
}

/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

.text-center { text-align: center; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-default);
  border: var(--border-thick);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  line-height: 1.2;
}

.btn-primary {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid #e07a52;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
  text-decoration: none;
  background-color: var(--color-bow-tie-coral);
  color: #fff;
  box-shadow: 0 3px 10px 0 rgba(255, 158, 125, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px 0 rgba(255, 158, 125, 0.5);
  background-color: #ff8a63;
  color: #fff;
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px 0 rgba(255, 158, 125, 0.4);
}

/* Large primary button variant */
.btn.btn-primary {
  padding: 1rem 2rem;
  font-size: 1.5rem;
  box-shadow: 0 4px 14px 0 rgba(255, 158, 125, 0.6);
}

.btn.btn-primary:hover {
  box-shadow: 0 6px 18px 0 rgba(255, 158, 125, 0.7);
}

/* Home Page Specifics */
.home-header {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 10;
}

.header-logo {
  width: 150px;
  flex-shrink: 0;
}

.header-logo.hidden {
  visibility: hidden;
}

.header-logo-img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.header-actions {
  min-width: 150px;
  flex-shrink: 0;
}

.home-nav-link {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  position: relative;
}

.home-nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--color-bow-tie-coral);
  transition: all 0.3s ease;
}

.home-nav-link:hover::after {
  width: 80%;
  left: 10%;
}

.btn-new-game {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  border: 2px solid #e07a52;
  background-color: var(--color-bow-tie-coral);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
  text-decoration: none;
  box-shadow: 0 3px 10px 0 rgba(255, 158, 125, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-new-game:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px 0 rgba(255, 158, 125, 0.5);
  background-color: #ff8a63;
  color: #fff;
}

.btn-new-game:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px 0 rgba(255, 158, 125, 0.4);
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1; /* Pushes footer down */
  text-align: center;
  padding: 2rem;
  pointer-events: none; /* Allow clicks to pass through to avatars behind */
}

/* Re-enable pointer events on interactive elements inside hero */
.hero-section .btn,
.hero-section a,
.hero-section button,
.hero-section .logo-large {
  pointer-events: auto;
}

.logo-large {
  max-width: 80%;
  width: 600px;
  height: auto;
  margin: 0 0 1.5rem 0;
  display: block;
}

.hero-cta {
  font-size: 1.8rem;
  margin-bottom: 3rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--color-deep-ink);
  padding: 1.5rem 2.5rem;
  max-width: 800px;
}

/* Scattered AI avatars background */
.hero-avatars-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden; /* Prevent avatars from causing horizontal scroll */
}

.hero-avatar-float {
  position: absolute;
  opacity: 0.35;
  border-radius: 50%;
  overflow: visible;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: avatar-float 8s ease-in-out infinite;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
  cursor: pointer;
}

.hero-avatar-float:hover,
.hero-avatar-float:focus {
  opacity: 1;
  transform: scale(1.15);
  animation-play-state: paused;
  z-index: 1000;
}

.hero-avatar-float:focus {
  outline: none;
}

.hero-avatar-float img {
  filter: saturate(0.85);
  transition: filter 0.3s ease;
  border-radius: 50%;
}

.hero-avatar-float:hover img,
.hero-avatar-float:focus img {
  filter: saturate(1);
}

/* Tooltip for avatar info */
.hero-avatar-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(45, 52, 54, 0.95);
  color: white;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  z-index: 1001;
}

.hero-avatar-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(45, 52, 54, 0.95);
}

.hero-avatar-float:hover .hero-avatar-tooltip,
.hero-avatar-float:focus .hero-avatar-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Tooltip positioned below for avatars near the top of the screen */
.hero-avatar-float--top .hero-avatar-tooltip {
  bottom: auto;
  top: calc(100% + 10px);
}

.hero-avatar-float--top .hero-avatar-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(45, 52, 54, 0.95);
}

/* Tooltip alignment for avatars on the left edge */
.hero-avatar-float--left-edge .hero-avatar-tooltip {
  left: 0;
  transform: translateX(0);
}

.hero-avatar-float--left-edge .hero-avatar-tooltip::after {
  left: 20px;
  transform: translateX(0);
}

/* Tooltip alignment for avatars on the right edge */
.hero-avatar-float--right-edge .hero-avatar-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.hero-avatar-float--right-edge .hero-avatar-tooltip::after {
  left: auto;
  right: 20px;
  transform: translateX(0);
}

.hero-avatar-tooltip-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-robot-blue);
  margin-bottom: 0.15rem;
}

.hero-avatar-tooltip-model {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.1rem;
}

.hero-avatar-tooltip-provider {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
}

@keyframes avatar-float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(2deg);
  }
  50% {
    transform: translateY(-4px) rotate(0deg);
  }
  75% {
    transform: translateY(-12px) rotate(-2deg);
  }
}

/* Adjust avatars for smaller screens */
@media (max-width: 768px) {
  .hero-avatars-background {
    /* Show avatars on mobile, but keep them subtle */
    display: block;
  }
  
  .hero-avatar-float {
    /* Smaller avatars on mobile */
    transform: scale(0.6);
    opacity: 0.25;
  }
  
  .hero-avatar-float:hover,
  .hero-avatar-float:focus {
    opacity: 0.9;
    transform: scale(0.75);
  }
  
  /* Hide tooltips on mobile - they're hard to use on touch */
  .hero-avatar-tooltip {
    display: none;
  }
}

/* Ensure main content is above the floating avatars */
.hero-section {
  position: relative;
  z-index: 1;
}

.footer-section {
  padding: 2.5rem 0 1.5rem;
  background: linear-gradient(
    to bottom,
    rgba(244, 249, 252, 0) 0%,
    rgba(244, 249, 252, 0.85) 30%,
    rgba(244, 249, 252, 1) 100%
  );
  /* No blur effect - keeps avatars visible behind the gradient */
  margin-top: auto;
  position: relative;
  z-index: 1; /* Same as hero-section, below header */
  padding-top: 4rem; /* Extra padding for the gradient fade */
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column {
  text-align: center;
}

.footer-column-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-deep-ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0;
}

.footer-column-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column-links li {
  margin-bottom: 0.5rem;
}

.footer-column-links li:last-child {
  margin-bottom: 0;
}

.footer-column-links li a {
  font-size: 0.95rem;
  color: var(--color-deep-ink);
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}

.footer-column-links li a:hover {
  opacity: 1;
  color: var(--color-bow-tie-coral);
}

.footer-copyright {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(44, 62, 80, 0.1);
}

.footer-copyright p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-deep-ink);
  opacity: 0.6;
}

/* Legacy footer links (for backwards compatibility) */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li a {
  font-size: 1rem;
  color: var(--color-deep-ink);
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-links li a:hover {
  opacity: 1;
  color: var(--color-bow-tie-coral);
}

/* Responsive footer */
@media (max-width: 600px) {
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-column {
    text-align: center;
  }
}

/* Game Arena Styles */
.game-layout {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
  width: 100%;
}

/* Top Scoreboard */
.arena-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-default);
  backdrop-filter: blur(5px);
}

.arena-round-info {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-robot-blue);
  margin-bottom: 0.5rem;
}

.arena-score {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--color-deep-ink);
  text-shadow: 2px 2px 0px white;
}

/* Battle Arena */
.arena-battle {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 3rem;
}

.battler {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 45%;
}

.battler-name {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--color-deep-ink);
}

.speech-bubble {
  width: 100%;
  min-height: 150px;
  padding: 2rem;
  border-radius: 20px;
  border: var(--border-thick);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: 4px 4px 0px rgba(44, 62, 80, 0.1);
  text-align: center;
}

.speech-bubble.human {
  /* Using the same color as result-word-box.human */
  background-color: var(--color-cream-puff);
  border-color: var(--color-bow-tie-coral);
}

.speech-bubble.ai {
  /* Using the same color as result-word-box.ai */
  background-color: var(--color-lavender-mist);
  border-color: var(--color-robot-blue);
}


/* Inputs inside bubble */
.speech-bubble input[type="text"] {
  width: 90%;
  padding: 0.8rem;
  font-size: 1.2rem;
  font-family: var(--font-body);
  border: 2px solid rgba(44, 62, 80, 0.2);
  border-radius: 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  outline: none;
}

.speech-bubble input[type="text"]:focus {
  border-color: var(--color-bow-tie-coral); /* Matches human result box color */
}

.speech-bubble button, .speech-bubble input[type="submit"] {
  margin-top: 1rem;
  background-color: var(--color-robot-blue);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.1s;
}

.speech-bubble button:hover, .speech-bubble input[type="submit"]:hover {
  transform: scale(1.05);
}

.thinking-text {
  margin-top: 1rem;
  font-style: italic;
  color: #666;
  font-size: 1rem;
}

/* Judge Section */
.judge-section {
  background-color: white;
  padding: 2rem;
  border-radius: var(--radius-default);
  border: 1px solid rgba(44, 62, 80, 0.1);
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 14px 0 rgba(0,0,0,0.05);
}

.judge-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-deep-ink);
  margin-bottom: 1rem;
}

.judge-title.waiting {
  font-size: 1.2rem;
  color: #666;
}

.sub-status {
  color: #888;
}

/* Round Result Card (Cleaned) */
.round-result-card-clean {
  margin-bottom: 1.5rem;
  /* Removed padding, background, border to remove grey box */
}

.result-header-clean {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  /* Removed border-bottom */
  padding-bottom: 0.5rem;
}

.result-header-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.result-score-info {
  font-size: 0.9rem;
  color: #888;
  font-weight: normal;
}

.round-label {
  font-weight: bold;
  font-size: 1.2rem;
  color: #555;
}

.result-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  color: white;
}
.result-badge.win { background-color: var(--color-bow-tie-coral); }
.result-badge.lose { background-color: var(--color-robot-blue); }
.result-badge.draw { background-color: #aaa; }

.result-words {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-word-box {
  background: white;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  min-width: 120px;
  text-align: center;
}
.result-word-box.human { border-color: var(--color-bow-tie-coral); background-color: var(--color-cream-puff); }
.result-word-box.ai { border-color: var(--color-robot-blue); background-color: var(--color-lavender-mist); }

.result-word-box .label { font-size: 0.8rem; text-transform: uppercase; color: #666; margin-bottom: 0.2rem; }
.result-word-box .word { font-size: 1.2rem; font-weight: bold; }

.vs { font-weight: bold; color: #ccc; }

.judge-decision-clean {
  text-align: left;
  /* Removed background, padding, border */
  padding: 1rem 0; 
}

.judge-pick {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.judge-reasoning {
  font-style: italic;
  color: #555;
  line-height: 1.4;
}

.judge-waiting-message {
  margin-top: 1rem;
  color: #666;
}

/* History Section */
.game-history {
  background-color: rgba(255, 255, 255, 0.6);
  padding: 1.5rem;
  border-radius: var(--radius-default);
}

.history-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-deep-ink);
  margin-bottom: 1rem;
  text-align: center;
}

.no-history-yet {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 1rem;
}

.history-card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  margin-right: 8px;
}
.tag.human { background: var(--color-cream-puff); color: var(--color-deep-ink); }
.tag.ai { background: var(--color-lavender-mist); color: var(--color-deep-ink); }
.tag.judge { background: #E8FFE6; color: #1B5E20; }

.muted { color: #777; font-size: 0.9rem; }
.error { color: #D64045; font-weight: bold; margin-top: 0.5rem; font-size: 0.95rem; }

/* Word input message styles */
.word-input-message {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
}

.word-input-message.hint {
  color: #888;
  font-weight: normal;
  font-style: italic;
}

.word-input-message.error {
  color: #D64045;
  font-weight: 600;
  font-style: normal;
}

/* Debug overrides for cleaner look in history */
.debug-section { margin-top: 0.5rem; font-size: 0.8rem; text-align: left; width: 100%; }
.debug-summary { color: #999; }

/* Pricing Page */
.pricing-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.pricing-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--color-deep-ink);
  margin-bottom: 1rem;
}

.pricing-subtitle {
  font-size: 1.2rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

.pricing-grid {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.pricing-card {
  background: white;
  border-radius: var(--radius-default);
  padding: 2rem;
  width: 280px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid rgba(44, 62, 80, 0.1);
  box-shadow: 0 4px 14px 0 rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px 0 rgba(0,0,0,0.1);
}

.pricing-card.featured {
  border: 2px solid var(--color-bow-tie-coral);
  transform: scale(1.05);
}

.pricing-card.featured:hover {
  transform: scale(1.05) translateY(-5px);
}

.plan-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-deep-ink);
  margin-bottom: 0.5rem;
}

.plan-price {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--color-robot-blue);
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
}

.plan-price span {
  font-size: 1rem;
  color: #888;
  font-weight: normal;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  flex-grow: 1;
}

.plan-features li {
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  color: #555;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.plan-features li::before {
  content: '✓';
  color: var(--color-bow-tie-coral);
  font-weight: bold;
}

.plan-btn {
  width: 100%;
  padding: 0.8rem;
  border-radius: 8px;
  border: none;
  background-color: var(--color-cloud-white);
  color: var(--color-deep-ink);
  font-weight: bold;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
}

.pricing-card.featured .plan-btn {
  background-color: var(--color-bow-tie-coral);
  color: white;
}

.plan-btn:hover {
  background-color: var(--color-robot-blue);
  color: white;
}

/* Free Tier Banner */
.free-tier-banner {
  background: linear-gradient(135deg, var(--color-cloud-white) 0%, rgba(136, 204, 241, 0.15) 100%);
  border: 2px dashed var(--color-robot-blue);
  border-radius: var(--radius-default);
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
}

.free-tier-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.free-tier-header {
  flex-shrink: 0;
}

.free-tier-label {
  display: inline-block;
  background-color: var(--color-robot-blue);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}

.free-tier-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--color-deep-ink);
  margin: 0;
}

.free-tier-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  justify-content: center;
}

.free-tier-features li {
  font-size: 0.95rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.free-tier-features li::before {
  content: '✓';
  color: var(--color-robot-blue);
  font-weight: bold;
}

.free-tier-btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  border: 2px solid var(--color-robot-blue);
  background-color: white;
  color: var(--color-deep-ink);
  font-weight: bold;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-align: center;
  text-decoration: none;
  flex-shrink: 0;
}

.free-tier-btn:hover {
  background-color: var(--color-robot-blue);
  color: white;
  transform: translateY(-2px);
}

.upgrade-divider {
  text-align: center;
  margin: 2rem 0;
  position: relative;
}

.upgrade-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(44, 62, 80, 0.15);
}

.upgrade-divider span {
  background-color: var(--color-cloud-white);
  padding: 0 1.5rem;
  position: relative;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: #888;
}

.support-section {
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-default);
  padding: 3rem;
  text-align: center;
  margin-bottom: 3rem;
  border: var(--border-thick);
}

.support-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-deep-ink);
  margin-bottom: 1rem;
}

.support-text {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
  color: #444;
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background-color: var(--color-bow-tie-coral);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
}

/* ============================================
   SIGNUP MODAL
   ============================================ */

.signup-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(44, 62, 80, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 1rem;
}

.signup-modal.active {
  opacity: 1;
  visibility: visible;
}

.signup-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, var(--color-cloud-white) 100%);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(136, 204, 241, 0.3);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.signup-modal.active .signup-modal-content {
  transform: translateY(0);
}

.signup-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(44, 62, 80, 0.1);
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-deep-ink);
  transition: background 0.2s, transform 0.2s;
}

.signup-modal-close:hover {
  background: rgba(44, 62, 80, 0.2);
  transform: scale(1.1);
}

.signup-modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.signup-modal-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.signup-modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.5rem 0;
}

.signup-modal-subtitle {
  color: #666;
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.signup-modal-benefits {
  background: rgba(136, 204, 241, 0.1);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.signup-modal-benefits h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.75rem 0;
}

.signup-modal-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.signup-modal-benefits li {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.signup-modal-benefits li:last-child {
  margin-bottom: 0;
}

.signup-modal-form {
  margin-bottom: 1rem;
}

.signup-form-group {
  margin-bottom: 1rem;
}

.signup-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-deep-ink);
  margin-bottom: 0.4rem;
}

.signup-form-group input {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid rgba(136, 204, 241, 0.5);
  border-radius: 10px;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.signup-form-group input:focus {
  outline: none;
  border-color: var(--color-robot-blue);
  box-shadow: 0 0 0 3px rgba(136, 204, 241, 0.2);
}

.signup-form-group input.code-input {
  font-size: 1.8rem;
  text-align: center;
  letter-spacing: 0.5rem;
  font-family: var(--font-heading);
}

/* Cloudflare Turnstile widget */
.cf-turnstile {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.signup-modal-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-bow-tie-coral) 0%, #ff8a65 100%);
  color: white;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(255, 158, 125, 0.4);
}

.signup-modal-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 158, 125, 0.5);
}

.signup-modal-btn:active:not(:disabled) {
  transform: translateY(0);
}

.signup-modal-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.signup-modal-error {
  background: #fff0f0;
  border: 1px solid #ffcccc;
  color: #cc0000;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

.signup-modal-footer-text {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

.signup-modal-footer-text a {
  color: var(--color-robot-blue);
  text-decoration: underline;
}

.signup-modal-footer-text a:hover {
  color: var(--color-bow-tie-coral);
}

/* Signup modal - note about costs */
.signup-modal-note {
  background: rgba(255, 158, 125, 0.1);
  border-left: 3px solid var(--color-bow-tie-coral);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.5;
  border-radius: 0 8px 8px 0;
}

/* Signup modal - username section */
.signup-username-section {
  margin-bottom: 1.5rem;
}

.signup-username-section h4,
.signup-auth-section h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.75rem 0;
}

.username-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.username-input-wrapper input {
  flex: 1;
  padding-right: 100px;
}

.username-status {
  position: absolute;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.username-status.success {
  color: #38a169;
}

.username-status.error {
  color: #e53e3e;
}

.username-status.checking {
  color: #718096;
}

/* Email status (for auth form) */
.email-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.email-input-wrapper input {
  flex: 1;
  padding-right: 120px;
}

.email-status {
  position: absolute;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.email-status.success {
  color: #38a169;
}

.email-status.error {
  color: #e53e3e;
}

.email-status.checking {
  color: #718096;
}

.email-status.info {
  color: var(--color-robot-blue);
}

/* Signup modal - auth section */
.signup-auth-section {
  border-top: 1px solid rgba(136, 204, 241, 0.3);
  padding-top: 1.5rem;
}

.auth-options.auth-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.auth-options.auth-disabled .google-signin-btn,
.auth-options.auth-disabled .signup-modal-btn,
.auth-options.auth-disabled input {
  cursor: not-allowed;
}

/* ============================================
   LIMIT REACHED MODAL (for signed-in users)
   ============================================ */

.limit-reached-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(44, 62, 80, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
  padding: 1rem;
}

.limit-reached-modal.active {
  opacity: 1;
  visibility: visible;
}

.limit-reached-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, var(--color-cloud-white) 100%);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(136, 204, 241, 0.3);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.limit-reached-modal.active .limit-reached-modal-content {
  transform: translateY(0);
}

.limit-reached-message {
  background: rgba(136, 204, 241, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.limit-reached-message p {
  color: #444;
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.limit-reached-message p:last-child {
  margin-bottom: 0;
}

.limit-reached-message a {
  color: var(--color-robot-blue);
  text-decoration: underline;
}

.limit-reached-message a:hover {
  color: var(--color-bow-tie-coral);
}

.limit-reached-actions {
  text-align: center;
}

/* Utility class */
.hidden {
  display: none !important;
}

/* ============================================
   AUTH PAGES (Devise sign-in/sign-up)
   ============================================ */

.auth-container {
  max-width: 400px;
  margin: 3rem auto;
  padding: 2rem;
  background: linear-gradient(135deg, #ffffff 0%, var(--color-cloud-white) 100%);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(136, 204, 241, 0.3);
}

.auth-container h2 {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-deep-ink);
  margin-bottom: 1.5rem;
}

.auth-container .field {
  margin-bottom: 1rem;
}

.auth-container .field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-deep-ink);
  margin-bottom: 0.4rem;
}

.auth-container .field input[type="email"],
.auth-container .field input[type="password"],
.auth-container .field input[type="text"] {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid rgba(136, 204, 241, 0.5);
  border-radius: 10px;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-container .field input:focus {
  outline: none;
  border-color: var(--color-robot-blue);
  box-shadow: 0 0 0 3px rgba(136, 204, 241, 0.2);
}

.auth-container .field input[type="checkbox"] {
  margin-right: 0.5rem;
}

.auth-container .cf-turnstile {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.auth-container .actions {
  margin-top: 1.5rem;
}

.auth-container .actions input[type="submit"] {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-bow-tie-coral) 0%, #ff8a65 100%);
  color: white;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(255, 158, 125, 0.4);
}

.auth-container .actions input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 158, 125, 0.5);
}

.auth-container .actions input[type="submit"]:active {
  transform: translateY(0);
}

/* Auth links */
.auth-container a {
  color: var(--color-robot-blue);
  text-decoration: none;
}

.auth-container a:hover {
  color: var(--color-bow-tie-coral);
  text-decoration: underline;
}

/* Error messages */
.auth-container #error_explanation {
  background: #fff0f0;
  border: 1px solid #ffcccc;
  color: #cc0000;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.auth-container #error_explanation h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
  color: #cc0000;
}

.auth-container #error_explanation ul {
  margin: 0;
  padding-left: 1.2rem;
}

/* Auth page checkbox */
.auth-container .checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-container .checkbox-field label {
  margin-bottom: 0;
}

/* Auth divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(136, 204, 241, 0.5);
}

.auth-divider span {
  padding: 0 1rem;
  color: #888;
  font-size: 0.9rem;
}

/* Magic link section */
.magic-link-section {
  text-align: center;
  padding: 1rem;
  background: rgba(136, 204, 241, 0.1);
  border-radius: 12px;
}

.magic-link-text {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  color: var(--color-deep-ink);
}

.magic-link-btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--color-robot-blue);
  color: white !important;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none !important;
  transition: transform 0.15s, box-shadow 0.15s;
}

.magic-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(136, 204, 241, 0.4);
  color: white !important;
}

/* ============================================
   AUTH PAGES (Full page with header/footer)
   ============================================ */

.auth-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  max-width: 480px;
  width: 100%;
  background: linear-gradient(135deg, #ffffff 0%, var(--color-cloud-white) 100%);
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(136, 204, 241, 0.3);
}

.auth-card h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-deep-ink);
  text-align: center;
  margin: 0 0 0.5rem 0;
}

.auth-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-deep-ink);
  margin: 0 0 1rem 0;
}

.auth-subtitle {
  text-align: center;
  color: #666;
  font-size: 1rem;
  margin: 0 0 1.5rem 0;
}

.auth-icon {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.auth-benefits {
  background: rgba(136, 204, 241, 0.1);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.auth-benefits ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-benefits li {
  padding: 0.4rem 0;
  font-size: 0.95rem;
}

.auth-note {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.auth-error {
  background: #fff0f0;
  border: 1px solid #ffcccc;
  color: #cc0000;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.auth-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(136, 204, 241, 0.3);
}

.auth-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.auth-form-group {
  margin-bottom: 1rem;
}

.auth-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-deep-ink);
  margin-bottom: 0.4rem;
}

.auth-form-group input[type="email"],
.auth-form-group input[type="password"],
.auth-form-group input[type="text"] {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid rgba(136, 204, 241, 0.5);
  border-radius: 10px;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--color-robot-blue);
  box-shadow: 0 0 0 3px rgba(136, 204, 241, 0.2);
}

.auth-form-group .code-input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
  font-family: var(--font-heading);
}

.auth-form {
  margin-bottom: 1rem;
}

.auth-form .cf-turnstile {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-hint {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  margin: 0.75rem 0 0 0;
}

.auth-footer {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin: 1.5rem 0 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(136, 204, 241, 0.3);
}

.auth-footer a {
  color: var(--color-robot-blue);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  color: var(--color-bow-tie-coral);
  text-decoration: underline;
}

/* Full width button */
.btn-full {
  width: 100%;
}

/* Auth options (gated by username) */
.auth-card .auth-options.auth-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Auth form groups (reusing signup modal styles) */
.auth-container .signup-form-group {
  margin-bottom: 1rem;
}

.auth-container .signup-form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-deep-ink);
  margin-bottom: 0.4rem;
}

.auth-container .signup-form-group input[type="email"],
.auth-container .signup-form-group input[type="password"],
.auth-container .signup-form-group input[type="text"] {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid rgba(136, 204, 241, 0.5);
  border-radius: 10px;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.auth-container .signup-form-group input:focus {
  outline: none;
  border-color: var(--color-robot-blue);
  box-shadow: 0 0 0 3px rgba(136, 204, 241, 0.2);
}

/* ============================================
   GOOGLE SIGN-IN BUTTON
   ============================================ */

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 24px;
  background-color: #ffffff;
  border: 2px solid #dadce0;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: #3c4043;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.google-signin-btn:hover {
  background-color: #f8f9fa;
  border-color: #c6c8ca;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.google-signin-btn:active {
  background-color: #f1f3f4;
}

.google-signin-btn .google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.google-signin-btn span {
  line-height: 1;
}

/* Field hints */
.field-hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 0.3rem;
  margin-bottom: 0;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */

.flash {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: flash-slide-in 0.3s ease-out;
  max-width: 90%;
  text-align: center;
}

@keyframes flash-slide-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.flash-notice {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-alert {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.flash-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
  color: #856404;
  border: 1px solid #ffeeba;
}

/* ============================================
   SOCIAL SHARE SECTION
   ============================================ */

.share-section {
  margin: 1.5rem 0 2rem;
  padding: 1.75rem 2rem;
  background: linear-gradient(145deg, 
    rgba(224, 195, 252, 0.4) 0%, 
    rgba(136, 204, 241, 0.35) 50%,
    rgba(255, 158, 125, 0.3) 100%
  );
  border-radius: var(--radius-default);
  border: 2px solid rgba(136, 204, 241, 0.5);
  box-shadow: 
    0 6px 24px rgba(136, 204, 241, 0.2),
    0 2px 8px rgba(224, 195, 252, 0.15);
  position: relative;
  overflow: hidden;
}

/* Playful dashed border accent */
.share-section::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  border: 2px dashed rgba(136, 204, 241, 0.4);
  border-radius: 8px;
  pointer-events: none;
}

.share-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.share-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-deep-ink);
  margin: 0;
}

.share-subtitle {
  text-align: center;
  color: var(--color-deep-ink);
  opacity: 0.75;
  margin: 0 0 1.25rem 0;
  font-size: 1rem;
}

.share-preview {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--color-bow-tie-coral);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.share-message {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-deep-ink);
  line-height: 1.6;
  font-style: italic;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  min-width: 110px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
  text-decoration: none;
  border: none;
  color: white;
}

.share-btn:hover {
  transform: translateY(-2px);
  color: white;
}

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

.share-icon-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Platform-specific colors */
.share-btn-twitter {
  background-color: #000000;
}
.share-btn-twitter:hover {
  background-color: #333333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-btn-facebook {
  background-color: #1877F2;
}
.share-btn-facebook:hover {
  background-color: #0d65d9;
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
}

.share-btn-linkedin {
  background-color: #0A66C2;
}
.share-btn-linkedin:hover {
  background-color: #084d94;
  box-shadow: 0 4px 12px rgba(10, 102, 194, 0.4);
}

.share-btn-whatsapp {
  background-color: #25D366;
}
.share-btn-whatsapp:hover {
  background-color: #1da851;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.share-btn-copy {
  background-color: var(--color-deep-ink);
}
.share-btn-copy:hover {
  background-color: #3d5a73;
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.3);
}

.share-btn-copy.copied {
  background-color: var(--color-bow-tie-coral);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .share-section {
    padding: 1.5rem 1rem;
    margin: 1rem 0 1.5rem;
  }
  
  .share-title {
    font-size: 1.25rem;
  }
  
  .share-subtitle {
    font-size: 0.9rem;
  }
  
  .share-buttons {
    gap: 0.5rem;
  }
  
  .share-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-width: auto;
  }
  
  .share-btn span {
    display: none;
  }
  
  .share-icon-svg {
    width: 22px;
    height: 22px;
  }
}

/* ============================================
   HEADER AUTH LINKS & USER DROPDOWN
   ============================================ */

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.auth-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-auth-link {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
}

.header-auth-link:hover {
  background-color: rgba(136, 204, 241, 0.1);
}

.header-auth-link-primary {
  background-color: var(--color-robot-blue);
  color: white !important;
}

.header-auth-link-primary:hover {
  background-color: #6bb8e8;
  color: white !important;
}

/* User Dropdown */
.user-dropdown {
  position: relative;
}

.user-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: white;
  border: 2px solid rgba(136, 204, 241, 0.5);
  border-radius: 25px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: var(--font-body);
}

.user-dropdown-trigger:hover {
  border-color: var(--color-robot-blue);
  box-shadow: 0 2px 8px rgba(136, 204, 241, 0.2);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--color-robot-blue) 0%, var(--color-lavender-mist) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
}

.user-name {
  font-weight: 600;
  color: var(--color-deep-ink);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 1000;
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--color-deep-ink);
  text-decoration: none;
  transition: background-color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: rgba(136, 204, 241, 0.1);
  color: var(--color-deep-ink);
}

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

.dropdown-item-logout:hover {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.dropdown-icon {
  font-size: 1rem;
}

.dropdown-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0.5rem 0;
}

/* ============================================
   PROFILE PAGE
   ============================================ */

.profile-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-robot-blue) 0%, var(--color-lavender-mist) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 2rem;
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
}

.profile-info h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.25rem 0;
}

.profile-email {
  color: #666;
  margin: 0 0 0.5rem 0;
}

.profile-stats {
  display: flex;
  gap: 1.5rem;
  margin: 0;
}

.profile-stats .stat {
  font-size: 0.9rem;
  color: #666;
}

.profile-stats .stat strong {
  color: var(--color-deep-ink);
}

.profile-actions {
  flex-shrink: 0;
}

.btn-secondary {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: white;
  border: 2px solid var(--color-robot-blue);
  color: var(--color-deep-ink);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-secondary:hover {
  background-color: rgba(136, 204, 241, 0.1);
  transform: translateY(-1px);
  color: var(--color-deep-ink);
}

.profile-section {
  background: white;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.profile-section h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--color-deep-ink);
  margin: 0 0 1rem 0;
}

/* Games List */
.games-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #ddd;
  transition: transform 0.15s, box-shadow 0.15s;
}

.game-card:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.game-card.human {
  border-left-color: var(--color-bow-tie-coral);
}

.game-card.ai {
  border-left-color: var(--color-robot-blue);
}

.game-card.draw {
  border-left-color: #aaa;
}

.game-card-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.game-result .result-badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
}

.result-badge.in-progress {
  background-color: var(--color-lavender-mist);
  color: var(--color-deep-ink);
}

.result-badge.terminated {
  background-color: #6c757d;
}

.game-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.2rem;
}

.human-score {
  color: var(--color-bow-tie-coral);
}

.ai-score {
  color: var(--color-robot-blue);
}

.score-separator {
  color: #ccc;
}

.game-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.game-opponent {
  font-weight: 600;
  color: var(--color-deep-ink);
}

.game-date {
  font-size: 0.85rem;
  color: #888;
}

.btn-link {
  color: var(--color-robot-blue);
  font-weight: 600;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: var(--font-heading);
  color: var(--color-deep-ink);
  margin: 0 0 0.5rem 0;
}

.empty-state p {
  color: #666;
  margin: 0 0 1.5rem 0;
}

/* ============================================
   SETTINGS PAGE
   ============================================ */

.settings-container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.settings-header {
  margin-bottom: 2rem;
}

.settings-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.5rem 0;
}

.settings-header p {
  margin: 0;
}

.settings-section {
  background: white;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.settings-section h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.25rem 0;
}

.section-description {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

.settings-form {
  margin-bottom: 0.5rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.form-group {
  flex: 1;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid rgba(136, 204, 241, 0.5);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-robot-blue);
  box-shadow: 0 0 0 3px rgba(136, 204, 241, 0.2);
}

.form-input.code-input {
  font-size: 1.5rem;
  letter-spacing: 0.3rem;
  text-align: center;
  font-family: var(--font-heading);
}

.form-hint {
  font-size: 0.85rem;
  color: #888;
  margin: 0.5rem 0 0 0;
}

.form-disabled {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 10px;
}

.current-value {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.current-email {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.current-email p {
  margin: 0;
}

.pending-email-notice {
  padding: 1rem;
  background: rgba(255, 158, 125, 0.1);
  border: 1px solid rgba(255, 158, 125, 0.3);
  border-radius: 10px;
}

.pending-email-notice p {
  margin: 0 0 0.5rem 0;
}

.connected-account {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 10px;
}

.account-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-link-danger {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-top: 0.5rem;
}

.btn-link-danger:hover {
  text-decoration: underline;
}

/* Danger Zone */
.danger-zone {
  border: 2px solid rgba(220, 53, 69, 0.3);
}

.danger-zone h2 {
  color: #dc3545;
}

.danger-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.danger-info h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.25rem 0;
}

.danger-info p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
}

.btn-danger {
  padding: 0.6rem 1.2rem;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.btn-danger:hover {
  background: #c82333;
}

/* ============================================
   ACCOUNT AREA (Profile, Settings, History)
   ============================================ */

.account-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

.account-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.account-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-deep-ink);
  text-decoration: none;
  transition: background-color 0.2s, transform 0.15s;
}

.account-nav-item:hover {
  background: rgba(136, 204, 241, 0.15);
  color: var(--color-deep-ink);
}

.account-nav-item.active {
  background: linear-gradient(135deg, var(--color-robot-blue) 0%, #6bb8e8 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(136, 204, 241, 0.4);
}

.account-nav-item.active:hover {
  color: white;
}

.account-nav-icon {
  font-size: 1.1rem;
}

.account-main {
  /* Main content area */
}

.account-page {
  /* Page wrapper */
}

.account-page-header {
  margin-bottom: 2rem;
}

.account-page-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.5rem 0;
}

.account-page-header p {
  color: #666;
  margin: 0;
}

/* Profile header with avatar */
.account-page-header:has(.profile-avatar-large) {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--color-robot-blue) 0%, var(--color-lavender-mist) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 2rem;
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.profile-info-header h1 {
  margin: 0 0 0.25rem 0;
}

.profile-email-text {
  color: #666;
  margin: 0;
}

/* Account cards */
.account-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.account-card h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.25rem 0;
}

.card-description {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-header-row h2 {
  margin: 0;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.stat-box {
  text-align: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-radius: 12px;
  border: 1px solid rgba(136, 204, 241, 0.2);
}

.stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-deep-ink);
  line-height: 1;
}

.stat-value.win-percentage {
  color: var(--color-bow-tie-coral);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}

/* Games preview on profile */
.games-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.game-preview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #ddd;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.game-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-preview-card.human {
  border-left-color: var(--color-bow-tie-coral);
}

.game-preview-card.ai {
  border-left-color: var(--color-robot-blue);
}

.game-preview-card.draw {
  border-left-color: #aaa;
}

.game-preview-score {
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.game-preview-date {
  font-size: 0.8rem;
  color: #888;
}

/* Game cards in history list - make them clickable */
a.game-card {
  text-decoration: none;
  cursor: pointer;
}

a.game-card:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

a.game-card .game-meta,
a.game-card .game-opponent,
a.game-card .game-date {
  color: inherit;
}

/* History Games List - Account Page */
.history-games-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-game-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 4px solid #e0e0e0;
}

.history-game-card:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.history-game-card.human {
  border-left-color: var(--color-bow-tie-coral);
}

.history-game-card.ai {
  border-left-color: var(--color-robot-blue);
}

.history-game-card.draw {
  border-left-color: #999;
}

.history-game-card.terminated_game {
  border-left-color: #6c757d;
}

.history-game-result {
  flex-shrink: 0;
}

.history-game-score {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
}

.history-game-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.history-game-opponent {
  font-weight: 600;
  color: var(--color-deep-ink);
  font-size: 0.95rem;
}

.history-game-date {
  font-size: 0.85rem;
  color: #888;
}

.history-game-arrow {
  color: #ccc;
  flex-shrink: 0;
}

.history-game-card:hover .history-game-arrow {
  color: var(--color-deep-ink);
}

@media (max-width: 500px) {
  .history-game-card {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .history-game-info {
    flex-basis: 100%;
    order: 3;
  }
  
  .history-game-arrow {
    display: none;
  }
}

/* Empty state compact */
.empty-state-compact {
  text-align: center;
  padding: 2rem 1rem;
}

.empty-state-compact .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.empty-state-compact h3 {
  font-family: var(--font-heading);
  color: var(--color-deep-ink);
  margin: 0 0 0.5rem 0;
}

.empty-state-compact p {
  color: #666;
  margin: 0 0 1rem 0;
}

/* Breadcrumb navigation */
.breadcrumb {
  margin-bottom: 1.5rem;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-robot-blue);
  text-decoration: none;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  transition: background-color 0.2s, transform 0.15s;
}

.breadcrumb-link:hover {
  background: white;
  transform: translateX(-2px);
  color: var(--color-bow-tie-coral);
}

/* Game details page */
.game-details-header {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.result-badge-large {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
}

.result-badge-large.win {
  background: linear-gradient(135deg, var(--color-bow-tie-coral) 0%, #ff8a65 100%);
}

.result-badge-large.lose {
  background: linear-gradient(135deg, var(--color-robot-blue) 0%, #6bb8e8 100%);
}

.result-badge-large.draw {
  background: linear-gradient(135deg, #888 0%, #aaa 100%);
}

.result-badge-large.terminated {
  background: linear-gradient(135deg, #6c757d 0%, #868e96 100%);
}

.result-badge-large.in-progress {
  background: linear-gradient(135deg, var(--color-lavender-mist) 0%, #d4b3f5 100%);
  color: var(--color-deep-ink);
}

.game-score-large {
  font-family: var(--font-heading);
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.game-score-large .human-score {
  color: var(--color-bow-tie-coral);
}

.game-score-large .ai-score {
  color: var(--color-robot-blue);
}

.game-score-large .score-separator {
  color: #ccc;
  margin: 0 0.5rem;
}

.game-details-meta {
  color: #666;
  font-size: 0.95rem;
}

.meta-divider {
  margin: 0 0.75rem;
  color: #ddd;
}

/* Rounds list */
.rounds-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.round-card {
  padding: 1.25rem;
  background: #f8f9fa;
  border-radius: 12px;
  border-left: 4px solid var(--color-robot-blue);
  margin-bottom: 1rem;
}

.round-card:last-child {
  margin-bottom: 0;
}

.round-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.round-number {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-deep-ink);
}

.round-winner {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.round-winner.human {
  background: rgba(255, 158, 125, 0.2);
  color: #d35400;
}

.round-winner.ai {
  background: rgba(136, 204, 241, 0.2);
  color: #1a6aa5;
}

.round-winner.draw {
  background: rgba(128, 128, 128, 0.2);
  color: #666;
}

.round-words {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.round-words-two {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.round-words-two .word-column {
  flex: 1;
  max-width: 200px;
}

.vs-divider {
  font-weight: bold;
  color: #ccc;
  font-size: 0.9rem;
}

.word-column {
  text-align: center;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #eee;
}

.word-column.starting {
  border-color: #ddd;
}

.word-column.human {
  border-color: var(--color-bow-tie-coral);
  background: rgba(255, 245, 225, 0.5);
}

.word-column.ai {
  border-color: var(--color-robot-blue);
  background: rgba(224, 195, 252, 0.3);
}

.word-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.25rem;
}

.word-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-deep-ink);
}

.word-column.winner {
  position: relative;
}

.word-winner-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 12px;
  z-index: 1;
}

.word-winner-badge.human {
  background: #ff8c64;
  color: white;
  border: none;
}

.word-winner-badge.ai {
  background: #88ccf1;
  color: white;
  border: none;
}

.round-reasoning {
  padding: 0.75rem 1rem;
  background: white;
  border-radius: 8px;
  border-left: 3px solid var(--color-lavender-mist);
}

.round-reasoning .reasoning-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.25rem;
}

.round-reasoning p {
  margin: 0;
  font-size: 0.9rem;
  font-style: italic;
  color: #555;
  line-height: 1.5;
}

/* Round card winner styling */
.round-card.human-won {
  border-left-color: var(--color-bow-tie-coral);
}

.round-card.ai-won {
  border-left-color: var(--color-robot-blue);
}

.no-rounds-message {
  text-align: center;
  color: #888;
  padding: 2rem;
}

/* Responsive */
@media (max-width: 600px) {
  .account-container {
    padding: 1rem;
  }

  .account-nav {
    grid-template-columns: 1fr;
  }

  .account-nav-item {
    justify-content: flex-start;
    padding: 0.6rem 1rem;
  }

  .account-page-header:has(.profile-avatar-large) {
    flex-direction: column;
    text-align: center;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .games-preview {
    grid-template-columns: 1fr;
  }

  .round-words {
    grid-template-columns: 1fr;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .profile-actions {
    width: 100%;
  }

  .profile-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }

  .game-card-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .form-row {
    flex-direction: column;
  }

  .danger-action {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-danger {
    width: 100%;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .user-name {
    display: none;
  }
}

/* =============================================
   Email Preference Toggle
============================================= */
.email-preference {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  padding: 1rem 0;
}

.preference-info {
  flex: 1;
}

.preference-info h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.5rem 0;
}

.preference-info p {
  margin: 0 0 0.5rem 0;
  color: #666;
  font-size: 0.95rem;
}

.preference-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.btn-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  border: 2px solid var(--color-deep-ink);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-toggle.subscribed {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
}

.btn-toggle.subscribed:hover {
  background: linear-gradient(135deg, #219a52 0%, #27ae60 100%);
  transform: translateY(-1px);
}

.btn-toggle.unsubscribed {
  background: #f1f1f1;
  color: #666;
}

.btn-toggle.unsubscribed:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

.toggle-icon {
  font-size: 1.2rem;
}

.toggle-status {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
}

/* Simple toggle button - less colorful */
.btn-toggle-simple {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  min-width: 60px;
}

.btn-toggle-simple.on {
  background: #f0f7f0;
  color: #2d6a2d;
  border-color: #b8d4b8;
}

.btn-toggle-simple.on:hover {
  background: #e5f0e5;
  transform: translateY(-1px);
}

.btn-toggle-simple.off {
  background: #f8f8f8;
  color: #666;
  border-color: #ddd;
}

.btn-toggle-simple.off:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .email-preference {
    flex-direction: column;
    gap: 1rem;
  }

  .preference-toggle {
    align-self: flex-start;
  }
}

/* ============================================
   PLAN SECTION (Account Settings)
   ============================================ */

.plan-info {
  padding: 1rem 0;
}

.plan-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.plan-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-deep-ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-emoji {
  font-size: 1.3rem;
}

.plan-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plan-badge-free {
  background: #f1f1f1;
  color: #666;
}

.plan-badge-insight {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  color: #8a4500;
}

.plan-badge-expert {
  background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
  color: #4a5568;
}

.plan-badge-extreme {
  background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
  color: white;
}

.plan-description {
  color: #666;
  margin: 0 0 1rem 0;
  font-size: 0.95rem;
}

.plan-stats {
  padding: 0.75rem 1rem;
  background: rgba(136, 204, 241, 0.1);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.plan-stats p {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
}

.plan-stats p:last-child {
  margin-bottom: 0;
}

.games-remaining {
  color: var(--color-robot-blue);
  font-weight: 600;
}

.games-remaining-large {
  font-size: 1.3rem;
}

.games-exhausted {
  color: #dc3545;
  font-weight: 600;
}

.games-exhausted-large {
  font-size: 1.3rem;
}

.plan-features {
  margin-bottom: 1.5rem;
}

.plan-features h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--color-deep-ink);
  margin: 0 0 0.75rem 0;
}

.plan-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.plan-features li {
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.plan-features .feature-enabled {
  color: #27ae60;
}

.plan-features .feature-disabled {
  color: #aaa;
}

/* Dev plan selector (development only) */
.dev-plan-selector {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fff3cd;
  border: 2px dashed #ffc107;
  border-radius: 10px;
}

.dev-plan-selector h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #856404;
  margin: 0 0 0.75rem 0;
}

@media (max-width: 600px) {
  .plan-features ul {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   STATIC PAGE CONTENT (Prose Links)
   ============================================ */

.static-page-content a:not(.btn):not(.btn-primary):not(.btn-secondary):not(.email-cta) {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--color-bow-tie-coral);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  transition: color 0.2s;
}

.static-page-content a:not(.btn):not(.btn-primary):not(.btn-secondary):not(.email-cta):hover {
  color: var(--color-bow-tie-coral);
}

/* Email CTA links (large email addresses on contact/sponsor/bugs pages) */
.email-cta {
  display: inline-block;
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-bow-tie-coral) !important;
  text-decoration: none !important;
  transition: transform 0.15s, color 0.15s;
}

.email-cta:hover {
  color: var(--color-deep-ink) !important;
  transform: scale(1.02);
}

/* ============================================
   GAME ARENA OVERHAUL - Scoreboard
   ============================================ */

.arena-scoreboard {
  padding: 1.5rem;
  min-height: 180px;
}

.arena-players-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Player cards - stacked vertically (avatar on top) */
.arena-player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  text-align: center;
}

.arena-player-card.ai {
  text-align: center;
}

/* Bigger avatars */
.player-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--color-deep-ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.player-avatar.human {
  border-color: var(--color-bow-tie-coral);
}

.player-avatar.ai {
  border-color: var(--color-robot-blue);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.player-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-deep-ink);
}

.player-label {
  font-size: 0.75rem;
  color: #888;
}

.player-provider {
  font-size: 0.7rem;
  color: #aaa;
}

/* Score Display */
.arena-score-display {
  text-align: center;
  flex-shrink: 0;
  min-width: 160px;
  padding-top: 0.5rem;
}

.score-numbers {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.score-human {
  color: var(--color-bow-tie-coral);
}

.score-ai {
  color: var(--color-robot-blue);
}

.score-separator {
  color: var(--color-deep-ink);
  font-size: 2.5rem;
}

.game-status-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.game-status-badge.human {
  background: linear-gradient(135deg, var(--color-bow-tie-coral), #ff8a65);
  color: white;
}

.game-status-badge.ai {
  background: linear-gradient(135deg, var(--color-robot-blue), #6bb8e8);
  color: white;
}

.game-status-badge.draw {
  background: #888;
  color: white;
}

.game-status-badge.terminated_game {
  background: #666;
  color: white;
}

/* Round Progress Circles */
.arena-round-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.round-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  color: #ccc;
  transition: all 0.3s ease;
}

.round-circle.completed {
  color: #888;
}

.round-circle.completed.human-won {
  color: var(--color-bow-tie-coral);
}

.round-circle.completed.ai-won {
  color: var(--color-robot-blue);
}

.round-circle.completed.tie {
  color: #aaa;
}

.round-circle.current {
  color: var(--color-deep-ink);
  transform: scale(1.2);
}

.circle-icon {
  font-size: 1.2rem;
}

.circle-icon.current-dot {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   GAME ARENA OVERHAUL - Input Fields
   ============================================ */

.submitted-word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.word-display {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-deep-ink);
}

.word-status {
  font-size: 0.8rem;
  color: #888;
}

.ai-thinking,
.ai-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.ai-ready-text {
  font-size: 1.1rem;
  color: var(--color-deep-ink);
  font-weight: 600;
}

.ai-waiting-text {
  font-size: 0.9rem;
  color: #888;
}

/* Thinking Spinner Animation */
.thinking-spinner {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.spinner-dot {
  width: 10px;
  height: 10px;
  background-color: var(--color-robot-blue);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.spinner-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.spinner-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.spinner-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   GAME ARENA OVERHAUL - Judge Section
   ============================================ */

.judge-identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(136, 204, 241, 0.1), rgba(224, 195, 252, 0.1));
  border-radius: 12px;
}

.judge-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--color-lavender-mist);
}

.judge-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.judge-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-deep-ink);
}

.judge-role {
  font-size: 0.85rem;
  color: #666;
}

.judge-model {
  font-size: 0.75rem;
  color: #999;
}

.judge-phase {
  text-align: center;
  padding: 1.5rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.judge-phase.thinking .thinking-spinner {
  margin-bottom: 1rem;
}

.judge-phase .phase-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-deep-ink);
  margin-bottom: 0.25rem;
}

.judge-phase .phase-subtitle {
  font-size: 0.9rem;
  color: #888;
}

.judge-actions {
  margin-top: 1.5rem;
  text-align: center;
}

/* ============================================
   GAME ARENA OVERHAUL - Round Result
   ============================================ */

.round-result {
  padding: 1rem 0;
}

.result-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.result-round {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-deep-ink);
}

.result-winner {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.result-winner.human {
  background: var(--color-bow-tie-coral);
  color: white;
}

.result-winner.ai {
  background: var(--color-robot-blue);
  color: white;
}

.result-winner.tie {
  background: #888;
  color: white;
}

.result-words-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.result-word-box {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  text-align: center;
  min-width: 120px;
  border: 2px solid #ddd;
  background: white;
  transition: all 0.2s ease;
}

.result-word-box.human {
  border-color: var(--color-bow-tie-coral);
  background: var(--color-cream-puff);
}

.result-word-box.ai {
  border-color: var(--color-robot-blue);
  background: var(--color-lavender-mist);
}

.result-word-box.winner {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.result-word-box .word-owner {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.result-word-box .word-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-deep-ink);
}

.result-vs {
  font-weight: 700;
  color: #ccc;
  font-size: 1rem;
}

/* Reasoning Bubbles */
.result-reasoning-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.reasoning-bubble {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: #f8f9fa;
}

.reasoning-bubble.ai-reasoning {
  background: rgba(224, 195, 252, 0.15);
  border-left: 3px solid var(--color-lavender-mist);
}

.reasoning-bubble.judge-reasoning {
  background: rgba(136, 204, 241, 0.1);
  border-left: 3px solid var(--color-robot-blue);
}

.bubble-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-img-small {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bubble-content {
  flex: 1;
}

.bubble-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  margin-bottom: 0.25rem;
}

.bubble-text {
  margin: 0;
  font-size: 0.9rem;
  font-style: italic;
  color: #555;
  line-height: 1.5;
}

/* ============================================
   GAME ARENA OVERHAUL - History Section
   ============================================ */

.game-history {
  min-height: 0;
  transition: min-height 0.3s ease;
}

.game-history:empty {
  display: none;
}

.history-round-card {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #eee;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.history-round-card.human-won {
  border-color: rgba(255, 158, 125, 0.3);
}

.history-round-card.ai-won {
  border-color: rgba(136, 204, 241, 0.3);
}

.history-round-card.tie {
  border-color: #ddd;
}

/* Corner point badges */
.history-point-badge {
  position: absolute;
  top: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.history-point-badge.left {
  left: 0.75rem;
  background: var(--color-bow-tie-coral);
  color: white;
}

.history-point-badge.right {
  right: 0.75rem;
  background: var(--color-robot-blue);
  color: white;
}

/* Centered header */
.history-round-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
  padding-top: 0.25rem;
}

.history-round-card .round-number {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-deep-ink);
}

.round-score-label {
  font-size: 0.7rem;
  color: #999;
}

.round-score-value {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-deep-ink);
}

.history-words-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.history-word {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-align: center;
  min-width: 80px;
  background: #f8f9fa;
}

.history-word.human {
  background: rgba(255, 245, 225, 0.6);
  border: 1px solid var(--color-bow-tie-coral);
}

.history-word.ai {
  background: rgba(224, 195, 252, 0.3);
  border: 1px solid var(--color-robot-blue);
}

.history-word.winner {
  font-weight: 700;
}

.history-word .word-label {
  display: block;
  font-size: 0.65rem;
  color: #888;
  margin-bottom: 0.1rem;
}

.history-word .word-value {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-deep-ink);
}

.history-vs {
  color: #ccc;
  font-weight: 600;
  font-size: 0.8rem;
}

.history-reasoning {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #eee;
}

.history-reasoning-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #666;
}

.reasoning-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-img-tiny {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reasoning-text {
  flex: 1;
  font-style: italic;
  line-height: 1.4;
}

.reasoning-label {
  font-weight: 600;
  font-style: normal;
  color: #888;
}

/* ============================================
   GAME ARENA OVERHAUL - Responsive
   ============================================ */

/* ============================================
   COMPREHENSIVE RESPONSIVE STYLES
   ============================================ */

/* ----------------------------------------
   Desktop-only / Mobile-only utilities
   ---------------------------------------- */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: flex;
}

@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }
  
  .desktop-only {
    display: none !important;
  }
}

/* ----------------------------------------
   Mobile Header with Hamburger Menu
   ---------------------------------------- */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  position: relative;
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--color-deep-ink);
}

.mobile-menu-toggle .close-icon {
  display: none;
}

.mobile-menu-toggle.active .hamburger-icon {
  display: none;
}

.mobile-menu-toggle.active .close-icon {
  display: block;
}

/* Mobile auth links inside nav menu */
.mobile-auth-links {
  display: none;
}

/* Logout link styling for mobile */
.mobile-auth-links .logout-link {
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.mobile-auth-links .signup-link {
  background: var(--color-robot-blue);
  color: white !important;
  border-radius: 8px;
  padding: 0.75rem 1.5rem !important;
  margin-top: 0.5rem;
  text-align: center;
  display: inline-block;
}

.mobile-auth-links .signup-link:hover {
  color: white !important;
}

/* ----------------------------------------
   Tablet Breakpoint (768px)
   ---------------------------------------- */
@media (max-width: 768px) {
  /* Mobile menu toggle visible */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 2;
  }
  
  /* Header adjustments */
  .home-header {
    padding: 0.75rem 1rem;
    flex-wrap: nowrap;
    gap: 0.5rem;
    position: relative;
    z-index: 101; /* Above the mobile nav overlay (z-index: 100) */
  }
  
  .header-logo {
    width: auto;
    min-width: 0;
    order: 1;
  }
  
  .header-logo-img {
    height: 32px;
  }
  
  /* Navigation - slide-out menu on mobile */
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(244, 249, 252, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.15rem;
    padding: 4rem 3rem 2rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    flex: none;
    order: 0;
    border: none;
  }
  
  .nav-links.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .home-nav-link {
    font-size: 1.2rem;
    padding: 0.6rem 0;
    text-align: left;
    width: 100%;
  }
  
  .home-nav-link::after {
    display: none;
  }
  
  /* Mobile auth links in nav */
  .mobile-auth-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    padding-left: 1rem;
    border-top: 1px solid rgba(44, 62, 80, 0.1);
    width: 100%;
  }
  
  .mobile-auth-header {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-robot-blue);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
  }
  
  .mobile-auth-links .home-nav-link {
    padding: 1rem 0;
  }
  
  .mobile-auth-links .logout-link {
    color: #dc3545;
    font-family: var(--font-heading);
    padding: 0.6rem 0;
    text-align: left;
  }
  
  .header-actions {
    min-width: 0;
    gap: 0.5rem;
    order: 3;
    margin-left: auto;
  }
  
  .btn-new-game {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
  
  /* User dropdown - hidden on mobile (in hamburger menu instead) */
  .user-dropdown-trigger {
    padding: 0.3rem 0.5rem;
  }
  
  .user-name {
    display: none;
  }
  
  /* Auth links in header - hidden on mobile */
  .auth-links {
    gap: 0.5rem;
  }
  
  .header-auth-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }
  
  /* Hero Section */
  .hero-section {
    padding: 1.5rem 1rem;
  }
  
  .logo-large {
    width: 90%;
    max-width: 400px;
    margin-bottom: 1rem;
  }
  
  .hero-cta {
    font-size: 1.3rem;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
  }
  
  .btn.btn-primary {
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
  }
  
  /* Game Arena - Scoreboard */
  .arena-scoreboard {
    padding: 1rem;
    min-height: auto;
  }

  .arena-players-row {
    gap: 0.5rem;
  }
  
  .player-avatar {
    width: 56px;
    height: 56px;
  }
  
  .player-name {
    font-size: 0.9rem;
  }
  
  .player-label,
  .player-provider {
    font-size: 0.65rem;
  }
  
  .arena-score-display {
    min-width: 80px;
  }
  
  .score-numbers {
    font-size: 2.5rem;
  }
  
  .score-separator {
    font-size: 1.8rem;
  }
  
  .game-status-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }
  
  .arena-round-progress {
    flex-wrap: wrap;
    gap: 0.3rem;
  }
  
  /* Game Arena - Battle */
  .arena-battle {
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .battler {
    max-width: 100%;
    width: 100%;
  }
  
  .battler-name {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
  }
  
  .speech-bubble {
    min-height: 100px;
    padding: 1.25rem;
    font-size: 1.2rem;
    border-radius: 16px;
  }
  
  /* Critical: Input field sizing for mobile (prevent iOS zoom) */
  .speech-bubble input[type="text"] {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 0.75rem;
    width: 95%;
  }
  
  .speech-bubble button,
  .speech-bubble input[type="submit"] {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    min-height: 44px; /* Touch target size */
  }
  
  /* Judge Section */
  .judge-section {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .judge-identity {
    padding: 0.75rem;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .judge-avatar {
    width: 48px;
    height: 48px;
  }
  
  .judge-info {
    text-align: center;
  }
  
  .judge-name {
    font-size: 1rem;
  }
  
  .judge-role,
  .judge-model {
    font-size: 0.75rem;
  }
  
  .judge-phase {
    padding: 1rem;
    min-height: 60px;
  }
  
  .judge-phase .phase-title {
    font-size: 1.1rem;
  }
  
  .judge-phase .phase-subtitle {
    font-size: 0.85rem;
  }
  
  /* Round Result */
  .bubble-avatar {
    width: 36px;
    height: 36px;
  }
  
  .result-words-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .result-vs {
    display: none;
  }
  
  .result-word-box {
    min-width: 0;
    width: 100%;
    max-width: 200px;
    padding: 0.75rem 1rem;
  }
  
  .result-word-box .word-value {
    font-size: 1.1rem;
  }
  
  .reasoning-bubble {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .bubble-text {
    font-size: 0.85rem;
  }
  
  /* History Section */
  .game-history {
    padding: 1rem;
  }
  
  .history-title {
    font-size: 1.2rem;
  }
  
  .history-round-card {
    padding: 1rem;
  }
  
  .history-words-row {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .history-vs {
    display: none;
  }
  
  .history-word {
    width: 100%;
    max-width: 180px;
  }
  
  .history-reasoning-item {
    font-size: 0.75rem;
  }
  
  .reasoning-avatar {
    width: 28px;
    height: 28px;
  }
  
  /* Share Section */
  .share-section {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .share-header {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .share-title {
    font-size: 1.2rem;
  }
  
  .share-preview {
    padding: 0.75rem 1rem;
  }
  
  .share-message {
    font-size: 0.85rem;
  }
  
  /* Footer */
  .footer-section {
    padding: 2rem 0 1.5rem;
  }
  
  .footer-columns {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer-column:last-child {
    grid-column: span 2;
  }
  
  /* Account Container */
  .account-container {
    padding: 1rem;
  }

  .account-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .account-nav-item {
    padding: 0.5rem;
    font-size: 0.85rem;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .account-nav-icon {
    font-size: 1.2rem;
  }
  
  /* Account cards */
  .account-card {
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  .account-card h2 {
    font-size: 1.15rem;
  }
  
  /* Stats grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .stat-box {
    padding: 1rem;
  }
  
  .stat-value {
    font-size: 1.6rem;
  }
  
  /* Settings forms */
  .form-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .form-row .btn-primary,
  .form-row .btn-secondary {
    width: 100%;
  }
  
  .danger-action {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .btn-danger {
    width: 100%;
  }
  
  /* Profile header */
  .account-page-header:has(.profile-avatar-large) {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
  
  .profile-avatar-large {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
  }
  
  /* Static page content */
  .static-page-content {
    padding: 0 0.5rem;
  }
  
  .pricing-header {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
  }
  
  .pricing-title {
    font-size: 2rem;
  }
  
  .pricing-subtitle {
    font-size: 1rem;
  }
  
  /* Auth pages */
  .auth-page {
    padding: 1.5rem 1rem;
    min-height: calc(100vh - 160px);
  }
  
  .auth-card {
    padding: 1.5rem;
    border-radius: 16px;
  }
  
  .auth-card h1 {
    font-size: 1.6rem;
  }
  
  /* Modals */
  .signup-modal-content,
  .limit-reached-modal-content {
    padding: 1.5rem;
    border-radius: 16px;
    max-height: calc(100vh - 1rem);
    max-width: calc(100vw - 1rem);
  }
  
  .signup-modal-header h2 {
    font-size: 1.5rem;
  }
  
  .signup-modal-benefits {
    padding: 0.75rem 1rem;
  }
  
  .signup-modal-benefits li {
    font-size: 0.85rem;
  }
  
  .signup-form-group input,
  .auth-form-group input {
    font-size: 16px; /* Prevent iOS zoom */
    padding: 0.75rem 1rem;
  }
  
  .signup-modal-btn {
    padding: 0.9rem;
    font-size: 1rem;
    min-height: 48px;
  }
  
  .google-signin-btn {
    padding: 0.75rem 1rem;
    min-height: 48px;
  }
  
  /* Email preference on settings */
  .email-preference {
    flex-direction: column;
    gap: 1rem;
  }
  
  .preference-toggle {
    align-self: stretch;
    align-items: stretch;
  }
  
  .btn-toggle-simple {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
}

/* ----------------------------------------
   Mobile Breakpoint (480px)
   ---------------------------------------- */
@media (max-width: 480px) {
  /* Header - more compact */
  .home-header {
    padding: 0.5rem 0.75rem;
  }
  
  .nav-links {
    gap: 0.5rem;
    padding: 0.4rem 0;
  }
  
  .home-nav-link {
    font-size: 0.9rem;
    padding: 0.35rem 0.5rem;
  }
  
  .btn-new-game {
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
  }
  
  /* Hero */
  .hero-section {
    padding: 1rem 0.75rem;
  }
  
  .logo-large {
    width: 95%;
    max-width: 280px;
  }
  
  /* Even smaller avatars on very small screens */
  .hero-avatar-float {
    transform: scale(0.45);
    opacity: 0.2;
  }
  
  .hero-avatar-float:hover,
  .hero-avatar-float:focus {
    opacity: 0.85;
    transform: scale(0.6);
  }
  
  .hero-cta {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
  }
  
  .btn.btn-primary {
    padding: 0.75rem 1.25rem;
    font-size: 1.1rem;
    width: 100%;
    max-width: 280px;
  }
  
  /* Game Layout */
  .game-layout {
    padding: 0.5rem;
  }
  
  /* Scoreboard - more compact */
  .arena-scoreboard {
    padding: 0.75rem;
  }
  
  .arena-players-row {
    gap: 0.3rem;
  }
  
  .player-avatar {
    width: 44px;
    height: 44px;
    border-width: 2px;
  }
  
  .player-info {
    gap: 0;
  }
  
  .player-name {
    font-size: 0.8rem;
  }
  
  .player-label {
    font-size: 0.6rem;
  }
  
  .player-provider {
    display: none;
  }
  
  .arena-score-display {
    min-width: 70px;
  }
  
  .score-numbers {
    font-size: 2rem;
    gap: 0.25rem;
  }
  
  .score-separator {
    font-size: 1.5rem;
  }
  
  .game-status-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    margin-top: 0.3rem;
  }
  
  .arena-round-progress {
    margin-top: 0.5rem;
  }
  
  .round-circle {
    width: 22px;
    height: 22px;
    font-size: 0.8rem;
  }
  
  /* Battle - Full width speech bubbles */
  .arena-battle {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .battler-name {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
  }
  
  .speech-bubble {
    min-height: 80px;
    padding: 1rem;
    font-size: 1rem;
    border-radius: 14px;
    box-shadow: 2px 2px 0px rgba(44, 62, 80, 0.1);
  }
  
  .speech-bubble input[type="text"] {
    font-size: 16px;
    padding: 0.7rem;
    border-radius: 6px;
  }
  
  .speech-bubble button,
  .speech-bubble input[type="submit"] {
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
    border-radius: 6px;
  }
  
  .word-input-message {
    font-size: 0.8rem;
  }
  
  .submitted-word .word-display {
    font-size: 1.2rem;
  }
  
  .submitted-word .word-status {
    font-size: 0.75rem;
  }
  
  .ai-ready-text {
    font-size: 1rem;
  }
  
  .ai-waiting-text {
    font-size: 0.8rem;
  }
  
  .thinking-spinner {
    gap: 0.25rem;
  }
  
  .spinner-dot {
    width: 8px;
    height: 8px;
  }
  
  /* Judge Section - very compact */
  .judge-section {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
  }
  
  .judge-identity {
    padding: 0.6rem;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
  }
  
  .judge-avatar {
    width: 40px;
    height: 40px;
    border-width: 2px;
  }
  
  .judge-name {
    font-size: 0.9rem;
  }
  
  .judge-role {
    font-size: 0.7rem;
  }
  
  .judge-model {
    font-size: 0.65rem;
  }
  
  .judge-phase {
    padding: 0.75rem;
    min-height: 50px;
  }
  
  .judge-phase .phase-title {
    font-size: 1rem;
  }
  
  .judge-phase .phase-subtitle {
    font-size: 0.8rem;
  }
  
  .judge-actions .btn.btn-primary {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  /* Round Result - compact layout */
  .round-result {
    padding: 0.75rem 0;
  }
  
  .result-header {
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .result-round {
    font-size: 0.95rem;
  }
  
  .result-winner {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
  }
  
  .result-words-row {
    gap: 0.4rem;
    margin-bottom: 1rem;
  }
  
  .result-word-box {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
  }
  
  .result-word-box .word-owner {
    font-size: 0.7rem;
  }
  
  .result-word-box .word-value {
    font-size: 1rem;
  }
  
  .result-word-box.winner {
    transform: scale(1.02);
  }
  
  /* Reasoning bubbles */
  .result-reasoning-section {
    gap: 0.75rem;
  }
  
  .reasoning-bubble {
    padding: 0.6rem;
    gap: 0.4rem;
    border-radius: 10px;
  }
  
  .bubble-avatar {
    width: 32px;
    height: 32px;
  }
  
  .bubble-label {
    font-size: 0.7rem;
  }
  
  .bubble-text {
    font-size: 0.8rem;
    line-height: 1.4;
  }
  
  /* History - compact cards */
  .game-history {
    padding: 0.75rem;
    border-radius: 10px;
  }
  
  .history-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .history-round-card {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 10px;
  }
  
  .history-point-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }
  
  .history-round-header {
    margin-bottom: 0.5rem;
  }
  
  .history-round-card .round-number {
    font-size: 0.9rem;
  }
  
  .round-score-value {
    font-size: 1rem;
  }
  
  .history-words-row {
    margin-bottom: 0.5rem;
  }
  
  .history-word {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
  }
  
  .history-word .word-label {
    font-size: 0.6rem;
  }
  
  .history-word .word-value {
    font-size: 0.9rem;
  }
  
  .history-reasoning {
    padding-top: 0.4rem;
  }
  
  .history-reasoning-item {
    font-size: 0.7rem;
  }
  
  .reasoning-avatar {
    width: 24px;
    height: 24px;
  }
  
  /* Share Section - compact */
  .share-section {
    padding: 0.75rem;
    margin: 0.75rem 0;
    border-radius: 10px;
  }
  
  .share-title {
    font-size: 1rem;
  }
  
  .share-subtitle {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }
  
  .share-preview {
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
  }
  
  .share-message {
    font-size: 0.8rem;
  }
  
  .share-buttons {
    gap: 0.4rem;
  }
  
  .share-btn {
    padding: 0.5rem;
    min-width: auto;
    flex: 1;
    justify-content: center;
  }
  
  .share-btn span {
    display: none;
  }
  
  .share-icon-svg {
    width: 20px;
    height: 20px;
  }
  
  /* Footer - single column */
  .footer-section {
    padding: 1.5rem 0 1rem;
  }
  
  .footer-container {
    padding: 0 1rem;
  }
  
  .footer-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .footer-column:last-child {
    grid-column: span 1;
  }
  
  .footer-column-title {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }
  
  .footer-column-links li a {
    font-size: 0.9rem;
  }
  
  .footer-copyright p {
    font-size: 0.8rem;
  }
  
  /* Account pages - compact */
  .account-container {
    padding: 0.75rem;
  }
  
  .account-nav {
    gap: 0.2rem;
    padding: 0.2rem;
    margin-bottom: 1.5rem;
  }
  
  .account-nav-item {
    padding: 0.4rem 0.25rem;
    font-size: 0.75rem;
    gap: 0.15rem;
  }
  
  .account-nav-item span:not(.account-nav-icon) {
    display: none;
  }
  
  .account-nav-icon {
    font-size: 1.4rem;
  }
  
  .account-page-header h1 {
    font-size: 1.5rem;
  }
  
  .account-page-header p {
    font-size: 0.9rem;
  }
  
  .account-page-header:has(.profile-avatar-large) {
    padding: 1.25rem;
    gap: 1rem;
  }
  
  .profile-avatar-large {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  
  .account-card {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .account-card h2 {
    font-size: 1.1rem;
  }
  
  .card-description {
    font-size: 0.85rem;
  }
  
  /* Stats grid - 2 columns */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .stat-box {
    padding: 0.75rem 0.5rem;
  }
  
  .stat-value {
    font-size: 1.4rem;
  }
  
  .stat-label {
    font-size: 0.75rem;
  }
  
  /* Settings - compact forms */
  .settings-section {
    padding: 1rem;
  }
  
  .form-input {
    font-size: 16px;
    padding: 0.65rem 0.75rem;
  }
  
  .form-hint {
    font-size: 0.8rem;
  }
  
  .danger-info h3 {
    font-size: 0.95rem;
  }
  
  .danger-info p {
    font-size: 0.85rem;
  }
  
  /* History game cards */
  .history-games-list {
    gap: 0.4rem;
  }
  
  .history-game-card {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    border-radius: 10px;
  }
  
  .history-game-result .result-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }
  
  .history-game-score {
    font-size: 0.95rem;
    gap: 0.3rem;
  }
  
  .history-game-opponent {
    font-size: 0.85rem;
  }
  
  .history-game-date {
    font-size: 0.75rem;
  }
  
  /* Static pages */
  .pricing-header {
    padding: 1rem 0;
    margin-bottom: 1.5rem;
  }
  
  .pricing-title {
    font-size: 1.6rem;
  }
  
  .pricing-subtitle {
    font-size: 0.9rem;
    padding: 0 1rem;
  }
  
  .static-page-content h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .static-page-content h3 {
    font-size: 1.05rem;
  }
  
  .static-page-content p,
  .static-page-content li {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  /* Auth pages */
  .auth-page {
    padding: 1rem 0.75rem;
  }
  
  .auth-card {
    padding: 1.25rem;
    border-radius: 14px;
  }
  
  .auth-card h1 {
    font-size: 1.4rem;
  }
  
  .auth-subtitle {
    font-size: 0.9rem;
  }
  
  .auth-icon {
    font-size: 2.5rem;
  }
  
  .auth-benefits {
    padding: 0.75rem 1rem;
  }
  
  .auth-benefits li {
    font-size: 0.85rem;
  }
  
  .auth-form-group input {
    padding: 0.7rem 0.85rem;
  }
  
  /* Modals - nearly full screen */
  .signup-modal {
    padding: 0.5rem;
  }
  
  .signup-modal-content,
  .limit-reached-modal-content {
    padding: 1.25rem;
    border-radius: 14px;
    max-height: calc(100vh - 1rem);
    width: 100%;
    max-width: 100%;
  }
  
  .signup-modal-close {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    font-size: 1.3rem;
  }
  
  .signup-modal-header {
    margin-bottom: 1rem;
  }
  
  .signup-modal-icon {
    font-size: 2.5rem;
  }
  
  .signup-modal-header h2 {
    font-size: 1.3rem;
  }
  
  .signup-modal-subtitle {
    font-size: 0.9rem;
  }
  
  .signup-modal-benefits {
    padding: 0.75rem;
    margin-bottom: 1rem;
  }
  
  .signup-modal-benefits h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  .signup-modal-benefits li {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
  }
  
  .signup-modal-note {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
  }
  
  .signup-username-section h4,
  .signup-auth-section h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  .signup-form-group {
    margin-bottom: 0.75rem;
  }
  
  .signup-form-group label {
    font-size: 0.85rem;
  }
  
  .signup-form-group input {
    padding: 0.7rem 0.85rem;
  }
  
  .form-hint {
    font-size: 0.75rem;
    margin-top: 0.3rem;
  }
  
  .username-status,
  .email-status {
    font-size: 0.7rem;
    right: 8px;
  }
  
  .username-input-wrapper input,
  .email-input-wrapper input {
    padding-right: 80px;
  }
  
  .signup-modal-btn {
    padding: 0.8rem;
    font-size: 0.95rem;
  }
  
  .google-signin-btn {
    padding: 0.7rem;
    font-size: 0.95rem;
    gap: 8px;
  }
  
  .google-signin-btn .google-icon {
    width: 18px;
    height: 18px;
  }
  
  .auth-divider span {
    font-size: 0.8rem;
    padding: 0 0.75rem;
  }
  
  .signup-modal-footer-text {
    font-size: 0.8rem;
  }
  
  /* Code input */
  .signup-form-group input.code-input,
  .auth-form-group .code-input,
  .form-input.code-input {
    font-size: 1.4rem;
    letter-spacing: 0.4rem;
    padding: 0.6rem 0.5rem;
  }
  
  /* Limit reached modal */
  .limit-reached-message {
    padding: 0.75rem;
  }
  
  .limit-reached-message p {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  
  /* Cloudflare Turnstile - scale to fit */
  .cf-turnstile {
    transform: scale(0.9);
    transform-origin: center;
    margin: 0.75rem 0;
  }
  
  /* Flash messages */
  .flash {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    max-width: calc(100% - 1rem);
    border-radius: 8px;
    top: 10px;
  }
  
  /* Empty states */
  .empty-state-compact {
    padding: 1.5rem 0.75rem;
  }
  
  .empty-state-compact .empty-icon {
    font-size: 2rem;
  }
  
  .empty-state-compact h3 {
    font-size: 1.1rem;
  }
  
  .empty-state-compact p {
    font-size: 0.9rem;
  }
  
  /* Game details page */
  .game-details-header {
    padding: 1.25rem;
    border-radius: 14px;
  }
  
  .result-badge-large {
    padding: 0.4rem 1.25rem;
    font-size: 1rem;
  }
  
  .game-score-large {
    font-size: 2.2rem;
  }
  
  .game-score-large .score-separator {
    margin: 0 0.3rem;
  }
  
  .game-details-meta {
    font-size: 0.85rem;
  }
  
  .meta-divider {
    margin: 0 0.5rem;
  }
  
  /* Round cards in game details */
  .round-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }
  
  .round-header {
    margin-bottom: 0.75rem;
  }
  
  .round-number {
    font-size: 0.95rem;
  }
  
  .round-winner {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }
  
  .round-words {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
  
  .round-words-two {
    flex-direction: column;
    gap: 0.4rem;
  }
  
  .round-words-two .word-column {
    max-width: 100%;
    width: 100%;
  }
  
  .vs-divider {
    display: none;
  }
  
  .word-column {
    padding: 0.6rem;
  }
  
  .word-label {
    font-size: 0.7rem;
  }
  
  .word-value {
    font-size: 0.95rem;
  }
  
  .word-winner-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.5rem;
    top: -10px;
  }
  
  .round-reasoning {
    padding: 0.6rem 0.75rem;
  }
  
  .round-reasoning .reasoning-label {
    font-size: 0.7rem;
  }
  
  .round-reasoning p {
    font-size: 0.8rem;
  }
  
  /* Breadcrumb */
  .breadcrumb {
    margin-bottom: 1rem;
  }
  
  .breadcrumb-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }
}

/* ----------------------------------------
   Mobile Keyboard Accommodations
   ---------------------------------------- */
@media (max-width: 768px) {
  /* When keyboard is likely visible, ensure input is accessible */
  .speech-bubble:focus-within {
    margin-bottom: env(safe-area-inset-bottom, 0);
  }
  
  /* Ensure modal content is scrollable when keyboard is open */
  .signup-modal-content,
  .limit-reached-modal-content {
    max-height: calc(100vh - env(safe-area-inset-bottom, 0) - 1rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Add bottom padding for iPhone notch/home indicator */
  .footer-section {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
  }
  
  body {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

/* ----------------------------------------
   Touch Target Sizes (Accessibility)
   ---------------------------------------- */
@media (max-width: 768px) {
  /* Ensure all interactive elements meet 44px minimum */
  button,
  input[type="submit"],
  .btn,
  .btn-primary,
  .btn-secondary,
  .btn-new-game,
  .home-nav-link,
  .dropdown-item,
  .account-nav-item,
  .share-btn {
    min-height: 44px;
  }
  
  /* Make dropdown items taller for easier tapping */
  .dropdown-item {
    padding: 0.85rem 1rem;
  }
  
  .user-dropdown-menu {
    min-width: 160px;
  }
}

/* ----------------------------------------
   Landscape Phone Adjustments
   ---------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  /* Reduce vertical spacing when in landscape on phone */
  .hero-section {
    padding: 0.5rem 1rem;
  }
  
  .logo-large {
    max-width: 200px;
    margin-bottom: 0.5rem;
  }
  
  .hero-cta {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
  }
  
  .btn.btn-primary {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
  }
  
  /* Compact scoreboard in landscape */
  .arena-scoreboard {
    padding: 0.5rem;
  }
  
  .arena-players-row {
    margin-bottom: 0.5rem;
  }
  
  .player-avatar {
    width: 36px;
    height: 36px;
  }
  
  .score-numbers {
    font-size: 1.8rem;
  }
  
  .arena-round-progress {
    margin-top: 0.25rem;
  }
  
  /* Compact battle area */
  .arena-battle {
    flex-direction: row;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
  
  .battler {
    max-width: 48%;
  }
  
  .speech-bubble {
    min-height: 60px;
    padding: 0.5rem;
  }
  
  .judge-section {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  .judge-identity {
    padding: 0.4rem;
    margin-bottom: 0.5rem;
  }
  
  .judge-avatar {
    width: 32px;
    height: 32px;
  }
  
  /* Hide footer in landscape during gameplay */
  .game-layout ~ .footer-section {
    display: none;
  }
}

/* ----------------------------------------
   Static Page Content Responsive
   ---------------------------------------- */
@media (max-width: 768px) {
  /* Container with inline styles */
  .container[style*="padding: 2rem"] {
    padding: 1rem 0.75rem !important;
  }
  
  /* Static page content areas */
  .static-page-content[style*="padding: 2rem"] {
    padding: 1.25rem !important;
  }
  
  .static-page-content[style*="max-width: 1000px"],
  .static-page-content[style*="max-width: 800px"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Model/opponent/judge cards grid - ensure single column on small screens */
  .static-page-content [style*="grid-template-columns: repeat(auto-fill, minmax(200px"] {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 1rem !important;
  }
  
  /* Info boxes grid */
  .static-page-content [style*="grid-template-columns: repeat(auto-fit, minmax(200px"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  /* Section headers with icons */
  .static-page-content [style*="display: flex"][style*="align-items: center"][style*="gap: 1rem"] {
    flex-wrap: wrap;
  }
  
  /* Large centered counter boxes */
  .static-page-content [style*="font-size: 5rem"] {
    font-size: 3rem !important;
  }
  
  /* Email CTA */
  .email-cta {
    font-size: 1.2rem;
    word-break: break-all;
  }
}

@media (max-width: 480px) {
  .static-page-content [style*="grid-template-columns: repeat(auto-fill, minmax"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  /* Model cards - smaller avatars */
  .static-page-content [style*="width: 80px"][style*="height: 80px"][style*="border-radius: 50%"] {
    width: 60px !important;
    height: 60px !important;
  }
  
  /* Section icon circles */
  .static-page-content [style*="width: 60px"][style*="height: 60px"][style*="border-radius: 50%"] {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.4rem !important;
  }
  
  /* Inline padding boxes */
  .static-page-content [style*="padding: 2rem"] {
    padding: 1.25rem !important;
  }
  
  .static-page-content [style*="padding: 1.5rem"] {
    padding: 1rem !important;
  }
  
  /* Large text in counter */
  .static-page-content [style*="font-size: 5rem"] {
    font-size: 2.5rem !important;
  }
  
  .static-page-content [style*="font-size: 1.3rem"] {
    font-size: 1.1rem !important;
  }
  
  /* Email CTA even smaller */
  .email-cta {
    font-size: 1rem;
  }
}

/* ----------------------------------------
   Game Details Page Responsive
   ---------------------------------------- */
@media (max-width: 480px) {
  .game-details-header {
    padding: 1rem;
  }
  
  .result-badge-large {
    font-size: 0.9rem;
    padding: 0.35rem 1rem;
  }
  
  .game-score-large {
    font-size: 2rem;
  }
  
  .game-details-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .meta-divider {
    display: none;
  }
}

/* ----------------------------------------
   Magic Link Verify Page Responsive
   ---------------------------------------- */
@media (max-width: 480px) {
  .magic-link-section {
    padding: 0.75rem;
  }
  
  .magic-link-text {
    font-size: 0.9rem;
  }
  
  .magic-link-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* ----------------------------------------
   Unsubscribe Page Responsive
   ---------------------------------------- */
@media (max-width: 480px) {
  .auth-container {
    margin: 1.5rem auto;
    padding: 1.25rem;
  }
  
  .auth-container h2 {
    font-size: 1.5rem;
  }
}

/* ----------------------------------------
   AI Model Roster Cards
   ---------------------------------------- */
.model-roster-card:not(.model-roster-card--locked):hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1) !important;
}

/* ----------------------------------------
   Print Styles (for game history)
   ---------------------------------------- */
@media print {
  .home-header,
  .footer-section,
  .account-nav,
  .btn,
  .btn-primary,
  .btn-secondary,
  .signup-modal,
  .limit-reached-modal,
  .user-dropdown,
  .mobile-menu-toggle {
    display: none !important;
  }
  
  body {
    background: white;
    background-image: none;
  }
  
  .account-container {
    max-width: 100%;
  }
  
  .account-card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Shared presentation for the scoring judge and Jev second opinion. */
.judgment-card {
  --judgment-accent: #775396;
  --judgment-muted: #685772;
  margin-top: 1.2rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid #dfd1ec;
  border-radius: 14px;
  background: #f7f1fc;
  color: var(--color-deep-ink);
  text-align: left;
}
.judgment-card__header,
.judgment-card__identity,
.judgment-card__confidence {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}
.judgment-card__header { flex-wrap: wrap; }
.judgment-card__identity { justify-content: flex-start; }
.judgment-card__avatar {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 12px;
  background: #fff;
  color: var(--judgment-accent);
  font: 600 1.6rem var(--font-heading);
}
.judgment-card__avatar span { color: #9a78b5; }
.judgment-card__name { display: block; font: 500 1.05rem var(--font-heading); }
.judgment-card__provider { display: block; font-size: 0.75rem; color: var(--judgment-muted); }
.judgment-card__badge {
  border: 1px solid #d4bfE3;
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  color: #65497c;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.judgment-card__result { margin-top: 1rem; }
.judgment-card__vote { margin: 0 0 0.4rem; font: 500 1.3rem var(--font-heading); overflow-wrap: anywhere; }
.judgment-card__comparison { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 1rem; font-size: 0.8rem; color: #5f536b; }
.judgment-card__owner { padding: 0.15rem 0.45rem; border-radius: 5px; }
.judgment-card__owner.is-human { background: #ffe4d8; color: #86412d; }
.judgment-card__owner.is-ai { background: #dceffa; color: #285b7a; }
.judgment-card__confidence { font-size: 0.8rem; }
.judgment-card__confidence strong { font-variant-numeric: tabular-nums; }
.judgment-card__meter { display: block; width: 100%; height: 8px; margin-top: 0.4rem; border: 0; border-radius: 8px; background: #e7dbee; }
.judgment-card__meter::-webkit-meter-bar { height: 8px; border: 0; border-radius: 8px; background: #e7dbee; }
.judgment-card__meter::-webkit-meter-optimum-value { border-radius: 8px; background: var(--judgment-accent); }
.judgment-card__meter::-moz-meter-bar { border-radius: 8px; background: var(--judgment-accent); }
.judgment-card__details { margin-top: 0.75rem; font-size: 0.78rem; color: #604e6e; }
.judgment-card__details summary { cursor: pointer; padding: 0.3rem 0; width: fit-content; }
.judgment-card__details p { margin: 0.5rem 0 0; padding: 0.7rem; border-radius: 8px; background: #fff; line-height: 1.6; }
.judgment-card__footnote { margin: 0.9rem 0 0; color: var(--judgment-muted); font-size: 0.72rem; }
.judgment-card__status { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.9rem; color: var(--judgment-muted); }
.judgment-card__pending-dot { display: inline-block; flex: 0 0 7px; height: 7px; border-radius: 50%; background: var(--judgment-accent); animation: jev-pulse 1.8s ease-in-out infinite; }
.judgment-card--compact { margin-top: 0.9rem; padding: 0.85rem 1rem; }
.judgment-card--compact .judgment-card__avatar { height: 30px; flex-basis: 30px; font-size: 1.3rem; }
.judgment-card--compact .judgment-card__vote { font-size: 1.1rem; }
.judgment-card--compact .judgment-card__result { margin-top: 0.65rem; }
@keyframes jev-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .judgment-card__pending-dot { animation: none; } }
@media (max-width: 480px) { .judgment-card { padding: 0.9rem; } }
@media (pointer: coarse) { .judgment-card__details summary { min-height: 44px; display: flex; align-items: center; } }

.primary-judgment {
  --judgment-accent: #336681;
  --judgment-muted: #4c6575;
  background: #f0f7fb;
  border-color: #c9dfe9;
}
.primary-judgment .judgment-card__badge { color: #336681; border-color: #bdd5e3; }
.primary-judgment .judgment-card__avatar { object-fit: cover; width: 38px; }
.judgment-card__identity { min-width: 0; }
.judgment-card__identity > div { min-width: 0; overflow-wrap: anywhere; }
.judgment-card__reasoning { font-size: 0.85rem; line-height: 1.6; }
.judgment-card__reasoning-label { font-size: 0.75rem; font-weight: 600; color: var(--judgment-muted); }
.judgment-card__reasoning p { margin: 0.35rem 0 0; overflow-wrap: anywhere; }
.primary-judgment .judgment-card__footnote { font-weight: 600; }
.judge-section > .judgment-card { margin-top: 0; }
.round-judgments { display: grid; gap: 1rem; margin-top: 1.2rem; }
.round-judgments > .judgment-card { min-width: 0; margin-top: 0; }

/* Keep replay with the result and social sharing, above the round details. */
.share-header { justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.play-again-button { min-height: 44px; }
@media (min-width: 769px) {
  .round-judgments { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 480px) {
  .share-header { flex-direction: column-reverse; }
  .play-again-button { width: 100%; }
}
