/* Who Wants To Be A Millionaire Game Styles */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a, #2a2a2a);
    color: #fff;
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Game container - simple flex layout */
.game-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Header */
.game-header {
    background: rgba(0, 0, 0, 0.8);
    padding: clamp(8px, 2vh, 16px);
    text-align: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-title {
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
    font-weight: bold;
    letter-spacing: 2px;
}

.admin-link {
    position: absolute;
    top: 20px;
    right: 20px;
}

.admin-link a {
    color: #ffd700;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid #ffd700;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.admin-link a:hover {
    background: #ffd700;
    color: #0d1421;
}

/* Screen Management */
.screen {
    display: none;
    flex: 1;
    padding: 20px;
    overflow: hidden;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Welcome Screen */
.welcome-content {
    text-align: center;
    max-width: 800px;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.welcome-content h2 {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.welcome-description {
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #e0e0e0;
}

.rules {
    margin-top: 30px;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
}

.rules h3 {
    color: #ffd700;
    margin-bottom: 15px;
    text-align: center;
}

.rules ul {
    list-style: none;
    padding: 0;
}

.rules li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    padding-left: 20px;
}

.rules li:before {
    content: "•";
    color: #ffd700;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Game Selection Screen */
.game-selection-content {
    text-align: center;
    max-width: 1000px;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.game-selection-content h2 {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.selection-description {
    font-size: 1.2rem;
    margin-bottom: 30px;
    line-height: 1.6;
    color: #e0e0e0;
}

.games-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.game-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.game-card:hover {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.2);
}

.game-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.game-card-title {
    font-size: 1.4rem;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 5px;
}

.game-card-status {
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
}

.game-card-status.complete {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid #28a745;
}

.game-card-status.incomplete {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.game-card-description {
    color: #e0e0e0;
    margin-bottom: 15px;
    line-height: 1.4;
    font-size: 0.95rem;
}

.game-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #ccc;
}

.question-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.selection-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Game Screen */
#game-screen.active {
    display: block;
}

.game-layout {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 20px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding: 20px;
}

/* Question Panel - Redesigned for vertical stacked layout */
.question-panel {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    height: 100%;
    max-height: calc(100vh - 180px);
    overflow: hidden;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.question-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.question-number {
    font-size: 1.5rem;
    color: #ffd700;
    font-weight: bold;
}

.question-value {
    font-size: 1.2rem;
    color: #e0e0e0;
}

/* Lifelines */
.lifelines {
    display: flex;
    gap: 15px;
}

.lifeline-btn {
    width: 60px;
    height: 60px;
    border: 3px solid #ffd700;
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lifeline-btn:hover:not(:disabled) {
    background: #ffd700;
    color: #0d1421;
    transform: scale(1.1);
}

.lifeline-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.3);
    border-color: #666;
    color: #666;
}

/* Question Content - Flexible and expandable */
.question-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.question-text {
    font-size: clamp(1rem, 2.2vw, 1.3rem);
    line-height: 1.4;
    text-align: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: clamp(10px, 1.5vh, 16px);
    border-radius: 10px;
    border: 2px solid #ffd700;
    overflow-y: auto;
    flex: 0 1 auto;
    max-height: 20vh;
}

.question-image-container {
    text-align: center;
}

.question-image {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: clamp(150px, 25vh, 300px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 0 auto;
}

/* Answers Grid - Always visible with minimal height allocation */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: clamp(4px, 0.8vh, 8px);
    flex: 0 0 auto;
    min-height: clamp(100px, 20vh, 160px);
    max-height: 25vh;
}

.answer-btn {
    background: linear-gradient(45deg, #1e3c72, #2a5298);
    border: 1px solid #4a90e2;
    color: white;
    padding: clamp(4px, 0.8vh, 8px);
    border-radius: 6px;
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 6px);
    height: 100%;
    min-height: 0;
    line-height: 1.1;
}

.answer-btn:hover:not(:disabled) {
    background: linear-gradient(45deg, #2a5298, #4a90e2);
    border-color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.answer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.answer-btn.selected {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-color: #ffd700;
    color: #0d1421;
}

.answer-btn.correct {
    background: linear-gradient(45deg, #28a745, #34ce57);
    border-color: #28a745;
    color: white;
}

.answer-btn.incorrect {
    background: linear-gradient(45deg, #dc3545, #e74c3c);
    border-color: #dc3545;
    color: white;
}

.answer-btn.hidden {
    opacity: 0.3;
    pointer-events: none;
}

.answer-label {
    font-weight: bold;
    font-size: clamp(0.8rem, 1.6vw, 0.95rem);
    min-width: clamp(16px, 2.5vw, 20px);
    flex-shrink: 0;
}

.answer-text {
    flex: 1;
    line-height: 1.1;
    font-size: clamp(0.65rem, 1.4vw, 0.8rem);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Game Controls */
.game-controls {
    text-align: center;
}

/* Money Panel */
.money-panel {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 15px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.3);
    height: fit-content;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    display: block;
}

.money-panel h3 {
    display: none;
}

.money-ladder {
    display: flex;
    flex-direction: column-reverse;
    gap: 1px;
}

.money-step {
    padding: 1px 3px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.5rem;
    min-height: 12px;
    line-height: 0.8;
}

.money-step.safe-haven {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    border-color: #ff6b35;
}

.money-step.current {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #0d1421;
    border-color: #ffd700;
    animation: pulse 2s infinite;
}

.money-step.completed {
    background: rgba(40, 167, 69, 0.3);
    border-color: #28a745;
}

.money-step.locked {
    background: rgba(108, 117, 125, 0.3);
    color: #6c757d;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.step-number {
    display: none;
}

.step-amount {
    font-size: 0.5rem;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #2a5298, #4a90e2);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.btn-warning {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #495057);
    color: white;
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.2rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Result Screen */
#result-screen.active {
    display: flex;
}

.result-content {
    text-align: center;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.8);
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

#result-title {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.result-message {
    font-size: 1.3rem;
    margin-bottom: 25px;
    line-height: 1.6;
    color: #e0e0e0;
}

.final-amount {
    font-size: 3rem;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Lifeline Notification Bars */
.lifeline-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-bottom: 3px solid #ffd700;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    padding: 15px 20px;
}

.lifeline-bar.active {
    display: block;
}

.lifeline-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    gap: 20px;
}

.lifeline-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.lifeline-info .lifeline-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #ffd700;
    border-radius: 50%;
}

.lifeline-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.lifeline-message {
    font-size: 1rem;
    color: #e0e0e0;
    margin-left: 10px;
}

.lifeline-timer {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #ffd700;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    border: 2px solid #ffd700;
    min-width: 60px;
    justify-content: center;
}

.lifeline-timer-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lifeline-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: auto;
}

/* Inline Audience Results */
.audience-results-inline {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: 20px;
}

.audience-results-inline .audience-option {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
}

.audience-results-inline .audience-letter {
    font-weight: bold;
    color: #ffd700;
    min-width: 20px;
}

.audience-results-inline .audience-bar {
    width: 40px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.audience-results-inline .audience-bar-fill {
    height: 100%;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.audience-results-inline .audience-percentage {
    font-weight: bold;
    color: #ffd700;
    font-size: 0.85rem;
    min-width: 30px;
}

/* Adjust game content when lifeline bars are active */
body:has(.lifeline-bar.active) .game-header {
    margin-top: 80px;
}

/* Fallback for browsers that don't support :has() */
.lifeline-active .game-header {
    margin-top: 80px;
}

/* Old Modal Styles (keeping for backward compatibility) */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.timer-display {
    font-size: 2rem;
    color: #ffd700;
    margin: 20px 0;
    font-weight: bold;
}

.timer-section {
    text-align: center;
    padding: 20px 0;
}

.timer-section .timer-display {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    border-radius: 15px;
    border: 2px solid #ffd700;
    margin: 20px 0;
    display: inline-block;
}

.timer-section .modal-actions {
    margin-top: 20px;
}

.modal-actions {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Audience Results */
.audience-results {
    margin: 20px 0;
    text-align: left;
}

.audience-option {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
}

.audience-letter {
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 15px;
    min-width: 25px;
    color: #ffd700;
}

.audience-bar {
    flex: 1;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    margin-right: 15px;
}

.audience-bar-fill {
    height: 100%;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.audience-percentage {
    font-weight: bold;
    min-width: 40px;
    color: #ffd700;
}

/* Loading Screen */
.loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-screen.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 215, 0, 0.3);
    border-top: 5px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content p {
    color: #ffd700;
    font-size: 1.2rem;
}

/* Responsive Design - Auto-resize to window */

/* Use dynamic viewport units for better scaling */
.game-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.welcome-content h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.question-text {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
}

.answer-btn {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    padding: clamp(10px, 2vh, 16px);
    min-height: clamp(45px, 6vh, 60px);
}

.answer-label {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
}

/* Game layout responsive */
.game-layout {
    height: 100%;
    padding: clamp(10px, 2vw, 20px);
    gap: clamp(20px, 3vw, 30px);
}

.question-panel, .money-panel {
    padding: clamp(20px, 3vw, 30px);
}

/* Money ladder scaling */
.money-step {
    padding: clamp(8px, 1.5vh, 12px) clamp(15px, 2.5vw, 20px);
    font-size: clamp(0.8rem, 1.5vw, 1rem);
}

.step-amount {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

/* Lifeline buttons scaling */
.lifeline-btn {
    width: clamp(50px, 8vw, 60px);
    height: clamp(50px, 8vw, 60px);
    font-size: clamp(12px, 2vw, 14px);
}

/* Large screens (desktops) */
@media (min-width: 1400px) {
    .game-layout {
        max-width: 90vw;
    }
    
    .welcome-content {
        max-width: 60vw;
    }
}

/* Medium-large screens - Hide money panel to prioritize game content */
@media (max-width: 800px) {
    .game-layout {
        grid-template-columns: 1fr;
        gap: clamp(10px, 2vh, 20px);
    }
    
    .money-panel {
        display: none;
    }
    
    .money-ladder {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: clamp(5px, 1vh, 8px);
    }
    
    .money-step {
        min-width: clamp(100px, 15vw, 140px);
        flex: 0 0 auto;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .game-header {
        padding: clamp(8px, 2vh, 12px);
    }
    
    .admin-link {
        position: static;
        margin-top: 6px;
    }
    
    .answers-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        gap: clamp(4px, 0.8vh, 8px);
        min-height: clamp(120px, 24vh, 180px);
        max-height: 30vh;
    }
    
    .question-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .lifelines {
        justify-content: center;
        gap: clamp(10px, 2vw, 15px);
    }
    
    .welcome-content {
        padding: clamp(20px, 5vw, 40px);
        margin: clamp(10px, 3vw, 20px);
    }
    
    .result-content {
        padding: clamp(20px, 5vw, 40px);
        margin: clamp(10px, 3vw, 20px);
    }
    
    .final-amount {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .modal-content {
        padding: clamp(20px, 5vw, 40px);
        width: clamp(280px, 90vw, 500px);
    }
    
    .money-ladder {
        max-height: 25vh;
        overflow-y: auto;
    }
    
    .money-step {
        min-width: clamp(90px, 20vw, 120px);
        font-size: clamp(0.7rem, 2vw, 0.9rem);
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .screen {
        padding: clamp(10px, 3vw, 20px);
    }
    
    .game-title {
        letter-spacing: 1px;
    }
    
    .question-text {
        padding: clamp(15px, 4vw, 25px);
    }
    
    .answer-btn {
        padding: clamp(6px, 1.2vh, 10px);
        gap: clamp(4px, 1.2vw, 8px);
        font-size: clamp(0.65rem, 1.8vw, 0.8rem);
    }
    
    .answer-text {
        font-size: clamp(0.6rem, 1.6vw, 0.75rem);
        -webkit-line-clamp: 3;
    }
    
    .lifeline-btn {
        width: clamp(45px, 10vw, 55px);
        height: clamp(45px, 10vw, 55px);
    }
    
    .rules {
        padding: clamp(15px, 4vw, 20px);
    }
    
    .modal-content {
        margin: clamp(20px, 5vh, 40px);
    }
    
    .btn-large {
        padding: clamp(15px, 4vw, 20px) clamp(25px, 6vw, 40px);
        font-size: clamp(1rem, 3vw, 1.2rem);
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .money-step {
        min-width: 80px;
        padding: 6px 12px;
        font-size: 0.7rem;
    }
    
    .lifelines {
        flex-wrap: wrap;
    }
    
    .answer-btn {
        min-height: 50px;
        padding: 12px;
    }
}

/* Hide money panel on smaller heights to ensure answers are visible */
@media (max-height: 600px) {
    .money-panel { display: none; }
}

/* Additional height constraints for better answer visibility */
@media (max-height: 600px) {
    .question-content {
        flex: 1;
        min-height: 0;
    }
    
    .question-text {
        max-height: 12vh;
        font-size: clamp(0.9rem, 2vw, 1.1rem);
    }
    
    .question-image {
        max-height: clamp(120px, 20vh, 200px);
    }
    
    .answers-grid {
        min-height: clamp(100px, 22vh, 140px);
        max-height: 25vh;
    }
    
    .answer-btn {
        font-size: clamp(0.6rem, 1.4vw, 0.75rem);
        padding: clamp(3px, 0.6vh, 6px);
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .game-header {
        padding: 8px 12px;
    }
    
    .game-title {
        font-size: clamp(1rem, 2.5vh, 1.4rem);
    }
    
    .screen {
        padding: 10px;
    }
    
    .welcome-content {
        padding: 20px;
    }
    
    .question-panel {
        padding: 20px;
        gap: 15px;
    }
    
    .money-panel {
        padding: 15px;
    }
    
    .money-ladder {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: 20vh;
    }
    
    .money-step {
        min-width: 90px;
        padding: 6px 12px;
    }
}

/* High resolution displays */
@media (min-resolution: 2dppx) {
    .question-image {
        max-height: 250px;
    }
}

/* Auto-adjust text based on available space */
@container (max-width: 600px) {
    .question-text {
        font-size: 1.1rem;
    }
    
    .answer-btn {
        font-size: 0.95rem;
    }
}

/* Copyright Notice */
.copyright {
    position: fixed;
    bottom: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    z-index: 1000;
    pointer-events: none;
    user-select: none;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .copyright {
        font-size: 0.6rem;
        padding: 3px 6px;
        bottom: 8px;
        right: 10px;
    }
}

/* Fireworks Animation */
.fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1500;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: firework 2s ease-out forwards;
}

@keyframes firework {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(15) rotate(360deg);
        opacity: 0;
    }
}

.firework-spark {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    opacity: 1;
}

.firework-gold { background: radial-gradient(circle, #ffd700, #ffed4e); }
.firework-red { background: radial-gradient(circle, #ff6b6b, #ff5722); }
.firework-blue { background: radial-gradient(circle, #4dabf7, #2196f3); }
.firework-green { background: radial-gradient(circle, #51cf66, #4caf50); }
.firework-purple { background: radial-gradient(circle, #b197fc, #9c27b0); }
.firework-orange { background: radial-gradient(circle, #ffa726, #ff9800); }

@keyframes spark {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--end-x, 0), var(--end-y, 0)) scale(0);
    }
}

.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1400;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    opacity: 0;
    animation: celebration-glow 3s ease-in-out infinite;
}

@keyframes celebration-glow {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Image Modal Styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-overlay {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.expanded-image {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: block;
}

.image-modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 40px;
    height: 40px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 2001;
}

.image-modal-close:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Make question images clickable */
.question-image {
    cursor: pointer;
    transition: all 0.3s ease;
}

.question-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
    border: 2px solid rgba(255, 215, 0, 0.5);
}

/* Add click hint for images */
.question-image-container {
    position: relative;
}

.question-image-container::after {
    content: "🔍 Click to expand";
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.question-image-container:hover::after {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile optimizations for image modal */
@media (max-width: 768px) {
    .image-modal-content {
        padding: 15px;
        margin: 10px;
    }
    
    .expanded-image {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .image-modal-close {
        top: -5px;
        right: -5px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .question-image-container::after {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}
