@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-color: #02021a;
    --primary-color: #0b0b45;
    --accent-color: #ffd700;
    --text-color: #ffffff;
    --correct-color: #2ecc71;
    --wrong-color: #e74c3c;
    --border-color: #34495e;
    --gradient-blue: linear-gradient(135deg, #0b0b45 0%, #1a1a6b 100%);
    --gradient-gold: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.view {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Landing Page Styles */
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 10px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pay-btn {
    background: var(--gradient-gold);
    color: var(--bg-color);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    transition: transform 0.2s;
}

.pay-btn:hover {
    transform: scale(1.05);
}

.stats-container {
    background: rgba(11, 11, 69, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

.stats-container h2 {
    margin-bottom: 20px;
    text-align: center;
    color: var(--accent-color);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
}

.player-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.2s;
}

.player-row:last-child {
    border-bottom: none;
}

.player-rank {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.player-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
    background: var(--primary-color);
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-meta {
    font-size: 0.75rem;
    color: #888;
}

.player-score {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--correct-color);
    flex-shrink: 0;
    text-align: right;
}


/* Header & Progress Bar */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.level-indicator {
    background: var(--gradient-blue);
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid var(--accent-color);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.score-display {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Question Area */
.question-container {
    background: var(--gradient-blue);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-text {
    font-size: 1.4rem;
    line-height: 1.4;
    font-weight: 600;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 480px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Force 2 columns on mobile as well for compact view */
.options-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-btn {
    background: var(--gradient-blue);
    border: 2px solid var(--border-color);
    color: white;
    padding: 10px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    overflow: hidden;
    min-height: 50px;
}

.timer-display {
    background: var(--primary-color);
    border: 2px solid var(--accent-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-left: auto;
    /* Push to right */
}

/* Footer & Status */
.game-footer {
    margin-top: 20px;
    text-align: center;
}

.win-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 5px;
    background: rgba(255, 215, 0, 0.1);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--accent-color);
}

.safe-haven-text {
    font-size: 0.9rem;
    color: var(--correct-color);
    margin-top: 5px;
    font-weight: 600;
    background: rgba(46, 204, 113, 0.1);
    padding: 8px;
    border-radius: 5px;
    border: 1px dashed var(--correct-color);
}

.option-btn::before {
    content: attr(data-prefix);
    color: var(--accent-color);
    font-weight: 700;
    margin-right: 15px;
}

.option-btn:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

.option-btn.selected {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

.option-btn.correct {
    background: var(--correct-color) !important;
    border-color: var(--correct-color) !important;
    color: white !important;
    animation: flash 0.5s ease 3;
}

.option-btn.wrong {
    background: var(--wrong-color) !important;
    border-color: var(--wrong-color) !important;
    color: white !important;
}

/* Lifelines */
.lifelines {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: auto;
    padding-bottom: 20px;
}

.lifeline-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-blue);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lifeline-btn:hover:not(.used) {
    background: var(--accent-color);
    color: var(--bg-color);
    transform: scale(1.1);
}

.lifeline-btn.used {
    background: #333;
    border-color: #666;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Animations */
@keyframes flash {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Win/Lose Screens */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
}

.modal.active {
    display: flex;
}

.result-title {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.result-score {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.restart-btn {
    background: var(--gradient-gold);
    color: var(--bg-color);
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}