/* Estilos de la cabecera y los avisos compartidos (antes se inyectaban desde JS).
   Van en un fichero propio para que la CSP pueda prohibir estilos en línea. */

/* ── Barra de juegos (shared/nav.js) ── */
#game-header {
  position: relative; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-body);
}

#game-brand-link {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
#game-brand-link::before {
  content: ''; display: inline-block;
  width: 9px; height: 9px; margin-right: 10px;
  background: var(--gold); transform: rotate(45deg);
}
#game-brand-link:hover { color: var(--gold); }

#game-nav-icons { display: flex; align-items: center; gap: 2px; flex: 1; }

.gnav-icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 6px;
  color: var(--dim); text-decoration: none; cursor: pointer;
  position: relative; transition: color 0.15s, background 0.15s;
}
.gnav-icon-btn:hover { color: var(--text); background: var(--surface2); }
.gnav-icon-btn.gnav-current { color: var(--text); background: var(--surface2); }
.gnav-icon-btn.gnav-current::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: 2px;
  height: 2px; background: var(--gold);
}
.gnav-svg { display: block; }

#game-topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
#game-topbar-right #lang-switcher { position: static !important; }

@media (max-width: 560px) {
  #game-header { flex-wrap: wrap; gap: 8px 8px; padding: 12px 12px; }
  #game-brand-link { font-size: 1.05rem; letter-spacing: 0.1em; }
  #game-nav-icons { order: 3; flex-basis: 100%; justify-content: space-between; }
  .gnav-icon-btn { width: 44px; height: 44px; }
  #game-topbar-right { gap: 2px; }
}

/* ── Cookie reopener ── */
#ck-reopener { bottom: 16px !important; left: 16px !important; }

/* ── Selector de idioma (shared/lang.js) ── */
#lang-switcher {
  display: flex; font-family: var(--font-body);
  background: var(--surface); border: 1px solid var(--border);
}
.lang-option {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 9px; cursor: pointer;
  background: none; border: none; color: var(--dim);
  font-family: var(--font-body);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
  transition: background 0.15s, color 0.15s;
}
.lang-option + .lang-option { border-left: 1px solid var(--border); }
.lang-option img { opacity: 0.45; transition: opacity 0.15s; }
.lang-option:hover { color: var(--text); }
.lang-option:hover img { opacity: 0.8; }
.lang-option.active { color: var(--gold); background: rgb(var(--gold-rgb) / 0.1); cursor: default; }
.lang-option.active img { opacity: 1; }
/* Móvil: solo banderas, para no pisar el título de la cabecera */
@media (max-width: 480px) {
  .lang-option { padding: 6px 7px; }
  .lang-code { display: none; }
}

/* ── Cuenta (shared/account.js) ── */
.acc-btn { padding: 0; font: inherit; overflow: hidden; }
.acc-btn.acc-signed { border-color: transparent; }
.acc-avatar { width: 26px; height: 26px; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--gold-dark); }

#acc-overlay {
  position: fixed; inset: 0; z-index: 9995;
  background: rgb(var(--bg-rgb) / 0.88);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
}
.acc-card {
  position: relative; width: 92%; max-width: 420px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6); padding: 32px 24px 20px;
  color: var(--text);
}
.acc-close {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 6px;
  background: none; border: none; color: var(--dim); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.acc-close:hover { color: var(--text); background: var(--surface2); }
.acc-title {
  font-family: var(--font-display); color: var(--text); font-size: 1.9rem; font-weight: 700;
  text-transform: uppercase; line-height: 1; text-align: center; margin: 0 0 18px;
}
.acc-info { font-size: 0.85rem; line-height: 1.45; color: var(--dim); margin: 0 0 14px; text-align: center; }
.acc-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 48px; margin-bottom: 18px; cursor: pointer;
  background: #fff; color: #1f1f1f; border: none; border-radius: 6px;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 700;
}
.acc-google:hover { background: #f0f0f0; }
.acc-user { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.acc-user-avatar { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gold-dark); }
.acc-name { font-weight: 700; color: var(--text); }
.acc-email { font-size: 0.8rem; color: var(--dim); }
.acc-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.acc-tab {
  flex: 1; padding: 8px 4px; cursor: pointer; background: transparent; border-radius: 6px;
  border: 1px solid var(--border); color: var(--dim);
  font-family: var(--font-display); font-size: 0.9rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.acc-tab.active, .acc-tab:hover { border-color: var(--gold); color: var(--gold); }
.acc-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin-bottom: 14px; }
.acc-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--text); }
.acc-label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.acc-dist-title { margin-bottom: 6px; }
.acc-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 0.8rem; }
.acc-bar-row > span { width: 18px; text-align: right; color: var(--dim); }
.acc-bar {
  background: var(--border); color: var(--text); text-align: right; padding: 1px 6px; border-radius: 3px;
  font-size: 0.75rem; font-weight: 700; min-width: 18px;
}
.acc-empty { text-align: center; color: var(--dim); font-size: 0.85rem; margin: 18px 0; }
.acc-footer {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 14px;
  margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border);
}
.acc-link {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: var(--font-body); font-size: 0.78rem; color: var(--dim); text-decoration: underline;
}
.acc-link:hover { color: var(--gold); }
.acc-delete:hover { color: var(--danger); }

/* ── Aviso de almacenamiento (shared/js/notice.js) ── */
#storage-notice{position:fixed;left:0;right:0;bottom:0;z-index:9990;box-sizing:border-box;
  background:var(--surface);border-top:1px solid var(--border);
  padding:12px 16px;font-family:var(--font-body)}
#storage-notice .sn-wrap{max-width:960px;margin:0 auto;display:flex;align-items:center;gap:12px 16px;flex-wrap:wrap}
#storage-notice p{flex:1;min-width:220px;margin:0;font-size:.85rem;line-height:1.45;color:var(--text-dim)}
#storage-notice a{color:var(--gold);text-decoration:underline;white-space:nowrap}
#storage-notice button{font:700 1rem var(--font-display);letter-spacing:.12em;text-transform:uppercase;
  height:44px;padding:0 24px;border:1px solid var(--gold);background:var(--gold);color:var(--bg);border-radius:6px;cursor:pointer}
#storage-notice button:hover{background:var(--text);border-color:var(--text)}
#storage-notice button:focus-visible,#storage-notice a:focus-visible{outline:2px solid var(--text);outline-offset:2px}
@media (prefers-reduced-motion:no-preference){#storage-notice{animation:sn-fade .25s ease both}}
@keyframes sn-fade{from{opacity:0}to{opacity:1}}

/* ── Piezas que antes llevaban style="" desde el JS ── */
.ac-hit { color: var(--gold); }
.load-error { padding: 2rem; text-align: center; color: var(--gold); font-family: var(--font-body); }

/* ── Botón de tema claro/oscuro (shared/js/theme.js) ── */
.theme-toggle { background: transparent; border: 0; padding: 0; cursor: pointer; }
.topbar { gap: 4px; }
.topbar #lang-switcher { margin-left: 8px; }

/* ── Fondo con profundidad ──
   Dos luces suaves (dorado arriba, turquesa abajo a la derecha) y una trama de puntos muy tenue sobre el
   color base. Todo sale de los tokens, así que el tema claro y el oscuro lo adaptan solos. Esta hoja carga
   después de la de cada juego; las que la siguen (legal, instrucciones) no deben reponer `background:`. */
body {
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -12%, rgb(var(--gold-rgb) / .10), transparent 62%),
    radial-gradient(ellipse 70% 50% at 100% 105%, rgb(var(--teal-rgb) / .08), transparent 60%),
    radial-gradient(rgb(var(--text-rgb) / .04) 1px, transparent 1.4px);
  background-size: auto, auto, 26px 26px;
  background-repeat: no-repeat, no-repeat, repeat;
  background-attachment: fixed, fixed, scroll;
}

/* ── Logos de equipo y fotos de jugador (shared/js/media.js) ── */
.team-logo { width: var(--logo, 24px); height: var(--logo, 24px); object-fit: contain; flex: none; vertical-align: middle; }
.team-logo-sm { --logo: 20px; }
.team-logo-lg { --logo: 36px; }
.team-logo-xl { --logo: 64px; }
.player-photo {
  width: var(--photo, 48px); height: var(--photo, 48px); flex: none;
  border-radius: 50%; object-fit: cover; object-position: top center;
  background: var(--surface2); border: 1px solid var(--border);
}
.player-photo-sm { --photo: 36px; }
.player-photo-lg { --photo: 64px; }

/* Iconos propios (shared/icons.svg) */
.icon { display: inline-block; flex: none; vertical-align: middle; }
