@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-deep: #0c0d11;
  --bg-panel: #14151b;
  --bg-panel-raised: #1c1d25;
  --line: #2b2d38;
  --gold: #c9a24b;
  --gold-light: #e8cf8a;
  --blue-accent: #d98a3d;
  --blue-glow: rgba(217, 138, 61, 0.35);
  --text: #eceef2;
  --text-dim: #8b8d99;
  --text-dark: #14151b;
  --danger: #d1544a;
  --success: #4fae72;
  --info: #4c7a9e;
  --vip-purple: #8a63a3;
  --bone-white: #f2ecdd;
  --hero-header-height: 210px;
  --header-stack-height: 282px;
}

@media (max-width: 640px) {
  :root {
    --hero-header-height: 150px;
    --header-stack-height: 222px;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(217,138,61,0.07), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(201,162,75,0.06), transparent 35%);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--blue-accent); text-decoration: none; }
a:hover { color: var(--gold-light); }

.site-hero-header {
  min-height: 210px;
  background-size: cover;
  background-position: center 15%;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.7rem;
  position: relative;
  z-index: 22;
}
.hero-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.5rem 1.4rem;
  border: 2px solid var(--gold);
  border-radius: 4px;
  background: rgba(12, 13, 17, 0.4);
  backdrop-filter: blur(3px);
  box-shadow:
    inset 0 0 0 3px rgba(6, 7, 10, 0.55),
    inset 0 0 0 4px rgba(201, 162, 75, 0.45),
    0 0 18px rgba(0, 0, 0, 0.35);
}
.hero-nav a {
  color: var(--gold-light);
  text-decoration: none;
  font-family: 'Cinzel', 'Georgia', serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  transition: color 0.15s ease;
}
.hero-nav a:hover { color: var(--gold); }
.hero-nav-sep { color: rgba(201,162,75,0.5); font-size: 0.55rem; }

@media (max-width: 640px) {
  .site-hero-header { min-height: 150px; padding-top: 0.6rem; }
  .hero-nav { gap: 0.4rem 0.5rem; padding: 0.4rem 0.9rem; }
  .hero-nav a { font-size: 0.68rem; }
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 1.5rem 0 0;
  background: linear-gradient(180deg, #15161d 0%, #0c0d11 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(217,138,61,0.12);
  position: sticky;
  top: 0;
  z-index: 23;
}

.brand-logo { height: 44px; }

.countdown-bar {
  position: sticky;
  top: 72px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(180deg, #1c1508 0%, #120d05 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(217,138,61,0.12);
}
.countdown-text {
  color: var(--gold-light);
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
}
.countdown-clock { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.countdown-unit {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  background: var(--bg-panel);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
}
.countdown-value { color: var(--gold); font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.countdown-label { color: var(--text-dim); font-size: 0.7rem; text-transform: uppercase; }

@media (max-width: 640px) {
  .countdown-bar { top: 0; }
}
.countdown-bar-entrance { position: sticky; top: 0; z-index: 21; }

.inline-form { display: inline; }
/* Ventana emergente centrada en vez de una fila inline: una fila inline con
   texto + dos botones se salía de la pantalla en columnas estrechas. */
.confirm-borrar-form {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: min(90vw, 380px);
  padding: 1.25rem 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}
.confirm-borrar-form:not([hidden]) { display: flex; }
.confirm-borrar-form::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(6, 7, 10, 0.72);
}
.confirm-borrar-text { font-size: 0.85rem; color: var(--danger); font-weight: 600; }

/* margin-left:auto además de justify-content:space-between en .site-header:
   en PC el botón ☰ está oculto, así que sin esto .header-actions sería el
   único hijo visible y space-between lo dejaría pegado a la izquierda. */
.header-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.header-text-link {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.header-text-link:hover { color: var(--blue-accent); }

.coins-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
}
img.coin-icon { width: 20px !important; height: 20px !important; object-fit: contain; flex-shrink: 0; }

.avatar-pill {
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.avatar-pill:hover { opacity: 0.85; }
.avatar-pill img { width: 100%; height: 100%; object-fit: contain; }

.avatar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 220px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 30;
}
.avatar-menu.open { display: block; }
.avatar-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.avatar-menu-item:hover { background: var(--bg-panel); }
.avatar-menu-danger { color: var(--danger); }
.avatar-menu form { margin: 0; }

/* --- App shell: left sidebar + main content ---
   Mobile-first: sidebar is an off-canvas drawer by default;
   from 901px up it becomes a permanently docked column. */
main { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; transition: padding 0.2s ease; }

.sidebar-toggle-btn { display: flex; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 17;
}
.sidebar-backdrop.show { display: block; }

.app-sidebar {
  position: fixed;
  top: var(--header-stack-height);
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  z-index: 18;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}
.app-sidebar.open { transform: translateX(0); }

/* Pestaña pegada al borde izquierdo (solo en PC): deja claro que el menú
   se puede abrir, y se desplaza con el panel para cerrarlo desde su borde. */
.sidebar-edge-tab {
  display: none;
  position: fixed;
  top: calc(var(--header-stack-height) + 1rem);
  left: 0;
  z-index: 19;
  width: 28px;
  height: 68px;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--bg-panel);
  border: 1px solid var(--gold);
  border-left: none;
  border-radius: 0 10px 10px 0;
  color: var(--gold-light);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 3px 0 12px rgba(0, 0, 0, 0.45), 0 0 10px rgba(201, 162, 75, 0.25);
  transition: left 0.2s ease, background 0.15s ease;
}
.sidebar-edge-tab:hover { background: var(--bg-deep); color: var(--gold); }
.sidebar-edge-tab .edge-chevron { display: inline-block; transition: transform 0.2s ease; }
.sidebar-edge-tab.open { left: 260px; }
.sidebar-edge-tab.open .edge-chevron { transform: rotate(180deg); }

@media (min-width: 901px) {
  .sidebar-edge-tab { display: flex; }

  /* En PC el menú lateral no se abre "encima" (nada de fondo oscuro ni de
     hamburguesa): se abre y cierra solo con la pestaña del borde, y la
     página deja hueco a la izquierda mientras está abierto, igual que ya
     hacía con el chat a la derecha. */
  /* Especificidad extra (selector de elemento) porque el .icon-btn genérico,
     que va después en la hoja de estilos, también fija su propio display. */
  button.sidebar-toggle-btn { display: none; }
  .sidebar-backdrop { display: none !important; }
  body:has(.app-sidebar.open) main { padding-left: calc(1.5rem + 260px); }

  body:has(.app-sidebar):has(.social-panel.open) main { padding-right: calc(1.5rem + var(--chat-width, 340px)); }
  body:has(.app-sidebar):has(.notif-panel.open) main { padding-right: calc(1.5rem + 320px); }
}
.sidebar-nav, .sidebar-bottom { display: flex; flex-direction: column; gap: 0.25rem; }
.sidebar-nav a[href="/clasificacion"] { margin-top: 0.5rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { background: var(--bg-panel-raised); color: var(--text); }
.sidebar-icon { font-size: 1.05rem; width: 1.4rem; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-icon-img { width: 1.2rem; height: 1.2rem; object-fit: contain; border-radius: 3px; }
.inline-icon-img { width: 1.1em; height: 1.1em; object-fit: contain; vertical-align: -0.2em; border-radius: 3px; }
.sidebar-link-btn { margin: 0; }
.sidebar-bottom form { margin: 0; }

.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}
.hero h1 {
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: 0;
}
.hero .subtitle {
  font-size: 1.05rem;
  color: var(--gold);
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.welcome-text, .about-text {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue-accent);
  border-radius: 4px;
  padding: 1.75rem;
  white-space: pre-line;
  margin: 1.5rem 0;
  color: var(--text-dim);
}

.section-heading { text-align: center; margin-top: 3.5rem; }
.section-heading h2 {
  font-family: 'Cinzel', 'Georgia', serif;
  color: var(--text);
  margin-bottom: 0.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 1.4rem;
}
.section-heading p { color: var(--text-dim); margin-top: 0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.filter-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-chip:hover { border-color: var(--blue-accent); color: var(--blue-accent); }
.filter-chip.is-active { background: var(--blue-accent); border-color: var(--blue-accent); color: #06121f; }

/* Filtro primario (modo de juego): más grande y llamativo — es el que manda. */
.filter-bar-primary { margin-top: 1.75rem; gap: 0.75rem; }
.filter-chip-primary {
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-width: 2px;
  border-radius: 4px;
}
.filter-chip-primary.is-active { box-shadow: 0 0 16px var(--blue-glow); }

/* Filtros secundarios (etiquetas): más discretos, prioridad más baja.
   Se espera que este grupo crezca mucho con el tiempo. */
.filter-bar-secondary { margin-top: 0.75rem; }
.filter-chip-secondary {
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem;
  opacity: 0.8;
  border-radius: 4px;
}
.filter-chip-secondary.is-active { opacity: 1; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-pill {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

/* Catálogo: 4 columnas fijas en escritorio; las filas nuevas se añaden
   automáticamente hacia abajo a medida que hay más juegos publicados. */
.catalog-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .catalog-grid { grid-template-columns: 1fr; } }

.sort-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  font-size: 0.8rem;
}
.sort-bar label { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.sort-bar select {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  font-family: inherit;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  clip-path: polygon(0 14px, 14px 0, 100% 0, 100% 100%, 0 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-accent);
  box-shadow: 0 8px 24px var(--blue-glow);
}
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.card-body { padding: 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card-body h3 { margin: 0; color: var(--text); font-weight: 700; }
.card-body p { color: var(--text-dim); font-size: 0.9rem; margin: 0; }
.card-body > :last-child { margin-top: auto; }
.card-author { color: var(--text-dim); font-size: 0.78rem; font-style: italic; margin: 0; }
.card-price { color: var(--gold); font-weight: 700; display: flex; align-items: center; gap: 0.35rem; }

.card-image-zoom { display: flex; align-items: center; justify-content: center; background: var(--bg-deep); height: 160px; overflow: hidden; }
.card-image-zoom .card-image-sm {
  width: 100px;
  height: 100px;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
}
.card-image-zoom.is-emoji-pack { background: var(--bone-white); padding: 0.6rem; }
/* El número de columnas/filas se calcula por icono (ver shop.ejs/profile.ejs)
   para que la cuadrícula siempre llene la caja entera, casi sin margen.
   minmax(0, 1fr) en vez de 1fr: un `1fr` a secas no baja de su contenido
   mínimo, así que con muchos iconos las filas se salían de la caja. */
.pack-emoji-grid {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 4px;
  overflow: hidden;
}
.pack-emoji-grid img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }

.card.is-owned { opacity: 0.55; filter: grayscale(0.8); }
.card.is-owned .btn[disabled] { cursor: not-allowed; background: var(--bg-deep); color: var(--text-dim); box-shadow: none; }

.about-page {
  max-width: 760px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.about-badge {
  width: 220px;
  max-width: 60%;
  height: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 24px rgba(255, 200, 80, 0.35));
}
.about-text { text-align: left; color: var(--text-dim); line-height: 1.7; }
.about-text p { margin: 0 0 1.2rem; }

.blog-tabs-section { max-width: 760px; margin: 0 auto 3rem; padding: 0 1.5rem; }
.blog-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.blog-tab {
  flex: 1;
  min-width: 200px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.blog-tab:hover { border-color: var(--blue-accent); color: var(--blue-accent); }
.blog-tab.is-active { background: var(--blue-accent); border-color: var(--blue-accent); color: #06121f; }

.blog-tab-content { display: none; }
.blog-tab-content.is-active { display: block; }

.blog-post {
  text-align: left;
  color: var(--text-dim);
  line-height: 1.7;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.blog-post:last-child { border-bottom: none; }
.blog-post-highlight { animation: blog-post-flash 2.5s ease; border-radius: 8px; }
@keyframes blog-post-flash {
  0% { background: rgba(201,162,75,0.25); }
  100% { background: transparent; }
}
.blog-post h3 { color: var(--gold); font-family: 'Cinzel', 'Georgia', serif; margin: 0 0 0.3rem; }
.blog-post-date { font-size: 0.75rem; color: var(--text-dim); opacity: 0.7; margin: 0 0 0.8rem; }
.blog-post p { margin: 0 0 1rem; }
.blog-post-cover { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 4px; margin-bottom: 1rem; }
.blog-post-content p { margin: 0 0 1rem; }
.blog-post-content img { max-width: 100%; border-radius: 4px; margin: 0.5rem 0; }
.blog-post-content a { color: var(--blue-accent); }

.blog-post-actions { margin: 0.5rem 0 1rem; }
.blog-like-btn {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.blog-like-btn:disabled { cursor: default; opacity: 0.6; }
.blog-like-btn.is-active { border-color: var(--gold); color: var(--gold); background: rgba(201,162,75,0.12); }

.blog-comments { border-top: 1px dashed var(--line); padding-top: 0.75rem; }
.blog-comments-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.blog-comment { font-size: 0.85rem; background: var(--bg-panel); border-radius: 4px; padding: 0.5rem 0.65rem; }
.blog-comment-author { font-weight: 700; color: var(--blue-accent); margin-right: 0.4rem; }
.blog-comment-text { color: var(--text); }
.blog-comment-form { display: flex; gap: 0.5rem; }
.blog-comment-form input { flex: 1; padding: 0.45rem 0.6rem; border-radius: 4px; border: 1px solid var(--line); background: var(--bg-deep); color: var(--text); font-family: inherit; }

/* --- Sugerencias de los parroquianos (catálogo, antes del footer) ---
   Las tarjetas reutilizan .blog-post/.blog-comment*; solo hacen falta la
   franja de reacciones (like, dislike y emojis en fila) y el contenedor. */
.suggestions-section { max-width: 760px; margin: 3.5rem auto 0; padding: 0 1.5rem 3rem; }
.suggestions-list .blog-post:first-child { padding-top: 0; }
.suggestion-reactions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.suggestion-dislike-btn.is-active { border-color: var(--danger); color: var(--danger); background: rgba(209,84,74,0.12); }
.suggestion-emoji-btn { min-width: 2.6rem; text-align: center; }

.rte-wrap { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.4rem; background: var(--bg-panel); border-bottom: 1px solid var(--line); }
.rte-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
}
.rte-btn:hover { border-color: var(--blue-accent); }
.rte-image-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; padding: 0.5rem; background: var(--bg-panel); border-bottom: 1px solid var(--line); }
.rte-editable {
  min-height: 160px;
  padding: 0.75rem;
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  outline: none;
}
.rte-editable img { max-width: 100%; border-radius: 4px; }

.account-page {
  max-width: 480px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}
.account-page .form-field input[disabled] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-dim);
}
.account-page form { margin-top: 1.5rem; }

.empty-state {
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  padding: 2.5rem;
  border: 1px dashed var(--line);
  border-radius: 4px;
}

.btn {
  display: inline-block;
  background: var(--blue-accent);
  color: #06121f;
  border: none;
  border-radius: 4px;
  padding: 0.65rem 1.4rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: #eab06a; box-shadow: 0 0 16px var(--blue-glow); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c65950; box-shadow: 0 0 16px rgba(168,59,51,0.4); }

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

.auth-page {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-width='0.6' opacity='0.35'%3E%3Ccircle cx='100' cy='100' r='80'/%3E%3Ccircle cx='100' cy='100' r='60'/%3E%3Cpath d='M100 10 L116 84 L190 100 L116 116 L100 190 L84 116 L10 100 L84 84 Z'/%3E%3Cpath d='M100 30 L108 92 L170 100 L108 108 L100 170 L92 108 L30 100 L92 92 Z' stroke-width='0.4'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(circle at 20% 20%, rgba(201,162,75,0.05), transparent 45%);
  background-repeat: no-repeat, no-repeat;
  background-position: right -60px bottom -60px, center;
  background-size: 340px 340px, cover;
}

.auth-card {
  background: var(--bg-panel-raised);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23c9a24b' stroke-width='0.6' opacity='0.18'%3E%3Ccircle cx='100' cy='100' r='80'/%3E%3Cpath d='M100 20 L112 88 L180 100 L112 112 L100 180 L88 112 L20 100 L88 88 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center -20px;
  background-size: 260px 260px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(217,138,61,0.10);
  text-align: center;
}
.auth-card img { height: 48px; margin-bottom: 0.3rem; }
.auth-card .auth-tabs { margin: 0.75rem 0; }
.auth-card .auth-tabs a { padding: 0.4rem; font-size: 0.75rem; }
.auth-card .form-field { margin-bottom: 0.55rem; }
.auth-card .form-field label { font-size: 0.68rem; margin-bottom: 0.2rem; }
.auth-card .form-field input, .auth-card .form-field select { padding: 0.4rem 0.55rem; font-size: 0.85rem; }
.auth-card .date-field-display { padding: 0.4rem 0.1rem 0.4rem 0.55rem; font-size: 0.85rem; }

.date-field-wrap { position: relative; }
.date-field-wrap input[type="date"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}
.date-field-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.2rem 0.6rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}
.date-field-display:hover, .date-field-display:focus { outline: none; border-color: var(--blue-accent); }
.date-field-text.is-placeholder { color: var(--text-dim); }
.date-field-icon { font-size: 1.15rem; line-height: 1; flex-shrink: 0; }

.password-field-wrap { position: relative; }
.password-field-wrap input { width: 100%; padding-right: 2.6rem !important; }
.password-toggle-btn {
  position: absolute;
  right: 0.15rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  border-radius: 50%;
  opacity: 0.75;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.password-toggle-btn img { display: block; width: 28px; height: 28px; object-fit: contain; border-radius: 50%; margin: 0; }
.password-toggle-btn:hover { opacity: 1; background: rgba(255,255,255,0.06); }
.auth-card .error-message, .auth-card .success-message { margin-bottom: 0.6rem; font-size: 0.85rem; }
.auth-card button.btn { padding: 0.55rem; }

.dev-login-box {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}
.dev-login-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 0 0 0.4rem;
}
.dev-login-actions { display: flex; flex-direction: column; gap: 0.35rem; }
.dev-login-actions .btn { padding: 0.4rem; font-size: 0.75rem; }
.dev-login-actions form { margin: 0; }
.dev-login-actions .btn {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--line);
}
.dev-login-actions .btn:hover { border-color: var(--blue-accent); box-shadow: none; }
.dev-login-form { display: flex; flex-direction: column; gap: 0.35rem; }
.dev-login-form input {
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 0.8rem;
}

.error-page {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.error-page-art {
  flex: 1 1 420px;
  max-width: 480px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
.error-page-box {
  flex: 1 1 320px;
  max-width: 420px;
  text-align: center;
  padding: 2rem 1.5rem;
  border: 1px dashed var(--gold);
  border-radius: 6px;
  position: relative;
}
.error-page-box::before,
.error-page-box::after {
  content: '◆';
  display: block;
  color: var(--gold);
  font-size: 0.7rem;
  margin: 0 auto 1rem;
}
.error-page-box::after { margin: 1.5rem auto 0; }
.error-page-text {
  font-family: 'Cinzel', 'Georgia', serif;
  font-style: italic;
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 0;
}
.error-page-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--gold);
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 1.05rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.error-page-link:hover { border-color: var(--gold); }

.error-page-frame { display: none; }

/* Desktop: reproduce the reference image's exact wide banner composition.
   The reference art already contains the box, border and dividers baked in
   (with the two text areas erased) — real i18n text is overlaid on top in
   the exact spot, positioned as % of the image so it scales with it. */
@media (min-width: 900px) {
  .error-page-art,
  .error-page-box {
    display: none;
  }
  .error-page {
    display: block;
    max-width: 1300px;
    padding: 0 1.5rem;
  }
  .error-page-frame {
    display: block;
    position: relative;
    width: 100%;
  }
  .error-page-bg-full {
    display: block;
    width: 100%;
    height: auto;
  }
  .error-page-text-overlay {
    position: absolute;
    left: 56%;
    top: 32%;
    width: 36%;
    height: 14%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Cinzel', 'Georgia', serif;
    font-style: italic;
    color: var(--text);
    font-size: clamp(0.8rem, 1.35vw, 1.2rem);
    line-height: 1.5;
  }
  .error-page-link-overlay {
    position: absolute;
    left: 60%;
    top: 53%;
    width: 28%;
    height: 9%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-family: 'Cinzel', 'Georgia', serif;
    font-size: clamp(0.75rem, 1.05vw, 1rem);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
  }
  .error-page-link-overlay:hover { border-color: var(--gold); }
}

.auth-tabs { display: flex; margin: 1.25rem 0; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.auth-tabs a {
  flex: 1;
  padding: 0.65rem;
  background: var(--bg-panel);
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-tabs a.active { background: var(--blue-accent); color: #06121f; }

.form-field {
  text-align: left;
  margin-bottom: 1rem;
}
.form-field label {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

.error-message { color: var(--danger); font-weight: 600; margin-bottom: 1rem; }
.success-message { color: var(--success); font-weight: 600; margin-bottom: 1rem; }

.site-footer {
  position: relative;
  text-align: center;
  padding: 0.35rem 1.75rem 1.75rem;
  background-color: #0a0b0e;
  background-image:
    linear-gradient(180deg, rgba(6,7,10,0) 40%, rgba(6,7,10,0.75) 78%, rgba(6,7,10,0.95) 100%),
    url('/img/footer-bg.jpg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.85rem;
}
.site-footer p { position: relative; z-index: 1; text-transform: uppercase; letter-spacing: 0.04em; }

.footer-top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}
.footer-brand img { display: block; margin: 0 auto; transform: translateX(-14px); filter: drop-shadow(0 0 10px rgba(201,162,75,0.25)); }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-nav a {
  color: var(--gold-light);
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
  transition: color 0.15s ease;
}
.footer-nav a:hover { color: var(--gold); }
.footer-nav-sep { color: var(--line); font-size: 0.6rem; }
.footer-slogan {
  margin: 0;
  color: var(--gold-light);
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
  font-style: italic;
  font-size: 0.8rem;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}

.footer-social {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.footer-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  font-size: 1.05rem;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.footer-social-icon:hover { border-color: var(--gold); transform: translateY(-2px); }

.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.8rem;
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: normal;
  margin-top: 3.5rem;
}
.footer-copyright { color: var(--text-dim); }
.footer-policy-links a { color: var(--text-dim); text-decoration: none; }
.footer-policy-links a:hover { color: var(--gold); text-decoration: underline; }

.legal-title { color: var(--gold); font-family: 'Cinzel', 'Georgia', serif; margin-top: 0; }
.legal-image-page {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  text-align: center;
  line-height: 0;
}
.legal-image { display: block; width: 100%; height: auto; }

.footer-link-row, .footer-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.footer-link-row input[type="text"], .footer-social-row input[type="text"] { flex: 1; min-width: 160px; }

.wallet-row { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 0.5rem; }
.wallet-chip {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.4rem 0.9rem; font-size: 0.85rem; font-weight: 700; color: var(--gold-light);
}
.wallet-chip img { width: 20px; height: 20px; object-fit: contain; }

.avatar-preview { text-align: center; margin: 1.5rem 0; }
.avatar-preview img { height: 180px; }

.admin-nav { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; min-width: 760px; border-collapse: collapse; margin-top: 1.5rem; }
.admin-table th {
  text-align: left;
  padding: 0.6rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td { border-bottom: 1px solid var(--line); padding: 0.7rem 0.6rem; white-space: nowrap; }
.admin-table td.wrap-cell { white-space: normal; }

.admin-select-mini {
  height: 34px;
  padding: 0 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
}
.admin-select-mini:hover { border-color: var(--blue-accent); }
.icon-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.icon-btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.icon-btn-mini:hover { border-color: var(--blue-accent); background: var(--bg-deep); }
.icon-btn-danger { border-color: var(--danger); }
.icon-btn-danger:hover { background: var(--danger); border-color: var(--danger); }
.icon-btn-mini.is-active { border-color: var(--gold); background: rgba(201,162,75,0.15); }
.icon-btn-mini.is-active:hover { border-color: var(--gold); background: rgba(201,162,75,0.25); }

.games-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.9rem;
  margin-top: 1.5rem;
}
.game-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.game-card[open] { border-color: var(--blue-accent); }
.game-card-summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
}
.game-card-summary::-webkit-details-marker { display: none; }
.game-card-summary-top { display: flex; align-items: center; gap: 0.6rem; }
.game-card-summary-top .game-card-title { flex: 1; }
.game-card-chevron {
  color: var(--gold);
  font-size: 1.3rem;
  line-height: 1;
  font-family: 'Cinzel', 'Georgia', serif;
  text-shadow: 0 1px 4px rgba(0,0,0,0.85);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.game-card[open] .game-card-chevron { transform: rotate(90deg); }
.game-card-title { font-weight: 700; color: var(--text); }
.game-card-thumb-wrap { position: relative; flex-shrink: 0; z-index: 1; }
.game-card-thumb-wrap:hover { z-index: 30; }
.game-card-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  display: block;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  transform-origin: top left;
}
.game-card-thumb-wrap:hover .game-card-thumb {
  transform: scale(5);
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(0,0,0,0.65);
}
.game-card-author { font-size: 0.78rem; color: var(--text-dim); }
.game-card-badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.game-card-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
}
.tag-chip-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.system-log-list { display: flex; flex-direction: column; gap: 0.3rem; max-height: 500px; overflow-y: auto; }
.system-log-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  background: var(--bg-panel);
  font-size: 0.78rem;
}
.system-log-row.system-log-error { border-left: 3px solid var(--danger); background: rgba(209,84,74,0.08); }
.system-log-time { color: var(--text-dim); font-size: 0.7rem; white-space: nowrap; }
.system-log-user { color: var(--blue-accent); font-weight: 700; }
.system-log-message { color: var(--text); word-break: break-word; }

.stat-subsection {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
}
.stat-subsection summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}
.stat-subsection summary::-webkit-details-marker { display: none; }
.stat-subsection summary::marker { content: ''; display: none; }
details.stat-subsection summary::after { content: none; display: none; }
.stat-subsection summary::before { content: '▸ '; color: var(--gold); }
.stat-subsection[open] summary::before { content: '▾ '; }
.stat-subsection .stat-bar-list { margin-top: 0.75rem; }

.stat-bar-list { display: flex; flex-direction: column; gap: 0.45rem; }
.stat-bar-row { display: flex; align-items: center; gap: 0.6rem; }
.stat-bar-label { width: 140px; flex-shrink: 0; font-size: 0.8rem; color: var(--text-dim); text-align: right; }
.stat-bar-track { flex: 1; height: 14px; background: var(--bg-deep); border-radius: 4px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: var(--blue-accent); border-radius: 4px; transition: width 0.3s ease; }
.stat-bar-fill-gold { background: var(--gold); }
.stat-bar-fill-blue { background: var(--blue-accent); }
.stat-bar-fill-green { background: var(--success); }
.stat-bar-value { width: 90px; flex-shrink: 0; font-size: 0.78rem; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .stat-bar-label { width: 90px; font-size: 0.72rem; }
  .stat-bar-value { width: 70px; font-size: 0.72rem; }
}
.tag-chip {
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.ranking-table { max-width: 700px; margin: 1.75rem auto 0; }
.ranking-table th { display: table-cell; }
.ranking-table th img { vertical-align: middle; margin-right: 0.25rem; }
.ranking-position { font-weight: 800; color: var(--text-dim); width: 2.5rem; }
.ranking-top td { font-weight: 700; }
.ranking-top-1 .ranking-position { color: #e8cf8a; }
.ranking-top-2 .ranking-position { color: #c9c9d4; }
.ranking-top-3 .ranking-position { color: #d3986a; }
.admin-form { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 4px; padding: 1.75rem; margin-bottom: 2rem; }
.admin-form h3 { margin-top: 0; color: var(--text); }

.shop-tab-content { display: none; }
.shop-tab-content.is-active { display: block; }

.baul-tab-content { display: none; }
.baul-tab-content.is-active { display: block; }

.admin-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 960px;
  margin: 2rem auto;
}
.admin-tools-grid .admin-form { margin-bottom: 0; }
@media (max-width: 700px) {
  .admin-tools-grid { grid-template-columns: 1fr; }
}

/* --- Editor de contenido: acordeón por página --- */
.content-section {
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 1rem;
  background: var(--bg-panel);
  overflow: hidden;
}
.content-section summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.content-section summary::-webkit-details-marker { display: none; }
.content-section summary::after {
  content: '▾';
  color: var(--text-dim);
  transition: transform 0.15s ease;
  margin-left: 1rem;
}
.content-section[open] summary::after { transform: rotate(180deg); }
.content-section summary:hover { color: var(--blue-accent); }
.content-section-body {
  background: var(--bg-deep);
  border-top: 1px solid var(--line);
  border-radius: 0;
  margin-bottom: 0;
}
.content-section-body > form { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px dashed var(--line); }
.content-section-body > form:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.logo-editor {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-panel);
  margin-bottom: 1.5rem;
}
.logo-editor h4 { margin: 0 0 0.75rem; color: var(--text); }
.logo-editor-hint { display: block; color: var(--text-dim); font-size: 0.75rem; font-weight: 400; margin-top: 0.2rem; }
.logo-preview {
  background: var(--bg-deep);
  border: 1px dashed var(--line);
  border-radius: 4px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  margin-bottom: 1rem;
}
.logo-preview img { max-width: 100%; object-fit: contain; }
.logo-upload-form { margin-bottom: 1rem; }
.logo-size-form { display: flex; align-items: center; gap: 0.6rem; }
.logo-size-form label { color: var(--text-dim); font-size: 0.8rem; }
.logo-size-form input { width: 80px; padding: 0.4rem; border-radius: 4px; border: 1px solid var(--line); background: var(--bg-deep); color: var(--text); }

.save-feedback {
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}
.save-feedback-show { opacity: 1; transform: translateY(0); }
.save-feedback-success { color: #4caf50; }
.save-feedback-error { color: #e05555; }

.text-override-row { margin-bottom: 1.1rem; }
.text-override-row > label { display: block; font-family: monospace; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.35rem; }
.text-override-row input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
}
.text-edit-lang-selector {
  max-width: 320px;
  margin: 0 auto 1.5rem;
}
.text-edit-lang-selector select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
}

.edit-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.edit-mode-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.edit-mode-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.edit-mode-icon { font-size: 2rem; display: block; margin-bottom: 0.6rem; }
.edit-mode-card h3 { margin: 0 0 0.4rem; }
.edit-mode-card p { margin: 0; color: var(--text-dim); font-size: 0.85rem; }

.visit-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.visit-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
}
.visit-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gold); }
.visit-stat-label { font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem; text-align: center; }

.admin-users-controls {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.admin-users-search {
  flex: 1;
  min-width: 200px;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
}
.admin-users-controls select {
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
}

.admin-users-list { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
  flex-wrap: wrap;
}
.admin-user-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1 1 380px;
  min-width: 0;
  flex-wrap: wrap;
}
.admin-user-identity { display: flex; flex-direction: column; min-width: 140px; }
.admin-user-name { font-weight: 700; }
.admin-user-email { font-size: 0.75rem; color: var(--text-dim); }
.admin-user-stats {
  display: flex;
  gap: 1rem;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  flex: 1;
  flex-wrap: wrap;
}
.admin-user-stats img.coin-icon { width: 16px; height: 16px; vertical-align: middle; margin-right: 0.2rem; }
.admin-user-date { margin-left: auto; }
.admin-user-actions { display: flex; gap: 0.4rem; flex: 0 0 auto; align-items: center; flex-wrap: wrap; }
@media (max-width: 560px) {
  .admin-user-row { flex-direction: column; align-items: stretch; }
  .admin-user-main { flex-basis: auto; }
  .admin-user-actions { margin-left: 0; justify-content: flex-end; }
}
/* Iconos de un pack: filas cortas y de solo lectura, caben de sobra en
   una cuadrícula de 3 columnas en vez de una lista vertical. Todas las
   cajas miden lo mismo: el texto se trunca a una línea en vez de estirar
   la caja, y se reserva altura fija para el nombre aunque no lo tenga. */
.pack-icons-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 0.5rem; }
.pack-icons-grid .admin-user-row { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 0.5rem; }
.pack-icons-grid .admin-user-main { flex-basis: auto; flex-wrap: nowrap; min-width: 0; }
.pack-icons-grid .admin-user-identity { min-width: 0; min-height: 2.4em; justify-content: center; }
.pack-icons-grid .admin-user-name,
.pack-icons-grid .admin-user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pack-icons-grid .admin-user-actions { justify-content: center; }
@media (max-width: 700px) {
  .pack-icons-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .pack-icons-grid { grid-template-columns: 1fr; }
}
.vip-badge {
  background: var(--gold);
  color: #1a1a1a;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.4rem;
}
.banned-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.4rem;
}

.profile-rank-title { color: var(--gold); font-weight: 700; margin: 0.25rem 0 0; }

.profile-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.profile-progress-grid > div { display: flex; flex-direction: column; align-items: center; }
.profile-stat-label { font-size: 0.75rem; color: var(--text-dim); }
.profile-stat-value { font-size: 1.2rem; font-weight: 700; color: var(--text); }

.xp-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  overflow: hidden;
}
.xp-bar-fill { height: 100%; background: var(--gold); transition: width 0.3s ease; }
.xp-bar-label { text-align: center; font-size: 0.75rem; color: var(--text-dim); margin: 0.4rem 0 0; }

.profile-title-form { margin-top: 1rem; }
.profile-title-form select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-deep);
}
.achievement-card.is-locked { opacity: 0.4; filter: grayscale(1); }
.achievement-icon { font-size: 1.8rem; }
.achievement-name { font-weight: 700; font-size: 0.9rem; }
.achievement-desc { font-size: 0.75rem; color: var(--text-dim); }

.profile-picture-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.profile-picture-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: var(--bg-deep);
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
}
.profile-picture-option input { position: absolute; opacity: 0; pointer-events: none; }
.profile-picture-option img { height: 80px; }
.profile-picture-option.is-selected { border-color: var(--blue-accent); box-shadow: 0 0 12px var(--blue-glow); }
.profile-picture-option.is-locked { opacity: 0.4; filter: grayscale(1); cursor: not-allowed; }
.profile-picture-lock { font-size: 0.7rem; color: var(--text-dim); }

.vip-note { color: var(--gold); font-weight: 600; }

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.reward-track {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-panel);
  text-align: center;
}
.reward-track h3 { margin-top: 0; }
.reward-days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.reward-day {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
}
.reward-day.is-done { background: var(--gold); border-color: var(--gold); color: #1a1a1a; }
.reward-day.is-grand { border-color: var(--gold); }
.reward-daily-text, .reward-grand-text { font-size: 0.85rem; color: var(--text-dim); margin: 0.3rem 0; }
.reward-warning { color: var(--danger); font-size: 0.8rem; }
.reward-claim-btn { margin-top: 0.75rem; }

.collab-status { font-size: 0.8rem; font-weight: 600; padding: 0.2rem 0.5rem; border-radius: 4px; }
.collab-status-pendiente { color: var(--gold); }
.collab-status-aprobado { color: var(--success); }
.collab-status-rechazado { color: var(--danger); }

.maintenance-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 1rem;
}
.maintenance-page-art {
  max-width: 1100px;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.game-file-field { border: 1px dashed var(--line); border-radius: 6px; padding: 1rem; }
.game-file-field-disabled { opacity: 0.55; }
.game-file-field-disabled input[type="file"] { pointer-events: none; }
.game-file-requirements {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg-deep);
  border-radius: 4px;
  padding: 0.75rem 1rem;
}
.game-file-requirements ul { margin: 0.4rem 0; padding-left: 1.2rem; }
.game-file-requirements li { margin-bottom: 0.3rem; }

.game-preview-frame-wrap {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}
.card-locked { opacity: 0.5; filter: grayscale(0.8); }
.card-locked .btn[disabled] { cursor: not-allowed; background: var(--bg-deep); color: var(--text-dim); box-shadow: none; }
.beta-badge {
  background: var(--gold);
  color: #1a1a1a;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  vertical-align: middle;
}

.play-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1300px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
}
.play-title { margin: 0; text-align: center; flex: 1; }
.play-fallback-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 1300px;
  margin: 0.5rem auto 0;
  padding: 0 1.5rem;
}
.play-frame-wrap {
  max-width: 1300px;
  margin: 1rem auto 2rem;
  padding: 0 1.5rem;
}
.play-frame {
  width: 100%;
  height: 75vh;
  min-height: 480px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #000;
}

.game-preview-frame {
  width: 100%;
  height: 75vh;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #000;
}

.asset-picker {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
}

/* --- Icon buttons (theme toggle, settings) --- */
.icon-btn-wrap { position: relative; }
.icon-btn {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease;
}

.theme-toggle-floating {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.icon-btn:hover { border-color: var(--blue-accent); }

.back-btn-floating {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 40;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  border-color: #ffffff;
  color: #ffffff;
}
.spin-arrow { display: inline-block; transition: transform 0.5s ease; }
.back-btn-floating:hover .spin-arrow { transform: rotate(360deg); }

.settings-panel {
  display: none;
  position: fixed;
  top: 4.25rem;
  right: 1rem;
  width: 240px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 30;
  text-align: left;
}
.settings-panel.open { display: block; }
.settings-panel h4 {
  margin: 0 0 0.75rem;
  color: var(--text);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.settings-row-volume input { width: 120px; }

.mode-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.genre-checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.genre-checkbox-list label.mode-checkbox {
  padding: 0.3rem 0.5rem;
  font-size: 0.66rem;
  line-height: 1.15;
  gap: 0.3rem;
  text-transform: none;
  letter-spacing: normal;
  border-radius: 4px;
}
.genre-checkbox-list label.mode-checkbox input {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}
.genre-checkbox-list label.mode-checkbox input::before {
  width: 6px;
  height: 6px;
}
.genre-other-wrap {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.genre-other-wrap.is-expanded { grid-column: span 2; }
.genre-other-input {
  width: 0;
  min-width: 0;
  padding: 0;
  margin-left: 0;
  border: 0;
  border-radius: 4px;
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 0.66rem;
  opacity: 0;
  overflow: hidden;
  transition: width 0.15s ease, opacity 0.15s ease, margin-left 0.15s ease, padding 0.15s ease;
}
.genre-other-wrap.is-expanded .genre-other-input {
  width: 100px;
  opacity: 1;
  margin-left: 0.35rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
}
.form-field .mode-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.form-field .mode-checkbox:hover { border-color: var(--blue-accent); color: var(--blue-accent); }
.form-field .mode-checkbox:has(input:checked) {
  border-color: var(--success);
  color: var(--text);
}
.mode-checkbox input {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin: 0;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: border-color 0.15s ease;
}
.mode-checkbox input:checked {
  border-color: var(--success);
}
.mode-checkbox input::before {
  content: '';
  width: 9px;
  height: 9px;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform 0.1s ease;
  background: var(--success);
}
.mode-checkbox input:checked::before { transform: scale(1); }
.settings-panel form { margin-top: 0.75rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* --- Language selector (floating) --- */
.lang-selector {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  font-family: 'Inter', system-ui, sans-serif;
}
.lang-current {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.lang-current:hover { border-color: var(--blue-accent); }
.lang-code { letter-spacing: 0.05em; }
.lang-caret { color: var(--text-dim); font-size: 0.7rem; }

.lang-list {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  width: 220px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  padding: 0.4rem;
}
.lang-list.open { display: block; }
.lang-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}
a.lang-item:hover { background: var(--bg-panel); color: var(--blue-accent); }
a.lang-item.is-current { color: var(--blue-accent); font-weight: 700; }
.lang-disabled { color: var(--text-dim); opacity: 0.45; cursor: not-allowed; }

/* --- Social panel: toggled from a header button, overlays on top of the page --- */
.social-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notif-panel {
  position: fixed;
  top: var(--header-stack-height);
  right: 0;
  bottom: 0;
  width: 320px;
  background: var(--bg-panel-raised);
  border-left: 1px solid var(--line);
  z-index: 18;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,0.35);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.notif-panel.open { transform: translateX(0); }
.notif-panel-body { padding: 1rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 0.75rem; }

@media (max-width: 960px) {
  .notif-panel { width: 100%; }
}

.social-panel {
  position: fixed;
  top: var(--header-stack-height);
  right: 0;
  bottom: 0;
  width: var(--chat-width, 340px);
  max-width: 100vw;
  background: var(--bg-panel-raised);
  border-left: 1px solid var(--line);
  z-index: 18;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  box-shadow: -12px 0 40px rgba(0,0,0,0.35);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}
.social-panel.open { transform: translateX(0); }

@media (max-width: 960px) {
  .social-panel { width: 100%; }
}

.social-panel-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.social-panel-header h3 {
  font-family: 'Cinzel', 'Georgia', serif;
  margin: 0;
  flex: 1;
  color: var(--text);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
/* Quién eres tú, en vez de un título genérico "Charla": tu foto y tu
   nombre, a la izquierda del selector de estado. */
.social-panel-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.social-panel-me-name {
  font-family: 'Cinzel', 'Georgia', serif;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-panel-header select {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
}
.social-panel-header .icon-btn { width: 32px; height: 32px; font-size: 0.85rem; }

.social-tabs { display: flex; gap: 0.4rem; padding: 0.75rem 1rem 0; }
.social-tab {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.4rem;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.social-tab.is-active { background: var(--blue-accent); border-color: var(--blue-accent); color: #16110b; }

.social-tab-content { display: none; flex: 1; overflow-y: auto; overflow-x: hidden; padding: 1rem; flex-direction: column; }
.social-section-heading {
  margin: 1rem 0 0.3rem;
  font-family: 'Cinzel', 'Georgia', serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}
.social-section-heading:first-child { margin-top: 0; }
.social-tab-content.is-active { display: flex; }

.social-search input, .social-compose input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 0.85rem;
}
.social-section { margin-top: 0.75rem; }
.social-list { margin-top: 0.5rem; }

.social-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  max-width: 100%;
  text-align: left;
  cursor: default;
}
button.social-row { cursor: pointer; }
button.social-row:hover { color: var(--blue-accent); }
.social-row-name { flex: 1; min-width: 3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem; margin-left: auto; }
.social-row-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); background: var(--bg-deep); }

.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0; }
.status-dot.status-online { background: var(--success); }
.status-dot.status-playing { background: var(--blue-accent); }
.status-dot.status-away { background: var(--gold); }
.status-dot.status-offline { background: var(--text-dim); }
.status-dot.status-invisible { background: var(--text-dim); }
.status-device { font-size: 0.8rem; }
.status-last-seen { font-size: 0.72rem; color: var(--text-dim); margin-left: auto; white-space: nowrap; }

.order-form { display: flex; gap: 0.3rem; align-items: center; }
.order-input {
  width: 50px;
  padding: 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
}

.btn-mini {
  background: var(--blue-accent);
  color: #06121f;
  border: none;
  border-radius: 4px;
  padding: 0.25rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
}
.btn-mini-danger { background: var(--danger); color: #fff; }
.btn-mini:disabled { opacity: 0.35; cursor: default; }

.footer-social-order { display: flex; gap: 0.25rem; }

.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.75rem; min-height: 120px; }
.chat-message { font-size: 0.82rem; color: var(--text); padding: 0.35rem 0.5rem; border-radius: 4px; background: var(--bg-panel); display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.chat-message.is-mine { align-self: flex-end; background: var(--blue-glow); }
.chat-message-author { font-weight: 700; color: var(--blue-accent); }
.user-link { cursor: pointer; }
.user-link:hover { text-decoration: underline; }
.chat-message-actions { margin-left: auto; display: flex; gap: 0.25rem; opacity: 0; pointer-events: none; transition: opacity 0.1s ease; }
.chat-message:hover .chat-message-actions,
.chat-message:focus-within .chat-message-actions { opacity: 1; pointer-events: auto; }

.chat-pinned-message {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text);
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  border-left: 3px solid var(--gold);
  background: rgba(201,162,75,0.12);
  margin-bottom: 0.5rem;
}
.chat-pinned-message-label { font-weight: 700; color: var(--gold); }
.mention { color: var(--gold); font-weight: 700; cursor: pointer; }
.mention-me { background: rgba(201,162,75,0.25); border-radius: 3px; padding: 0 2px; }

/* El selector de idioma flota fijo en la esquina inferior derecha de toda
   la página; el panel social ocupa esa misma esquina, así que dejamos
   siempre ese hueco libre para que la caja de texto y el botón de enviar
   no queden debajo (más a la izquierda). */
.social-compose { display: flex; gap: 0.5rem; padding-right: 6.5rem; }
.btn-send {
  flex-shrink: 0;
  width: 2.6rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-transform: none;
  letter-spacing: normal;
}
.social-compose input { flex: 1; }

.chat-input-wrap { position: relative; flex: 1; display: flex; }
.chat-input-wrap input { flex: 1; padding-right: 2.2rem !important; }
.emoji-toggle-btn {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.15rem;
  opacity: 0.85;
}
.emoji-toggle-btn:hover { opacity: 1; }
.emoji-toggle-btn .new-badge {
  position: absolute;
  top: -0.55rem;
  right: -0.65rem;
  background: var(--gold);
  color: #1a1a1a;
  font-size: 0.5rem;
  font-weight: 800;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
  letter-spacing: 0.03em;
  line-height: 1.3;
}
.emoji-picker {
  /* position: fixed (no absolute) y colocado por JS (positionEmojiPicker):
     un antepasado como #tab-dm tiene overflow-y:auto, y un position:absolute
     ahí dentro se recorta en vez de desbordar, escondiendo la parte de arriba
     del picker sin forma de llegar a ella haciendo scroll. Con fixed y
     coordenadas calculadas contra el viewport, siempre queda entero y con su
     propio scroll si no cabe. */
  position: fixed;
  /* Se ajusta al ancho del chat (configurable en /admin/social), pero nunca
     se sale de la pantalla en móvil; JS pone el ancho/alto reales según el
     hueco disponible cada vez que se abre. */
  width: min(var(--chat-width, 340px), calc(100vw - 1.5rem));
  max-height: min(360px, 70vh);
  overflow-y: auto;
  background: var(--bg-panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  display: grid;
  /* auto-fill en vez de un número fijo de columnas: el número de emojis por
     fila se adapta solo al ancho disponible y a su tamaño (escalado con
     --chat-emoji-scale), así siempre quedan ordenados y sin recortarse.
     Base más pequeña que antes para que quepan más sin necesitar scroll. */
  grid-template-columns: repeat(auto-fill, minmax(calc(1.7rem * var(--chat-emoji-scale, 1)), 1fr));
  gap: 0.2rem;
  z-index: 1000;
}
.emoji-picker button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: calc(0.95rem * var(--chat-emoji-scale, 1));
  padding: 0.15rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.emoji-picker button:hover { background: var(--bg-panel); }
.emoji-picker button img { width: calc(18px * var(--chat-emoji-scale, 1)); height: calc(18px * var(--chat-emoji-scale, 1)); object-fit: contain; border-radius: 50%; }
.emoji-picker button.emoji-locked { position: relative; }
.emoji-picker button.emoji-locked img { opacity: 0.4; filter: grayscale(1); }
.emoji-lock-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 0.6rem;
  line-height: 1;
  background: var(--bg-deep);
  border-radius: 50%;
  padding: 0.1rem;
}
.emoji-picker-divider { grid-column: 1 / -1; border-top: 1px dashed var(--line); margin: 0.15rem 0; }
/* Mismo tamaño que .chat-emoji-char (el emoji unicode suelto) para que un
   :codigo: personalizado y un 🤔 escrito a mano se vean igual de grandes
   dentro de un mensaje de chat; el picker tiene su propia regla aparte
   (.emoji-picker button img), no se toca. */
.chat-emoji-img { width: 1.8em; height: 1.8em; object-fit: contain; vertical-align: -0.3em; border-radius: 50%; }
.chat-emoji-char { font-size: 1.8em; line-height: 1; display: inline-block; vertical-align: -0.3em; }

.dm-layout { display: flex; flex-direction: column; gap: 0.75rem; flex: 1; min-height: 0; }
.dm-friend-list { display: flex; flex-direction: column; gap: 0.4rem; overflow-y: auto; flex: 1; }
.dm-friend-btn { flex-direction: row; align-items: center; gap: 0.6rem; width: 100%; text-align: left; }
.dm-friend-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; font-weight: 600; }
.dm-friend-detail { font-size: 0.72rem; color: var(--text-dim); flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.dm-empty-state { width: 100%; text-align: center; }
.dm-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Con una conversación abierta, el hilo ocupa todo el cuadro: se oculta la
   lista de amigos y el texto de presentación de la pestaña, y arriba del
   todo aparece con quién se habla en su lugar. */
#tab-dm.is-conversation-open .social-pane-header { display: none; }
#tab-dm.is-conversation-open .dm-friend-list { display: none; }
.dm-thread-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.dm-thread-header #dm-back-btn { width: 32px; height: 32px; font-size: 1rem; flex-shrink: 0; }
.dm-thread-name { font-family: 'Cinzel', 'Georgia', serif; color: var(--gold); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notif-row { border-left: 3px solid transparent; cursor: pointer; }
.notif-row:hover { background: var(--bg-panel); }
.notif-row.is-unread { border-left-color: var(--blue-accent); background: rgba(217,138,61,0.10); }
.notif-text { font-size: 0.82rem; }

.social-pane-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}
.social-pane-header h4 {
  font-family: 'Cinzel', 'Georgia', serif;
  color: var(--gold);
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}
.social-pane-intro {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-dim);
  margin: 0;
}

.social-tab-content .empty-state,
.social-tab-content .social-error-state,
.notif-panel-body .empty-state,
.notif-panel-body .social-error-state {
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 1.25rem;
}
.social-error-state {
  text-align: center;
  font-style: italic;
  color: var(--danger);
  border: 1px dashed var(--danger);
  border-radius: 4px;
  background: rgba(209,84,74,0.08);
}

/* --- Reveal on scroll: fade + rise as a block enters the viewport ---
   Native CSS scroll-driven animation (animation-timeline: view()).
   No JS, no library. Browsers without support (Firefox, Safari as of
   early 2026) just see the content fully visible via the fallback
   below — @supports keeps this a progressive enhancement, never a
   permanently-hidden block. */
.reveal-on-scroll {
  opacity: 1;
}

@supports (animation-timeline: view()) {
  .reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    animation: reveal-fade-up linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
}

@keyframes reveal-fade-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
