/* Classements des salles verifiees.
 *
 * Tout part des variables de app.css : cette page est une page du site, pas une
 * fenetre posee dessus. La version relayee avait sa propre palette et se lisait
 * comme un autre produit.
 *
 * Le vert de la mention « salle verifiee » est celui de --success, deja utilise
 * ailleurs pour dire « c'est bon ». Il ne concurrence pas le violet de la
 * marque : l'un signale un etat, l'autre porte l'identite.
 */

/* La colonne est large comme le tableau ; c'est la PHRASE qui garde sa laisse
   de lecture. Une accroche qui court sur 1180 px se lit mal. */
/* Le titre de la page est le logo World Scoring : le mot « Classement » reste dans le
   h1 pour les lecteurs d'ecran, masque a l'oeil. La largeur suit l'ecran pour que
   « WORLD SCORING » reste lisible sur telephone. */
.rk-title {
    margin: 0;
    line-height: 1;
}

.rk-title-logo {
    display: block;
    width: clamp(232px, 36vw, 392px);
    height: auto;
}

.rk-hero .page-lead {
    max-width: 62ch;
}

/* La classe suffit a les designer : ecrite « .rk-hero .rk-tabs », la regle ne
   valait que pour les classements et les onglets des contests collaient a la
   phrase du dessus. */
.rk-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 26px;
}

.rk-tabs a {
    padding: 9px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 600;
}

.rk-tabs a:hover,
.rk-tabs a:focus-visible {
    border-color: var(--line-strong);
    color: var(--text);
}

.rk-tabs a.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ── Les trois mondes ────────────────────────────────────────────────────── */

/* Ils changent le SENS du classement, pas seulement son contenu : ils se
   posent donc au-dessus des filtres, et se lisent comme des onglets. */
.rk-worlds {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.rk-worlds button {
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
}

.rk-worlds button:hover {
    border-color: var(--line-strong);
    color: var(--text);
}

.rk-worlds button.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.rk-worlds-note {
    max-width: 78ch;
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

/* ── Les filtres ─────────────────────────────────────────────────────────── */

/* Les champs s'alignent par le HAUT (2026-10-07) : alignes par le bas, le petit mot sous la
   recherche allongeait sa colonne et faisait descendre la liste du perimetre d'autant. */
.rk-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    align-items: flex-start;
    margin-bottom: 26px;
}

.rk-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* « Monde » n'a pas de sous-choix : sa liste de valeurs se cache. L'attribut
   hidden pose display:none, mais la regle ci-dessus le bat - une declaration
   d'auteur l'emporte sur celle du navigateur, et le champ restait visible,
   vide, a cote du perimetre. */
.rk-filters label[hidden] {
    display: none;
}

/* La liste des valeurs (pays, ville) n'a pas de libelle visible : une ligne vide en tient lieu,
   pour que sa liste s'aligne sur celle du perimetre. */
#rk-value-wrap::before {
    content: "\00a0";
}

/* Le champ de recherche et les listes deroulantes appartiennent a la meme
   rangee : ils se ressemblent, sinon l'un a l'air d'un ajout. */
.rk-filters select,
.rk-filters input {
    min-width: 200px;
    max-width: 100%;
    padding: 10px 12px;
    background: var(--surface-raised);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: normal;
}

/* Le petit mot sous le champ : il n'apparait que s'il reste des jeux hors de
   la fenetre, ou si la recherche ne trouve rien. */
.rk-hint {
    min-height: 1.1em;
    font-size: 0.72rem;
    letter-spacing: normal;
    text-transform: none;
    color: var(--muted);
}

.rk-filters select:focus-visible,
.rk-filters input:focus-visible {
    outline: 2px solid var(--brand-bright);
    outline-offset: 2px;
}

/* Ce que le defi choisi classe : une phrase sur sa propre ligne, sous les listes. Vide (la fiche
   d'un jeu ne l'a pas, et le script ne l'a pas encore ecrite), elle ne prend pas de place. */
.rk-challenge-note {
    flex: 0 0 100%;
    max-width: 78ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.6;
}

.rk-challenge-note:empty {
    display: none;
}

/* ── Le podium ───────────────────────────────────────────────────────────── */

.rk-podium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
}

.rk-place {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* La premiere place se distingue par la couleur de la marque, pas par une
 * taille differente : trois cartes de hauteurs inegales se lisent mal des que
 * la grille passe sur une colonne. */
.rk-place-1 {
    border-color: color-mix(in srgb, var(--brand) 55%, transparent);
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--brand) 12%, var(--surface)) 0%,
        var(--surface) 60%);
}

.rk-medal {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.rk-place-1 .rk-medal {
    color: var(--brand-bright);
}

.rk-place-game {
    color: var(--text-soft);
    font-size: 0.92rem;
}

/* La date du record, et depuis combien de jours il tient sa place (demande user 2026-10-19). */
.rk-place-since {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--text-soft);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.rk-place-held {
    color: var(--text);
    font-weight: 600;
}

.rk-table .rk-date {
    color: var(--text-soft);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rk-place-score {
    font-size: 1.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ── Le joueur ───────────────────────────────────────────────────────────── */

.rk-player {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.rk-avatar {
    /* Les avatars sont dessines pixel par pixel : les lisser les abimerait. */
    image-rendering: pixelated;
    border-radius: 7px;
    flex: none;
}

.rk-honors {
    font-size: 0.85rem;
}

/* ── Le tableau ──────────────────────────────────────────────────────────── */

/* Le tableau defile dans sa propre boite : sans cela, six colonnes poussent la
 * page entiere de cote sur un telephone. */
.rk-table-scroll {
    overflow-x: auto;
}

/* LISIBLE SUR LE FOND ANIME (19/11, demande du user : comme le tableau ELO). Depuis les fonds des modes du
 * 18/11, les lignes du tableau flottaient sur l'image animee et se lisaient mal. Le tableau se pose dans une
 * boite opaque, comme .mp-table-wrap du classement ELO ; tout par les variables jour/nuit. */
.rk-table-scroll {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.rk-table tbody tr:last-child td {
    border-bottom: 0;
}

/* Une ligne sur deux a peine teintee : l'oeil suit la ligne du pseudo jusqu'aux points. */
.rk-table tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--text) 3%, transparent);
}

.rk-table tbody tr:hover td {
    background: color-mix(in srgb, var(--brand) 8%, transparent);
}

/* Le pseudo comme au classement ELO : la couleur du texte, en gras, sans soulignement. */
.rk-table .rk-player a,
.rk-place .rk-player a {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.rk-table .rk-player a:hover,
.rk-table .rk-player a:focus-visible,
.rk-place .rk-player a:hover,
.rk-place .rk-player a:focus-visible {
    color: var(--brand-bright, var(--brand));
}

.rk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.rk-table th,
.rk-table td {
    padding: 11px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.rk-table th {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.rk-table .rk-rank {
    width: 3ch;
    color: var(--text-soft);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.rk-table .rk-system {
    color: var(--text-soft);
}

.rk-table .rk-score,
.rk-table th.rk-score {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* LE SCORE EST CE QU'ON VIENT LIRE. Il se lisait a la taille du reste de la ligne,
   noye entre le pseudo, la provenance et le moteur ; il porte maintenant la ligne
   (demande user 2026-09-22). L'entete garde sa petite taille : c'est une etiquette. */
.rk-table td.rk-score {
    font-size: 1.32rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text, #eef2ff);
}

/* Ce qui accompagne le score ne grossit pas avec lui. */
.rk-table td.rk-score .rk-replay,
.rk-table td.rk-score .rk-flag,
.rk-table td.rk-score .rk-emulator,
.rk-table td.rk-score .rk-trial-detail,
.rk-table td.rk-score .rk-difficulty {
    font-size: 0.72rem;
    letter-spacing: 0;
}

.rk-table td.rk-score .rk-seal {
    vertical-align: baseline;
}

@media (max-width: 640px) {
    .rk-table td.rk-score {
        font-size: 1.14rem;
    }

    /* Au telephone, les points (le chiffre qui compte) restent visibles sans faire defiler : les medailles sont deja
     * dans le podium et au detail du joueur. */
    .rk-table .rk-podiums-col {
        display: none;
    }
}

/* ── Bouton « ▷ Replay » (funnel) ────────────────────────────────────────── */
/* N'apparait QUE sur les records dont le replay est public. Pilule discrete a la
 * couleur de la marque : presente sans concurrencer le score. Le clic est pris
 * par le funnel (nelfe-runtime.js) via data-nelfe-replay. */
.rk-replay {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 4px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    color: var(--brand-bright);
    background: color-mix(in srgb, var(--brand) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent);
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
}

.rk-replay:hover {
    background: color-mix(in srgb, var(--brand) 28%, transparent);
    border-color: var(--brand-bright);
}

.rk-replay:active { transform: translateY(1px); }

.rk-replay:focus-visible {
    outline: 2px solid var(--brand-bright);
    outline-offset: 2px;
}

.rk-replay[aria-busy="true"] { opacity: 0.6; cursor: progress; }

/* ── « Sans replay : MAME autonome » ─────────────────────────────────────── */
/* A la place du bouton, quand le moteur qui a mesure le score n'enregistre pas la
 * partie. MAME hors RetroArch mesure par le pont Lua mais n'a pas les commandes
 * reseau d'enregistrement : le record est vrai, il n'est simplement pas rejouable.
 * Ton eteint, aucune bordure : c'est une note de bas de page, pas une alerte, et
 * surtout pas un bouton mort qu'on essaierait de cliquer (2026-09-22). */
.rk-no-replay {
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--muted, #94a3b8);
    opacity: 0.85;
    cursor: help;
}

@media (max-width: 640px) {
    /* L'ecran etroit garde le score entier : la note passe dessous. */
    .rk-no-replay {
        display: block;
        margin-left: 0;
        margin-top: 2px;
    }
}

/* Dans le tableau, le score est aligne a droite : le bouton suit le nombre sur
 * la meme ligne plutot que de creer une colonne. */
.rk-table .rk-score .rk-replay {
    margin-top: 0;
    margin-left: 8px;
    vertical-align: middle;
}

/* Sa propre ligne. Un liseré et un fond a peine teinte suffisent : un
   classement se lit en balayant, et une ligne trop criarde ferait perdre les
   autres. */
.rk-table tr.is-me td {
    background: color-mix(in srgb, var(--brand) 14%, transparent);
}

.rk-table tr.is-me td:first-child {
    box-shadow: inset 3px 0 0 var(--brand-bright);
}

.rk-place.is-me {
    border-color: var(--brand-bright);
}

.rk-state {
    padding: 26px 12px;
    color: var(--muted);
    text-align: center;
    white-space: normal;
}

.rk-badge {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid color-mix(in srgb, var(--success) 45%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

/* La couleur dit la garantie. Le vert est reserve a la salle verifiee ; les
   deux autres mondes restent neutres, sinon la pastille verte ne voudrait plus
   rien dire. */
.rk-badge-home,
.rk-badge-stream {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--muted);
}

.rk-where {
    margin-left: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.rk-tally {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.rk-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0 0;
}

/* ── Comment on sait que c'est vrai ──────────────────────────────────────── */

.rk-trust {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.rk-trust article {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.rk-trust h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.rk-trust p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.94rem;
}

.rk-trust p + p {
    margin-top: 12px;
}

.rk-trust a {
    color: var(--brand-bright);
}

/* Le sceau de scellement, devant le score. Discret : il certifie, il ne decore pas. */
.rk-seal {
    display: inline-block;
    margin-right: .35em;
    vertical-align: -.12em;
}

/* La tete de l'avatar du moment : dessinee en 32 x 32, montree a la taille du portrait. */
canvas.rk-avatar {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

/* Classement des joueurs (sans jeu choisi) : podiums en medailles, points en or. */
.rk-medals { display: inline-flex; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rk-medal-count { font-size: .92em; }
.rk-games { font-variant-numeric: tabular-nums; }
.rk-place .rk-medals { margin-top: 4px; }

/* ── LES SCORES EN ATTENTE, DANS UN CLASSEMENT ─────────────────────────────
   Un score joue sur un emulateur que la plateforme ne reconnait pas encore est
   garde, pas detruit. Il se charge a la demande, sous le tableau, et ne prend
   JAMAIS de rang : il se lit a cote du classement, jamais dedans.
   (Ces regles vivent ici et non dans quarantaine.css : c'est cette page-ci qui
   les affiche, et elle ne charge pas la feuille de la page d'explication.) */
/* Les lignes en attente dans un classement : visibles, jamais confondues avec un rang.
   Pas de numéro, pas de sceau, et un fond qui les met en retrait. */
.rk-row.is-pending {
    opacity: .72;
}

.rk-row.is-pending td:first-child::before {
    color: var(--text-muted, #9aa0b5);
    content: '·';
}

.rk-pending-tag {
    background: rgba(217, 164, 65, .16);
    border-radius: 999px;
    color: var(--vif-d9a441);
    font-size: .68rem;
    letter-spacing: .03em;
    margin-left: .45rem;
    padding: .12rem .45rem;
    text-transform: uppercase;
    white-space: nowrap;
}

/* La barre sous le classement. Le bouton porte la charte du site (.button .button-ghost
   .button-small) ; on ne redéfinit ici que ce qui lui est propre, la pastille d'état et
   le lien d'explication à côté. */
.rk-pending-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    /* Le tableau se termine juste au-dessus : sans cet air, le bouton se lit comme une
       ligne de plus du classement, ce qu'il n'est pas. */
    margin-top: 1.9rem;
    margin-bottom: .5rem;
}

/* Le point reprend la couleur de l'attente, celle de la pastille sur les lignes : on
   reconnaît de quoi parle le bouton avant d'avoir lu son texte. */
.rk-pending-dot {
    background: #d9a441;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(217, 164, 65, .16);
    display: inline-block;
    flex: none;
    height: 7px;
    width: 7px;
}

.rk-pending-toggle[aria-pressed="true"] {
    border-color: rgba(217, 164, 65, .5);
}

.rk-pending-toggle[aria-pressed="true"] .rk-pending-dot {
    box-shadow: 0 0 0 4px rgba(217, 164, 65, .24);
}

/* L'aide : un point d'interrogation, pas une phrase. Une cible ronde de 26 px, assez
   grande pour le doigt, assez discrète pour ne pas concurrencer le bouton. */
.rk-pending-help {
    align-items: center;
    border: 1px solid var(--line-strong, rgba(255, 255, 255, .16));
    border-radius: 50%;
    color: var(--text-muted, #9aa0b5);
    display: inline-flex;
    flex: none;
    font-size: .8rem;
    height: 26px;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    width: 26px;
}

.rk-pending-help:hover,
.rk-pending-help:focus-visible {
    border-color: rgba(134, 93, 255, .52);
    color: var(--text, inherit);
}

/* La difficulte choisie au depart, sous le score : libre, elle se lit sans departager. */
.rk-difficulty {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--brand-bright, #A98BFF);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Le mode d'un record, a cote du nom du jeu : « Tetris · Type B ». */
.rk-mode {
    display: inline-block;
    margin-left: 0.4em;
    padding: 0 0.45em;
    border-radius: 999px;
    border: 1px solid rgba(134, 93, 255, .45);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    vertical-align: 0.1em;
    white-space: nowrap;
}

/* Le moteur du record, sous le score : une precision, pas une donnee du classement. Les deux autres mesures d'un temps
   de defi (chrono independant, temps du jeu) se lisent au meme endroit. */
.rk-emulator,
.rk-trial-detail {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--muted, #8a93a8);
    white-space: nowrap;
}

/* LE PREMIER RANG QUI TOMBE, EN DIRECT (CDC video V2, §5.8) : cache tant qu'aucun direct ne dure. Sur la fiche d'un
   jeu, le lecteur du direct ; sur la page des classements, la liste des directs en cours. */
.record-live {
    max-width: var(--container, 1180px);
    margin: 24px auto 0;
    padding: 0 16px;
}

.record-live__head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.record-live__badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--danger, #ff7b8e);
    color: var(--bg-deep, #03050a);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.record-live__text {
    margin: 0;
    color: var(--text, #f5f7fb);
    font-weight: 600;
}

/* L'ANTENNE DE /lives (direct partage, 16 octobre 2026) : un grand lecteur comme celui de la fiche d'un joueur, toute la
   largeur en 16:9, avec son ombre ; sans borne a l'antenne, l'ecran reste la avec un mot d'attente. Il suit la colonne de
   la page (.container) : son titre et son cadre s'alignent sur le titre « Directs » et sur le texte en dessous. */
.record-live[data-mode="antenne"] {
    display: grid;
    gap: .8rem;
    width: min(calc(100% - 40px), var(--container));
    padding: 0;
}

.record-live__title {
    margin: 0;
}

/* Le titre du grand lecteur : le logo NelfePlay TV, en grand (demande du user, 16 octobre 2026). */
.record-live[data-mode="antenne"] .record-live__title {
    line-height: 0;
}

.record-live__logo {
    display: block;
    width: auto;
    height: clamp(52px, 7vw, 92px);
    filter: drop-shadow(0 0 18px rgba(134, 93, 255, .35));
}

.record-live__logo--nuit,
:root[data-theme="nuit"] .record-live__logo--jour {
    display: none;
}

:root[data-theme="nuit"] .record-live__logo--nuit {
    display: block;
}

.record-live[data-mode="antenne"] .record-live__frame {
    box-shadow: var(--shadow, 0 18px 50px rgba(var(--shadow-rgb), calc(0.45 * var(--shadow-k))));
}

/* LE CADRE DE TELEVISEUR DU GRAND LECTEUR (16 octobre 2026). Rien ne se pose sur le lecteur YouTube (regles
   d'integration) : la pastille, les informations et le logo sont dans le cadre, autour de l'ecran. L'effet cathodique
   habille le cadre (verre sombre, reflet, halo, balayage), jamais l'image. */
.tv {
    display: grid;
    /* Colonne sans largeur propre (04/12/2026) : un titre de jeu tres long ne l'elargit jamais au-dela de la carte. */
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    gap: .6rem;
    padding: clamp(10px, 1.4vw, 18px);
    border: 1px solid rgba(160, 140, 255, .22);
    border-radius: 26px;
    background:
        repeating-linear-gradient(to bottom, rgba(255, 255, 255, .03) 0, rgba(255, 255, 255, .03) 1px, transparent 1px, transparent 3px),
        linear-gradient(160deg, rgba(255, 255, 255, .09) 0%, rgba(255, 255, 255, .02) 22%, transparent 42%),
        radial-gradient(120% 140% at 50% 0%, #1b1733 0%, #0b0a17 60%, #05050b 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), 0 18px 60px rgba(0, 0, 0, .55), 0 0 48px rgba(134, 93, 255, .18);
}

.tv__bord {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 1.75rem;
    min-width: 0;
}

/* La ligne du haut ne passe jamais sur deux lignes (04/12/2026) : un titre de jeu trop long est coupe par des points de
   suspension, il ne pousse ni les boutons ni la video. */
.tv__bord--haut {
    flex-wrap: nowrap;
}

.tv__bord--bas {
    flex-wrap: wrap;
    row-gap: .5rem;
    justify-content: space-between;
}

/* LA BARRE DU PROGRAMME (16 octobre 2026) : sur sa propre ligne, toute la largeur, au-dessus des informations ; pendant
   la programmation seulement. */
.tv__progres {
    flex: 1 0 100%;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
}

.tv__progres[hidden],
.tv__suivant[hidden] {
    display: none;
}

.tv__progres-plein {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand, #865dff), var(--brand-bright, #a98bff));
    box-shadow: 0 0 10px rgba(169, 139, 255, .55);
    transition: width 1s linear;
}

/* « A SUIVRE 2:41 Le jeu · le programme » : le titre se coupe, jamais l'etiquette ni le temps. */
.tv__suivant {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 48%;
    margin: 0;
    overflow: hidden;
    color: var(--text-soft, #aab3c5);
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv__suivant-titre {
    margin-right: .45em;
    color: var(--brand-bright, #a98bff);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.tv__suivant-temps {
    color: #fff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .tv__progres-plein {
        transition: none;
    }
}

.tv__pastille {
    display: inline-block;
    flex: none;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--danger, #ff7b8e);
    color: #03050a;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tv__pastille--rerun {
    background: #f5b942;
}

/* Le retour d'un direct (18 octobre 2026) : le fil de l'antenne reprend en fondu, la ou il s'etait arrete. */
.tv__ecran--fondu > * {
    animation: tv-fondu .9s ease-out;
}

@keyframes tv-fondu {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .tv__ecran--fondu > * {
        animation: none;
    }
}

/* Un invite de NelfePlay TV (17 octobre 2026) : la video d'un autre createur. */
.tv__pastille--guest {
    background: #a98bff;
}

.tv__texte {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* En haut a droite : le lien du classement, le bouton du son, le plein ecran du cadre seul. */
.tv__droite {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    margin-left: auto;
}

.tv__lien {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    color: var(--brand-bright, #a98bff);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv__son,
.tv__plein {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    min-height: 28px;
    padding: 3px 11px 3px 9px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: var(--text, #f5f7fb);
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.tv__plein {
    width: 28px;
    padding: 0;
}

.tv__son:hover,
.tv__plein:hover {
    border-color: rgba(255, 255, 255, .38);
    background: rgba(255, 255, 255, .12);
}

.tv__son:focus-visible,
.tv__plein:focus-visible {
    outline: 2px solid var(--brand-bright, #a98bff);
    outline-offset: 2px;
}

.tv__son[aria-pressed="true"] {
    border-color: rgba(169, 139, 255, .7);
    background: rgba(134, 93, 255, .24);
}

.tv__infos {
    /* Base nulle : les informations se coupent avant de pousser le logo sur une autre ligne. */
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--text-soft, #aab3c5);
    font-size: .92rem;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv__logo {
    flex: none;
    width: auto;
    height: 28px;
}

.record-live[data-mode="antenne"] .tv__ecran {
    container-type: inline-size;
    border: 1px solid rgba(0, 0, 0, .85);
    border-radius: 18px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .04), 0 0 26px rgba(120, 180, 255, .12);
}

/* LE CLASSEMENT A JOUR apres « Current leaderboard » (16 octobre 2026) : il prend la place du lecteur YouTube dans
   l'ecran, en deux colonnes de cinq ; tailles en largeur de l'ecran (cqw), de la page au plein ecran d'une salle. */
.tv__classement {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 2.4cqw;
    padding: 3.4cqw 5cqw;
    background:
        repeating-linear-gradient(to bottom, rgba(255, 255, 255, .025) 0, rgba(255, 255, 255, .025) 1px, transparent 1px, transparent 3px),
        radial-gradient(ellipse at 50% 0%, rgba(134, 93, 255, .3), transparent 65%),
        #07061a;
    color: #f5f7fb;
}

.tv__classement-tete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2cqw;
    padding-bottom: 1.6cqw;
    border-bottom: 1px solid rgba(169, 139, 255, .35);
}

.tv__classement-jeu {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 3.4cqw;
    font-weight: 800;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv__classement-regle {
    flex: none;
    margin: 0;
    padding: .4cqw 1.3cqw;
    border: 1px solid rgba(169, 139, 255, .55);
    border-radius: 999px;
    color: #a98bff;
    font-size: 1.6cqw;
    font-weight: 800;
    letter-spacing: .12em;
}

.tv__classement-liste {
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(5, minmax(0, 1fr));
    gap: 1cqw 4cqw;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tv__rang {
    display: grid;
    grid-template-columns: 4.6cqw minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.6cqw;
    padding: 0 1.8cqw;
    border-radius: 1.1cqw;
    background: rgba(255, 255, 255, .045);
    font-size: 2.1cqw;
    animation: tv-rang .5s ease-out both;
    animation-delay: calc(var(--i, 0) * 90ms);
}

.tv__rang-n {
    color: rgba(245, 247, 251, .55);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.tv__rang-joueur {
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv__rang-score {
    color: #cfd6e6;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.tv__rang--1 {
    background: linear-gradient(90deg, rgba(245, 185, 66, .28), rgba(245, 185, 66, .06));
    box-shadow: inset 0 0 0 1px rgba(245, 185, 66, .5);
}

.tv__rang--1 .tv__rang-n,
.tv__rang--1 .tv__rang-score {
    color: #f5b942;
}

.tv__rang--2 .tv__rang-n {
    color: #dfe3ec;
}

.tv__rang--3 .tv__rang-n {
    color: #d79c6c;
}

@keyframes tv-rang {
    from {
        opacity: 0;
        transform: translateY(1.2cqw);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Un petit ecran (telephone) : les cinq premiers, en une colonne, assez grands pour se lire. */
@container (max-width: 560px) {
    .tv__classement {
        gap: 3cqw;
        padding: 4.5cqw 6cqw;
    }

    .tv__classement-jeu {
        font-size: 5.2cqw;
    }

    .tv__classement-regle {
        font-size: 3cqw;
    }

    .tv__classement-liste {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.6cqw;
    }

    .tv__rang {
        grid-template-columns: 7cqw minmax(0, 1fr) auto;
        font-size: 3.8cqw;
    }

    .tv__rang:nth-child(n + 6) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tv__rang {
        animation: none;
    }
}

/* LE PLEIN ECRAN DU CADRE SEUL (demande du user, 16 octobre 2026 : l'ecran d'une salle). Le televiseur prend tout
   l'ecran, l'image garde son 16:9 au plus grand, la souris se cache apres 3 secondes sans mouvement. */
.tv:fullscreen {
    width: 100vw;
    height: 100vh;
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: clamp(14px, 2vh, 28px) clamp(18px, 2.5vw, 40px);
    border: 0;
    border-radius: 0;
}

.tv:fullscreen .tv__ecran {
    align-self: center;
    justify-self: center;
    width: min(100%, calc((100vh - 9rem) * 16 / 9));
}

.tv:fullscreen .tv__infos {
    font-size: 1.1rem;
}

.tv:fullscreen .tv__suivant {
    font-size: 1.05rem;
}

.tv:fullscreen .tv__progres {
    height: 4px;
}

.tv:fullscreen .tv__logo {
    height: 40px;
}

.tv--calme:fullscreen {
    cursor: none;
}

@media (max-width: 640px) {
    /* La colonne de la page se resserre sur un telephone (app.css) : le lecteur la suit. */
    .record-live[data-mode="antenne"] {
        width: min(calc(100% - 28px), var(--container));
    }

    .tv {
        border-radius: 18px;
    }

    .tv__logo {
        height: 20px;
    }

    .tv__infos {
        font-size: .82rem;
    }

    /* Sur un telephone, la phrase du haut (« A l'antenne : ... ») passerait sur deux lignes et decalerait l'ecran : la
       pastille, le lien du jeu et les boutons suffisent (demande user, 16 octobre 2026). */
    .tv__texte {
        display: none;
    }

    /* Sur un telephone, « A suivre » passe sous les informations, sur toute la ligne. */
    .tv__suivant {
        order: 3;
        flex-basis: 100%;
        max-width: none;
        font-size: .78rem;
    }

    /* Sur un telephone, le bouton du son se reduit a son icone (son nom reste lu par les lecteurs d'ecran). */
    .tv__son {
        width: 28px;
        padding: 0;
    }

    .tv__son span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

.record-live__frame--idle {
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: radial-gradient(ellipse at center, rgba(134, 93, 255, 0.16), transparent 70%), var(--bg-deep, #03050a);
}

.record-live__idle {
    max-width: 36rem;
    margin: 0;
    text-align: center;
    color: var(--text-soft, #aab3c5);
}

.record-live__frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line-strong, rgba(151, 174, 211, 0.28));
    border-radius: var(--radius, 18px);
    overflow: hidden;
    background: var(--bg-deep, #03050a);
}

.record-live__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.record-live__list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.record-live__link {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border: 1px solid var(--line-strong, rgba(151, 174, 211, 0.28));
    border-radius: var(--radius-sm, 10px);
    background: var(--surface-raised, #111827);
    color: var(--text, #f5f7fb);
    text-decoration: none;
}

.record-live__link:hover,
.record-live__link:focus-visible {
    border-color: var(--danger, #ff7b8e);
}

.record-live__watch {
    margin-left: auto;
    color: var(--brand-bright, #a98bff);
    font-weight: 700;
}

/* La page des directs : un lecteur par direct de record en cours, le lien de son classement a droite. */
.record-live__one + .record-live__one {
    margin-top: 24px;
}

.record-live__sheet {
    margin-left: auto;
    color: var(--brand-bright, #a98bff);
    font-weight: 700;
    text-decoration: none;
}

.record-live__sheet:hover,
.record-live__sheet:focus-visible {
    text-decoration: underline;
}

/* ── LES SCORES PAL, A COTE DU CLASSEMENT PRINCIPAL (12/11) ─────────────────
   Option du user : les meilleurs scores PAL se montrent dans le classement
   principal d'un jeu, a leur valeur, avec un badge « PAL » et sans rang. Ils
   ont leur propre classement ; ici ils se lisent pour memoire, en retrait. */
tr.is-pal {
    opacity: .8;
}

tr.is-pal td:first-child::before {
    color: var(--text-muted, #9aa0b5);
    content: '·';
}

.rk-pal-tag {
    background: color-mix(in srgb, var(--brand) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 40%, transparent);
    border-radius: 999px;
    color: var(--brand-bright);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    margin-left: .45rem;
    padding: .1rem .45rem;
    white-space: nowrap;
}

/* La phrase des medailles, sous le tableau des joueurs : un peu d'air sous la table. */
#rk-medals-note {
    margin-top: 0.7rem;
}

/* LES DIRECTS DE RECORD PARTOUT (02/12). Sous le grand lecteur de /lives : le bouton « Regarder sur ma borne » du joueur
   a l'antenne et les AUTRES records en direct (un seul record a la fois a l'ecran). Couleurs par les variables jour/nuit. */
.record-live__sous {
    display: grid;
    gap: .6rem;
    margin-top: .2rem;
}

.record-live__session {
    margin: 0;
}

.record-live__others {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.record-live__other {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm, 10px);
    background: var(--surface-raised);
    color: var(--text);
    text-decoration: none;
}

.record-live__other:hover,
.record-live__other:focus-visible {
    border-color: var(--danger);
}

.record-live__other .record-live__text {
    font-size: .9rem;
}

/* Le bandeau « record en direct » des fiches d'un joueur et d'un jeu qui ne sont pas ceux du record. */
.record-live-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: var(--container, 1180px);
    margin: 16px auto 0;
    padding: 10px 16px;
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm, 10px);
    background: var(--surface-raised);
    color: var(--text);
    text-decoration: none;
}

.record-live-banner[hidden] {
    display: none;
}

.record-live-banner .record-live__text {
    font-size: .92rem;
}

/* « Joue en ce moment » sur la fiche d'un jeu. */
.record-live--playing {
    display: grid;
    gap: .5rem;
}

.record-live__playing-title {
    margin: 0;
    font-weight: 700;
    color: var(--text);
}

.record-live__playing {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.record-live__playing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm, 10px);
    background: var(--surface-raised);
}

.record-live__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--danger);
    flex: none;
}

.record-live__player {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.record-live__playing-watch {
    color: var(--brand-bright);
    font-weight: 700;
    text-decoration: none;
}

.record-live__playing-item .record-live__join {
    margin-left: auto;
}
