/* =====================================================================
   El Mandiokero TV - Tema propio (dark + acentos bandera Paraguay)
   ===================================================================== */

:root {
    --py-red: #d52b1e;
    --py-red-dim: #a8221a;
    --py-blue: #0038a8;
    --py-blue-light: #2f5bd6;
    --py-white: #ffffff;

    --bg-0: #06070a;
    --bg-1: #0d0f14;
    --bg-2: #14171d;
    --surface: #191d24;
    --surface-2: #21262f;
    --border-soft: rgba(255, 255, 255, 0.08);

    --text: #eef0f2;
    --text-muted: #9aa2ad;
    --text-faint: #6b7280;

    --accent-gradient: linear-gradient(135deg, var(--py-red) 0%, var(--py-blue) 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(213, 43, 30, 0.18) 0%, rgba(0, 56, 168, 0.18) 100%);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-glow-red: 0 0 24px rgba(213, 43, 30, 0.35);
    --shadow-glow-blue: 0 0 24px rgba(0, 56, 168, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-0);
    color: var(--text);
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main {
    flex: 1;
}

a {
    color: var(--py-blue-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--py-red);
}

::selection {
    background: var(--py-red);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--py-red-dim); }

.text-muted-py { color: var(--text-muted) !important; }
.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section {
    padding: 5rem 0;
}

.section-title {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--py-red);
}

/* =====================================================================
   Navbar
   ===================================================================== */
.navbar-mandioka {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    padding: 1.1rem 0;
    background: transparent;
    transition: background 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

.navbar-mandioka.scrolled {
    background: rgba(9, 11, 15, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0.6rem 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-soft);
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--text) !important;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow-red);
    font-size: 1.15rem;
}

.brand-icon-img {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-glow-red);
    flex-shrink: 0;
}

.brand-logo:hover { color: var(--text) !important; }

.navbar-mandioka .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    position: relative;
}

.navbar-mandioka .nav-link:hover,
.navbar-mandioka .nav-link.active {
    color: var(--text);
}

.navbar-mandioka .nav-link.active::after {
    content: '';
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.btn-py {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-py:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-red);
    filter: brightness(1.08);
}

.btn-outline-py {
    border: 1px solid var(--border-soft);
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-outline-py:hover {
    color: var(--text);
    border-color: var(--py-red);
    background: rgba(213, 43, 30, 0.08);
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
    position: relative;
    padding: 11rem 0 7rem;
    overflow: hidden;
    background: radial-gradient(ellipse at top, #10131a 0%, var(--bg-0) 60%);
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.45;
    z-index: 0;
    animation: floatBlob 14s ease-in-out infinite;
}

.hero-blob.blob-red {
    width: 480px;
    height: 480px;
    background: var(--py-red);
    top: -140px;
    left: -120px;
}

.hero-blob.blob-blue {
    width: 520px;
    height: 520px;
    background: var(--py-blue);
    bottom: -180px;
    right: -140px;
    animation-delay: -6s;
}

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.08); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.badge-live-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-soft);
    padding: 0.4rem 0.9rem;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dot-live {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff3b30;
    box-shadow: 0 0 0 rgba(255, 59, 48, 0.6);
    animation: pulseLive 1.6s infinite;
}

@keyframes pulseLive {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.hero-title {
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 620px;
}

.hero-flag-bar {
    width: 64px;
    height: 6px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--py-red) 0 33%, #fff 33% 66%, var(--py-blue) 66% 100%);
    margin-bottom: 1.5rem;
}

/* Stats */
.stat-box {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border-soft);
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =====================================================================
   Cards de canal
   ===================================================================== */
.channel-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.channel-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(213, 43, 30, 0.4);
}

.channel-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, var(--surface-2), var(--bg-1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--text-faint);
    overflow: hidden;
}

.channel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.channel-card:hover .channel-thumb img {
    transform: scale(1.08);
}

.channel-badge-live {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.channel-badge-featured {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
}

.channel-body {
    padding: 1.1rem;
}

.channel-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    margin-bottom: 0.5rem;
}

.category-chip {
    border: 1px solid var(--border-soft);
    background: var(--surface);
    color: var(--text-muted);
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-chip:hover,
.category-chip.active {
    color: #fff;
    background: var(--accent-gradient);
    border-color: transparent;
}

/* =====================================================================
   Formularios (login, registro, contacto, etc.)
   ===================================================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    background: radial-gradient(ellipse at top, #10131a 0%, var(--bg-0) 65%);
    position: relative;
    overflow: hidden;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 2;
}

.form-control-py,
.form-select-py {
    background: var(--bg-1);
    border: 1px solid var(--border-soft);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.9rem;
}

.form-control-py:focus,
.form-select-py:focus {
    background: var(--bg-1);
    border-color: var(--py-red);
    color: var(--text);
    box-shadow: 0 0 0 0.2rem rgba(213, 43, 30, 0.18);
}

.form-control-py::placeholder { color: var(--text-faint); }

.form-label-py {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.invalid-feedback-py {
    color: #ff6b6b;
    font-size: 0.82rem;
    margin-top: 0.3rem;
}

/* Honeypot: invisible para humanos, visible para bots simples */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* =====================================================================
   Flash messages / toasts
   ===================================================================== */
.toast-stack {
    position: fixed;
    top: 90px;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 380px;
}

.toast-py {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-left: 4px solid var(--py-blue);
    color: var(--text);
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    animation: toastIn 0.35s ease;
}

.toast-py.toast-success { border-left-color: #2fbf71; }
.toast-py.toast-error,
.toast-py.toast-danger { border-left-color: var(--py-red); }
.toast-py.toast-warning { border-left-color: #f5a623; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =====================================================================
   Cookie consent + welcome modal
   ===================================================================== */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -200px;
    z-index: 1900;
    background: rgba(13, 15, 20, 0.97);
    border-top: 1px solid var(--border-soft);
    backdrop-filter: blur(10px);
    padding: 1.2rem 0;
    transition: bottom 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.cookie-banner.show {
    bottom: 0;
}

.modal-py .modal-content {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    color: var(--text);
}

.welcome-flag-strip {
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--py-red) 0 33%, #fff 33% 66%, var(--py-blue) 66% 100%);
}

/* =====================================================================
   Reproductor / canal
   ===================================================================== */
.player-wrapper {
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.player-wrapper.is-live {
    box-shadow: 0 0 0 2px rgba(213, 43, 30, 0.5), 0 0 34px rgba(213, 43, 30, 0.28), var(--shadow-soft);
    animation: liveGlow 3s ease-in-out infinite;
}

@keyframes liveGlow {
    0%, 100% { box-shadow: 0 0 0 2px rgba(213, 43, 30, 0.5), 0 0 24px rgba(213, 43, 30, 0.22), var(--shadow-soft); }
    50% { box-shadow: 0 0 0 2px rgba(213, 43, 30, 0.75), 0 0 40px rgba(213, 43, 30, 0.4), var(--shadow-soft); }
}

.player-wrapper video {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
    background: #000;
}

.z-2 { z-index: 2; }

/* Plyr: tema propio (rojo PY como color principal) */
:root {
    --plyr-color-main: var(--py-red);
    --plyr-video-background: #000;
    --plyr-control-radius: 8px;
    --plyr-font-family: 'Poppins', 'Segoe UI', sans-serif;
}

.viewer-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Única insignia "EN VIVO" del reproductor, siempre en la misma esquina. */
.player-live-badge {
    position: absolute;
    top: 0.9rem;
    left: 0.9rem;
    z-index: 5;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    pointer-events: none;
}

.player-live-badge .viewer-counter { pointer-events: auto; }

/* Pill "EN VIVO" propia del reproductor (a diferencia de .channel-badge-live,
   que es position:absolute para las tarjetas del catálogo). */
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    background: linear-gradient(135deg, rgba(213, 43, 30, 0.95), rgba(168, 34, 26, 0.9));
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.4rem 0.85rem;
    border-radius: 50px;
    box-shadow: 0 0 14px rgba(213, 43, 30, 0.55);
}

.live-pill .dot-live {
    width: 9px;
    height: 9px;
    background: #fff;
    box-shadow: 0 0 0 rgba(255, 255, 255, 0.6);
    /* El pulso rojo heredado de .dot-live es invisible sobre el fondo rojo
       del pill; acá se pinta en blanco para que el pulso se note. */
    animation: pulseLiveWhite 1.6s infinite;
}

@keyframes pulseLiveWhite {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Estado de carga mientras conecta/bufferea. z-index por encima de los
   controles de Plyr (z-index 3 en plyr.css) para que no floten encima del
   overlay mientras carga. */
.player-loading {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: radial-gradient(ellipse at center, #14171d 0%, #000 100%);
    pointer-events: none;
}

.player-spinner {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--py-red);
    animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Aviso de "tocá para activar el sonido" (autoplay silenciado por el navegador).
   Arranca oculto (.d-none en el HTML) y solo se muestra una vez que el video
   realmente empieza a reproducir muteado (ver player.js). z-index por encima
   de los controles de Plyr para que nunca quede tapado. */
.player-sound-hint {
    position: absolute;
    bottom: 4.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    animation: soundHintPulse 2.2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes soundHintPulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

.player-error {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    background: #0b0c0f;
}

@media (max-width: 576px) {
    .player-live-badge { top: 0.6rem; left: 0.6rem; gap: 0.35rem; }
    .live-pill { font-size: 0.7rem; padding: 0.3rem 0.65rem; }
    .viewer-counter { font-size: 0.7rem; padding: 0.25rem 0.6rem; }
    .player-sound-hint { font-size: 0.78rem; padding: 0.4rem 0.9rem; bottom: 3.25rem; max-width: 90%; }
}

/* Overlay de "iniciá sesión para ver" sobre el reproductor (invitados) */
.player-locked {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-locked::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6, 7, 10, 0.88);
    backdrop-filter: blur(6px);
}

.player-locked-overlay {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 420px;
}

.chat-box {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    height: 560px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.chat-message {
    animation: chatIn 0.25s ease;
}

@keyframes chatIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message .username-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.chat-message .username,
.chat-message a.username {
    font-weight: 700;
    color: var(--py-blue-light);
    font-size: 0.82rem;
    text-decoration: none;
}

.chat-message a.username:hover {
    text-decoration: underline;
}

.chat-message .text {
    font-size: 0.9rem;
    color: var(--text);
    word-break: break-word;
}

.chat-input-row {
    border-top: 1px solid var(--border-soft);
    padding: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

/* Herramientas de moderación inline (solo visibles para admins conectados) */
.chat-admin-tools {
    display: flex;
    gap: 0.3rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chat-message:hover .chat-admin-tools {
    opacity: 1;
}

.chat-admin-btn {
    background: transparent;
    border: none;
    color: var(--text-faint);
    font-size: 0.72rem;
    padding: 0.1rem 0.3rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.chat-admin-btn:hover { color: #fff; }
.chat-pin-btn:hover { background: rgba(0, 56, 168, 0.4); }
.chat-ban-btn:hover, .chat-delete-btn:hover { background: rgba(213, 43, 30, 0.5); }

.chat-pinned {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(213, 43, 30, 0.1);
    border-bottom: 1px solid var(--border-soft);
    padding: 0.6rem 1rem;
    color: var(--py-red);
    font-size: 0.85rem;
}

.chat-pinned i.fa-thumbtack { flex-shrink: 0; }

.chat-pinned-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.chat-pinned-user {
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--py-blue-light);
}

.chat-pinned-text {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-pinned-unpin {
    background: transparent;
    border: none;
    color: var(--text-faint);
    flex-shrink: 0;
}

.chat-conn-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-faint);
    display: inline-block;
    transition: background 0.2s ease;
}

.chat-conn-dot.is-online { background: #2fbf71; box-shadow: 0 0 6px rgba(47, 191, 113, 0.6); }
.chat-conn-dot.is-offline { background: var(--py-red); animation: chatConnPulse 1.2s ease-in-out infinite; }

@keyframes chatConnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.chat-input-row input:disabled,
.chat-input-row button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-pinned-unpin:hover { color: #fff; }

/* =====================================================================
   Mensajes privados
   ===================================================================== */
.dm-inbox-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-soft);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s ease;
}

.dm-inbox-row:last-child { border-bottom: none; }
.dm-inbox-row:hover { background: var(--bg-1); color: var(--text); }
.dm-inbox-row.is-unread .dm-inbox-name { font-weight: 800; }

.dm-inbox-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-inbox-name { font-weight: 600; }
.dm-inbox-username { color: var(--text-muted); font-size: 0.82rem; }

.dm-chat-box { height: 560px; }

.dm-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: chatIn 0.25s ease;
}

.dm-message.is-mine { align-self: flex-end; align-items: flex-end; }
.dm-message:not(.is-mine) { align-self: flex-start; align-items: flex-start; }

.dm-bubble {
    background: var(--surface-2);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text);
    word-break: break-word;
}

.dm-message.is-mine .dm-bubble {
    background: var(--accent-gradient);
    color: #fff;
}

.dm-attachment {
    max-width: 220px;
    max-height: 220px;
    border-radius: var(--radius-md);
    object-fit: cover;
    display: block;
    margin-bottom: 0.3rem;
}

.dm-time {
    font-size: 0.7rem;
    color: var(--text-faint);
    margin-top: 0.2rem;
}

/* =====================================================================
   Perfil público / amigos
   ===================================================================== */
.profile-card { max-width: 720px; margin: 0 auto; }

.profile-banner {
    height: 110px;
    background: linear-gradient(120deg, rgba(213, 43, 30, 0.35), rgba(0, 56, 168, 0.35));
}

.profile-banner.is-admin {
    background: linear-gradient(120deg, var(--py-red), #7a1710 45%, var(--py-blue));
    position: relative;
    overflow: hidden;
}

.profile-banner.is-admin::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg, rgba(255,255,255,0.06) 0 12px, transparent 12px 24px);
}

.profile-header-row { margin-top: -48px; }

.profile-avatar-lg {
    width: 96px;
    height: 96px;
    font-size: 2.2rem;
    flex-shrink: 0;
    border: 4px solid var(--surface);
}

.profile-avatar-lg.is-admin {
    border-color: var(--py-red);
    box-shadow: 0 0 0 2px rgba(213, 43, 30, 0.35), 0 0 24px rgba(213, 43, 30, 0.35);
}

.role-badge {
    font-size: 0.72rem;
    padding: 0.35rem 0.7rem;
    letter-spacing: 0.02em;
}

.role-badge-admin {
    background: linear-gradient(120deg, var(--py-red), var(--py-blue)) !important;
}

.role-badge-user {
    background: var(--surface-2) !important;
    color: var(--text-muted);
}

.profile-stats > div + div { border-left: 1px solid var(--border-soft); padding-left: 1.5rem; }

/* Sugerencias de mensajes ("personas que quizás conozcas") */
.dm-suggestion-card {
    background: var(--bg-1);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.dm-suggestion-name {
    font-weight: 600;
    margin-top: 0.6rem;
    font-size: 0.9rem;
}

.dm-suggestion-username {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* =====================================================================
   Página del desarrollador
   ===================================================================== */
.dev-hero { padding-bottom: 1rem; }

.dev-avatar-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    padding: 5px;
    background: conic-gradient(var(--py-red), var(--py-blue), #fff, var(--py-red));
    display: flex;
    align-items: center;
    justify-content: center;
}

.dev-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--text);
}

.dev-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--border-soft);
}

.dev-timeline li {
    position: relative;
    padding: 0 0 1.1rem 1.2rem;
}

.dev-timeline li::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--py-red);
}

.dev-timeline li:last-child { padding-bottom: 0; }

.dev-course-badge {
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
    border-radius: 50px;
}

.dev-game-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-soft);
}

.dev-game-wrapper canvas {
    display: block;
    width: 100%;
    height: auto;
    background: linear-gradient(180deg, #0e1420 0%, #1a1f2e 100%);
    cursor: pointer;
}

.dev-game-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(10, 12, 18, 0.72);
    color: #fff;
    padding: 1rem;
}

/* =====================================================================
   Dashboard / Admin
   ===================================================================== */
.side-nav {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.side-nav .nav-link {
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.side-nav .nav-link.active,
.side-nav .nav-link:hover {
    background: var(--accent-gradient-soft);
    color: var(--text);
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 56, 168, 0.4);
}

.kpi-value {
    font-size: 1.9rem;
    font-weight: 800;
}

.pagination .page-link {
    background: var(--surface);
    border-color: var(--border-soft);
    color: var(--text-muted);
}

.pagination .page-item.active .page-link {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
}

.pagination .page-link:hover {
    background: var(--surface-2);
    color: var(--text);
}

.table-py {
    color: var(--text);
    --bs-table-bg: var(--surface);
    --bs-table-border-color: var(--border-soft);
    --bs-table-striped-bg: var(--bg-2);
    --bs-table-hover-bg: rgba(213, 43, 30, 0.06);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-canales th, .table-canales td { padding: 0.6rem 0.7rem; font-size: 0.85rem; white-space: nowrap; }
.table-canales td:first-child, .table-canales th:first-child { white-space: normal; }
.table-canales .badge { font-size: 0.7rem; }
.table-canales .btn-sm { padding: 0.25rem 0.5rem; }

.badge-status-pending { background: #f5a623 !important; }
.badge-status-approved,
.badge-status-active { background: #2fbf71 !important; }
.badge-status-rejected,
.badge-status-banned { background: var(--py-red) !important; }
.badge-status-suspended,
.badge-status-disabled { background: var(--text-faint) !important; }

.card-py {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
}

/* =====================================================================
   Footer
   ===================================================================== */
.footer-py {
    background: var(--bg-1);
    border-top: 1px solid var(--border-soft);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-py h6 {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-py a {
    color: var(--text-muted);
    font-size: 0.92rem;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-py a:hover { color: var(--py-red); }

.footer-legal-note {
    font-size: 0.82rem;
    color: var(--text-faint);
    border-top: 1px solid var(--border-soft);
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.footer-py a.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.footer-py a.social-icon:hover {
    background: var(--accent-gradient);
    color: #fff;
    transform: translateY(-3px);
}

/* Notification bell */
.notif-bell {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--py-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 50px;
    line-height: 1.2;
}

/* Utilities */
.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-favorite {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 50px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-favorite.is-favorite {
    color: var(--py-red);
    border-color: var(--py-red);
}

.btn-favorite.animate-pop {
    animation: popHeart 0.3s ease;
}

@keyframes popHeart {
    50% { transform: scale(1.35); }
}

/* =====================================================================
   Espacios patrocinados — nombres de clase deliberadamente neutros (sin
   "ad"/"banner"/"sponsor"): las listas de filtros de adblock (EasyList y
   variantes) esconden por patrón de clase/id además de por dominio, así que
   un espacio 100% propio (sin red publicitaria de terceros) igual puede
   quedar oculto solo por cómo se llaman las clases.
   ===================================================================== */
.content-promo {
    position: relative;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 0.6rem;
}

.content-promo-tag {
    position: absolute;
    top: 0.4rem;
    left: 0.6rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    background: var(--surface);
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
}

.content-promo-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .hero { padding: 8.5rem 0 4rem; }
    .chat-box { height: 420px; }
}

/* ---------------------------------------------------------------------
   Contenido de noticias (HTML enriquecido del editor TinyMCE)
--------------------------------------------------------------------- */
.news-content {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.75;
}

.news-content p { margin-bottom: 1.25rem; }

.news-content h2, .news-content h3, .news-content h4 {
    color: var(--text);
    font-weight: 700;
    margin: 2rem 0 1rem;
}

.news-content h2 { font-size: 1.5rem; }
.news-content h3 { font-size: 1.25rem; }

.news-content a { color: var(--py-red); text-decoration: underline; }
.news-content a:hover { color: #ff5b4c; }

.news-content ul, .news-content ol { margin-bottom: 1.25rem; padding-left: 1.5rem; color: var(--text); }
.news-content li { margin-bottom: 0.4rem; }

.news-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 1rem 0; }

.news-content blockquote {
    border-left: 4px solid var(--py-red);
    background: var(--surface);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-muted);
    margin: 1.5rem 0;
}

.news-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}
.news-content table td, .news-content table th {
    border: 1px solid var(--border-soft);
    padding: 0.5rem 0.75rem;
}

.news-content .ratio { border-radius: var(--radius-md); overflow: hidden; }

.news-channel-embed { transition: transform 0.2s ease, border-color 0.2s ease; }
.news-channel-embed:hover { transform: translateY(-2px); border-color: rgba(213, 43, 30, 0.4) !important; }

/* Chip protegido "Insertar Canal" dentro del editor TinyMCE (iframe propio del editor) */
.chip-canal {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(213, 43, 30, 0.15);
    border: 1px solid rgba(213, 43, 30, 0.4);
    border-radius: 50px;
    padding: 0.15rem 0.7rem;
    font-size: 0.85rem;
    color: #ff8a80;
    cursor: default;
}

/* ---------------------------------------------------------------------
   Login / registro: panel visual + formulario
--------------------------------------------------------------------- */
.auth-shell {
    display: flex;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    position: relative;
    z-index: 2;
    background: var(--surface);
    border: 1px solid var(--border-soft);
}

.auth-visual {
    flex: 0 0 42%;
    background: linear-gradient(160deg, rgba(213, 43, 30, .92), rgba(0, 56, 168, .92)), var(--bg-1);
    padding: 3rem 2.25rem;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .12), transparent 55%);
}

.auth-visual-content { position: relative; z-index: 1; }

.auth-visual .brand-logo-white {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 2.25rem;
}

.auth-visual h2 {
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: rgba(255, 255, 255, .92);
    font-size: .9rem;
    margin-bottom: 1rem;
}

.auth-feature i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-visual-stats {
    display: flex;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}
.auth-visual-stats div { color: #fff; }
.auth-visual-stats strong { display: block; font-size: 1.3rem; font-weight: 800; }
.auth-visual-stats span { font-size: .76rem; color: rgba(255, 255, 255, .75); }

.auth-form-panel {
    flex: 1 1 auto;
    padding: 2.5rem;
    min-width: 0;
}

@media (min-width: 992px) {
    .auth-visual { display: flex; }
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    background: #fff;
    color: #3c4043;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: var(--radius-sm);
    padding: .65rem .9rem;
    font-weight: 600;
    width: 100%;
    transition: box-shadow .2s ease, transform .2s ease;
}
.btn-google:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .25); transform: translateY(-1px); color: #3c4043; }
.btn-google svg { width: 20px; height: 20px; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--text-faint);
    font-size: .78rem;
    margin: 1.25rem 0;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-soft);
}
