/* Solo en modo VS (crear sala / vs CPU), no en el inicio normal */
body.vs-focus-mode #pane-torneos,
body.vs-focus-mode #pane-ranking,
body.vs-focus-mode #pane-stats,
body.vs-focus-mode .lobby-tabs,
body.vs-focus-mode #online-card,
body.vs-focus-mode #top-ranking-home,
body.vs-focus-mode #pane-salas > .lobby-grid,
body.vs-focus-mode #pane-salas > .online-card,
body.vs-focus-mode #global-chat-card {
  display: none !important;
}

body.vs-focus-mode #pane-salas,
body.vs-focus-mode #pane-salas.lobby-pane,
body.vs-focus-mode #pane-salas.lobby-pane.active {
  display: block !important;
  visibility: visible !important;
}

body.vs-focus-mode #seccion-crear.create-room-card,
body.vs-focus-mode #seccion-vs-cpu.lobby-card {
  opacity: 1 !important;
  max-height: none !important;
  overflow: visible !important;
  margin-top: 12px !important;
}

body.vs-focus-mode .vs-focus-toolbar { display: flex !important; }
body.vs-focus-mode .vs-active-games { display: block !important; }

body.vs-focus-mode #seccion-crear:not([hidden]),
body.vs-focus-mode #seccion-vs-cpu:not([hidden]) {
  display: block !important;
  visibility: visible !important;
}

body.vs-focus-mode #seccion-crear[hidden],
body.vs-focus-mode #seccion-vs-cpu[hidden] {
  display: none !important;
}

/* Guest CTA and auth buttons */
.guest-auth-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.guest-auth-actions .juego-btn {
  padding: 8px 14px;
  font-size: .88rem;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
}
.guest-auth-actions .top-login-btn {
  background: transparent;
  border: 1px solid var(--line, #d8dee8);
  color: var(--ink, #172033);
}
.guest-auth-actions .top-login-btn:hover {
  background: var(--surface-2, #f8fafc);
}
.guest-auth-actions .top-register-btn {
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.guest-cta-card {
  background: linear-gradient(135deg, rgba(15, 118, 110, .08), rgba(15, 118, 110, .02));
  border: 1px solid rgba(15, 118, 110, .22);
}
.guest-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px;
}
.guest-cta-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.guest-cta-actions .juego-btn {
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .guest-cta-inner { flex-direction: column; align-items: stretch; }
  .guest-cta-actions { width: 100%; }
  .guest-cta-actions .juego-btn { flex: 1; text-align: center; justify-content: center; }
}

/* Auth modal */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.auth-modal-overlay.is-open { display: flex; }
body.auth-modal-open { overflow: hidden; }

.auth-modal {
  position: relative;
  width: min(420px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: var(--surface, #fff);
  color: var(--ink, #172033);
  border-radius: 18px;
  border: 1px solid var(--line, #e2e8f0);
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  padding: 22px 22px 20px;
  animation: authModalIn .18s ease;
}
@keyframes authModalIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  background: var(--surface-2, #f8fafc);
  color: var(--ink, #172033);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}
.auth-modal-close:hover { background: var(--line, #e2e8f0); }

.auth-modal .auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin: 0 28px 16px 0;
  background: var(--surface-2, #f1f5f9);
  border-radius: 12px;
  border: 1px solid var(--line, #e2e8f0);
}
.auth-modal .auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 9px;
  font: inherit;
  font-weight: 700;
  font-size: .9rem;
  color: var(--muted, #64748b);
  cursor: pointer;
}
.auth-modal .auth-tab.active {
  background: var(--surface, #fff);
  color: var(--ink, #172033);
  box-shadow: 0 1px 4px rgba(15,23,42,.08);
}
.auth-modal .auth-tab-panel h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}
.auth-modal .auth-tab-panel .sub {
  margin: 0 0 16px;
  color: var(--muted, #64748b);
  font-size: .9rem;
  line-height: 1.45;
}
.auth-modal .form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-modal .form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .86rem;
  font-weight: 650;
}
.auth-modal .form input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  background: var(--surface, #fff);
  color: var(--ink, #172033);
  font: inherit;
}
.auth-modal .form input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .15);
}
.auth-modal .btn.primary {
  margin-top: 4px;
  padding: 11px 14px;
  border-radius: 11px;
  border: 0;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.auth-modal .btn.primary:hover { filter: brightness(1.06); }
.auth-modal-msg { margin: 0 0 12px; }
.auth-modal .errores {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .88rem;
}
.auth-modal .ok-msg {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .88rem;
}
.auth-modal .verify-box { margin-top: 8px; word-break: break-all; font-size: .82rem; }

.guest-auth-actions .juego-btn,
.guest-auth-actions button.juego-btn {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font: inherit;
}

@media (max-width: 480px) {
  .auth-modal { padding: 18px 16px 16px; border-radius: 16px; }
}

button.mobile-nav-link {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

/* ========== Guest Landing (página de inicio mejorada) ========== */
.guest-landing {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 0 40px;
}
.guest-hero {
  text-align: center;
  padding: 36px 24px 28px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, .18), transparent 70%),
    linear-gradient(180deg, var(--surface, #fff) 0%, var(--surface-2, #f8fafc) 100%);
  border: 1px solid var(--line, #e2e8f0);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .06);
  margin-bottom: 28px;
}
html[data-theme="dark"] .guest-hero {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99, 102, 241, .25), transparent 70%),
    linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-color: #334155;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.guest-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
}
.guest-hero-badge .ico,
.guest-crown {
  filter: brightness(0) invert(1);
}
.guest-hero-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
html[data-theme="dark"] .guest-hero-title {
  background: linear-gradient(135deg, #a5b4fc, #c4b5fd 50%, #e9d5ff);
  -webkit-background-clip: text;
  background-clip: text;
}
.guest-hero-lead {
  font-size: 1.15rem;
  color: var(--ink, #172033);
  margin: 0 0 6px;
  font-weight: 500;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.guest-hero-sub {
  font-size: .95rem;
  color: var(--muted, #64748b);
  margin: 0 0 22px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.guest-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.guest-hero-actions .juego-btn {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 140px;
}
.guest-hero-actions .juego-btn.primary {
  box-shadow: 0 4px 14px rgba(79, 70, 229, .35);
}

.guest-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (min-width: 800px) {
  .guest-features { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 520px) {
  .guest-features { grid-template-columns: 1fr; }
}
.guest-feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 18px;
  border-radius: 18px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e2e8f0);
  text-decoration: none;
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  cursor: pointer;
  min-height: 160px;
}
.guest-feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
  border-color: rgba(99, 102, 241, .35);
}
html[data-theme="dark"] .guest-feature-card {
  background: #1e293b;
  border-color: #334155;
}
html[data-theme="dark"] .guest-feature-card:hover {
  border-color: rgba(129, 140, 248, .45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}
.guest-feature-ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(139, 92, 246, .08));
  margin-bottom: 12px;
  color: #6366f1;
}
html[data-theme="dark"] .guest-feature-ico {
  background: linear-gradient(135deg, rgba(99, 102, 241, .25), rgba(139, 92, 246, .15));
  color: #a5b4fc;
}
.guest-feature-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
}
.guest-feature-card p {
  margin: 0 0 12px;
  font-size: .88rem;
  color: var(--muted, #64748b);
  line-height: 1.45;
  flex: 1;
}
.guest-feature-cta {
  font-size: .85rem;
  font-weight: 700;
  color: #6366f1;
}
html[data-theme="dark"] .guest-feature-cta { color: #a5b4fc; }

.guest-live-teaser {
  margin-top: 8px;
}
.guest-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.guest-live-head h2 {
  margin: 0;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guest-live-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guest-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
}
html[data-theme="dark"] .guest-live-row {
  background: #0f172a;
  border-color: #334155;
}
.guest-live-players {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: .95rem;
}
.guest-live-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.guest-live-meta .juego-btn {
  padding: 6px 12px;
  font-size: .85rem;
  border-radius: 999px;
}
.guest-live-hint {
  margin: 12px 0 0;
  text-align: center;
}

@media (max-width: 600px) {
  .guest-hero { padding: 28px 16px 22px; }
  .guest-hero-actions .juego-btn { flex: 1; min-width: 0; }
  .guest-live-row { flex-direction: column; align-items: flex-start; }
  .guest-live-meta { width: 100%; justify-content: flex-end; }
}
