/* ==========================================================================
   AnimeH v2 - Diseño oscuro tipo streaming
   ========================================================================== */

:root {
    --bg: #15141b;
    --bg-soft: #1b1a22;
    --surface: #201f28;
    --surface-2: #292833;
    --surface-3: #33323e;
    --border: #2e2d39;
    --border-strong: #3d3c4a;
    --text: #ececf1;
    --text-2: #c2c1cc;
    --muted: #8d8c9b;
    --accent: #ff4f8b;
    --accent-hover: #ff6b9e;
    --accent-soft: rgba(255, 79, 139, .14);
    --warning: #f5c451;
    --radius: 8px;
    --radius-lg: 12px;
    --header-h: 64px;
    --container: 1220px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
/* Si una imagen falla, no mostrar el texto alternativo encima de la tarjeta */
.poster-thumb img, .episode-thumb img, .serie-cover img, .side-item img { color: transparent; font-size: 0; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: rgba(21, 20, 27, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 24px;
    font-weight: 800;
    font-style: italic;
    letter-spacing: -.5px;
    flex-shrink: 0;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    background: var(--accent);
    color: #fff;
    border-radius: 7px;
    font-size: 17px;
    font-style: normal;
    transform: rotate(-4deg);
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 280px;
    height: 38px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.header-search i.fa-search {
    position: absolute;
    left: 12px;
    color: var(--muted);
    font-size: 13px;
}
.header-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 8px 0 34px;
    background: none;
    border: 0;
    outline: none;
    color: var(--text);
    font-size: 13px;
}
.header-search input::placeholder { color: var(--muted); }
.header-search .search-filters {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 5px;
    padding: 4px 8px;
    background: var(--surface-3);
    border-radius: 6px;
    color: var(--text-2);
    font-size: 11px;
    white-space: nowrap;
}
.header-search .search-filters:hover { color: #fff; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.header-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.header-link:hover,
.header-link.active { background: var(--surface); color: #fff; }
.header-icon {
    width: 38px;
    padding: 0;
    justify-content: center;
    border: 1px solid var(--border);
}

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 16px;
    cursor: pointer;
}

/* ==========================================================================
   Botones, chips, badges
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn-light { background: #fff; border-color: #fff; color: #111; }
.btn-light:hover { background: #e9e9ee; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-icon { width: 38px; padding: 0; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn.disabled { opacity: .35; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 12px;
    transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); color: #fff; }

.badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 7px;
    background: rgba(20, 19, 26, .88);
    border-radius: 5px;
    color: var(--text-2);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .2px;
}
.badge-accent { background: var(--accent); color: #fff; }

.meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12.5px;
}
.meta-line .dot { width: 3px; height: 3px; background: var(--muted); border-radius: 50%; }

/* ==========================================================================
   Secciones
   ========================================================================== */

.page { padding-top: 24px; padding-bottom: 56px; }

.section { margin-top: 40px; }
.section:first-child { margin-top: 0; }
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
.section-title { font-size: 20px; font-weight: 700; }
.section-sub {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

/* ==========================================================================
   Tarjeta de serie (póster vertical)
   ========================================================================== */

.poster-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 28px 22px;
}

.poster-card { display: block; min-width: 0; }
.poster-thumb {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius);
}
.poster-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease, filter .35s ease;
}
.poster-thumb .badge { position: absolute; left: 0; bottom: 0; border-radius: 0 5px 0 0; }
.poster-thumb::after {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    transition: opacity .25s;
}
.poster-card:hover .poster-thumb img { transform: scale(1.04); }
.poster-card:hover .poster-thumb::after { opacity: 1; }
.poster-title {
    margin-top: 10px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.poster-card:hover .poster-title { color: var(--accent); }
.poster-info { margin-top: 3px; padding: 0 6px; color: var(--muted); font-size: 11.5px; }

/* ==========================================================================
   Tarjeta de episodio (horizontal)
   ========================================================================== */

.episode-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 16px;
}
.episode-card { display: block; min-width: 0; }
.episode-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface);
    border-radius: var(--radius);
}
.episode-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 22%;
    filter: brightness(.82);
    transition: transform .35s ease, filter .35s ease;
}
.episode-thumb .badge { position: absolute; left: 6px; bottom: 6px; }
.episode-thumb .ep-time {
    position: absolute;
    right: 8px;
    bottom: 8px;
    color: #e2e2ea;
    font-size: 10.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.episode-thumb .ep-new { position: absolute; top: 6px; right: 6px; }
.episode-card:hover .episode-thumb img { transform: scale(1.04); filter: brightness(1); }
.episode-name {
    margin-top: 8px;
    padding: 0 2px;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.episode-card:hover .episode-name { color: var(--accent); }

/* ==========================================================================
   Hero (inicio)
   ========================================================================== */

.hero {
    position: relative;
    margin-top: calc(var(--header-h) * -1);
    padding-top: var(--header-h);
    min-height: 430px;
    overflow: hidden;
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease, visibility .6s;
}
.hero-slide.active { position: relative; opacity: 1; visibility: visible; }
.hero-slide > .container { position: relative; z-index: 2; }
.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 25%;
    filter: blur(2px) brightness(.45);
    transform: scale(1.05);
}
.hero-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, var(--bg) 0%, rgba(21,20,27,.85) 35%, rgba(21,20,27,.25) 75%, rgba(21,20,27,.55) 100%),
        linear-gradient(0deg, var(--bg) 0%, rgba(21,20,27,0) 45%);
}
.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    min-height: 366px;
    max-width: 560px;
    padding-top: 30px;
    padding-bottom: 30px;
}
.hero-title { font-size: 36px; font-weight: 800; letter-spacing: -.5px; }
.hero-text {
    color: var(--text-2);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-actions { display: flex; gap: 10px; margin-top: 4px; }
.hero-arrows {
    position: absolute;
    right: 16px;
    bottom: 30px;
    z-index: 3;
    display: flex;
    gap: 8px;
}
.hero-arrows .btn { background: rgba(41, 40, 51, .8); }
.hero-dots {
    position: absolute;
    left: 16px;
    bottom: 12px;
    z-index: 3;
    display: flex;
    gap: 6px;
}
.hero-dots button {
    width: 22px;
    height: 4px;
    padding: 0;
    background: var(--surface-3);
    border: 0;
    border-radius: 2px;
    cursor: pointer;
}
.hero-dots button.active { background: var(--accent); }
.hero-wrap {
    position: absolute;
    inset: 0;
    z-index: 3;
    max-width: var(--container);
    margin: 0 auto;
    pointer-events: none;
}
.hero-arrows,
.hero-dots { pointer-events: auto; }

/* ==========================================================================
   Catálogo
   ========================================================================== */

.letters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    gap: 8px;
    margin-bottom: 22px;
}
.letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 32px;
    padding: 0 6px;
    background: var(--surface-2);
    border-radius: 6px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    transition: background .15s, color .15s;
}
.letter:hover { background: var(--surface-3); color: #fff; }
.letter.active { background: var(--accent); color: #fff; }

.filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 200px;
    gap: 14px;
    margin-bottom: 26px;
}
.select-wrap { position: relative; }
.select-wrap label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 12.5px;
    pointer-events: none;
}
.select-wrap select {
    width: 100%;
    height: 38px;
    padding: 0 32px 0 var(--pad, 70px);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23c2c1cc' stroke-width='1.6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
}
.select-wrap select:focus { border-color: var(--border-strong); }
.select-wrap select option { background: var(--surface); }

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 12.5px;
}
.results-bar strong { color: var(--text-2); font-weight: 600; }
.results-bar .select-wrap select { --pad: 88px; background-color: transparent; border-color: transparent; min-width: 210px; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 20px; }
.active-filters .chip { border-color: var(--accent); color: #fff; gap: 8px; }

.empty-state {
    padding: 60px 16px;
    text-align: center;
    color: var(--muted);
    background: var(--bg-soft);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}
.empty-state i { display: block; margin-bottom: 12px; font-size: 30px; color: var(--surface-3); }

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 24px;
    background: rgba(245, 196, 81, .06);
    border: 1px solid rgba(245, 196, 81, .25);
    border-radius: var(--radius);
    color: var(--text-2);
    font-size: 13px;
}
.notice i { color: var(--warning); margin-top: 2px; }

/* Paginación */
.pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    background: var(--surface-2);
    border-radius: 6px;
    color: var(--text-2);
    font-size: 12.5px;
    font-weight: 600;
}
.pager a:hover { background: var(--surface-3); color: #fff; }
.pager .current { background: var(--accent); color: #fff; }
.pager .gap { background: none; }

/* ==========================================================================
   Ficha de serie
   ========================================================================== */

.serie-hero-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
}
.serie-hero {
    position: relative;
    z-index: 5;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.serie-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 30%;
    filter: blur(28px) brightness(.35);
    transform: scale(1.2);
    opacity: .7;
}
.serie-hero-inner {
    position: relative;
    display: flex;
    gap: 28px;
    padding: 20px;
}
.serie-cover {
    flex: 0 0 200px;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.serie-cover img { width: 100%; height: 100%; object-fit: cover; }
.serie-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding-top: 4px;
}
.serie-title { font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
.serie-alt { margin-top: -6px; color: var(--accent); font-size: 13.5px; }
.serie-synopsis { color: var(--text-2); font-size: 14px; line-height: 1.65; max-width: 760px; white-space: pre-line; }
.serie-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; }
.stat-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-right: 10px;
    color: var(--text-2);
    font-size: 12px;
}
.stat-box strong { color: #fff; font-size: 20px; font-weight: 700; }
.stat-box i { color: var(--accent); font-size: 17px; }
.stat-box i.fa-eye { color: var(--warning); }

.episodes-tools { display: flex; gap: 8px; }
.ep-search {
    display: none;
    height: 38px;
    width: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: width .2s, padding .2s, border-color .2s;
}
.ep-search.open { display: block; width: 150px; padding: 0 12px; border-color: var(--border); }

.ep-list-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px 16px;
}
.ep-tile { display: block; min-width: 0; }
.ep-tile .episode-thumb .badge { left: 0; bottom: 0; border-radius: 0 5px 0 0; height: 22px; }

/* ==========================================================================
   Página de episodio
   ========================================================================== */

.watch-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas:
        "main side"
        "comments side";
    gap: 24px;
    align-items: start;
}
.watch-main { grid-area: main; min-width: 0; }
.watch-layout > .side-box { grid-area: side; }
.watch-comments { grid-area: comments; min-width: 0; }

.player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: var(--radius-lg);
}
.player iframe,
.player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.player-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}
.player-nav { display: flex; gap: 8px; }

.servers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.servers-label { margin-right: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.server {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 11px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.server:hover { color: #fff; border-color: var(--accent); }
.server.server_true { background: var(--accent); border-color: var(--accent); color: #fff; }
.server .cc { padding: 0 4px; background: #22c55e; border-radius: 3px; color: #fff; font-size: 9px; }

.watch-info { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.watch-serie { color: var(--accent); font-size: 13px; font-weight: 600; }
.watch-serie:hover { text-decoration: underline; }
.watch-title { font-size: 24px; font-weight: 800; }

.side-box {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    padding: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.side-head { padding: 2px 4px 10px; }
.side-head small { display: block; color: var(--muted); font-size: 11px; }
.side-head strong { font-size: 14px; }
.side-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}
.side-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .15s, background .15s;
}
.side-item:hover { background: var(--surface-2); }
.side-item.current { border-color: var(--accent); background: var(--accent-soft); }
.side-item img { width: 64px; height: 40px; object-fit: cover; object-position: center 22%; border-radius: 5px; flex-shrink: 0; }
.side-item .t { font-size: 12.5px; font-weight: 600; }
.side-item.current .t { color: var(--accent); }
.side-item .s { color: var(--muted); font-size: 11px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================================================
   Comentarios / anuncios
   ========================================================================== */

.comments-box {
    padding: 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.ad-slot { display: flex; justify-content: center; margin: 20px 0; overflow: hidden; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { margin-top: 40px; padding: 30px 0 36px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.footer-top { display: flex; align-items: center; gap: 16px; }
.footer-top .brand { color: var(--muted); font-size: 26px; }
.footer-top .brand-mark { background: var(--surface-3); color: var(--text-2); }
.footer-love { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.footer-love i { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.footer-links a {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 12px;
}
.footer-links a:hover { border-color: var(--accent); color: #fff; }
.footer-copy { color: var(--muted); font-size: 11.5px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
    .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .ep-list-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .watch-layout { grid-template-columns: minmax(0, 1fr) 260px; }
}

@media (max-width: 900px) {
    .episode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; }
    .ep-list-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .watch-layout { grid-template-columns: 1fr; grid-template-areas: "main" "side" "comments"; }
    .side-box { position: static; }
    .side-list { max-height: 320px; }

    .menu-toggle { display: inline-flex; }
    .header-search { display: none; }
    .header-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px 16px 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        transform: translateY(calc(-100% - var(--header-h)));
        visibility: hidden;
        transition: transform .25s ease, visibility .25s;
        z-index: -1;
    }
    .header-nav.open { transform: translateY(0); visibility: visible; }
    .header-nav .mobile-search { display: flex; max-width: none; margin-bottom: 6px; }
    .header-icon { width: auto; padding: 0 12px; justify-content: flex-start; border: 0; }
    .header-icon span.sr-only { position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; }
}

@media (min-width: 901px) {
    .header-nav .mobile-search { display: none; }
}

@media (max-width: 640px) {
    body { font-size: 13.5px; }
    .page { padding-top: 16px; padding-bottom: 40px; }
    .section { margin-top: 32px; }
    .brand { font-size: 21px; }
    .episode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
    .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
    .ep-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
    .filters { grid-template-columns: 1fr; gap: 10px; }
    .results-bar { flex-direction: column; align-items: flex-start; }
    .results-bar .select-wrap { width: 100%; }
    .results-bar .select-wrap select { --pad: 12px; min-width: 0; padding-left: 12px; background-color: var(--surface); border-color: var(--border); }
    .results-bar .select-wrap label { display: none; }

    .hero { min-height: 0; }
    .hero-content { min-height: 300px; justify-content: flex-end; padding-top: 20px; padding-bottom: 56px; }
    .hero-title { font-size: 26px; }
    .hero-arrows { bottom: 8px; }
    .hero-arrows .btn { height: 30px; width: 30px; }

    .serie-hero-inner { flex-direction: column; align-items: center; text-align: center; padding: 18px 16px; }
    .serie-cover { flex-basis: auto; width: 160px; }
    .serie-body { align-items: center; }
    .serie-body .chips, .serie-body .meta-line, .serie-actions { justify-content: center; }
    .serie-title { font-size: 22px; }

    .watch-title { font-size: 20px; }
    .player { border-radius: var(--radius); margin: 0 -16px; width: calc(100% + 32px); border-radius: 0; }

    .footer-inner { align-items: center; }
    .footer-links { justify-content: center; }
}

/* ==========================================================================
   Cuentas: menú de usuario
   ========================================================================== */

.header-login { background: var(--accent); color: #fff !important; }
.header-login:hover { background: var(--accent-hover) !important; }

.user-menu { position: relative; }
.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px 0 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.user-menu-btn:hover { border-color: var(--border-strong); }
.user-menu-btn .fa-angle-down { color: var(--muted); font-size: 12px; }
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown,
.list-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 60;
    min-width: 210px;
    padding: 6px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.user-menu.open .user-dropdown,
.list-wrap.open .list-menu { opacity: 1; visibility: visible; transform: none; }
.user-dropdown a,
.user-dropdown button,
.list-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    background: none;
    border: 0;
    border-radius: var(--radius);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}
.user-dropdown a:hover,
.user-dropdown button:hover,
.list-menu button:hover { background: var(--surface-2); color: #fff; }
.user-dropdown i,
.list-menu i { width: 18px; text-align: center; color: var(--muted); font-size: 15px; }
.user-dropdown form { margin: 0; border-top: 1px solid var(--border); padding-top: 4px; margin-top: 4px; }

/* ==========================================================================
   Serie: "Agregar a lista" y botón grande de "Me gusta"
   ========================================================================== */

.list-wrap { position: relative; display: inline-flex; }
.list-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 18px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 10px 0 0 10px;
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.list-btn i { font-size: 17px; }
.list-caret {
    width: 46px;
    height: 46px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-left: 1px solid var(--surface-3);
    border-radius: 0 10px 10px 0;
    color: var(--text-2);
    cursor: pointer;
    transition: background .15s;
}
.list-btn:hover,
.list-caret:hover { background: var(--surface-3); }
.list-wrap.in-list .list-btn,
.list-wrap.in-list .list-caret { background: var(--accent-soft); border-color: var(--accent); }
.list-wrap.in-list .list-btn i { color: var(--accent); }
.list-menu { left: 0; right: auto; min-width: 100%; }
.list-menu button.active { color: #fff; background: var(--surface-2); }
.list-menu button.active i { color: var(--accent); }
.list-menu button.active::after { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: auto; color: var(--accent); font-size: 12px; }
.list-menu .list-remove { border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 var(--radius) var(--radius); color: #f87171; }
.list-menu .list-remove i { color: #f87171; }

.like-big {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 46px;
    padding: 0 20px 0 16px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}
.like-big i { font-size: 20px; color: var(--accent); }
.like-big .like-count { padding-left: 12px; border-left: 1px solid var(--border-strong); font-variant-numeric: tabular-nums; }
.like-big:hover { background: var(--surface-3); }
.like-big:active { transform: scale(.97); }
.like-big.is-on { background: var(--accent); border-color: var(--accent); }
.like-big.is-on i { color: #fff; }
.like-big.is-on .like-count { border-left-color: rgba(255,255,255,.35); }
.like-big.pop i { animation: likePop .35s ease; }
@keyframes likePop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ==========================================================================
   Entrar / Registro
   ========================================================================== */

.auth-wrap { display: flex; justify-content: center; padding: 40px 0 20px; }
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 30px 28px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
}
.auth-card h1 { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.auth-card .auth-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.field input[type=text],
.field input[type=password] {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.field .error { display: block; margin-top: 6px; color: #f87171; font-size: 12px; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px !important; }
.pass-toggle {
    position: absolute; right: 4px; top: 4px;
    width: 36px; height: 36px;
    background: none; border: 0; color: var(--muted); cursor: pointer;
}
.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
}
.check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.auth-card .btn-block { width: 100%; height: 46px; font-size: 14.5px; margin-top: 6px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-foot a { color: var(--accent); font-weight: 600; }
.auth-warning {
    display: flex;
    gap: 12px;
    padding: 14px;
    margin-bottom: 20px;
    background: rgba(245, 196, 81, .07);
    border: 1px solid rgba(245, 196, 81, .35);
    border-radius: var(--radius);
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.5;
}
.auth-warning i { color: var(--warning); font-size: 16px; margin-top: 2px; }
.auth-warning strong { color: var(--warning); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert-box { padding: 12px 14px; margin-bottom: 18px; border-radius: var(--radius); font-size: 13px; }
.alert-box.ok { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.35); color: #86efac; }
.alert-box.bad { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; }

/* ==========================================================================
   Perfil
   ========================================================================== */

.profile-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    margin-bottom: 22px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.profile-head .avatar { width: 68px; height: 68px; font-size: 28px; }
.profile-head h1 { font-size: 24px; font-weight: 800; }
.profile-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.profile-stats { display: flex; gap: 22px; margin-left: auto; }
.profile-stats div { text-align: center; }
.profile-stats strong { display: block; font-size: 20px; font-weight: 800; }
.profile-stats span { color: var(--muted); font-size: 11.5px; }

.tabs { display: flex; gap: 6px; margin-bottom: 22px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}
.tab:hover { border-color: var(--border-strong); color: #fff; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab .n { padding: 1px 7px; background: rgba(255,255,255,.1); border-radius: 999px; font-size: 11px; }
.tab.active .n { background: rgba(255,255,255,.25); }

.poster-thumb .status-badge { position: absolute; right: 6px; top: 6px; left: auto; bottom: auto; border-radius: 5px; }

.settings-box { margin-top: 40px; padding: 22px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); max-width: 520px; }
.settings-box h2 { font-size: 16px; margin-bottom: 16px; }

@media (max-width: 900px) {
    .user-menu { width: 100%; }
    .user-menu-btn { width: 100%; border-radius: var(--radius); padding: 0 12px 0 4px; }
    .user-menu-btn .fa-angle-down { margin-left: auto; }
    .user-dropdown { position: static; display: none; margin-top: 6px; opacity: 1; visibility: visible; transform: none; box-shadow: none; }
    .user-menu.open .user-dropdown { display: block; }
    .header-login { justify-content: center; }
}

@media (max-width: 640px) {
    .profile-head { flex-wrap: wrap; }
    .profile-stats { margin-left: 0; width: 100%; justify-content: space-around; padding-top: 12px; border-top: 1px solid var(--border); }
    .serie-actions .list-wrap, .serie-actions .like-big { flex: 1 1 100%; }
    .serie-actions .list-btn { flex: 1; justify-content: center; }
    .like-big { justify-content: center; }
    .auth-card { padding: 24px 18px; }
}

/* ==========================================================================
   Comentarios
   ========================================================================== */

.comments { margin-top: 8px; }
.notice .rules { margin: 6px 0 0; padding-left: 18px; }
.notice .rules li { margin: 2px 0; }
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.comments-head .section-title { font-size: 22px; }
.comments-sort { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.comments-sort select {
    padding: 4px 22px 4px 4px;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23ececf1' stroke-width='1.6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 4px center;
    border: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
}
.comments-sort select option { background: var(--surface); }

.cmt-avatar {
    --h: 330;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: hsl(var(--h) 45% 32%);
    color: hsl(var(--h) 90% 88%);
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
}

/* Caja para escribir */
.cmt-form { display: flex; gap: 14px; margin-bottom: 26px; }
.cmt-composer {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.cmt-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cmt-composer textarea {
    display: block;
    width: 100%;
    min-height: 58px;
    max-height: 320px;
    padding: 16px 18px;
    background: transparent;
    border: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.55;
    resize: none;
    outline: none;
}
.cmt-composer textarea::placeholder { color: var(--muted); }
.cmt-toolbar { display: flex; align-items: stretch; border-top: 1px solid var(--border); }
.cmt-tools { flex: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 2px; padding: 4px 8px; }
.cmt-tools button {
    width: 32px;
    height: 32px;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--text-2);
    font-size: 13px;
    cursor: pointer;
}
.cmt-tools button:hover { background: var(--surface-3); color: #fff; }
.cmt-count { margin-left: auto; padding-right: 6px; color: var(--muted); font-size: 11px; }
.cmt-submit, .cmt-cancel {
    padding: 0 18px;
    background: var(--surface-3);
    border: 0;
    border-left: 1px solid var(--border);
    color: var(--muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.cmt-submit:not(:disabled) { background: var(--accent); color: #fff; }
.cmt-submit:not(:disabled):hover { background: var(--accent-hover); }
.cmt-submit:disabled { cursor: not-allowed; }
.cmt-cancel { background: transparent; color: var(--text-2); }
.cmt-cancel:hover { color: #fff; }
.cmt-form-reply { margin: 12px 0 6px; }
.cmt-form-reply .cmt-avatar { width: 30px; height: 30px; font-size: 13px; }
.cmt-form-reply textarea { min-height: 46px; padding: 12px 14px; font-size: 14px; }

.cmt-guest {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    margin-bottom: 26px;
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    color: var(--text-2);
}
.cmt-guest i { font-size: 20px; color: var(--muted); }
.cmt-guest a { color: var(--accent); font-weight: 700; }

/* Comentario */
.cmt { display: flex; gap: 14px; padding: 8px 0 12px; scroll-margin-top: 90px; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; min-height: 22px; }
.cmt-user { font-size: 15px; font-weight: 700; }
.cmt-time { color: var(--muted); font-size: 12px; }
.cmt-more { position: relative; margin-left: auto; align-self: flex-start; }
.cmt-more-btn {
    width: 30px;
    height: 26px;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
}
.cmt-more-btn:hover { background: var(--surface-2); color: #fff; }
.cmt-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 20;
    min-width: 180px;
    padding: 5px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,.45);
    display: none;
}
.cmt-more.open .cmt-menu { display: block; }
.cmt-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    background: none;
    border: 0;
    border-radius: 7px;
    color: var(--text-2);
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.cmt-menu button:hover { background: var(--surface-2); color: #fff; }
.cmt-menu button i { width: 16px; color: var(--muted); }
.cmt-menu button.danger, .cmt-menu button.danger i { color: #f87171; }

.cmt-body {
    margin-top: 4px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    position: relative;
}
.cmt-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.cmt-body blockquote {
    margin: 6px 0;
    padding: 4px 0 4px 12px;
    border-left: 3px solid var(--border-strong);
    color: var(--text-2);
}
.cmt-body .spoiler {
    padding: 0 3px;
    background: var(--surface-3);
    border-radius: 4px;
    color: transparent;
    cursor: pointer;
    user-select: none;
    transition: color .2s, background .2s;
}
.cmt-body .spoiler.shown { color: inherit; background: var(--surface-2); user-select: text; cursor: auto; }
.cmt-mention { color: var(--accent); font-weight: 700; margin-right: 4px; }
.cmt-body.clamped { max-height: 190px; overflow: hidden; }
.cmt-body.clamped::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 70px;
    background: linear-gradient(transparent, var(--bg));
}
.cmt-expand {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 6px 0;
    background: none;
    border: 0;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.cmt-expand:hover { color: var(--accent); }

/* Imágenes en miniatura: pequeñas para no ocupar toda la pantalla */
.cmt-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cmt-img {
    display: block;
    padding: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: zoom-in;
    line-height: 0;
}
.cmt-img img {
    display: block;
    max-width: 240px;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: cover;
    transition: opacity .15s;
}
.cmt-img:hover img { opacity: .85; }
.cmt-img.broken { cursor: default; }
.cmt-img.broken img { display: none; }
.cmt-img.broken::after {
    content: 'Imagen no disponible';
    display: block;
    padding: 14px 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.cmt-actions { display: flex; align-items: center; gap: 18px; margin-top: 8px; }
.cmt-act {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    background: none;
    border: 0;
    color: var(--text-2);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.cmt-act:hover { color: #fff; }
.cmt-act.on { color: var(--accent); }
.cmt-act:disabled { opacity: .6; }
.cmt-likes { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.cmt-likes i { color: var(--accent); font-size: 12px; }

/* Respuestas con línea guía como en la referencia */
.cmt-replies { position: relative; margin-top: 6px; padding-left: 18px; }
.cmt-replies::before {
    content: '';
    position: absolute;
    left: -32px;
    top: -6px;
    bottom: 22px;
    width: 1px;
    background: var(--border-strong);
}
.cmt-reply-wrap { position: relative; }
.cmt-reply-wrap::before {
    content: '';
    position: absolute;
    left: -50px;
    top: 26px;
    width: 32px;
    height: 1px;
    background: var(--border-strong);
}
.cmt-reply-wrap.is-hidden { display: none; }
.cmt-reply .cmt-avatar { width: 32px; height: 32px; font-size: 13px; }
.cmt-more-replies {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 6px;
    padding: 4px 0;
    background: none;
    border: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}
.cmt-more-replies:hover { color: var(--accent); }

.cmt-new > .cmt-main { animation: cmtFlash 1.6s ease; border-radius: 8px; }
@keyframes cmtFlash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.cmt-hidden-report { opacity: .35; pointer-events: none; }

.cmt-empty { padding: 30px 0; text-align: center; color: var(--muted); }
.cmt-empty i { margin-right: 6px; }
.cmt-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    margin-top: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}
.cmt-load-more:hover { background: var(--surface-2); }

/* Reportar */
.cmt-report, .cmt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .7);
}
.cmt-report[hidden], .cmt-lightbox[hidden] { display: none; }
.cmt-report-box {
    width: 100%;
    max-width: 360px;
    padding: 20px;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
}
.cmt-report-box h3 { font-size: 17px; margin-bottom: 4px; }
.cmt-report-box p { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.cmt-report-box button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    margin-bottom: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-2);
    font-family: inherit;
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
}
.cmt-report-box button:hover { border-color: var(--accent); color: #fff; }
.cmt-report-box button.danger { color: #f87171; }
.cmt-report-box button.cancel { justify-content: center; background: none; border-color: transparent; margin: 6px 0 0; }

.cmt-lightbox { cursor: zoom-out; }
.cmt-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.cmt-lightbox button {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,.12);
    border: 0;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.cmt-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 300;
    padding: 10px 18px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    transform: translate(-50%, 20px);
    opacity: 0;
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}
.cmt-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
    .comments-head .section-title { font-size: 19px; }
    .cmt-form { gap: 10px; }
    .cmt-form > .cmt-avatar { display: none; }
    .cmt { gap: 10px; }
    .cmt-avatar { width: 32px; height: 32px; font-size: 13px; }
    .cmt-body { font-size: 14.5px; }
    .cmt-replies { padding-left: 4px; }
    .cmt-replies::before { left: -26px; }
    .cmt-reply-wrap::before { left: -30px; width: 22px; }
    .cmt-img img { max-width: 160px; max-height: 140px; }
    .cmt-tools { gap: 0; padding: 4px; }
    .cmt-tools button { width: 30px; }
    .cmt-count { display: none; }
}

/* ==========================================================================
   Anuncios administrados desde el panel
   ========================================================================== */

.ad-slot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 16px auto;
    overflow: hidden;
    text-align: center;
}
.ad-slot > *,
.ad-slot iframe,
.ad-slot img,
.ad-slot ins,
.ad-slot video { max-width: 100% !important; }
.ad-slot img { height: auto; }

/* Banner fijo al pie */
.ad-sticky {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 150;
    transform: translateX(-50%);
    width: auto;
    max-width: 100%;
    padding: 8px 8px 6px;
    background: rgba(21, 20, 27, .96);
    border: 1px solid var(--border-strong);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .5);
    animation: adStickyIn .3s ease;
    transition: opacity .3s, transform .3s;
}
.ad-sticky.closing { opacity: 0; transform: translate(-50%, 30px); }
.ad-sticky-inner { display: flex; justify-content: center; max-width: calc(100vw - 16px); overflow: hidden; }
.ad-sticky-inner > *, .ad-sticky-inner iframe, .ad-sticky-inner img, .ad-sticky-inner ins { max-width: 100% !important; }
.ad-sticky-close {
    position: absolute;
    top: -14px;
    right: -6px;
    width: 28px;
    height: 28px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.ad-sticky-close:hover { background: var(--accent); border-color: var(--accent); }
.ad-sticky-timer { height: 3px; margin-top: 6px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.ad-sticky-timer span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: left; animation: adStickyTimer linear forwards; }
@keyframes adStickyIn { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes adStickyTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 640px) {
    .ad-slot { margin: 12px auto; }
    .ad-sticky { width: 100%; border-radius: 0; border-left: 0; border-right: 0; }
    .ad-sticky-close { right: 6px; }
}
