/* =========================================================
 *  KumoBot · estilo "sticker de noche"
 *  Paneles con contorno y sombra sólida, como los emojis de Kumo.
 * ========================================================= */
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-Medium.ttf') format('truetype'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/Poppins-Bold.ttf') format('truetype'); font-weight: 700 900; font-display: swap; }

:root {
    --noche: #1A1442;
    --noche2: #120D33;
    --panel: #261E5E;
    --panel2: #31287A;
    --hueco: #1C1650;      /* campos y zonas hundidas */
    --linea: #4A3F9A;
    --tinta: #0B0726;      /* sombra sólida */
    --nube: #F4F7FF;
    --texto: #EDEBFF;
    --suave: #B3ADE3;
    --cian: #7FD8FF;
    --rosa: #FF8FB8;
    --oro: #FFCB45;
    --menta: #6EE7B0;
    --lila: #B79CFF;
    --rojo: #FF6B81;
    --naranja: #FF9F5A;
    --r-grande: 26px;
    --r-medio: 16px;
    --r-chico: 12px;
}

* { box-sizing: border-box; }
html { background: var(--noche2); }
html, body { margin: 0; min-height: 100vh; }
body {
    font: 500 15px/1.55 'Poppins', system-ui, sans-serif;
    color: var(--texto);
    background:
        radial-gradient(1000px 520px at 80% -8%, #3B2C8C 0%, transparent 62%),
        radial-gradient(800px 480px at -5% 30%, #22357A 0%, transparent 60%),
        linear-gradient(180deg, var(--noche) 0%, #17113D 60%, #211654 100%);
    background-attachment: fixed;
}
/* nubes del horizonte */
body::after {
    content: ''; position: fixed; left: -5%; right: -5%; bottom: -60px; height: 220px; z-index: -1; pointer-events: none;
    background:
        radial-gradient(160px 90px at 8% 70%, #2E2672 98%, transparent 100%),
        radial-gradient(220px 120px at 22% 85%, #2E2672 98%, transparent 100%),
        radial-gradient(180px 100px at 40% 78%, #2E2672 98%, transparent 100%),
        radial-gradient(260px 130px at 60% 92%, #2E2672 98%, transparent 100%),
        radial-gradient(170px 95px at 78% 75%, #2E2672 98%, transparent 100%),
        radial-gradient(230px 120px at 95% 88%, #2E2672 98%, transparent 100%);
    opacity: .55;
}
a { color: var(--cian); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; border-radius: 8px; }
.oculto { display: none !important; }

/* íconos y emojis */
.ic { width: 1.4em; height: 1.4em; flex: none; vertical-align: -0.35em; }
.ic.g { width: 28px; height: 28px; }
.ic.gg { width: 40px; height: 40px; }
img.emoji, img.em { width: 1.35em; height: 1.35em; vertical-align: -0.3em; object-fit: contain; }

/* estrellas */
.cielo { position: fixed; inset: 0; pointer-events: none; z-index: -2; overflow: hidden; }
.cielo i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; opacity: .55; animation: titilar 3.5s infinite ease-in-out; }
.cielo i:nth-child(5n) { width: 5px; height: 5px; background: var(--oro); box-shadow: 0 0 8px var(--oro); }
@keyframes titilar { 50% { opacity: .12; } }

/* ---------- barra superior ---------- */
.barra {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 18px;
    padding: 12px 28px 10px;
    background: var(--panel);
    border-bottom: 2px solid var(--linea);
}
/* borde de nube */
.barra::after {
    content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: none;
    background: radial-gradient(14px 12px at 14px 0, var(--panel) 96%, transparent 100%) 0 -2px / 28px 14px repeat-x;
    filter: drop-shadow(0 2px 0 var(--linea));
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 21px; color: #fff; letter-spacing: -.01em; }
.logo img { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--tinta); background: var(--cian); }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 6px; margin-left: 10px; flex: 1; }
.nav a { display: inline-flex; align-items: center; gap: 8px; color: var(--suave); padding: 8px 14px; border-radius: 999px; border: 2px solid transparent; }
.nav a:hover { color: #fff; background: var(--panel2); text-decoration: none; }
.nav a.activo { color: #fff; background: var(--panel2); border-color: var(--linea); }
.usuario { display: flex; align-items: center; gap: 10px; }
.usuario .yo { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; background: var(--hueco); border: 2px solid var(--linea); }
.usuario .yo img { width: 32px; height: 32px; border-radius: 50%; }
.usuario .yo span { font-weight: 700; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- botones (caramelo) ---------- */
.btn {
    --c: var(--cian); --t: #15103A;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 2px solid var(--tinta); border-radius: var(--r-chico); padding: 9px 18px;
    font: 700 14px 'Poppins', sans-serif; cursor: pointer; color: var(--t);
    background: var(--c);
    box-shadow: 0 4px 0 var(--tinta), inset 0 -3px 0 rgba(0, 0, 0, .12), inset 0 2px 0 rgba(255, 255, 255, .45);
    transition: transform .08s ease, box-shadow .08s ease, filter .12s;
    text-decoration: none !important;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--tinta), inset 0 -2px 0 rgba(0, 0, 0, .12); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.secundario { --c: var(--panel2); --t: var(--texto); box-shadow: 0 4px 0 var(--tinta), inset 0 2px 0 rgba(255, 255, 255, .08); }
.btn.rosa { --c: var(--rosa); }
.btn.lila { --c: #9D86FF; --t: #fff; }
.btn.peligro { --c: var(--rojo); --t: #2A0712; }
.btn.chico { padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn.grande { padding: 13px 26px; font-size: 16px; border-radius: 16px; }
.btn.redondo { padding: 6px; border-radius: 50%; }
.btn .ic { width: 22px; height: 22px; }

/* ---------- estructura ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 40px 24px 120px; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.15; letter-spacing: -.015em; font-weight: 800; }
h1 { font-size: 36px; font-weight: 900; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.tit { display: flex; align-items: center; gap: 10px; }
.tit .ic { width: 30px; height: 30px; }
.sub { color: var(--suave); margin: 0 0 20px; max-width: 70ch; }
.tarjeta {
    background: var(--panel); border: 2px solid var(--linea); border-radius: var(--r-grande);
    padding: 24px; box-shadow: 0 6px 0 var(--tinta);
}
.hueco { background: var(--hueco); border: 2px solid var(--linea); border-radius: var(--r-medio); padding: 16px; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fila { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.cabecera h1 { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.cabecera h1 .ic { width: 44px; height: 44px; }
.cabecera .sub { margin: 0; }
.volver { display: inline-flex; align-items: center; gap: 8px; color: var(--suave); }
.volver .ic { width: 26px; height: 26px; }
@media (max-width: 900px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .editor { grid-template-columns: minmax(0, 1fr) !important; } }

/* ---------- portada ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; align-items: center; padding: 10px 0 40px; }
.hero h1 { font-size: clamp(38px, 5.2vw, 62px); line-height: 1.02; letter-spacing: -.035em; margin-bottom: 18px; }
.hero p.lead { font-size: 18px; color: var(--suave); max-width: 52ch; margin: 0 0 26px; }
.hero .nota { color: var(--suave); font-size: 14px; margin-top: 18px; display: flex; align-items: center; gap: 8px; }
.escena { position: relative; aspect-ratio: 1; max-width: 460px; width: 100%; justify-self: center; }
.escena .halo { position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(127, 216, 255, .35), transparent 68%); }
.escena .kumo { position: absolute; inset: 18%; width: 64%; border-radius: 50%; animation: flotar 5s ease-in-out infinite; filter: drop-shadow(0 18px 0 rgba(11, 7, 38, .55)); }
.escena .orb { position: absolute; width: 17%; animation: flotar 4s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(11, 7, 38, .5)); }
.escena .orb:nth-of-type(1) { left: 4%; top: 18%; animation-delay: -1s; }
.escena .orb:nth-of-type(2) { right: 2%; top: 10%; width: 14%; animation-delay: -2.2s; }
.escena .orb:nth-of-type(3) { right: 0; bottom: 22%; animation-delay: -.5s; }
.escena .orb:nth-of-type(4) { left: 6%; bottom: 10%; width: 14%; animation-delay: -3s; }
.escena .orb:nth-of-type(5) { left: 44%; bottom: -2%; width: 13%; animation-delay: -1.6s; }
.escena .orb:nth-of-type(6) { left: 40%; top: -2%; width: 12%; animation-delay: -2.7s; }
@keyframes flotar { 50% { transform: translateY(-12px) rotate(-3deg); } }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .escena { max-width: 320px; } }

.pasos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.paso { padding: 22px; border-radius: var(--r-grande); border: 2px solid var(--tinta); box-shadow: 0 6px 0 var(--tinta); color: #15103A; }
.paso:nth-child(1) { background: var(--cian); }
.paso:nth-child(2) { background: var(--oro); }
.paso:nth-child(3) { background: var(--rosa); }
.paso:nth-child(4) { background: var(--menta); }
.paso .ic { width: 52px; height: 52px; margin-bottom: 10px; filter: drop-shadow(0 3px 0 rgba(11, 7, 38, .25)); }
.paso h3 { color: #15103A; }
.paso p { margin: 0; font-size: 14px; color: #2A2357; }
@media (max-width: 900px) { .pasos { grid-template-columns: 1fr 1fr; } }

/* ---------- servidores ---------- */
.servidor { display: flex; align-items: center; gap: 14px; }
.servidor .ico { width: 56px; height: 56px; border-radius: 18px; background: var(--panel2); border: 2px solid var(--tinta); display: grid; place-items: center; font-weight: 900; font-size: 22px; flex: none; overflow: hidden; }
.servidor .ico img { width: 100%; height: 100%; object-fit: cover; }
.servidor .nombre { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta.servidor { padding: 18px; }
.tarjeta.servidor.sin-bot { background: transparent; border-style: dashed; box-shadow: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; background: var(--hueco); border: 2px solid var(--linea); font-size: 12.5px; font-weight: 600; color: var(--suave); white-space: nowrap; }
.chip .ic { width: 18px; height: 18px; }
.chip.on { color: #0F3B29; background: var(--menta); border-color: var(--tinta); }
.chip.off { color: #3B0D18; background: var(--rojo); border-color: var(--tinta); }
.chip.aviso { color: #3A2A00; background: var(--oro); border-color: var(--tinta); }
.chip.click { cursor: pointer; }
.chip.click:hover { color: #fff; border-color: var(--cian); }
.metas { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--suave); font-size: 13px; }
.metas > span { display: inline-flex; align-items: center; gap: 6px; }
.metas .ic { width: 18px; height: 18px; }

/* ---------- pestañas ---------- */
.pestanas { display: flex; gap: 6px; flex-wrap: wrap; margin: 24px 0; padding: 6px; background: var(--hueco); border: 2px solid var(--linea); border-radius: 999px; width: fit-content; max-width: 100%; }
.pestanas button { display: inline-flex; align-items: center; gap: 8px; background: none; border: 2px solid transparent; color: var(--suave); font: 700 14px 'Poppins'; padding: 7px 16px 7px 10px; cursor: pointer; border-radius: 999px; }
.pestanas button:hover { color: #fff; }
.pestanas button.activo { color: #15103A; background: var(--cian); border-color: var(--tinta); box-shadow: 0 3px 0 var(--tinta); }
.pestanas .ic { width: 24px; height: 24px; }
.pestanas .num { background: var(--rosa); color: #3A0D20; border-radius: 999px; padding: 0 7px; font-size: 12px; border: 2px solid var(--tinta); }

/* ---------- formularios ---------- */
label { display: block; font-size: 13px; color: var(--suave); margin: 0 0 6px; font-weight: 600; }
input[type=text], input[type=number], input[type=url], select, textarea {
    width: 100%; background: var(--hueco); color: var(--texto);
    border: 2px solid var(--linea); border-radius: var(--r-chico); padding: 10px 12px;
    font: 500 14px 'Poppins', sans-serif; outline: none;
}
textarea { min-height: 130px; resize: vertical; }
textarea.codigo { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--cian); box-shadow: 0 0 0 3px rgba(127, 216, 255, .2); }
input[type=color] { width: 54px; height: 44px; border: 2px solid var(--linea); border-radius: var(--r-chico); background: var(--hueco); padding: 3px; cursor: pointer; }
.campo { margin-bottom: 16px; }
.ayuda { font-size: 12.5px; color: var(--suave); margin-top: 6px; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--hueco); border: 2px solid var(--linea); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: var(--suave); border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--menta); border-color: var(--tinta); }
.switch input:checked + span::before { transform: translateX(22px); background: #fff; box-shadow: 0 0 0 2px var(--tinta); }
.switch input:focus-visible + span { outline: 3px solid var(--oro); outline-offset: 2px; }

/* ---------- tablas ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--hueco); vertical-align: middle; }
th { color: var(--suave); font-weight: 700; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
td input, td select { padding: 8px 10px; }
td select { min-width: 140px; }
td .fuente { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
td .fuente .ic { width: 28px; height: 28px; }

/* ---------- plantillas ---------- */
.plantilla { cursor: pointer; text-align: center; padding: 18px 12px; transition: transform .12s; }
.plantilla:hover { transform: translateY(-3px); }
.plantilla.sel { border-color: var(--tinta); background: var(--cian); color: #15103A; }
.plantilla.sel .ayuda { color: #2A2357; }
.plantilla .emojis { font-size: 30px; margin-bottom: 6px; display: flex; justify-content: center; gap: 4px; }
.plantilla .emojis img.emoji { width: 40px; height: 40px; }

/* ---------- selector de emojis ---------- */
.emoji-campo { display: flex; gap: 8px; align-items: center; }
.emoji-campo .muestra { width: 46px; height: 46px; border-radius: var(--r-chico); background: var(--hueco); border: 2px solid var(--linea); display: grid; place-items: center; font-size: 22px; flex: none; }
.emoji-campo .muestra img { width: 30px; height: 30px; }
.picker { position: absolute; z-index: 50; width: 330px; max-height: 320px; overflow: auto; background: var(--panel); border: 2px solid var(--tinta); border-radius: var(--r-medio); padding: 10px; box-shadow: 0 6px 0 var(--tinta); }
.picker h4 { margin: 8px 4px 6px; font-size: 12.5px; color: var(--suave); }
.picker .lista { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.picker button { background: none; border: 0; border-radius: 10px; padding: 4px; cursor: pointer; font-size: 20px; }
.picker button:hover { background: var(--panel2); }
.picker img { width: 28px; height: 28px; }

/* ---------- vista previa estilo Discord ---------- */
.discord { background: #313338; border-radius: var(--r-medio); padding: 16px; font-family: 'Poppins', sans-serif; border: 2px solid var(--tinta); }
.discord .cab { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.discord .cab img { width: 40px; height: 40px; border-radius: 50%; }
.discord .bot { font-weight: 700; color: #f2f3f5; }
.discord .app { background: #5865f2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.discord .hora { color: #949ba4; font-size: 12px; }
.discord .bloque { margin-left: 48px; background: #2b2d31; border-radius: 8px; border-left: 4px solid var(--cian); padding: 12px 14px; color: #dbdee1; font-size: 15px; display: flex; gap: 12px; }
.discord .bloque .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.discord .bloque .mini { width: 80px; height: 80px; border-radius: 8px; flex: none; object-fit: cover; }
.discord h1, .discord h2, .discord h3 { color: #f2f3f5; margin: 4px 0; }
.discord h1 { font-size: 24px; } .discord h2 { font-size: 20px; } .discord h3 { font-size: 17px; }
.discord .peq { font-size: 12px; color: #949ba4; }
.discord .cita { border-left: 3px solid #4e5058; padding-left: 10px; }
.discord code { background: #1e1f22; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.discord .mencion { background: rgba(88, 101, 242, .3); color: #c9cdfb; padding: 0 3px; border-radius: 4px; }
.discord p { margin: 2px 0; }
.discord .apagado { display: flex; align-items: center; gap: 10px; color: #b5bac1; margin: 0; }

/* ---------- editor de mensajes ---------- */
.editor { display: grid; grid-template-columns: 270px 1fr; gap: 20px; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.lista-msg { padding: 10px; }
.lista-msg button { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 2px solid transparent; color: var(--texto); padding: 10px 12px; border-radius: var(--r-medio); cursor: pointer; font: 600 14px 'Poppins'; margin-bottom: 4px; }
.lista-msg button:hover { background: var(--panel2); }
.lista-msg button.activo { background: var(--hueco); border-color: var(--cian); }
.lista-msg small { display: block; color: var(--suave); font-size: 12px; font-weight: 500; }
.lista-msg .estado { margin-top: 4px; }

/* ---------- top ---------- */
.top ol { list-style: none; padding: 0; margin: 0; }
.top li { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-chico); }
.top li:nth-child(odd) { background: var(--hueco); }
.top img.av { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--tinta); }
.top .pos { width: 32px; text-align: center; font-weight: 800; color: var(--suave); }
.top .pos img { width: 30px; height: 30px; }

/* ---------- estadísticas ---------- */
.stat { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat .ic { width: 48px; height: 48px; }
.stat .num { font-size: 30px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.stat .lab { color: var(--suave); font-size: 13px; margin-top: 4px; }

/* ---------- soporte y tickets ---------- */
.bandeja { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .bandeja { grid-template-columns: 1fr; } }
.ticket-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; margin-bottom: 12px; cursor: pointer; color: inherit; border-radius: var(--r-medio); box-shadow: 0 4px 0 var(--tinta); }
.ticket-item:hover { text-decoration: none; border-color: var(--cian); }
.ticket-item.sel { border-color: var(--cian); background: var(--panel2); }
.ticket-item .av { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--tinta); flex: none; }
.ticket-item .cuerpo { flex: 1; min-width: 0; }
.ticket-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-cab { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 16px; border-bottom: 2px solid var(--hueco); }
.conversa { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 86%; }
.msg .av { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--tinta); flex: none; background: var(--cian); }
.msg.usuario { align-self: flex-end; flex-direction: row-reverse; }
.msg.soporte { align-self: flex-start; }
.burbuja { padding: 12px 15px; border-radius: 20px; border: 2px solid var(--tinta); box-shadow: 0 4px 0 var(--tinta); white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.msg.soporte .burbuja { background: var(--nube); color: #1B1640; border-bottom-left-radius: 6px; }
.msg.usuario .burbuja { background: #4C3DB0; color: #fff; border-bottom-right-radius: 6px; }
.burbuja .quien { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; margin-bottom: 4px; white-space: normal; opacity: .8; }
.burbuja .quien .ic { width: 16px; height: 16px; }
.adjuntos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 8px; white-space: normal; }
.adjuntos:first-child { margin-top: 0; }
.adj { border-radius: 14px; overflow: hidden; border: 2px solid var(--tinta); background: var(--hueco); }
.adj img { display: block; width: 100%; height: 150px; object-fit: cover; cursor: zoom-in; }
.adj video { display: block; width: 100%; max-height: 240px; background: #000; }
.adj.audio, .adj.video { grid-column: 1 / -1; }
.adj.audio { display: flex; align-items: center; gap: 10px; padding: 10px; color: var(--texto); }
.adj.audio audio { flex: 1; min-width: 0; height: 40px; }
.adj.audio .ic { width: 34px; height: 34px; }
.adj .pie { display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 12px; color: var(--suave); }
.adj .pie a { margin-left: auto; font-weight: 600; }

/* compositor */
.compositor { background: var(--hueco); border: 2px solid var(--linea); border-radius: 22px; padding: 10px; transition: border-color .12s; }
.compositor.arrastrando { border-color: var(--cian); border-style: dashed; background: #221B5C; }
.compositor textarea { border: 0; background: transparent; min-height: 90px; box-shadow: none !important; padding: 8px 10px; }
.compositor .herramientas { display: flex; align-items: center; gap: 8px; border-top: 2px solid var(--panel); padding-top: 10px; }
.compositor .herramientas .espacio { flex: 1; font-size: 12px; color: var(--suave); }
.btn-ic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 2px solid var(--linea); background: var(--panel); cursor: pointer; transition: transform .08s; }
.btn-ic:hover { border-color: var(--cian); }
.btn-ic:active { transform: translateY(2px); }
.btn-ic .ic { width: 28px; height: 28px; }
.btn-ic.grabando { background: var(--rojo); border-color: var(--tinta); animation: latido 1s infinite; }
@keyframes latido { 50% { transform: scale(1.06); } }
.pendientes { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 10px; }
.pendientes:empty { display: none; }
.pend { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 30px 6px 6px; border-radius: 14px; background: var(--panel); border: 2px solid var(--linea); max-width: 240px; font-size: 12.5px; }
.pend img, .pend .mini { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--hueco); }
.pend .mini .ic { width: 28px; height: 28px; }
.pend .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pend .nom small { display: block; color: var(--suave); }
.pend .quitar { position: absolute; top: 4px; right: 4px; background: none; border: 0; cursor: pointer; padding: 0; }
.pend .quitar .ic { width: 22px; height: 22px; }
.pend .barra-carga { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 4px; border-radius: 4px; background: var(--hueco); overflow: hidden; }
.pend .barra-carga i { display: block; height: 100%; width: 0; background: var(--cian); transition: width .2s; }
.pend.error { border-color: var(--rojo); }

/* visor de imágenes */
.visor { position: fixed; inset: 0; z-index: 95; background: rgba(8, 5, 28, .88); display: grid; place-items: center; padding: 30px; cursor: zoom-out; }
.visor img { max-width: 100%; max-height: 100%; border-radius: 16px; border: 2px solid var(--tinta); box-shadow: 0 8px 0 var(--tinta); }

/* ---------- avisos ---------- */
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: 18px; background: var(--nube); color: #1B1640; font-weight: 700; border: 2px solid var(--tinta); box-shadow: 0 5px 0 var(--tinta); max-width: 400px; animation: entrar .22s cubic-bezier(.3, 1.5, .6, 1); }
.toast .ic { width: 32px; height: 32px; }
.toast.error { background: #FFE1E6; }
@keyframes entrar { from { transform: translateY(16px) scale(.96); opacity: 0; } }
.modal-fondo { position: fixed; inset: 0; background: rgba(8, 5, 28, .7); z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal { max-width: 460px; width: 100%; }
.vacio { text-align: center; color: var(--suave); padding: 44px 16px; }
.vacio img { width: 96px; margin-bottom: 10px; border-radius: 50%; }
.vacio .ic { width: 64px; height: 64px; margin-bottom: 8px; }
.vacio h2 { color: var(--texto); }
.vacio .sub { margin-left: auto; margin-right: auto; }
.cargando { display: grid; place-items: center; gap: 12px; padding: 80px; color: var(--suave); }
.cargando img { width: 72px; border-radius: 50%; animation: flotar 1.4s ease-in-out infinite; }
.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-medio); background: #3A3070; border: 2px solid var(--oro); color: #FFF1C7; font-size: 14px; }
.aviso .ic { width: 28px; height: 28px; }
.aviso.info { background: #22346F; border-color: var(--cian); color: #D8F3FF; }
footer { text-align: center; color: var(--suave); font-size: 13px; padding: 30px; display: flex; justify-content: center; align-items: center; gap: 8px; }
footer img { width: 22px; height: 22px; }

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

/* ---------- minijuegos ---------- */
.juegos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .juegos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .juegos { grid-template-columns: 1fr; } }
.juego { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 14px; border-radius: var(--r-medio); background: var(--hueco); border: 2px solid var(--linea); color: var(--texto); cursor: pointer; transition: opacity .15s, border-color .15s; }
.juego:hover { border-color: var(--cian); }
.juego .cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.juego .cab .ic { width: 42px; height: 42px; }
.juego b { font-size: 15px; }
.juego .desc { font-size: 13px; color: var(--suave); flex: 1; }
.juego .chip { white-space: normal; }
.juego.apagado { opacity: .5; }
.juego.apagado .cab .ic { filter: grayscale(1); }

/* ---------- canales ---------- */
.modos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .modos { grid-template-columns: 1fr; } }
.modos button { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 12px; border-radius: var(--r-medio); background: var(--hueco); border: 2px solid var(--linea); color: var(--texto); font: 600 14px 'Poppins'; cursor: pointer; }
.modos button .ic { width: 34px; height: 34px; }
.modos button small { display: block; color: var(--suave); font-weight: 500; font-size: 12.5px; }
.modos button.activo { border-color: var(--tinta); background: var(--cian); color: #15103A; box-shadow: 0 4px 0 var(--tinta); }
.modos button.activo small { color: #2A2357; }
.buscador { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--hueco); border: 2px solid var(--linea); border-radius: var(--r-chico); padding: 0 10px; }
.buscador:focus-within { border-color: var(--cian); }
.buscador input { border: 0 !important; background: transparent; box-shadow: none !important; padding: 9px 0; }
.canales { max-height: 430px; overflow: auto; margin-top: 12px; padding-right: 4px; }
.grupo { margin-bottom: 14px; }
.grupo .cat { font-size: 12.5px; font-weight: 800; color: var(--suave); }
.link { background: none; border: 0; color: var(--cian); font: 600 12.5px 'Poppins'; cursor: pointer; padding: 2px 4px; }
.pildoras { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.canal { margin: 0; cursor: pointer; }
.canal input { position: absolute; opacity: 0; pointer-events: none; }
.canal span { display: inline-flex; align-items: center; gap: 4px; padding: 6px 13px; border-radius: 999px; background: var(--hueco); border: 2px solid var(--linea); color: var(--texto); font-size: 13.5px; font-weight: 600; transition: transform .08s; }
.canal span i { font-style: normal; color: var(--suave); font-weight: 800; }
.canal:hover span { border-color: var(--cian); }
.canal input:checked + span { background: var(--menta); color: #0F3B29; border-color: var(--tinta); box-shadow: 0 3px 0 var(--tinta); }
.canal input:checked + span i { color: #0F3B29; }
.canal input:focus-visible + span { outline: 3px solid var(--oro); outline-offset: 2px; }

/* cifras de la portada */
.cifras { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.cifras > div { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: 18px; background: var(--panel); border: 2px solid var(--linea); box-shadow: 0 4px 0 var(--tinta); }
.cifras b { display: block; font-size: 22px; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; }
.cifras span { color: var(--suave); font-size: 13px; }
.cifras b { color: var(--texto); }

/* =========================================================
 *  Celulares y tablets
 * ========================================================= */
@media (max-width: 760px) {
    .barra { gap: 8px; padding: 10px 14px 8px; }
    .nav { margin-left: 4px; gap: 2px; }
    .nav a { padding: 7px 9px; }
    .nav a span, .usuario .yo span, #salir span { display: none; }
    .usuario .yo { padding: 3px; }
    #salir { padding: 6px 8px; }
    main { padding: 26px 14px 100px; }
    .tarjeta { padding: 18px; border-radius: 22px; }
    h1 { font-size: 28px; }
    .cabecera h1 .ic { width: 36px; height: 36px; }
    /* pestañas en una sola fila que se desliza */
    .pestanas { flex-wrap: nowrap; overflow-x: auto; width: 100%; border-radius: 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .pestanas::-webkit-scrollbar { display: none; }
    .pestanas button { white-space: nowrap; flex: none; }
    /* tablas: se deslizan de lado en vez de apretar los campos */
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    td input, td select { min-width: 96px; }
    td input[type=number] { min-width: 80px; }
    /* tickets */
    .msg { max-width: 100%; gap: 6px; }
    .msg .av { width: 30px; height: 30px; }
    .compositor .herramientas .espacio { visibility: hidden; }
    .adjuntos { grid-template-columns: minmax(0, 1fr); }
    .ticket-cab { flex-direction: column-reverse; align-items: flex-start; }
    .stat { padding: 14px; gap: 10px; }
    .stat .ic { width: 36px; height: 36px; }
    .stat .num { font-size: 24px; }
    .emoji-campo input { min-width: 0; }
    .toast { left: 14px; right: 14px; bottom: 14px; max-width: none; }
    .escena { max-width: 300px; }
    .cifras > div { flex: 1; }
}
@media (max-width: 430px) {
    .logo span { display: none; }
    .pasos { grid-template-columns: 1fr; }
    .juegos { grid-template-columns: 1fr; }
    .hero h1 { font-size: 36px; }
}
@media (max-width: 380px) { .g4 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- tutorial ---------- */
.tutorial { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.indice { position: sticky; top: 96px; padding: 10px; }
.indice a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-medio); color: var(--texto); font-weight: 700; font-size: 14px; }
.indice a:hover { background: var(--panel2); text-decoration: none; }
.indice a .ic { width: 30px; height: 30px; }
.indice small { display: block; color: var(--suave); font-weight: 500; font-size: 12px; }
.capitulo { margin-bottom: 20px; scroll-margin-top: 96px; }
.pantalla { border-radius: var(--r-medio); overflow: hidden; border: 2px solid var(--tinta); box-shadow: 0 6px 0 var(--tinta); background: var(--noche2); aspect-ratio: 880 / 550; }
.pantalla img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pasos-lista { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: paso; display: grid; gap: 10px; }
.pasos-lista li { counter-increment: paso; display: flex; gap: 12px; align-items: flex-start; }
.pasos-lista li::before { content: counter(paso); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 13px; background: var(--cian); color: #15103A; border: 2px solid var(--tinta); }
@media (max-width: 900px) {
    .tutorial { grid-template-columns: minmax(0, 1fr); }
    .indice { position: static; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
    .indice a { flex: none; }
}

/* ---------- términos y privacidad ---------- */
.legal { max-width: 820px; margin: 0 auto; padding: 32px 36px; }
.legal .intro { font-size: 16px; margin: 0 0 8px; }
.legal section { padding-top: 22px; margin-top: 22px; border-top: 2px solid var(--hueco); }
.legal h2 { font-size: 20px; }
.legal p, .legal li { color: #D6D2F5; max-width: 72ch; }
.legal ul { padding-left: 20px; margin: 8px 0; display: grid; gap: 6px; }
.legal li::marker { color: var(--cian); }
.legal code { background: var(--hueco); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
footer { flex-wrap: wrap; }
@media (max-width: 760px) { .legal { padding: 22px 18px; } }
