/* Caracola Mágica · tema «Arrecife Loop»: menú azul marino, fondo crema, bordes gruesos y sombras de color. */

:root {
    color-scheme: light;
    --marino: #10224a;
    --marino-2: #172c5e;
    --marino-3: #2b4382;
    --marino-hondo: #0c1a3b;
    --marino-texto: #e8eeff;
    --marino-tenue: #9fb3e6;

    --coral: #ff6b4a;
    --cielo: #7fd6ff;
    --lima: #a6e86b;
    --sol: #ffd23f;
    --uva: #7c5cff;

    --fondo: #fff4e3;
    --panel: #ffffff;
    --campo: #fffaf2;
    --suave: #f6ecdc;
    --linea: var(--marino);
    --sombra: var(--marino);
    --control: var(--marino);
    --linea-suave: #ead9c2;
    --migas: #7a6a5c;
    --marcador: #8f8a99;
    --peligro-fondo: #fff0ee;
    --cuadros-1: #efe3cf;
    --cuadros-2: #fffaf2;
    --cita-fondo: #10224a0d;
    --texto: var(--marino);
    --tenue: #5b5870;

    /* Cada grupo del menú pinta su página con su color. */
    --acento: var(--coral);
    --acento-suave: #ffe1d9;
    --acento-texto: #a8321a;

    --ok: #2f7d32;
    --error: #c42b1c;
    --radio: 22px;
    --discord: #313338;
    --titulos: "Fredoka", "Nunito", system-ui, sans-serif;
}

body[data-grupo="soporte"] { --acento: var(--cielo); --acento-suave: #dcf3ff; --acento-texto: #155e85; }
body[data-grupo="juegos"] { --acento: var(--lima); --acento-suave: #e6f8d6; --acento-texto: #2f6512; }
body[data-grupo="economia"] { --acento: var(--sol); --acento-suave: #fff3c4; --acento-texto: #7a5600; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    background: var(--fondo);
    color: var(--texto);
    font: 600 16px/1.5 "Nunito", "Segoe UI", system-ui, sans-serif;
}
a { color: inherit; }
img { display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--titulos); font-weight: 700; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--uva); outline-offset: 2px; }

/* ---------- Estructura: menú lateral + contenido ---------- */

.app { display: flex; min-height: 100vh; }
.principal { flex: 1; min-width: 0; }

.menu {
    position: sticky;
    top: 0;
    flex: 0 0 300px;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px 16px;
    background: var(--marino);
    color: var(--marino-texto);
    scrollbar-width: thin;
    scrollbar-color: var(--marino-3) transparent;
}
.menu :focus-visible { outline-color: var(--sol); }
.menu .icono { display: grid; place-items: center; }

.menu-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-marca { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; }
.menu-logo {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--coral);
    color: var(--marino);
    box-shadow: 4px 4px 0 var(--sol);
    transition: transform .2s;
}
.menu-marca:hover .menu-logo { transform: rotate(-8deg) scale(1.05); }
.menu-marca strong { display: block; font-family: var(--titulos); font-size: 23px; font-weight: 700; line-height: 1.05; }
.menu-marca small { display: block; margin-top: 3px; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; color: var(--marino-tenue); }
.menu-alternar { display: none; }

.menu-cuerpo { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.menu-vacio { padding: 0 6px; color: var(--marino-tenue); font-size: 14px; }

.menu-servidor {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 2px solid var(--marino-3);
    border-radius: 14px;
    background: var(--marino-2);
    font-weight: 800;
    text-decoration: none;
    transition: border-color .15s;
}
.menu-servidor:hover { border-color: var(--marino-tenue); }
.menu-servidor .icono-servidor { width: 30px; height: 30px; border-radius: 10px; background: var(--uva); color: #fff; font-size: 12px; }
.menu-servidor .nombre { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.menu-buscar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px;
    border: 2px solid var(--marino-3);
    border-radius: 12px;
    background: var(--marino-hondo);
    color: var(--marino-tenue);
}
.menu-buscar:focus-within { border-color: var(--sol); }
.menu-buscar input[type="search"] { width: 100%; min-width: 0; padding: 0; border: 0; background: none; color: var(--marino-texto); font-weight: 700; outline: none; }
.menu-buscar input[type="search"]:focus { box-shadow: none; }
.menu-buscar input::placeholder { color: var(--marino-tenue); }

.menu nav { display: flex; flex-direction: column; gap: 4px; }
.menu-grupo { --g-color: var(--coral); --g-claro: #ff9b85; --g-fondo: #3a2340; --g-sombra: var(--sol); }
.menu-grupo[data-grupo="soporte"] { --g-color: var(--cielo); --g-claro: var(--cielo); --g-fondo: #163a5c; }
.menu-grupo[data-grupo="juegos"] { --g-color: var(--lima); --g-claro: var(--lima); --g-fondo: #23431f; }
.menu-grupo[data-grupo="economia"] { --g-color: var(--sol); --g-claro: var(--sol); --g-fondo: #4a3d12; --g-sombra: var(--coral); }

.menu-grupo-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 6px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--g-claro);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .14em;
    text-align: left;
    cursor: pointer;
}
.menu-grupo-titulo:hover { background: var(--marino-2); }
.menu-grupo-titulo .icono { transition: transform .2s; }
.menu-grupo-titulo[aria-expanded="false"] .icono { transform: rotate(-90deg); }
.menu-contador { margin-left: auto; padding: 0 8px; border-radius: 99px; background: var(--marino-2); color: var(--marino-tenue); font-size: 12px; letter-spacing: 0; }

.menu-grupo-lista { display: flex; flex-direction: column; gap: 4px; padding: 0 0 8px 4px; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 14px;
    text-decoration: none;
    transition: background .15s, transform .15s;
}
.menu-item:hover { background: var(--marino-2); transform: translateX(3px); }
.menu-icono { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--g-fondo); color: var(--g-claro); }
.menu-item strong { display: block; font-weight: 800; line-height: 1.25; }
.menu-item small { display: block; color: #8a9cc9; font-size: 12px; font-weight: 700; line-height: 1.3; }
.menu-item.activo { background: var(--g-color); color: var(--marino); box-shadow: 3px 3px 0 var(--g-sombra); transform: none; }
.menu-item.activo .menu-icono { background: var(--marino); color: var(--g-color); }
.menu-item.activo small { color: var(--marino); }

.menu-apartados { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px 24px; padding-left: 14px; border-left: 3px solid var(--g-color); }
.menu-apartados a { padding: 6px 10px; border-radius: 10px; color: #c9d5f5; font-size: 14px; font-weight: 700; text-decoration: none; }
.menu-apartados a:hover { color: #fff; }
.menu-apartados a.activo { background: #1e3570; color: #fff; font-weight: 800; }

.menu-pie { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.menu-estado { display: flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--marino-tenue); font-size: 13px; font-weight: 700; }
.menu-estado::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--lima); box-shadow: 0 0 0 0 #a6e86b88; animation: latido 2.4s infinite; }
@keyframes latido { 70% { box-shadow: 0 0 0 7px #a6e86b00; } 100% { box-shadow: 0 0 0 0 #a6e86b00; } }
.menu-usuario { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--marino-2); }
.menu-usuario img { width: 36px; height: 36px; border: 2px solid var(--sol); border-radius: 50%; }
.menu-usuario div { flex: 1; min-width: 0; }
.menu-usuario strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 800; }
.menu-usuario small { color: var(--marino-tenue); font-size: 12px; }
.menu-usuario button { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--marino-3); color: var(--marino-texto); cursor: pointer; }
.menu-usuario button:hover { background: var(--coral); color: var(--marino); }

.menu-creador {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px dashed var(--sol);
    border-radius: 14px;
    color: var(--sol);
    font-weight: 800;
    text-decoration: none;
    transition: background .15s;
}
.menu-creador:hover, .menu-creador[aria-current="page"] { background: #ffd23f22; }

/* Consola del creador */
.consola-resumen { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.consola-cifra { padding: 10px 16px; border: 2px solid var(--linea); border-radius: 16px; background: var(--panel); box-shadow: 4px 4px 0 var(--sol); }
.consola-cifra strong { display: block; font-family: var(--titulos); font-size: 28px; line-height: 1; }
.consola-cifra span { color: var(--tenue); font-size: 13px; font-weight: 800; }
.consola-filtros { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 14px; }
.consola-filtros { align-items: center; }
.consola-filtros input[type="search"] { flex: 1 1 260px; width: auto; }
.consola-filtros label { display: flex; align-items: center; gap: 8px; font-weight: 800; white-space: nowrap; }
.consola-filtros label input { width: 20px; height: 20px; accent-color: var(--control); }
.consola-lista { display: flex; flex-direction: column; gap: 12px; }
.consola-servidor { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; border: 2px solid var(--linea); border-radius: 18px; background: var(--panel); box-shadow: 4px 4px 0 var(--sombra); }
.consola-servidor.ajeno { box-shadow: 4px 4px 0 var(--coral); }
.consola-info { flex: 1 1 240px; min-width: 0; }
.consola-bloqueados { margin-top: 28px; }
.consola-servidor strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.consola-servidor small { color: var(--tenue); overflow-wrap: anywhere; }
.etiqueta-estoy { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 800; vertical-align: 2px; }
.etiqueta-estoy.si { background: #e6f8d6; color: #2f6512; }
.etiqueta-estoy.no { background: #ffe1d9; color: #a8321a; }
.consola-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.consola-acciones label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.consola-acciones input { width: 18px; height: 18px; accent-color: var(--control); }

.menu-legal { margin: 2px 4px 0; color: #6f84bd; font-size: 11px; font-weight: 600; line-height: 1.4; }
.legal { max-width: 640px; color: var(--tenue); font-size: 12px; line-height: 1.5; }

/* Cabecera de cada página */

.cabecera { grid-column: 1 / -1; order: -3; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.migas { display: flex; flex-wrap: wrap; gap: 6px; color: var(--migas); font-weight: 700; }
.migas a { text-decoration: none; }
.migas a:hover { color: var(--texto); text-decoration: underline; }
.migas strong { color: var(--texto); }
.cabecera h1 { margin-top: 6px; font-size: 46px; line-height: 1; }
.cabecera p { margin-top: 8px; color: var(--tenue); font-size: 17px; }
.cabecera-acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.cabecera-acciones:empty { display: none; }

/* ---------- Botones ---------- */

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 18px;
    border: 2px solid var(--linea);
    border-radius: 14px;
    background: var(--panel);
    color: var(--texto);
    box-shadow: 3px 3px 0 var(--sombra);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s, background .15s;
}
.boton:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--sombra); }
.boton:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--sombra); }
.boton:disabled { opacity: .5; cursor: not-allowed; }
.boton.principal { background: var(--acento); color: var(--marino); }
.boton.grande { min-height: 54px; padding: 10px 28px; font-size: 18px; }
.boton.sutil { border-color: transparent; background: transparent; box-shadow: none; }
.boton.sutil:hover:not(:disabled) { border-color: var(--linea); background: var(--acento-suave); box-shadow: none; transform: none; }
.boton.peligro { border-color: var(--error); color: var(--error); background: var(--peligro-fondo); }

/* ---------- Inicio ---------- */

.portada {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    min-height: 100vh;
    padding: 40px 24px;
    text-align: center;
}
.portada > img { width: 132px; height: 132px; border: 4px solid var(--linea); border-radius: 36px; box-shadow: 8px 8px 0 var(--coral); transform: rotate(-4deg); }
.portada h1 { font-size: clamp(40px, 8vw, 68px); line-height: 1.05; }
.portada p { max-width: 540px; color: var(--tenue); font-size: 19px; }

.aviso {
    max-width: 620px;
    padding: 16px 18px;
    border: 2px solid var(--linea);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 5px 5px 0 var(--coral);
    text-align: left;
}
.aviso ol { margin: 8px 0 0; padding-left: 20px; color: var(--tenue); }
.aviso code { color: var(--acento-texto); overflow-wrap: anywhere; }

/* ---------- Páginas de contenido (servidores, colección, tienda) ---------- */

.contenido { max-width: 1180px; padding: 28px 40px 64px; }
.contenido > h1 { font-size: 46px; line-height: 1; }
.contenido > p { margin-top: 8px; color: var(--tenue); font-size: 17px; }
.contenido > .cabecera + * { margin-top: 18px; }

.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }

.tarjeta-servidor {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 16px;
    border: 2px solid var(--linea);
    border-radius: var(--radio);
    background: var(--panel);
    box-shadow: 6px 6px 0 var(--coral);
    transition: transform .15s;
}
.tarjeta-servidor:nth-child(4n+2) { box-shadow: 6px 6px 0 var(--cielo); }
.tarjeta-servidor:nth-child(4n+3) { box-shadow: 6px 6px 0 var(--lima); }
.tarjeta-servidor:nth-child(4n+4) { box-shadow: 6px 6px 0 var(--sol); }
.tarjeta-servidor:hover { transform: translate(-2px, -2px); }
.tarjeta-servidor .boton { flex: none; }
.tarjeta-servidor .nombre { flex: 1; min-width: 0; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }

.icono-servidor {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--uva);
    color: #fff;
    font-family: var(--titulos);
    font-weight: 700;
    object-fit: cover;
}

/* ---------- Editor (páginas de configuración) ---------- */

.editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 24px;
    align-items: start;
    max-width: 1320px;
    padding: 28px 40px 120px;
}
.editor.dos { grid-template-columns: minmax(0, 1fr); padding-bottom: 32px; }

.columna { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.tarjeta {
    padding: 22px;
    border: 2px solid var(--linea);
    border-radius: var(--radio);
    background: var(--panel);
    box-shadow: 6px 6px 0 var(--acento);
    scroll-margin-top: 20px;
}
.columna > .tarjeta:nth-of-type(4n+2) { box-shadow: 6px 6px 0 var(--cielo); }
.columna > .tarjeta:nth-of-type(4n+3) { box-shadow: 6px 6px 0 var(--lima); }
.columna > .tarjeta:nth-of-type(4n+4) { box-shadow: 6px 6px 0 var(--sol); }
.tarjeta-cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.tarjeta-cabecera h2 { font-size: 23px; line-height: 1.2; }
.tarjeta-cabecera p { margin-top: 2px; color: var(--tenue); font-size: 14px; }
.tarjeta-cuerpo { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }

.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > span, .campo > label { font-size: 14px; font-weight: 800; }
.campo small { color: var(--tenue); }
.campo small.alerta { color: var(--error); }

input[type="text"], input[type="search"], input[type="number"], input[type="password"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--linea);
    border-radius: 12px;
    background: var(--campo);
    color: var(--texto);
    transition: box-shadow .12s;
}
input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus, input[type="password"]:focus, select:focus, textarea:focus { outline: none; box-shadow: 3px 3px 0 var(--acento); }
textarea { min-height: 96px; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--control); }
::placeholder { color: var(--marcador); }

.fila { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.color { display: flex; align-items: center; gap: 8px; }
input[type="color"] {
    flex: none;
    width: 44px;
    height: 44px;
    padding: 3px;
    border: 2px solid var(--linea);
    border-radius: 12px;
    background: var(--campo);
    cursor: pointer;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 4px 12px;
    border: 2px solid var(--linea);
    border-radius: 99px;
    background: var(--sol);
    color: var(--marino);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .12s;
}
.chip:nth-child(4n+2) { background: var(--cielo); }
.chip:nth-child(4n+3) { background: var(--lima); }
.chip:nth-child(4n+4) { background: #ffb3a3; }
.chip:hover { transform: translateY(-2px) rotate(-2deg); }

.interruptor { position: relative; flex: none; width: 52px; height: 30px; }
.interruptor input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.interruptor span { position: absolute; inset: 0; border: 2px solid var(--linea); border-radius: 99px; background: var(--suave); pointer-events: none; transition: background .15s; }
.interruptor span::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border: 2px solid var(--linea);
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
    transition: transform .18s;
}
.interruptor input:checked + span { background: var(--acento); }
.interruptor input:checked + span::after { transform: translateX(22px); }
.interruptor input:focus-visible + span { outline: 3px solid var(--uva); outline-offset: 2px; }

.zona-fondo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 2px dashed var(--linea);
    border-radius: 16px;
    background: var(--campo);
    transition: background .15s;
}
.zona-fondo.encima { background: var(--acento-suave); }
.zona-fondo p { color: var(--tenue); font-size: 14px; }
.zona-fondo .acciones { display: flex; gap: 8px; }

/* ---------- Vista previa de Discord ---------- */

.previa { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px; }
.previa h2 { font-size: 20px; font-weight: 600; }

.mensaje-discord {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--linea);
    border-radius: var(--radio);
    background: var(--discord);
    box-shadow: 6px 6px 0 var(--sol);
    color: #dbdee1;
    font: 400 15px/1.375 "Segoe UI", "gg sans", system-ui, sans-serif;
}
.mensaje-discord > img { flex: none; width: 40px; height: 40px; border-radius: 50%; }
.mensaje-discord .cuerpo { flex: 1; min-width: 0; }
.mensaje-discord .autor { font-weight: 600; color: #f2f3f5; }
.mensaje-discord .etiqueta { margin-left: 4px; padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; vertical-align: 1px; }
.mensaje-discord .texto { white-space: pre-wrap; overflow-wrap: anywhere; }
.mensaje-discord .mencion-rol { font-weight: 500; }
.selector-roles { max-width: 230px; }
.mensaje-discord .mencion { padding: 0 2px; border-radius: 3px; background: #5865f24d; color: #c9cdfb; }
.mensaje-discord .banner { width: 100%; margin-top: 8px; border-radius: 8px; transition: opacity .15s; }
.mensaje-discord .banner.cargando { opacity: .6; }

.mensaje-discord .embed { margin-top: 8px; padding: 10px 12px; border-left: 4px solid var(--coral); border-radius: 6px; background: #2b2d31; }
.embed-cuerpo { display: flex; justify-content: space-between; gap: 12px; }
.embed-cuerpo > div { min-width: 0; }
.embed-titulo { font-weight: 600; color: #f2f3f5; overflow-wrap: anywhere; }
.embed-miniatura { flex: none; width: 72px; height: 72px; border-radius: 6px; object-fit: cover; }
.embed-pie { margin-top: 6px; color: #b5bac1; font-size: 12px; overflow-wrap: anywhere; }
.embed-pie:empty { display: none; }

.separador-previa { width: 100%; max-width: 400px; height: auto; margin-top: 8px; }
.embed-nota { padding: 8px 12px; }
.selector-letras { width: auto; padding: 4px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; background: var(--panel); cursor: pointer; }

/* Editor de bloques */
.bloques { display: flex; flex-direction: column; gap: 14px; }
.bloque { border: 2px solid var(--linea); border-radius: 18px; background: var(--campo); overflow: hidden; }
.bloque-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 12px; border-bottom: 2px solid var(--linea); background: var(--tinte, var(--suave)); }
.bloque-titulo { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.bloque-titulo strong { font-family: var(--titulos); font-size: 17px; }
.bloque-titulo small { color: var(--tenue); font-size: 13px; }
.bloque-numero { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--linea); color: #fff; font-size: 12px; font-weight: 800; align-self: center; }
.bloque-acciones { display: flex; flex: none; gap: 6px; }
.boton-icono { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--linea); border-radius: 10px; background: var(--panel); color: var(--texto); font-weight: 800; cursor: pointer; }
.boton-icono:hover:not(:disabled) { background: var(--sol); }
.boton-icono.quitar:hover:not(:disabled) { background: #ffb3a3; }
.boton-icono:disabled { opacity: .35; cursor: not-allowed; }
.bloque-cuerpo { display: flex; flex-direction: column; gap: 14px; padding: 14px; }
.tipo-separador { --tinte: #fff3c4; }
.tipo-texto { --tinte: #dcf3ff; }
.tipo-recuadro { --tinte: #ffe1d9; }
.tipo-nota { --tinte: #ece8ff; }
.tipo-directo { --tinte: #efe3ff; }
.separador-muestra { width: 100%; max-width: 420px; height: auto; }
.bloques-botones { display: flex; flex-wrap: wrap; gap: 8px; }
.anadir-bloque { min-height: 40px; padding: 6px 14px; background: var(--tinte, var(--panel)); }
.acciones-bloques { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bloques-vacio { padding: 6px 0; }
.previa-bloques { display: flex; flex-direction: column; gap: 6px; }
.previa-bloques > .embed, .previa-bloques .bloque-directo-previa .embed { margin-top: 2px; }
.previa-bloques .texto:empty { display: none; }

.md-emoji { display: inline-block; width: 22px; height: 22px; margin: 0 1px; vertical-align: -5px; object-fit: contain; }
.fila-numeros { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.fila-numeros-titulo { margin-right: 4px; color: var(--tenue); font-size: 13px; font-weight: 800; }
.boton-numero { display: grid; place-items: center; width: 34px; height: 34px; padding: 2px; border: 2px solid var(--linea); border-radius: 10px; background: #313338; cursor: pointer; transition: transform .12s; }
.boton-numero:hover { transform: translateY(-2px) rotate(-4deg); }
.boton-numero img { width: 26px; height: 26px; }
.numeros-muestra { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border: 2px solid var(--linea); border-radius: 16px; background: #313338; }
.numeros-muestra img { width: 48px; height: 48px; }

.mensaje-discord .embed-sala { border-left-color: #7fd6ff; }
.embed-sala .texto { margin-top: 4px; font-size: 14px; }
.menu-discord { margin-top: 8px; padding: 8px 12px; border: 1px solid #1e1f22; border-radius: 4px; background: #2b2d31; color: #949ba4; font-size: 14px; }

.mensaje-discord .embed-juego { border-left-color: #2f2f2f; }
.mensaje-discord .embed-oferta { border-left-color: #ff7900; }
.embed-campos.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fila-juego .marca-error { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #ff004d; color: #fff; font-size: 12px; font-weight: 800; vertical-align: middle; }
.portada-juego.cuadrada { width: 62px; }
.fila-juego .avatar-cumple { flex: none; width: 44px; height: 44px; border: 2px solid var(--linea); border-radius: 50%; object-fit: cover; background: var(--suave); }
.fila-juego .marca-hoy { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: #ff77a8; color: #1d1a33; font-size: 12px; font-weight: 800; vertical-align: middle; }
.campo-corto { flex: 0 1 110px; }
.fila-campos.abajo { align-items: flex-end; }
.fila-campos.abajo .boton { margin-bottom: 2px; }
.tiendas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 14px; margin: 0; padding: 0; border: 0; }
.tiendas legend { margin-bottom: 6px; padding: 0; font-size: 14px; font-weight: 800; }
.lista-juegos { display: flex; flex-direction: column; gap: 10px; }
.fila-juego { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--linea); border-radius: 16px; background: var(--campo); }
.fila-juego.filtrado { opacity: .5; }
.fila-juego a { text-decoration: none; }
.fila-juego a:hover strong { text-decoration: underline; }
.fila-juego small { display: block; color: var(--tenue); }
.portada-juego { flex: none; width: 110px; height: 62px; border: 2px solid var(--linea); border-radius: 10px; object-fit: cover; background: var(--suave); }
.subtitulo-proximos { margin-top: 10px; font-size: 18px; }

/* Editor del banner */
.editor-banner { display: flex; flex-direction: column; gap: 12px; }
.eb-barra { display: flex; flex-wrap: wrap; gap: 10px; }
.eb-grupo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px; border: 2px dashed var(--linea-suave); border-radius: 14px; }
.eb-boton { min-height: 38px; padding: 4px 12px; font-size: 14px; }
.eb-select { width: auto; min-height: 38px; padding: 4px 10px; font-size: 14px; font-weight: 800; }
.eb-emoji-entrada { width: 64px !important; min-height: 38px; padding: 4px 8px !important; font-size: 18px; text-align: center; }
.eb-zona { width: 100%; overflow: hidden; }
.eb-marco { position: relative; border: 2px solid var(--linea); border-radius: 12px; overflow: hidden; box-shadow: 4px 4px 0 var(--sombra); }
.eb-lienzo { position: absolute; top: 0; left: 0; width: 1100px; height: 440px; transform-origin: 0 0; overflow: hidden; touch-action: none; user-select: none; outline: none; }
.eb-lienzo:focus-visible { box-shadow: inset 0 0 0 6px var(--uva); }
.eb-fondo, .eb-oscuro, .eb-capas { position: absolute; inset: 0; }
.eb-fondo { background-size: cover; background-position: center; }
.eb-capa { position: absolute; display: flex; align-items: center; justify-content: center; cursor: grab; }
.eb-capa:hover { outline: 2px dashed #ffffff88; outline-offset: 2px; }
.eb-capa.eb-elegida { outline: 3px solid var(--sol); outline-offset: 3px; z-index: 2; }
.eb-capa.eb-bloqueada { cursor: default; }
.eb-capa.eb-bloqueada.eb-elegida { outline-style: dashed; outline-color: #ffffffaa; }
.eb-capa svg { display: block; width: 100%; height: 100%; overflow: visible; }
.eb-foto-imagen { width: 100%; height: 100%; display: grid; place-items: center; background: #ff8a65 center / cover no-repeat; color: #1d2547; font: 700 80px "Segoe UI", sans-serif; }
.eb-foto-circulo .eb-foto-imagen { border-radius: 50%; }
.eb-foto-redondeado .eb-foto-imagen { border-radius: 18%; }
.eb-texto-linea { white-space: nowrap; line-height: 1; pointer-events: none; }
.eb-emoji-glifo { line-height: 1; pointer-events: none; font-family: "Segoe UI Emoji", "Noto Color Emoji", "Twemoji", sans-serif; }
.eb-asa { position: absolute; width: 20px; height: 20px; border: 3px solid var(--linea); border-radius: 50%; background: var(--sol); z-index: 3; }
.eb-asa-nw { left: -13px; top: -13px; cursor: nwse-resize; }
.eb-asa-ne { right: -13px; top: -13px; cursor: nesw-resize; }
.eb-asa-sw { left: -13px; bottom: -13px; cursor: nesw-resize; }
.eb-asa-se { right: -13px; bottom: -13px; cursor: nwse-resize; }
.eb-asa-giro { position: absolute; left: 50%; top: -46px; width: 22px; height: 22px; margin-left: -11px; border: 3px solid var(--linea); border-radius: 50%; background: var(--cielo); cursor: grab; z-index: 3; }
.eb-asa-giro::after { content: ""; position: absolute; left: 50%; top: 19px; width: 3px; height: 22px; margin-left: -1.5px; background: var(--sol); }
.eb-guia { position: absolute; z-index: 4; background: #ff3dbb; pointer-events: none; }
.eb-guia-v { top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.eb-guia-h { left: 0; right: 0; height: 2px; margin-top: -1px; }
.eb-panel { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; align-items: start; }
.eb-lista { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; padding: 8px; border: 2px solid var(--linea); border-radius: 14px; background: var(--campo); }
.eb-lista-titulo { margin-bottom: 4px; color: var(--tenue); font-size: 12px; font-weight: 800; }
.eb-fila { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border: 2px solid transparent; border-radius: 10px; background: none; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.eb-fila:hover { background: var(--suave); }
.eb-fila.activa { border-color: var(--linea); background: var(--acento-suave); }
.eb-fila-nombre { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.eb-propiedades { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 2px solid var(--linea); border-radius: 14px; background: var(--campo); }
.eb-prop-titulo { font-family: var(--titulos); font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.eb-fila-props { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.eb-campo { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 110px; font-size: 13px; font-weight: 800; }
.eb-campo input[type="number"] { width: 100%; padding: 6px 8px; border: 2px solid var(--linea); border-radius: 10px; background: var(--panel); }
.eb-campo select { padding: 6px 8px; }
.eb-texto-campo { display: flex; flex-direction: column; gap: 6px; }
.eb-texto-campo .eb-campo { flex: none; }
.eb-casilla { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.eb-casilla input { width: 18px; height: 18px; accent-color: var(--control); }
.eb-oscurecer { justify-content: flex-end; }
@media (max-width: 900px) {
    .eb-panel { grid-template-columns: minmax(0, 1fr); }
    .eb-lista { max-height: 180px; }
}

/* Mascota */
.imagen-mascota { width: 100%; max-width: 900px; height: auto; border: 2px solid var(--linea); border-radius: 18px; box-shadow: 4px 4px 0 var(--sombra); }
.mascota-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.mascota-datos h3 { margin-bottom: 6px; font-size: 18px; }
.lista-cuidadores, .lista-ayuda { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.lista-ayuda { list-style: none; padding-left: 0; color: var(--tenue); font-size: 14px; }
.campo-ancho { flex: 1 1 220px; }
.fila-campos { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin-bottom: 14px; }

/* Formato de Discord */

.barra-formato { display: flex; flex-wrap: wrap; gap: 6px; }
textarea.alto { min-height: 260px; }

.mensaje-discord .texto .md-cita { margin: 2px 0; padding-left: 12px; border-left: 4px solid #4e5058; }
.md-titulo { margin: 8px 0 4px; color: #f2f3f5; font-weight: 700; line-height: 1.3; }
.md-titulo-1 { font-size: 1.5em; }
.md-titulo-2 { font-size: 1.25em; }
.md-titulo-3 { font-size: 1.1em; }
.md-pequeno { color: #b5bac1; font-size: .8em; }
.md-lista { padding-left: 8px; }
.md-codigo { padding: 1px 4px; border-radius: 3px; background: #1e1f22; font-size: .9em; }
.md-bloque-codigo { margin: 4px 0; padding: 8px; border-radius: 4px; background: #1e1f22; font-size: .9em; white-space: pre-wrap; overflow-wrap: anywhere; }
.md-spoiler { padding: 0 2px; border-radius: 3px; background: #1e1f22; }
.md-enlace { color: #00a8fc; text-decoration: none; }
.md-enlace:hover { text-decoration: underline; }

/* ---------- Seguimiento de partidas ---------- */

.opcion { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.opcion input { width: 20px; height: 20px; accent-color: var(--control); }
.fila-anadir { display: flex; flex-wrap: wrap; gap: 8px; }
.fila-anadir input { flex: 1 1 180px; min-width: 0; width: auto; }
.fila-anadir select { flex: 0 0 96px; width: 96px; }
.cambio-contrasena select { flex: 1 1 200px; width: auto; }
.jugadores { display: flex; flex-direction: column; gap: 10px; }
.jugador {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 2px solid var(--linea);
    border-radius: 16px;
    background: var(--campo);
}
.jugador > div { flex: 1 1 140px; min-width: 0; }
.jugador strong { display: block; overflow-wrap: anywhere; }
.jugador small { color: var(--tenue); }
.cuenta-discord { flex: 1 1 170px; width: auto; min-width: 0; }

/* ---------- Directos ---------- */

#plataforma { flex: 0 0 130px; width: 130px; }
#puerta { flex: 1 1 240px; width: auto; }
.avatar-canal { flex: none; width: 44px; height: 44px; border: 2px solid var(--linea); border-radius: 50%; background: var(--suave); object-fit: cover; }
.canal-directo a { text-decoration: none; }
.canal-directo a:hover strong { text-decoration: underline; }
.insignia-plataforma { display: inline-block; padding: 0 7px; border-radius: 99px; background: #9146ff; color: #fff; font-size: 12px; font-weight: 800; }
.canal-directo[data-plataforma="youtube"] .insignia-plataforma { background: #d40000; }
.en-directo { display: inline-flex; align-items: center; gap: 5px; color: var(--error); font-weight: 800; }
.en-directo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: latido 1.6s infinite; }

.mensaje-discord .embed-directo { border-left-color: #9146ff; }
.embed-autor { color: #f2f3f5; font-size: 13px; font-weight: 600; }
.embed-titulo.enlace { margin-top: 4px; color: #00a8fc; }
.embed-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; font-size: 14px; }
.embed-campos strong { display: block; color: #f2f3f5; font-size: 13px; }
.embed-imagen { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; margin-top: 10px; border-radius: 6px; background: repeating-linear-gradient(135deg, #3b2a63 0 14px, #33255a 14px 28px); }
.embed-imagen span { padding: 2px 8px; border-radius: 4px; background: #e91916; color: #fff; font-size: 12px; font-weight: 700; text-transform: uppercase; }

/* ---------- Colección y tienda ---------- */

.resumen { color: var(--tenue); font-size: 17px; }
.progreso {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    padding: 18px;
    border: 2px solid var(--linea);
    border-radius: var(--radio);
    background: var(--panel);
    box-shadow: 6px 6px 0 var(--acento);
}
.progreso-fila { display: grid; grid-template-columns: 96px minmax(0, 1fr) 92px; align-items: center; gap: 12px; font-size: 14px; font-weight: 800; }
.progreso-fila small { color: var(--tenue); text-align: right; }
.progreso-barra { height: 14px; overflow: hidden; border: 2px solid var(--linea); border-radius: 999px; background: var(--suave); }
.progreso-barra span { display: block; min-width: 2px; height: 100%; }

.filtros { display: grid; grid-template-columns: minmax(0, 1fr) 190px 190px; gap: 10px; margin: 24px 0 18px; }

.coleccion { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.carta {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 12px;
    border: 2px solid var(--linea);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 4px 4px 0 var(--sombra);
    transition: transform .15s, box-shadow .15s;
}
.carta:hover { transform: translate(-2px, -3px) rotate(-.6deg); box-shadow: 6px 7px 0 var(--sombra); }
.carta img { width: 100%; height: 130px; margin-bottom: 6px; object-fit: contain; }
.carta strong { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.carta small { color: var(--tenue); }
.carta-cantidad { position: absolute; top: 8px; right: 8px; padding: 1px 9px; border-radius: 999px; background: var(--linea); color: #fff; font-size: 13px; font-weight: 800; }

.monedero {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: 2px solid var(--linea);
    border-radius: 999px;
    background: var(--panel);
    box-shadow: 4px 4px 0 var(--sol);
    font-size: 22px;
}
.monedero strong { font-family: var(--titulos); font-weight: 700; }
.contenido > .nota { margin: 4px 0 20px; }
.tienda { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.tienda .carta img { height: 150px; }
.tienda .carta .boton { width: 100%; margin-top: auto; }
.tienda .carta small { margin-bottom: 10px; }
.carta.comprada { box-shadow: 4px 4px 0 var(--lima); }
.carta.comprada img { opacity: .45; }
.volver { margin-top: 24px; }
.enlaces-pie { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- Stickers ---------- */

.formulario-sticker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 16px; }
.zona-sticker { flex-direction: column; justify-content: center; min-height: 260px; text-align: center; }
.previa-sticker {
    width: 160px;
    height: 160px;
    border: 2px solid var(--linea);
    border-radius: 16px;
    background: repeating-conic-gradient(var(--cuadros-1) 0 25%, var(--cuadros-2) 0 50%) 0 0 / 20px 20px;
}
.previa-sticker img { width: 100%; height: 100%; object-fit: contain; }
.campos-sticker { display: flex; flex-direction: column; gap: 14px; }
.campos-sticker .boton { align-self: flex-start; }
.opcional { color: var(--tenue); font-weight: 600; }
.lista-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-top: 16px; }
.carta-sticker img { height: 110px; }
.carta-sticker small { min-height: 1.2em; margin-bottom: 8px; overflow-wrap: anywhere; }
.carta-sticker .boton { margin-top: auto; min-height: 38px; padding: 6px 10px; font-size: 14px; }
.sticker-lottie { display: grid; place-items: center; height: 110px; margin-bottom: 6px; color: var(--tenue); font-size: 13px; text-align: center; }

/* ---------- Panel de tickets ---------- */

.estilos { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; border: 0; }
.estilos legend { margin-bottom: 6px; padding: 0; font-size: 14px; font-weight: 800; }
.estilos label { position: relative; cursor: pointer; }
.estilos input { position: absolute; opacity: 0; }
.estilos span {
    display: block;
    min-width: 80px;
    padding: 8px 14px;
    border: 2px solid var(--linea);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    transition: transform .12s;
}
.estilos input:checked + span { box-shadow: 3px 3px 0 var(--sombra); transform: translate(-1px, -1px); outline: 3px solid var(--sol); outline-offset: 1px; }
.estilos input:focus-visible + span { outline: 3px solid var(--uva); outline-offset: 2px; }

.azul { background: #5865f2; }
.verde { background: #248046; }
.rojo { background: #da373c; }
.gris { background: #4e5058; }

.botones-discord { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.boton-discord { max-width: 100%; padding: 6px 14px; border-radius: 4px; color: #fff; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }

.ejemplo { color: var(--acento-texto); font-weight: 800; overflow-wrap: anywhere; }
.nota { color: var(--tenue); font-size: 14px; }
.nota:empty { display: none; }

/* ---------- Bandeja de tickets ---------- */

.bandeja { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; min-width: 0; height: calc(100vh - 210px); min-height: 520px; }

.lista-tickets, .conversacion {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 16px;
    border: 2px solid var(--linea);
    border-radius: var(--radio);
    background: var(--panel);
    box-shadow: 6px 6px 0 var(--acento);
}
.conversacion { box-shadow: 6px 6px 0 var(--sol); }
.lista-tickets h2 { margin-bottom: 10px; font-size: 20px; }
.lista-tickets #lista { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; }

.ticket {
    display: flex;
    flex-direction: column;
    flex: none;
    width: 100%;
    padding: 9px 12px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.ticket:hover { background: var(--campo); border-color: var(--linea-suave); }
.ticket.activo { background: var(--acento-suave); border-color: var(--linea); }
.ticket strong { overflow-wrap: anywhere; }
.ticket small { color: var(--tenue); overflow-wrap: anywhere; }

.agente { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--linea-suave); }
.agente summary { color: var(--tenue); font-size: 14px; font-weight: 800; cursor: pointer; }
.agente[open] { display: flex; flex-direction: column; gap: 10px; }
.agente[open] > * { margin-top: 10px; }

.conversacion .estado { margin: auto; padding: 24px; }
#chat { display: flex; flex-direction: column; flex: 1; gap: 10px; min-height: 0; }
#chat[hidden] { display: none; }
#chat h2 { font-size: 20px; overflow-wrap: anywhere; }

.mensajes { flex: 1; display: flex; flex-direction: column; gap: 12px; min-height: 0; padding-right: 6px; overflow-y: auto; }
.mensaje { display: flex; gap: 10px; max-width: 85%; }
.mensaje > img { flex: none; width: 34px; height: 34px; border-radius: 50%; }
.mensaje.del-bot { flex-direction: row-reverse; align-self: flex-end; }

.burbuja { min-width: 0; padding: 8px 12px; border: 2px solid var(--linea); border-radius: 16px 16px 16px 4px; background: var(--campo); }
.mensaje.del-bot .burbuja { border-radius: 16px 16px 4px 16px; background: var(--acento-suave); }
.burbuja .texto { white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; }
.cabecera-mensaje { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.cabecera-mensaje strong { font-weight: 800; overflow-wrap: anywhere; }
.cabecera-mensaje time { color: var(--tenue); font-size: 12px; }

.embed-mensaje { margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--linea); border-radius: 4px; background: var(--cita-fondo); }
.adjunto { display: block; margin-top: 6px; color: var(--acento-texto); font-weight: 800; overflow-wrap: anywhere; }
.adjunto img { max-width: 100%; max-height: 240px; border-radius: 8px; }
.respondido-por { color: var(--acento-texto); font-size: 12px; font-weight: 800; }

#abrir-registro { flex: none; margin-top: 12px; }
#registro { display: flex; flex-direction: column; flex: 1; gap: 8px; min-height: 0; }
#registro[hidden] { display: none; }
#registro h2 { font-size: 20px; }
.registro-lista { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.registro-fila { padding: 8px 12px; border: 2px solid var(--linea-suave); border-radius: 12px; background: var(--campo); }
.registro-fila .cabecera-mensaje small { color: var(--tenue); overflow-wrap: anywhere; }
.registro-fila .texto { white-space: pre-wrap; overflow-wrap: anywhere; }

#responder { display: flex; gap: 8px; align-items: flex-end; }
#responder textarea { flex: 1; min-width: 0; min-height: 46px; }

/* ---------- Barra de guardado y avisos ---------- */

.guardar {
    position: fixed;
    left: calc(50% + 150px);
    bottom: 22px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(620px, calc(100% - 332px));
    padding: 10px 12px 10px 20px;
    border: 2px solid var(--linea);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 6px 6px 0 var(--sombra);
    transform: translateX(-50%);
    animation: aparecer .25s ease-out;
}
.guardar span { flex: 1; font-weight: 800; }
@keyframes aparecer { from { transform: translate(-50%, 20px); opacity: 0; } }

.tostada {
    position: fixed;
    top: 18px;
    left: calc(50% + 150px);
    z-index: 6;
    max-width: calc(100% - 340px);
    padding: 10px 18px;
    border: 2px solid var(--linea);
    border-radius: 14px;
    background: var(--lima);
    box-shadow: 4px 4px 0 var(--sombra);
    color: var(--marino);
    font-weight: 800;
    transform: translateX(-50%);
    animation: caer .25s ease-out;
}
.tostada.mala { background: #ffb3a3; }
@keyframes caer { from { transform: translate(-50%, -16px); opacity: 0; } }

.estado { padding: 64px 24px; color: var(--tenue); text-align: center; font-size: 17px; }
.estado .boton { margin-top: 16px; }

/* ---------- Pantallas más estrechas ---------- */

@media (max-width: 1240px) {
    .editor { grid-template-columns: minmax(0, 1fr); }
    .previa { position: static; order: -1; }
}

@media (max-width: 900px) {
    .app { flex-direction: column; }
    .menu { position: sticky; top: 0; z-index: 7; flex: none; height: auto; max-height: 100vh; padding: 12px 16px; gap: 12px; }
    .menu-logo { width: 44px; height: 44px; border-radius: 14px; }
    .menu-marca strong { font-size: 20px; }
    .menu-alternar { display: grid; place-items: center; width: 46px; height: 46px; border: 2px solid var(--marino-3); border-radius: 12px; background: var(--marino-2); color: var(--marino-texto); cursor: pointer; }
    .menu-cuerpo { display: none; }
    .menu.abierto .menu-cuerpo { display: flex; }
    .editor, .contenido { padding: 20px 16px 120px; }
    .cabecera h1, .contenido > h1 { font-size: 34px; }
    .bandeja { grid-template-columns: minmax(0, 1fr); height: auto; }
    .lista-tickets #lista { max-height: 220px; flex: none; }
    .conversacion { height: 75vh; min-height: 420px; }
    .guardar, .tostada { left: 50%; }
    .guardar { width: min(620px, calc(100% - 32px)); }
    .tostada { max-width: calc(100% - 32px); }
    .formulario-sticker { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .filtros { grid-template-columns: minmax(0, 1fr); }
    .progreso-fila { grid-template-columns: 76px minmax(0, 1fr) 74px; }
    .fila { grid-template-columns: minmax(0, 1fr); }
    .guardar { padding-left: 14px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Selector de tema (pie del menú) ---------- */

.menu-tema { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--marino-2); }
.menu-tema button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 4px 6px; border: 0; border-radius: 10px; background: transparent; color: var(--marino-tenue); font-size: 13px; font-weight: 800; cursor: pointer; }
.menu-tema button:hover { color: var(--marino-texto); background: var(--marino-3); }
.menu-tema button[aria-pressed="true"] { background: var(--sol); color: var(--marino); }
.menu-tema svg { width: 16px; height: 16px; }

/* ---------- Tema oscuro ---------- */

:root[data-tema="oscuro"] {
    color-scheme: dark;
    --fondo: #0a1128;
    --panel: #141e40;
    --campo: #0e1734;
    --suave: #1d2a57;
    --linea: #5267ad;
    --sombra: #02060f;
    --control: #9fb3ff;
    --linea-suave: #263463;
    --texto: #eef2ff;
    --tenue: #a9b5da;
    --migas: #8e9bc6;
    --marcador: #6c789f;
    --peligro-fondo: #3d1a17;
    --cuadros-1: #1d2a57;
    --cuadros-2: #0e1734;
    --cita-fondo: #ffffff0f;
    --ok: #86df8a;
    --error: #ff8a7a;
    --acento-suave: #4a2420;
    --acento-texto: #ffb3a3;
}
[data-tema="oscuro"] body[data-grupo="soporte"] { --acento-suave: #12384f; --acento-texto: #9fdcff; }
[data-tema="oscuro"] body[data-grupo="juegos"] { --acento-suave: #1f3b15; --acento-texto: #c4f19a; }
[data-tema="oscuro"] body[data-grupo="economia"] { --acento-suave: #3f3410; --acento-texto: #ffe27a; }
[data-tema="oscuro"] .tipo-separador { --tinte: #be9fd1; }
/* El lila es claro: encima, texto oscuro para que se lea. */
[data-tema="oscuro"] .tipo-separador .bloque-cabeza, [data-tema="oscuro"] .anadir-bloque.tipo-separador { color: var(--marino); }
[data-tema="oscuro"] .tipo-separador .bloque-cabeza small { color: #3d2f52; }
[data-tema="oscuro"] .tipo-texto { --tinte: #12384f; }
[data-tema="oscuro"] .tipo-recuadro { --tinte: #4a2420; }
[data-tema="oscuro"] .tipo-nota { --tinte: #2a2456; }
[data-tema="oscuro"] .tipo-directo { --tinte: #33224f; }
[data-tema="oscuro"] .etiqueta-estoy.si { background: #1f3b15; color: #c4f19a; }
[data-tema="oscuro"] .etiqueta-estoy.no { background: #4a2420; color: #ffb3a3; }
/* El menú ya es oscuro: en este tema se separa del fondo con una raya. */
[data-tema="oscuro"] .menu { border-right: 2px solid var(--linea-suave); }

/* ---------- Cuentas de Valorant ---------- */

.registro-cuentas { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.registro-cuentas li { padding: 6px 10px; border-radius: 10px; background: var(--campo); }
.registro-cuentas time { color: var(--tenue); font-size: 13px; font-weight: 700; }
.fila-juego .cambio-contrasena { flex: 1 1 100%; }
#form-cuenta .boton { flex: 0 0 auto; white-space: nowrap; }

/* Mensaje de la cuenta prestada: campos a la izquierda, vista previa a la derecha. */
.mensaje-cuenta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mensaje-cuenta-campos { display: flex; flex-direction: column; gap: 12px; }
.mensaje-cuenta-previa .previa-campo { margin-top: 8px; }
.mensaje-cuenta-previa .previa-campo strong { display: block; color: #f2f3f5; font-size: 13px; }
.mensaje-cuenta-previa .previa-campo span { color: #dbdee1; font-size: 14px; }
.mensaje-cuenta-previa .previa-campo .md-bloque-codigo { display: block; margin: 4px 0 0; color: #dbdee1; }
.mensaje-cuenta-previa .botones-discord { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.previa-efimero { display: block; margin-top: 6px; color: #949ba4; font-size: 12px; }
@media (max-width: 900px) { .mensaje-cuenta { grid-template-columns: minmax(0, 1fr); } }
