/* ════════════════════════════════════════════
   ÉCRAN DE DÉMARRAGE
════════════════════════════════════════════ */

#screen-start {
    background: #0a0a1a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 80px;
    cursor: pointer;
}

.start-logo {
    width: 870px;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: none !important;
}

.start-tap-hint {
    font-size: 52px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 6px;
    opacity: 0.7;
    animation: pulse 1.2s ease-in-out infinite;
}

.start-title-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 60px;
}


.start-url {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 4px;
    color: rgba(255,255,255,0.5);
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* ════════════════════════════════════════════
   SPLASH
════════════════════════════════════════════ */

#screen-splash {
    justify-content: center;
    background: #000;
}

.splash-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.splash-loader {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 10px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--blue-light);
    animation: spin 0.9s linear infinite;
}


/* ════════════════════════════════════════════
   MENU
════════════════════════════════════════════ */

#screen-menu {
    justify-content: center;
    gap: 0;
    padding-bottom: 100px;
}

.menu-top {
    margin-bottom: 80px;
    text-align: center;
}

.menu-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.menu-subtitle {
    font-size: 44px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    letter-spacing: 4px;
    text-align: center;
    margin-top: -150px;
}

.menu-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
}

.menu-title-img {
    height: 480px;
    object-fit: contain;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.playmate-sprite {
    width: 226px;
    height: 490px;
    background-image: url('../assets/images/playmate.png');
    background-size: 400% 100%;
    background-position: 0% 0%;
    background-repeat: no-repeat;
    flex-shrink: 0;
    position: relative;
    bottom: 10px;
    margin-right: -160px;
    z-index: 2;
}

.menu-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 56px;
    padding: 18px 56px;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.14);
    border-radius: 60px;
    font-size: 36px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
}

.menu-stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-stat-icon { font-size: 38px; }

.menu-stat-label {
    font-size: 28px;
    font-weight: 500;
    opacity: 0.6;
}

.menu-stat-sep {
    font-size: 48px;
    opacity: 0.25;
    line-height: 1;
}

.menu-buttons {
    width: 100%;
    padding: 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ════════════════════════════════════════════
   FORMULAIRES (CREATE / JOIN)
════════════════════════════════════════════ */

#screen-create,
#screen-join {
    padding: 0;
    justify-content: flex-start;
}

.form-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 60px 60px 40px;
    flex-shrink: 0;
}

.form-title {
    font-size: 72px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    text-shadow: 0 4px 0 rgba(0,0,0,0.15);
}

.form-label {
    font-size: 38px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    display: block;
    margin-bottom: 14px;
    margin-top: 10px;
}

.form-card {
    width: 100%;
    flex: 1;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    border-radius: 60px 60px 0 0;
    padding: 60px 70px 80px;
    border-top: 2px solid rgba(255,255,255,0.2);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ════════════════════════════════════════════
   SÉLECTEUR DE MODE DE JEU
════════════════════════════════════════════ */

#mode-select-create {
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mode-section-title {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 32px 0 14px;
}

#mode-select-create > .mode-section-title:first-child {
    margin-top: 0;
}

/* -- Pills de durée -- */

.duration-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.duration-pill {
    flex: 1;
    min-width: 110px;
    padding: 22px 8px 18px;
    background: rgba(255, 255, 255, 0.07);
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.duration-pill:active { transform: scale(0.96); }

.pill-emoji {
    font-size: 44px;
    line-height: 1;
    display: block;
}

.pill-label {
    font-size: 26px;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

.pill-desc {
    font-size: 20px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1;
}

.duration-pill.selected {
    background: var(--green);
    border-color: var(--green);
    box-shadow: 0 8px 0 var(--green-dark), 0 10px 20px rgba(90, 158, 30, 0.3);
}

.duration-pill.selected .pill-desc {
    color: rgba(255, 255, 255, 0.75);
}

/* -- Cartes modes spéciaux -- */

.special-modes {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.special-mode-card {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 26px 32px;
    background: rgba(255, 255, 255, 0.07);
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.special-mode-card:active { transform: scale(0.98); }

.special-mode-icon-wrap {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    flex-shrink: 0;
}

.special-mode-info {
    flex: 1;
}

.special-mode-name {
    font-size: 34px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 6px;
}

.special-mode-desc {
    font-size: 24px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.3;
}

.special-mode-radio {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s;
}

.special-mode-card.selected {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
}

.special-mode-card.selected .special-mode-radio {
    border-color: var(--white);
}

.special-mode-card.selected .special-mode-radio::after {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--white);
}

/* ── Option toggle (grilles mélangées, etc.) ── */

.option-toggle-card {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 26px 32px;
    background: rgba(255,255,255,0.07);
    border: 3px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    margin-top: 6px;
}

.option-toggle-card:active { transform: scale(0.98); }

.option-toggle-card.selected {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.5);
}

.option-toggle-icon {
    font-size: 44px;
    flex-shrink: 0;
    width: 60px;
    text-align: center;
}

.option-toggle-info { flex: 1; }

.option-toggle-name {
    font-size: 34px;
    font-weight: 800;
    color: var(--white);
}

.option-toggle-desc {
    font-size: 26px;
    color: rgba(255,255,255,0.55);
    margin-top: 4px;
}

.option-toggle-switch {
    font-size: 30px;
    font-weight: 900;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    letter-spacing: 1px;
}

.option-toggle-switch.on {
    background: var(--green);
    color: var(--white);
}

.option-toggle-switch.off {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.45);
}

/* ════════════════════════════════════════════
   SPLASH "DÉJÀ DIT" (mode MOI D'ABORD)
════════════════════════════════════════════ */

.splash-overlay {
    position: absolute;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.splash-overlay.hidden { display: none; }

.splash-already-card {
    background: linear-gradient(to bottom, #1a0a00, #3d1a00);
    border: 6px solid #c9920a;
    border-radius: var(--radius-lg);
    padding: 70px 100px;
    text-align: center;
    box-shadow: 0 0 60px rgba(201, 146, 10, 0.4), 0 30px 60px rgba(0,0,0,0.6);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.splash-already-icon {
    font-size: 120px;
    line-height: 1;
    margin-bottom: 20px;
    display: block;
}

.splash-already-text {
    font-size: 80px;
    font-weight: 900;
    color: #c9920a;
    text-shadow: 0 4px 0 rgba(0,0,0,0.4);
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.splash-already-word {
    font-size: 60px;
    font-weight: 700;
    color: var(--accent-lime);
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow:
        -2px -2px 0 #000,
         2px -2px 0 #000,
        -2px  2px 0 #000,
         2px  2px 0 #000;
}

/* ── Splash Mot Piégé ── */

.splash-piege-card {
    background: linear-gradient(to bottom, #1a0000, #3d0000);
    border: 6px solid #dc2626;
    border-radius: var(--radius-lg);
    padding: 60px 80px;
    text-align: center;
    box-shadow: 0 0 60px rgba(220, 38, 38, 0.4), 0 30px 60px rgba(0,0,0,0.6);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.splash-piege-icon {
    font-size: 120px;
    line-height: 1;
    margin-bottom: 16px;
    display: block;
}

.splash-piege-text {
    font-size: 80px;
    font-weight: 900;
    color: #dc2626;
    text-shadow: 0 4px 0 rgba(0,0,0,0.4);
    letter-spacing: 2px;
    margin-bottom: 28px;
}

.splash-piege-player {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 48px;
    font-weight: 700;
    color: #fff;
}

.splash-piege-player .avatar-sprite {
    width: 80px !important;
    height: 80px !important;
    border: 3px solid rgba(255,255,255,0.4);
    border-radius: 50%;
}

/* ── Case piégée ── */

.letter-case.trapped {
    background: linear-gradient(150deg, #374151 20%, #1f2937 100%) !important;
    color: #4b5563 !important;
    border-top-color: rgba(255,255,255,0.08) !important;
    border-left-color: rgba(255,255,255,0.05) !important;
    border-right-color: rgba(0,0,0,0.3) !important;
    border-bottom-color: rgba(0,0,0,0.3) !important;
    box-shadow: 0 8px 0 #111827, 0 12px 8px rgba(0,0,0,0.4) !important;
    filter: grayscale(1);
    cursor: not-allowed;
    transition: background 0.25s ease, color 0.25s ease;
}

/* ════════════════════════════════════════════
   LOBBY
════════════════════════════════════════════ */

#screen-lobby {
    padding: 0;
    justify-content: flex-start;
}

.lobby-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 60px 60px 40px;
    flex-shrink: 0;
}

.room-code-card {
    width: calc(100% - 120px);
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-lg);
    padding: 50px 60px;
    margin-bottom: 50px;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    gap: 50px;
}

.room-code-info {
    flex: 1;
    text-align: center;
}

.room-code-qr {
    flex-shrink: 0;
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.room-code-qr canvas,
.room-code-qr img {
    display: block;
}

.room-code-label {
    font-size: 38px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    margin-bottom: 16px;
}

.room-code-value {
    font-size: 160px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 20px;
    line-height: 1;
    text-shadow: 0 6px 0 rgba(0,0,0,0.2);
}

.room-code-hint {
    font-size: 36px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    margin-top: 16px;
}

.players-grid {
    width: calc(100% - 120px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    flex: 1;
}

.lobby-actions {
    width: 100%;
    padding: 40px 80px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.lobby-waiting {
    font-size: 40px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-align: center;
    margin: 0;
}

/* ════════════════════════════════════════════
   ÉCRAN DE JEU
════════════════════════════════════════════ */

.game-screen {
    padding: 0;
    justify-content: flex-start;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 20%, rgba(18,54,38,0.4) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(20,30,80,0.5) 0%, transparent 40%);
}

/* -- Étoiles décoratives -- */

.game-star {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    animation: floatStar 3s ease-in-out infinite;
    font-size: 42px;
}

.gs-1 { top: 15%; left: 8%;   animation-delay: 0s;   color: #f472b6; }
.gs-2 { top: 18%; right: 12%; animation-delay: 1s;   color: #facc15; font-size: 28px; }
.gs-3 { top: 30%; right: 6%;  animation-delay: 0.5s; color: #fef08a; font-size: 34px; opacity: 0.7; }

.ms-1 { top: 8%;    left: 6%;   animation-delay: 0s;    color: #f472b6; font-size: 44px; }
.ms-2 { top: 6%;    right: 8%;  animation-delay: 0.9s;  color: #facc15; font-size: 30px; }
.ms-3 { bottom: 18%; left: 8%;  animation-delay: 1.6s;  color: #a78bfa; font-size: 36px; opacity: 0.75; }

/* -- En-tête -- */

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 50px 56px 30px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.game-menu-btn {
    background: #c0182a;
    border: 6px solid #8b0f1e;
    color: var(--white);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    font-size: 42px;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 0 #6e0a17, 0 10px 20px rgba(0,0,0,0.4);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.game-menu-btn:active {
    transform: translateY(6px);
    box-shadow: 0 2px 0 #6e0a17;
}

.timer-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 13, 74, 0.72);
    color: var(--white);
    padding: 22px 48px 22px 110px;
    border-radius: var(--radius-pill);
    font-size: 58px;
    font-weight: 700;
    border: 10px solid #4b2685;
    box-shadow:
        0 12px 28px rgba(0,0,0,0.5),
        0 -2px 8px rgba(255,255,255,0.06),
        inset 0 3px 10px rgba(255,255,255,0.10),
        inset 0 -6px 16px rgba(0,0,0,0.45),
        inset 4px 0 10px rgba(0,0,0,0.2),
        inset -4px 0 10px rgba(0,0,0,0.2);
}

.timer-badge .hdr-icon {
    position: absolute;
    left: 36px;
    font-size: 50px;
    color: #b471ff;
}

.score-badge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(19, 17, 24, 0.72);
    color: var(--white);
    padding: 18px 90px 18px 110px;
    border-radius: var(--radius-pill);
    border: 10px solid #b59d28;
    box-shadow:
        0 12px 28px rgba(0,0,0,0.5),
        0 -2px 8px rgba(255,255,255,0.06),
        inset 0 3px 10px rgba(255,255,255,0.10),
        inset 0 -6px 16px rgba(0,0,0,0.45),
        inset 4px 0 10px rgba(0,0,0,0.2),
        inset -4px 0 10px rgba(0,0,0,0.2);
}

.score-badge .hdr-icon {
    position: absolute;
    left: 36px;
    font-size: 52px;
}

.score-badge .badge-label {
    font-size: 30px;
}

#game-timer {
    min-width: 5ch;
    display: inline-block;
    text-align: center;
}

#my-score {
    font-size: 72px;
    min-width: 180px;
    text-align: center;
}

.score-combo-badge {
    position: absolute;
    top: -18px;
    left: -18px;
    background: #fbbf24;
    color: #1a0a00;
    font-size: 28px;
    font-weight: 900;
    font-family: inherit;
    min-width: 62px;
    height: 62px;
    border-radius: 999px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 3px solid rgba(255,255,255,0.5);
    animation: comboBadgePop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.5);
}

@keyframes comboBadgePop {
    0%   { transform: scale(0.5); }
    100% { transform: scale(1); }
}

.hdr-icon {
    font-size: 46px;
    color: #b471ff;
    line-height: 1;
}

.hdr-icon-gold { color: #ffc800; }

.score-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.badge-label {
    font-size: 26px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    letter-spacing: 2px;
}

#my-score {
    font-size: 58px;
    font-weight: 700;
    color: var(--accent-yellow);
    line-height: 1;
}

/* -- Titre -- */

.game-info {
    width: 100%;
    padding: 10px 44px 16px;
    flex-shrink: 0;
    text-align: center;
    position: relative;
    z-index: 5;
}

.game-supertitle {
    font-size: 44px;
    font-weight: 600;
    color: var(--white);
    margin: 0 0 -8px;
    opacity: 0.9;
    letter-spacing: 1px;
}

.game-title {
    font-size: 76px;
    font-weight: 700;
    color: var(--white);
    margin: 0;
    text-shadow:
        -3px -3px 0 #123117,
         3px -3px 0 #123117,
        -3px  3px 0 #123117,
         3px  3px 0 #123117,
         0    6px 0 rgba(0,0,0,0.4);
    letter-spacing: 1px;
}

.title-yellow { color: var(--accent-yellow); }

/* -- Zone joueurs + mot en cours -- */

.game-mid-zone {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    min-height: 210px;
    z-index: 10;
}

#players-bubbles {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 18px 44px 22px;
    width: 100%;
    min-height: 210px;
}

.player-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(5, 25, 10, 0.75);
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 32px;
    padding: 18px 30px;
    min-width: 150px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.08);
}

.bubble-rank {
    font-size: 28px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1;
}

.bubble-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Bulles compactes (5+ joueurs) ── */

#players-bubbles[data-density="compact"] {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px 24px 16px;
    min-height: unset;
}

#players-bubbles[data-density="compact"] .player-bubble {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 18px;
    min-width: unset;
}

#players-bubbles[data-density="compact"] .bubble-rank {
    font-size: 22px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

#players-bubbles[data-density="compact"] .bubble-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

#players-bubbles[data-density="compact"] .bubble-name {
    font-size: 22px;
    flex: 1;
    min-width: 0;
    max-width: none;
}

#players-bubbles[data-density="compact"] .bubble-score {
    font-size: 26px;
    margin-left: auto;
    flex-shrink: 0;
}

.bubble-name {
    font-size: 30px;
    font-weight: 700;
    color: var(--white);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.1;
}

.bubble-score {
    font-size: 38px;
    font-weight: 900;
    color: var(--accent-yellow);
    line-height: 1;
    text-shadow: 0 2px 0 rgba(0,0,0,0.4);
}

/* -- Mot en cours -- */

.word-preview-area {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 76px;
    z-index: 20;
    pointer-events: none;
}


#current-word-badge {
    width: 100%;
    background: linear-gradient(to bottom, rgba(31, 80, 30, 0.72), rgba(19, 58, 20, 0.72));
    border: 10px solid #488732;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5), 0 16px 0 #0d280e;
    color: var(--accent-lime);
    padding: 18px 80px;
    border-radius: var(--radius-pill);
    font-size: 100px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 8px;
    text-shadow:
        -3px -3px 0 #000,
         3px -3px 0 #000,
        -3px  3px 0 #000,
         3px  3px 0 #000,
         0    6px 6px rgba(0,0,0,0.6),
         0    0   30px rgba(209,244,22,0.4);
}

/* -- Grille -- */

.grid-container {
    position: relative;
    margin: 2px auto 0;
    padding: 0px 10px 26px;
    width: calc(100% - 80px);
    max-width: 870px;
    background: rgba(11, 36, 19, 0.65);
    border-radius: 44px;
    border: 10px solid var(--game-board-border);
    box-shadow:
        0 20px 50px rgba(0,0,0,0.6),
        0 -3px 10px rgba(255,255,255,0.05),
        inset 0 5px 18px rgba(255,255,255,0.07),
        inset 0 -8px 24px rgba(0,0,0,0.5),
        inset 6px 0 14px rgba(0,0,0,0.25),
        inset -6px 0 14px rgba(0,0,0,0.25);
    flex-shrink: 0;
    z-index: 5;
}

.players-count-badge {
    position: absolute;
    top: 14px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 22px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.30);
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 6;
}

.players-count-badge .fa-user {
    font-size: 18px;
}

.grid-4x4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 24px;
    aspect-ratio: 798 / 728;
    touch-action: none;
}

.letter-case {
    background: linear-gradient(150deg, #fdfbf0 20%, #e8e2cc 100%);
    border-radius: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 112px;
    font-weight: 700;
    font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif;
    color: var(--tile-text);
    text-transform: uppercase;
    letter-spacing: -2px;
    border-top: 5px solid rgba(255,255,255,0.95);
    border-left: 5px solid rgba(255,255,255,0.7);
    border-right: 5px solid rgba(0,0,0,0.10);
    border-bottom: 5px solid rgba(0,0,0,0.15);
    box-shadow:
        0 16px 0 #b8aa80,
        0 22px 14px rgba(0,0,0,0.4),
        inset 0 5px 10px rgba(255,255,255,0.9),
        inset 5px 0 8px rgba(255,255,255,0.4),
        inset 0 -4px 8px rgba(0,0,0,0.12),
        inset -4px 0 8px rgba(0,0,0,0.07);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    position: relative;
    z-index: 2;
}

.letter-case.selected {
    background: linear-gradient(150deg, #f4ff80 20%, #c5e000 100%);
    color: #1a3a00;
    border-top: 5px solid rgba(255,255,255,0.95);
    border-left: 5px solid rgba(255,255,255,0.7);
    border-right: 5px solid rgba(0,0,0,0.10);
    border-bottom: 5px solid rgba(0,0,0,0.15);
    box-shadow:
        0 6px 0 #7a9900,
        0 10px 10px rgba(0,0,0,0.35),
        inset 0 5px 10px rgba(255,255,255,0.8),
        inset 0 -4px 8px rgba(0,0,0,0.15);
    transform: translateY(10px);
}

#selection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* -- Panneau inférieur -- */

.game-bottom-panel {
    width: 100%;
    background: transparent;
    padding: 0 40px 60px;
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* -- Mots trouvés -- */

.words-found-container {
    width: calc(100% - 10px);
    max-width: 960px;
    margin: 16px auto 24px;
    background: rgba(9, 43, 14, 0.85);
    padding: 22px 28px;
    border-radius: 60px;
    border: 10px solid var(--game-board-border);
    box-shadow:
        0 16px 40px rgba(0,0,0,0.6),
        0 -3px 10px rgba(255,255,255,0.05),
        inset 0 5px 18px rgba(255,255,255,0.07),
        inset 0 -8px 24px rgba(0,0,0,0.5),
        inset 6px 0 14px rgba(0,0,0,0.25),
        inset -6px 0 14px rgba(0,0,0,0.25);
    position: relative;
    z-index: 15;
}

.words-found-header {
    margin-bottom: 18px;
    flex-shrink: 0;
}

.words-found-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-lime);
    letter-spacing: 2px;
}

.words-grid {
    display: flex;
    flex-direction: row;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 18px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 60px;
    align-items: center;
    cursor: grab;
    user-select: none;
}

.words-grid::-webkit-scrollbar { display: none; }

.word-badge {
    background: #124d16;
    border: 3px solid #227228;
    padding: 10px 32px;
    border-radius: var(--radius-pill);
    font-size: 32px;
    font-weight: 700;
    color: #e2e8e2;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.word-badge.new {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    background: linear-gradient(to bottom, #b340ff, #710fc4);
    border-color: #d38bff;
    color: var(--white);
}

/* -- Barre de progression -- */

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-container {
    flex: 1;
    height: 24px;
    background: #051707;
    border-radius: var(--radius-pill);
    overflow: hidden;
    border: 3px solid #163a18;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, #408820, var(--accent-lime));
    border-radius: var(--radius-pill);
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-star {
    font-size: 26px;
    color: var(--accent-yellow);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    flex-shrink: 0;
}

/* -- Boutons d'action -- */

.game-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 10px;
    width: 100%;
    max-width: 960px;
    margin: auto auto 0;
}

.action-btn {
    position: relative;
    border-radius: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 14px;
    padding-top: 14px;
    height: 130px;
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: transform 0.1s ease;
}

.action-btn:active { transform: translateY(10px); }

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-hint {
    background: linear-gradient(to bottom, #ffb415, #f27100);
    border-top: 7px solid #ffdf73;
    border-bottom: 14px solid #b84a00;
    border-left: 5px solid #e68a00;
    border-right: 5px solid #e68a00;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.action-shuffle {
    background: linear-gradient(to bottom, #1eb0ff, #005add);
    border-top: 7px solid #8cd4ff;
    border-bottom: 14px solid #003882;
    border-left: 5px solid #007acc;
    border-right: 5px solid #007acc;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    height: 168px;
    margin-top: -38px;
}

.action-extra {
    background: linear-gradient(to bottom, #a22cd6, #6a00a3);
    border-top: 7px solid #d285ff;
    border-bottom: 14px solid #42006b;
    border-left: 5px solid #8817ba;
    border-right: 5px solid #8817ba;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.action-bonus {
    background: linear-gradient(to bottom, #ff2a85, #d1004a);
    border-top: 7px solid #ff85c2;
    border-bottom: 14px solid #85002a;
    border-left: 5px solid #e6005c;
    border-right: 5px solid #e6005c;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.action-icon {
    font-size: 52px;
    color: var(--white);
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.action-icon-red {
    color: #ff3333;
    background: white;
    border-radius: 50%;
    padding: 4px;
    font-size: 42px;
}

.action-icon-yellow { color: var(--accent-yellow); }

.action-label {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    text-shadow:
        -1px -1px 0 rgba(0,0,0,0.5),
         1px -1px 0 rgba(0,0,0,0.5),
        -1px  1px 0 rgba(0,0,0,0.5),
         1px  1px 0 rgba(0,0,0,0.5);
}

.action-badge {
    position: absolute;
    top: -14px;
    right: -14px;
    background: var(--green);
    color: var(--white);
    font-size: 30px;
    font-weight: 700;
    font-family: inherit;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 3px solid rgba(255,255,255,0.3);
}

#fx-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* ── Fond courbe coin bas-droit menu ── */

.menu-corner-bg {
    position: absolute;
    bottom: -72px;
    right: -72px;
    width: 448px;
    height: 448px;
    background: rgba(0, 0, 0, 0.60);
    border-radius: 55% 0 0 0;
    z-index: 6;
    pointer-events: none;
}

/* ── Version app menu ── */

.menu-version {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.35);
    z-index: 10;
    pointer-events: none;
}

/* ── QR code menu ── */

.menu-qrcode-wrap {
    position: absolute;
    bottom: 60px;
    right: 36px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    opacity: 0.88;
    animation: qrFloat 3.5s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes qrFloat {
    0%,  100% { transform: rotate(10deg) scale(1);    }
    50%        { transform: rotate(10deg) scale(1.05); }
}

.menu-qrcode-wrap > div:first-child {
    background: #fff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 6px 28px rgba(0,0,0,0.5);
}

.menu-qrcode-wrap canvas,
.menu-qrcode-wrap img {
    display: block;
}

.menu-qrcode-label {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* ── Indicateur skip intro ── */

.btn-skip-intro {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 22px 60px;
    font-size: 40px;
    font-weight: 900;
    font-family: inherit;
    letter-spacing: 3px;
    color: #fff;
    background: rgba(255,255,255,0.12);
    border: 4px solid rgba(255,255,255,0.8);
    border-radius: 60px;
    cursor: pointer;
    white-space: nowrap;
    z-index: 10;
    animation: skipBlink 1s step-start infinite;
}

@keyframes skipBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── Combo overlay ── */

.combo-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    z-index: 30;
    white-space: nowrap;
}

.combo-overlay.combo-pop {
    animation: comboPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

.combo-overlay.combo-fade-out {
    animation: comboFadeOut 1.4s ease forwards;
}

.combo-label {
    font-size: 110px;
    font-weight: 900;
    font-family: 'Arial Black', Arial, sans-serif;
    color: #fbbf24;
    text-shadow:
        0 0 40px rgba(251,191,36,0.9),
        0 0 80px rgba(251,191,36,0.5),
        0 6px 0 rgba(0,0,0,0.6);
    letter-spacing: -2px;
    line-height: 1;
}

.combo-pts {
    font-size: 62px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 0 rgba(0,0,0,0.55);
    margin-top: 8px;
}

@keyframes comboPop {
    0%   { transform: scale(0.6); opacity: 0; }
    70%  { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

@keyframes comboFadeOut {
    0%   { opacity: 1; transform: translateY(0); }
    30%  { opacity: 1; transform: translateY(-20px); }
    100% { opacity: 0; transform: translateY(-90px); }
}

/* ── XP flottant ── */

.floating-xp {
    position: absolute;
    font-size: 58px;
    font-weight: 900;
    font-family: 'Arial Black', Arial, sans-serif;
    color: #fbbf24;
    pointer-events: none;
    z-index: 700;
    text-shadow: 0 3px 0 rgba(0,0,0,0.5), 0 0 20px rgba(251,191,36,0.8);
    animation: floatXP 1.1s ease forwards;
    transform: translateX(-50%);
}

@keyframes floatXP {
    0%   { opacity: 1;   transform: translateX(-50%) translateY(0);     }
    20%  { opacity: 1;   transform: translateX(-50%) translateY(-30px);  }
    100% { opacity: 0;   transform: translateX(-50%) translateY(-130px); }
}

/* ════════════════════════════════════════════
   RÉSULTATS
════════════════════════════════════════════ */

#screen-over {
    padding: 0;
    justify-content: flex-start;
    gap: 0;
}

.over-header {
    width: 100%;
    padding: 70px 60px 40px;
    text-align: center;
}

.winner-card {
    width: calc(100% - 120px);
    background: rgba(255,255,255,0.14);
    border: 2px solid rgba(255,255,255,0.22);
    border-radius: var(--radius-lg);
    padding: 60px 60px 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
    backdrop-filter: blur(10px);
}

.winner-crown {
    font-size: 100px;
    line-height: 1;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

.winner-avatar-slot {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: transparent;
    border: 8px solid rgba(255,255,255,0.4);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}

.winner-avatar-image {
    width: 100%;
    height: 100%;
}

.winner-name {
    font-size: 70px;
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 4px 0 rgba(0,0,0,0.2);
    text-align: center;
}

.winner-score {
    font-size: 56px;
    font-weight: 700;
    color: var(--green);
    text-shadow: 0 3px 0 var(--green-dark);
}

.ranking-list {
    width: calc(100% - 120px);
    flex: 1;
    overflow-y: auto;
}

.over-footer {
    width: 100%;
    padding: 40px 60px;
    display: flex;
    justify-content: center;
}

.btn-revanche {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    padding-right: 36px;
}

.revanche-countdown-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0,0,0,0.25);
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    min-width: 72px;
}

/* ════════════════════════════════════════════
   MEILLEURS SCORES
════════════════════════════════════════════ */

#screen-highscores {
    padding: 0;
    justify-content: flex-start;
    overflow: hidden;
}

/* ── État vide ── */

.hs-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 80px;
}

.hs-empty-icon {
    font-size: 140px;
    line-height: 1;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4));
    opacity: 0.6;
}

.hs-empty-text {
    font-size: 54px;
    font-weight: 800;
    color: rgba(255,255,255,0.75);
    text-align: center;
}

.hs-empty-sub {
    font-size: 38px;
    font-weight: 500;
    color: rgba(255,255,255,0.4);
    text-align: center;
    line-height: 1.4;
}

/* ── Carousel ── */

.hs-carousel-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 0 60px;
    user-select: none;
    cursor: grab;
    min-height: 0;
    width: 90%;
    max-width: 90%;
    align-self: center;
}
.hs-carousel-wrap:active { cursor: grabbing; }

.hs-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 32px 0 24px;
    flex-shrink: 0;
}

.hs-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.22);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}
.hs-dot.active {
    background: var(--accent-lime);
    transform: scale(1.35);
    box-shadow: 0 0 12px rgba(199,234,27,0.5);
}

.hs-viewport {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    padding: 0;
}

.hs-track {
    display: flex;
    height: 100%;
    will-change: transform;
}

.hs-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4px 0 8px;
}

/* ── Carte d'un mode ── */

.hs-card {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 3px solid rgba(255,255,255,0.14);
    border-radius: 52px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    max-height: 100%;
}

.hs-card-header {
    display: flex;
    align-items: center;
    gap: 36px;
    padding: 44px 56px;
    flex-shrink: 0;
    border-radius: 48px 48px 0 0;
}

.hs-mode-emoji {
    font-size: 80px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.hs-mode-info {
    flex: 1;
}

.hs-mode-label {
    font-size: 60px;
    font-weight: 900;
    color: var(--white);
    line-height: 1;
    text-shadow: 0 3px 0 rgba(0,0,0,0.25);
    letter-spacing: 1px;
}

.hs-mode-desc {
    font-size: 34px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
    line-height: 1;
}

/* ── Liste de scores ── */

.hs-list {
    padding: 20px 20px 30px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: none;
}
.hs-list::-webkit-scrollbar { display: none; }

.hs-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 28px;
    border-radius: 32px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.05);
    transition: background 0.15s;
}

/* Top 3 — grands */
.hs-r1 { background: linear-gradient(135deg, rgba(255,200,0,0.18), rgba(255,160,0,0.08)); border: 2px solid rgba(255,200,0,0.3); padding: 32px 28px; }
.hs-r2 { background: linear-gradient(135deg, rgba(192,192,192,0.18), rgba(160,160,160,0.08)); border: 2px solid rgba(200,200,200,0.25); padding: 28px 28px; }
.hs-r3 { background: linear-gradient(135deg, rgba(205,127,50,0.18), rgba(160,90,20,0.08)); border: 2px solid rgba(205,127,50,0.25); padding: 24px 28px; }

/* 4e+ — même taille que top 3 */
.hs-compact {
    padding: 28px 28px;
    border-radius: 32px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.05);
}

/* Rang top 3 : badge avec bordure + ombre */
.hs-rank-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    width: 84px;
    padding: 10px 8px 12px;
    border-radius: 20px;
}

.hs-rank-badge-1 {
    border: 3px solid #ffd700;
    box-shadow: 0 6px 0 rgba(120,70,0,0.85), 0 8px 28px rgba(255,200,0,0.55);
    background: rgba(255,190,0,0.48);
}
.hs-rank-badge-2 {
    border: 3px solid #c0c0c0;
    box-shadow: 0 6px 0 rgba(50,50,50,0.8), 0 8px 20px rgba(180,180,180,0.45);
    background: rgba(190,190,190,0.38);
}
.hs-rank-badge-3 {
    border: 3px solid #cd7f32;
    box-shadow: 0 6px 0 rgba(80,30,0,0.8), 0 8px 20px rgba(205,127,50,0.5);
    background: rgba(185,100,25,0.40);
}

.hs-rank-medal {
    font-size: 40px;
    line-height: 1;
}
.hs-r2 .hs-rank-medal { font-size: 34px; }
.hs-r3 .hs-rank-medal { font-size: 30px; }

.hs-rank-label {
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    display: flex;
    align-items: flex-start;
}
.hs-r2 .hs-rank-label { font-size: 44px; }
.hs-r3 .hs-rank-label { font-size: 38px; }

.hs-rank-badge-1 .hs-rank-label { color: #ffd700; text-shadow: 0 2px 0 rgba(0,0,0,0.4); }
.hs-rank-badge-2 .hs-rank-label { color: #d8d8d8; text-shadow: 0 2px 0 rgba(0,0,0,0.4); }
.hs-rank-badge-3 .hs-rank-label { color: #cd7f32; text-shadow: 0 2px 0 rgba(0,0,0,0.4); }

.hs-rank-sup {
    font-size: 0.38em;
    font-weight: 800;
    vertical-align: super;
    letter-spacing: 0.5px;
    margin-left: 1px;
}

/* Rang 4+ : simple numéro */
.hs-rank-num {
    font-size: 32px;
    font-weight: 700;
    width: 44px;
    text-align: center;
    flex-shrink: 0;
    color: rgba(255,255,255,0.4);
    line-height: 1;
}

.hs-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    flex-shrink: 0;
}
.hs-r1 .hs-avatar { width: 130px; height: 130px; }

.hs-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hs-name {
    font-size: 44px;
    font-weight: 700;
    color: var(--white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hs-meta {
    font-size: 28px;
    font-weight: 500;
    color: rgba(255,255,255,0.32);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-score-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    position: relative;
}

.hs-score {
    font-size: 52px;
    font-weight: 900;
    color: var(--accent-yellow);
    text-shadow: 0 2px 0 rgba(0,0,0,0.35);
}

.hs-combo-badge {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, #f97316, #ef4444);
    padding: 4px 16px;
    border-radius: 20px;
    transform: rotate(-6deg);
    box-shadow: 0 3px 0 rgba(0,0,0,0.3);
    letter-spacing: 1px;
    line-height: 1.2;
}

.hs-pts {
    font-size: 30px;
    font-weight: 600;
    color: rgba(255,221,0,0.65);
}

/* ── Hint navigation ── */

.hs-hint {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    letter-spacing: 6px;
    padding: 18px 0 12px;
    flex-shrink: 0;
    animation: skipPulse 2s ease-in-out infinite;
}

/* ════════════════════════════════════════════
   BOUTON RÈGLES DU JEU
════════════════════════════════════════════ */

.btn-menu-rules {
    position: absolute;
    top: 48px;
    right: 156px;
    z-index: 300;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    font-size: 40px;
    font-weight: 900;
    font-family: 'Fredoka', 'Nunito', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    border: 3px solid rgba(255,255,255,0.25);
    transition: background 0.2s, transform 0.1s;
}

.btn-menu-rules:active {
    background: rgba(255,255,255,0.25);
    transform: scale(0.93);
}

/* ════════════════════════════════════════════
   MODAL RÈGLES DU JEU
════════════════════════════════════════════ */

.rules-modal-overlay {
    position: absolute;
    inset: 0;
    z-index: 600;
    background: rgba(0, 0, 0, 0.80);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rules-modal-box {
    width: 940px;
    height: 1720px;
    background: linear-gradient(170deg, #0c1230 0%, #060d1e 100%);
    border: 3px solid rgba(255,255,255,0.14);
    border-radius: 60px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── En-tête modal ── */

.rules-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 52px 60px 32px;
    flex-shrink: 0;
}

.rules-modal-title {
    font-size: 52px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
}

.rules-close-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.7);
    font-size: 38px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.rules-close-btn:active {
    background: rgba(255,255,255,0.22);
}

/* ── Dots de navigation ── */

.rules-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 0 0 32px;
    flex-shrink: 0;
}

.rules-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s, width 0.25s;
}

.rules-dot.active {
    background: var(--accent-lime);
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(199,234,27,0.6);
    width: 40px;
    border-radius: 10px;
}

/* ── Viewport / Track ── */

.rules-viewport {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.rules-track {
    display: flex;
    height: 100%;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ── Navigation prev/next ── */

.rules-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 52px 48px;
    flex-shrink: 0;
}

.rules-nav-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: var(--white);
    font-size: 68px;
    font-weight: 300;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s, opacity 0.2s, transform 0.1s;
    padding-bottom: 6px;
}

.rules-nav-btn:active {
    background: rgba(255,255,255,0.18);
    transform: scale(0.93);
}

/* ════════════════════════════════════════════
   SLIDES RÈGLES
════════════════════════════════════════════ */

.rules-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 60px 30px;
    overflow-y: auto;
    scrollbar-width: none;
}

.rules-slide::-webkit-scrollbar { display: none; }

.rs-icon {
    font-size: 100px;
    line-height: 1;
    margin-bottom: 20px;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.5));
}

.rs-title {
    font-size: 72px;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 20px;
    text-align: center;
    text-shadow: 0 4px 0 rgba(0,0,0,0.3);
}

.rs-desc {
    font-size: 38px;
    font-weight: 500;
    color: rgba(255,255,255,0.70);
    text-align: center;
    line-height: 1.4;
    margin: 0 0 36px;
    max-width: 800px;
}

.rs-tip-box {
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(255,255,255,0.14);
    border-radius: 30px;
    padding: 22px 36px;
    font-size: 34px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    text-align: center;
    line-height: 1.4;
    margin-top: 28px;
    max-width: 800px;
}

/* ── Mini grille de démonstration (pleine taille) ── */

.rs-demo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    width: 660px;
}

.dc {
    background: linear-gradient(150deg, #fdfbf0 20%, #e8e2cc 100%);
    border-radius: 18px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 68px;
    font-weight: 700;
    font-family: 'Arial Black', Arial, sans-serif;
    color: #123117;
    border-top: 4px solid rgba(255,255,255,0.9);
    border-left: 4px solid rgba(255,255,255,0.7);
    border-right: 4px solid rgba(0,0,0,0.1);
    border-bottom: 4px solid rgba(0,0,0,0.15);
    box-shadow: 0 8px 0 #b8aa80, 0 12px 10px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

.dc.sel {
    background: linear-gradient(150deg, #f4ff80 20%, #c5e000 100%);
    color: #1a3a00;
    border-top: 4px solid rgba(255,255,255,0.95);
    border-left: 4px solid rgba(255,255,255,0.7);
    border-right: 4px solid rgba(0,0,0,0.08);
    border-bottom: 4px solid rgba(0,0,0,0.12);
    box-shadow: 0 6px 0 #7a9900, 0 10px 10px rgba(0,0,0,0.25);
    transform: translateY(-3px);
}

.rs-demo-arrow {
    font-size: 64px;
    font-weight: 900;
    color: var(--accent-lime);
    text-shadow: 0 0 20px rgba(199,234,27,0.5);
    line-height: 1;
}

.rs-result-badge {
    background: linear-gradient(135deg, #1a5e1e, #0d3a10);
    border: 3px solid #4a9c50;
    border-radius: var(--radius-pill);
    padding: 16px 48px;
    font-size: 46px;
    font-weight: 700;
    color: var(--accent-lime);
    letter-spacing: 2px;
    box-shadow: 0 6px 0 #062008, 0 10px 20px rgba(0,0,0,0.4);
}

.rs-result-gold {
    background: linear-gradient(135deg, #3a2600, #1e1200);
    border-color: #c9920a;
    color: #fbbf24;
    box-shadow: 0 6px 0 #110a00, 0 0 24px rgba(201,146,10,0.35), 0 10px 20px rgba(0,0,0,0.4);
}

/* ── Tags de direction ── */

.rs-demo-dirs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.rs-dir-tag {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 6px 18px;
    white-space: nowrap;
}

.rs-dir-change {
    color: var(--accent-lime);
    background: rgba(199,234,27,0.12);
    border-color: rgba(199,234,27,0.3);
}

/* ── Cellules numérotées ── */

.dc-step {
    position: relative;
}

.dc-step::after {
    content: attr(data-step);
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 0.26em;
    font-weight: 900;
    color: rgba(0, 55, 0, 0.60);
    font-family: 'Fredoka', 'Nunito', sans-serif;
    line-height: 1;
}

.demo-grid-sm .dc-step::after {
    font-size: 0.38em;
    top: 3px;
    right: 5px;
}

/* ── Chemin libre (slide 2) ── */

.rs-libre-wrap {
    width: 100%;
    background: rgba(199,234,27,0.06);
    border: 2px solid rgba(199,234,27,0.18);
    border-radius: 30px;
    padding: 22px 24px 20px;
    margin-bottom: 8px;
}

.rs-libre-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--accent-lime);
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 16px;
}

.rs-libre-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

.rs-libre-inner .demo-grid-sm {
    width: 240px;
    flex-shrink: 0;
}

.rs-libre-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.rs-libre-path {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rs-libre-word {
    font-size: 36px;
    font-weight: 900;
    color: #fbbf24;
    letter-spacing: 2px;
    text-shadow: 0 0 14px rgba(251,191,36,0.4);
}

/* ── 4 mini grilles (slide 2) ── */

.rs-4-grids {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    width: 100%;
    margin-bottom: 12px;
}

.rs-mini-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.10);
    border-radius: 32px;
    padding: 24px 16px 20px;
}

.demo-grid-sm {
    width: 100%;
    gap: 8px;
}

.demo-grid-sm .dc {
    font-size: 36px;
    border-radius: 12px;
    border-width: 3px;
    box-shadow: 0 5px 0 #b8aa80, 0 7px 6px rgba(0,0,0,0.3);
}

.demo-grid-sm .dc.sel {
    box-shadow: 0 4px 0 #7a9900, 0 6px 8px rgba(0,0,0,0.25);
    transform: translateY(-2px);
}

.rs-mini-dir-label {
    font-size: 30px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    letter-spacing: 1px;
    text-align: center;
}

.rs-mini-word {
    font-size: 38px;
    font-weight: 900;
    color: var(--accent-lime);
    letter-spacing: 4px;
    text-shadow: 0 0 14px rgba(199,234,27,0.4);
}

/* ── Score table (slide 3) ── */

.rs-score-table {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 8px;
}

.rs-score-row {
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    padding: 20px 28px;
}

.rs-score-max {
    background: rgba(199,234,27,0.10);
    border-color: rgba(199,234,27,0.30);
    box-shadow: 0 0 24px rgba(199,234,27,0.1);
}

.rs-score-ex {
    font-size: 34px;
    font-weight: 900;
    font-family: 'Arial Black', Arial, sans-serif;
    color: var(--white);
    letter-spacing: 3px;
    min-width: 120px;
    text-align: left;
}

.rs-score-bar-wrap {
    flex: 1;
    height: 22px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.rs-score-bar {
    height: 100%;
    background: linear-gradient(to right, #3b8f1a, var(--accent-lime));
    border-radius: var(--radius-pill);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rs-bar-max {
    background: linear-gradient(to right, #a0c820, #f4ff44);
    box-shadow: 0 0 12px rgba(199,234,27,0.6);
}

.rs-score-pts {
    font-size: 34px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    min-width: 140px;
    text-align: right;
    white-space: nowrap;
}

.rs-pts-max {
    color: var(--accent-lime);
    font-size: 36px;
    text-shadow: 0 0 12px rgba(199,234,27,0.5);
}

/* ── Formule combo ── */

.rs-combo-formula-box {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(251,191,36,0.10);
    border: 2px solid rgba(251,191,36,0.25);
    border-radius: 24px;
    padding: 18px 32px;
    margin-bottom: 24px;
    width: 100%;
}

.rs-cf-label {
    font-size: 32px;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: 1px;
}

.rs-cf-eq {
    font-size: 32px;
    font-weight: 400;
    color: rgba(255,255,255,0.4);
}

.rs-cf-val {
    font-size: 32px;
    font-weight: 800;
    color: var(--white);
}

.rs-cf-note {
    font-size: 26px;
    font-weight: 500;
    color: rgba(255,255,255,0.38);
}

/* ── Breakdown base + bonus ── */

.rs-combo-breakdown {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin: 4px 0 2px;
}

.rs-cb-base {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255,255,255,0.65);
}

.rs-cb-op {
    font-size: 26px;
    color: rgba(255,255,255,0.3);
}

.rs-cb-bonus {
    font-size: 28px;
    font-weight: 700;
    color: rgba(255,255,255,0.22);
}

.rs-cb-bonus-on {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251,191,36,0.5);
}

/* ── Ligne total ── */

.rs-combo-total-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.10);
    border-radius: 24px;
    padding: 18px 28px;
    margin: 14px 0 8px;
    width: 100%;
}

.rs-ct-label {
    font-size: 30px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
}

.rs-ct-calc {
    font-size: 30px;
    font-weight: 500;
    color: rgba(255,255,255,0.45);
}

.rs-ct-eq {
    font-size: 30px;
    color: rgba(255,255,255,0.3);
}

.rs-ct-result {
    font-size: 42px;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 14px rgba(251,191,36,0.4);
}

.rs-ct-gain {
    font-size: 26px;
    font-weight: 600;
    color: var(--accent-lime);
    background: rgba(199,234,27,0.12);
    border: 2px solid rgba(199,234,27,0.25);
    border-radius: 16px;
    padding: 4px 16px;
}

/* ── Combo chain (slide 4) ── */

.rs-combo-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.rs-combo-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.07);
    border: 2px solid rgba(255,255,255,0.12);
    border-radius: 30px;
    padding: 24px 28px;
    flex: 1;
}

.rs-combo-badge-x {
    font-size: 32px;
    font-weight: 900;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 6px 18px;
    line-height: 1;
}

.rs-combo-x2 {
    color: #fbbf24;
    background: rgba(251,191,36,0.18);
    border: 2px solid rgba(251,191,36,0.3);
    text-shadow: 0 0 14px rgba(251,191,36,0.6);
}

.rs-combo-x3 {
    color: #ff6b35;
    background: rgba(255,107,53,0.18);
    border: 2px solid rgba(255,107,53,0.35);
    text-shadow: 0 0 14px rgba(255,107,53,0.7);
    font-size: 36px;
}

.rs-combo-word {
    font-size: 38px;
    font-weight: 900;
    font-family: 'Arial Black', Arial, sans-serif;
    color: var(--white);
    letter-spacing: 3px;
}

.rs-combo-pts {
    font-size: 30px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
}

.rs-combo-pts-big {
    color: #fbbf24;
    font-size: 32px;
}

.rs-combo-pts-fire {
    color: #ff6b35;
    font-size: 30px;
    font-weight: 900;
}

.rs-combo-arrow {
    font-size: 52px;
    color: rgba(255,255,255,0.25);
    flex-shrink: 0;
    line-height: 1;
}

.rs-combo-reset {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(220, 38, 38, 0.12);
    border: 2px solid rgba(220,38,38,0.25);
    border-radius: 24px;
    padding: 24px 36px;
    font-size: 34px;
    font-weight: 600;
    color: rgba(255,255,255,0.65);
    text-align: left;
    line-height: 1.4;
    width: 100%;
}

.rs-combo-reset-icon {
    font-size: 48px;
    flex-shrink: 0;
}

/* ── Outils (slide 5) ── */

.rs-tools-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.rs-tool-item {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 28px 36px;
    border-radius: 30px;
    border: 3px solid transparent;
}

.rs-tool-hint {
    background: rgba(255, 180, 21, 0.12);
    border-color: rgba(255,180,21,0.25);
}

.rs-tool-shuffle {
    background: rgba(30, 176, 255, 0.10);
    border-color: rgba(30,176,255,0.22);
}

.rs-tool-target {
    background: rgba(162, 44, 214, 0.12);
    border-color: rgba(162,44,214,0.25);
}

.rs-tool-bonus {
    background: rgba(255,42,133,0.08);
    border-color: rgba(255,42,133,0.18);
    opacity: 0.65;
}

.rs-tool-icon-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.10);
}

.rs-tool-hint .rs-tool-icon-wrap { color: #ffb415; background: rgba(255,180,21,0.18); }
.rs-tool-shuffle .rs-tool-icon-wrap { color: #1eb0ff; background: rgba(30,176,255,0.18); }
.rs-tool-target .rs-tool-icon-wrap { color: #c062ff; background: rgba(162,44,214,0.18); }
.rs-tool-bonus .rs-tool-icon-wrap { color: #ff2a85; background: rgba(255,42,133,0.18); }

.rs-tool-info { flex: 1; }

.rs-tool-name {
    font-size: 40px;
    font-weight: 800;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 6px;
}

.rs-tool-badge-count {
    font-size: 26px;
    font-weight: 700;
    background: var(--green);
    color: var(--white);
    padding: 4px 14px;
    border-radius: 20px;
}

.rs-tool-badge-soon {
    font-size: 24px;
    font-weight: 600;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.45);
    padding: 4px 14px;
    border-radius: 20px;
}

.rs-tool-desc {
    font-size: 32px;
    font-weight: 500;
    color: rgba(255,255,255,0.50);
    line-height: 1.35;
}
