/* ==========================================================================
   Torcll Ranking 7 — Top 7 de androides
   Todas las clases llevan el prefijo .torcll- para no chocar con el tema.
   Los selectores usan al menos dos clases para ganar a los estilos
   genéricos de MoreNews/CelebNews (button, input, h2, h3…).
   ========================================================================== */

.torcll-ranking {
    --torcll-yellow: #FFCC00;
    --torcll-yellow-hover: #ffd940;
    --torcll-red: #DD0000;
    --torcll-black: #000000;
    --torcll-ink: #111111;
    --torcll-surface: #161616;
    --torcll-surface-2: #1f1f1f;
    --torcll-line: rgba(255, 255, 255, .1);
    --torcll-line-strong: rgba(255, 255, 255, .22);
    --torcll-text: #ffffff;
    --torcll-muted: #a8a8a8;
    --torcll-silver: #d4d8dd;
    --torcll-bronze: #d8924f;
    --torcll-success: #2ecc71;
    --torcll-error: #ff5252;
    --torcll-radius: 10px;
    --torcll-head: 'Oswald', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --torcll-body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

    container: torcll / inline-size;
    position: relative;
    margin: 0 0 24px;
    padding: 20px 16px;
    background: var(--torcll-black);
    border-top: 4px solid var(--torcll-yellow);
    border-radius: 12px;
    color: var(--torcll-text);
    font-family: var(--torcll-body);
    font-size: 16px;
    line-height: 1.5;
}

@media (max-width: 599px) {
    .torcll-ranking { padding: 16px 10px; }
}
@media (min-width: 600px) {
    .torcll-ranking { padding: 28px 28px 24px; }
}

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

.torcll-ranking [hidden] { display: none !important; }

.torcll-ranking p { margin: 0; }

.torcll-ranking ol,
.torcll-ranking ul { list-style: none; margin: 0; padding: 0; }

.torcll-ranking li { margin: 0; list-style: none; }

.torcll-ranking .torcll-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center 15%;
}

/* Imagen caída o inexistente: se muestra la inicial del androide. */
.torcll-ranking .torcll-media {
    position: relative;
    display: block;
    overflow: hidden;
    background: linear-gradient(135deg, #2a2a2a, #151515);
}
.torcll-ranking .torcll-media.is-broken img { display: none; }
.torcll-ranking .torcll-media.is-broken::after {
    content: attr(data-initial);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .35);
    font-family: var(--torcll-head);
    font-size: 2em;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Tipografía y bloques comunes
   -------------------------------------------------------------------------- */

.torcll-ranking .torcll-hero { margin-bottom: 24px; }

.torcll-ranking .torcll-kicker {
    margin: 0 0 4px;
    color: var(--torcll-red);
    font-family: var(--torcll-head);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.torcll-ranking .torcll-title {
    margin: 0 0 8px;
    padding: 0;
    color: var(--torcll-text);
    font-family: var(--torcll-head);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
}
.torcll-ranking .torcll-title span { color: var(--torcll-yellow); }

@container torcll (min-width: 560px) {
    .torcll-ranking .torcll-title { font-size: 40px; }
}

.torcll-ranking .torcll-lead {
    max-width: 62ch;
    color: var(--torcll-muted);
    font-size: 15px;
}

.torcll-ranking .torcll-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 14px;
}

.torcll-ranking .torcll-section-title {
    margin: 0;
    padding: 0 0 0 12px;
    border-left: 4px solid var(--torcll-yellow);
    color: var(--torcll-text);
    font-family: var(--torcll-head);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.torcll-ranking .torcll-empty {
    padding: 20px;
    border: 1px dashed var(--torcll-line-strong);
    border-radius: var(--torcll-radius);
    color: var(--torcll-muted);
    text-align: center;
}

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

/* Los colores van en las variantes (.torcll-btn.torcll-btn--*): con dos clases superan la regla
   de CelebNews "body:is(.aft-default-mode,.aft-dark-mode) :is(button,…)", de especificidad (0,2,2). */
.torcll-ranking .torcll-btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--torcll-text);
    font-family: var(--torcll-head);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, opacity .15s, transform .1s;
}
.torcll-ranking .torcll-btn:active:not(:disabled) { transform: translateY(1px); }

.torcll-ranking .torcll-btn.torcll-btn--primary { background: var(--torcll-yellow); color: var(--torcll-ink); }
.torcll-ranking .torcll-btn.torcll-btn--primary:hover:not(:disabled) { background: var(--torcll-yellow-hover); color: var(--torcll-ink); }

.torcll-ranking .torcll-btn.torcll-btn--ghost { border-color: var(--torcll-line-strong); background: transparent; color: var(--torcll-text); }
.torcll-ranking .torcll-btn.torcll-btn--ghost:hover:not(:disabled) { border-color: var(--torcll-yellow); background: transparent; color: var(--torcll-yellow); }

.torcll-ranking .torcll-btn.torcll-btn--danger { background: var(--torcll-red); color: #fff; }
.torcll-ranking .torcll-btn.torcll-btn--danger:hover:not(:disabled) { background: #f01414; color: #fff; }

.torcll-ranking .torcll-btn:disabled { opacity: .38; cursor: not-allowed; }

.torcll-ranking button:focus-visible,
.torcll-ranking a:focus-visible,
.torcll-ranking input:focus-visible {
    outline: 2px solid var(--torcll-yellow);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Avisos
   -------------------------------------------------------------------------- */

.torcll-ranking .torcll-notice {
    margin: 0 0 22px;
    padding: 14px 18px;
    border: 1px solid var(--torcll-line);
    border-left: 4px solid var(--torcll-yellow);
    border-radius: 8px;
    background: var(--torcll-surface);
}
.torcll-ranking .torcll-notice__title {
    display: block;
    margin-bottom: 2px;
    font-family: var(--torcll-head);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.torcll-ranking .torcll-notice__text { color: #ddd; font-size: 15px; }
.torcll-ranking .torcll-notice--success { border-left-color: var(--torcll-success); }
.torcll-ranking .torcll-notice--success .torcll-notice__title { color: var(--torcll-success); }
.torcll-ranking .torcll-notice--warning .torcll-notice__title { color: var(--torcll-yellow); }
.torcll-ranking .torcll-notice--error { border-left-color: var(--torcll-error); }
.torcll-ranking .torcll-notice--error .torcll-notice__title { color: var(--torcll-error); }

/* --------------------------------------------------------------------------
   Top 7
   -------------------------------------------------------------------------- */

.torcll-ranking .torcll-top7 {
    margin-bottom: 32px;
    padding: 16px;
    border: 1px solid var(--torcll-line);
    border-radius: 12px;
    background: radial-gradient(120% 80% at 50% 0%, rgba(255, 204, 0, .07), transparent 60%), var(--torcll-ink);
}

.torcll-ranking .torcll-counter { color: var(--torcll-muted); font-size: 14px; }
.torcll-ranking .torcll-counter strong {
    margin-right: 4px;
    color: var(--torcll-yellow);
    font-family: var(--torcll-head);
    font-size: 22px;
    font-weight: 700;
}

.torcll-ranking .torcll-progress {
    height: 6px;
    margin: 0 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
}
.torcll-ranking .torcll-progress__bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--torcll-red), var(--torcll-yellow));
    transition: width .25s ease;
}

/* Móvil: #1 a lo ancho, el resto en 2 columnas. Sin scroll horizontal. */
.torcll-ranking .torcll-top7__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.torcll-ranking .torcll-slot {
    position: relative;
    min-width: 0;
    aspect-ratio: 1 / 1;
    border-radius: var(--torcll-radius);
    overflow: hidden;
}
.torcll-ranking .torcll-slot:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
}

/* Escritorio: #1–#3 en la primera fila, #4–#7 en la segunda. */
@container torcll (min-width: 560px) {
    .torcll-ranking .torcll-top7 { padding: 20px; }
    .torcll-ranking .torcll-top7__list {
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 12px;
    }
    .torcll-ranking .torcll-slot { grid-column: span 3; }
    .torcll-ranking .torcll-slot:nth-child(-n+3) { grid-column: span 4; aspect-ratio: 4 / 3; }
}

.torcll-ranking .torcll-slot.is-empty {
    display: flex;
    border: 2px dashed rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .02);
}
.torcll-ranking .torcll-slot.is-next {
    border-color: var(--torcll-yellow);
    background: rgba(255, 204, 0, .06);
}

.torcll-ranking .torcll-slot__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    padding: 8px;
    text-align: center;
}
.torcll-ranking .torcll-slot__num {
    color: rgba(255, 255, 255, .3);
    font-family: var(--torcll-head);
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}
.torcll-ranking .torcll-slot:nth-child(-n+3) .torcll-slot__num { font-size: 40px; }
.torcll-ranking .torcll-slot__hint {
    color: var(--torcll-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.torcll-ranking .torcll-slot.is-next .torcll-slot__num { color: var(--torcll-yellow); }
.torcll-ranking .torcll-slot.is-next .torcll-slot__hint { color: #eee; }

.torcll-ranking .torcll-slot.is-filled {
    border: 2px solid rgba(255, 255, 255, .08);
    background: var(--torcll-surface-2);
    animation: torcll-pop .22s ease-out;
}
.torcll-ranking .torcll-slot:nth-child(1).is-filled { border-color: var(--torcll-yellow); }

.torcll-ranking .torcll-slot__media { position: absolute; inset: 0; }

.torcll-ranking .torcll-slot__name {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 28px 10px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .92));
    font-family: var(--torcll-head);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.15;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.torcll-ranking .torcll-slot:nth-child(-n+3) .torcll-slot__name { font-size: 19px; }

/* Insignia de posición (#1 oro, #2 plata, #3 bronce). */
.torcll-ranking .torcll-pos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 24px;
    padding: 0 6px;
    border-radius: 4px;
    background: #2b2b2b;
    color: #fff;
    font-family: var(--torcll-head);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}
.torcll-ranking .torcll-pos--1 { background: var(--torcll-yellow); color: var(--torcll-ink); }
.torcll-ranking .torcll-pos--2 { background: var(--torcll-silver); color: var(--torcll-ink); }
.torcll-ranking .torcll-pos--3 { background: var(--torcll-bronze); color: var(--torcll-ink); }

.torcll-ranking .torcll-slot .torcll-pos {
    position: absolute;
    top: 8px;
    left: 8px;
    min-width: 36px;
    height: 30px;
    font-size: 17px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}

.torcll-ranking .torcll-slot__actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
}

.torcll-ranking .torcll-slot__actions .torcll-slot__btn {
    -webkit-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}
.torcll-ranking .torcll-slot__btn svg { width: 16px; height: 16px; }
.torcll-ranking .torcll-slot__actions .torcll-slot__btn:hover:not(:disabled) { border-color: var(--torcll-yellow); background: rgba(0, 0, 0, .9); color: var(--torcll-yellow); }
.torcll-ranking .torcll-slot__actions .torcll-slot__btn--remove:hover:not(:disabled) { border-color: var(--torcll-red); background: var(--torcll-red); color: #fff; }
.torcll-ranking .torcll-slot__btn:disabled { opacity: .25; cursor: default; }

/* Pantallas angostas: el Top 7 se muestra como lista vertical de posiciones
   (posición · foto · nombre · controles), sin superposiciones ni scroll horizontal. */
@container torcll (max-width: 559px) {
    .torcll-ranking .torcll-top7 { padding: 10px 8px; }
    .torcll-ranking .torcll-top7__list { grid-template-columns: minmax(0, 1fr); gap: 8px; }

    .torcll-ranking .torcll-slot,
    .torcll-ranking .torcll-slot:first-child {
        grid-column: auto;
        aspect-ratio: auto;
        min-height: 60px;
    }

    .torcll-ranking .torcll-slot.is-filled {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 6px 6px 8px;
    }
    .torcll-ranking .torcll-slot.is-filled .torcll-slot__media {
        position: relative;
        inset: auto;
        flex: none;
        width: 48px;
        height: 48px;
        border-radius: 6px;
    }
    .torcll-ranking .torcll-slot:first-child.is-filled .torcll-slot__media { width: 60px; height: 60px; }

    .torcll-ranking .torcll-slot.is-filled .torcll-pos {
        position: static;
        order: -1;
        flex: none;
        min-width: 34px;
        height: 28px;
        font-size: 15px;
        box-shadow: none;
    }

    .torcll-ranking .torcll-slot.is-filled .torcll-slot__name {
        position: static;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        flex: 1 1 auto;
        min-width: 0;
        padding: 0;
        background: none;
        font-size: 15px;
        line-height: 1.15;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .torcll-ranking .torcll-slot:first-child.is-filled .torcll-slot__name { font-size: 18px; }

    /* Subir/bajar apilados y quitar al lado: deja más ancho al nombre. */
    .torcll-ranking .torcll-slot.is-filled .torcll-slot__actions {
        position: static;
        flex: none;
        display: grid;
        grid-template-columns: 28px 32px;
        grid-template-rows: 24px 24px;
        align-items: center;
        gap: 2px 6px;
    }
    .torcll-ranking .torcll-slot__actions .torcll-slot__btn--up,
    .torcll-ranking .torcll-slot__actions .torcll-slot__btn--down {
        grid-column: 1;
        width: 28px;
        height: 24px;
        border-radius: 5px;
    }
    /* En lista vertical, las flechas apuntan arriba/abajo. */
    .torcll-ranking .torcll-slot__actions .torcll-slot__btn--up svg,
    .torcll-ranking .torcll-slot__actions .torcll-slot__btn--down svg { transform: rotate(90deg); }
    .torcll-ranking .torcll-slot__actions .torcll-slot__btn--remove {
        grid-column: 2;
        grid-row: 1 / 3;
        width: 32px;
        height: 32px;
    }

    .torcll-ranking .torcll-slot.is-empty .torcll-slot__empty {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 8px 12px;
    }
    .torcll-ranking .torcll-slot.is-empty .torcll-slot__num { min-width: 34px; font-size: 24px; text-align: center; }
}

/* Muy angosto (móviles de 320px): se prioriza el nombre sobre la miniatura. */
@container torcll (max-width: 299px) {
    .torcll-ranking .torcll-slot.is-filled .torcll-slot__media { display: none; }
    .torcll-ranking .torcll-slot.is-filled { gap: 8px; }
}

/* --------------------------------------------------------------------------
   Androides disponibles
   -------------------------------------------------------------------------- */

.torcll-ranking .torcll-pool { margin-bottom: 32px; }

.torcll-ranking .torcll-search { flex: 1 1 220px; max-width: 320px; }

.torcll-ranking .torcll-search .torcll-search__input,
.torcll-ranking .torcll-alias .torcll-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 44px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--torcll-line-strong);
    border-radius: 6px;
    background: var(--torcll-ink);
    color: var(--torcll-text);
    font-family: var(--torcll-body);
    font-size: 15px;
    line-height: 1.2;
}
.torcll-ranking .torcll-search .torcll-search__input::placeholder,
.torcll-ranking .torcll-alias .torcll-input::placeholder { color: #7a7a7a; }
.torcll-ranking .torcll-search .torcll-search__input:focus,
.torcll-ranking .torcll-alias .torcll-input:focus { border-color: var(--torcll-yellow); outline: none; }

/* Móvil: 2 columnas. Escritorio: 4 columnas (4 x 4 = 16 por tanda). */
.torcll-ranking .torcll-android-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@container torcll (min-width: 560px) {
    .torcll-ranking .torcll-android-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
    .torcll-ranking .torcll-search { flex-grow: 0; }
}

.torcll-ranking .torcll-android-grid .torcll-android {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--torcll-radius);
    background: var(--torcll-surface);
    color: var(--torcll-text);
    text-align: left;
    text-transform: none;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s, opacity .15s, box-shadow .15s;
}
.torcll-ranking .torcll-android-grid .torcll-android:hover { border-color: rgba(255, 204, 0, .55); background: var(--torcll-surface); color: var(--torcll-text); }

.torcll-ranking .torcll-android__media { aspect-ratio: 1 / 1; }
.torcll-ranking .torcll-android__media img { transition: transform .25s ease; }
.torcll-ranking .torcll-android:hover .torcll-android__media img { transform: scale(1.05); }

.torcll-ranking .torcll-android__name {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 30px 10px 9px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .92));
    color: var(--torcll-text);
    font-family: var(--torcll-head);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.torcll-ranking .torcll-android__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 32px;
    padding: 0 6px;
    border-radius: 4px;
    background: var(--torcll-yellow);
    color: var(--torcll-ink);
    font-family: var(--torcll-head);
    font-size: 17px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
    transform: scale(0);
    transition: transform .18s ease-out;
}

.torcll-ranking .torcll-android.is-selected {
    border-color: var(--torcll-yellow);
    box-shadow: 0 0 0 1px var(--torcll-yellow), 0 8px 24px rgba(255, 204, 0, .18);
}
.torcll-ranking .torcll-android.is-selected .torcll-android__badge { transform: scale(1); }
.torcll-ranking .torcll-android.is-selected .torcll-android__media img { opacity: .6; }

.torcll-ranking .torcll-android.is-locked { opacity: .4; }
.torcll-ranking .torcll-android.is-locked:hover { border-color: transparent; }

.torcll-ranking .torcll-more { margin-top: 18px; text-align: center; }

/* --------------------------------------------------------------------------
   Alias
   -------------------------------------------------------------------------- */

.torcll-ranking .torcll-alias {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    min-width: 0;
}
.torcll-ranking .torcll-alias legend { margin-bottom: 14px; float: left; width: 100%; }
.torcll-ranking .torcll-alias__options { clear: both; display: flex; flex-wrap: wrap; gap: 10px; }

.torcll-ranking .torcll-choice { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.torcll-ranking .torcll-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}
.torcll-ranking .torcll-choice span {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--torcll-line-strong);
    border-radius: 999px;
    color: var(--torcll-text);
    font-weight: 600;
    font-size: 15px;
    transition: background-color .15s, border-color .15s, color .15s;
}
.torcll-ranking .torcll-choice:hover span { border-color: var(--torcll-yellow); }
.torcll-ranking .torcll-choice input:checked + span {
    border-color: var(--torcll-yellow);
    background: var(--torcll-yellow);
    color: var(--torcll-ink);
}
.torcll-ranking .torcll-choice input:focus-visible + span { outline: 2px solid var(--torcll-yellow); outline-offset: 2px; }

.torcll-ranking .torcll-alias__custom { max-width: 360px; margin-top: 14px; }
.torcll-ranking .torcll-label { display: block; margin-bottom: 6px; color: #ddd; font-size: 14px; font-weight: 600; }
.torcll-ranking .torcll-label small { color: var(--torcll-muted); font-weight: 400; }
.torcll-ranking .torcll-field-error { margin-top: 6px; color: var(--torcll-error); font-size: 14px; }
.torcll-ranking .torcll-alias.has-error .torcll-input { border-color: var(--torcll-error); }

/* --------------------------------------------------------------------------
   Barra de acciones (fija abajo mientras se arma el Top 7)
   -------------------------------------------------------------------------- */

.torcll-ranking .torcll-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin: 0 -8px;
    padding: 12px;
    border: 1px solid var(--torcll-line-strong);
    border-radius: 10px;
    background: rgba(14, 14, 14, .96);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.torcll-ranking .torcll-actionbar__status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }

.torcll-ranking .torcll-actionbar__mini { display: flex; gap: 4px; }
.torcll-ranking .torcll-actionbar__mini li {
    width: 26px;
    height: 26px;
    border: 1px dashed rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: transparent center 15% / cover no-repeat;
}
.torcll-ranking .torcll-actionbar__mini li.is-filled { border: 2px solid var(--torcll-yellow); }

.torcll-ranking .torcll-actionbar__text { color: #ddd; font-size: 14px; font-weight: 600; }
.torcll-ranking .torcll-actionbar__text.is-ready { color: var(--torcll-success); }
.torcll-ranking .torcll-actionbar__text.is-warning { color: var(--torcll-yellow); }

.torcll-ranking .torcll-actionbar__buttons { display: flex; flex-wrap: wrap; gap: 8px; }

@container torcll (max-width: 519px) {
    .torcll-ranking .torcll-actionbar { gap: 8px; margin: 0 -4px; padding: 10px; }
    .torcll-ranking .torcll-actionbar__mini { display: none; }
    .torcll-ranking .torcll-actionbar__label-extra { display: none; }
    .torcll-ranking .torcll-actionbar__buttons { width: 100%; }
    .torcll-ranking .torcll-actionbar__buttons .torcll-btn { flex: 1 1 0; padding-right: 10px; padding-left: 10px; font-size: 14px; }
}

/* --------------------------------------------------------------------------
   Rankings recientes
   -------------------------------------------------------------------------- */

.torcll-ranking .torcll-recent {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--torcll-line);
    scroll-margin-top: 90px;
}

.torcll-ranking .torcll-recent__meta { color: var(--torcll-muted); font-size: 14px; }

/* Una tarjeta por fila: así los 7 nombres se leen completos. */
.torcll-ranking .torcll-recent__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.torcll-ranking .torcll-rcard {
    container: torcll-card / inline-size;
    border: 1px solid var(--torcll-line);
    border-radius: var(--torcll-radius);
    background: var(--torcll-surface);
    overflow: hidden;
}
.torcll-ranking .torcll-rcard.is-new {
    border-color: var(--torcll-yellow);
    box-shadow: 0 0 0 1px var(--torcll-yellow), 0 10px 30px rgba(255, 204, 0, .15);
}

.torcll-ranking .torcll-rcard__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--torcll-line);
    background: rgba(255, 255, 255, .03);
}
.torcll-ranking .torcll-rcard__alias {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--torcll-text);
    font-family: var(--torcll-head);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .02em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.torcll-ranking .torcll-rcard__tag {
    flex: none;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--torcll-yellow);
    color: var(--torcll-ink);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.torcll-ranking .torcll-rcard__date { flex: none; color: var(--torcll-muted); font-size: 13px; }

.torcll-ranking .torcll-rcard__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
}

/* #1 destacado */
.torcll-ranking .torcll-rcard__first { display: flex; align-items: center; gap: 12px; min-width: 0; }
.torcll-ranking .torcll-rcard__cover {
    flex: none;
    width: 64px;
    height: 64px;
    border: 2px solid var(--torcll-yellow);
    border-radius: 8px;
}
.torcll-ranking .torcll-rcard__first-text { display: flex; align-items: center; gap: 8px; min-width: 0; }
.torcll-ranking .torcll-rcard__first-name {
    min-width: 0;
    overflow: hidden;
    font-family: var(--torcll-head);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.15;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

/* #2–#7: la posición va sobre la miniatura para dejar más ancho al nombre. */
.torcll-ranking .torcll-rcard__rest {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}
.torcll-ranking .torcll-rcard__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 8px 4px 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .04);
}
.torcll-ranking .torcll-rcard__thumb { flex: none; width: 36px; height: 36px; border-radius: 5px; font-size: 13px; }
.torcll-ranking .torcll-rcard__item .torcll-pos {
    position: absolute;
    bottom: 2px;
    left: 2px;
    min-width: 0;
    height: 16px;
    padding: 0 3px;
    border-radius: 3px;
    font-size: 11px;
}
.torcll-ranking .torcll-rcard__name {
    min-width: 0;
    overflow: hidden;
    color: #e6e6e6;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tarjeta angosta: nombres en hasta dos líneas en vez de cortarlos. */
@container torcll-card (max-width: 459px) {
    .torcll-ranking .torcll-rcard__body { padding: 10px; }
    .torcll-ranking .torcll-rcard__thumb { width: 32px; height: 32px; }
    .torcll-ranking .torcll-rcard__name {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 12px;
        line-height: 1.2;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@container torcll-card (min-width: 460px) {
    .torcll-ranking .torcll-rcard__body { grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; }
    .torcll-ranking .torcll-rcard__first { flex-direction: column; align-items: stretch; gap: 6px; }
    .torcll-ranking .torcll-rcard__cover { width: 96px; height: 96px; font-size: 20px; }
    .torcll-ranking .torcll-rcard__first-text { flex-direction: column; align-items: flex-start; gap: 4px; }
    .torcll-ranking .torcll-rcard__first-text .torcll-pos { display: none; }
    .torcll-ranking .torcll-rcard__first-name { width: 100%; font-size: 15px; text-align: center; }
}
@container torcll-card (min-width: 640px) {
    .torcll-ranking .torcll-rcard__rest { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .torcll-ranking .torcll-rcard__name { font-size: 14px; }
}
/* Paginación */
.torcll-ranking .torcll-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
}
.torcll-ranking .torcll-pagination__pages { display: flex; flex-wrap: wrap; gap: 6px; }

.torcll-ranking .torcll-pagination__step,
.torcll-ranking .torcll-pagination__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--torcll-line-strong);
    border-radius: 6px;
    background: transparent;
    color: var(--torcll-text);
    font-family: var(--torcll-head);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    transition: border-color .15s, color .15s, background-color .15s;
}
.torcll-ranking a.torcll-pagination__step:hover,
.torcll-ranking a.torcll-pagination__num:hover { border-color: var(--torcll-yellow); color: var(--torcll-yellow); }
.torcll-ranking .torcll-pagination__num.is-current { border-color: var(--torcll-yellow); background: var(--torcll-yellow); color: var(--torcll-ink); }
.torcll-ranking .torcll-pagination__step.is-disabled { opacity: .35; }
.torcll-ranking .torcll-pagination__gap { display: inline-flex; align-items: center; height: 44px; padding: 0 4px; color: var(--torcll-muted); }
.torcll-ranking .torcll-pagination__compact { display: none; color: var(--torcll-muted); font-family: var(--torcll-head); font-size: 16px; }

@container torcll (max-width: 479px) {
    .torcll-ranking .torcll-pagination { justify-content: space-between; }
    .torcll-ranking .torcll-pagination__pages { display: none; }
    .torcll-ranking .torcll-pagination__compact { display: inline; }
}

/* --------------------------------------------------------------------------
   Modales (<dialog>)
   -------------------------------------------------------------------------- */

.torcll-ranking .torcll-modal {
    width: calc(100% - 32px);
    max-width: 560px;
    max-height: calc(100% - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--torcll-text);
    font-family: var(--torcll-body);
    overflow: visible;
}
.torcll-ranking .torcll-modal--small { max-width: 440px; }
.torcll-ranking .torcll-modal::backdrop { background: rgba(0, 0, 0, .78); }

/* Navegadores sin showModal(): se centra manualmente. */
.torcll-ranking .torcll-modal.is-fallback[open] {
    position: fixed;
    inset: 0;
    z-index: 100000;
    height: fit-content;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .78);
}

.torcll-ranking .torcll-modal__box {
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 20px;
    border: 1px solid var(--torcll-line-strong);
    border-top: 4px solid var(--torcll-yellow);
    border-radius: 12px;
    background: var(--torcll-ink);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
    animation: torcll-pop .2s ease-out;
}
@media (min-width: 600px) {
    .torcll-ranking .torcll-modal__box { padding: 26px 28px; }
}

.torcll-ranking .torcll-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.torcll-ranking .torcll-modal__title {
    margin: 0;
    padding: 0;
    color: var(--torcll-text);
    font-family: var(--torcll-head);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
}
.torcll-ranking .torcll-modal__head .torcll-modal__close {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    width: 40px;
    height: 40px;
    margin: -4px -6px 0 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--torcll-muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.torcll-ranking .torcll-modal__head .torcll-modal__close:hover { border-color: var(--torcll-line-strong); background: transparent; color: #fff; }

.torcll-ranking .torcll-modal__list { display: grid; gap: 6px; margin-bottom: 16px; }
.torcll-ranking .torcll-modal__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 6px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .04);
}
.torcll-ranking .torcll-modal__item:first-child { background: rgba(255, 204, 0, .1); }
.torcll-ranking .torcll-modal__thumb { flex: none; width: 44px; height: 44px; border-radius: 6px; font-size: 14px; }
.torcll-ranking .torcll-modal__item:first-child .torcll-modal__thumb { width: 56px; height: 56px; }
.torcll-ranking .torcll-modal__name {
    min-width: 0;
    overflow: hidden;
    font-family: var(--torcll-head);
    font-size: 17px;
    font-weight: 500;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.torcll-ranking .torcll-modal__item:first-child .torcll-modal__name { font-size: 20px; font-weight: 600; }

.torcll-ranking .torcll-modal__alias,
.torcll-ranking .torcll-modal__text { margin-bottom: 6px; color: #ddd; font-size: 15px; }
.torcll-ranking .torcll-modal__alias strong { color: var(--torcll-yellow); }
.torcll-ranking .torcll-modal__note { color: var(--torcll-muted); font-size: 13px; }

.torcll-ranking .torcll-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
@media (max-width: 479px) {
    .torcll-ranking .torcll-modal__actions { flex-direction: column-reverse; }
    .torcll-ranking .torcll-modal__actions .torcll-btn { width: 100%; }
}

html.torcll-modal-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   Animaciones
   -------------------------------------------------------------------------- */

@keyframes torcll-pop {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: scale(1); }
}

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