/* ============================================
   FILMIQ - CINEMATCH (GRID GUESS MAKEOVER) CSS
   ============================================ */

:root {
    --green: #10b981;
    --yellow: #fbbf24;
    --grey-dark: #1e293b;
    --grey-light: #475569;
    --accent-primary: #818cf8;
    --accent-secondary: #c084fc;
    --primary-bg: #030712;
    --glass-bg: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 600;
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    margin: 0;
    background: #030712;
}

/* Ambient Animated Cinematic Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #030712 60%, #020617 100%);
}

/* Header Suite Styling */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) clamp(var(--spacing-md), 4vw, var(--spacing-xl)) !important;
    background: rgba(3, 7, 18, 0.75) !important;
    backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

.header-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.social-icons {
    display: flex;
    gap: 0.5rem;
}

.social-link,
.stats-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(10px);
    color: var(--text-primary) !important;
    font-size: 1.1rem !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.05);
}

.social-link:hover,
.stats-btn:hover {
    transform: translateY(-2px) scale(1.08) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 15px rgba(129, 140, 248, 0.3), inset 0 1px 1px rgba(255,255,255,0.1) !important;
    color: var(--accent-primary) !important;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(15px, 4vw, 40px) !important;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

footer {
    text-align: center;
    padding: 1.5rem !important;
    background: rgba(3, 7, 18, 0.8) !important;
    backdrop-filter: blur(10px);
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
    margin-top: 40px;
}

.version {
    margin-left: 0.5rem;
    opacity: 0.5;
}

/* Streak Indicator Panel */
#streak-container {
    width: 100%;
    max-width: 600px;
    background: var(--glass-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px);
    padding: 8px 16px !important;
    border-radius: 12px !important;
    text-align: center;
    font-weight: 700;
    margin-bottom: 20px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(129, 140, 248, 0.03) !important;
    position: relative;
    overflow: hidden;
}

#streak-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.7;
}

#streak-container p {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

#streak-container span {
    color: var(--accent-primary) !important;
    text-shadow: 0 0 10px rgba(129, 140, 248, 0.5) !important;
    font-weight: 800;
}

/* Master Game Container */
#game-container {
    width: 100%;
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    backdrop-filter: blur(25px);
    border-radius: 24px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.05) !important;
    padding: 25px !important;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    position: relative;
}

/* ============================================
   CINEMATIC FILM STRIP TIMELINE
   ============================================ */
.film-strip-container {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 5px;
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guess-counter {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.give-up-btn {
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    transition: all 0.2s ease;
}

.give-up-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.film-strip {
    width: 100%;
    background: #020617;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8), 0 8px 24px rgba(0,0,0,0.5);
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

/* Sprocket Holes */
.sprockets {
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    opacity: 0.5;
    user-select: none;
    pointer-events: none;
}

.sprockets .sprocket {
    width: 8px;
    height: 10px;
    background: #0d1527;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.8);
}

/* Film Cells grid */
.film-cells {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    padding: 0 12px;
}

/* Movie Poster Film Cell Frame */
.film-cell {
    aspect-ratio: 2/3;
    background: #060b13;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
}

.film-cell::before {
    content: attr(data-number);
    font-size: 0.95rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.2);
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.film-cell:hover {
    transform: scale(1.08) translateY(-2px);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 18px rgba(0,0,0,0.8);
    z-index: 5;
}

.film-cell.active {
    border-color: var(--accent-primary) !important;
    box-sizing: border-box;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 0 14px rgba(129, 140, 248, 0.5), 0 8px 18px rgba(0,0,0,0.8) !important;
    z-index: 10;
}

.film-cell.active::before {
    color: var(--accent-primary) !important;
}

/* Custom Guess State Indicators on Film Strip */
.film-cell.status-correct {
    border-color: var(--green) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}
.film-cell.status-correct::before { display: none; }

.film-cell.status-close {
    border-color: var(--yellow) !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}
.film-cell.status-close::before { display: none; }

.film-cell.status-wrong {
    border-color: var(--grey-light) !important;
    box-shadow: none;
}
.film-cell.status-wrong::before { display: none; }

/* ============================================
   SEARCH INPUT & AUTOCOMPLETE
   ============================================ */
#input-container {
    position: relative;
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

#guess-input {
    flex: 1;
    padding: 12px 18px !important;
    font-size: 1.05rem !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    background: rgba(17, 24, 39, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    border-radius: 12px !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

#guess-input:focus {
    outline: none;
    border-color: var(--accent-primary) !important;
    background: rgba(17, 24, 39, 0.8) !important;
    box-shadow: 0 0 16px rgba(129, 140, 248, 0.35) !important;
}

#guess-input::placeholder {
    color: var(--text-tertiary);
    font-weight: 500;
}

.dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0; 
    background: rgba(10, 11, 24, 0.95) !important;
    backdrop-filter: blur(25px) !important;
    border: 1px solid rgba(129, 140, 248, 0.3) !important;
    border-radius: 12px !important;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8), 0 0 20px rgba(129, 140, 248, 0.15) !important;
    padding: 4px;
}

.dropdown.show {
    display: block !important;
}

.dropdown::-webkit-scrollbar {
    width: 6px;
}

.dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.search-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.search-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    padding-left: 18px;
}

/* Action Controls & Submittals */
#submit-btn, .action-btn {
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-family: inherit !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

#submit-btn {
    background: rgba(129, 140, 248, 0.1) !important;
    border: 1px solid rgba(129, 140, 248, 0.4) !important;
    color: #c7d2fe !important;
}

#submit-btn:hover {
    background: rgba(129, 140, 248, 0.25) !important;
    border-color: #a5b4fc !important;
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.35) !important;
    transform: translateY(-1px) !important;
}

.game-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

.game-controls .action-btn {
    font-size: 0.85rem !important;
    padding: 8px 16px !important;
    flex: 1;
}

#hint-btn {
    background: rgba(16, 185, 129, 0.05) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: #a7f3d0 !important;
}

#hint-btn:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2) !important;
}

#cast-hint-btn {
    background: rgba(245, 158, 11, 0.05) !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    color: #fde68a !important;
}

#cast-hint-btn:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2) !important;
}

#submit-btn:disabled, .action-btn:disabled {
    opacity: 0.25 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.hint-popup {
    width: 100%;
    max-width: 600px;
    margin-top: 5px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 12px;
    font-size: 0.95rem;
    text-align: center;
    display: none;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02);
}

.hint-popup.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================
   ACTIVE CINEMATIC GUESS CARD
   ============================================ */
.guess-card {
    width: 100%;
    max-width: 760px;
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255,255,255,0.03);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: cardEntrance 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(15px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.guess-card.hidden {
    display: none !important;
}

.card-left {
    width: auto;
    min-width: unset;
    position: relative;
    border-right: none;
    background: transparent;
    padding: 20px 0 20px 20px;
    display: flex;
    align-items: flex-start;
}

.card-poster {
    width: 160px;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: block;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.card-poster:hover {
    transform: scale(1.03);
}

.card-right {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    overflow: hidden; /* Prevent horizontal overflow */
}

.card-header-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.genre-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    filter: grayscale(100%);
    opacity: 0.75;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.genre-badge.match-correct {
    filter: grayscale(0%);
    opacity: 1;
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--green);
    color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Stats Comparison Grid (Fixed Cutoff & Heights) */
.stats-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 1.25fr;
    gap: 8px;
    width: 100%;
}

.stat-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    perspective: 1000px;
    min-height: 82px;
    position: relative;
    box-shadow: none !important;
    overflow: visible !important;
    padding: 0 !important;
}

.stat-block-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-block:not(.animate-flip) .stat-block-inner {
    transform: rotateY(180deg);
}

.stat-block-front,
.stat-block-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    padding: 8px 4px;
}

.stat-block-front {
    background: rgba(17, 24, 39, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02), 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.stat-block-front-icon {
    font-size: 1.4rem;
    margin-bottom: 2px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.1));
}

.stat-block-front-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.stat-block-back {
    transform: rotateY(180deg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.01), 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1;
    overflow: hidden;
}

.stat-block-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700;
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}

.stat-block-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
}

/* Beautiful custom match neon arrows */
.stat-block-arrow {
    font-size: 0.8rem;
    font-weight: 900;
    margin-top: 2px;
    text-shadow: 0 0 5px currentColor;
}

.arrow-up { color: #f43f5e; }
.arrow-down { color: #3b82f6; }

/* Stat Match States with Custom GPU Glow & Shine Sweep */
.stat-block.match-correct .stat-block-back {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1.5px solid var(--green) !important;
    color: #a7f3d0 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
    animation: neonGlowPulseCorrect 2.5s infinite ease-in-out;
}
.stat-block.match-correct .stat-block-back .stat-block-value { color: #a7f3d0 !important; }
.stat-block.match-correct .stat-block-back .stat-block-label { color: rgba(167, 243, 208, 0.65) !important; }

.stat-block.match-close .stat-block-back {
    background: rgba(245, 158, 11, 0.15) !important;
    border: 1.5px solid var(--yellow) !important;
    color: #fde68a !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1) !important;
    animation: neonGlowPulseClose 2.5s infinite ease-in-out;
}
.stat-block.match-close .stat-block-back .stat-block-value { color: #fde68a !important; }
.stat-block.match-close .stat-block-back .stat-block-label { color: rgba(253, 230, 138, 0.65) !important; }

.stat-block:not(.match-correct):not(.match-close) .stat-block-back {
    background: rgba(30, 41, 59, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.01) !important;
}

/* Studio Block - Compact & Un-Clipped */
.studio-block {
    grid-column: 5;
}

.stat-block.match-correct .studio-logo {
    filter: grayscale(0%) invert(0) brightness(1);
    opacity: 1;
}

/* Premium diagonal shine sweep reflection */
.stat-block-back::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.22) 50%,
        transparent
    );
    transform: skewX(-25deg);
    pointer-events: none;
    z-index: 5;
}

.stat-block.animate-flip .stat-block-back::after {
    animation: shineSweep 1.3s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.studio-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    height: 100%;
}

.studio-logo {
    max-height: 32px; /* Restrict logo height tightly */
    max-width: 90%;
    object-fit: contain;
    filter: grayscale(100%) invert(1) brightness(0.8);
    opacity: 0.55;
    transition: all 0.5s ease;
}

.stat-block.match-correct .studio-logo {
    filter: grayscale(0%) invert(0) brightness(1);
    opacity: 1;
}

.studio-name-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
    text-align: center;
}

/* ============================================
   SPACE-EFFICIENT HORIZONTAL CAST SECTION
   ============================================ */
.cast-crew-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

.cast-crew-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 0; /* Enable truncation for child text items */
    gap: 6px;
    position: relative;
}

.cast-avatar-container {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: #090e18;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.cast-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) brightness(0.6);
    transition: all 0.5s ease;
}

.cast-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
    transition: all 0.3s ease;
}

/* Role Label badges underneath names */
.cast-role-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 800;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

/* Highlight states for Cast and Crew matches */
.cast-crew-card.match-correct .cast-avatar-container {
    border-color: var(--green) !important;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}
.cast-crew-card.match-correct .cast-avatar {
    filter: grayscale(0%) brightness(1);
}
.cast-crew-card.match-correct .cast-name {
    color: #34d399;
    font-weight: 800;
}

.cast-crew-card.match-close .cast-avatar-container {
    border-color: var(--yellow) !important;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}
.cast-crew-card.match-close .cast-avatar {
    filter: grayscale(0%) brightness(1);
}
.cast-crew-card.match-close .cast-name {
    color: #fbbf24;
    font-weight: 800;
}

/* ============================================
   TIPS CAROUSEL SYSTEM
   ============================================ */
.tips-carousel-container {
    width: 100%;
    max-width: 600px;
    background: rgba(15, 23, 42, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    gap: 15px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.01);
    margin-top: 5px;
}

.tip-content-box {
    flex: 1;
    text-align: center;
    transition: opacity 0.3s ease;
}

.tip-prefix {
    font-size: 0.62rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tip-content-box h4 {
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #f3f4f6;
}

.tip-content-box p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-top: 3px;
    font-weight: 500;
}

.tip-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0 5px;
    transition: all 0.2s ease;
    line-height: 1;
}

.tip-nav-btn:hover {
    color: var(--text-primary);
    transform: scale(1.2);
}

/* Color Clue Legend Style */
.legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.01) !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    backdrop-filter: blur(10px);
    padding: 10px 18px !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.01);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.box {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.box.green { background: var(--green); box-shadow: 0 0 6px rgba(16, 185, 129, 0.3); }
.box.yellow { background: var(--yellow); box-shadow: 0 0 6px rgba(245, 158, 11, 0.3); }
.box.grey { background: var(--grey-dark); }

/* Cinematic Start & Conclusion Overlays */
/* ============================================
   OVERHAULED CINEMATIC START CARD
   ============================================ */
.cinematic-start-card {
    max-width: 680px !important;
    width: 92% !important;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.start-header-graphic {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.clapboard-icon {
    font-size: 3rem;
    z-index: 2;
    animation: clapboardWiggle 4s ease-in-out infinite;
}

@keyframes clapboardWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.cine-glow-effect {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.4) 0%, transparent 70%);
    z-index: 1;
    filter: blur(10px);
}

.start-tagline {
    font-size: 0.95rem !important;
    color: #94a3b8 !important;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: -8px;
    margin-bottom: 5px;
}

/* Intro Rules Steps Grid */
.intro-sections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin: 15px 0;
}

.intro-section-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.01);
}

.intro-section-card:hover {
    transform: translateY(-2px);
    border-color: rgba(129, 140, 248, 0.2);
    background: rgba(0, 0, 0, 0.35);
}

.section-badge-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(129, 140, 248, 0.15);
    border: 1px solid var(--accent-primary);
    color: #a5b4fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.3);
}

.intro-section-card h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.intro-section-card p {
    font-size: 0.78rem !important;
    color: var(--text-secondary) !important;
    line-height: 1.4 !important;
    font-weight: 500;
}

/* Attrib preview badges row */
.start-stats-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 15px;
}

.attrib-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #cbd5e1;
    transition: all 0.3s ease;
}

.attrib-chip:hover {
    background: rgba(129, 140, 248, 0.08);
    border-color: rgba(129, 140, 248, 0.3);
    color: #a5b4fc;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.1);
}

/* Loading Spinner styling */
.start-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #a5b4fc;
    font-weight: 700;
    margin: 5px 0;
}

.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(129, 140, 248, 0.2);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

#play-start-btn {
    display: block;
    margin: 1rem auto 0 !important;
    padding: 0.9rem 2.2rem !important;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 30px !important;
    cursor: pointer;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25) !important;
    animation: buttonPulse 2s ease-in-out infinite !important;
}

#play-start-btn:hover {
    transform: translateY(-2px) scale(1.03) !important;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4), 0 0 15px rgba(168, 85, 247, 0.3) !important;
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2); }
    50% { box-shadow: 0 4px 30px rgba(99, 102, 241, 0.45); }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.8) !important;
    backdrop-filter: blur(15px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.overlay.show {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 50% !important;
    width: 34px;
    height: 34px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent-primary) !important;
    transform: rotate(90deg) scale(1.05) !important;
}

/* Personal Statistics Modal */
.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
    width: 100% !important;
    margin: 20px 0 !important;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    padding: 15px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.02);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.03);
    border-color: var(--accent-primary) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 102, 241, 0.05) !important;
}

.stat-card::before {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.stat-card:nth-child(1)::before { content: '🎬'; }
.stat-card:nth-child(2)::before { content: '🎯'; }
.stat-card:nth-child(3)::before { content: '🔥'; }

.stat-card .stat-value {
    font-size: 1.8rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
}

.stat-card .stat-label {
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    color: var(--text-tertiary) !important;
    font-weight: 700 !important;
}

/* Achievements styles */
.achievements-section h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.achievements-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
}

.achievement-card {
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
    padding: 15px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Conclusion and Results modals */
/* ============================================
   CINEMATCH DEDUCTION BOARD
   ============================================ */
.deduction-dashboard {
    width: 100%;
    max-width: 600px;
    background: rgba(15, 23, 42, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 16px;
    padding: 15px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02), 0 8px 24px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeIn 0.4s ease;
}

.deduction-dashboard.hidden {
    display: none !important;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
}

.dashboard-icon {
    font-size: 1.1rem;
}

.dashboard-header h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f3f4f6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-hint {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-left: auto;
    font-weight: 500;
}

.deduction-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.deduction-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.deduc-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.deduc-value {
    font-size: 0.85rem;
    font-weight: 800;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.deduc-value .arrow {
    font-size: 0.75rem;
    text-shadow: 0 0 4px currentColor;
}

.deduc-wide {
    grid-column: span 3;
}

#deduc-studio {
    grid-column: span 2;
}

.discovered-clues-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 2px 0;
}

.clue-placeholder {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-style: italic;
    font-weight: 500;
}

.discovered-clue-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(129, 140, 248, 0.08);
    border: 1px solid rgba(129, 140, 248, 0.2);
    color: #a5b4fc;
}

.discovered-clue-badge.clue-genre {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.discovered-clue-badge.clue-people {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
    color: #fde68a;
}

/* ============================================
   CURTAIN-CALL THEATER RESULT MODAL
   ============================================ */
#result-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.85) !important;
}

.result-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.18);
    opacity: 0;
    transition: opacity 0.8s ease;
}

#result-modal.show .result-backdrop {
    opacity: 0.75;
}

.theater-view {
    max-width: 820px !important;
    width: 90% !important;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 40px rgba(129, 140, 248, 0.1) !important;
    padding: 0 !important;
    overflow: hidden;
    position: relative;
    border-radius: 24px !important;
}

.theater-layout {
    display: flex;
    width: 100%;
}

.theater-left {
    width: 250px;
    min-width: 250px;
    background: #090e1a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.theater-left #result-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    border: none;
    margin: 0;
    box-shadow: none;
    display: block;
}

.theater-right {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 85vh;
    overflow-y: auto;
}

.completion-badge {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--green);
    color: #34d399;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.completion-badge.loss {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #fca5a5;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

#result-title {
    font-size: 2.2rem !important;
    font-weight: 900 !important;
    line-height: 1.1;
    margin-bottom: 0 !important;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    text-shadow: none !important;
}

.result-tagline {
    font-size: 0.95rem;
    font-style: italic;
    color: #94a3b8;
    line-height: 1.4;
    border-left: 2px solid var(--accent-primary);
    padding-left: 10px;
}

.movie-stats-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.res-stat-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #e2e8f0;
}

.overview-box h4, .journey-box h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.result-overview {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
    font-weight: 500;
}

.journey-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 12px 15px;
}

.journey-cells {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.journey-cell {
    width: 22px;
    height: 33px;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.journey-cell.status-correct { border-color: var(--green); box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.journey-cell.status-close { border-color: var(--yellow); box-shadow: 0 0 6px rgba(251, 191, 36, 0.4); }
.journey-cell.status-wrong { border-color: var(--grey-light); }

#result-message {
    font-size: 0.9rem;
    color: #cbd5e1;
    font-weight: 600;
}

.primary-action {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.primary-action:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%) !important;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4) !important;
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
}

.share-action-btn {
    background: linear-gradient(135deg, #3b82f6, #60a5fa) !important;
    border-color: #3b82f6 !important;
}

.share-action-btn:hover {
    background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
}

#submit-btn:active, .action-btn:active {
    transform: translateY(1px) scale(0.97) !important;
}

/* ============================================
   RESPONSIVENESS AND COLLAPSIBILITY
   ============================================ */
@media (max-width: 768px) {
    main {
        padding: 12px !important;
    }
    
    #game-container {
        padding: 15px !important;
        gap: 15px;
        border-radius: 18px !important;
    }
    
    #input-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    #guess-input {
        width: 100% !important;
    }
    
    #submit-btn {
        width: 100% !important;
        padding: 10px 20px !important;
    }
    
    .game-controls {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .game-controls button {
        width: 100% !important;
    }
    
    .legend {
        padding: 8px 12px !important;
        gap: 8px;
        font-size: 0.72rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .result-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
        margin-top: 15px;
    }
    
    .result-actions button {
        width: 100% !important;
    }

    /* Overhauled Start Screen Mobile Adjustments */
    .intro-sections-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    .intro-section-card {
        padding: 12px 16px !important;
        flex-direction: row !important;
        text-align: left;
        gap: 12px !important;
    }
    .intro-section-card h4 {
        margin-bottom: 2px;
    }
    .cinematic-start-card {
        padding: 20px 15px !important;
        gap: 10px !important;
    }
    .start-tagline {
        font-size: 0.8rem !important;
    }

    /* Deduction Dashboard Mobile Optimization */
    .deduction-dashboard {
        padding: 12px;
        border-radius: 12px;
        gap: 10px;
    }
    .deduction-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    .deduc-wide, #deduc-studio {
        grid-column: span 1 !important;
    }
    .discovered-clues-list {
        justify-content: center;
        gap: 4px;
    }

    /* Theater Completion Modal Mobile Overrides */
    .theater-layout {
        flex-direction: column !important;
    }
    .theater-left {
        width: 100% !important;
        min-width: unset !important;
        height: 160px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    .theater-left #result-poster {
        object-position: center 20% !important;
    }
    .theater-right {
        padding: 20px 15px !important;
        max-height: 65vh !important;
        gap: 12px;
    }
    #result-title {
        font-size: 1.6rem !important;
        text-align: center;
    }
    .result-tagline {
        font-size: 0.85rem !important;
        text-align: center;
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px dashed rgba(255, 255, 255, 0.1);
        padding-top: 6px;
    }
    .movie-stats-strip {
        justify-content: center !important;
        gap: 6px;
    }
    .completion-badge {
        align-self: center !important;
    }
    .journey-cells {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 4px !important;
    }
    .journey-cell {
        width: 18px !important;
        height: 27px !important;
    }

    /* Collapse Card Layout to Vertical Stack on Mobile */
    .guess-card {
        flex-direction: column;
        border-radius: 16px;
    }

    .card-left {
        width: 100%;
        height: auto;
        min-width: unset;
        border-right: none;
        border-bottom: none;
        background: transparent;
        padding: 15px 15px 0 15px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .card-poster {
        width: 130px;
        aspect-ratio: 2/3;
        margin: 0 auto;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    }

    .card-right {
        padding: 15px;
        gap: 12px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .stats-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .studio-block {
        grid-column: span 2;
        min-height: 55px;
    }

    .cast-crew-section {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }
    
    .cast-crew-card {
        flex: unset;
        width: 28%;
    }
}

@media (max-width: 480px) {
    #streak-container {
        padding: 6px 12px !important;
    }
    #streak-container p {
        font-size: 0.85rem;
    }
    .film-cells {
        gap: 4px;
        padding: 0 6px;
    }
    .sprockets {
        padding: 0 6px;
    }
    .guess-counter {
        font-size: 0.8rem;
    }
    .tips-carousel-container {
        padding: 10px;
        gap: 8px;
    }
    .tip-content-box p {
        font-size: 0.75rem;
    }
    .cast-crew-card {
        width: 45%;
    }
}

/* ============================================
   STAGGERED TILE FLIP & CINEMATIC REVEAL KEYFRAMES
   ============================================ */
@keyframes tileFlip3D {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(180deg);
    }
}

.stat-block.animate-flip .stat-block-inner {
    animation: tileFlip3D 0.75s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes neonGlowPulseCorrect {
    0%, 100% {
        box-shadow: 0 0 12px rgba(16, 185, 129, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1);
        border-color: rgba(16, 185, 129, 0.8);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.15);
        border-color: rgba(16, 185, 129, 1);
    }
}

@keyframes neonGlowPulseClose {
    0%, 100% {
        box-shadow: 0 0 12px rgba(245, 158, 11, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1);
        border-color: rgba(245, 158, 11, 0.8);
    }
    50% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.15);
        border-color: rgba(245, 158, 11, 1);
    }
}

@keyframes shineSweep {
    0% {
        left: -150%;
    }
    30% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}

@keyframes castCircleReveal {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.1) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.cast-crew-card.animate-reveal {
    animation: castCircleReveal 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes posterSlideIn {
    from {
        transform: translateX(-18px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.card-left.animate-poster {
    animation: posterSlideIn 0.6s cubic-bezier(0.25, 1, 0.5, 1) both;
}

@keyframes titleHeaderReveal {
    from {
        transform: translateY(-8px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.card-header-info.animate-header {
    animation: titleHeaderReveal 0.5s cubic-bezier(0.25, 1, 0.5, 1) both;
}

/* ============================================
   PREMIUM PORTRAIT PERSON MODAL STYLING
   ============================================ */
.person-content {
    max-width: 720px !important;
    width: 90% !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 35px rgba(129, 140, 248, 0.1) !important;
    padding: 0 !important;
    overflow: hidden;
    position: relative;
    border-radius: 20px !important;
}

.person-layout {
    display: flex;
    width: 100%;
}

.person-media {
    width: 230px;
    min-width: 230px;
    background: #090e1a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.person-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.person-info {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 80vh;
    overflow-y: auto;
}

.person-role-badge {
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(129, 140, 248, 0.15);
    border: 1px solid var(--accent-primary);
    color: #a5b4fc;
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.2);
}

#person-name {
    font-size: 2rem !important;
    font-weight: 900 !important;
    line-height: 1.1;
    color: #ffffff;
}

.person-meta-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.person-meta-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #cbd5e1;
}

.person-bio-box h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.person-biography {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
    font-weight: 500;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
    text-align: left;
}

.person-biography::-webkit-scrollbar {
    width: 4px;
}
.person-biography::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Cast Card clickable trigger details */
.cast-crew-card {
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.cast-crew-card:hover {
    transform: translateY(-3px) scale(1.05);
}

.cast-crew-card:hover .cast-avatar-container {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.4);
}

.cast-crew-card:hover .cast-name {
    color: #ffffff !important;
}

/* Responsive adjustment for Mobile viewports */
@media (max-width: 768px) {
    .person-layout {
        flex-direction: column !important;
    }
    .person-media {
        width: 100% !important;
        min-width: unset !important;
        height: 200px !important;
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    .person-media img {
        object-position: center 20% !important;
    }
    .person-info {
        padding: 20px 15px !important;
        max-height: 55vh !important;
    }
    #person-name {
        font-size: 1.5rem !important;
        text-align: center;
    }
    .person-role-badge {
        align-self: center !important;
    }
    .person-meta-strip {
        justify-content: center !important;
    }
}

