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

body {
    font-family: 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f23, #1a1a3e);
    color: #ffffff;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
    margin-bottom: env(safe-area-inset-bottom); /* Additional safe area margin */
}

.game-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 150px; /* Extra space for money ladder on mobile */
}

.header {
    text-align: center;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 10px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid #ffd700;
    backdrop-filter: blur(10px);
}

.current-question,
.current-winnings {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffd700;
}

.main-game {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.question-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #ffd700;
    backdrop-filter: blur(10px);
    min-height: 150px;
    display: flex;
    align-items: center;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2);
}

.question-text {
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.6;
    text-align: center;
    width: 100%;
}

.answers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.3s ease;
}

.answers-container.active {
    opacity: 1;
    pointer-events: all;
}

.answer-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 2px solid #4a90e2;
    border-radius: 10px;
    padding: 20px;
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-align: left;
    backdrop-filter: blur(10px);
}

.answer-btn:hover {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.answer-btn.selected {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.answer-btn.correct {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.3), rgba(40, 167, 69, 0.1));
    animation: correctAnswer 1s ease-in-out;
}

.answer-btn.wrong {
    border-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.3), rgba(220, 53, 69, 0.1));
    animation: wrongAnswer 0.5s ease-in-out;
}

.answer-btn.disabled {
    opacity: 0.3;
    background: rgba(100, 100, 100, 0.2);
    border-color: #666;
    color: #999;
}

@keyframes correctAnswer {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes wrongAnswer {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.answer-letter {
    background: #ffd700;
    color: #000;
    padding: 8px 12px;
    border-radius: 50%;
    font-weight: 700;
    margin-right: 15px;
    min-width: 40px;
    text-align: center;
}

.answer-text {
    flex: 1;
}

.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.start-btn,
.final-answer-btn,
.walk-away-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.start-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-size: 1.5rem;
    padding: 20px 40px;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.start-btn:hover::before {
    left: 100%;
}

.final-answer-btn {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #000;
}

.walk-away-btn {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
    color: white;
}

.start-btn:hover,
.final-answer-btn:hover,
.walk-away-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.start-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.6);
    border-color: #ffd700;
}

.right-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.lifelines {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #4a90e2;
    backdrop-filter: blur(10px);
}

.lifelines h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #ffd700;
    font-size: 1.3rem;
}

.lifeline-btn {
    width: 100%;
    margin-bottom: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(74, 144, 226, 0.1));
    border: 2px solid #4a90e2;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lifeline-btn:hover {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    transform: translateY(-1px);
}

.lifeline-btn.used {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(100, 100, 100, 0.2);
    border-color: #666;
}

.lifeline-icon {
    background: #ffd700;
    color: #000;
    padding: 8px;
    border-radius: 50%;
    font-weight: 700;
    min-width: 35px;
    text-align: center;
    font-size: 0.9rem;
}

.lifeline-text {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.money-ladder {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    padding: 20px 25px;
    border-radius: 15px;
    border: 2px solid #ffd700;
    backdrop-filter: blur(10px);
    margin-top: 30px;
    position: sticky;
    bottom: 20px;
    z-index: 100;
    transition: all 0.5s ease;
    max-width: 100%;
    overflow-x: auto;
}

.money-ladder.hidden {
    display: none !important;
}

.money-ladder.show {
    display: block;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.money-ladder h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
    font-size: 1.3rem;
}

.ladder-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
    max-height: none; /* Remove height restriction on desktop */
    overflow: visible;
}

.money-step {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 20px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 80px;
    position: relative;
}

.money-step::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid #444;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    z-index: 1;
}

.money-step:last-child::after {
    display: none;
}

.money-step.mobile-hidden {
    display: none !important;
}

.money-step.current {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #000;
    font-weight: 700;
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    transform: scale(1.1);
    z-index: 2;
}

.money-step.current::after {
    border-left-color: #ffd700;
}

.money-step.guaranteed {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(40, 167, 69, 0.1));
}

.money-step.guaranteed::after {
    border-left-color: #28a745;
}

.money-step.reached {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
}

.money-step.reached::after {
    border-left-color: #ffd700;
}
.money-grand-prize {
    font-size: 2rem;
    font-weight: 800;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1a1a3e, #0f0f23);
    margin: 10% auto;
    padding: 30px;
    border: 2px solid #ffd700;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.modal-content div {
    margin: 15px 0;
    font-size: 1.1rem;
    line-height: 1.5;
}

.modal-content button {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #000;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
}

.close:hover {
    color: #ffd700;
}

/* Audience Poll Styles */
.audience-poll {
    margin: 20px 0;
}

.poll-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.poll-bar {
    height: 20px;
    background: linear-gradient(90deg, #ffd700, #ffed4a);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .game-container {
        padding: 15px;
        padding-bottom: 100px;
    }
    
    .main-game {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .right-panel {
        order: -1;
    }
    
    .money-ladder {
        margin-top: 20px;
        position: fixed;
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 15px;
    }
    
    .ladder-container {
        gap: 6px;
    }
    
    .money-step {
        font-size: 0.8rem;
        padding: 6px 10px;
        min-width: 70px;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 10px;
        padding-bottom: 120px; /* Increased space for mobile money ladder */
    }
    
    .header {
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .game-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px 15px;
    }
    
    .main-game {
        gap: 15px;
        margin-top: 15px;
    }
    
    .question-container {
        padding: 20px 15px;
        min-height: 120px;
    }
    
    .answers-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .answer-btn {
        padding: 15px 12px;
        font-size: 0.95rem;
    }
    
    .control-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .question-text {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .money-ladder {
        position: fixed;
        bottom: 5px;
        left: 5px;
        right: 5px;
        padding: 10px 15px;
        margin-top: 0;
        border-radius: 10px;
        max-height: 20vh; /* Smaller height since only 3 steps */
        overflow: hidden; /* No scrolling needed */
    }
    
    .money-ladder h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .ladder-container {
        gap: 8px;
        justify-content: center;
        overflow: visible;
        padding-bottom: 0;
        max-height: none;
        flex-direction: row; /* Horizontal layout for 3 steps */
        align-items: center;
    }
    
    .money-step {
        font-size: 0.8rem;
        padding: 8px 12px;
        min-width: 80px;
        flex-shrink: 0;
        border-radius: 15px;
    }
    
    .money-step::after {
        right: -12px;
        border-left-width: 6px;
        border-top-width: 4px;
        border-bottom-width: 4px;
    }
    
    .money-step:last-child::after {
        display: none;
    }
    
    .lifelines {
        padding: 15px;
    }
    
    .lifeline-btn {
        padding: 12px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 8px;
        padding-bottom: 180px; /* Increased for better mobile spacing */
    }
    
    .header h1 {
        font-size: 1.4rem;
        line-height: 1.2;
    }
    
    .game-info {
        padding: 10px;
        font-size: 1rem;
    }
    
    .current-question,
    .current-winnings {
        font-size: 1rem;
    }
    
    .question-container {
        padding: 15px 10px;
        min-height: 100px;
    }
    
    .question-text {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .answer-btn {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .answer-letter {
        padding: 6px 8px;
        margin-right: 10px;
        min-width: 32px;
        font-size: 0.9rem;
    }
    
    .control-buttons {
        gap: 8px;
    }
    
    .start-btn,
    .final-answer-btn,
    .walk-away-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .start-btn {
        font-size: 1.2rem;
        padding: 15px 25px;
    }
    
    .modal-content {
        margin: 15% auto;
        padding: 15px;
        width: 95%;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .money-ladder {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 8px;
        border-radius: 8px 8px 0 0;
        max-height: 40vh;
        overflow-y: auto;
        background: linear-gradient(135deg, rgba(15, 15, 35, 0.95), rgba(26, 26, 62, 0.9));
        backdrop-filter: blur(15px);
        border: 2px solid #ffd700;
    }
    
    .money-ladder h3 {
        font-size: 1rem;
        margin-bottom: 8px;
        position: sticky;
        top: 0;
        background: inherit;
        z-index: 1;
    }
    
    .ladder-container {
        flex-direction: column;
        gap: 2px;
        max-height: none;
        overflow-y: visible;
        padding-bottom: 10px;
    }
    
    .money-step {
        width: 100%;
        font-size: 0.75rem;
        padding: 6px;
        text-align: center;
        transition: all 0.3s ease;
    }
    
    .money-step.current {
        transform: scale(1.05);
        font-weight: 700;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
        border: 2px solid #ffd700;
        z-index: 2;
        position: relative;
    }

    .money-step::after {
        display: none;
    }
    
    .lifelines {
        padding: 12px;
    }
    
    .lifeline-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .lifeline-icon {
        padding: 6px;
        min-width: 30px;
        font-size: 0.8rem;
    }
}