/* Reset and Base Styles */
body {
    margin: 0;
    padding: 0;
    background-image: url('background.jpg'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center; 
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* --- Welcome Screen Overlay --- */
#welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100; /* Highest priority */
    display: flex;
    justify-content: center;
    align-items: center;
}

.welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.welcome-logo {
    max-width: 90%;
    max-height: 60vh;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 100, 255, 0.8);
}

.start-game-btn {
    background: linear-gradient(180deg, #1c941c 0%, #2dc92d 100%);
    border: 3px solid #ffd700;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    padding: 15px 60px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    text-shadow: 2px 2px 2px black;
    transition: transform 0.2s, box-shadow 0.2s;
}

.start-game-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
}

/* --- Money Ladder (Fixed Left) --- */
.money-ladder {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column; 
    gap: 5px;
    z-index: 20;
    padding: 20px 10px;
    background: rgba(0,0,0,0.3); 
    border-radius: 0 20px 20px 0;
}

.money-step {
    background: linear-gradient(180deg, rgba(32,58,139,0.9) 0%, rgba(63,94,251,0.9) 50%, rgba(32,58,139,0.9) 100%);
    border: 2px solid #bba53d;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    color: #ffd700;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 1px black;
    border-radius: 10px; 
    width: 200px;         
    padding: 10px 0;
    font-size: 1.15rem;   
    cursor: default;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.money-step.active-step {
    background: linear-gradient(180deg, rgb(255, 160, 27) 0%, rgb(255, 120, 0) 100%);
    border-color: #fff;
    color: #fff;
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 0 20px rgba(255, 140, 0, 1);
    z-index: 2;
}

.money-step.passed-step {
    opacity: 1;
    color: #fff;
    border-color: #ffd700;
}

/* --- Main Container --- */
.game-container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center; 
    position: relative; 
    z-index: 5;
    height: 100vh; 
    margin-left: 220px; 
    width: calc(100% - 220px);
}

/* --- Shared Button Styles --- */
.game-button {
    background: linear-gradient(180deg, rgba(32,58,139,1) 0%, rgba(63,94,251,1) 50%, rgba(32,58,139,1) 100%);
    border: 3px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.7), inset 0 0 15px rgba(0,0,0,0.4);
    color: white;
    font-weight: bold;
    text-align: center;
    text-shadow: 1px 1px 2px black;
    border-radius: 50px; 
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.game-button:hover {
    background: linear-gradient(180deg, rgba(42,68,149,1) 0%, rgba(83,114,255,1) 50%, rgba(42,68,149,1) 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.9), inset 0 0 10px rgba(0,0,0,0.2);
}

/* --- Restart Button Style (Red) --- */
.restart-btn {
    display: block;
    margin: 20px auto 0 auto;
    background: linear-gradient(180deg, #b71c1c 0%, #ff5252 50%, #b71c1c 100%);
    border: 3px solid #ffd700;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    text-shadow: 1px 1px 2px black;
    transition: transform 0.2s, box-shadow 0.2s;
}

.restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    background: linear-gradient(180deg, #c62828 0%, #ff8a80 50%, #c62828 100%);
}

/* --- Lifelines --- */
.lifelines {
    position: absolute;
    top: 20px; 
    right: 20px; 
    display: flex;
    flex-direction: row; 
    gap: 15px;
    z-index: 10; 
}

.lifeline-btn {
    width: 70px;
    height: 50px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; 
}

.lifeline-svg {
    width: 28px;
    height: 28px;
    fill: #ffd700; 
    filter: drop-shadow(1px 1px 1px black);
}

.icon-text {
    color: #ffd700;
    font-size: 1.2rem;
    font-weight: 900;
    font-family: 'Arial Black', sans-serif;
    letter-spacing: -1px;
}

.lifeline-btn[disabled] {
    opacity: 0.5;
    pointer-events: none;
}

/* --- Question Area --- */
.question-display-area {
    background: linear-gradient(180deg, rgba(32,58,139,0.95) 0%, rgba(63,94,251,0.95) 50%, rgba(32,58,139,0.95) 100%);
    border: 4px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), inset 0 0 20px rgba(0,0,0,0.5);
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    padding: 30px 50px;
    border-radius: 20px; 
    min-height: 120px; 
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    margin-top: auto; 
    margin-bottom: 20px; 
}

/* --- Connector Lines --- */
.main-connector {
    height: 3px;
    background: #ffd700;
    box-shadow: 0 0 15px #ffd700, 0 0 8px #fff;
    border-radius: 3px;
    opacity: 0.9;
    margin: 20px 100px;
    flex-shrink: 0;
}

.answers-section {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 20px 60px; 
    padding: 10px 0;
    margin-bottom: 40px; 
}

.answer-connector-line {
    position: absolute;
    height: 2px;
    background: #ffd700;
    box-shadow: 0 0 10px #ffd700, 0 0 5px #fff;
    border-radius: 2px;
    opacity: 0.8;
    top: 50%; 
    left: -20px;
    right: -20px;
    transform: translateY(-50%);
    z-index: 1; 
}

.answer-btn {
    font-size: 1.3rem;
    display: flex;
    justify-content: flex-start;
    text-align: left;
}

.label {
    color: #ffd700; 
    margin-right: 15px;
    min-width: 25px; 
}

/* --- Animations & Answer Feedback --- */

/* Flashing Animation: Orange - 3 times */
@keyframes flash-orange {
    0% { background: linear-gradient(180deg, rgba(32,58,139,1) 0%, rgba(63,94,251,1) 100%); }
    50% { background: orange; border-color: white; }
    100% { background: linear-gradient(180deg, rgba(32,58,139,1) 0%, rgba(63,94,251,1) 100%); }
}

.flash-selected {
    animation: flash-orange 0.5s linear;
    animation-iteration-count: 3; /* Flash 3 times */
}

.correct-bg {
    background: linear-gradient(180deg, rgb(28, 148, 28) 0%, rgb(45, 201, 45) 100%) !important;
    border-color: #fff !important;
    box-shadow: 0 0 20px #0f0;
}

.wrong-bg {
    background: linear-gradient(180deg, rgb(161, 29, 29) 0%, rgb(221, 55, 55) 100%) !important;
    border-color: #fff !important;
    box-shadow: 0 0 20px #f00;
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .money-ladder {
        display: none;
    }
    .game-container {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .lifelines {
        top: 10px;
        right: 50%;
        transform: translateX(50%);
        width: auto;
    }
    .answers-section {
        grid-template-columns: 1fr; 
        gap: 15px;
        margin-bottom: 20px;
    }
    .question-display-area {
        font-size: 1.1rem;
        padding: 20px;
        margin-top: 100px; 
    }
    .answer-connector-line, .main-connector {
        display: none; 
    }
}

/* --- Confetti Effect --- */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicking buttons underneath */
    z-index: 9999; /* On top of everything */
}