/* ═══════════════════════════════════════════════════════════
   URBANDLE — Sistema de diseño compartido
   Inspirado en futbol-11.com
═══════════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:         #0d0d12;
  --surface:    #16161f;
  --surface-2:  #1e1e2a;
  --surface-3:  #262634;
  --border:     rgba(255,255,255,0.07);
  --border-hi:  rgba(41,120,181,0.55);
  --accent:     #2978b5;
  --accent-h:   #3d9ae8;
  --green:      #22c55e;
  --yellow:     #eab308;
  --red:        #ef4444;
  --text:       #eef0f4;
  --muted:      #7c8390;
  --dim:        #3e4150;
  --r-xs:       6px;
  --r:          10px;
  --r-lg:       16px;
  --r-xl:       22px;
  --shadow:     0 4px 24px rgba(0,0,0,0.55);
  --shadow-a:   0 4px 28px rgba(41,120,181,0.22);
  --t:          0.18s ease;
  --font:       'Poppins', sans-serif;
  --font-d:     'Bebas Neue', sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

/* ═══════════════════ HEADER ════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 58px;
  background: rgba(13,13,18,0.93);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logo */
.site-logo {
  font-family: var(--font-d);
  font-size: 30px;
  letter-spacing: 1px;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 1;
}
.logo-u { color: #fff; }
.logo-d { color: var(--accent); }

/* Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 4px;
}
.site-nav::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--r);
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--t);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--accent); background: rgba(41,120,181,0.13); }
.nav-link .nav-emoji { font-size: 14px; }

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-social { display: flex; align-items: center; gap: 6px; }
.header-social a {
  display: flex;
  align-items: center;
  color: var(--muted);
  opacity: 0.7;
  transition: opacity var(--t), color var(--t);
}
.header-social a:hover { opacity: 1; color: var(--text); }

/* Info button */
.btn-info {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
}
.btn-info:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Hamburger */
.btn-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px; height: 16px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.btn-menu span {
  display: block; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--t);
}
.btn-menu.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.btn-menu.open span:nth-child(2) { opacity: 0; }
.btn-menu.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav dropdown */
.mobile-nav {
  display: none;
  position: fixed;
  top: 58px;
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px 12px;
  z-index: 899;
  max-height: calc(100vh - 58px);
  overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--r);
  transition: var(--t);
}
.mobile-nav a:hover { background: var(--surface-2); }

/* ═════════════════ GAME INFO MODAL ══════════════════════════ */

.game-info {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 9500;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.game-info.visible { display: flex; }

.info-content {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-xl);
  padding: 28px 28px 24px;
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-a);
  position: relative;
  animation: fadeUp 0.22s ease;
}
.info-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}
.info-content p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.close-btn {
  position: absolute;
  top: 14px; right: 14px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--t);
  border: none;
  font-family: var(--font);
}
.close-btn:hover { background: var(--red); color: #fff; }

/* ══════════════════ END GAME MODAL ══════════════════════════ */

.overlay-juegos {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9400;
  padding: 16px;
}

.ventana-juegos {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--r-xl);
  padding: 28px 24px 24px;
  width: min(540px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: var(--shadow-a);
  animation: fadeUp 0.25s ease;
}
.ventana-juegos h2 {
  font-family: var(--font-d);
  font-size: 26px;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.ventana-juegos > p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}

.botones-juegos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.juego-btn {
  display: block;
  padding: 11px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: var(--t);
}
.juego-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.cerrar-juegos {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 9px 20px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: var(--t);
}
.cerrar-juegos:hover { background: var(--surface-2); color: var(--text); }

/* ════════════════════ RACHA ════════════════════════════════ */

#racha-marcador {
  text-align: center;
  margin: 14px 0 4px;
}
.mensaje-racha {
  display: block;
  color: #f59e0b;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  animation: fadeUp 0.3s ease;
}
#racha-contador-wrap {
  font-size: 13px;
  color: var(--muted);
}
#racha-contador-wrap strong {
  color: var(--text);
  font-size: 15px;
}

/* ════════════════════ SHARED INPUT ═════════════════════════ */

.search-input {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-family: var(--font);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-input::placeholder { color: var(--dim); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(41,120,181,0.13);
}
.search-input:disabled { opacity: 0.4; cursor: not-allowed; }

/* ════════════════════ BUTTONS ══════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--t);
  border: none;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost    { background: transparent; border: 1.5px solid var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ════════════════════ ADVERT SLOTS ════════════════════════ */

.anuncio-inferior {
  max-width: 728px;
  margin: 40px auto 0;
  text-align: center;
}
.anuncio-lateral {
  position: fixed;
  top: 130px;
  width: 160px;
  height: calc(100vh - 180px);
  max-height: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--dim);
  text-align: center;
}
.anuncio-izquierdo { left: 10px; }
.anuncio-derecho   { right: 10px; }
@media (max-width: 1340px) { .anuncio-lateral { display: none; } }

/* ════════════════════ ANIMATIONS ═══════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}
@keyframes pop {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}
@keyframes brillar {
  from { box-shadow: 0 0 8px #36ee61aa; }
  to   { box-shadow: 0 0 16px #36ee61cc; }
}

/* ════════════════════ RESPONSIVE ═══════════════════════════ */

@media (max-width: 768px) {
  .site-nav  { display: none; }
  .btn-menu  { display: flex; }
}
