/* ============================================
   Oscar Picks — Theme & Layout (v2)
   Dark + Gold, elegant typography
   ============================================ */

:root {
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1f2f52;
    --gold: #d4af37;
    --gold-light: #f5e6a3;
    --gold-dim: #a08520;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --accent-green: #4caf50;
    --accent-red: #e74c3c;
    --border: #2a2a4a;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

.main-content {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

#game-container, #session-review-view {
    text-align: center;
}

/* --- Header --- */
#game-header { margin-bottom: 1.5rem; }

.oscar-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: #1a1a2e;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}

#game-prompt {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--gold-light);
    margin: 0.25rem 0;
}

#game-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 0.25rem;
}

#round-counter {
    color: var(--gold);
    font-weight: 600;
}

/* --- Film Cards --- */
.films-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1rem 0;
    position: relative;
    width: 100%;
}

.film-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    margin: 0.5rem 0;
    cursor: pointer;
    width: 100%;
    transition: all 0.25s ease;
    text-align: left;
}
.film-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold-dim);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.15);
}

.film-card .film-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4rem;
}

.film-card .film-meta {
    font-size: 0.85rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.film-card .film-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.film-card-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.skip-btn {
    all: unset;
    box-sizing: border-box;
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    margin-top: 0.25rem;
    border-radius: 12px;
    transition: all 0.2s;
    opacity: 0.6;
}
.skip-btn:hover {
    opacity: 1;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.05);
}

.vs-divider {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--gold-dim);
    margin: 0.5rem 0;
    font-style: italic;
}

/* --- Flash Message --- */
#flash-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 2.5rem;
    border-radius: 12px;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    font-family: var(--font-display);
    z-index: 10;
    text-align: center;
}
#flash-message.correct { background-color: rgba(76, 175, 80, 0.9); }
#flash-message.incorrect { background-color: rgba(231, 76, 60, 0.9); }

/* ============================================
   ELIMINATION TRACKER
   ============================================ */
#tracker {
    margin: 1rem 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0,0,0,0.2);
}

#tracker-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.tracker-pill {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.65rem;
    border-radius: 16px;
    border: 1.5px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tracker-alive {
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    border-color: var(--border);
}

.tracker-fighting {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    border-color: var(--gold);
    animation: pulse-border 1.5s ease-in-out infinite;
}

.tracker-eliminated {
    background: rgba(231, 76, 60, 0.1);
    color: var(--text-muted);
    border-color: rgba(231, 76, 60, 0.3);
    text-decoration: line-through;
    opacity: 0.5;
}

.tracker-skipped {
    background: rgba(100, 100, 120, 0.1);
    color: var(--text-muted);
    border-color: rgba(100, 100, 120, 0.3);
    font-style: italic;
    opacity: 0.4;
}

.tracker-champion {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-dark);
    font-weight: 700;
    border-color: var(--gold-light);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--gold); }
    50% { border-color: var(--gold-light); box-shadow: 0 0 8px rgba(212, 175, 55, 0.3); }
}


/* --- Navigation --- */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.btn-primary {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    cursor: pointer;
    flex-grow: 1;
    min-width: 120px;
    border: 2px solid var(--gold);
    border-radius: 8px;
    background: transparent;
    color: var(--gold);
    transition: all 0.2s;
}
.btn-primary:hover {
    background: var(--gold);
    color: var(--bg-dark);
}

.btn-secondary {
    all: unset;
    box-sizing: border-box;
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s;
    flex-grow: 1;
    text-align: center;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

nav button { all: unset; box-sizing: border-box; }
nav .btn-primary { margin: 0; }
nav .btn-secondary { flex-grow: 1; }

/* --- Path / History --- */
#path-stats-container {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
    margin-top: 1rem;
    border-radius: 8px;
}
#path-list {
    list-style: none;
    padding: 0.75rem 1rem;
    text-align: left;
}
#path-list li {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
#path-list .round-num {
    font-weight: 600;
    color: var(--gold);
}
#path-list li b { color: var(--text-primary); }

/* Quiz path coloring */
.quiz-path-correct { background-color: rgba(76, 175, 80, 0.15) !important; }
.quiz-path-incorrect { background-color: rgba(231, 76, 60, 0.15) !important; }

/* --- Modal --- */
#modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
}
.modal-view {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    border-radius: 12px;
    padding: 2rem 2rem 1.5rem;
    z-index: 101;
    min-width: 300px;
    width: 90vw;
    max-width: 500px;
    text-align: center;
    color: var(--text-primary);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-view.modal-view-top {
    top: 15vh;
    transform: translate(-50%, 0);
}
.modal-view-lg { max-width: 700px; }

.close-modal-btn {
    position: absolute; top: 10px; right: 15px;
    font-size: 2rem; font-weight: bold;
    color: var(--text-muted);
    background: none; border: none;
    cursor: pointer; line-height: 1; padding: 0.5rem;
}
.close-modal-btn:hover { color: var(--text-primary); }

#modal-title {
    font-family: var(--font-display);
    color: var(--gold-light);
    margin-bottom: 1rem;
}

#modal-body input {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

#modal-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: stretch;
    gap: 10px;
}
#modal-footer button { flex-grow: 1; }

/* Game Over winner pill */
#game-over-winner-text {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: var(--bg-dark);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-family: var(--font-display);
    font-weight: 700;
}

/* --- Stats View inside Modal --- */
#stats-view {
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
    margin-bottom: 1rem;
}
#stats-view h3 {
    font-family: var(--font-display);
    color: var(--gold);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    font-size: 1.1rem;
}
#stats-view ul { list-style: none; padding-left: 0; }
#stats-view li {
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.stats-history-links { margin-top: 0.5rem; }
.stats-history-links a {
    margin-right: 1rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--gold);
}
.stats-history-links a:hover { text-decoration: underline; }

/* Film ranking bar */
.ranking-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-top: 0.4rem;
}
.ranking-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Review modal */
#review-modal-path {
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
    margin-bottom: 1rem;
}
#review-modal-path ul { list-style: none; padding-left: 0; }
#review-modal-path li {
    font-size: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}
#review-modal-path li b { color: var(--gold); }

/* Session review page */
#session-review-view {
    text-align: left;
    max-width: 600px;
    margin: 1rem auto;
}
#session-review-path ul { list-style: none; padding-left: 0; }
#session-review-path li {
    font-size: 1.1rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}
#session-review-path li b { color: var(--gold); }

/* Share modal */
.share-input-group { margin-bottom: 1rem; text-align: left; }
.share-input-group label {
    display: block; font-weight: 600;
    margin-bottom: 0.25rem; font-size: 0.85rem;
    color: var(--text-secondary);
}
.share-input-wrapper { display: flex; gap: 0.5rem; }
.share-input-wrapper input {
    flex-grow: 1;
    background-color: var(--bg-dark) !important;
    font-size: 0.85rem !important;
}

/* --- Utilities --- */
.hidden { display: none; }

/* --- Responsive --- */
@media (min-width: 768px) {
    .films-wrapper {
        flex-direction: row;
        align-items: stretch;
    }
    .film-card-wrapper {
        flex: 1;
        width: auto;
    }
    .film-card {
        flex-grow: 1;
        width: auto;
    }
    .vs-divider {
        margin: auto 1rem;
    }
    body {
        padding-top: 5vh;
    }
    .tracker-pill {
        font-size: 0.8rem;
        padding: 0.35rem 0.75rem;
    }
}

/* Scrollbar styling for dark theme */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }
