/* ============================================
   أفلام بدون كلام — OASIS × Ancient Egypt
   Ready Player One meets the Pharaohs
   Mobile-first · Material Design · Cairo Font
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Core palette */
    --bg:          #06060F;
    --bg2:         #0D0D1E;
    --bg3:         #12122A;
    --card:        rgba(13,13,30,0.97);
    --card-hover:  rgba(20,20,50,0.98);
    --glass:       rgba(255,255,255,0.03);

    /* Gold — Egyptian */
    --gold:        #FFD700;
    --gold-dim:    #D4A520;
    --gold-glow:   rgba(255,215,0,0.12);
    --gold-glow2:  rgba(255,215,0,0.25);
    --sand:        #D4A574;

    /* Neon — OASIS/RPO */
    --neon:        #00FF88;
    --neon-dim:    #00CC66;
    --neon-glow:   rgba(0,255,136,0.15);
    --neon-pink:   #FF2D78;
    --neon-blue:   #00D4FF;

    /* Status */
    --red:         #FF2D55;
    --red-dim:     #CC1540;
    --green:       #00E676;
    --green-dim:   #00B85A;
    --blue:        #2979FF;
    --orange:      #FF9100;

    /* Text */
    --text:        #E8E8FF;
    --text2:       #9898BB;
    --text3:       #4A4A6A;

    /* Borders */
    --border:      rgba(255,215,0,0.12);
    --border2:     rgba(255,215,0,0.28);
    --border-neon: rgba(0,255,136,0.2);

    /* Effects */
    --radius:      16px;
    --radius-sm:   10px;
    --radius-xs:   6px;
    --shadow:      0 8px 32px rgba(0,0,0,0.6);
    --shadow-gold: 0 0 30px rgba(255,215,0,0.12), 0 0 60px rgba(255,215,0,0.06);
    --shadow-neon: 0 0 20px rgba(0,255,136,0.2), 0 0 40px rgba(0,255,136,0.08);
    --transition:  all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }
body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== ANIMATED BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255,215,0,0.04) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0,255,136,0.03) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 20% 60%, rgba(255,45,120,0.02) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Egyptian geometric border pattern at top */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        var(--gold) 0%, var(--neon-pink) 25%,
        var(--neon) 50%, var(--neon-blue) 75%, var(--gold) 100%);
    z-index: 1000;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 540px;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

/* ===== LANDING ===== */
.landing-page { background: var(--bg); }
.landing-container { padding-top: 3rem; padding-bottom: 3rem; }

.landing-hero { text-align: center; margin-bottom: 2.5rem; }

.hero-icon-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.hero-icon {
    font-size: 5rem;
    line-height: 1;
    display: block;
    animation: heroFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255,215,0,0.4));
}

.hero-icon-ring {
    position: absolute;
    inset: -15px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    animation: ringPulse 3s ease-in-out infinite;
}
.hero-icon-ring2 {
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    animation: ringPulse 3s ease-in-out infinite 0.5s;
}

@keyframes heroFloat {
    0%,100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes ringPulse {
    0%,100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.05); }
}

.game-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.05;
    background: linear-gradient(135deg, var(--gold) 0%, var(--sand) 40%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 0.5rem;
}

.title-sub {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--neon);
    margin-bottom: 0.75rem;
}

.tagline {
    font-size: 1rem;
    color: var(--text2);
    font-weight: 600;
}

.tagline-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,215,0,0.08);
    border: 1px solid var(--border2);
    border-radius: 20px;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 700;
    margin-top: 0.75rem;
}

.landing-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 2rem; }

/* ===== HOW TO PLAY BRIEF ===== */
.how-brief {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.how-brief::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
}

.how-brief h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.steps { display: flex; flex-direction: column; gap: 0.65rem; }
.step {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    font-size: 0.88rem;
    color: var(--text2);
    line-height: 1.4;
}

.step-num {
    min-width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #000;
    font-weight: 900;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255,215,0,0.3);
}

/* ===== MATERIAL CARDS ===== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card-glow {
    border-color: var(--border2);
    box-shadow: var(--shadow), var(--shadow-gold);
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.2), transparent);
}

.card-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* Ripple */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: inherit;
}
.btn:active::after { opacity: 1; }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn:disabled::after { display: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dim));
    color: #000;
    box-shadow: 0 4px 20px rgba(255,215,0,0.3);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(255,215,0,0.4); }

.btn-neon {
    background: linear-gradient(135deg, var(--neon), var(--neon-dim));
    color: #000;
    box-shadow: 0 4px 20px rgba(0,255,136,0.3);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border-color: var(--border2);
}
.btn-outline:hover { background: var(--gold-glow); border-color: var(--gold); }

.btn-ghost {
    background: transparent;
    color: var(--text2);
    border-color: rgba(255,255,255,0.1);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); }

.btn-success {
    background: linear-gradient(135deg, var(--green), var(--green-dim));
    color: #000;
    box-shadow: 0 4px 16px rgba(0,230,118,0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), var(--red-dim));
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,45,85,0.25);
}

.btn-leave {
    background: rgba(255,45,85,0.1);
    border-color: rgba(255,45,85,0.3);
    color: var(--red);
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}
.btn-leave:hover { background: rgba(255,45,85,0.2); }

.btn-xl { padding: 1rem 2rem; font-size: 1.15rem; border-radius: 14px; }
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.05rem; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.82rem; border-radius: var(--radius-xs); }
.btn-block { width: 100%; display: flex; }

/* FAB button */
.fab-btn {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--red-dim));
    color: #fff;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255,45,85,0.4);
    z-index: 100;
    transition: var(--transition);
}
.fab-btn:active { transform: scale(0.9); }

/* Pulse animation */
.pulse-btn {
    animation: pulseBtn 1.4s ease-in-out infinite;
}
@keyframes pulseBtn {
    0%,100% { box-shadow: 0 4px 20px rgba(0,230,118,0.3); }
    50% { box-shadow: 0 4px 40px rgba(0,230,118,0.6), 0 0 0 12px rgba(0,230,118,0.08); }
}

.pulse-gold {
    animation: pulseGold 1.4s ease-in-out infinite;
}
@keyframes pulseGold {
    0%,100% { box-shadow: 0 4px 20px rgba(255,215,0,0.3); }
    50% { box-shadow: 0 4px 40px rgba(255,215,0,0.5), 0 0 0 12px rgba(255,215,0,0.08); }
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text2);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03rem;
}

.form-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    padding: 0.85rem 1rem;
    outline: none;
    transition: var(--transition);
}
.form-input:focus {
    border-color: var(--gold);
    background: rgba(255,215,0,0.03);
    box-shadow: 0 0 0 3px rgba(255,215,0,0.08);
}
.form-input::placeholder { color: var(--text3); }

.form-row { display: flex; gap: 0.75rem; }
.form-row .form-group.half { flex: 1; }

.form-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text3);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.75rem 0;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
}
.form-divider::before, .form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.input-code {
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: 0.4rem;
    color: var(--gold);
}

/* ===== AVATAR PICKER ===== */
.avatar-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text2);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

/* Selected actor preview banner */
.avatar-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255,215,0,0.06);
    border: 1.5px solid rgba(255,215,0,0.2);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.9rem;
    min-height: 72px;
    transition: border-color 0.3s, background 0.3s;
}
.avatar-preview-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--gold);
    flex-shrink: 0;
    box-shadow: 0 0 14px rgba(255,215,0,0.25);
    background: #111;
    transition: transform 0.25s;
}
.avatar-preview-img:hover { transform: scale(1.06); }
.avatar-preview-emoji {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2.5px solid var(--gold);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(255,215,0,0.08);
    box-shadow: 0 0 14px rgba(255,215,0,0.2);
}
.avatar-preview-info { flex: 1; min-width: 0; }
.avatar-preview-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.avatar-preview-hint {
    font-size: 0.72rem;
    color: var(--text3);
    font-weight: 600;
    margin-top: 0.15rem;
}
.avatar-preview-check {
    color: var(--gold);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Scrollable avatar grid strip */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
    margin-bottom: 0.5rem;
}

.avatar-option {
    background: rgba(255,255,255,0.03);
    border: 2px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.18rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
    padding: 0.55rem 0.25rem 0.45rem;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.avatar-option:active { transform: scale(0.9); }
.avatar-option.selected {
    border-color: var(--gold);
    background: rgba(255,215,0,0.09);
    box-shadow: 0 0 18px rgba(255,215,0,0.22);
}
.avatar-option.selected::after {
    content: '✓';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: var(--gold);
    color: #000;
    border-radius: 50%;
    font-size: 0.55rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 16px;
    text-align: center;
}

/* Image inside picker cell */
.avatar-opt-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.1);
    background: #111;
    display: block;
    transition: border-color 0.2s;
}
.avatar-option.selected .avatar-opt-img { border-color: var(--gold); }
.avatar-opt-emoji {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.avatar-option.selected .avatar-opt-emoji { border-color: var(--gold); }

.avatar-name {
    font-size: 0.56rem;
    color: var(--text3);
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.avatar-option.selected .avatar-name { color: var(--gold); }

/* ===== Avatar display circles (lobby / game) ===== */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 2px solid transparent;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    background: rgba(255,255,255,0.05);
}
.avatar-circle.size-sm { width: 32px; height: 32px; font-size: 1rem; }
.avatar-circle.size-lg { width: 56px; height: 56px; font-size: 2rem; }
.avatar-circle.size-xl { width: 72px; height: 72px; font-size: 2.5rem; }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-fallback-emoji { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: inherit; }

/* ===== CARD TITLE ROW (with library button) ===== */
.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.card-title-row .card-title { margin-bottom: 0; }

.btn-lib-open {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    background: rgba(255,215,0,0.08);
    border: 1.5px solid rgba(255,215,0,0.3);
    border-radius: 8px;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.btn-lib-open:hover { background: rgba(255,215,0,0.16); border-color: var(--gold); }
.btn-lib-open:active { transform: scale(0.94); }

/* ===== MOVIE LIBRARY MODAL ===== */
.lib-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.lib-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.lib-overlay.open .lib-modal {
    transform: translateY(0);
}

.lib-modal {
    width: 100%;
    max-width: 680px;
    height: 92dvh;          /* fill most of the screen on mobile */
    max-height: 92dvh;
    background: #0e0e1c;
    border: 1px solid rgba(255,215,0,0.15);
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.34,1.26,0.64,1);
    overflow: hidden;
}

/* drag handle */
.lib-modal::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 99px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

.lib-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.1rem 0.5rem;
    flex-shrink: 0;
}
.lib-title {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.lib-close-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.lib-close-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Controls */
.lib-controls {
    padding: 0 1rem 0.6rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.lib-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.lib-search-icon {
    position: absolute;
    right: 0.75rem;
    color: var(--text3);
    font-size: 0.85rem;
    pointer-events: none;
}
.lib-search-input {
    width: 100%;
    padding: 0.65rem 2.2rem 0.65rem 2.4rem;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;        /* 16px+ prevents iOS auto-zoom on focus */
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}
.lib-search-input:focus { border-color: var(--gold); }
.lib-search-clear {
    position: absolute;
    left: 0.6rem;
    background: none;
    border: none;
    color: var(--text3);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex; align-items: center;
    padding: 0.2rem;
}

/* Diff tabs */
.lib-diff-tabs {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}
.lib-diff-tabs::-webkit-scrollbar { display: none; }
.lib-tab {
    flex-shrink: 0;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text3);
    transition: all 0.15s;
}
.lib-tab:hover { border-color: var(--gold); color: var(--gold); }
.lib-tab.active          { background: var(--gold);   color: #000; border-color: var(--gold); }
.lib-tab.easy.active     { background: #00c853; color: #000; border-color: #00c853; }
.lib-tab.normal.active   { background: #2979ff; color: #fff; border-color: #2979ff; }
.lib-tab.hard.active     { background: #ff6d00; color: #fff; border-color: #ff6d00; }
.lib-tab.very_hard.active{ background: #d50000; color: #fff; border-color: #d50000; }

/* Stats */
.lib-stats {
    padding: 0 1rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.lib-stat-total { color: var(--text3); font-weight: 700; }
.lib-stat-badge {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.7rem;
}

/* ── Movie Library Grid ── */
/* Mobile: single column list, full-width cards */
.lib-grid {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.6rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,215,0,0.2) transparent;
}
.lib-grid::-webkit-scrollbar { width: 4px; }
.lib-grid::-webkit-scrollbar-thumb { background: rgba(255,215,0,0.2); border-radius: 4px; }

.lib-loading, .lib-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text3);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ── Movie Card — horizontal list item ── */
.lib-card {
    background: rgba(255,255,255,0.03);
    border: 1.5px solid var(--border);
    border-radius: 11px;
    padding: 0.65rem 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
}
.lib-card:active  { transform: scale(0.97); }
.lib-card.selected {
    border-color: var(--neon);
    background: rgba(0,255,136,0.07);
    box-shadow: 0 0 12px rgba(0,255,136,0.12);
}

/* Left colored dot — compact difficulty indicator */
.lib-card-diff {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.9;
}

/* Card content */
.lib-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.lib-card-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;        /* never clip Arabic titles */
    white-space: normal;
    flex: 1;
    min-width: 100px;
}
.lib-card.selected .lib-card-title { color: var(--neon); }

.lib-card-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.lib-diff-pill {
    font-size: 0.62rem;
    font-weight: 900;
    opacity: 0.85;
}
.lib-pop-bar {
    width: 36px;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
}
.lib-pop-fill {
    height: 100%;
    border-radius: 99px;
    opacity: 0.55;
}

/* Checkmark */
.lib-card-check {
    color: var(--neon);
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.lib-card.selected .lib-card-check { opacity: 1; }

/* Wider screens — 2-column grid */
@media (min-width: 500px) {
    .lib-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .lib-loading, .lib-empty { grid-column: 1 / -1; }
    .lib-card-body { flex-wrap: wrap; }
}

/* Desktop — 3-column grid */
@media (min-width: 700px) {
    .lib-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Infinite scroll sentinel (invisible trigger element) ── */
.lib-sentinel {
    height: 1px;
    width: 100%;
    /* spans both grid columns so it's always at the bottom */
    grid-column: 1 / -1;
    pointer-events: none;
    flex-shrink: 0;
}

/* ── Bottom spinner while loading next page ── */
.lib-scroll-loader {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem;
    color: var(--gold);
    font-size: 1.1rem;
}

/* ── End of results ── */
.lib-end-msg {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text3);
    font-weight: 700;
    border-top: 1px solid var(--border);
}

/* ── Pick action bar ── */
.lib-pick-bar {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    background: rgba(0,255,136,0.06);
    border-top: 1.5px solid rgba(0,255,136,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.22s ease;
}
.lib-pick-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--neon);
    min-width: 0;
    word-break: break-word;
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-error   { background: rgba(255,45,85,0.1);  color: #FF6B8A; border: 1px solid rgba(255,45,85,0.25); }
.alert-success { background: rgba(0,230,118,0.08); color: #69F0AE; border: 1px solid rgba(0,230,118,0.2); }
.alert-info    { background: rgba(41,121,255,0.1); color: #82B1FF; border: 1px solid rgba(41,121,255,0.2); }
.alert-warning { background: rgba(255,145,0,0.1);  color: #FFD740; border: 1px solid rgba(255,145,0,0.2); }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02rem;
}
.badge-gold    { background: rgba(255,215,0,0.15);  color: var(--gold); border: 1px solid rgba(255,215,0,0.25); }
.badge-neon    { background: rgba(0,255,136,0.1);   color: var(--neon); border: 1px solid rgba(0,255,136,0.2); }
.badge-success { background: rgba(0,230,118,0.1);   color: #69F0AE; }
.badge-error   { background: rgba(255,45,85,0.1);   color: #FF6B8A; }
.badge-warning { background: rgba(255,145,0,0.1);   color: #FFD740; }
.badge-info    { background: rgba(41,121,255,0.1);  color: #82B1FF; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 0 1.5rem;
}
.page-header h1 {
    font-size: 1.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--sand));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--text2);
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    flex-shrink: 0;
    transition: var(--transition);
}
.back-btn:hover { background: var(--gold-glow); border-color: var(--border2); color: var(--gold); }

/* ===== DIFFICULTY ===== */
.diff-badge {
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 800;
}
.diff-easy      { background: rgba(0,230,118,0.12); color: #69F0AE; }
.diff-normal    { background: rgba(41,121,255,0.12); color: #82B1FF; }
.diff-hard      { background: rgba(255,145,0,0.12);  color: #FFD740; }
.diff-very_hard { background: rgba(255,45,85,0.12);  color: #FF6B8A; }

/* ===== LOBBY ===== */
.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 0 0.5rem;
}

.room-code-block { cursor: pointer; }
.room-code-label { font-size: 0.72rem; color: var(--text3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08rem; }
.room-code-val {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--gold);
    letter-spacing: 0.25rem;
    line-height: 1;
    text-shadow: 0 0 20px rgba(255,215,0,0.3);
}

.header-actions { display: flex; gap: 0.5rem; align-items: center; }

.section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    margin: 0.5rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== TEAM PICKER ===== */
.teams-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.team-pick-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.team-pick-card:active { transform: scale(0.95); }
.team-pick-card:hover, .team-pick-card:active {
    border-color: var(--gold);
    background: var(--gold-glow);
}

.team-pick-emoji { font-size: 2.5rem; margin-bottom: 0.5rem; }
.team-pick-name { font-size: 1.05rem; font-weight: 900; color: var(--gold); }
.team-pick-count { font-size: 0.82rem; color: var(--text3); margin-top: 0.3rem; }

/* ===== MY TEAM CARD ===== */
.team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.team-name-big {
    font-size: 1.3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--sand));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.approval-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text2);
    font-weight: 700;
}

.members-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.member-chip {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.25rem 0.7rem 0.25rem 0.3rem;
    font-size: 0.82rem;
    font-weight: 700;
    transition: var(--transition);
}
.member-chip.captain { border-color: rgba(255,215,0,0.4); background: rgba(255,215,0,0.06); color: var(--gold); }

.online-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.online-dot.on  { background: var(--neon); box-shadow: 0 0 6px var(--neon); }
.online-dot.off { background: var(--text3); }

/* ===== SUGGEST ROW (search + random button) ===== */
.suggest-search-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0;
}
.suggest-search-row .search-wrap {
    margin-bottom: 0;
}

/* Random movie button */
.btn-random {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0 0.75rem;
    height: 46px;
    background: linear-gradient(135deg, #1a1a2e, #2a1a40);
    border: 1.5px solid rgba(255,215,0,0.35);
    border-radius: 10px;
    color: var(--gold);
    font-size: 1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-random:hover   { background: rgba(255,215,0,0.12); border-color: var(--gold); }
.btn-random:active  { transform: scale(0.93); }
.btn-random:disabled{ opacity: 0.5; pointer-events: none; }
.random-btn-label   { font-size: 0.58rem; font-weight: 800; color: var(--gold); opacity: 0.85; }

/* Difficulty filter chips */
.diff-filter-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin: 0.55rem 0 0.75rem;
}
.diff-chip {
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    border: 1.5px solid var(--border);
    color: var(--text3);
    background: transparent;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.diff-chip:hover { border-color: var(--gold); color: var(--gold); }
.diff-chip.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}
.diff-chip[data-diff="easy"].active    { background: #00c853; border-color: #00c853; }
.diff-chip[data-diff="normal"].active  { background: #2979ff; border-color: #2979ff; }
.diff-chip[data-diff="hard"].active    { background: #ff6d00; border-color: #ff6d00; }
.diff-chip[data-diff="very_hard"].active { background: #d50000; border-color: #d50000; }

/* ===== SEARCH DROPDOWN ===== */
.search-wrap { position: relative; margin-bottom: 0.75rem; }

.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #1A1A35;
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    z-index: 200;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: var(--shadow);
    display: none;
}

.search-item {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.15s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: rgba(255,215,0,0.05); }
.search-item.custom { color: var(--neon); font-weight: 700; }

.selected-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,215,0,0.06);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    font-size: 0.95rem;
}

.btn-icon-clear {
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    flex-shrink: 0;
}

/* ===== MOVIE LIST ===== */
.movie-item {
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    transition: var(--transition);
}
.movie-item.approved { border-color: rgba(0,230,118,0.25); background: rgba(0,230,118,0.03); }
.movie-item.rejected { opacity: 0.5; }

.movie-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.movie-title-text { font-weight: 700; font-size: 0.95rem; }
.movie-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text3);
}
.movie-actions { display: flex; gap: 0.4rem; margin-top: 0.5rem; }

/* ===== PLAYER LIST ===== */
.player-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.player-row:last-child { border-bottom: none; }
.player-row-name { flex: 1; font-weight: 700; }

.team-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--gold);
    padding: 0.6rem 0 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hint-text { font-size: 0.85rem; color: var(--text3); line-height: 1.4; }
.empty-msg { text-align: center; color: var(--text3); font-size: 0.88rem; padding: 1rem 0; }

/* ===== STATUS CHIP ===== */
.status-chip {
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
}
.chip-online  { background: rgba(0,255,136,0.1); color: var(--neon); }
.chip-total   { background: rgba(255,215,0,0.1);  color: var(--gold); }

/* ===== GAME PAGE ===== */
.game-body { background: #030310; }

/* Scoreboard */
.scoreboard {
    position: sticky;
    top: 3px;
    z-index: 50;
    background: rgba(6,6,15,0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: center;
    padding: 0.7rem 1rem;
    gap: 0.5rem;
}

.score-side { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; }
.score-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.04rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.score-name.mine { color: var(--gold); }

.score-num {
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--text);
    line-height: 1;
}
.score-num.winning { color: var(--neon); text-shadow: 0 0 20px var(--neon-glow); }

.pass-pill {
    font-size: 0.6rem;
    padding: 0.1rem 0.45rem;
    border-radius: 8px;
    font-weight: 800;
}
.pass-pill.available { background: rgba(0,255,136,0.1); color: var(--neon); }
.pass-pill.used { background: rgba(255,255,255,0.04); color: var(--text3); text-decoration: line-through; }

.score-vs {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--text3);
}

/* Turn banner */
.turn-banner {
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border);
    background: var(--card);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.turn-banner.my-turn {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(255,215,0,0.06), rgba(255,145,0,0.04));
    box-shadow: var(--shadow-gold);
    animation: myTurnPulse 3s ease-in-out infinite;
}

@keyframes myTurnPulse {
    0%,100% { box-shadow: 0 0 30px rgba(255,215,0,0.1); }
    50% { box-shadow: 0 0 50px rgba(255,215,0,0.2); }
}

.turn-team-label { font-size: 0.72rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08rem; font-weight: 700; }
.turn-team-name { font-size: 1.5rem; font-weight: 900; color: var(--gold); margin: 0.2rem 0; }
.turn-actor { font-size: 0.95rem; color: var(--text2); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 0.4rem; }

/* Timer */
.timer-wrap { display: flex; justify-content: center; margin-bottom: 1rem; }
.timer-ring { position: relative; width: 130px; height: 130px; }
.timer-svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.timer-track { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 9; }
.timer-arc {
    fill: none;
    stroke: var(--neon);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s linear, stroke 0.5s;
}
.timer-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}
.timer-num { font-size: 2.2rem; font-weight: 900; color: var(--neon); line-height: 1; transition: color 0.5s; }
.timer-unit { font-size: 0.65rem; color: var(--text3); font-weight: 700; text-transform: uppercase; }

/* Movie reveal */
.movie-reveal {
    background: linear-gradient(135deg, rgba(255,215,0,0.06), rgba(255,145,0,0.04));
    border: 2px solid var(--gold);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    animation: revealPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

.movie-reveal::before {
    content: '🎬';
    position: absolute;
    top: -10px; right: -10px;
    font-size: 5rem;
    opacity: 0.06;
    transform: rotate(-15deg);
}

@keyframes revealPop {
    from { opacity: 0; transform: scale(0.85) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.movie-reveal-label {
    font-size: 0.72rem;
    color: var(--gold-dim);
    font-weight: 800;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}
.movie-reveal-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    line-height: 1.2;
    text-shadow: 0 0 30px rgba(255,215,0,0.3);
}

/* Status message */
.status-bar {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.5rem;
    color: var(--text3);
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.status-bar.active     { color: var(--gold); }
.status-bar.validation { color: var(--orange); }
.status-bar.pass       { color: var(--neon-blue); }
.status-bar.time_up    { color: var(--red); }
.status-bar.completed  { color: var(--neon); }

/* Action area */
.action-hint {
    text-align: center;
    color: var(--text3);
    font-size: 0.88rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Validation card */
.validation-card {
    background: linear-gradient(135deg, rgba(255,145,0,0.06), rgba(255,215,0,0.04));
    border: 2px solid rgba(255,145,0,0.4);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.validation-label { font-size: 1.1rem; font-weight: 900; color: var(--gold); margin-bottom: 0.4rem; }
.validation-sub { font-size: 0.88rem; color: var(--text2); margin-bottom: 1.25rem; }
.validation-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Pass replacement */
.replacement-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; }
.replacement-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--transition);
}
.replacement-item:hover { border-color: var(--gold); background: var(--gold-glow); }

/* Waiting */
.waiting-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text3);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 2rem 1rem;
    text-align: center;
    flex-direction: column;
}
.waiting-dots { display: flex; gap: 0.3rem; }
.waiting-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text3);
    animation: dotPulse 1.4s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
    0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Round/target */
.round-target-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.78rem;
    color: var(--text3);
    font-weight: 700;
    padding: 0.5rem 0;
    text-align: center;
}

/* ===== RESULTS PAGE ===== */
.results-header { text-align: center; padding: 2rem 1rem 1.5rem; }
.trophy-big { font-size: 4rem; animation: trophyBounce 2s ease-in-out infinite; }
@keyframes trophyBounce {
    0%,100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}
.winner-name { font-size: 2.2rem; font-weight: 900; color: var(--gold); margin-top: 0.5rem; }
.winner-score-big { font-size: 1.2rem; color: var(--neon); font-weight: 700; margin-top: 0.25rem; }

.podium-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.podium-row:last-child { border-bottom: none; }
.podium-rank { font-size: 1.5rem; min-width: 2rem; }
.podium-name { flex: 1; font-weight: 800; }
.podium-score { font-size: 1.2rem; font-weight: 900; }

.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); text-align: center; gap: 0.5rem; }
.stat-val { font-size: 1.8rem; font-weight: 900; color: var(--gold); }
.stat-lbl { font-size: 0.75rem; color: var(--text3); font-weight: 700; margin-top: 0.1rem; }

.movies-played-list { max-height: 280px; overflow-y: auto; }
.played-item { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.played-item:last-child { border-bottom: none; }
.played-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; }
.played-meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text3); }
.result-dot { font-weight: 900; }
.result-dot.completed { color: var(--neon); }
.result-dot.time_up   { color: var(--text3); }

/* ===== EASTER EGG OVERLAYS ===== */
.pharaoh-curse-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 2rem;
    animation: fadeInOverlay 0.4s ease;
}
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}
.pharaoh-emoji { font-size: 6rem; animation: pharaohShake 0.5s ease-in-out infinite; }
@keyframes pharaohShake {
    0%,100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}
.pharaoh-msg { font-size: 1.5rem; font-weight: 900; color: var(--gold); text-shadow: 0 0 20px rgba(255,215,0,0.5); }

/* Glitch effect */
.glitch {
    animation: glitchEffect 0.3s steps(2) 3;
}
@keyframes glitchEffect {
    0% { transform: translate(0); filter: none; }
    25% { transform: translate(-3px, 1px); filter: hue-rotate(90deg); }
    50% { transform: translate(3px, -1px); filter: hue-rotate(180deg); }
    75% { transform: translate(-2px, 2px); filter: hue-rotate(270deg); }
    100% { transform: translate(0); filter: none; }
}

/* Gold particles */
@keyframes goldParticle {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-80px) scale(0); opacity: 0; }
}
.gold-particle {
    position: fixed;
    pointer-events: none;
    font-size: 1rem;
    z-index: 9998;
    animation: goldParticle 1.5s ease-out forwards;
}

/* ===== TOAST ===== */
#toastContainer {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9990;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    pointer-events: none;
    width: calc(100% - 2rem);
    max-width: 480px;
}

.toast {
    background: rgba(20,20,48,0.97);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: var(--shadow), 0 0 20px rgba(0,0,0,0.5);
    animation: toastSlide 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-right: 4px solid;
    backdrop-filter: blur(10px);
    text-align: center;
    font-family: 'Cairo', sans-serif;
}
.toast-success { border-color: var(--neon);  color: #69F0AE; }
.toast-error   { border-color: var(--red);   color: #FF6B8A; }
.toast-info    { border-color: var(--blue);  color: #82B1FF; }
.toast-gold    { border-color: var(--gold);  color: var(--gold); }

@keyframes toastSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== LOADING ===== */
.loading-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 4rem 1rem;
    color: var(--text3);
    text-align: center;
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,215,0,0.1);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
    .game-title { font-size: 3.5rem; }
    .timer-ring { width: 160px; height: 160px; }
    .movie-reveal-title { font-size: 2.4rem; }
    .avatar-grid { grid-template-columns: repeat(6, 1fr); }
    .avatar-opt-img, .avatar-opt-emoji { width: 48px; height: 48px; }
}

@media (max-width: 380px) {
    .game-title { font-size: 2.4rem; }
    .score-num { font-size: 2rem; }
    .movie-reveal-title { font-size: 1.6rem; }
    .btn-xl { font-size: 1rem; padding: 0.9rem 1.5rem; }
    .timer-ring { width: 110px; height: 110px; }
    .timer-num { font-size: 1.8rem; }
    .avatar-grid { grid-template-columns: repeat(3, 1fr); }
    .avatar-opt-img, .avatar-opt-emoji { width: 38px; height: 38px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }
