/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Space+Mono:wght@400;700&display=swap');

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --background: hsl(220, 20%, 4%);
  --foreground: hsl(0, 0%, 98%);
  
  --card: hsl(220, 20%, 7%);
  --card-foreground: hsl(0, 0%, 98%);
  
  --popover: hsl(220, 20%, 7%);
  --popover-foreground: hsl(0, 0%, 98%);
  
  --primary: hsl(165, 100%, 50%);
  --primary-foreground: hsl(220, 20%, 4%);
  
  --secondary: hsl(340, 100%, 60%);
  --secondary-foreground: hsl(0, 0%, 98%);
  
  --muted: hsl(220, 15%, 12%);
  --muted-foreground: hsl(220, 10%, 55%);
  
  --accent: hsl(260, 100%, 65%);
  --accent-foreground: hsl(0, 0%, 98%);
  
  --destructive: hsl(0, 84%, 60%);
  --destructive-foreground: hsl(0, 0%, 98%);
  
  --border: hsl(220, 15%, 15%);
  --input: hsl(220, 15%, 15%);
  --ring: hsl(165, 100%, 50%);

  --radius: 1rem;

  /* Game colors */
  --game-x: hsl(165, 100%, 50%);
  --game-o: hsl(340, 100%, 60%);
  --game-grid: hsl(220, 15%, 25%);
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Evita scroll apenas no lobby (/jogar) - apenas desktop */
body.page-jogar {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Permite scroll no mobile */
@media (max-width: 768px) {
  body.page-jogar {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Evita scroll na tela do tabuleiro (layout 100% viewport) */
body.page-tabuleiro {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

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

.container-narrow {
  max-width: 900px;
}

.font-mono {
  font-family: 'Space Mono', monospace;
}

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

.glass {
  background: rgba(17, 19, 23, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-strong {
  background: rgba(17, 19, 23, 0.8);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glow-primary {
  box-shadow: 0 0 20px hsla(165, 100%, 50%, 0.4), 0 0 60px hsla(165, 100%, 50%, 0.2), 0 0 100px hsla(165, 100%, 50%, 0.1);
}

.glow-secondary {
  box-shadow: 0 0 20px hsla(340, 100%, 60%, 0.4), 0 0 60px hsla(340, 100%, 60%, 0.2);
}

/* ============================================
   Animated Background
   ============================================ */
.animated-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.animated-background .base-gradient {
  position: absolute;
  inset: 0;
  background: var(--background);
}

.animated-background .grid-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.02;
  background-image: 
    linear-gradient(var(--foreground) 1px, transparent 1px),
    linear-gradient(90deg, var(--foreground) 1px, transparent 1px);
  background-size: 100px 100px;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
}

.glow-orb.primary {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, hsla(165, 100%, 50%, 0.15) 0%, transparent 70%);
  top: 10%;
  left: 60%;
  animation: orbFloat1 20s ease-in-out infinite;
}

.glow-orb.secondary {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, hsla(340, 100%, 60%, 0.1) 0%, transparent 70%);
  bottom: 20%;
  left: 10%;
  filter: blur(80px);
  animation: orbFloat2 25s ease-in-out infinite;
}

.glow-orb.accent {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, hsla(260, 100%, 65%, 0.08) 0%, transparent 70%);
  top: 50%;
  right: 20%;
  filter: blur(100px);
  animation: orbFloat3 30s ease-in-out infinite;
}

.floating-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: hsla(165, 100%, 50%, 0.3);
  animation: particleFloat 15s ease-in-out infinite;
}

/* ============================================
   Animations
   ============================================ */
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30%, 30%); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30%, -30%); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40%, -40%); }
}

@keyframes particleFloat {
  0%, 100% { 
    transform: translateY(0); 
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translateY(-200px); 
    opacity: 0;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.1);
  }
}

@keyframes drawLine {
  from { stroke-dashoffset: 300; }
  to { stroke-dashoffset: 0; }
}

@keyframes drawCircle {
  from { stroke-dashoffset: 188; }
  to { stroke-dashoffset: 0; }
}

@keyframes bounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

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

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

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

.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  background: var(--muted);
  color: var(--foreground);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--muted);
  border-color: hsla(165, 100%, 50%, 0.5);
}

/* Botões de ação dos modais - Verde para continuar, Vermelho para cancelar */
.btn-success {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
  font-weight: 600;
  box-shadow: 0 0 20px hsla(165, 100%, 50%, 0.3);
  transition: all 0.2s ease;
}

.btn-success:hover {
  background: hsla(165, 100%, 55%, 1);
  box-shadow: 0 0 30px hsla(165, 100%, 50%, 0.5);
  transform: translateY(-1px);
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--destructive);
  color: var(--destructive);
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: var(--destructive);
  color: var(--destructive-foreground);
  box-shadow: 0 0 20px hsla(0, 84%, 60%, 0.3);
  transform: translateY(-1px);
}

/* Aplica estilos aos botões dos modais */
.match-modal-actions .btn-success,
.game-modal-actions .btn-success {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 1px solid var(--primary);
  font-weight: 600;
  box-shadow: 0 0 20px hsla(165, 100%, 50%, 0.3);
}

.match-modal-actions .btn-success:hover,
.game-modal-actions .btn-success:hover {
  background: hsla(165, 100%, 55%, 1);
  box-shadow: 0 0 30px hsla(165, 100%, 50%, 0.5);
  transform: translateY(-1px);
}

.match-modal-actions .btn-danger,
.game-modal-actions .btn-danger {
  background: transparent;
  border: 1px solid var(--destructive);
  color: var(--destructive);
  font-weight: 600;
}

.match-modal-actions .btn-danger:hover,
.game-modal-actions .btn-danger:hover {
  background: var(--destructive);
  color: var(--destructive-foreground);
  box-shadow: 0 0 20px hsla(0, 84%, 60%, 0.3);
  transform: translateY(-1px);
}

.btn-neon {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  box-shadow: 0 0 20px hsla(165, 100%, 50%, 0.3);
}

.btn-neon:hover {
  box-shadow: 0 0 30px hsla(165, 100%, 50%, 0.5), 0 0 60px hsla(165, 100%, 50%, 0.2);
  transform: scale(1.05);
}

.btn-neon:active {
  transform: scale(0.95);
}

.btn-hero {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: var(--primary-foreground);
  font-weight: 700;
  box-shadow: 0 0 30px hsla(165, 100%, 50%, 0.4);
}

.btn-hero:hover {
  box-shadow: 0 0 50px hsla(165, 100%, 50%, 0.6);
  transform: scale(1.05);
}

.btn-hero:active {
  transform: scale(0.95);
}

.btn-sm {
  height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
}

.btn-lg {
  height: 3rem;
  padding: 0 2rem;
  font-size: 1rem;
  border-radius: 0.875rem;
}

.btn-xl {
  height: 3.5rem;
  padding: 0 2.5rem;
  font-size: 1.125rem;
  border-radius: 0.875rem;
}

.btn .arrow-icon {
  animation: bounce 1.5s infinite;
}

/* ============================================
   Navbar
   ============================================ */
.navbar {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 95%;
  max-width: 1024px;
  animation: navSlideDown 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.navbar-inner {
  padding: 1rem 1.5rem;
  border-radius: 1rem;
}

.navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s ease;
}

.navbar-logo:hover {
  transform: scale(1.02);
}

.navbar-logo-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: hsla(165, 100%, 50%, 0.1);
  border: 1px solid hsla(165, 100%, 50%, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.navbar-logo-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: hsla(165, 100%, 50%, 0.2);
  transform: scale(0);
  transition: transform 0.3s ease;
  border-radius: inherit;
}

.navbar-logo:hover .navbar-logo-icon::before {
  transform: scale(1);
}

.navbar-logo-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  position: relative;
  z-index: 1;
}

.navbar-logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.navbar-logo-text span {
  color: var(--primary);
}

/* Desktop Nav */
.navbar-nav {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (min-width: 1024px) {
  .navbar-nav {
    display: flex;
  }
}

.navbar-nav a {
  position: relative;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: color 0.3s ease;
  white-space: nowrap;
}

.navbar-nav a:hover {
  color: var(--foreground);
}

.navbar-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.navbar-nav a:hover::after {
  width: 50%;
}

/* Remove o ::after dos botões */
.navbar-nav a.btn::after {
  display: none;
}

/* Botão de logout vermelho */
.navbar-nav .btn-logout {
  background: transparent;
  border: 1px solid var(--destructive);
  color: var(--destructive);
  font-weight: 600;
  transition: all 0.2s ease;
}

.navbar-nav .btn-logout:hover {
  background: var(--destructive);
  color: var(--destructive-foreground);
  box-shadow: 0 0 20px hsla(0, 84%, 60%, 0.3);
  transform: translateY(-1px);
}

/* Espaçamento entre links e botões */
.navbar-nav a[href="perfil.php"] {
  margin-right: 0.75rem;
}

/* Mobile Menu Button */
.navbar-mobile-btn {
  display: flex;
  padding: 0.5rem;
  color: var(--muted-foreground);
  transition: color 0.3s ease;
}

.navbar-mobile-btn:hover {
  color: var(--foreground);
}

.navbar-mobile-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 1024px) {
  .navbar-mobile-btn {
    display: none;
  }
}

/* Mobile Menu */
.navbar-mobile {
  display: none;
  overflow: hidden;
}

.navbar-mobile.active {
  display: block;
}

.navbar-mobile-inner {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.navbar-mobile-links a {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.navbar-mobile-links a:hover {
  color: var(--foreground);
  background: rgba(255, 255, 255, 0.05);
}

/* Logout vermelho no mobile */
.navbar-mobile-links .btn-logout {
  background: transparent;
  border: 1px solid var(--destructive);
  color: var(--destructive);
  font-weight: 600;
  text-align: center;
  display: block;
  transition: all 0.2s ease;
}

.navbar-mobile-links .btn-logout:hover {
  background: var(--destructive);
  color: var(--destructive-foreground);
  box-shadow: 0 0 20px hsla(0, 84%, 60%, 0.3);
}

.navbar-mobile .btn-neon {
  margin-top: 0.75rem;
  width: 100%;
}

@media (min-width: 640px) {
  .navbar-logo-text {
    display: block;
  }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 8rem 1rem 5rem;
}

.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .hero-content {
    text-align: left;
  }
}

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid hsla(165, 100%, 50%, 0.2);
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.2s;
    opacity: 0;
  }

.hero-badge svg {
  width: 1rem;
  height: 1rem;
  animation: pulse 2s infinite;
}

/* Title */
.hero-title-wrapper {
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* Description */
.hero-description {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 32rem;
  margin: 0 auto;
  line-height: 1.7;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.5s;
    opacity: 0;
}

@media (min-width: 1024px) {
  .hero-description {
    margin: 0;
  }
}

/* CTA Buttons */
.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.6s;
  opacity: 0;
}

@media (min-width: 640px) {
  .hero-buttons {
    flex-direction: row;
  }
}

@media (min-width: 1024px) {
  .hero-buttons {
    justify-content: flex-start;
  }
}

/* Stats */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  padding-top: 1.5rem;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: 0.7s;
  opacity: 0;
}

@media (min-width: 1024px) {
  .hero-stats {
    justify-content: flex-start;
  }
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s ease;
}

.hero-stat:hover {
  transform: scale(1.05);
}

.hero-stat-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid hsla(165, 100%, 50%, 0.2);
}

.hero-stat-icon.secondary {
  border-color: hsla(340, 100%, 60%, 0.2);
}

.hero-stat-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.hero-stat-icon svg.primary {
  color: var(--primary);
}

.hero-stat-icon svg.secondary {
  color: var(--secondary);
}

.hero-stat-text {
  text-align: left;
}

.hero-stat-number {
  font-weight: 700;
  font-size: 1.875rem;
  color: var(--foreground);
  font-family: 'Space Mono', monospace;
}

.hero-stat-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Game Grid Illustration */
.hero-game {
  display: flex;
  justify-content: center;
  animation: scaleIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.5s;
  opacity: 0;
}

@media (min-width: 1024px) {
  .hero-game {
    justify-content: flex-end;
  }
}

.game-grid-container {
  position: relative;
  width: 320px;
  height: 320px;
}

.game-grid-glow {
  position: absolute;
  inset: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(165, 100%, 50%, 0.2) 0%, transparent 60%);
  filter: blur(40px);
  animation: pulseGlow 4s ease-in-out infinite;
}

.game-grid-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  animation: float 6s ease-in-out infinite;
}

.game-grid-svg {
  width: 100%;
  height: 100%;
}

/* Grid lines */
.game-grid-svg .grid-line {
  stroke: var(--game-grid);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: drawLine 0.8s ease forwards;
}

.game-grid-svg .grid-line:nth-child(1) { animation-delay: 0.2s; }
.game-grid-svg .grid-line:nth-child(2) { animation-delay: 0.4s; }
.game-grid-svg .grid-line:nth-child(3) { animation-delay: 0.6s; }
.game-grid-svg .grid-line:nth-child(4) { animation-delay: 0.8s; }

/* X symbols */
.game-grid-svg .x-line {
  stroke: var(--game-x);
  stroke-width: 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px hsla(165, 100%, 50%, 0.8));
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawLine 0.3s ease forwards;
}

.x-group-1 .x-line:nth-child(1) { animation-delay: 1.2s; }
.x-group-1 .x-line:nth-child(2) { animation-delay: 1.3s; }
.x-group-2 .x-line:nth-child(1) { animation-delay: 1.8s; }
.x-group-2 .x-line:nth-child(2) { animation-delay: 1.9s; }

/* O symbols */
.game-grid-svg .o-circle {
  fill: none;
  stroke: var(--game-o);
  stroke-width: 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px hsla(340, 100%, 60%, 0.8));
  stroke-dasharray: 188;
  stroke-dashoffset: 188;
  animation: drawCircle 0.6s ease forwards;
}

.o-circle:nth-of-type(1) { animation-delay: 1.5s; }
.o-circle:nth-of-type(2) { animation-delay: 2.1s; }

/* ============================================
   Features Section
   ============================================ */
.features {
  padding: 8rem 1rem;
  position: relative;
}

.features-header {
  text-align: center;
  margin-bottom: 5rem;
}

.features-label {
  color: var(--primary);
  font-family: 'Space Mono', monospace;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1rem;
}

.features-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}

.features-description {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  max-width: 42rem;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.feature-card {
  position: relative;
  padding: 2rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: all 0.5s ease;
}

.feature-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.feature-card.primary:hover {
  border-color: hsla(165, 100%, 50%, 0.5);
}

.feature-card.secondary:hover {
  border-color: hsla(340, 100%, 60%, 0.5);
}

.feature-card.accent:hover {
  border-color: hsla(260, 100%, 65%, 0.5);
}

.feature-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.feature-card:hover .feature-card-bg {
  opacity: 1;
}

.feature-card.primary .feature-card-bg {
  background: linear-gradient(to bottom right, hsla(165, 100%, 50%, 0.2), hsla(165, 100%, 50%, 0.05));
}

.feature-card.secondary .feature-card-bg {
  background: linear-gradient(to bottom right, hsla(340, 100%, 60%, 0.2), hsla(340, 100%, 60%, 0.05));
}

.feature-card.accent .feature-card-bg {
  background: linear-gradient(to bottom right, hsla(260, 100%, 65%, 0.2), hsla(260, 100%, 65%, 0.05));
}

.feature-card-content {
  position: relative;
  z-index: 1;
}

.feature-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: transform 0.5s ease;
}

.feature-card:hover .feature-icon {
  transform: rotate(-10deg);
}

.feature-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.feature-icon.primary svg { color: var(--primary); }
.feature-icon.secondary svg { color: var(--secondary); }
.feature-icon.accent svg { color: var(--accent); }

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.75rem;
}

.feature-description {
  color: var(--muted-foreground);
  line-height: 1.7;
}

/* Animation for feature cards */
.feature-card {
  opacity: 0;
  transform: translateY(40px);
}

.feature-card.animate {
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.feature-card:nth-child(1).animate { animation-delay: 0s; }
.feature-card:nth-child(2).animate { animation-delay: 0.15s; }
.feature-card:nth-child(3).animate { animation-delay: 0.3s; }
.feature-card:nth-child(4).animate { animation-delay: 0.45s; }

/* ============================================
   CTA Section
   ============================================ */
.cta {
  padding: 8rem 1rem;
  position: relative;
  overflow: hidden;
}

.cta-bg-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, hsla(165, 100%, 50%, 0.1) 0%, transparent 60%);
  animation: pulseGlow 8s ease-in-out infinite;
}

.cta-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.cta-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border-radius: 1.5rem;
  animation: float 4s ease-in-out infinite;
}

.cta-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--primary);
}

.cta-title {
  font-size: clamp(2rem, 6vw, 3.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.cta-description {
  font-size: 1.25rem;
  color: var(--muted-foreground);
  max-width: 42rem;
}

.cta-button {
  font-size: 1.125rem;
  padding: 0 3rem;
}

.cta-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.cta-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.cta-badge-dot.primary { background: var(--primary); }
.cta-badge-dot.secondary { background: var(--secondary); }
.cta-badge-dot.accent { background: var(--accent); }

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 3rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  position: relative;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s ease;
}

.footer-logo:hover {
  transform: scale(1.02);
}

.footer-logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid hsla(165, 100%, 50%, 0.3);
  transition: box-shadow 0.3s ease;
}

.footer-logo:hover .footer-logo-icon {
  box-shadow: 0 0 20px hsla(165, 100%, 50%, 0.4), 0 0 60px hsla(165, 100%, 50%, 0.2);
}

.footer-logo-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
}

.footer-logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--foreground);
}

.footer-logo-text span {
  color: var(--primary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.footer-link {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  transition: all 0.3s ease;
  position: relative;
}

.footer-link:hover {
  color: var(--foreground);
  transform: translateY(-2px);
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.footer-link:hover::after {
  width: 100%;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-social-link {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: all 0.3s ease;
}

.footer-social-link:hover {
  color: var(--foreground);
  transform: translateY(-2px);
}

.footer-social-link svg {
  width: 1rem;
  height: 1rem;
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 640px) {
  .navbar-logo-text {
    display: block;
  }
  
  .navbar-logo-icon {
    display: none;
  }
  
  .hero-stats {
    gap: 1.5rem;
  }
  
  .hero-stat-number {
    font-size: 1.5rem;
  }
  
  .hero-stat-icon {
    width: 3rem;
    height: 3rem;
  }
  
  .game-grid-container {
    width: 260px;
    height: 260px;
  }
}

/* ============================================
   Lobby / Jogar Page
   ============================================ */

.page-jogar main {
  position: relative;
  z-index: 10;
  padding-top: 7rem;
}

.lobby {
  min-height: 100vh;
  padding: 1.5rem 1rem 4rem;
}

.lobby .container {
  max-width: 1100px;
}

.lobby-auth-alert {
  margin-bottom: 1.75rem;
  padding: 0.9rem 1.25rem;
  border-radius: 0.9rem;
  background: rgba(255, 184, 0, 0.08);
  border: 1px solid rgba(255, 184, 0, 0.4);
  color: #fef7e3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}

.lobby-auth-alert strong {
  font-weight: 600;
}

.lobby-auth-alert p {
  margin-top: 0.1rem;
  color: rgba(255, 247, 227, 0.9);
}

.lobby-auth-alert .btn-outline {
  border-color: rgba(255, 184, 0, 0.7);
}

.hidden {
  display: none !important;
}

.lobby-header {
  text-align: left;
  margin-bottom: 2.5rem;
}

.lobby-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  background: rgba(10, 14, 22, 0.9);
  border: 1px solid hsla(165, 100%, 50%, 0.35);
  color: var(--primary);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: 'Space Mono', monospace;
}

.lobby-tag-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: var(--primary);
  box-shadow: 0 0 10px hsla(165, 100%, 50%, 0.8);
}

.lobby-title {
  margin-top: 0.9rem;
  font-size: clamp(2rem, 3.5vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lobby-subtitle {
  margin-top: 0.5rem;
  max-width: 34rem;
  font-size: 0.975rem;
  color: var(--muted-foreground);
}

.lobby-grid {
  display: grid;
  gap: 1.75rem;
  align-items: flex-start;
}

@media (min-width: 900px) {
  .lobby-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
  }
}

.lobby-card {
  border-radius: 1.5rem;
  padding: 1.75rem 1.75rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

/* =========================================================
   Lobby (layout competitivo - baseado no jogar.html atual)
   ========================================================= */

.lobby-competitive {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

/* Deixa o grid auto-posicionar os cards (evita sobreposição) */

/* No print, tudo fica “empilhado” e centralizado */
@media (min-width: 960px) {
  .lobby-competitive {
    max-width: 980px;
    margin: 0 auto;
  }
}

/* Perfil topo (banner horizontal) */
.lobby-profile-banner {
  display: block;
  padding: 1.55rem 1.65rem;
  border-radius: 1.6rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.lobby-modes-panel {
  display: block;
}

.lobby-profile-banner::before {
  content: '';
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(900px 420px at 20% 10%, hsla(165, 100%, 50%, 0.18), transparent 60%),
    radial-gradient(700px 360px at 90% 10%, hsla(260, 100%, 65%, 0.12), transparent 55%),
    radial-gradient(600px 360px at 30% 120%, hsla(340, 100%, 60%, 0.10), transparent 55%);
  pointer-events: none;
  opacity: 0.9;
}

.lobby-profile-banner > * {
  position: relative;
  z-index: 1;
}

.lobby-profile-banner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.lobby-avatar-lg {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 30% 30%, hsla(165, 100%, 50%, 0.9), rgba(10, 12, 18, 0.95) 65%);
  color: var(--primary-foreground);
  box-shadow: 0 0 26px hsla(165, 100%, 50%, 0.45);
  border: 1px solid hsla(165, 100%, 50%, 0.35);
  font-weight: 800;
  font-size: 1.35rem;
  overflow: hidden;
}

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

/* Brilhos do avatar de lobby-lg baseado na posição do ranking */
.lobby-avatar-glow--1 .lobby-avatar-lg {
  border-color: rgba(250, 204, 21, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(250, 204, 21, 0.6),
    0 0 40px rgba(250, 204, 21, 0.4),
    0 0 60px rgba(250, 204, 21, 0.2) !important;
  animation: glow-gold 2s ease-in-out infinite alternate;
}

.lobby-avatar-glow--2 .lobby-avatar-lg {
  border-color: rgba(148, 163, 184, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(148, 163, 184, 0.6),
    0 0 40px rgba(148, 163, 184, 0.4),
    0 0 60px rgba(148, 163, 184, 0.2) !important;
  animation: glow-silver 2s ease-in-out infinite alternate;
}

.lobby-avatar-glow--3 .lobby-avatar-lg {
  border-color: rgba(248, 113, 113, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(248, 113, 113, 0.6),
    0 0 40px rgba(248, 113, 113, 0.4),
    0 0 60px rgba(248, 113, 113, 0.2) !important;
  animation: glow-bronze 2s ease-in-out infinite alternate;
}

.lobby-avatar-glow--normal .lobby-avatar-lg {
  border-color: hsla(165, 100%, 50%, 0.6) !important;
  box-shadow: 
    0 0 15px hsla(165, 100%, 50%, 0.5),
    0 0 30px hsla(165, 100%, 50%, 0.3) !important;
  animation: glow-green 2s ease-in-out infinite alternate;
}

.lobby-profile-banner-identity { min-width: 0; }

.lobby-profile-name-lg {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-profile-rating-lg {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.9rem;
}

.lobby-rating-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Space Mono', monospace;
}

.lobby-rating-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px rgba(0, 255, 170, 0.25));
}

.lobby-pill {
  background: rgba(10, 14, 22, 0.92);
  border: 1px solid hsla(165, 100%, 50%, 0.55);
  color: var(--primary);
}

.lobby-profile-footer {
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

.lobby-profile-footer-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: var(--primary);
  box-shadow: 0 0 10px hsla(165, 100%, 50%, 0.85);
}

.lobby-profile-banner-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2.1rem;
  margin-top: 1.1rem;
  padding-top: 1.05rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.lobby-profile-banner-stat {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  text-align: center;
}

.lobby-profile-stat-value {
  font-family: 'Space Mono', monospace;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.lobby-profile-stat-label {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.stat-win { color: var(--primary); }
.stat-loss { color: var(--secondary); }

/* Painéis */
.lobby-section-title {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

/* Cabeçalho da seção de partida (título + tipo) */
.lobby-match-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.lobby-match-header-row .lobby-section-title {
  margin-bottom: 0;
}

.lobby-match-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(10, 14, 22, 0.92);
  border: 1px solid hsla(165, 100%, 50%, 0.55);
  color: var(--primary);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: 'Space Mono', monospace;
  white-space: nowrap;
}

/* Cards de modo de jogo */
.lobby-modes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 720px) {
  .lobby-modes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.lobby-mode-card {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 1.05rem 1.05rem;
  border-radius: 1.25rem;
  background: rgba(7, 9, 14, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  transition: transform 0.18s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  min-height: 92px;
}

.lobby-mode-card-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 19, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(226, 232, 240, 0.75);
  flex-shrink: 0;
}

.lobby-mode-card-icon svg { width: 1.25rem; height: 1.25rem; }

.lobby-mode-card-content { min-width: 0; }

.lobby-mode-title {
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 0.98rem;
}

.lobby-mode-description {
  margin-top: 0.15rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
}

.lobby-mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.3);
}

.lobby-mode-active {
  background:
    radial-gradient(700px 250px at 15% 15%, hsla(165, 100%, 50%, 0.22), rgba(7, 9, 14, 0.86) 55%);
  border-color: hsla(165, 100%, 50%, 0.45);
  box-shadow: 0 0 0 1px hsla(165, 100%, 50%, 0.12), 0 20px 60px rgba(0, 0, 0, 0.55);
}

.lobby-mode-active .lobby-mode-card-icon {
  border-color: hsla(165, 100%, 50%, 0.35);
  color: var(--primary);
  box-shadow: 0 0 18px hsla(165, 100%, 50%, 0.2);
}

.lobby-mode-disabled {
  opacity: 0.45;
  filter: saturate(0.7);
}

.lobby-mode-disabled:hover {
  transform: none;
  border-color: rgba(148, 163, 184, 0.18);
}

/* Informações da partida */
.lobby-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

@media (min-width: 720px) {
  .lobby-match-panel .lobby-info-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.lobby-info-card {
  padding: 0.95rem 1rem;
  border-radius: 1.15rem;
  background: rgba(7, 9, 14, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
}

.lobby-info-card-label {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.lobby-info-card-value {
  margin-top: 0.35rem;
  font-family: 'Space Mono', monospace;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  color: var(--foreground);
}

/* Botão principal (Buscar partida) */
.lobby-primary-button {
  margin-top: 1.35rem;
  width: min(420px, 100%);
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Space Mono', monospace;
  box-shadow: 0 0 0 1px hsla(165, 100%, 50%, 0.18), 0 0 30px hsla(165, 100%, 50%, 0.18);
}

.lobby-primary-button svg {
  width: 1.1rem;
  height: 1.1rem;
}

.lobby-primary-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Nota “tipo de partida” logo abaixo do botão (como no print) */
.lobby-queue-note {
  margin-top: 0.7rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.lobby-queue-note strong {
  color: var(--foreground);
}

/* Ajustes mobile */
@media (max-width: 720px) {
  .lobby-info-grid { grid-template-columns: 1fr; }
  .lobby-profile-banner-right {
    justify-content: space-between;
    gap: 0.9rem;
  }
}

.lobby-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted-foreground);
  margin-bottom: 1.1rem;
  font-family: 'Space Mono', monospace;
}

.lobby-card-title span {
  color: var(--primary);
}

/* Perfil do jogador */

.lobby-profile-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.lobby-avatar-wrapper {
  display: inline-block;
}

.lobby-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1.25rem;
  background: radial-gradient(circle at top, hsla(165, 100%, 50%, 0.36), rgba(10, 12, 18, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-foreground);
  box-shadow: 0 0 22px hsla(165, 100%, 50%, 0.8);
  overflow: hidden;
}

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

/* Brilhos do avatar de lobby baseado na posição do ranking */
.lobby-avatar-glow--1 .lobby-avatar {
  border: 2px solid rgba(250, 204, 21, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(250, 204, 21, 0.6),
    0 0 40px rgba(250, 204, 21, 0.4),
    0 0 60px rgba(250, 204, 21, 0.2) !important;
  animation: glow-gold 2s ease-in-out infinite alternate;
}

.lobby-avatar-glow--2 .lobby-avatar {
  border: 2px solid rgba(148, 163, 184, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(148, 163, 184, 0.6),
    0 0 40px rgba(148, 163, 184, 0.4),
    0 0 60px rgba(148, 163, 184, 0.2) !important;
  animation: glow-silver 2s ease-in-out infinite alternate;
}

.lobby-avatar-glow--3 .lobby-avatar {
  border: 2px solid rgba(248, 113, 113, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(248, 113, 113, 0.6),
    0 0 40px rgba(248, 113, 113, 0.4),
    0 0 60px rgba(248, 113, 113, 0.2) !important;
  animation: glow-bronze 2s ease-in-out infinite alternate;
}

.lobby-avatar-glow--normal .lobby-avatar {
  border: 2px solid hsla(165, 100%, 50%, 0.6) !important;
  box-shadow: 
    0 0 15px hsla(165, 100%, 50%, 0.5),
    0 0 30px hsla(165, 100%, 50%, 0.3) !important;
  animation: glow-green 2s ease-in-out infinite alternate;
}

.lobby-profile-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.lobby-profile-rating {
  margin-top: 0.15rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.lobby-pill {
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(11, 16, 24, 0.95);
  border: 1px solid hsla(165, 100%, 50%, 0.5);
  color: var(--primary);
}

.lobby-profile-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.lobby-profile-footer-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 9999px;
  background: var(--primary);
}

.lobby-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.35rem;
  margin-top: 1.25rem;
}

.lobby-profile-stat {
  min-width: 5.5rem;
}

.lobby-profile-stat-label {
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.lobby-profile-stat-value {
  margin-top: 0.15rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Space Mono', monospace;
}

/* Modos de jogo */

.lobby-modes {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lobby-mode {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(7, 9, 14, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.18s ease;
}

.lobby-mode:hover {
  transform: translateY(-1px);
}

.lobby-mode-active {
  border-color: hsla(165, 100%, 50%, 0.65);
  background: radial-gradient(circle at top left, hsla(165, 100%, 50%, 0.25), rgba(7, 9, 14, 0.98));
  box-shadow: 0 0 26px hsla(165, 100%, 50%, 0.4);
}

.lobby-mode-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.lobby-mode-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.lobby-mode-title {
  font-size: 0.95rem;
  font-weight: 500;
}

.lobby-mode-description {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.lobby-mode-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.15rem 0.55rem;
  color: rgba(255, 255, 255, 0.7);
}

.lobby-mode-badge-soon {
  border-color: rgba(148, 163, 184, 0.6);
  color: rgba(148, 163, 184, 0.95);
}

.lobby-mode-indicator {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 9999px;
  border: 2px solid rgba(148, 163, 184, 0.6);
  margin-left: 0.75rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
  position: relative;
}

.lobby-mode-indicator::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  background: transparent;
}

.lobby-mode-active .lobby-mode-indicator {
  border-color: hsla(165, 100%, 50%, 0.85);
}

.lobby-mode-active .lobby-mode-indicator::after {
  background: var(--primary);
  box-shadow: 0 0 10px hsla(165, 100%, 50%, 0.9);
}

/* Informações da partida e matchmaking */

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

.lobby-match-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.lobby-match-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid hsla(165, 100%, 50%, 0.6);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.lobby-match-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.5rem;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.lobby-match-info-item-label {
  color: var(--muted-foreground);
}

.lobby-match-info-item-value {
  font-weight: 500;
}

.lobby-match-rating {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.lobby-primary-button {
  width: 100%;
  margin-top: 1.3rem;
}

.lobby-secondary-note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  text-align: center;
  color: var(--muted-foreground);
}

.lobby-secondary-note span {
  color: var(--primary);
}

.lobby-matchmaking-status {
  margin-top: 1.4rem;
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  background: rgba(5, 8, 14, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lobby-matchmaking-status.active {
  display: flex;
}

.match-status-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.match-status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: var(--primary);
  box-shadow: 0 0 10px hsla(165, 100%, 50%, 0.9);
  animation: pulse 1.4s ease-in-out infinite;
}

.match-status-text {
  font-size: 0.85rem;
}

.match-status-text-strong {
  font-weight: 500;
}

.lobby-cancel-button {
  font-size: 0.78rem;
  padding-inline: 0.9rem;
}

.lobby-cancel-button.btn-outline {
  border-color: rgba(148, 163, 184, 0.7);
  color: rgba(226, 232, 240, 0.9);
}

.lobby-cancel-button.btn-outline:hover {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

@media (max-width: 768px) {
  .lobby-auth-alert {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .lobby-match-info {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* ============================================
   Auth / Login & Cadastro
   ============================================ */

.page-auth main {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7rem 1rem 3rem;
}

.auth-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.auth-grid {
  display: grid;
  gap: 2.25rem;
}

@media (min-width: 900px) {
  .auth-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
  }
}

.auth-header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid hsla(165, 100%, 50%, 0.4);
  background: rgba(10, 14, 22, 0.95);
  color: var(--primary);
  font-size: 0.75rem;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-header-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: var(--primary);
  box-shadow: 0 0 8px hsla(165, 100%, 50%, 0.9);
}

.auth-title {
  margin-top: 1rem;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin-top: 0.75rem;
  max-width: 26rem;
  font-size: 0.98rem;
  color: var(--muted-foreground);
}

.auth-highlight-list {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.auth-highlight-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-highlight-bullet {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: var(--primary);
}

.auth-card {
  border-radius: 1.5rem;
  padding: 1.8rem 1.8rem 1.6rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
}

.auth-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.auth-card-subtitle {
  font-size: 0.88rem;
  color: var(--muted-foreground);
  margin-bottom: 1.2rem;
}

.form-error {
  margin-bottom: 0.9rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.85rem;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.65);
  color: #fecaca;
  font-size: 0.82rem;
}

.auth-form {
  display: grid;
  gap: 0.9rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.form-input {
  border-radius: 0.9rem;
  border: 1px solid var(--input);
  background: rgba(15, 23, 42, 0.9);
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  color: var(--foreground);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-input::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.form-input:focus {
  border-color: hsla(165, 100%, 50%, 0.7);
  box-shadow: 0 0 0 1px hsla(165, 100%, 50%, 0.4);
  background: rgba(15, 23, 42, 1);
}

.form-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.2rem;
}

.form-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.form-checkbox-row input[type="checkbox"] {
  margin-top: 0.1rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.25rem;
}

.auth-submit {
  margin-top: 0.4rem;
  width: 100%;
}

.auth-footer-text {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  text-align: center;
}

.auth-footer-text a {
  color: var(--primary);
}

.auth-small-link {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.auth-small-link a {
  color: var(--primary);
}

@media (max-width: 768px) {
  .auth-card {
    padding: 1.5rem 1.4rem 1.4rem;
  }
}

/* ============================================
   Regras / Tutorial Completo
   ============================================ */

.page-rules main {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding: 7rem 1rem 4rem;
}

.rules-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.rules-hero {
  text-align: left;
  margin-bottom: 3rem;
}

.rules-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid hsla(165, 100%, 50%, 0.4);
  color: var(--primary);
  font-size: 0.75rem;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rules-badge-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: var(--primary);
  box-shadow: 0 0 8px hsla(165, 100%, 50%, 0.9);
}

.rules-title {
  margin-top: 1rem;
  font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.rules-subtitle {
  margin-top: 0.75rem;
  max-width: 36rem;
  font-size: 1rem;
  color: var(--muted-foreground);
}

.rules-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .rules-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rules-sections {
  display: grid;
  gap: 1.5rem;
}

.rules-card {
  border-radius: 1.5rem;
  padding: 1.6rem 1.6rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

.rules-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted-foreground);
  margin-bottom: 0.9rem;
  font-family: 'Space Mono', monospace;
}

.rules-card-title span {
  color: var(--primary);
}

.rules-section {
  border-radius: 1.1rem;
  padding: 1.2rem 1.3rem;
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.rules-section + .rules-section {
  margin-top: 1rem;
}

.rules-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.rules-section p {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin-bottom: 0.4rem;
}

.rules-section ul {
  padding-left: 1.1rem;
  margin: 0.25rem 0 0.4rem;
  list-style: disc;
}

.rules-section li {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  margin-bottom: 0.15rem;
}

.rules-highlight {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--muted-foreground);
}

.rules-highlight strong {
  color: var(--foreground);
}

.rules-side-card {
  border-radius: 1.5rem;
  padding: 1.6rem 1.6rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
}

.rules-side-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.rules-side-list {
  display: grid;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.rules-side-item {
  display: flex;
  gap: 0.6rem;
}

.rules-side-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: var(--primary);
  margin-top: 0.4rem;
}

.rules-cta {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.4rem;
  border-radius: 1.25rem;
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid hsla(165, 100%, 50%, 0.5);
}

.rules-cta-text {
  font-size: 0.96rem;
  color: var(--muted-foreground);
}

.rules-cta-text strong {
  color: var(--foreground);
}

.rules-cta-button {
  min-width: 180px;
}

@media (max-width: 640px) {
  .rules-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .rules-cta-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}


/* ============================================
   Ranking
   ============================================ */

.page-ranking main {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding: 7rem 1rem 4rem;
}

.ranking-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.ranking-hero {
  text-align: left;
  margin-bottom: 2.5rem;
}

.ranking-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid hsla(165, 100%, 50%, 0.4);
  color: var(--primary);
  font-size: 0.75rem;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ranking-badge-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: var(--primary);
  box-shadow: 0 0 8px hsla(165, 100%, 50%, 0.9);
}

.ranking-title {
  margin-top: 1rem;
  font-size: clamp(2.4rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.ranking-subtitle {
  margin-top: 0.75rem;
  max-width: 36rem;
  font-size: 1rem;
  color: var(--muted-foreground);
}

.ranking-top3 {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 900px) {
  .ranking-top3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ranking-top-card {
  border-radius: 1.5rem;
  padding: 1.6rem 1.6rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  text-align: center;
}

.ranking-top-card--1 {
  border-color: rgba(250, 204, 21, 0.9);
  box-shadow: 0 0 35px rgba(250, 204, 21, 0.4);
}

.ranking-top-card--2 {
  border-color: rgba(148, 163, 184, 0.9);
}

.ranking-top-card--3 {
  border-color: rgba(248, 113, 113, 0.9);
}

/* Avatares do ranking com brilho */
.ranking-avatar-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.ranking-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 30% 30%, hsla(165, 100%, 50%, 0.9), rgba(10, 12, 18, 0.95) 65%);
  color: var(--primary-foreground);
  border: 2px solid hsla(165, 100%, 50%, 0.35);
  font-weight: 900;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

/* Brilho Top 1 - Amarelo/Dourado */
.ranking-avatar-glow--1 .ranking-avatar {
  border-color: rgba(250, 204, 21, 0.8);
  box-shadow: 
    0 0 20px rgba(250, 204, 21, 0.6),
    0 0 40px rgba(250, 204, 21, 0.4),
    0 0 60px rgba(250, 204, 21, 0.2);
  animation: glow-gold 2s ease-in-out infinite alternate;
}

@keyframes glow-gold {
  from {
    box-shadow: 
      0 0 20px rgba(250, 204, 21, 0.6),
      0 0 40px rgba(250, 204, 21, 0.4),
      0 0 60px rgba(250, 204, 21, 0.2);
  }
  to {
    box-shadow: 
      0 0 30px rgba(250, 204, 21, 0.8),
      0 0 50px rgba(250, 204, 21, 0.6),
      0 0 70px rgba(250, 204, 21, 0.4);
  }
}

/* Brilho Top 2 - Cinza/Prata */
.ranking-avatar-glow--2 .ranking-avatar {
  border-color: rgba(148, 163, 184, 0.8);
  box-shadow: 
    0 0 20px rgba(148, 163, 184, 0.6),
    0 0 40px rgba(148, 163, 184, 0.4),
    0 0 60px rgba(148, 163, 184, 0.2);
  animation: glow-silver 2s ease-in-out infinite alternate;
}

@keyframes glow-silver {
  from {
    box-shadow: 
      0 0 20px rgba(148, 163, 184, 0.6),
      0 0 40px rgba(148, 163, 184, 0.4),
      0 0 60px rgba(148, 163, 184, 0.2);
  }
  to {
    box-shadow: 
      0 0 30px rgba(148, 163, 184, 0.8),
      0 0 50px rgba(148, 163, 184, 0.6),
      0 0 70px rgba(148, 163, 184, 0.4);
  }
}

/* Brilho Top 3 - Vermelho/Bronze */
.ranking-avatar-glow--3 .ranking-avatar {
  border-color: rgba(248, 113, 113, 0.8);
  box-shadow: 
    0 0 20px rgba(248, 113, 113, 0.6),
    0 0 40px rgba(248, 113, 113, 0.4),
    0 0 60px rgba(248, 113, 113, 0.2);
  animation: glow-bronze 2s ease-in-out infinite alternate;
}

@keyframes glow-bronze {
  from {
    box-shadow: 
      0 0 20px rgba(248, 113, 113, 0.6),
      0 0 40px rgba(248, 113, 113, 0.4),
      0 0 60px rgba(248, 113, 113, 0.2);
  }
  to {
    box-shadow: 
      0 0 30px rgba(248, 113, 113, 0.8),
      0 0 50px rgba(248, 113, 113, 0.6),
      0 0 70px rgba(248, 113, 113, 0.4);
  }
}

/* Brilho Normal - Verde (resto) */
.ranking-avatar-glow--normal .ranking-row-avatar {
  border-color: hsla(165, 100%, 50%, 0.6);
  box-shadow: 
    0 0 15px hsla(165, 100%, 50%, 0.5),
    0 0 30px hsla(165, 100%, 50%, 0.3);
  animation: glow-green 2s ease-in-out infinite alternate;
}

@keyframes glow-green {
  from {
    box-shadow: 
      0 0 15px hsla(165, 100%, 50%, 0.5),
      0 0 30px hsla(165, 100%, 50%, 0.3);
  }
  to {
    box-shadow: 
      0 0 20px hsla(165, 100%, 50%, 0.7),
      0 0 40px hsla(165, 100%, 50%, 0.5);
  }
}

/* Avatar na lista 4-10 */
.ranking-row-avatar-wrapper {
  display: flex;
  align-items: center;
  margin-right: 0.75rem;
}

.ranking-row-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 30% 30%, hsla(165, 100%, 50%, 0.9), rgba(10, 12, 18, 0.95) 65%);
  color: var(--primary-foreground);
  border: 2px solid hsla(165, 100%, 50%, 0.35);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

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

.ranking-position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 9999px;
  margin-bottom: 0.6rem;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 1.1rem;
}

.ranking-top-card--1 .ranking-position-badge {
  background: radial-gradient(circle, rgba(250, 204, 21, 0.9), rgba(15, 23, 42, 1));
  color: #0f172a;
}

.ranking-top-card--2 .ranking-position-badge {
  background: radial-gradient(circle, rgba(148, 163, 184, 0.9), rgba(15, 23, 42, 1));
  color: #020617;
}

.ranking-top-card--3 .ranking-position-badge {
  background: radial-gradient(circle, rgba(248, 113, 113, 0.9), rgba(15, 23, 42, 1));
  color: #020617;
}

.ranking-top-name {
  font-size: 1.15rem;
  font-weight: 600;
}

.ranking-top-rating {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  color: var(--muted-foreground);
}

.ranking-top-rating strong {
  color: var(--foreground);
}

.ranking-top-meta {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.ranking-top-meta span + span {
  margin-left: 0.5rem;
}

.ranking-list-card {
  border-radius: 1.5rem;
  padding: 1.6rem 1.6rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
}

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

.ranking-list-title {
  font-size: 1rem;
  font-weight: 600;
}

.ranking-list-subtitle {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.ranking-scroll {
  margin-top: 0.4rem;
  display: grid;
  gap: 0.3rem;
}

.ranking-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(30, 64, 175, 0.3);
}

.ranking-row-pos {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  min-width: 2.3rem;
}

.ranking-row-main {
  min-width: 0;
}

.ranking-row-name {
  font-size: 0.95rem;
  font-weight: 500;
}

.ranking-row-meta {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.ranking-row-rating {
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.ranking-row-rating-value {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  color: var(--foreground);
}

.ranking-row-rating-label {
  font-size: 0.75rem;
}

@media (max-width: 640px) {
  .ranking-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .ranking-row-rating {
    grid-column: 2 / -1;
  }
}

/* ============================================
   Perfil
   ============================================ */

.page-perfil main {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  padding: 7rem 1rem 4rem;
}

.profile-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.profile-hero {
  text-align: left;
  margin-bottom: 2.25rem;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  background: rgba(10, 14, 22, 0.95);
  border: 1px solid hsla(165, 100%, 50%, 0.4);
  color: var(--primary);
  font-size: 0.75rem;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-badge-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: var(--primary);
  box-shadow: 0 0 8px hsla(165, 100%, 50%, 0.9);
}

.profile-title {
  margin-top: 1rem;
  font-size: clamp(2.2rem, 4.5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.profile-subtitle {
  margin-top: 0.75rem;
  max-width: 40rem;
  font-size: 1rem;
  color: var(--muted-foreground);
}

.profile-auth-alert {
  margin-bottom: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(255, 184, 0, 0.4);
  background: rgba(255, 184, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
}

.profile-auth-alert p {
  margin-top: 0.15rem;
  color: rgba(255, 247, 227, 0.9);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.profile-card,
.profile-side {
  border-radius: 1.5rem;
  padding: 1.6rem 1.6rem 1.4rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
}

.profile-card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.profile-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.profile-avatar {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 9999px;
  background:
    radial-gradient(circle at 30% 30%, hsla(165, 100%, 50%, 0.9), rgba(10, 12, 18, 0.95) 65%);
  color: var(--primary-foreground);
  box-shadow: 0 0 26px hsla(165, 100%, 50%, 0.45);
  border: 1px solid hsla(165, 100%, 50%, 0.35);
  font-weight: 900;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

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

.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-foreground);
  border: 2px solid var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.profile-avatar-edit:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px hsla(165, 100%, 50%, 0.5);
}

.profile-avatar-edit svg {
  width: 0.875rem;
  height: 0.875rem;
}

/* Brilhos do avatar de perfil baseado na posição do ranking */
.profile-avatar-glow--1 .profile-avatar {
  border-color: rgba(250, 204, 21, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(250, 204, 21, 0.6),
    0 0 40px rgba(250, 204, 21, 0.4),
    0 0 60px rgba(250, 204, 21, 0.2) !important;
  animation: glow-gold 2s ease-in-out infinite alternate;
}

.profile-avatar-glow--2 .profile-avatar {
  border-color: rgba(148, 163, 184, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(148, 163, 184, 0.6),
    0 0 40px rgba(148, 163, 184, 0.4),
    0 0 60px rgba(148, 163, 184, 0.2) !important;
  animation: glow-silver 2s ease-in-out infinite alternate;
}

.profile-avatar-glow--3 .profile-avatar {
  border-color: rgba(248, 113, 113, 0.8) !important;
  box-shadow: 
    0 0 20px rgba(248, 113, 113, 0.6),
    0 0 40px rgba(248, 113, 113, 0.4),
    0 0 60px rgba(248, 113, 113, 0.2) !important;
  animation: glow-bronze 2s ease-in-out infinite alternate;
}

.profile-avatar-glow--normal .profile-avatar {
  border-color: hsla(165, 100%, 50%, 0.6) !important;
  box-shadow: 
    0 0 15px hsla(165, 100%, 50%, 0.5),
    0 0 30px hsla(165, 100%, 50%, 0.3) !important;
  animation: glow-green 2s ease-in-out infinite alternate;
}

.profile-identity { min-width: 0; }

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(11, 16, 24, 0.95);
  border: 1px solid hsla(165, 100%, 50%, 0.5);
  color: var(--primary);
  flex-shrink: 0;
}

.profile-rating {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.92rem;
}

.profile-rating strong {
  color: var(--foreground);
}

.profile-sep {
  opacity: 0.6;
}

.profile-stats {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.profile-stat {
  padding: 0.95rem 1rem;
  border-radius: 1.15rem;
  background: rgba(7, 9, 14, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.18);
  text-align: center;
}

.profile-stat-value {
  font-family: 'Space Mono', monospace;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.profile-stat-label {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.profile-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-logout.btn-outline {
  border-color: rgba(148, 163, 184, 0.7);
}

.profile-logout.btn-outline:hover {
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.profile-side-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.profile-side-list {
  display: grid;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}

.profile-side-item {
  display: flex;
  gap: 0.6rem;
}

.profile-side-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 9999px;
  background: var(--primary);
  margin-top: 0.4rem;
  flex-shrink: 0;
}

.profile-side-actions {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .profile-auth-alert {
    flex-direction: column;
    align-items: stretch;
  }

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

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal-container {
  width: 100%;
  max-width: 500px;
  border-radius: 1.5rem;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  animation: scaleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--foreground);
}

.modal-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.modal-body {
  padding: 1.75rem;
}

.modal-form {
  display: grid;
  gap: 1.25rem;
}

.form-hint {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.modal-actions .btn {
  min-width: 100px;
}

@media (max-width: 640px) {
  .modal-container {
    max-width: 100%;
  }

  .modal-header {
    padding: 1.25rem 1.5rem;
  }

  .modal-body {
    padding: 1.5rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

/* Avatar Preview */
.avatar-preview-wrapper {
  margin-bottom: 1rem;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 9999px;
  margin: 0 auto 1rem;
  background:
    radial-gradient(circle at 30% 30%, hsla(165, 100%, 50%, 0.9), rgba(10, 12, 18, 0.95) 65%);
  border: 2px solid hsla(165, 100%, 50%, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 26px hsla(165, 100%, 50%, 0.45);
}

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

.avatar-preview-placeholder {
  font-weight: 900;
  font-size: 3rem;
  color: var(--primary-foreground);
}

.form-input[type="file"] {
  padding: 0.5rem;
  cursor: pointer;
}

.form-input[type="file"]::-webkit-file-upload-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--foreground);
  cursor: pointer;
  margin-right: 0.75rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

/* ============================================
   Tabuleiro (tela de partida)
   ============================================ */

.page-tabuleiro main {
  position: relative;
  z-index: 10;
}

.board-page {
  height: 100vh;
  width: 100vw;
  padding: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.board-container {
  width: 100%;
  max-width: 980px;
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
}

.board-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.board-back {
  padding-inline: 0.9rem;
}

.board-back svg {
  width: 1.1rem;
  height: 1.1rem;
}

.board-danger {
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.06);
}

.board-danger:hover {
  border-color: rgba(248, 113, 113, 0.9);
  background: rgba(248, 113, 113, 0.12);
  color: #fff;
}

/* Em telas maiores, os botões ficam na lateral (canto esquerdo), sem ocupar topo */
@media (min-width: 900px) {
  .board-topbar {
    position: fixed;
    left: 1.25rem;
    top: 1.25rem;
    transform: none;
    z-index: 20;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.65rem;
    padding: 0.75rem;
    border-radius: 1.1rem;
    background: rgba(17, 19, 23, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  }

  .board-topbar .btn {
    width: 9.5rem;
    justify-content: flex-start;
  }
}

.player-bar {
  border-radius: 1.25rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.player-bar.is-active {
  border-color: hsla(165, 100%, 50%, 0.45);
  box-shadow: 0 0 0 1px hsla(165, 100%, 50%, 0.12), 0 18px 55px rgba(0, 0, 0, 0.55);
}

.player-bar-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.player-avatar {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.2rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.player-avatar--x {
  background: radial-gradient(circle at 30% 30%, hsla(165, 100%, 50%, 0.85), rgba(10, 12, 18, 0.95) 65%);
  box-shadow: 0 0 22px hsla(165, 100%, 50%, 0.35);
  color: var(--primary-foreground);
  border-color: hsla(165, 100%, 50%, 0.35);
}

.player-avatar--o {
  background: radial-gradient(circle at 30% 30%, hsla(340, 100%, 60%, 0.85), rgba(10, 12, 18, 0.95) 65%);
  box-shadow: 0 0 22px hsla(340, 100%, 60%, 0.25);
  color: var(--primary-foreground);
  border-color: hsla(340, 100%, 60%, 0.35);
}

.player-meta {
  min-width: 0;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.player-name {
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.player-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: rgba(11, 16, 24, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.9);
  flex-shrink: 0;
}

.player-pill--x {
  border-color: hsla(165, 100%, 50%, 0.55);
  color: var(--primary);
}

.player-pill--o {
  border-color: hsla(340, 100%, 60%, 0.55);
  color: var(--secondary);
}

.player-sub {
  margin-top: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.player-sub strong {
  color: var(--foreground);
}

.player-sep {
  opacity: 0.6;
}

.turn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  border-radius: 9999px;
  background: rgba(10, 14, 22, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.78rem;
  white-space: nowrap;
}

.turn-badge.is-active {
  border-color: hsla(165, 100%, 50%, 0.6);
  box-shadow: 0 0 0 1px hsla(165, 100%, 50%, 0.12);
}

.turn-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: var(--primary);
  box-shadow: 0 0 10px hsla(165, 100%, 50%, 0.9);
  animation: pulse 1.6s ease-in-out infinite;
}

.board-stage {
  min-height: 0;
  display: grid;
  place-items: center;
}

.ultimate-board {
  width: min(740px, 82vmin);
  height: min(740px, 82vmin);
  border-radius: 1.6rem;
  padding: clamp(0.85rem, 2.2vw, 1.25rem);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.85rem, 2.4vw, 1.25rem);
  position: relative;
  overflow: hidden;
}

.ultimate-board::before {
  content: '';
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(900px 420px at 15% 10%, hsla(165, 100%, 50%, 0.10), transparent 55%),
    radial-gradient(780px 420px at 90% 25%, hsla(260, 100%, 65%, 0.08), transparent 55%),
    radial-gradient(820px 420px at 40% 110%, hsla(340, 100%, 60%, 0.06), transparent 55%);
  opacity: 1;
  pointer-events: none;
}

.ultimate-board > * {
  position: relative;
  z-index: 1;
}

.mini-board {
  border-radius: 1.15rem;
  background: rgba(7, 9, 14, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.55rem;
  position: relative;
  transition: transform 0.18s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  overflow: hidden;
}

.mini-board::before {
  content: '';
  position: absolute;
  inset: 0.55rem;
  border-radius: 0.85rem;
  background:
    linear-gradient(to right, transparent 31.5%, rgba(226, 232, 240, 0.22) 32%, rgba(226, 232, 240, 0.22) 33%, transparent 33.5%),
    linear-gradient(to right, transparent 66.5%, rgba(226, 232, 240, 0.22) 67%, rgba(226, 232, 240, 0.22) 68%, transparent 68.5%),
    linear-gradient(to bottom, transparent 31.5%, rgba(226, 232, 240, 0.22) 32%, rgba(226, 232, 240, 0.22) 33%, transparent 33.5%),
    linear-gradient(to bottom, transparent 66.5%, rgba(226, 232, 240, 0.22) 67%, rgba(226, 232, 240, 0.22) 68%, transparent 68.5%);
  pointer-events: none;
  opacity: 0.85;
  z-index: 1;
}

/* Símbolo grande quando tabuleiro está vencido ou empatado */
.mini-board-board-winner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  font-family: 'Outfit', sans-serif;
  z-index: 20;
  pointer-events: none;
  text-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
}

.mini-board-board-winner.winner-x {
  color: var(--game-x);
}

.mini-board-board-winner.winner-o {
  color: var(--game-o);
}

.mini-board-board-winner.winner-draw {
  background: linear-gradient(90deg, var(--game-x) 0%, var(--game-x) 50%, var(--game-o) 50%, var(--game-o) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 20px hsla(165, 100%, 50%, 0.8)) drop-shadow(0 0 20px hsla(340, 100%, 60%, 0.8));
  font-size: 3rem;
  letter-spacing: -0.2em;
}

.mini-board:hover {
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.35);
}

.mini-board.is-active {
  border-color: hsla(165, 100%, 50%, 0.55);
  box-shadow: 0 0 0 1px hsla(165, 100%, 50%, 0.12), 0 0 30px hsla(165, 100%, 50%, 0.15);
}

.mini-board.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(520px 220px at 25% 15%, hsla(165, 100%, 50%, 0.16), transparent 50%);
  pointer-events: none;
}

/* Mini-tabuleiro vencido ou empatado - mostra símbolo grande usando ::after */
.mini-board.board-won-x::after,
.mini-board.board-won-o::after,
.mini-board.board-draw::after {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  z-index: 15;
  pointer-events: none;
  font-family: 'Outfit', sans-serif;
}

.mini-board.board-won-x::after {
  content: 'X';
  color: var(--game-x);
  text-shadow: 0 0 30px hsla(165, 100%, 50%, 0.8), 0 0 60px hsla(165, 100%, 50%, 0.5);
}

.mini-board.board-won-o::after {
  content: 'O';
  color: var(--game-o);
  text-shadow: 0 0 30px hsla(340, 100%, 60%, 0.8), 0 0 60px hsla(340, 100%, 60%, 0.5);
}

.mini-board.board-draw::before,
.mini-board.board-draw::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-family: 'Outfit', sans-serif;
  z-index: 15;
}

/* Bolinha (fundo) */
.mini-board.board-draw::before {
  content: 'O';
  color: var(--game-o);
  text-shadow: 0 0 24px hsla(340, 100%, 60%, 0.7), 0 0 48px hsla(340, 100%, 60%, 0.4);
  font-size: 3.8rem;
  letter-spacing: 0;
}

/* X por cima da bolinha */
.mini-board.board-draw::after {
  content: 'X';
  color: var(--game-x);
  text-shadow: 0 0 24px hsla(165, 100%, 50%, 0.8), 0 0 48px hsla(165, 100%, 50%, 0.5);
  font-size: 3.2rem;
  transform: translateX(-0.1rem); /* ajuste fino para centralizar */
}

.mini-cell {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
  position: relative;
  z-index: 1;
}

.mini-cell:hover {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
  transform: scale(1.03);
}

.mini-cell:active {
  transform: scale(0.98);
}

.mini-cell:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.mini-cell.cell-x,
.mini-cell.cell-o {
  font-size: 2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.mini-cell.cell-x {
  color: var(--game-x);
  text-shadow: 0 0 15px hsla(165, 100%, 50%, 0.8), 0 0 30px hsla(165, 100%, 50%, 0.5);
}

.mini-cell.cell-o {
  color: var(--game-o);
  text-shadow: 0 0 15px hsla(340, 100%, 60%, 0.8), 0 0 30px hsla(340, 100%, 60%, 0.5);
}

.mini-cell:disabled {
  cursor: not-allowed;
  opacity: 0.9;
}

.mini-cell:disabled:not(.cell-x):not(.cell-o) {
  opacity: 0.5;
}

@media (max-width: 720px) {
  .board-container {
    gap: 0.6rem;
    padding: 0.6rem;
  }

  .player-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 0.7rem;
  }

  .player-bar-right {
    display: flex;
    justify-content: flex-start;
  }

  .player-avatar {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.95rem;
  }

  .player-sub {
    font-size: 0.75rem;
  }

  .turn-badge {
    font-size: 0.7rem;
  }

  .ultimate-board {
    width: min(92vw, 640px);
    height: min(92vw, 640px);
    padding: 0.75rem;
    gap: 0.75rem;
    border-radius: 1.25rem;
  }

  .mini-board {
    padding: 0.45rem;
    border-radius: 1rem;
  }

  .mini-cell {
    border-radius: 0.5rem;
  }

  .mini-cell.cell-x,
  .mini-cell.cell-o {
    font-size: 1.4rem;
  }

  .mini-board-board-winner {
    font-size: 3rem;
  }

  .mini-board-board-winner.winner-draw {
    font-size: 2.5rem;
  }
}

@media (max-width: 540px) {
  .board-page {
    align-items: flex-start;
  }

  .board-container {
    max-width: 100%;
    padding: 0.25rem 0;
    gap: 0.2rem;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  .board-topbar {
    padding: 0 0.5rem;
    margin-bottom: 0.2rem;
  }

  .board-topbar .btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .player-bar {
    padding: 0.35rem 0.4rem;
    gap: 0.4rem;
    margin: 0 0.5rem;
  }

  .player-avatar {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.7rem;
  }

  .player-name {
    font-size: 0.7rem;
  }

  .player-sub {
    font-size: 0.6rem;
  }

  .turn-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.35rem;
  }

  .board-stage {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    flex: 1;
    overflow: hidden;
  }

  .ultimate-board {
    width: 200vw;
    height: 100vh;
    max-height: 120%;
    padding: 0.3rem;
    gap: 0.3rem;
    border-radius: 0;
    margin: 0;
  }

  .mini-board {
    padding: 0.3rem;
    gap: 0.12rem;
  }

  .mini-cell {
    border-radius: 0.35rem;
  }

  .mini-cell.cell-x,
  .mini-cell.cell-o {
    font-size: 1.15rem;
  }

  .mini-board.board-won-x::after,
  .mini-board.board-won-o::after,
  .mini-board.board-draw::after {
    font-size: 2.8rem;
  }
}

@media (max-height: 700px) {
  .board-container {
    padding: 0.65rem;
    gap: 0.55rem;
  }

  .player-bar {
    padding: 0.7rem 0.8rem;
  }

  .player-avatar {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  .ultimate-board {
    width: min(640px, 100vmin);
    height: min(640px, 100vmin);
    padding: 0.75rem;
    gap: 0.75rem;
  }
}

/* ============================================
   Modais de Partida
   ============================================ */

.match-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.match-modal-overlay.hidden {
  display: none;
}

.match-modal-container {
  width: 100%;
  max-width: 500px;
  border-radius: 1.5rem;
  padding: 2rem;
  background: rgba(17, 19, 23, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: scaleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
}

.match-modal-players {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.match-modal-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.match-modal-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, hsla(165, 100%, 50%, 0.9), rgba(10, 12, 18, 0.95) 65%);
  border: 3px solid hsla(165, 100%, 50%, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 900;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 30px hsla(165, 100%, 50%, 0.5);
}

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

.match-modal-player-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.match-modal-player-rating {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  font-family: 'Space Mono', monospace;
}

.match-modal-vs {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.7;
}

.match-modal-status {
  font-size: 1.1rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.match-modal-countdown,
#match-modal-custom-countdown {
  font-size: 4rem;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 30px hsla(165, 100%, 50%, 0.8);
  margin: 1.5rem 0;
  animation: pulse 1s ease-in-out;
  font-family: 'Space Mono', monospace;
  text-align: center;
  display: block;
}

.match-modal-link-container {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(10, 14, 22, 0.8);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.match-modal-link-label {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
  display: block;
}

.match-modal-link-input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: var(--foreground);
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  text-align: center;
}

.match-modal-link-copy {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.match-modal-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.match-modal-actions .btn {
  min-width: 140px;
}

.match-modal-actions-column {
  flex-direction: column;
  gap: 1rem;
}

.match-modal-actions-column .btn {
  width: 100%;
  min-width: auto;
  display: block;
}

.match-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.match-modal-message {
  font-size: 1rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
  text-align: center;
  line-height: 1.6;
}

.match-modal-code-input-container {
  margin-bottom: 1.5rem;
}

.match-modal-code-input {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
}

@media (max-width: 640px) {
  .match-modal-container {
    padding: 1.5rem;
  }

  .match-modal-players {
    gap: 1rem;
  }

  .match-modal-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  .match-modal-countdown {
    font-size: 3rem;
  }

  .match-modal-actions {
    flex-direction: column;
  }

  .match-modal-actions .btn {
    width: 100%;
  }
}

/* ============================================
   Modais do Jogo (Tabuleiro)
   ============================================ */

.game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.game-modal-overlay.hidden {
  display: none;
}

.game-modal-container {
  width: 100%;
  max-width: 450px;
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  background: rgba(17, 19, 23, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9);
  animation: scaleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: center;
}

.game-modal-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.game-modal-icon svg {
  width: 48px;
  height: 48px;
}

.game-modal-icon-error {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
}

.game-modal-icon-warning {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.1);
}

.game-modal-icon-success {
  color: var(--game-x);
  border-color: hsla(165, 100%, 50%, 0.5);
  background: rgba(0, 255, 170, 0.1);
}

.game-modal-icon-loss {
  color: var(--game-o);
  border-color: hsla(340, 100%, 60%, 0.5);
  background: rgba(255, 64, 129, 0.1);
}

.game-modal-icon-draw {
  color: var(--muted-foreground);
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.1);
}

.game-modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.game-modal-message {
  font-size: 1rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.game-modal-rating-change {
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(10, 14, 22, 0.8);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-modal-rating-label {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  display: block;
  margin-bottom: 0.5rem;
}

.game-modal-rating-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
  display: block;
}

.game-modal-rating-value.positive {
  color: var(--game-x);
}

.game-modal-rating-value.negative {
  color: var(--game-o);
}

.game-modal-rating-value.neutral {
  color: var(--muted-foreground);
}

.game-modal-actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.game-modal-actions .btn {
  min-width: 140px;
}

@media (max-width: 640px) {
  .game-modal-container {
    padding: 2rem 1.5rem;
    max-width: 90vw;
  }

  .game-modal-icon {
    width: 64px;
    height: 64px;
  }

  .game-modal-icon svg {
    width: 36px;
    height: 36px;
  }

  .game-modal-title {
    font-size: 1.5rem;
  }

  .game-modal-message {
    font-size: 0.95rem;
  }

  .game-modal-actions {
    flex-direction: column;
  }

  .game-modal-actions .btn {
    width: 100%;
  }
}

