/* =====================================================================
   Panneaux de vote : podium, feuille de partie, bandeau du chat,
   choix des couleurs du tirage, anneau du minuteur
   ===================================================================== */

/* ------------------------------------------------------------ Podium */
.podium {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.podium__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
    min-height: 168px;
}

.podium__slot {
    --c: #ff8a3d;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    transition: opacity 0.3s ease;
}

.podium__slot.is-empty { opacity: 0.25; }
.podium__slot.is-empty .podium__piece { visibility: hidden; }
/* Marche vide : pas de reste du dernier coup affiché (coup, %, votes) */
.podium__slot.is-empty :is(.podium__move, .podium__pct, .podium__count) { visibility: hidden; }

.podium__piece {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    /* Fond clair teinté : pièces blanches et noires lisibles */
    background: radial-gradient(circle at 50% 40%, #fff, color-mix(in srgb, var(--c) 45%, #e9e5f5));
    border: 3px solid var(--c);
    box-shadow: 0 0 12px color-mix(in srgb, var(--c) 45%, transparent);
}

.podium__piece img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}

.podium__slot[data-rank="1"] .podium__piece { width: 48px; height: 48px; }
.podium__slot[data-rank="1"] .podium__piece img { width: 40px; height: 40px; }

.podium__move {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 1.3em;
}

.podium__slot[data-rank="1"] .podium__move { font-size: 1.2rem; font-weight: 800; }

.podium__step {
    width: 100%;
    height: 40px;
    border-radius: 3px 3px 2px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    background: color-mix(in srgb, var(--c) 28%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
    box-sizing: border-box;
    transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s ease;
    overflow: hidden;
}

.podium__slot[data-rank="1"] .podium__step {
    background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 60%, #000));
    border-color: transparent;
    box-shadow: 0 0 20px color-mix(in srgb, var(--c) 40%, transparent);
}

.podium__slot.is-empty .podium__step {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.podium__pct {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.1;
}

.podium__slot[data-rank="1"] .podium__pct { font-size: 1.35rem; }

.podium__count {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.podium__slot.is-winner .podium__step {
    outline: 2px solid #facc15;
    outline-offset: 2px;
    animation: podiumWin 0.9s ease-in-out infinite alternate;
}

@keyframes podiumWin {
    from { box-shadow: 0 0 8px rgba(250, 204, 21, 0.4); }
    to { box-shadow: 0 0 24px rgba(250, 204, 21, 0.8); }
}

.podium__rest {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    min-height: 1.6em;
    max-height: 7.5em;
    overflow-y: auto;
}

.podium__chip {
    --c: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
}

.podium__chip b {
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
}

.podium__chip i {
    font-style: normal;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.45);
}

.podium__chip small {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.podium__chip--more { border-color: rgba(255, 255, 255, 0.15); }

.podium__hint {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* -------------------------------------------------- Feuille de partie */
.hist-table {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
}

.hist-head,
.hist-row {
    display: grid;
    grid-template-columns: 2.2em 1fr 1fr;
    gap: 4px;
    align-items: center;
}

.hist-head {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 4px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.5);
    background: var(--bg-panel, #1a1512);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hist-row {
    padding: 2px 6px;
    border-radius: 2px;
}

.hist-row:nth-child(odd) { background: rgba(255, 255, 255, 0.025); }

.hist-num {
    color: rgba(255, 255, 255, 0.4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.hist-move {
    display: flex;
    align-items: baseline;
    position: relative;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 2px;
    min-width: 0;
}

.hist-san {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #fff;
}

.hist-vote {
    font-size: 0.72rem;
    color: #ffd2b0;
}

.hist-vote--random { font-size: 0.8rem; }

/* Pièce jouée, dans sa couleur */
.hist-piece { width: 1.25em; height: 1.25em; flex: none; align-self: center; margin: -2px -2px -2px -3px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }

/* Dernier coup en jaune, comme sur l'échiquier */
.hist-move.is-last {
    background: rgba(250, 204, 21, 0.18);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.55);
}

.hist-move.is-last .hist-san { color: #fde68a; }

.hist-move--none { color: rgba(255, 255, 255, 0.3); }

.hist-empty {
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
}

/* ------------------------------------------------- Bandeau des votes */
.vote-ticker {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: var(--board-size, 100%);
    margin: 8px auto 0;
    padding: 6px 10px;
    border-radius: 3px;
    background: rgba(22, 19, 31, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

.vote-ticker[hidden] { display: none; }

.vote-ticker__label {
    flex: none;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--on-accent);
    background: #ff8a3d;
}

/* Une seule ligne : le dernier vote à gauche, les anciens défilent à droite.
   Molette = défilement horizontal (voteViews.js), jamais d'élargissement de la page */
.vote-ticker__track {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    height: 1.6em;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    overscroll-behavior: contain;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
}

.vote-ticker__track::-webkit-scrollbar { display: none; }

.vote-ticker:not(.has-votes) .vote-ticker__track::before {
    content: '…';
    color: rgba(255, 255, 255, 0.35);
}

.vote-ticker__item {
    flex: none;
    white-space: nowrap;
    font-size: 0.85rem;
    animation: tickerIn 0.3s ease-out;
}

.vote-ticker__item:nth-child(n + 4) { opacity: 0.7; }
.vote-ticker__item:nth-child(n + 8) { opacity: 0.45; }

.vote-ticker__user { font-weight: 600; }

.vote-ticker__move {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #fff;
}

@keyframes tickerIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: none; }
}

/* ------------------------------------------- Couleurs du tirage */
.form-row--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.palette-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 6px;
}

.palette-option {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.8);
    font: inherit;
    font-size: 0.78rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.palette-option:hover { border-color: rgba(255, 255, 255, 0.3); }

.palette-option.is-active {
    border-color: #ffb27a;
    background: rgba(255, 138, 61, 0.15);
    color: #fff;
}

.palette-option__swatches {
    display: flex;
    height: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.palette-option__swatches span { flex: 1; }

/* ------------------------------------------- Anneau du minuteur */
.countdown,
.watch__timer-ring { position: relative; }

.countdown__inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    line-height: 1;
}

.countdown__num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 1.9rem;
    color: #fff;
    transition: font-size 0.2s ease, color 0.2s ease;
}

.countdown__label {
    margin-top: 2px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.6);
}

/* Le texte MM:SS reste pour les messages des problèmes, sinon caché */
.board-timer-container #timer-value:not(:has(*)) { display: none; }

.board-timer-container .countdown circle:first-child {
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 6;
    opacity: 1;
}

.board-timer-container .countdown circle:last-child,
.watch__timer-ring circle:last-child {
    stroke: url(#timer-grad);
    stroke-width: 6;
}

.watch__timer-ring circle:first-child { stroke-width: 6; stroke: rgba(255, 255, 255, 0.12); }
.watch__timer-ring circle:last-child { stroke: url(#watch-timer-grad); }

/* Moins de 5 s : ambre, chiffre plus gros, « votez ! » */
.countdown.timer-critical circle:last-child,
.watch__timer.is-critical .watch__timer-ring circle:last-child { stroke: #f59e0b; }

.countdown.timer-critical .countdown__num,
.watch__timer.is-critical .countdown__num {
    font-size: 2.4rem;
    color: #fbbf24;
}

.countdown.timer-critical .countdown__label,
.watch__timer.is-critical .countdown__label {
    color: #fbbf24;
    font-weight: 800;
    text-transform: uppercase;
}

.timer-critical .countdown,
.countdown.timer-critical {
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.countdown.timer-paused .countdown__num,
.watch__timer.is-paused .countdown__num { color: #ff9800; }

.watch__timer-ring { width: 88px; height: 88px; }
.watch__timer-ring .countdown__num { font-size: 1.6rem; }
.watch__timer.is-critical .watch__timer-ring .countdown__num { font-size: 2rem; }

@media (max-width: 768px) {
    .countdown__num { font-size: 1.5rem; }
    .countdown.timer-critical .countdown__num { font-size: 1.9rem; }
}

#page-sandbox .sandbox__main { min-width: 0; }

/* ------------------------------------------- Minuteur sans cadre noir */
body:not(.no-vote-timer) .board-timer-container,
.watch__timer {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.board-timer-container .countdown__num,
.watch__timer .countdown__num { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }

/* ------------------------------------------- Menu « Tirage ▾ » */
.draw-menu__panel { width: 300px; }

.draw-menu__title {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.draw-menu__styles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}

.draw-menu__style {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.8);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.draw-menu__style:hover { border-color: rgba(255, 255, 255, 0.3); }

.draw-menu__style.is-active {
    border-color: #ffb27a;
    background: rgba(255, 138, 61, 0.15);
    color: #fff;
}

.draw-menu .palette-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ------------------------------------------- Réglages en lecture seule (en partie) */
body:not(.sandbox-launch) #sandbox-setup .config-only { display: none !important; }

.settings-summary__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    margin: 0 0 10px;
}

.settings-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
}

.settings-summary__row dt { color: rgba(255, 255, 255, 0.65); }
.settings-summary__row dt i { width: 1.1em; color: #ffb27a; }

.settings-summary__row dd {
    margin: 0;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

/* Menu ouvert au-dessus du minuteur et de l'echiquier */
.phantom-menu.is-open { z-index: 300; }

/* ------------------------------------------------ Colonne « Tape ton coup » (viewer Twitch) */
.sandbox__moves-panel .moves-panel__typeit {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.moves-panel__title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.moves-panel__ex {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.moves-panel__ex code {
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
    background: rgba(255, 138, 61, 0.25);
    padding: 1px 6px;
    border-radius: 2px;
}

/* Coups pas encore votés : discrets */
#page-sandbox .sandbox__moves-panel .moves-group button {
    --c: transparent;
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.12);
    transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.15s;
}

#page-sandbox .sandbox__moves-panel .moves-group button:hover {
    color: #fff;
    background: rgba(255, 138, 61, 0.3);
    border-color: var(--accent-purple);
}

/* Coups votés : couleur du podium + nombre de votes */
#page-sandbox .sandbox__moves-panel .moves-group button.is-voted {
    color: #fff;
    border-color: var(--c);
    background: color-mix(in srgb, var(--c) 18%, transparent);
}

/* Nombre de votes : pastille calée dans le coin haut droit du bouton (n'élargit pas le bouton) */
.sandbox__moves-panel .moves-group button { position: relative; }
.sandbox__moves-panel .moves-group button b {
    position: absolute;
    top: -7px;
    right: -6px;
    z-index: 1;
    min-width: 16px;
    padding: 0 4px;
    font: 700 0.62rem/15px 'Inter', sans-serif;
    text-align: center;
    color: #fff;
    background: var(--c);
    border-radius: 8px;
    box-shadow: 0 0 0 2px var(--bg-card, #1a1512);
    pointer-events: none;
}

/* ------------------------------------------------ Emplacement du podium / de la roue classique */
:is(#votes-panel, #watch-votes-panel, #h24-votes-panel).votes-slot {
    --dock-size: min(420px, 82vw, calc(var(--sidebar-width) - 50px));
    position: relative;
    padding: 4px 0;
}

.votes-slot__podium {
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.65, 0, 0.35, 1), filter 0.6s ease;
}

/* La place de la roue s'ouvre en douceur au tirage */
.votes-slot--wheel { transition: min-height 0.7s cubic-bezier(0.65, 0, 0.35, 1); min-height: 0; }
.votes-slot--wheel.is-drawing { min-height: calc(var(--dock-size) + 20px); }

.votes-slot.is-drawing .votes-slot__podium {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(4px);
    pointer-events: none;
}

.votes-slot__ghost {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.35);
}

/* La roue classique quitte l'overlay flottant et se pose à la place du podium */
body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel) :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked {
    --wheel-size: var(--dock-size);
    --wheel-inner-size: var(--wheel-size);
    --wheel-center-size: 70px;
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transform: none;
    transition: opacity 0.5s ease 0.15s;
}

body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel).is-drawing :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked {
    opacity: 1;
    pointer-events: auto;
}

body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel) :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked .wheel-container {
    width: var(--wheel-size);
    height: var(--wheel-size);
    padding: 0;
}

body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel) :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked .wheel-canvas {
    width: var(--wheel-size) !important;
    height: var(--wheel-size) !important;
}

body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel) :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked .wheel-pointer::after { display: none; }

@property --wheel-reveal {
    syntax: '<angle>';
    inherits: false;
    initial-value: 360deg;
}

/* La roue se dévoile en balayage pendant que les marches du podium s'y fondent */
body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel).is-drawing :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked .wheel-container {
    animation: wheelDockIn 1s cubic-bezier(0.65, 0, 0.35, 1) both;
}

body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel).is-drawing :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked .wheel-canvas {
    -webkit-mask-image: conic-gradient(#000 var(--wheel-reveal), transparent 0);
    mask-image: conic-gradient(#000 var(--wheel-reveal), transparent 0);
    animation: wheelReveal 1s cubic-bezier(0.65, 0, 0.35, 1) 0.1s both;
}

@keyframes wheelDockIn {
    from { transform: scale(0.6) rotate(-40deg); }
    to { transform: none; }
}

@keyframes wheelReveal {
    from { --wheel-reveal: 0deg; }
    to { --wheel-reveal: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
    body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel).is-drawing :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked .wheel-container,
    body :is(#votes-panel, #watch-votes-panel, #h24-votes-panel).is-drawing :is(#wheel-area, #watch-wheel-area, #h24-wheel-area).wheel-area--docked .wheel-canvas { animation: none; }
}

/* ------------------------------------------------ Coup tiré : en grand dans l'encart du podium (roue et bande) */
:is(#votes-panel, #watch-votes-panel, #h24-votes-panel) > .votes-slot__podium,
:is(#votes-panel, #watch-votes-panel, #h24-votes-panel) > :is(#wheel-area, #watch-wheel-area, #h24-wheel-area) { transition: opacity 0.35s ease, filter 0.35s ease; }

:is(#votes-panel, #watch-votes-panel, #h24-votes-panel).has-winner > .votes-slot__podium,
:is(#votes-panel, #watch-votes-panel, #h24-votes-panel).has-winner > :is(#wheel-area, #watch-wheel-area, #h24-wheel-area) {
    opacity: 0.12;
    filter: blur(3px) saturate(0.6);
}

.votes-slot__winner {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

:is(#votes-panel, #watch-votes-panel, #h24-votes-panel).has-winner .votes-slot__winner {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

:is(#votes-panel, #watch-votes-panel, #h24-votes-panel).has-winner .votes-slot__winner > * { animation: winnerPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
:is(#votes-panel, #watch-votes-panel, #h24-votes-panel).has-winner .votes-slot__winner > :nth-child(2) { animation-delay: 0.06s; }
:is(#votes-panel, #watch-votes-panel, #h24-votes-panel).has-winner .votes-slot__winner > :nth-child(3) { animation-delay: 0.12s; }

.votes-slot__winner-piece {
    width: clamp(64px, 22%, 104px);
    aspect-ratio: 1;
    padding: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--win) 55%, white), var(--win));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--win) 35%, transparent), 0 0 40px color-mix(in srgb, var(--win) 70%, transparent);
}

.votes-slot__winner-move {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2.4rem, 9vw, 3.6rem);
    font-weight: 800;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 24px color-mix(in srgb, var(--win) 80%, transparent), 0 2px 0 rgba(0, 0, 0, 0.5);
}

.votes-slot__winner-pct {
    padding: 4px 14px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--win) 30%, rgba(0, 0, 0, 0.4));
    border: 1px solid color-mix(in srgb, var(--win) 70%, transparent);
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

@keyframes winnerPop {
    from { opacity: 0; transform: scale(0.6) translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    :is(#votes-panel, #watch-votes-panel, #h24-votes-panel).has-winner .votes-slot__winner > * { animation: none; }
}

/* Coups disponibles : pas de sélection de texte à la souris */
.sandbox__moves-panel { -webkit-user-select: none; user-select: none; }

/* ------------------------------------------------ Anonymat du vote */
.anon-picker__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.anon-picker__option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font: inherit;
    font-size: 0.78rem;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.anon-picker__option i { font-size: 1rem; opacity: 0.8; }
.anon-picker__option:hover { border-color: rgba(255, 255, 255, 0.3); }

.anon-picker__option.is-active {
    border-color: var(--color-primary, #ff8a3d);
    background: color-mix(in srgb, var(--color-primary, #ff8a3d) 22%, transparent);
}

.anon-picker__hint { margin: 6px 0 0; }

/* Vote secret : podium vide, juste le nombre de votes */
.podium__hint--secret {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 1rem;
    font-weight: 700;
    opacity: 0.9;
}

.podium__hint--secret small { font-size: 0.75rem; font-weight: 400; opacity: 0.7; }

.vote-ticker__item.is-anon .vote-ticker__user { color: rgba(255, 255, 255, 0.6); }

.anon-picker__option:disabled { cursor: default; opacity: 0.5; }
.anon-picker__option.is-active:disabled { opacity: 1; }
.preset__anon { margin: 12px 0; }

/* Couleurs du tirage : liste déroulante + aperçu */
.palette-select { display: flex; align-items: center; gap: 8px; }
.palette-select .palette-option__swatches { flex: 0 0 72px; height: 14px; }
.palette-select select { flex: 1; min-width: 0; }

/* Système de vote compact : réglages en grille, anonymat en ligne */
.vote-options__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 5px;
}
.sandbox-setup .vote-options__grid > .form-row {
    padding: 3px 10px;
    min-height: 36px;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.025);
}
.vote-options__grid > .timer-off-warning { grid-column: 1 / -1; margin: 0; }
.vote-options__anon { margin-top: 10px; }
.vote-options__label { display: inline-block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text-secondary); }
.vote-options .anon-picker__option { flex-direction: row; justify-content: center; padding: 6px 6px; font-size: 0.82rem; }
.vote-options .anon-picker__option i { font-size: 0.85rem; }
.vote-options .anon-picker__hint { display: none; }
.vote-options .anon-picker.is-locked .anon-picker__hint { display: block; }

/* Fond vert (incrustation OBS) */
.chroma-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.chroma-row__label { flex: 1; }
.chroma-row__color {
    width: 34px; height: 26px; padding: 0; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 2px; background: none;
}
.chroma-row__color::-webkit-color-swatch-wrapper { padding: 2px; }
.chroma-row__color::-webkit-color-swatch { border: none; border-radius: 2px; }
.chroma-row__reset {
    border: none; background: none; color: inherit; opacity: 0.6; cursor: pointer; padding: 4px;
}
.chroma-row__reset:hover { opacity: 1; }
.chroma-row__reset[hidden] { display: none; }
.vote-options__grid > .form-row > span { white-space: nowrap; }

/* ------------------------------------------- Minuteur en barre (bloc de vote) */
.vote-timer { display: flex; flex-direction: column; gap: 6px; flex: none; }
.vote-timer[hidden] { display: none; }

.vote-timer__row { display: flex; align-items: center; gap: 10px; }

.vote-timer__bar {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 12px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.vote-timer__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--p, 0) * 100%);
    border-radius: inherit;
    background: linear-gradient(90deg, #ff8a3d, #f2700f);
    transition-property: width;
    transition-timing-function: linear;
}

.vote-timer__num {
    min-width: 2.2ch;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    text-align: right;
    color: #fff;
}

.vote-timer__label {
    min-width: 56px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.6);
}

/* Moins de 5 s : ambre et « votez ! » ; en pause : orange */
:is(.vote-timer.is-critical, .timer-critical) .vote-timer__fill { background: #f59e0b; }
:is(.vote-timer.is-critical, .timer-critical) :is(.vote-timer__num, .vote-timer__label) { color: #fbbf24; }
:is(.vote-timer.is-critical, .timer-critical) .vote-timer__label { font-weight: 800; text-transform: uppercase; }
:is(.vote-timer.is-paused, .timer-paused) .vote-timer__fill { background: #ff9800; }
:is(.vote-timer.is-paused, .timer-paused) .vote-timer__num { color: #ff9800; }

/* Partie du streamer : la barre garde sa place hors du vote (pas de saut du bloc) */
body:not(.showTimer) .vote-timer--board .vote-timer__row { visibility: hidden; }
.vote-timer--board #timer-value:not(:has(*)) { display: none; }
.vote-timer--board #timer-value { font-family: 'JetBrains Mono', monospace; font-weight: 700; text-align: center; }
.vote-timer--board .timer-pause-btn {
    flex: none;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
}
