
/* ============ Thème ============ */
:root {
    --bg: #0c0a0b;
    --bg-2: #141012;
    --panel: rgba(28, 22, 24, 0.72);
    --panel-border: rgba(255, 255, 255, 0.07);
    --text: #e9e3e4;
    --muted: #9b9092;
    --red: #ff2b2b;
    --red-soft: #ff6d6d;
    --red-glow: rgba(255, 43, 43, 0.45);
    --gold: #e8a45a;
    --green: #3ee07a;
    --orange: #ff9a1f;
    --radius: 20px;
    --display: 'Bebas Neue', 'Impact', sans-serif;
    --body: 'Inter', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--body);
    color: var(--text);
    text-align: center;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 43, 43, 0.18), transparent 70%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(232, 164, 90, 0.08), transparent 70%),
        linear-gradient(180deg, var(--bg-2), var(--bg));
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* léger grain façon vieux bar */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.05;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

[hidden] { display: none !important; }

.panel, #result, #chaosPanel { scroll-margin-top: 90px; }

img { max-width: 100%; }

/* ============ Header ============ */
header {
    position: sticky;
    top: 14px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: min(640px, calc(100% - 32px));
    margin: 14px auto 0;
    padding: 8px 10px 8px 14px;
    background: rgba(18, 14, 15, 0.75);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

header a { margin: 0; }

header img {
    display: block;
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 8px var(--red-glow));
    transition: transform 0.25s;
}

header a:hover img { transform: scale(1.08) rotate(-4deg); }

nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

nav a {
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

nav a:hover {
    color: #fff;
    text-shadow: none;
    background: rgba(255, 255, 255, 0.06);
}

nav a.active {
    color: #fff;
    background: var(--red);
    box-shadow: 0 0 18px var(--red-glow);
}

.close-button img {
    width: 34px;
    height: 34px;
    opacity: 0.8;
}

.close-button:hover img { opacity: 1; transform: rotate(90deg); }

/* ============ Mise en page ============ */
.page {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 60px;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
}

#logo {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 0 25px var(--red-glow));
    animation: float 5s ease-in-out infinite;
}

.hero h1 {
    margin: 0;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(56px, 12vw, 96px);
    line-height: 0.9;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 0 30px var(--red-glow);
}

.badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--red-soft);
    background: rgba(255, 43, 43, 0.1);
    border: 1px solid rgba(255, 43, 43, 0.3);
}

.panel {
    padding: 28px 24px;
    margin-bottom: 20px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    animation: rise 0.45s ease both;
}

.step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--red-soft);
}

.step span {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    letter-spacing: 0;
}

h2, #nameInputs > p {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

h3 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 26px;
    letter-spacing: 0.05em;
    color: #fff;
    margin: 28px 0 8px;
}

b { color: #fff; font-weight: 700; }

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.divider {
    height: 1px;
    margin: 28px 0;
    background: linear-gradient(90deg, transparent, var(--panel-border) 20%, var(--panel-border) 80%, transparent);
    border: 0;
}

/* ============ Boutons ============ */
button {
    font-family: var(--body);
    padding: 14px 26px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    cursor: pointer;
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, #ff4545, #e01818);
    box-shadow: 0 6px 20px rgba(255, 43, 43, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transition: transform 0.15s, box-shadow 0.25s, filter 0.2s;
}

button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 10px 30px rgba(255, 43, 43, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

button:active { transform: translateY(1px) scale(0.98); }

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--red-soft);
    outline-offset: 3px;
}

button.ghost, #resetButton, #rules > button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    color: var(--text);
}

button.ghost:hover, #resetButton:hover, #rules > button:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.shoot {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 400;
    letter-spacing: 0.1em;
    padding: 12px 34px;
}

/* ============ Champs ============ */
#playerCount, #nameInputsContainer input, #playerList {
    font-family: var(--body);
    padding: 14px 16px;
    font-size: 17px;
    font-weight: 500;
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#playerCount:focus, #nameInputsContainer input:focus, #playerList:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(255, 43, 43, 0.15);
    outline: none;
}

#playerCount { width: 90px; font-size: 22px; font-weight: 700; }

#playerList {
    min-width: 200px;
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ff6d6d' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

#playerList option { background: #1a1415; color: #fff; }

#nameInputsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

#nameInputsContainer br { display: none; }

#nameInputsContainer input { width: 100%; }

#nameInputsContainer input::placeholder { color: #6d6466; }

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] { -moz-appearance: textfield; }

/* ============ Playground ============ */
#playground {
    display: block;
    width: 320px;
    height: auto;
    margin: 10px auto 0;
    opacity: 0.9;
}

.result {
    margin: 22px auto 0;
    padding: 18px 20px;
    max-width: 560px;
    font-family: var(--display);
    font-size: clamp(38px, 8vw, 56px);
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1;
    border-radius: 16px;
    animation: pop 0.45s cubic-bezier(.2, 1.4, .4, 1) both;
}

.result:empty { display: none; }

.result.lost {
    color: #ff3b3b;
    background: rgba(255, 43, 43, 0.1);
    border: 1px solid rgba(255, 43, 43, 0.35);
    text-shadow: 0 0 24px rgba(255, 43, 43, 0.7);
    animation: pop 0.45s cubic-bezier(.2, 1.4, .4, 1) both, shake 0.5s 0.1s;
}

.result.survived {
    color: var(--green);
    background: rgba(62, 224, 122, 0.08);
    border: 1px solid rgba(62, 224, 122, 0.3);
    text-shadow: 0 0 24px rgba(62, 224, 122, 0.5);
}

.table-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

#tableText {
    font-family: var(--display);
    font-size: clamp(38px, 8vw, 54px);
    letter-spacing: 0.05em;
    line-height: 1;
    color: var(--red);
    text-shadow: 0 0 28px var(--red-glow);
    animation: pop 0.45s cubic-bezier(.2, 1.4, .4, 1) both;
}

#cardImage {
    width: 150px;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 43, 43, 0.25);
    transition: transform 0.2s ease-in;
}


/* ============ Règles ============ */
#rules { margin-top: 10px; }

#rulesText {
    margin-top: 20px;
    padding: 8px 26px 26px;
    text-align: left;
    line-height: 1.7;
    color: #cfc6c8;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    animation: rise 0.35s ease both;
}

#rulesText p { margin: 0; }

.counts {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    margin-top: 6px;
}

.counts th, .counts td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--panel-border);
    text-align: center;
}

.counts th {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.counts td:first-child { font-weight: 700; color: #fff; }

.counts tr:hover td { background: rgba(255, 255, 255, 0.03); }

/* ============ Cartes retournables ============ */
.cards-title {
    margin-top: 40px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    margin: 18px 0 20px;
}

.card {
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 150px;
    height: 208px;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(.3, 1.4, .5, 1);
}

.card:hover .card-inner,
.card-inner.is-flipped {
    transform: rotateY(180deg) translateY(-6px);
}

.card-front, .card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.card-back { transform: rotateY(180deg); }

.card:hover .card-back { box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 30px var(--red-glow); }

#AS, #ROI, #REINE, #JOKER, #MEURTRE {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============ Footer ============ */
footer {
    width: min(640px, calc(100% - 32px));
    margin: 0 auto 24px;
    padding: 16px 22px;
    background: rgba(18, 14, 15, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: 999px;
}

footer div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

footer p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

footer a {
    margin: 0;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    background: rgba(255, 43, 43, 0.12);
    border: 1px solid rgba(255, 43, 43, 0.35);
    transition: background 0.2s, box-shadow 0.2s;
}

footer a:hover {
    background: rgba(255, 43, 43, 0.22);
    box-shadow: 0 0 20px var(--red-glow);
}

a {
    color: var(--red);
    text-decoration: none;
    font-weight: 700;
}

/* ============ Animations ============ */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes pop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { translate: 0; }
    20% { translate: -8px; }
    40% { translate: 7px; }
    60% { translate: -5px; }
    80% { translate: 3px; }
}

@keyframes deal {
    from { opacity: 0; transform: translateY(-30px) rotate(-12deg) scale(0.8); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============ Mobile ============ */
@media (max-width: 600px) {
    header { padding: 6px 6px 6px 10px; top: 10px; }
    header img { width: 36px; height: 36px; }
    .close-button img { width: 28px; height: 28px; }
    nav a { padding: 7px 11px; font-size: 14px; }

    .page { padding-top: 28px; }
    #logo { width: 110px; }
    .panel { padding: 22px 16px; }
    h2, #nameInputs > p { font-size: 19px; }

    button { font-size: 16px; padding: 13px 20px; }
    #specialButton, #nameInputs > button, .row button { width: 100%; }
    #playerList { width: 100%; }
    .row { flex-direction: column; align-items: stretch; }
    #playerCount { width: 100%; }

    #playground { width: 220px; }
    #cardImage { width: 120px; }

    .card-container { gap: 10px; flex-wrap: nowrap; }
    .card-inner { width: 21vw; height: 29vw; max-width: 110px; max-height: 152px; }
    .card-front, .card-back { border-radius: 8px; }

    #rulesText { padding: 4px 16px 18px; font-size: 15px; }
    .counts { font-size: 13px; }
    .counts th, .counts td { padding: 8px 4px; }

    footer { border-radius: var(--radius); }
    footer div { justify-content: center; }
}

/* =========================================================
   Composants du jeu (js/game.js)
   ========================================================= */

.hint {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--muted);
}

.game-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -8px -4px 6px;
}

.alive-count {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.1); box-shadow: none; }

/* --- Boutons joueurs --- */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.player-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 10px 12px;
    font-size: 17px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 3px solid currentColor;
    border-radius: 14px;
    box-shadow: none;
    transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.player-chip:hover { background: rgba(255, 255, 255, 0.06); box-shadow: none; filter: none; }

.player-chip.selected {
    background: rgba(255, 43, 43, 0.14);
    border-color: var(--red);
    box-shadow: 0 0 0 2px var(--red), 0 0 24px var(--red-glow);
    transform: translateY(-2px);
}

.chip-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.chip-dots { display: flex; gap: 5px; }

.chip-dots i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    opacity: 0.5;
}

.chip-dots i.on { background: currentColor; opacity: 1; }

.chip-count { font-size: 13px; font-weight: 700; }

.chill { color: var(--green); }
.warning { color: var(--orange); }
.lost1 { color: #ff3b3b; opacity: 0.55; }
.lost1 .chip-name { text-decoration: line-through; color: #ff3b3b; }

button:disabled { cursor: wait; }

.shoot {
    display: block;
    width: min(100%, 380px);
    margin: 0 auto;
}

.special-hint { margin-top: 18px; }

.special { gap: 10px; }

button.danger {
    background: linear-gradient(180deg, #2a2224, #1a1415);
    border: 1px solid rgba(255, 43, 43, 0.5);
    color: var(--red-soft);
    font-size: 15px;
    box-shadow: 0 0 18px rgba(255, 43, 43, 0.12);
}

button.small { padding: 9px 18px; font-size: 14px; }

button.armed { color: #fff; border-color: var(--red); background: rgba(255, 43, 43, 0.2); }

/* --- Carte Chaos --- */
.chaos-panel {
    margin-top: 18px;
    padding: 6px 18px 20px;
    border: 1px dashed rgba(255, 43, 43, 0.45);
    border-radius: 16px;
    background: rgba(255, 43, 43, 0.04);
    animation: rise 0.3s ease both;
}

.chaos-panel h3 { margin-top: 14px; }

.chaos-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 18px;
}

.chaos-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}

.chaos-shooter { text-align: right; font-weight: 700; color: #fff; }
.chaos-arrow { font-size: 13px; color: var(--muted); }

.chaos-target {
    font-family: var(--body);
    font-size: 15px;
    padding: 10px 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

.chaos-target option { background: #1a1415; }

/* --- Résultat multiple --- */
.result-title { display: block; }

.result-lines {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    font-family: var(--body);
    font-size: 15px;
    letter-spacing: 0;
    text-shadow: none;
}

.result-lines li {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
}

.result-lines li.lost { color: #ff5a5a; }
.result-lines li.survived { color: var(--green); }
.result-lines strong { color: inherit; }

.result.multi { font-size: clamp(30px, 6vw, 42px); }

/* --- Cartes conseillées / reprise --- */
.recommend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(232, 164, 90, 0.08);
    border: 1px solid rgba(232, 164, 90, 0.25);
    animation: rise 0.3s ease both;
}

.recommend-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.recommend strong { font-size: 15px; }

.resume { margin-top: 14px; }

.resume-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
    padding: 12px 16px;
}

.resume-label { font-size: 14px; }

.resume-names {
    max-width: 100%;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Statistiques & historique --- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 10px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 0;
}

.stat-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-value {
    font-family: var(--display);
    font-weight: 400;
    font-size: 28px;
    letter-spacing: 0.04em;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat:first-child .stat-value { color: var(--gold); text-shadow: 0 0 18px rgba(232, 164, 90, 0.4); }

.stat-sub { font-size: 12px; color: var(--muted); }

.history {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
    text-align: left;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
}

.history li {
    display: grid;
    grid-template-columns: 46px 22px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.history time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history .h-dot { justify-self: center; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.history .h-dead .h-dot, .history .h-eliminated .h-dot { background: #ff4a4a; }
.history .h-survived .h-dot { background: var(--green); }
.history .h-win .h-dot, .history .h-devil .h-dot, .history .h-chaos .h-dot { background: var(--gold); }
.history .h-win { background: rgba(232, 164, 90, 0.08); color: #fff; font-weight: 700; }
.history .h-round { color: var(--muted); }

.h-mode {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

/* --- Messages --- */
.toasts {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: min(420px, calc(100% - 32px));
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: rgba(28, 22, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    animation: rise 0.25s ease both;
    transition: opacity 0.3s, transform 0.3s;
}

.toast.warn { border-color: rgba(255, 154, 31, 0.5); }
.toast.error { border-color: rgba(255, 43, 43, 0.6); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 43, 43, 0.25); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* --- Barillet --- */
.barrel-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: rgba(8, 6, 7, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fade 0.2s ease both;
}

.barrel-overlay.dead { animation: redflash 0.6s ease both; }

.barrel-box { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.barrel {
    width: min(58vw, 230px);
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.7));
}

.barrel .cyl { fill: #2b2427; stroke: #5a4f52; stroke-width: 2; }
.barrel .chamber { fill: #0b0909; stroke: #6b5f62; stroke-width: 2; }
.barrel .axis { fill: #4a4043; stroke: #7a6d70; stroke-width: 2; }
.barrel .hammer { fill: var(--red); }
.barrel-overlay.dead .chamber { fill: #3a0b0b; }
.barrel-overlay.dead .barrel { animation: shake 0.45s; }

.barrel-name {
    margin: 14px 0 0;
    font-family: var(--display);
    font-size: clamp(40px, 10vw, 64px);
    letter-spacing: 0.05em;
    line-height: 1;
    color: #fff;
}

.barrel-status {
    margin: 0;
    min-height: 1.2em;
    font-family: var(--display);
    font-size: clamp(30px, 8vw, 46px);
    letter-spacing: 0.08em;
    color: var(--muted);
}

.barrel-status.show { animation: pop 0.35s cubic-bezier(.2, 1.4, .4, 1) both; }
.barrel-overlay.dead .barrel-status { color: #ff3b3b; text-shadow: 0 0 30px rgba(255, 43, 43, 0.8); }
.barrel-overlay.safe .barrel-status { color: var(--green); text-shadow: 0 0 24px rgba(62, 224, 122, 0.5); }

.screen-flash {
    position: fixed;
    inset: 0;
    z-index: 150;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 43, 43, 0.35), rgba(255, 43, 43, 0.1) 70%);
    animation: fadeout 0.7s ease both;
}

/* --- Gagnant --- */
.winner-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(8, 6, 7, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fade 0.3s ease both;
}

#confetti {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.winner-box {
    position: relative;
    width: min(420px, 100%);
    padding: 34px 24px 26px;
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(40, 30, 28, 0.95), rgba(20, 16, 17, 0.95));
    border: 1px solid rgba(232, 164, 90, 0.35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(232, 164, 90, 0.15);
    animation: pop 0.5s cubic-bezier(.2, 1.4, .4, 1) both;
}

.trophy { width: 96px; height: auto; filter: drop-shadow(0 0 24px rgba(255, 43, 43, 0.5)); animation: float 3s ease-in-out infinite; }

.winner-label {
    margin: 14px 0 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.winner-box h2 {
    margin: 4px 0 6px;
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(48px, 13vw, 72px);
    letter-spacing: 0.04em;
    line-height: 1;
    text-shadow: 0 0 30px rgba(232, 164, 90, 0.5);
    overflow-wrap: anywhere;
}

.winner-sub { margin: 0 0 22px; color: var(--muted); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes redflash {
    0% { background: rgba(120, 0, 0, 0.9); }
    100% { background: rgba(8, 6, 7, 0.88); }
}

@media (max-width: 600px) {
    .player-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .player-chip { font-size: 16px; padding: 12px 8px 10px; }
    .shoot { width: 100%; }
    .special { flex-direction: column; align-items: stretch; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 24px; }
    .history li { grid-template-columns: 40px 20px 1fr; font-size: 13px; padding: 8px 10px; }
    .history .h-mode { grid-column: 3; justify-self: start; }
    .chaos-panel { padding: 4px 12px 16px; }
}

.icon-btn { display: inline-grid; place-items: center; }

/* =========================================================
   Règles du jeu
   ========================================================= */

#rulesText {
    padding: 24px 28px 28px;
    font-size: 16px;
    line-height: 1.65;
}

#rulesText p { margin: 0 0 12px; }
#rulesText p:last-child { margin-bottom: 0; }
#rulesText b { color: #fff; }

/* --- Résumé --- */
.rule-summary {
    padding: 20px 22px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 43, 43, 0.14), rgba(255, 43, 43, 0.03));
    border: 1px solid rgba(255, 43, 43, 0.28);
}

.rule-kicker {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--red-soft);
}

#rulesText .rule-summary p {
    margin: 0 0 18px;
    font-size: 18px;
    line-height: 1.55;
    color: #fff;
}

.rule-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 0;
}

.rule-facts div {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.rule-facts dt {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.rule-facts dd {
    margin: 2px 0 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

/* --- Sommaire --- */
.rule-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 20px 0 6px;
}

.rule-toc a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 6px 12px 6px 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.2s, border-color 0.2s;
}

.rule-toc a:hover {
    color: #fff;
    text-shadow: none;
    background: rgba(255, 43, 43, 0.12);
    border-color: rgba(255, 43, 43, 0.4);
}

.rule-toc span {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 43, 43, 0.7);
}

/* --- Sections --- */
.rule-section {
    padding-top: 26px;
    margin-top: 26px;
    border-top: 1px solid var(--panel-border);
    scroll-margin-top: 90px;
}

#rulesText .rule-section h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    font-size: 27px;
    line-height: 1.1;
}

.rule-num {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-family: var(--body);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
    color: #fff;
    background: var(--red);
    box-shadow: 0 0 16px var(--red-glow);
}

.rule-body {
    padding-left: 44px;
    max-width: 62ch;
}

#rulesText .note {
    padding: 10px 14px;
    font-size: 14px;
    color: var(--muted);
    border-left: 3px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0 10px 10px 0;
}

.rule-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rule-list li {
    position: relative;
    padding: 7px 0 7px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.rule-list li:last-child { border-bottom: 0; }

.rule-list li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 1.05em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--red);
}

.rule-steps {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rule-steps li {
    position: relative;
    counter-increment: step;
    padding: 10px 14px 10px 46px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
}

.rule-steps li::before {
    content: counter(step);
    position: absolute;
    left: 12px;
    top: 11px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--red);
    color: var(--red-soft);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.example {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    font-style: italic;
    color: var(--gold);
}

/* --- Menteur --- */
.verdicts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 4px 0 12px;
}

.verdict {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-radius: 14px;
    text-align: center;
}

.verdict strong {
    font-family: var(--display);
    font-weight: 400;
    font-size: 26px;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.verdict.lie { background: rgba(255, 43, 43, 0.1); border: 1px solid rgba(255, 43, 43, 0.35); }
.verdict.lie strong { color: #ff4a4a; }
.verdict.truth { background: rgba(62, 224, 122, 0.07); border: 1px solid rgba(62, 224, 122, 0.3); }
.verdict.truth strong { color: var(--green); }

/* --- Cartes spéciales --- */
.special-rules { display: flex; flex-direction: column; gap: 10px; }

.special-rule {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.special-rule img, .special-tile {
    flex: none;
    width: 64px;
    height: 89px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.special-tile {
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-size: 20px;
    letter-spacing: 0.08em;
    color: var(--red-soft);
    background: linear-gradient(160deg, #3a1416, #16100f);
    border: 1px solid rgba(255, 43, 43, 0.45);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.special-rule strong { display: block; margin-bottom: 4px; font-size: 17px; color: #fff; }
#rulesText .special-rule p { margin: 0; }

#rulesText .app-hint {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
}

.app-hint span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red-soft);
}

/* --- Pistolet --- */
.odds {
    width: 100%;
    margin: 4px 0 12px;
    border-collapse: collapse;
    font-size: 15px;
}

.odds th {
    padding: 0 12px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: left;
    color: var(--muted);
}

.odds td {
    padding: 9px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.odds td:first-child { width: 60px; font-weight: 700; color: #fff; }

.odds td:last-child { position: relative; }

.odds .bar {
    display: block;
    width: var(--w);
    height: 5px;
    margin-bottom: 5px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--orange), var(--red));
}

.odds tr.max td { color: #ff4a4a; font-weight: 700; }

.recommend.warn { background: rgba(255, 154, 31, 0.08); border-color: rgba(255, 154, 31, 0.35); }
.recommend.warn .recommend-label { color: var(--orange); }

@media (max-width: 600px) {
    #rulesText { padding: 18px 14px 22px; font-size: 15px; }
    #rulesText .rule-summary p { font-size: 16px; }
    .rule-summary { padding: 16px; }
    .rule-facts { grid-template-columns: 1fr; }
    .rule-facts div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
    .rule-facts dd { margin: 0; font-size: 15px; text-align: right; }
    .rule-toc { display: grid; grid-template-columns: 1fr; gap: 4px; }
    .rule-toc a { border-radius: 10px; }
    .rule-body { padding-left: 0; }
    #rulesText .rule-section h3 { font-size: 24px; }
    .verdicts { grid-template-columns: 1fr; }
    .special-rule { gap: 12px; }
    .special-rule img, .special-tile { width: 50px; height: 70px; }
    .special-tile { font-size: 16px; }
}

/* =========================================================
   Nouveautés : couleurs, annulation, fin de partie, table,
   titres, mise à jour, mode tablette
   ========================================================= */

/* --- Avatars et couleurs --- */
.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    color: #0c0a0b;
    background: var(--pc, #888);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4), 0 0 14px color-mix(in srgb, var(--pc, #888) 45%, transparent);
}

.avatar.big { width: 52px; height: 52px; font-size: 24px; }

.player-chip .avatar { margin-bottom: 2px; }
.lost1 .avatar { filter: grayscale(1); opacity: 0.6; }

.player-chip.winner {
    color: var(--gold);
    border-color: rgba(232, 164, 90, 0.6);
    background: rgba(232, 164, 90, 0.1);
    box-shadow: 0 0 24px rgba(232, 164, 90, 0.25);
}

#nameInputsContainer { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.name-row input { flex: 1; min-width: 0; }

.swatch {
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--pc);
    border: 3px solid rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 14px color-mix(in srgb, var(--pc) 50%, transparent);
}

.swatch:hover { background: var(--pc); filter: brightness(1.1); box-shadow: 0 0 0 2px #fff; }

/* --- Outils en haut de la zone de jeu --- */
.game-tools { display: flex; gap: 6px; }
#tabletToggle[aria-pressed="true"] { background: var(--red); border-color: var(--red); }

/* --- Fin de partie --- */
.finished-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 4px;
    text-align: left;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(232, 164, 90, 0.16), rgba(232, 164, 90, 0.04));
    border: 1px solid rgba(232, 164, 90, 0.4);
    animation: rise 0.35s ease both;
}

.finished-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.finished-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
}

.finished-text strong {
    font-family: var(--display);
    font-weight: 400;
    font-size: 30px;
    letter-spacing: 0.04em;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

/* --- Annuler --- */
.undo-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 12px auto 0;
    padding: 8px 10px 12px;
    max-width: 420px;
    overflow: hidden;
    font-size: 14px;
    color: var(--muted);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    animation: rise 0.25s ease both;
}

.undo-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--red);
    transform-origin: left;
}

@keyframes undo-countdown {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.link-btn {
    margin-top: 14px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
    box-shadow: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-btn:hover { color: #fff; background: none; box-shadow: none; transform: none; }

/* --- Carte de la table --- */
#tableButton.pulse {
    color: #fff;
    border-color: var(--red);
    background: rgba(255, 43, 43, 0.15);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 43, 43, 0.45); }
    50% { box-shadow: 0 0 0 10px rgba(255, 43, 43, 0); }
}

#cardImage.dealing { animation: deal 0.6s cubic-bezier(.2, 1, .3, 1) both; }
#cardImage.flip-half { transform: rotateY(90deg); }

/* --- Titres de la soirée --- */
.titles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    text-align: left;
}

.title-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 0;
}

.title-text { display: flex; flex-direction: column; min-width: 0; }

.title-name {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
}

.title-text strong {
    font-size: 17px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.title-reason { font-size: 13px; color: var(--muted); }

#historyPanel .row { margin-top: 4px; }

/* --- Bandeau de mise à jour --- */
.update-banner {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 400;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
    width: min(520px, calc(100% - 32px));
    padding: 14px 16px;
    text-align: left;
    border-radius: 18px;
    background: rgba(28, 22, 24, 0.97);
    border: 1px solid rgba(255, 43, 43, 0.45);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
    animation: rise 0.3s ease both;
}

.update-banner span { flex: 1 1 200px; font-size: 14px; color: var(--muted); }
.update-banner strong { display: block; font-size: 15px; color: #fff; }
.update-banner button { padding: 10px 18px; font-size: 14px; }

.update-banner .update-close {
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--muted);
    padding: 10px 6px;
}

.update-banner .update-close:hover { color: #fff; background: none; box-shadow: none; transform: none; }

/* --- Mode tablette --- */
body.tablet header,
body.tablet .hero,
body.tablet #playerSetup,
body.tablet #nameInputs,
body.tablet #playground,
body.tablet #rules,
body.tablet #historyPanel,
body.tablet footer {
    display: none !important;
}

body.tablet .page {
    width: min(1280px, calc(100% - 24px));
    padding: 12px 0;
}

body.tablet #gameArea {
    min-height: calc(100vh - 24px);
    min-height: calc(100dvh - 24px);
    margin: 0;
    padding: 20px 24px;
}

body.tablet #gameArea h2 { font-size: 26px; }
body.tablet .player-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
body.tablet .player-chip { font-size: 22px; padding: 18px 12px 14px; }
body.tablet .player-chip .avatar { width: 46px; height: 46px; font-size: 20px; }
body.tablet .chip-dots i { width: 12px; height: 12px; }
body.tablet .chip-count { font-size: 15px; }
body.tablet .shoot { font-size: 34px; padding: 16px 30px; }
body.tablet #cardImage { width: 200px; }
body.tablet #tableText, body.tablet .result { font-size: clamp(42px, 5vw, 64px); }

@media (min-width: 900px) {
    body.tablet .game-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 28px;
        align-items: start;
    }

    body.tablet .game-side {
        position: sticky;
        top: 12px;
        padding: 18px;
        border-radius: 18px;
        background: rgba(0, 0, 0, 0.22);
    }

    body.tablet .game-side .result { margin-top: 0; }
    body.tablet .game-side .result:empty + .undo-bar + .divider,
    body.tablet .game-side .result:empty + .undo-bar[hidden] + .divider { display: none; }
}

@media (max-width: 600px) {
    .titles { grid-template-columns: 1fr; }
    .finished-banner { flex-wrap: wrap; }
    .finished-banner button { width: 100%; }
    .undo-bar { flex-wrap: wrap; }
    #nameInputsContainer { grid-template-columns: 1fr; }
    body.tablet .player-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   Parties en direct (js/online.js)
   ========================================================= */

#liveButton.on { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 0 16px var(--red-glow); }

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fff;
    border-radius: 999px;
    background: rgba(255, 43, 43, 0.18);
    border: 1px solid rgba(255, 43, 43, 0.5);
    box-shadow: none;
}

.live-pill:hover { background: rgba(255, 43, 43, 0.28); box-shadow: none; transform: none; }

.game-top { gap: 8px; }
.game-top > .alive-count { margin-right: auto; }
.game-top > .live-pill + .game-tools, .game-top > .alive-count + .game-tools { margin-left: auto; }

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 0 0 rgba(255, 43, 43, 0.6);
    animation: live 1.6s ease-out infinite;
}

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

/* --- Fenêtre du meneur --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 260;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(8, 6, 7, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fade 0.2s ease both;
}

.modal-box {
    width: min(440px, 100%);
    padding: 28px 24px 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(36, 28, 30, 0.97), rgba(20, 16, 17, 0.97));
    border: 1px solid rgba(255, 43, 43, 0.35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    animation: pop 0.35s cubic-bezier(.2, 1.4, .4, 1) both;
}

.modal-box h2 { margin-bottom: 12px; }
.modal-box p { margin: 0 0 12px; line-height: 1.55; }
.modal-box > div > button { width: 100%; }

.modal-kicker, .room-label, .join-kicker {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--red-soft);
}

.room-code {
    margin: 4px 0 14px;
    font-family: var(--display);
    font-size: 88px;
    line-height: 1;
    letter-spacing: 0.18em;
    color: #fff;
    text-shadow: 0 0 30px var(--red-glow);
}

.room-link {
    width: 100%;
    margin-bottom: 14px;
    padding: 11px 14px;
    font-family: var(--body);
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

/* --- Bandeau du spectateur --- */
.live-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: -6px -6px 16px;
    padding: 10px 12px 10px 14px;
    text-align: left;
    border-radius: 14px;
    background: rgba(255, 43, 43, 0.1);
    border: 1px solid rgba(255, 43, 43, 0.35);
}

.live-banner.ended { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.12); }
.live-banner.ended .live-dot { background: var(--muted); animation: none; }

.live-banner-text { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 700; color: #fff; }
.live-banner-actions { display: inline-flex; align-items: center; gap: 8px; }

.live-leave {
    margin: 0;
    padding: 8px 14px;
    font-size: 14px;
    color: #fff;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.live-leave:hover { color: #fff; text-shadow: none; background: rgba(255, 255, 255, 0.14); }

/* Le spectateur regarde : pas de boutons d'action */
body.viewer #shootButton,
body.viewer #specialActions,
body.viewer .special-hint,
body.viewer #chaosPanel,
body.viewer #tableButton,
body.viewer #undoBar,
body.viewer #gameArea > .row,
body.viewer #gameArea > .divider:last-of-type,
body.viewer #finishedBanner button,
body.viewer #replayButton,
body.viewer #winnerUndo,
body.viewer #clearHistory,
body.viewer #playerSetup,
body.viewer #nameInputs {
    display: none !important;
}

body.viewer #gameArea h2 { font-size: 18px; color: var(--muted); }
body.viewer .player-chip { cursor: default; }
body.viewer .player-chip.selected { box-shadow: 0 0 0 2px var(--red), 0 0 24px var(--red-glow); }

/* --- Accueil : rejoindre --- */
.join {
    width: min(520px, 100%);
    margin: 40px auto 0;
    padding: 26px 22px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    animation: rise 0.5s 0.2s ease both;
}

.join h2 { margin: 4px 0 6px; font-size: 24px; }
.join p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }

.join-form { display: flex; gap: 10px; justify-content: center; }

#joinCode {
    width: 150px;
    padding: 12px;
    font-family: var(--display);
    font-size: 32px;
    letter-spacing: 0.2em;
    text-align: center;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
}

#joinCode:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 43, 43, 0.15); }
#joinCode::placeholder { color: #4d4547; }

.join-error { margin: 12px 0 0 !important; color: #ff6d6d !important; font-weight: 600; }

@media (max-width: 600px) {
    .room-code { font-size: 72px; }
    .join-form { flex-direction: column; align-items: stretch; }
    #joinCode { width: 100%; }
    .live-banner { margin: -4px -4px 14px; }
}

.hero-sub {
    margin: 4px 0 8px;
    font-size: 15px;
    color: var(--muted);
}

/* =========================================================
   Soutenir le projet (jeu de cartes MhyTom)
   ========================================================= */

.support-btn {
    display: inline-block;
    margin: 0;
    padding: 13px 26px;
    font-size: 16px;
    font-weight: 700;
    color: #1a1208;
    text-decoration: none;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffc978, #e8a45a);
    box-shadow: 0 8px 24px rgba(232, 164, 90, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: transform 0.15s, box-shadow 0.25s, filter 0.2s;
}

.support-btn:hover {
    color: #1a1208;
    text-shadow: none;
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 12px 30px rgba(232, 164, 90, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.support-btn.small { padding: 10px 18px; font-size: 14px; }

/* Accueil */
.support {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 34px;
    width: min(820px, 100%);
    margin: 50px auto 0;
    padding: 30px 34px;
    text-align: left;
    border-radius: 24px;
    background:
        radial-gradient(circle at 0% 50%, rgba(232, 164, 90, 0.14), transparent 60%),
        var(--panel);
    border: 1px solid rgba(232, 164, 90, 0.3);
    animation: rise 0.5s 0.2s ease both;
}

.support-cards {
    position: relative;
    width: 210px;
    height: 190px;
}

.support-cards img {
    position: absolute;
    top: 10px;
    width: 120px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55);
    transition: transform 0.35s cubic-bezier(.2, 1.4, .4, 1);
}

.support-cards img:nth-child(1) { left: 0; transform: rotate(-14deg); }
.support-cards img:nth-child(2) { left: 45px; transform: translateY(-8px); z-index: 1; }
.support-cards img:nth-child(3) { left: 90px; transform: rotate(14deg); }
.support:hover .support-cards img:nth-child(1) { transform: rotate(-20deg) translateX(-8px); }
.support:hover .support-cards img:nth-child(3) { transform: rotate(20deg) translateX(8px); }

.support-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}

.support h2 {
    margin: 4px 0 10px;
    font-family: var(--display);
    font-weight: 400;
    font-size: 36px;
    letter-spacing: 0.04em;
    line-height: 1.05;
    color: #fff;
}

.support-text > p { margin: 0 0 18px; line-height: 1.6; color: #cfc6c8; }
.support-text > .support-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* Pages de mode, sous les cartes */
.support-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 10px auto 10px;
    max-width: 640px;
    padding: 16px 18px;
    text-align: left;
    border-radius: 16px;
    background: rgba(232, 164, 90, 0.08);
    border: 1px solid rgba(232, 164, 90, 0.3);
}

.support-inline p { margin: 0; font-size: 15px; color: #cfc6c8; }
.support-inline strong { color: #fff; }
.support-inline .support-btn { flex: none; }

/* Écran du gagnant */
.winner-support {
    display: block;
    margin: 16px 0 0;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--muted);
    text-decoration: none;
    border-radius: 12px;
    background: rgba(232, 164, 90, 0.08);
    border: 1px solid rgba(232, 164, 90, 0.25);
}

.winner-support strong { display: block; color: var(--gold); }
.winner-support:hover { color: #fff; text-shadow: none; background: rgba(232, 164, 90, 0.14); }

footer a { white-space: nowrap; }

@media (max-width: 700px) {
    .support { grid-template-columns: 1fr; justify-items: center; gap: 16px; padding: 26px 20px; text-align: center; }
    .support-cards { width: 190px; height: 170px; }
    .support-cards img { width: 106px; }
    .support-cards img:nth-child(2) { left: 42px; }
    .support-cards img:nth-child(3) { left: 84px; }
    .support h2 { font-size: 30px; }
    .support-inline { flex-direction: column; text-align: center; }
}

/* --- Pied de page avec liens --- */
footer { border-radius: 24px; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 18px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--panel-border);
}

footer .footer-links a {
    padding: 4px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 0;
}

footer .footer-links a:hover { color: #fff; background: none; box-shadow: none; text-shadow: none; }

.support-more {
    display: inline-block;
    margin: 0 0 0 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.support-more:hover { color: #fff; text-shadow: none; }
.support-inline a:not(.support-btn) { margin: 0; color: var(--gold); text-decoration: underline; }

/* Récap mis en avant sur l'écran du gagnant */
.winner-recap { width: 100%; margin-top: 12px; }

@media (max-width: 700px) {
    .support-more { display: block; margin: 12px 0 0; }
}

/* --- Icône du compte dans l'en-tête --- */
.account-link {
    display: grid;
    place-items: center;
    flex: none;
    width: 38px;
    height: 38px;
    margin: 0;
    overflow: hidden;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 800;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.account-link:hover { color: #fff; text-shadow: none; background: rgba(255, 255, 255, 0.1); }

.account-link.signed-in {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
    box-shadow: 0 0 14px var(--red-glow);
}

.account-link img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 600px) {
    .account-link { width: 32px; height: 32px; font-size: 14px; }
    header { gap: 6px; }
}

/* =========================================================
   Direction artistique : le bar rouge
   Bois sombre, cuir, laiton et enseignes néon.
   ========================================================= */
:root {
    --bg: #070405;
    --bg-2: #11090b;
    --panel: rgba(20, 12, 14, 0.9);
    --panel-border: rgba(255, 231, 214, 0.1);
    --red: #ff3038;
    --red-soft: #ff777b;
    --red-deep: #790910;
    --red-glow: rgba(255, 35, 45, 0.48);
    --gold: #d7a45f;
    --gold-soft: #f1d49e;
}

body {
    background:
        linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px) 0 0 / 72px 72px,
        linear-gradient(rgba(255,255,255,0.009) 1px, transparent 1px) 0 0 / 72px 72px,
        radial-gradient(ellipse 68% 34% at 50% -4%, rgba(255, 28, 38, 0.25), transparent 72%),
        radial-gradient(ellipse 45% 40% at 0% 85%, rgba(111, 5, 13, 0.15), transparent 75%),
        linear-gradient(145deg, #13090b 0%, #090506 46%, #050304 100%);
    background-attachment: fixed;
}

body::before {
    opacity: 0.065;
    mix-blend-mode: soft-light;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(0,0,0,.62), transparent 12%, transparent 88%, rgba(0,0,0,.62));
    box-shadow: inset 0 0 180px rgba(0,0,0,.72);
}

header {
    top: 12px;
    background:
        linear-gradient(180deg, rgba(40, 22, 25, .92), rgba(13, 8, 9, .94));
    border-color: rgba(235, 195, 151, .15);
    box-shadow:
        0 14px 40px rgba(0,0,0,.5),
        inset 0 1px 0 rgba(255,255,255,.08),
        0 0 28px rgba(255,31,40,.06);
}

header::before {
    content: "";
    position: absolute;
    inset: 4px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.035);
    border-radius: inherit;
}

nav { background: rgba(0,0,0,.22); }

nav a {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
}

nav a.active {
    background: linear-gradient(180deg, #ff4148, #a80c14);
    box-shadow: 0 0 10px rgba(255,35,45,.72), 0 0 28px rgba(255,35,45,.3), inset 0 1px rgba(255,255,255,.28);
}

.panel,
#rulesText,
.join,
.about-steps li,
.faq details {
    position: relative;
    background:
        linear-gradient(135deg, rgba(255,255,255,.028), transparent 38%),
        linear-gradient(180deg, rgba(30,17,20,.94), rgba(13,8,9,.96));
    border-color: rgba(236, 198, 165, .11);
    box-shadow:
        0 22px 60px rgba(0,0,0,.48),
        inset 0 1px 0 rgba(255,255,255,.045),
        inset 0 -1px 0 rgba(0,0,0,.5);
}

.panel::after,
.join::after {
    content: "";
    position: absolute;
    inset: 7px;
    z-index: -1;
    pointer-events: none;
    border: 1px solid rgba(215,164,95,.08);
    border-radius: calc(var(--radius) - 7px);
}

.step {
    color: var(--gold-soft);
}

.step span {
    background: linear-gradient(145deg, #efc17e, #855323);
    color: #170d08;
    box-shadow: 0 0 0 2px rgba(215,164,95,.12), 0 4px 12px rgba(0,0,0,.35);
}

button {
    text-transform: uppercase;
    letter-spacing: .07em;
    background: linear-gradient(180deg, #ff464d 0%, #c10d17 58%, #7f080e 100%);
    border: 1px solid rgba(255,123,128,.34);
    box-shadow: 0 8px 24px rgba(196, 9, 18, .34), inset 0 1px 0 rgba(255,255,255,.28), inset 0 -2px 0 rgba(0,0,0,.28);
}

button:hover {
    box-shadow: 0 12px 34px rgba(255,31,40,.42), 0 0 18px rgba(255,31,40,.18), inset 0 1px 0 rgba(255,255,255,.3);
}

.hero h1,
#tableText {
    text-shadow:
        0 0 4px rgba(255,255,255,.88),
        0 0 12px rgba(255,45,54,.9),
        0 0 36px rgba(255,23,34,.62);
}

.badge {
    color: #ffd4d5;
    background: rgba(137,5,13,.35);
    border-color: rgba(255,74,82,.4);
    box-shadow: inset 0 0 18px rgba(255,22,33,.12), 0 0 16px rgba(255,22,33,.12);
}

.card-front,
.card-back,
#cardImage {
    border: 1px solid rgba(243,210,171,.15);
}

footer {
    background: linear-gradient(180deg, rgba(28,15,18,.84), rgba(10,6,7,.9));
    border-color: rgba(215,164,95,.12);
    box-shadow: 0 18px 48px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.04);
}

@media (max-width: 600px) {
    body::after { box-shadow: inset 0 0 90px rgba(0,0,0,.62); }
    nav a { letter-spacing: .04em; }
}

/* =========================================================
   Prise en main, règles maison et QR du direct
   ========================================================= */
.setup-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

button.setup-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border-color: rgba(215,164,95,.15);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .06em;
}

button.setup-action:hover { color: #fff; border-color: rgba(215,164,95,.3); }

.experience-modal { z-index: 280; }

.experience-modal .modal-box {
    position: relative;
    border-color: rgba(215,164,95,.26);
    background:
        radial-gradient(circle at 50% 0, rgba(137,8,16,.24), transparent 48%),
        linear-gradient(180deg, rgba(31,17,20,.99), rgba(10,6,7,.99));
    box-shadow: 0 35px 90px rgba(0,0,0,.72), inset 0 0 0 7px rgba(215,164,95,.025);
}

.modal-x {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 36px !important;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: none;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
}

.modal-x:hover { color: #fff; background: rgba(255,255,255,.08); box-shadow: none; }

.tutorial-box { text-align: center; }

.tutorial-visual {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    margin: 24px auto 12px;
    color: #fff;
    border: 1px solid rgba(255,83,90,.5);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255,52,61,.3), rgba(91,5,12,.42));
    box-shadow: 0 0 18px rgba(255,35,45,.28), inset 0 0 26px rgba(255,35,45,.12);
    font-family: var(--display);
    font-size: 48px;
    text-shadow: 0 0 18px var(--red-glow);
}

.tutorial-visual { line-height: 1; }

.tutorial-count {
    margin: 0 0 4px !important;
    color: var(--gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.tutorial-box h2 { margin: 0 0 8px; font-family: var(--display); font-size: 38px; font-weight: 400; letter-spacing: .05em; }
.tutorial-copy { min-height: 68px; margin: 0 auto 14px !important; max-width: 340px; color: #cfc6c8; }

.tutorial-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.tutorial-dots i { width: 18px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12); }
.tutorial-dots i.on { width: 34px; background: var(--red); box-shadow: 0 0 10px var(--red-glow); }
.tutorial-box #tutorialNext { width: 100%; }
.tutorial-box #tutorialSkip { width: auto; margin-top: 10px; }

.house-rules-box { text-align: left; }
.house-rules-box > h2 { margin: 5px 0 5px; font-family: var(--display); font-size: 40px; font-weight: 400; letter-spacing: .05em; }

.rule-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 22px 0 14px;
    padding: 0;
    border: 0;
}

.rule-picker legend {
    grid-column: 1 / -1;
    width: 100%;
    margin-bottom: 7px;
    color: var(--gold-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.rule-picker label { cursor: pointer; }
.rule-picker input { position: absolute; opacity: 0; pointer-events: none; }

.rule-picker span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    height: 100%;
    padding: 13px 10px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    background: rgba(0,0,0,.25);
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.rule-picker b { font-size: 13px; }
.rule-picker small { color: var(--muted); font-size: 10px; }
.rule-picker input:checked + span { border-color: var(--red); background: rgba(255,35,45,.12); box-shadow: 0 0 16px rgba(255,35,45,.12); }
.rule-picker input:focus-visible + span { outline: 2px solid var(--red-soft); outline-offset: 2px; }

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 20px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    background: rgba(0,0,0,.22);
    cursor: pointer;
}

.switch-row span { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 11px; }
.switch-row input { position: absolute; opacity: 0; }
.switch-row i { position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px; background: #3a3032; transition: background .2s; }
.switch-row i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch-row input:checked + i { background: var(--red); box-shadow: 0 0 14px var(--red-glow); }
.switch-row input:checked + i::after { transform: translateX(20px); }
.switch-row input:focus-visible + i { outline: 2px solid var(--red-soft); outline-offset: 3px; }
.house-rules-box #saveHouseRules { width: 100%; }

.room-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin: 4px auto 14px;
    padding: 10px 10px 8px;
    color: var(--gold-soft);
    border: 1px solid rgba(215,164,95,.22);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0,0,0,.36), 0 0 24px rgba(255,35,45,.1);
}

.room-qr img { display: block; width: 176px; height: 176px; image-rendering: pixelated; }
.room-qr span { color: #3c2225; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

@media (max-width: 600px) {
    .setup-actions { flex-direction: column; }
    button.setup-action { width: 100%; }
    .experience-modal .modal-box { max-height: calc(100vh - 24px); overflow-y: auto; padding: 24px 18px 17px; }
    .rule-picker { grid-template-columns: 1fr; }
    .rule-picker span { flex-direction: row; justify-content: space-between; align-items: center; }
    .tutorial-visual { width: 76px; height: 76px; font-size: 40px; }
}

/* =========================================================
   Navigation éditoriale du pied de page
   ========================================================= */
footer { width: min(860px, calc(100% - 32px)); }

footer .footer-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 14px;
    padding: 0 0 14px;
}

footer .footer-links a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px 11px;
    color: #a99da0;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 12px;
    background: rgba(0,0,0,.22);
    font-size: 10px;
    line-height: 1.15;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: normal;
    transition: color .2s, border-color .2s, background .2s, transform .2s, box-shadow .2s;
}

footer .footer-links a::before {
    content: "";
    flex: none;
    width: 19px;
    height: 19px;
    background-color: currentColor;
    -webkit-mask: var(--footer-icon) center / contain no-repeat;
    mask: var(--footer-icon) center / contain no-repeat;
}

footer .footer-links a[href*="jeu-de-cartes"] {
    --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='5' y='3' width='14' height='18' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 7c-1.2 2-3.5 2.5-3.5 4.4 0 1.2.9 2.1 2.1 2.1.6 0 1.1-.2 1.4-.6.3.4.8.6 1.4.6 1.2 0 2.1-.9 2.1-2.1C15.5 9.5 13.2 9 12 7Zm-1.4 9h2.8' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

footer .footer-links a[href*="comment-jouer"] {
    --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 5h14a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8l-5 4v-4H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M9 9.5h6M9 13h4' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

footer .footer-links a[href*="jeux-de-bluff"] {
    --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='2.7' fill='black'/%3E%3C/svg%3E");
}

footer .footer-links a[href*="confidentialite"] {
    --footer-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 20 6v5c0 5-3.4 8.5-8 10-4.6-1.5-8-5-8-10V6l8-3Z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='m8.8 12 2.1 2.1 4.5-4.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

footer .footer-links a:hover,
footer .footer-links a[aria-current="page"] {
    color: #fff;
    border-color: rgba(255,55,64,.36);
    background: linear-gradient(180deg, rgba(255,44,53,.13), rgba(107,6,13,.12));
    box-shadow: inset 0 1px rgba(255,255,255,.04), 0 0 18px rgba(255,35,45,.1);
    transform: translateY(-2px);
}

footer .footer-links a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--red);
    box-shadow: 0 0 9px var(--red), 0 0 18px var(--red-glow);
}

@media (max-width: 700px) {
    footer .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    footer .footer-links a { font-size: 10px; padding: 10px; }
}

@media (max-width: 390px) {
    footer .footer-links a { gap: 7px; font-size: 9px; }
    footer .footer-links a::before { width: 17px; height: 17px; }
}

/* =========================================================
   Animations de jeu cinématiques
   ========================================================= */
.hero h1 { animation: neon-warmup .9s ease-out both; }

.barrel-overlay {
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(118,8,16,.2), transparent 34%),
        rgba(5,3,4,.92);
    animation: barrel-curtain .28s ease-out both;
}

.barrel-overlay::before {
    content: "";
    position: absolute;
    inset: -30%;
    pointer-events: none;
    opacity: .18;
    background: repeating-conic-gradient(from 0deg at 50% 42%, transparent 0 8deg, rgba(255,45,54,.08) 9deg 10deg);
    animation: ambient-rotate 18s linear infinite;
}

.barrel-box {
    position: relative;
    z-index: 1;
    animation: barrel-enter .5s cubic-bezier(.16,1,.3,1) both;
}

.barrel-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: min(66vw, 280px);
    aspect-ratio: 1;
    transform-origin: 50% 65%;
}

.barrel {
    position: relative;
    z-index: 2;
    width: 82%;
    filter: drop-shadow(0 24px 36px rgba(0,0,0,.78)) drop-shadow(0 0 16px rgba(255,35,45,.08));
}

.barrel-aura {
    position: absolute;
    inset: 9%;
    z-index: 0;
    border: 1px solid rgba(255,55,64,.16);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,35,45,.12), transparent 68%);
    box-shadow: 0 0 50px rgba(255,24,35,.12), inset 0 0 42px rgba(255,24,35,.08);
    animation: aura-breathe 2.2s ease-in-out infinite;
}

.barrel .cyl {
    fill: #21191b;
    stroke: #69595d;
    stroke-width: 2;
}

.barrel .chamber {
    transition: fill .08s, stroke .08s, filter .08s;
}

.barrel .chamber.active {
    fill: #5c381c;
    stroke: var(--gold-soft);
    filter: drop-shadow(0 0 5px rgba(241,212,158,.75));
}

.barrel .axis { filter: drop-shadow(0 0 6px rgba(255,255,255,.15)); }
.barrel .hammer { transform-origin: 100px 14px; }
.barrel-overlay.arming .hammer { animation: hammer-cock .24s cubic-bezier(.2,1.6,.4,1) both; }
.barrel-overlay.spinning .barrel-stage { animation: barrel-tension 1.1s ease-in-out both; }

.muzzle-flash {
    position: absolute;
    z-index: 4;
    inset: 28%;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle, #fff 0 8%, #ffe6a8 9% 18%, rgba(255,70,35,.95) 24%, transparent 63%);
    mix-blend-mode: screen;
}

.barrel-sparks { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.barrel-sparks i {
    position: absolute;
    top: 50%;
    left: calc(50% - 2px);
    width: 4px;
    height: 30px;
    opacity: 0;
    border-radius: 999px;
    background: linear-gradient(#fff, #ffd079 35%, #ff382f 70%, transparent);
    transform-origin: 2px 0;
}

.barrel-overlay.dead .barrel-stage { animation: barrel-recoil .55s cubic-bezier(.2,.9,.25,1) both; }
.barrel-overlay.dead .muzzle-flash { animation: muzzle-burst .34s ease-out both; }
.barrel-overlay.dead .barrel-sparks i {
    animation: spark-fly .55s calc(var(--i) * 14ms) ease-out both;
}
.barrel-overlay.dead .chamber.active { fill: #cf1822; stroke: #fff; filter: drop-shadow(0 0 9px #ff3038); }

.barrel-overlay.safe .barrel-stage { animation: safe-settle .5s cubic-bezier(.2,1.3,.4,1) both; }
.barrel-overlay.safe .barrel-aura {
    border-color: rgba(62,224,122,.35);
    background: radial-gradient(circle, rgba(62,224,122,.13), transparent 66%);
    box-shadow: 0 0 56px rgba(62,224,122,.16), inset 0 0 42px rgba(62,224,122,.08);
}
.barrel-overlay.safe .chamber.active { fill: #164a2a; stroke: var(--green); filter: drop-shadow(0 0 8px rgba(62,224,122,.7)); }

.barrel-name { animation: name-lock .45s .08s cubic-bezier(.2,1.25,.35,1) both; }
.barrel-status.show { animation: status-stamp .4s cubic-bezier(.15,1.55,.3,1) both; }

.player-chip.selected {
    position: relative;
    animation: player-ready 1.8s ease-in-out infinite;
}

.player-chip.selected::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: -3px;
    height: 2px;
    border-radius: 4px;
    background: currentColor;
    box-shadow: 0 0 8px currentColor, 0 0 16px currentColor;
    animation: scan-line 1.8s ease-in-out infinite;
}

.shoot {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.shoot::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -80%;
    bottom: -80%;
    left: -30%;
    width: 18%;
    transform: rotate(18deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.42), transparent);
    animation: trigger-shine 3.2s ease-in-out infinite;
}

.table-zone { position: relative; perspective: 900px; }
.table-zone::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 230px;
    height: 230px;
    opacity: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,35,45,.2), transparent 66%);
    transform: scale(.5);
    transition: opacity .35s, transform .55s cubic-bezier(.2,1.2,.4,1);
}

.table-zone.revealing::before,
.table-zone.revealed::before { opacity: 1; transform: scale(1); }

#cardImage.dealing { animation: card-throw .65s cubic-bezier(.12,.9,.22,1.18) both; }
#cardImage.flip-half { transform: rotateY(90deg) scale(.92); filter: brightness(1.4) drop-shadow(0 0 20px var(--red-glow)); }
#cardImage.face-in { animation: card-face .6s cubic-bezier(.2,1.3,.35,1) both; }
.table-zone.revealed #tableText { animation: neon-label .55s .12s ease-out both; }

.result.survived { animation: result-safe .55s cubic-bezier(.2,1.35,.4,1) both; }
.result.lost { animation: result-danger .55s cubic-bezier(.2,1.35,.4,1) both, shake .5s .12s; }

@keyframes neon-warmup {
    0% { opacity: 0; filter: brightness(.35); text-shadow: none; }
    18% { opacity: .8; }
    25% { opacity: .35; }
    36% { opacity: 1; }
    44% { opacity: .55; }
    100% { opacity: 1; filter: brightness(1); }
}

@keyframes barrel-curtain { from { opacity: 0; backdrop-filter: blur(0); } to { opacity: 1; backdrop-filter: blur(8px); } }
@keyframes barrel-enter { from { opacity: 0; transform: translateY(32px) scale(.78); } to { opacity: 1; transform: none; } }
@keyframes ambient-rotate { to { transform: rotate(360deg); } }
@keyframes aura-breathe { 0%,100% { transform: scale(.94); opacity: .55; } 50% { transform: scale(1.05); opacity: 1; } }
@keyframes hammer-cock { 0% { transform: rotate(0); } 70% { transform: rotate(-28deg); } 100% { transform: rotate(-20deg); } }
@keyframes barrel-tension { 0% { transform: scale(1); } 42% { transform: scale(1.04) rotate(-1deg); } 100% { transform: scale(1); } }
@keyframes barrel-recoil { 0% { transform: scale(1); } 10% { transform: translateY(24px) scale(1.12); } 35% { transform: translateY(-15px) scale(.96) rotate(-3deg); } 70% { transform: translateY(5px) rotate(1deg); } 100% { transform: none; } }
@keyframes safe-settle { 0% { transform: scale(1); } 45% { transform: scale(.92); } 75% { transform: scale(1.03); } 100% { transform: none; } }
@keyframes muzzle-burst { 0% { opacity: 0; transform: scale(.15) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: scale(3.8) rotate(35deg); } }
@keyframes spark-fly {
    0% { opacity: 1; transform: rotate(calc(var(--i) * 36deg)) translateY(-35px) scaleY(.2); }
    100% { opacity: 0; transform: rotate(calc(var(--i) * 36deg)) translateY(-145px) scaleY(1); }
}
@keyframes name-lock { from { opacity: 0; transform: translateY(12px); letter-spacing: .2em; } to { opacity: 1; transform: none; letter-spacing: .05em; } }
@keyframes status-stamp { 0% { opacity: 0; transform: scale(1.7); filter: blur(6px); } 100% { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes player-ready { 0%,100% { translate: 0 0; } 50% { translate: 0 -3px; } }
@keyframes scan-line { 0%,100% { transform: scaleX(.45); opacity: .55; } 50% { transform: scaleX(1); opacity: 1; } }
@keyframes trigger-shine { 0%,62% { transform: translateX(0) rotate(18deg); opacity: 0; } 68% { opacity: 1; } 85%,100% { transform: translateX(760px) rotate(18deg); opacity: 0; } }
@keyframes card-throw { 0% { opacity: 0; transform: translate3d(130px,-90px,120px) rotate(18deg) scale(.7); } 72% { opacity: 1; transform: translate3d(-8px,5px,0) rotate(-2deg) scale(1.03); } 100% { transform: none; } }
@keyframes card-face { 0% { transform: rotateY(-90deg) scale(.92); filter: brightness(1.6); } 72% { transform: rotateY(7deg) scale(1.035); } 100% { transform: none; filter: none; } }
@keyframes neon-label { 0% { opacity: 0; letter-spacing: .18em; filter: blur(5px); } 100% { opacity: 1; letter-spacing: .05em; filter: blur(0); } }
@keyframes result-safe { 0% { opacity: 0; transform: translateY(14px) scale(.78); } 65% { transform: translateY(-3px) scale(1.04); } 100% { opacity: 1; transform: none; } }
@keyframes result-danger { 0% { opacity: 0; transform: scale(1.6); filter: blur(5px); } 100% { opacity: 1; transform: scale(1); filter: blur(0); } }

@media (max-width: 600px) {
    .barrel-stage { width: min(76vw, 260px); }
    .barrel-overlay::before { inset: -60%; }
}

/* =========================================================
   Direct : permissions joueur et ordre du meneur
   ========================================================= */
#liveModal .modal-box {
    max-height: min(92vh, 820px);
    overflow-y: auto;
}

.player-order {
    margin: 18px 0;
    padding: 16px;
    text-align: left;
    border: 1px solid rgba(215,164,95,.16);
    border-radius: 16px;
    background: rgba(0,0,0,.22);
}

.player-order > .hint { margin: 3px 0 10px; }
.player-order-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }

.player-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 7px 8px 7px 10px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 11px;
    background: rgba(255,255,255,.025);
    animation: order-in .25s ease both;
}

.player-order-name { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; font-size: 14px; font-weight: 700; }
.player-order-name b { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px; color: var(--gold-soft); background: rgba(215,164,95,.1); font-size: 11px; }
.player-order-actions { display: flex; gap: 5px; }
.player-order-actions .icon-btn { width: 34px; height: 34px; color: #fff; font-size: 18px; }
.player-order-actions .icon-btn:disabled { cursor: not-allowed; opacity: .24; }

.viewer-action {
    position: relative;
    margin: 0 0 18px;
    padding: 22px;
    overflow: hidden;
    text-align: center;
    border: 1px solid rgba(255,48,57,.32);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 0, rgba(255,35,45,.16), transparent 55%),
        linear-gradient(180deg, rgba(35,18,21,.96), rgba(12,7,8,.97));
    box-shadow: 0 18px 44px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.04);
}

.viewer-action::after {
    content: "";
    position: absolute;
    inset: 7px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,.035);
    border-radius: 12px;
}

.viewer-role {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--gold-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.viewer-role i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(62,224,122,.8); }
body.viewer #gameArea .viewer-action h2 { margin: 7px 0 4px; color: #fff; font-family: var(--display); font-size: 31px; font-weight: 400; letter-spacing: .04em; }
.viewer-action p { margin: 0 auto 16px; max-width: 430px; color: var(--muted); font-size: 13px; }
.viewer-action label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

#viewerPlayerName {
    width: min(100%, 320px);
    margin-bottom: 10px;
    padding: 12px 36px 12px 14px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: #100a0b;
    font: 600 15px var(--body);
    text-align: center;
}

#viewerPlayerName:focus { outline: 2px solid var(--red-soft); outline-offset: 2px; }

button.liar-button {
    position: relative;
    z-index: 1;
    display: block;
    width: min(100%, 320px);
    margin: 0 auto;
    padding: 16px 24px;
    font-family: var(--display);
    font-size: 30px;
    font-weight: 400;
    letter-spacing: .12em;
    background: linear-gradient(180deg, #ff4d55, #b40812 62%, #70060c);
    box-shadow: 0 9px 28px rgba(255,25,35,.34), inset 0 1px rgba(255,255,255,.3);
    animation: liar-ready 2.2s ease-in-out infinite;
}

button.liar-button:disabled { cursor: wait; animation: none; opacity: .72; }

.liar-call-alert {
    position: fixed;
    z-index: 340;
    left: 50%;
    top: 24%;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(520px, calc(100% - 32px));
    padding: 24px 28px;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -30px) scale(.72);
    border: 1px solid rgba(255,84,91,.62);
    border-radius: 20px;
    background: rgba(77,5,11,.94);
    box-shadow: 0 30px 90px rgba(0,0,0,.72), 0 0 55px rgba(255,20,31,.32), inset 0 0 40px rgba(255,35,45,.16);
}

.liar-call-alert span { color: #ffd5d7; font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.liar-call-alert strong { color: #fff; font-family: var(--display); font-size: clamp(58px, 12vw, 92px); font-weight: 400; line-height: .95; letter-spacing: .08em; text-shadow: 0 0 5px #fff, 0 0 24px var(--red); }
.liar-call-alert.show { animation: liar-alert 2.25s cubic-bezier(.15,1.2,.3,1) both; }

body.viewer #houseRulesButton,
body.viewer #tabletToggle,
body.viewer #soundToggle { display: none !important; }
body.viewer .player-chip { pointer-events: none; }

@keyframes order-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes liar-ready { 0%,100% { box-shadow: 0 9px 28px rgba(255,25,35,.3), 0 0 0 0 rgba(255,45,54,.2); } 50% { box-shadow: 0 12px 34px rgba(255,25,35,.46), 0 0 0 7px rgba(255,45,54,0); } }
@keyframes liar-alert { 0% { opacity: 0; transform: translate(-50%,-30px) scale(.72); } 12%,78% { opacity: 1; transform: translate(-50%,0) scale(1); } 86% { transform: translate(-50%,0) scale(1.04); } 100% { opacity: 0; transform: translate(-50%,-12px) scale(.92); } }

@media (max-width: 600px) {
    .viewer-action { padding: 19px 14px; }
    .liar-call-alert { top: 20%; padding: 20px 16px; }
}

/* =========================================================
   Mode Last Call (jeu à boire)
   ========================================================= */

.drink-chip .chip-sips {
    font-family: var(--display);
    font-size: 34px;
    line-height: 1;
    color: #fff;
}

.player-chip.next {
    border-color: rgba(232, 164, 90, 0.7);
    border-style: dashed;
    background: rgba(232, 164, 90, 0.07);
}

.drink-panel {
    margin: 4px 0 6px;
    padding: 18px;
    text-align: left;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
}

.drink-turn { margin: 0 0 14px; font-size: 16px; color: var(--muted); }
.drink-turn strong { color: #fff; font-size: 18px; }
.drink-turn span { color: var(--gold); font-weight: 600; }

.drink-step { margin-bottom: 16px; }

.drink-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.card-count { display: flex; gap: 8px; }

.count-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 0;
    font-family: var(--display);
    font-size: 28px;
    font-weight: 400;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.count-btn:hover { background: rgba(255, 255, 255, 0.1); box-shadow: none; }
.count-btn.on { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 0 18px var(--red-glow); }

.drink-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.drink-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px;
    text-align: left;
    border-radius: 14px;
    box-shadow: none;
}

.drink-btn strong { font-size: 15px; line-height: 1.25; }
.drink-btn small { font-size: 13px; font-weight: 600; opacity: 0.85; }

.drink-btn.believe { background: rgba(62, 224, 122, 0.12); border: 1px solid rgba(62, 224, 122, 0.45); color: #d9ffe8; }
.drink-btn.lie { background: rgba(255, 43, 43, 0.16); border: 1px solid rgba(255, 43, 43, 0.55); color: #ffe1e1; }
.drink-btn.truth { background: rgba(232, 164, 90, 0.14); border: 1px solid rgba(232, 164, 90, 0.5); color: #ffeeda; }
.drink-btn:hover { filter: brightness(1.15); box-shadow: none; }

.drink-panel > .link-btn { display: block; margin: 0 auto 6px; }

.drink-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--panel-border);
    font-size: 14px;
    color: var(--muted);
}

.drink-settings label { display: flex; align-items: center; gap: 8px; }

.drink-settings select {
    font-family: var(--body);
    font-size: 14px;
    padding: 7px 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.unit-toggle { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); }

.unit-toggle button {
    padding: 7px 12px;
    font-size: 13px;
    color: var(--muted);
    background: none;
    border-radius: 9px;
    box-shadow: none;
}

.unit-toggle button:hover { background: rgba(255, 255, 255, 0.06); box-shadow: none; transform: none; }
.unit-toggle button.on { color: #fff; background: rgba(255, 255, 255, 0.14); }

.drink-ranking {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    text-align: left;
    counter-reset: rank;
}

.drink-ranking li {
    counter-increment: rank;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--panel-border);
}

.drink-ranking li::before { content: counter(rank); width: 18px; font-weight: 800; color: var(--muted); }
.drink-ranking li:first-child { color: var(--gold); }
.drink-ranking .avatar { width: 28px; height: 28px; font-size: 13px; }
.dr-name { flex: 1; font-weight: 700; color: #fff; }
.dr-sips { font-size: 14px; color: var(--muted); }

.age-box p { text-align: left; }
.age-box .row { margin-top: 16px; }
.age-box .btn { margin: 0; }

body.viewer #drinkPanel { display: none !important; }

@media (max-width: 600px) {
    .drink-choices { grid-template-columns: 1fr; }
    .drink-settings { flex-direction: column; align-items: stretch; }
    .unit-toggle { justify-content: center; }
    .count-btn { font-size: 24px; padding: 10px 0; }
}

.age-box .btn {
    display: inline-block;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.age-box .btn:hover { color: #fff; text-shadow: none; background: rgba(255, 255, 255, 0.1); }

/* Phrases complètes dans les choix Last Call : plus lisibles sans majuscules */
.drink-btn { text-transform: none; letter-spacing: 0; }
