﻿
        /* إخفاء شريط التمرير */
        ::-webkit-scrollbar { display: none; }
        html { -ms-overflow-style: none; scrollbar-width: none; }

        body {
            box-sizing: border-box;
            font-family: 'AAGalaxy', Tahoma, Geneva, Verdana, sans-serif;
            /* NEW: Modern Teal/Cyan to Deep Blue Gradient */
            background: linear-gradient(135deg, #16a085 0%, #2980b9 100%);
            margin: 0;
            /* ADJUSTED: Padding only 10px top/bottom, 0px left/right */
            padding: 10px 0; 
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: flex-start; 
        }
        .container {
            /* REMOVED: max-w-4xl mx-auto to allow full width */
            width: 100%;
            max-width: 900px; /* Kept a sensible max width for content inside */
            margin: 0 auto;
            /* Added horizontal padding here instead of body to control content width */
            padding: 0 10px; 
        }

        /* --- START Player Input Field Styles (New) --- */
        .player-input-style {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.75em 1em;
            border: 2px solid #5a5a5a;
            border-radius: 10px;
            background: #2d3748; /* Darker background */
            color: #ffffff;
            font-size: 1rem;
            box-shadow: 0 0 0 1px #4b5563;
            transition: all 0.3s ease;
        }

        .player-input-style::placeholder {
            color: #9ca3af;
        }

        .player-input-style:focus {
            outline: none;
            border-color: #019b98; /* NEW: Teal focus color */
            box-shadow: 0 0 0 2px #019b98, 0 0 10px rgba(1, 155, 152, 0.5);
            transform: translateY(-2px);
        }
        /* --- END Player Input Field Styles --- */

        /* --- START Card Selection Styles --- */
       
        .go-corner {
            display: flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            width: 2em;
            height: 2em;
            overflow: hidden;
            top: 0;
            right: 0;
            background: #000000; /* Black */
            border-radius: 0 10px 0 32px; 
            z-index: 2;
        }

        .go-arrow {
            margin-top: -4px;
            margin-right: -4px;
            color: white;
            font-family: courier, sans;
            font-weight: bold;
        }

        .card {
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            position: relative;
            width: 100%;
            /* FIX: Set fixed height for consistent card size */
            min-height: 140px; 
            height: 140px;
            max-height: 320px;
            border-radius: 10px;
            padding: 1.5em 1em;
            text-decoration: none;
            z-index: 0;
            overflow: hidden;
            background: #1f2937; 
            font-family: 'AAGalaxy', Helvetica, sans-serif;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
            transition: transform 0.3s ease-out;
            text-align: center;
        }

        .card-img-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: -3; 
            background-color: #2d3748; /* Dark fill color for empty space */
            background-position: center;
            background-repeat: no-repeat;
            opacity: 1;
            border-radius: 10px;
            transition: opacity 0.3s ease-out;
        }
       
        /* --- Desktop Images (Default) --- */
        .card[data-category="foods"] .card-img-overlay { background-image: url('../../images/7Ly0r7nv-image.webp'); }
        .card[data-category="animals"] .card-img-overlay { background-image: url('../../images/C5ZWDdrQ-7.webp'); }
        .card[data-category="countries"] .card-img-overlay { background-image: url('../../images/D0WtsmpH-8.webp'); }
        .card[data-category="produce"] .card-img-overlay { background-image: url('../../images/zXn1ktkH-9.webp'); }
        .card[data-category="drinks"] .card-img-overlay { background-image: url('../../images/Y04JgjDP-6.webp'); }
        .card[data-category="clothing"] .card-img-overlay { background-image: url('../../images/65dNhjhC-10.webp'); }
        .card[data-category="places"] .card-img-overlay { background-image: url('../../images/8cFqWsn1-11.webp'); }
        .card[data-category="professions"] .card-img-overlay { background-image: url('../../images/professions-desktop.png'); }
        .card[data-category="sports_games"] .card-img-overlay { background-image: url('../../images/sports_games-desktop.png'); }
        .card[data-category="brands"] .card-img-overlay { background-image: url('../../images/brands-desktop.png'); }
        .card[data-category="quran_characters"] .card-img-overlay { background-image: url('../../images/quran_characters-desktop.png'); }
        .card[data-category="sahaba"] .card-img-overlay { background-image: url('../../images/sahaba-desktop.png'); }
        .card[data-category="quran_surahs"] .card-img-overlay { background-image: url('../../images/quran_surahs-desktop.png'); }
        .card[data-category="twoCategories"] .card-img-overlay { background-image: url('../../images/vT1p9DS8-12.webp'); }
        .card[data-category="random"] .card-img-overlay { background-image: url('../../images/J0y9JtYT-13.webp'); }

        /* --- Desktop Images (min-width: 640px) --- */
        @media (min-width: 640px) {
            .card-img-overlay {
                /* FIX 1: Desktop images use COVER to fill, preventing gaps */
                background-size: cover; 
            }
        }
       
        /* --- Mobile Images (max-width: 639px) --- */
        @media (max-width: 639px) {
            .card-img-overlay {
                /* CHANGED: Changed from 'contain' to 'cover' to remove edges */
                background-size: cover; 
            }

            /* Mobile specific images for categories */
            .card[data-category="foods"] .card-img-overlay { background-image: url('../../images/cJNBWR9m-5.webp'); }
            .card[data-category="animals"] .card-img-overlay { background-image: url('../../images/Qd7Jv4b0-7.webp'); }
            .card[data-category="countries"] .card-img-overlay { background-image: url('../../images/Qd7Jv4bm-8.webp'); }
            .card[data-category="produce"] .card-img-overlay { background-image: url('../../images/sgW4b6cK-9.png'); }
            .card[data-category="drinks"] .card-img-overlay { background-image: url('../../images/Pr9M3s1c-6.webp'); }
            .card[data-category="clothing"] .card-img-overlay { background-image: url('../../images/rw4N7nJJ-10.png'); }
            .card[data-category="places"] .card-img-overlay { background-image: url('../../images/W4PwVGWw-11.webp'); }
            .card[data-category="professions"] .card-img-overlay { background-image: url('../../images/2SQw5Bcb-14.webp'); }
            .card[data-category="sports_games"] .card-img-overlay { background-image: url('../../images/9Qdpfq8r-12.webp'); }
            .card[data-category="brands"] .card-img-overlay { background-image: url('../../images/XYf8vyHB-15.webp'); }
            .card[data-category="quran_characters"] .card-img-overlay { background-image: url('../../images/QdQbMW43-17.webp'); }
            .card[data-category="sahaba"] .card-img-overlay { background-image: url('../../images/BvJCPQkt-16.png'); }
            .card[data-category="quran_surahs"] .card-img-overlay { background-image: url('../../images/2SQw5Bcq-13.webp'); }
            .card[data-category="twoCategories"] .card-img-overlay { background-image: url('../../images/YSwz76nx-12.webp'); }
            .card[data-category="random"] .card-img-overlay { background-image: url('../../images/yNzyKmQX-13.webp'); }
        }


        /* Hover effect: dark overlay appears */
        .card:before {
            content: '';
            position: absolute;
            z-index: 1; 
            top: 0;
            right: 0;
            left: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.4); 
            opacity: 0;
            transition: opacity 0.3s ease-out;
            border-radius: 10px;
        }

        /* Reveal tooltip/description on hover */
        .card:hover:before {
            opacity: 1;
        }
       
        .card-description-box {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 3; 
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease-out;
            padding: 1rem;
            text-shadow: 0 0 5px #000;
        }

        .card:hover .card-description-box {
            opacity: 1;
        }
       
        /* --- END Card Selection Styles --- */

        /* --- START Question Turn Display (REDESIGNED) --- */
        .question-turn-container {
            display: flex;
            justify-content: center;
            align-items: stretch; /* Make cards same height */
            gap: 1rem;
            flex-wrap: wrap; 
        }

        .player-turn-card {
            box-sizing: border-box;
            flex: 1; 
            min-width: 220px;
            max-width: 300px;
            background: linear-gradient(160deg, #2a3a50 0%, #1e293b 100%); 
            border-radius: 16px;
            border-bottom: 4px solid; 
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            display: flex; 
            align-items: center;
            padding: 1.25rem;
            gap: 1rem;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        .player-turn-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        }

        .player-turn-card.asker { border-color: #38bdf8; } /* Light Blue */
        .player-turn-card.answerer { border-color: #34d399; } /* Emerald Green */

        /* Player Avatar (first Arabic letter) */
        .player-avatar {
            flex-shrink: 0;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.75rem;
            font-weight: 800;
            color: #fff;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
            border: 3px solid rgba(255, 255, 255, 0.18);
            line-height: 1;
        }
        .asker-avatar {
            background: linear-gradient(145deg, #38bdf8, #0284c7);
        }
        .answerer-avatar {
            background: linear-gradient(145deg, #34d399, #059669);
        }

        .card-text-area {
            text-align: right;
            color: white;
            overflow: hidden;
            flex-grow: 1;
        }

        .player-label {
            font-size: 0.875rem; 
            color: #9ca3af; 
            margin-bottom: 0.25rem;
            font-weight: 500;
        }
        .player-name {
            font-size: 1.5rem; 
            font-weight: 700; 
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis; 
        }

        /* Animated Arrow (replaces "يسأل") */
        .asks-arrow {
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fbbf24;
            flex-shrink: 0;
            animation: arrow-pulse 1.4s ease-in-out infinite;
        }
        .asks-arrow svg { width: 36px; height: 36px; }
        @keyframes arrow-pulse {
            0%, 100% { transform: translateX(0); opacity: 0.65; }
            50% { transform: translateX(-8px); opacity: 1; }
        }

        @media (max-width: 640px) {
            .question-turn-container {
                gap: 0.75rem;
            }
            .player-turn-card {
                width: 100%; 
                max-width: none;
                min-width: unset;
                padding: 1rem;
            }
            .player-name {
                font-size: 1.25rem;
            }
            .player-avatar {
                width: 48px;
                height: 48px;
                font-size: 1.5rem;
            }
            .asks-arrow {
                width: 100%;
                padding: 0.25rem 0;
                animation: arrow-pulse-vertical 1.4s ease-in-out infinite;
            }
            .asks-arrow svg { transform: rotate(-90deg); width: 32px; height: 32px; }
            @keyframes arrow-pulse-vertical {
                0%, 100% { transform: translateY(0); opacity: 0.65; }
                50% { transform: translateY(6px); opacity: 1; }
            }
        }
        /* --- END Question Turn Display (REDESIGNED) --- */

        /* --- START Question Number Badge --- */
        .question-number-badge {
            width: 72px;
            height: 72px;
            border-radius: 50%;
            background: linear-gradient(145deg, #6366f1, #8b5cf6);
            color: #fff;
            font-size: 1.5rem;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1.25rem;
            box-shadow: 0 8px 22px rgba(99, 102, 241, 0.4);
            border: 3px solid rgba(255, 255, 255, 0.18);
            letter-spacing: 0.5px;
        }
        .question-number-badge .num-divider { margin: 0 0.2rem; opacity: 0.65; }
        /* --- END Question Number Badge --- */

        /* --- START Question Pair Transition (slide + scale + avatar pulse) --- */
        .question-pair-fade {
            animation: pair-slide-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
        }
        /* RTL: new pair enters from the right, exits to the left */
        @keyframes pair-slide-in {
            0%   { opacity: 0; transform: translateX(40px) scale(0.94); }
            60%  { opacity: 1; }
            100% { opacity: 1; transform: translateX(0) scale(1); }
        }
        .question-pair-fade.fading-out {
            animation: pair-slide-out 0.28s cubic-bezier(0.55, 0, 0.68, 0.06) forwards;
        }
        @keyframes pair-slide-out {
            0%   { opacity: 1; transform: translateX(0) scale(1); }
            100% { opacity: 0; transform: translateX(-40px) scale(0.96); }
        }
        /* Brief glow pulse on avatars when a new pair enters */
        .question-pair-fade .player-avatar {
            animation: avatar-pulse 0.7s ease-out;
        }
        @keyframes avatar-pulse {
            0%   { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(255, 255, 255, 0.55); }
            50%  { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 8px rgba(255, 255, 255, 0); }
            100% { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(255, 255, 255, 0); }
        }
        /* --- END Question Pair Transition --- */

        /* --- START Question Tip --- */
        .question-tip {
            display: flex;
            align-items: center;
            gap: 0.7rem;
            background: rgba(251, 191, 36, 0.08);
            border: 1px solid rgba(251, 191, 36, 0.3);
            border-radius: 10px;
            padding: 0.7rem 1rem;
            margin-top: 1rem;
        }
        .question-tip .tip-icon {
            font-size: 1.25rem;
            flex-shrink: 0;
        }
        .question-tip p {
            color: #fef3c7;
            font-size: 0.92rem;
            margin: 0;
            line-height: 1.5;
        }
        /* --- END Question Tip --- */

        /* --- START Next Pair Preview --- */
        .next-pair-preview {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.55rem;
            background: rgba(15, 23, 42, 0.55);
            border: 1px dashed #475569;
            border-radius: 10px;
            padding: 0.6rem 1rem;
            margin-bottom: 1rem;
            font-size: 0.92rem;
            color: #94a3b8;
            flex-wrap: wrap;
        }
        .next-pair-preview .next-label { font-weight: 600; }
        .next-pair-preview .next-name { font-weight: 700; }
        .next-pair-preview .asker-color { color: #38bdf8; }
        .next-pair-preview .answerer-color { color: #34d399; }
        .next-pair-preview .next-arrow { opacity: 0.7; }
        /* --- END Next Pair Preview --- */

        /* --- START Question Progress Bar --- */
        .question-progress-section {
            background: #1e293b;
            border: 1px solid #475569;
            border-radius: 12px;
            padding: 0.75rem 1rem;
            margin-bottom: 1.25rem;
        }
        .question-progress-section .progress-text {
            color: #cbd5e1;
            text-align: center;
            margin-bottom: 0.55rem;
            font-size: 0.9rem;
        }
        .question-progress-section .progress-text span {
            color: #fff;
            font-weight: 700;
        }
        .progress-bar-track {
            height: 8px;
            background: #475569;
            border-radius: 4px;
            overflow: hidden;
        }
        .progress-bar-fill {
            height: 100%;
            width: 0%;
            background: linear-gradient(to right, #38bdf8, #34d399);
            transition: width 0.4s ease;
            border-radius: 4px;
        }
        /* --- END Question Progress Bar --- */

        /* Custom styles for the Modal and other elements remain the same */
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .two-cat-modal-content {
            display: flex;
            flex-direction: column;
            max-height: 90vh;
        }
        #modalCategoriesGrid {
            overflow-y: auto;
            flex-grow: 1; /* Allows grid to take up available space */
        }


        /* Number Input Styles */
        .number-input-container {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            gap: 0.75rem;
        }
        .number-input-display {
            background-color: #1f2937;
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 0.75rem;
            font-size: 1.25rem;
            width: 60px;
            text-align: center;
            font-weight: bold;
        }
        .imposter-count-text { color: #d1d5db; }
        .custom-alert {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: #1f2937; 
            border: 2px solid #ef4444; 
            border-radius: 1.5rem; 
            padding: 1.5rem;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
            z-index: 10000;
            max-width: 90%;
            width: 350px;
            text-align: center;
        }
        .custom-alert-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            z-index: 9999;
        }
       
        /* --- START Start Game Animated Button Styles (.btn) --- */
        .btn {
            /* NEW: Orange/Teal/Cyan Border Color */
            --border-color: linear-gradient(-45deg, #f6ad55, #16a085, #4ade80);
            --border-width: 0.125em;
            --curve-size: 0.5em;
            --bg: #1f2937; 
            --color: #ffffff;
            color: var(--color);
            cursor: pointer;
            position: relative;
            isolation: isolate;
            display: inline-grid;
            place-content: center;
            padding: 1em 2em; 
            width: 100%;
            font-size: 1.125rem; 
            font-weight: 700;
            border: 0;
            text-transform: uppercase;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.5); 
            clip-path: polygon(
                0% var(--curve-size),
                var(--curve-size) 0,
                100% 0,
                100% calc(100% - var(--curve-size)),
                calc(100% - var(--curve-size)) 100%,
                0 100%
            );
            transition: color 250ms, box-shadow 250ms;
        }

        .btn::after, .btn::before { content: ""; position: absolute; inset: 0; }
        .btn::before {
            background: var(--border-color);
            background-size: 300% 300%;
            animation: move-bg7234 5s ease infinite;
            z-index: -2;
        }

        @keyframes move-bg7234 {
            0% { background-position: 31% 0%; }
            50% { background-position: 70% 100%; }
            100% { background-position: 31% 0%; }
        }

        .btn::after {
            background: var(--bg);
            z-index: -1;
            clip-path: polygon(
                var(--border-width) calc(var(--curve-size) + var(--border-width) * 0.5),
                calc(var(--curve-size) + var(--border-width) * 0.5) var(--border-width),
                calc(100% - var(--border-width)) var(--border-width),
                calc(100% - var(--border-width)) calc(100% - calc(var(--curve-size) + var(--border-width) * 0.5)),
                calc(100% - calc(var(--curve-size) + var(--border-width) * 0.5)) calc(100% - var(--border-width)),
                var(--border-width) calc(100% - var(--border-width))
            );
            transition: clip-path 500ms;
        }

        .btn:where(:hover, :focus)::after {
            clip-path: polygon(
                calc(100% - var(--border-width)) calc(100% - calc(var(--curve-size) + var(--border-width) * 0.5)),
                calc(100% - var(--border-width)) var(--border-width),
                calc(100% - var(--border-width)) var(--border-width),
                calc(100% - var(--border-width)) calc(100% - calc(var(--curve-size) + var(--border-width) * 0.5)),
                calc(100% - calc(var(--curve-size) + var(--border-width) * 0.5)) calc(100% - var(--border-width)),
                calc(100% - calc(var(--curve-size) + var(--border-width) * 0.5)) calc(100% - var(--border-width))
            );
            transition: 200ms;
        }

        .btn:where(:hover, :focus) {
            color: #fff;
            box-shadow: 0 0 25px rgba(246, 173, 85, 0.8); /* Focus on orange glow */
        }
        /* --- END Start Game Animated Button Styles (.btn) --- */

        /* --- START Bubble Buttons --- */
        .bubble-container {
            --bubbleTiming: cubic-bezier(0.5,0.15,0.25,1.75);
            font-size: 16px;
            display: flex;
            align-items: center;
        }
        .bubble {
            display: flex; /* Centering content */
            align-items: center;
            justify-content: center;
            -webkit-tap-highlight-color: transparent;
            box-shadow: 0 -0.06em 0.1em var(--highlight, hsl(0,0%,100%)) inset,
                        0 -0.15em 0.4em var(--shadow1, hsl(0,90%,45%)) inset,
                        0 0.05em 0.05em var(--shadow2, hsl(0,90%,45%)) inset,
                        0.05em 0 0.1em var(--highlight, hsl(0,0%,100%)) inset,
                        -0.05em 0 0.1em var(--highlight, hsl(0,0%,100%)) inset,
                        0 0.1em 0.4em var(--shadow3, hsl(0,90%,60%)) inset;
            cursor: pointer;
            position: relative;
            width: 3em;
            height: 3em;
            transform-style: preserve-3d;
            transition-property: box-shadow, transform, width, height;
            transition-duration: 0.2s;
            transition-timing-function: ease-in-out, ease-in-out, var(--bubbleTiming), var(--bubbleTiming);
            will-change: transform;
            -webkit-appearance: none;
            appearance: none;
            border: none;
            z-index: 0;
            border-radius: 50%;
        }
        .bubble:focus, .bubble:hover {
            transform: scale(1.1);
            outline: none;
        }
        /* White Dice */
        .white-bubble {
            --highlight: hsl(0,0%,100%);
            --shadow1: hsl(0,0%,70%);
            --shadow2: hsl(0,0%,70%);
            --shadow3: hsl(0,0%,80%);
            background-color: #f0f0f0;
        }
        .white-bubble.active {
            --highlight: hsl(180,90%,100%);
            --shadow1: hsl(180,90%,45%);
            --shadow2: hsl(180,90%,45%);
            --shadow3: hsl(180,90%,60%);
        }
        /* Red Dice */
        .red-bubble {
            --highlight: hsl(0,90%,100%);
            --shadow1: hsl(0,90%,45%);
            --shadow2: hsl(0,90%,45%);
            --shadow3: hsl(0,90%,60%);
        }
        .red-bubble.active {
            --highlight: hsl(10,90%,100%);
            --shadow1: hsl(10,90%,45%);
            --shadow2: hsl(10,90%,45%);
            --shadow3: hsl(10,90%,60%);
        }
        /* --- END Bubble Buttons --- */

        /* --- START 3D Buttons for +/- --- */
        .button-3d {
            -webkit-appearance: none;
            appearance: none;
            position: relative;
            border-width: 0;
            padding: 0;
            min-width: 3em;  /* MODIFIED: Smaller size */
            min-height: 3em; /* MODIFIED: Smaller size */
            box-sizing: border-box;
            background: transparent;
            font: inherit;
            cursor: pointer;
            border-radius: 12px;
        }
        .button-top {
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            z-index: 2;
            width: 100%;
            height: 100%;
            transform: translateY(0);
            color: #fff;
            font-size: 1.5rem; /* MODIFIED: Bigger icon */
            text-shadow: 0 -1px rgba(0, 0, 0, 0.25);
            border-radius: 12px;
            transition: transform 0.2s;
        }
        .button-3d:active .button-top {
            transform: translateY(2px);
        }
        .button-bottom {
            position: absolute;
            z-index: 1;
            bottom: 4px;
            left: 4px;
            border-radius: 12px;
            width: calc(100% - 8px);
            height: calc(100% - 10px);
            background: #ccc;
            box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.5);
        }
        .button-base {
            position: absolute;
            z-index: 0;
            top: 4px;
            left: 0;
            border-radius: 12px;
            width: 100%;
            height: calc(100% - 4px);
            background-color: rgba(0, 0, 0, 0.15);
            box-shadow: 0 1px 1px 0 rgba(255, 255, 255, 0.75),
                inset 0 2px 2px rgba(0, 0, 0, 0.25);
        }
        .button-3d-plus .button-top { background-image: linear-gradient(145deg, #2575fc, #6a11cb); }
        .button-3d-plus .button-bottom { background-image: linear-gradient(145deg, #6a11cb, #2575fc); }
        .button-3d-minus .button-top { background-image: linear-gradient(145deg, #ff416c, #ff4b2b); }
        .button-3d-minus .button-bottom { background-image: linear-gradient(145deg, #ff4b2b, #ff416c); }
        .button-3d.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .button-3d.disabled:active .button-top {
            transform: translateY(0); /* Prevent press effect when disabled */
        }
        /* --- END 3D Buttons --- */

       
        /* NEW: Unified Selected Category Display Styles */
        .selected-category-display-box {
            position: relative;
            background-color: #1f2937; /* Default dark background */
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        }
       
        .selected-category-image-bg {
            /* This is the background image that covers the entire box */
            width: 100%;
            min-height: 200px; /* Ensure sufficient height */
            background-size: cover; 
            background-position: center; 
            background-repeat: no-repeat;
            position: relative;
        }

        .selected-category-content-overlay {
            /* Dark overlay for text clarity */
            background: rgba(0, 0, 0, 0.5);
            padding: 16px; 
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            text-align: center;
        }

        .selected-category-title {
            color: white;
            font-weight: bold;
            font-size: 1.25rem; /* text-xl */
            margin-bottom: 4px;
        }

        .selected-category-subtitle {
            color: #d1d5db; /* text-gray-300 */
            font-size: 0.875rem; /* text-sm */
            margin-bottom: 8px;
        }

        /* --- START Animated Button (Change Category / Start Question) --- */
        .animated-button {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 12px 24px; /* Reduced padding for compact look */
            border: 3px solid; /* Reduced border for compact look */
            border-color: transparent;
            font-size: 1rem;
            background-color: inherit;
            border-radius: 50px;
            font-weight: 600;
            color: #019b98; /* Teal color for consistency */
            box-shadow: 0 0 0 2px #019b98;
            cursor: pointer;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
            width: 100%; /* Ensure full width when needed */
        }
       
        .animated-button .animated-icon {
            position: absolute;
            width: 20px; /* Slightly smaller icon */
            fill: #019b98;
            z-index: 9;
            transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        }
       
        .animated-button .arr-1 { right: 12px; }
        .animated-button .arr-2 { left: -20%; }
       
        .animated-button .circle {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 10px;
            height: 10px;
            background-color: #019b98;
            border-radius: 50%;
            opacity: 0;
            transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        }
       
        .animated-button .text {
            position: relative;
            z-index: 1;
            transform: translateX(-8px); /* Reduced translation */
            transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        }

        .animated-button:hover {
            /* FIXED: Ensure full background coverage on hover by increasing circle shadow transparency */
            box-shadow: 0 0 0 250px transparent; /* Increased to cover button area */
            color: #1f2937; /* Dark text on hover */
            border-radius: 8px;
        }

        .animated-button:hover .arr-1 { right: -20%; }
        .animated-button:hover .arr-2 { left: 12px; }
        .animated-button:hover .text { transform: translateX(8px); }
        .animated-button:hover .animated-icon { fill: #1f2937; }

        .animated-button:active {
            scale: 0.95;
            box-shadow: 0 0 0 3px #019b98;
        }

        .animated-button:hover .circle {
            width: 250px; /* Increased size to cover potential width */
            height: 250px;
            opacity: 1;
        }
        /* --- END Animated Button (Change Category / Start Question) --- */

        /* --- START Skip Vote Button (Icon Slide) --- */
        .skip-button {
            width: 100%;
            height: auto;
            min-height: 40px; 
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center; /* Align content to center initially */
            background: #cc4444; /* Dark Red */
            border: none;
            border-radius: 8px; 
            box-shadow: 1px 1px 3px rgba(0,0,0,0.3);
            transition: 200ms;
            overflow: hidden;
            position: relative;
            padding: 0;
        }
       
        .skip-button .skip-text {
            /* FIXED: Ensure text is centered initially */
            transform: translateX(0); 
            color: white;
            font-weight: bold;
            font-size: 0.9rem;
            z-index: 10;
            transition: 200ms;
            padding: 10px 0; /* Vertical padding */
            flex-grow: 1; /* Allow text to grow and center */
            text-align: center;
        }

        .skip-button .skip-icon-box {
            position: absolute;
            /* FIXED: Adjusted border and position for visual separation and RTL */
            border-right: 1px solid #993333; 
            transform: translateX(0);
            height: 100%;
            width: 50px; 
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent; /* Keep background transparent initially */
            transition: 200ms;
            right: 0;
        }

        .skip-button svg {
            width: 18px;
            fill: #eee;
        }

        .skip-button:hover {
            background: #ff5555;
        }

        .skip-button:hover .skip-text {
            color: white; /* Keep text visible in the center area */
            transform: translateX(-50px); /* Shift text slightly left (relative) to make space */
        }

        .skip-button:hover .skip-icon-box {
            /* FIXED: Expand from the right (RTL) */
            width: 100%; 
            border-right: none;
            transform: translateX(0);
            background: #ff5555;
        }

        .custom-header-container {
            height: 100px;
            width: 100%;
            padding: 0; 
            box-shadow: none; 
            overflow: hidden;
            background-color: transparent; 
            border: none; 
            margin-bottom: 24px; /* Added margin for separation */
        }
       
        .custom-header-image {
            width: 100%;
            height: 100%;
            background-image: url('../../images/nVyz3pdx-image.webp');
            background-size: cover; 
            background-repeat: no-repeat;
            background-position: center;
        }

        /* --- REVEAL EFFECT --- */
        @keyframes reveal-pulse {
            0%, 100% {
                transform: scale(1.5);
                text-shadow: 0 0 20px #ff4b2b;
            }
            50% {
                transform: scale(1.6);
                text-shadow: 0 0 30px #ff416c, 0 0 40px #ff4b2b;
            }
        }
        .reveal-effect {
            animation: reveal-pulse 1s ease-in-out infinite;
            color: #ff416c; /* Bright red */
        }

        /* --- SPIDER-VERSE BUTTON --- */
        .button-wrapper {
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.2s ease;
            padding: 20px 0; /* Adjusted padding */
        }
        .spiderverse-button {
            position: relative;
            width: 100%; /* Full width */
            padding: 15px 30px;
            font-size: 20px; /* Adjusted font size */
            font-weight: 900;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            background: #1f2937; /* Dark background to match theme */
            color: #fff; /* White text for contrast */
            text-transform: uppercase;
            letter-spacing: 2px; /* Adjusted letter spacing */
            transform-style: preserve-3d;
            transition: all 0.15s ease;
            font-family: 'AAGalaxy', sans-serif;
            border: 2px solid #16a085; /* Teal border */
            text-shadow: /* Removed heavy black shadow */
                0 0 5px #16a085,
                0 0 10px #16a085;
        }

        .glitch-layers {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        .glitch-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #1f2937; /* Match the main button background */
            border-radius: 50px;
            opacity: 0;
            transition: all 0.15s ease;
        }

        .layer-1 {
            color: #0ff;
            transform-origin: center;
        }

        .layer-2 {
            color: #f0f;
            transform-origin: center;
        }

        .button-wrapper:hover .layer-1 {
            opacity: 1;
            animation: glitchLayer1 0.4s steps(2) infinite;
        }

        .button-wrapper:hover .layer-2 {
            opacity: 1;
            animation: glitchLayer2 0.4s steps(2) infinite;
        }

        .button-wrapper:hover .spiderverse-button {
            animation: buttonGlitch 0.3s steps(2) infinite;
            box-shadow:
                0 0 20px rgba(255, 255, 255, 0.5),
                0 0 30px rgba(0, 255, 255, 0.5),
                0 0 40px rgba(255, 0, 255, 0.5);
        }

        @keyframes buttonGlitch {
            0% { transform: translate(0); }
            25% { transform: translate(-5px, 3px) skew(-3deg); }
            50% { transform: translate(5px, -3px) skew(3deg); }
            75% { transform: translate(-8px, -2px) skew(-2deg); }
            100% { transform: translate(0); }
        }

        @keyframes glitchLayer1 {
            0% { transform: translate(-10px, -5px) skew(-5deg); clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%); }
            25% { transform: translate(10px, 5px) skew(5deg); clip-path: polygon(0 30%, 100% 30%, 100% 60%, 0 60%); }
            50% { transform: translate(-8px, 3px) skew(-3deg); clip-path: polygon(0 10%, 100% 10%, 100% 40%, 0 40%); }
            75% { transform: translate(8px, -3px) skew(3deg); clip-path: polygon(0 40%, 100% 40%, 100% 70%, 0 70%); }
            100% { transform: translate(-10px, -5px) skew(-5deg); clip-path: polygon(0 20%, 100% 20%, 100% 50%, 0 50%); }
        }

        @keyframes glitchLayer2 {
            0% { transform: translate(10px, 5px) skew(5deg); clip-path: polygon(0 50%, 100% 50%, 100% 80%, 0 80%); }
            25% { transform: translate(-10px, -5px) skew(-5deg); clip-path: polygon(0 60%, 100% 60%, 100% 90%, 0 90%); }
            50% { transform: translate(8px, -3px) skew(3deg); clip-path: polygon(0 40%, 100% 40%, 100% 70%, 0 70%); }
            75% { transform: translate(-8px, 3px) skew(-3deg); clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%); }
            100% { transform: translate(10px, 5px) skew(5deg); clip-path: polygon(0 50%, 100% 50%, 100% 80%, 0 80%); }
        }

        /* --- START Spinning Wheel Display Styles (NEW) --- */
        .spinning-wheel-container {
            background: linear-gradient(145deg, #4b5563, #1f2937); /* Dark gradient */
            border-radius: 24px; /* rounded-3xl */
            padding: 12px; /* p-3 */
            box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 0 15px rgba(0,0,0,0.5);
            border: 2px solid #6b7280;
        }
        .spinning-wheel-inner {
            background: #111827; /* bg-gray-900 */
            border-radius: 16px; /* rounded-2xl */
            padding: 1rem 0.5rem; /* p-4 sm:p-8 equivalent with more vertical space */
            box-shadow: inset 0 4px 10px rgba(0,0,0,0.7);
            border: 1px solid #374151;
            min-height: 150px; /* Taller */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        #currentName {
            font-size: 2.5rem; /* ~text-4xl */
            font-weight: bold;
            color: white;
            transition: all 0.15s ease-in-out;
            text-align: center;
            word-break: break-word; /* FIX: Prevents overflow */
            padding: 0 1rem; /* Horizontal padding for long names */
            line-height: 1.2;
        }
        @media (min-width: 640px) {
            #currentName {
                font-size: 4rem; /* ~text-6xl */
            }
            .spinning-wheel-inner {
                min-height: 180px;
            }
        }
        /* --- END Spinning Wheel Display Styles --- */

        /* --- START Add-Player Button (ko-btn) --- */
        .ko-btn {
            cursor: pointer;
            border: none;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: box-shadow 0.15s ease, transform 0.1s ease;
        }
        .ko-btn:hover {
            box-shadow: rgba(0,0,0,0.5) 14px 14px 12px, #c8c6c4 1.5px 1.5px 1px 0px inset, #545251 -3.2px -3.2px 8px 0px inset;
        }
        .ko-btn:active {
            box-shadow: rgba(0,0,0,0.2) 4px 4px 4px, #a8a6a4 0.5px 0.5px 0.5px 0px inset, #545251 -1px -1px 3px 0px inset;
            transform: translate(2px, 2px);
        }
        /* --- END Add-Player Button --- */

        /* --- START Reveal Spin Text --- */
        .reveal-text {
            transition: color 0.1s ease;
        }
        /* --- END Reveal Spin Text --- */

/* --- START Skip-Questions Toggle Button --- */
.skip-q-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.7rem 1.25rem;
    border: 2px solid #64748b;
    border-radius: 0.85rem;
    background-color: #475569;
    color: #e2e8f0;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
.skip-q-toggle-btn:hover {
    background-color: #64748b;
    border-color: #94a3b8;
}
.skip-q-toggle-btn:active { transform: translateY(1px); }
.skip-q-toggle-btn .state-badge {
    background-color: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}
.skip-q-toggle-btn.active {
    background-image: linear-gradient(to right, #f59e0b, #ea580c);
    border-color: #fbbf24;
    color: #fff;
    box-shadow: 0 6px 14px rgba(234, 88, 12, 0.35);
}
.skip-q-toggle-btn.active .state-badge {
    background-color: rgba(0, 0, 0, 0.35);
    color: #fff;
}
/* Full-width variant for the settings modal */
.skip-q-toggle-btn--full {
    width: 100%;
    padding: 0.85rem 1rem;
}
/* --- END Skip-Questions Toggle Button --- */

/* --- START Voting Card (Challenge Mode) Styles --- */
.challenge-card {
    background-color: #4a5568;
    border: 2px solid #718096;
    transition: all 0.2s ease-in-out;
    animation: challenge-card-fade-in 0.4s ease-out backwards;
}
.challenge-card.selected {
    background-color: #b91c1c;
    border-color: #ef4444;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}
@keyframes challenge-card-fade-in {
    0%   { opacity: 0; transform: translateY(10px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.challenge-card:nth-child(1) { animation-delay: 0.05s; }
.challenge-card:nth-child(2) { animation-delay: 0.10s; }
.challenge-card:nth-child(3) { animation-delay: 0.15s; }
.challenge-card:nth-child(4) { animation-delay: 0.20s; }
.challenge-card:nth-child(5) { animation-delay: 0.25s; }
.challenge-card:nth-child(6) { animation-delay: 0.30s; }
.challenge-card:nth-child(n+7) { animation-delay: 0.35s; }

.challenge-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(145deg, #94a3b8, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    line-height: 1;
}
.challenge-card.selected .challenge-avatar {
    background: linear-gradient(145deg, #fca5a5, #dc2626);
    border-color: rgba(255, 255, 255, 0.45);
}
/* --- END Voting Card Styles --- */

/* --- START Voter Card (current voter highlight) --- */
.voter-card {
    position: relative;
    background: linear-gradient(135deg, #0e7490 0%, #0f766e 100%);
    border: 2px solid #22d3ee;
    border-radius: 1.25rem;
    padding: 1.5rem 1rem 1.25rem;
    text-align: center;
    box-shadow: 0 12px 30px rgba(8, 145, 178, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.voter-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.15), transparent 60%);
    pointer-events: none;
}
.voter-progress-pill {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
}
.voter-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    font-weight: 800;
    color: #fff;
    margin: 0.25rem auto 0.65rem;
    box-shadow: 0 8px 22px rgba(245, 158, 11, 0.55), inset 0 -3px 0 rgba(0, 0, 0, 0.18);
    border: 4px solid rgba(255, 255, 255, 0.35);
    line-height: 1;
    position: relative;
    z-index: 1;
}
.voter-name-display {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.4rem;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}
.voter-name-display span#voterName {
    color: #fef3c7;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.voter-instruction {
    color: #cffafe;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}
@media (max-width: 640px) {
    .voter-avatar { width: 72px; height: 72px; font-size: 2.2rem; }
    .voter-name-display { font-size: 1.25rem; }
    .voter-instruction { font-size: 0.85rem; }
}
.voter-card.voter-enter {
    animation: voter-slide-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.voter-card.voter-exit {
    animation: voter-slide-out 0.3s cubic-bezier(0.55, 0, 0.68, 0.06) forwards;
}
@keyframes voter-slide-in {
    0%   { opacity: 0; transform: translateX(50px) scale(0.92); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes voter-slide-out {
    0%   { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(-50px) scale(0.95); }
}
.voter-card.voter-enter .voter-avatar {
    animation: voter-avatar-pulse 0.85s ease-out;
}
@keyframes voter-avatar-pulse {
    0%   { box-shadow: 0 8px 22px rgba(245, 158, 11, 0.55), 0 0 0 0 rgba(255, 255, 255, 0.65); }
    60%  { box-shadow: 0 8px 22px rgba(245, 158, 11, 0.55), 0 0 0 16px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 8px 22px rgba(245, 158, 11, 0.55), 0 0 0 0 rgba(255, 255, 255, 0); }
}
/* --- END Voter Card --- */

/* --- START Reveal Phase Enhancements --- */
/* Anticipation screen */
.reveal-anticipation-emoji {
    font-size: 4.5rem;
    margin-bottom: 0.75rem;
    animation: reveal-emoji-bounce 1.4s ease-in-out infinite;
    display: inline-block;
}
@keyframes reveal-emoji-bounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-10px) rotate(3deg); }
}
.reveal-anticipation-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.reveal-anticipation-sub {
    color: #cbd5e1;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Countdown 3..2..1 */
.reveal-countdown-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 1rem;
}
.countdown-number {
    font-size: 9rem;
    font-weight: 900;
    background: linear-gradient(145deg, #fbbf24, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 60px rgba(239, 68, 68, 0.6);
    animation: countdown-pop 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1;
}
@keyframes countdown-pop {
    0%   { transform: scale(0.3); opacity: 0; }
    40%  { transform: scale(1.15); opacity: 1; }
    70%  { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Imposter progress badge */
.imposter-progress-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #991b1b, #b91c1c);
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 6px 16px rgba(185, 28, 28, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.imposter-progress-badge .badge-icon { font-size: 1.15rem; }
.imposter-progress-badge .num-divider { opacity: 0.6; }

/* Wheel rotating gradient border + glow */
.reveal-wheel-glow {
    position: relative;
}
.reveal-wheel-glow::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 26px;
    background: conic-gradient(from 0deg, #ef4444, #fbbf24, #8b5cf6, #ef4444);
    z-index: -1;
    animation: wheel-border-spin 4s linear infinite;
    filter: blur(1px);
}
.reveal-wheel-glow::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 28px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.35), transparent 70%);
    z-index: -2;
    animation: wheel-glow-pulse 2s ease-in-out infinite;
}
@keyframes wheel-border-spin {
    to { transform: rotate(360deg); }
}
@keyframes wheel-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 0.9; transform: scale(1.05); }
}

/* Avatar inside the wheel (during spin) */
.reveal-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(145deg, #94a3b8, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
    line-height: 1;
    transition: background 0.2s ease;
}
.reveal-avatar.is-imposter {
    background: linear-gradient(145deg, #fca5a5, #dc2626);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.6);
}

/* Spinning status (dots animation) */
.spinning-status {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 600;
}
.spinning-dots {
    display: inline-flex;
    gap: 0.25rem;
}
.spinning-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    animation: dot-pulse 1.2s ease-in-out infinite;
}
.spinning-dots span:nth-child(2) { animation-delay: 0.15s; }
.spinning-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-pulse {
    0%, 100% { transform: scale(0.6); opacity: 0.4; }
    50%      { transform: scale(1.2); opacity: 1; }
}

/* Big reveal badge "🎭 الملقوف!" */
.imposter-reveal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding: 0.8rem 1.6rem;
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 1rem;
    border: 3px solid #fbbf24;
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    animation: reveal-badge-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.imposter-reveal-badge .badge-emoji {
    font-size: 1.6rem;
    animation: badge-emoji-shake 0.5s ease-in-out infinite alternate;
}
@keyframes reveal-badge-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes badge-emoji-shake {
    from { transform: rotate(-8deg); }
    to   { transform: rotate(8deg); }
}

/* Wheel shake on landing */
.wheel-shake {
    animation: wheel-shake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes wheel-shake {
    10%, 90% { transform: translateX(-3px); }
    20%, 80% { transform: translateX(5px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

/* Screen flash overlay */
.reveal-flash {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.85), rgba(239, 68, 68, 0.4));
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
}
.reveal-flash.flash-active {
    animation: reveal-flash 0.45s ease-out;
}
@keyframes reveal-flash {
    0%   { opacity: 0; }
    20%  { opacity: 1; }
    100% { opacity: 0; }
}

/* Confetti container */
.confetti-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 50;
}
.confetti-particle {
    position: absolute;
    width: 10px;
    height: 14px;
    top: 40%;
    left: 50%;
    opacity: 0;
    will-change: transform, opacity;
}
.confetti-particle.go {
    animation: confetti-burst 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes confetti-burst {
    0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(0.5); }
    100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(1); }
}
/* --- END Reveal Phase Enhancements --- */

/* --- START Results Page Redesign --- */
.results-wrap {
    animation: results-fade-in 0.5s ease-out;
}
@keyframes results-fade-in {
    0%   { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Round indicator pill */
.results-round-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

/* Winner banner */
.winner-banner {
    position: relative;
    text-align: center;
    padding: 1.4rem 1rem;
    border-radius: 1.25rem;
    margin-bottom: 1.25rem;
    border: 3px solid;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    overflow: hidden;
}
.winner-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 60%);
    pointer-events: none;
}
.winner-banner-emoji {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.4rem;
    animation: winner-emoji-bounce 1.6s ease-in-out infinite;
    display: inline-block;
}
@keyframes winner-emoji-bounce {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-6px) rotate(3deg); }
}
.winner-banner-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
}
.winner-banner--imposter {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
    border-color: #ef4444;
}
.winner-banner--player {
    background: linear-gradient(135deg, #0e7490, #155e75);
    border-color: #22d3ee;
}
.winner-banner--tie {
    background: linear-gradient(135deg, #6b21a8, #4c1d95);
    border-color: #a78bfa;
}
@media (max-width: 640px) {
    .winner-banner-emoji { font-size: 2.5rem; }
    .winner-banner-text { font-size: 1.2rem; }
}

/* Overall leader strip (between round-winner banner and secret word) */
.overall-leader-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fef3c7;
    padding: 0.6rem 1rem;
    border-radius: 0.85rem;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    flex-wrap: wrap;
    text-align: center;
}
.overall-leader-strip .leader-emoji { font-size: 1.15rem; }
.overall-leader-strip .leader-text { color: #fef3c7; }
@media (max-width: 480px) {
    .overall-leader-strip { font-size: 0.85rem; padding: 0.5rem 0.75rem; }
}

/* Secret word feature card */
.secret-word-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px dashed #f87171;
    border-radius: 1rem;
    padding: 1.1rem 1rem;
    text-align: center;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}
.secret-word-label {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.secret-word-value {
    font-size: 2rem;
    font-weight: 900;
    color: #fca5a5;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 12px rgba(248, 113, 113, 0.5);
}
@media (max-width: 640px) {
    .secret-word-value { font-size: 1.6rem; }
}

/* Ranking card */
.ranking-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #475569;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
.ranking-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 0.85rem;
}
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Individual rank row */
.rank-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 0.85rem;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.7rem;
    transition: background 0.2s ease;
}
.rank-row:hover {
    background: rgba(71, 85, 105, 0.55);
}
.rank-row--top {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.13), rgba(245, 158, 11, 0.05));
    border-color: rgba(251, 191, 36, 0.35);
}
.rank-medal {
    flex-shrink: 0;
    width: 36px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #cbd5e1;
}
.rank-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, #94a3b8, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.18);
    line-height: 1;
}
.rank-avatar--imposter {
    background: linear-gradient(145deg, #fca5a5, #dc2626);
}
.rank-name {
    flex-grow: 1;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-scores {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}
.round-badge {
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
    min-width: 42px;
    text-align: center;
}
.round-badge.rb-pos { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.4); }
.round-badge.rb-neg { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(252, 165, 165, 0.4); }
.round-badge.rb-zero { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; border: 1px solid rgba(203, 213, 225, 0.3); }
.total-score {
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
    min-width: 40px;
    text-align: left;
}
@media (max-width: 480px) {
    .rank-medal { width: 28px; font-size: 1.05rem; }
    .rank-avatar { width: 34px; height: 34px; font-size: 1rem; }
    .rank-name { font-size: 0.92rem; }
    .round-badge { font-size: 0.72rem; min-width: 36px; }
    .total-score { font-size: 0.95rem; }
}
/* --- END Results Page Redesign --- */

/* --- START Wesh Al Harja --- */
.wah-instructions-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.1));
    border: 2px solid rgba(167, 139, 250, 0.4);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.15);
}
.wah-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, #818cf8, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}
.wah-text {
    color: #e0e7ff;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.55;
}

.wah-choices-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .wah-choices-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.wah-choice {
    background: linear-gradient(160deg, #2a3a50, #1e293b);
    border: 2px solid #475569;
    border-radius: 0.85rem;
    padding: 1.1rem 0.8rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    text-align: center;
    line-height: 1.3;
}
.wah-choice:hover:not(:disabled) {
    background: linear-gradient(160deg, #38bdf8, #0284c7);
    border-color: #7dd3fc;
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 22px rgba(56, 189, 248, 0.4);
}
.wah-choice:active:not(:disabled) { transform: translateY(0) scale(1); }

.wah-choice--correct {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    border-color: #4ade80 !important;
    color: #fff !important;
    cursor: default !important;
    transform: scale(1.05);
    box-shadow: 0 0 22px rgba(74, 222, 128, 0.6);
    animation: wah-correct-pulse 1.4s ease-in-out infinite;
}
@keyframes wah-correct-pulse {
    0%, 100% { box-shadow: 0 0 22px rgba(74, 222, 128, 0.45); }
    50%      { box-shadow: 0 0 32px rgba(74, 222, 128, 0.85); }
}

.wah-choice--wrong {
    background: linear-gradient(135deg, #dc2626, #991b1b) !important;
    border-color: #f87171 !important;
    color: #fff !important;
    cursor: default !important;
    box-shadow: 0 0 18px rgba(248, 113, 113, 0.5);
}

.wah-choice--dim {
    background: rgba(15, 23, 42, 0.55) !important;
    border-color: rgba(71, 85, 105, 0.5) !important;
    color: #64748b !important;
    cursor: default !important;
    opacity: 0.55;
}

.wah-result {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 1.5rem;
    font-weight: 900;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.wah-result--success {
    color: #4ade80;
    text-shadow: 0 0 18px rgba(74, 222, 128, 0.5);
    animation: wah-result-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wah-result--fail {
    color: #fca5a5;
    text-shadow: 0 0 18px rgba(252, 165, 165, 0.5);
    animation: wah-result-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wah-result-emoji {
    font-size: 1.7rem;
    animation: wah-emoji-bounce 0.7s ease-in-out infinite alternate;
}
@keyframes wah-result-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes wah-emoji-bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-6px); }
}
/* --- END Wesh Al Harja --- */

/* --- START How To Play Modal Redesign --- */
.how-modal-content {
    background: linear-gradient(160deg, #1e293b, #0f172a);
    padding: 1.25rem 1rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 720px;
    margin: 0 1rem;
    border: 1px solid #475569;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
@media (min-width: 640px) {
    .how-modal-content { padding: 2rem 1.75rem; }
}
.how-close-btn {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #cbd5e1;
    font-size: 1.6rem;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}
.how-close-btn:hover { background: rgba(220, 38, 38, 0.5); color: #fff; }
.how-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin-bottom: 1.25rem;
    letter-spacing: 0.3px;
}

.how-body {
    overflow-y: auto;
    padding-right: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.how-section {
    background: rgba(51, 65, 85, 0.35);
    border: 1px solid #475569;
    border-right: 4px solid;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
}
.how-section--goal      { border-right-color: #22d3ee; }
.how-section--imposters { border-right-color: #f59e0b; }
.how-section--flow      { border-right-color: #a78bfa; }
.how-section--score     { border-right-color: #fbbf24; }

.how-section-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.6rem;
}
.how-section-icon {
    font-size: 1.4rem;
    line-height: 1;
}
.how-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}
.how-section-text {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Imposter mode cards */
.how-mode-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}
@media (min-width: 540px) {
    .how-mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.how-mode-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.7rem;
    padding: 0.7rem;
}
.how-mode-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}
.how-mode-badge--manual { background: rgba(99, 102, 241, 0.25); color: #c7d2fe; border: 1px solid rgba(165, 180, 252, 0.4); }
.how-mode-badge--white  { background: rgba(226, 232, 240, 0.18); color: #f1f5f9; border: 1px solid rgba(226, 232, 240, 0.4); }
.how-mode-badge--red    { background: rgba(220, 38, 38, 0.22); color: #fca5a5; border: 1px solid rgba(252, 165, 165, 0.4); }
.how-mode-text {
    color: #cbd5e1;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* Flow steps */
.how-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.how-steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.6rem;
    padding: 0.55rem 0.75rem;
}
.how-step-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(145deg, #a78bfa, #7c3aed);
    color: #fff;
    font-weight: 900;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(124, 58, 237, 0.4);
}
.how-step-text {
    color: #e2e8f0;
    font-size: 0.92rem;
    line-height: 1.55;
    flex-grow: 1;
}
.how-step-text strong { color: #fff; }

/* Scoring blocks */
.how-score-block {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.7rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.55rem;
}
.how-score-block:last-child { margin-bottom: 0; }
.how-score-label {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.45rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}
.how-score-label--player   { color: #67e8f9; }
.how-score-label--imposter { color: #fca5a5; }
.how-score-label--bonus    { color: #fde68a; }
.how-score-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.how-score-list li {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.score-pill {
    flex-shrink: 0;
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-weight: 900;
    font-size: 0.8rem;
    min-width: 48px;
    text-align: center;
}
.score-pos { background: rgba(34, 197, 94, 0.22); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.45); }
.score-neg { background: rgba(239, 68, 68, 0.22); color: #fca5a5; border: 1px solid rgba(252, 165, 165, 0.45); }
/* --- END How To Play Modal Redesign --- */

/* --- START Role Distribution Redesign --- */
/* Progress bar */
.role-progress {
    margin-bottom: 1.25rem;
}
.role-progress-text {
    text-align: center;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.role-progress-track {
    width: 100%;
    height: 8px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.role-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #14b8a6);
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
}

/* Cards grid */
.role-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
@media (min-width: 1024px) {
    .role-cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Card base — NEUTRAL background regardless of role (color leak protection) */
.role-card {
    background: linear-gradient(160deg, #334155, #1e293b);
    border: 1px solid #475569;
    border-radius: 1rem;
    padding: 1rem 0.75rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
    grid-column: span 1;
}
.role-card:hover:not(.role-card--open):not(.role-card--locked) {
    transform: translateY(-3px);
    border-color: #64748b;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}
.role-card:active:not(.role-card--open):not(.role-card--locked) {
    transform: translateY(0);
}
.role-card-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

/* Avatar (neutral / done / imposter / player) */
.role-avatar {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(145deg, #94a3b8, #64748b);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    line-height: 1;
}
.role-avatar--done {
    background: linear-gradient(145deg, #475569, #334155);
    color: #94a3b8;
}
.role-avatar-check {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #1e293b;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.5);
}
.role-avatar--imposter {
    background: linear-gradient(145deg, #fca5a5, #dc2626);
    border-color: #fca5a5;
    box-shadow: 0 0 22px rgba(220, 38, 38, 0.55);
    font-size: 1.7rem;
}
.role-avatar--player {
    background: linear-gradient(145deg, #67e8f9, #0e7490);
    border-color: #67e8f9;
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.45);
    font-size: 1.7rem;
}

/* Name */
.role-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: #fff;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
}
.role-name--imposter {
    color: #fca5a5;
    text-shadow: 0 0 12px rgba(252, 165, 165, 0.4);
}
.role-name--player {
    color: #7dd3fc;
    text-shadow: 0 0 12px rgba(125, 211, 252, 0.4);
}

/* Hint text */
.role-hint {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 0.15rem;
}

/* Open card — full-width to give room for word + tip + close button */
.role-card--open {
    grid-column: 1 / -1;
    cursor: default;
    padding: 1.4rem 1rem;
    border-color: rgba(255, 255, 255, 0.12);
    animation: role-card-open-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes role-card-open-pop {
    0%   { transform: scale(0.92); opacity: 0; }
    60%  { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.role-card-inner--open {
    gap: 0.7rem;
}

/* Imposter open: dramatic avatar shake + glow (avatar only, not whole card) */
.role-card--imposter .role-avatar--imposter {
    animation: role-imposter-reveal 0.7s cubic-bezier(0.36, 0.07, 0.19, 0.97), role-imposter-pulse 1.6s ease-in-out 0.7s infinite;
}
@keyframes role-imposter-reveal {
    0%   { transform: scale(0.5) rotate(-12deg); }
    25%  { transform: scale(1.25) rotate(8deg); }
    50%  { transform: scale(0.95) rotate(-6deg); }
    75%  { transform: scale(1.1) rotate(4deg); }
    100% { transform: scale(1) rotate(0); }
}
@keyframes role-imposter-pulse {
    0%, 100% { box-shadow: 0 0 22px rgba(220, 38, 38, 0.55); }
    50%      { box-shadow: 0 0 36px rgba(220, 38, 38, 0.9); }
}

/* Player open: calm fade + gentle pulse (calmer than imposter) */
.role-card--player .role-avatar--player {
    animation: role-player-reveal 0.6s ease-out, role-player-pulse 2.4s ease-in-out 0.6s infinite;
}
@keyframes role-player-reveal {
    0%   { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes role-player-pulse {
    0%, 100% { box-shadow: 0 0 22px rgba(34, 211, 238, 0.4); }
    50%      { box-shadow: 0 0 30px rgba(34, 211, 238, 0.7); }
}

/* Role badge (small pill — colored, but small enough to not leak) */
.role-badge {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.85rem;
    border: 1px solid;
    margin-top: 0.1rem;
}
.role-badge--imposter {
    background: rgba(220, 38, 38, 0.18);
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.5);
}
.role-badge--player {
    background: rgba(34, 211, 238, 0.15);
    color: #67e8f9;
    border-color: rgba(103, 232, 249, 0.5);
}

/* Secret word inside the card (player only) */
.role-secret-word-card {
    width: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px dashed #67e8f9;
    border-radius: 0.85rem;
    padding: 0.7rem 0.9rem;
    text-align: center;
    margin-top: 0.3rem;
}
.role-secret-word-label {
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.role-secret-word-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #67e8f9;
    letter-spacing: 0.4px;
    text-shadow: 0 2px 12px rgba(34, 211, 238, 0.45);
}

/* Tip line */
.role-tip {
    color: #cbd5e1;
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.4;
    max-width: 320px;
}

/* Close button */
.role-close-btn {
    margin-top: 0.5rem;
    padding: 0.65rem 1.4rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #475569, #334155);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.role-close-btn:hover {
    background: linear-gradient(135deg, #64748b, #475569);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}
.role-close-btn:active { transform: translateY(0); }

/* Locked state — clearly "done", not clickable, dimmed */
.role-card--locked {
    cursor: not-allowed;
    opacity: 0.65;
    background: linear-gradient(160deg, #1e293b, #0f172a);
    border-color: rgba(71, 85, 105, 0.5);
    box-shadow: none;
}
.role-card--locked:hover { transform: none; }
.role-card--locked .role-hint { color: #4ade80; font-weight: 700; }

/* Continue wrap reveal animation when all cards locked */
.role-continue-wrap {
    margin-top: 1.25rem;
}
.role-continue-wrap--reveal {
    animation: role-continue-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes role-continue-rise {
    0%   { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0); }
}
/* --- END Role Distribution Redesign --- */

/* --- START Player Row (Reorder Arrows) --- */
.player-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    border-radius: 0.65rem;
}
.player-row .player-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* Arrow stack on the side */
.player-row-arrows {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 36px;
}
.player-row-arrow {
    flex: 1 1 0;
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #334155, #1e293b);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.28);
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    padding: 0;
    line-height: 1;
}
.player-row-arrow--up   { border-radius: 0.65rem 0.65rem 0 0; }
.player-row-arrow--down { border-radius: 0 0 0.65rem 0.65rem; }
.player-row-arrow:hover:not(:disabled) {
    background: linear-gradient(160deg, #0e7490, #155e75);
    color: #fff;
    border-color: #67e8f9;
}
.player-row-arrow:active:not(:disabled) {
    transform: scale(0.92);
}
.player-row-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Delete (X) button — opposite side of the arrows */
.player-row-delete {
    flex: 0 0 auto;
    width: 38px;
    border-radius: 0.65rem;
    background: linear-gradient(160deg, rgba(220, 38, 38, 0.18), rgba(127, 29, 29, 0.25));
    border: 1px solid rgba(252, 165, 165, 0.4);
    color: #fca5a5;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.player-row-delete:hover:not(:disabled) {
    background: linear-gradient(160deg, #dc2626, #991b1b);
    color: #fff;
    border-color: #fca5a5;
}
.player-row-delete:active:not(:disabled) { transform: scale(0.92); }
.player-row-delete:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Brief highlight after a move so the user sees what changed */
.player-row--moved .player-input {
    animation: player-row-flash 0.6s ease-out;
}
@keyframes player-row-flash {
    0%   { box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.6); }
    100% { box-shadow: 0 0 0 2px rgba(103, 232, 249, 0); }
}
/* --- END Player Row (Reorder Arrows) --- */

@font-face { font-family: 'AAGalaxy'; src: url('../../fonts/AA-GALAXY.otf') format('opentype'); font-weight: normal; font-style: normal; font-display: swap; }