/* --- Import a Modern Font --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* --- Base Styling --- */
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    overflow: hidden;
    font-family: 'Poppins', 'Arial Rounded MT Bold', 'Helvetica Rounded', Arial, sans-serif;
    /* Set a default background for welcome/setup screens */
    background-color: #1c2a44; /* Fallback color */
    background-image: linear-gradient(to bottom, #1c2a44, #304c7b);
    color: #E0F2F7;
    -webkit-tap-highlight-color: transparent;
}
canvas { display: block; width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: -1; /* Behind UI */}

/* --- Welcome Screen --- */
#welcomeScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 290; /* Below modal, above everything else initially */
    background: linear-gradient(145deg, #2a4a7a, #3f78b9);
    color: #E1F5FE;
    padding: 40px 50px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(179, 229, 252, 0.5);
    min-width: 300px;
    max-width: 80%;
    display: none; /* Hide initially, JS will show it */
    animation: welcomeFadeIn 0.6s ease-out forwards; /* Added animation */
}
#welcomeScreen h1 { margin-top: 0; margin-bottom: 15px; font-size: 2.2em; color: #FFCA28; text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5); }
#welcomeScreen p { font-size: 1.1em; margin-bottom: 30px; }
#welcomeScreen #initialStartButton { padding: 15px 35px; font-size: 1.2em; cursor: pointer; border: none; border-radius: 10px; background-color: #FFA000; color: #FFF; font-weight: bold; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease; }
#welcomeScreen #initialStartButton:hover { background-color: #FFB300; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35); }
#welcomeScreen #initialStartButton:active { transform: scale(0.97); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); }
@keyframes welcomeFadeIn { /* Added keyframes */
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}


/* --- Initially Hidden Game UI Elements --- */
body:not(.game-ui-visible) #uiContainer,
body:not(.game-ui-visible) .control-button,
body:not(.game-ui-visible) .boost-button,
body:not(.game-ui-visible) #burgerButton,
body:not(.game-ui-visible) #divider,
body:not(.game-ui-visible) canvas { display: none; }
body:not(.game-ui-visible) #menuPanel { display: none; }
body:not(.game-ui-visible) #pauseOverlay { display: none; }

/* Hide P2 elements in single-player mode */
body.single-player-mode #info-p2,
body.single-player-mode #problemContainer-p2,
body.single-player-mode #feedback-p2,
body.single-player-mode #laneHighlight-p2,
body.single-player-mode #leftButton-p2,
body.single-player-mode #rightButton-p2,
body.single-player-mode #boostButton-p2,
body.single-player-mode #divider {
    display: none !important; /* Important to override potential inline styles */
}
body.single-player-mode #answerText1-p2,
body.single-player-mode #answerText2-p2,
body.single-player-mode #answerText3-p2 {
    visibility: hidden !important;
}


/* --- UI Container & Positioning --- */
#uiContainer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

/* --- Base Panel Style (Info, Problem) --- */
.infoPanel, .problemContainer { position: absolute; background-color: rgba(0, 30, 60, 0.75); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.1); color: #E0F2F7; transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease, opacity 0.5s ease-out; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); pointer-events: none; display: flex; align-items: center; }
.infoPanel { top: 15px; padding: 10px 15px; line-height: 1.5; }
#info-p1 { left: 2%; }
#info-p2 { right: calc(2% + 55px); } /* Increased space from edge for burger */
.infoPanel span { display: inline-block; margin-right: 15px; font-size: 1em; } .infoPanel span:last-child { margin-right: 0; }
.infoPanel .playerPhoto { /* NEW: Player photo in info panel */
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    vertical-align: middle;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1); /* Placeholder background */
    display: inline-block;
}
.infoPanel .playerId {
    font-weight: 700; color: #FFD700;
    max-width: 100px; /* Limit width */
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis */
    vertical-align: middle; /* Align with icons */
    margin-right: 10px; /* Space before score */
}
.infoPanel .scoreDisplay::before { content: "🏆 "; opacity: 0.8; }
.infoPanel .coinDisplay { color: #FFD700; font-weight: 600; }
.infoPanel .speedDisplay::before { content: "⚡ "; opacity: 0.8; }
.infoPanel .questionCounter { font-weight: 600; }
.infoPanel.pop { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.1); }

/* --- Problem Container Specifics --- */
.problemContainer { top: 80px; padding: 12px 25px; border: 1px solid rgba(255, 160, 0, 0.5); opacity: 0; transform: translateY(-20px) translateX(-50%); transition: opacity 0.4s ease-out, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
#problemContainer-p1 { left: 25%; } #problemContainer-p2 { left: 75%; }
/* Adjust problem position in single player */
body.single-player-mode #problemContainer-p1 { left: 50%; }
.problemContainer.show { opacity: 1; transform: translateY(0) translateX(-50%); }
.problemDisplay { color: #FFFFFF; font-size: 36px; font-weight: 700; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6); margin: 0; line-height: 1; text-align: center; }

/* --- Answer Text --- */
.answerText { position: absolute; z-index: 101; background-color: rgba(255, 255, 180, 0.92); color: #5D4037; border: none; border-radius: 50%; font-size: 28px; font-weight: 700; width: 55px; height: 55px; display: flex; justify-content: center; align-items: center; padding: 0; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); pointer-events: none; visibility: hidden; opacity: 0; transform-origin: center bottom; transform: translate(-50%, -100%) scale(0.3); transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.15s linear; white-space: nowrap; }
@keyframes pulse { 0% { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); transform: translate(-50%, -100%) scale(var(--current-scale, 1));} 50% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); transform: translate(-50%, -100%) scale(calc(var(--current-scale, 1) * 1.05)); } 100% { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); transform: translate(-50%, -100%) scale(var(--current-scale, 1));} }

/* --- Feedback Display --- */
.feedbackDisplay { position: absolute; bottom: 18%; left: 50%; z-index: 110; padding: 15px 30px; border-radius: 25px; font-size: 30px; font-weight: 700; border: none; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); opacity: 0; pointer-events: none; display: flex; align-items: center; white-space: nowrap; transform: translate(-50%, 20px) scale(0.7); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease-out; }
#feedback-p1 { left: 25%; } #feedback-p2 { left: 75%; }
/* Adjust feedback position in single player */
body.single-player-mode #feedback-p1 { left: 50%; }
.feedbackDisplay.show { opacity: 1; transform: translate(-50%, 0) scale(1.0); }
.feedbackDisplay .icon { margin-right: 12px; font-size: 1.2em; line-height: 1; }
.feedbackDisplay.correct { background: linear-gradient(135deg, #66BB6A, #4CAF50); color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.4); }
.feedbackDisplay.incorrect { background: linear-gradient(135deg, #EF5350, #E53935); color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.4); }

/* --- Subtle Screen Glow Effect --- */
body::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1; opacity: 0; transition: opacity 0.15s linear; }
body.flash-correct-p1::after { background: radial-gradient(ellipse at 25% 50%, rgba(102, 187, 106, 0.4) 0%, rgba(102, 187, 106, 0) 70%); opacity: 1; }
body.flash-incorrect-p1::after { background: radial-gradient(ellipse at 25% 50%, rgba(239, 83, 80, 0.4) 0%, rgba(239, 83, 80, 0) 70%); opacity: 1; }
body.flash-correct-p2::after { background: radial-gradient(ellipse at 75% 50%, rgba(102, 187, 106, 0.4) 0%, rgba(102, 187, 106, 0) 70%); opacity: 1; }
body.flash-incorrect-p2::after { background: radial-gradient(ellipse at 75% 50%, rgba(239, 83, 80, 0.4) 0%, rgba(239, 83, 80, 0) 70%); opacity: 1; }
/* Adjust flash position in single player */
body.single-player-mode.flash-correct-p1::after { background: radial-gradient(ellipse at 50% 50%, rgba(102, 187, 106, 0.4) 0%, rgba(102, 187, 106, 0) 70%); }
body.single-player-mode.flash-incorrect-p1::after { background: radial-gradient(ellipse at 50% 50%, rgba(239, 83, 80, 0.4) 0%, rgba(239, 83, 80, 0) 70%); }


/* --- Lane Highlight --- */
.laneHighlightDisplay { position: absolute; bottom: 0.5%; width: 60px; height: 15px; background: radial-gradient(ellipse at center bottom, rgba(255, 235, 59, 0.8) 0%, rgba(255, 235, 59, 0) 70%); border-radius: 50% 50% 0 0 / 100% 100% 0 0; transform: translateX(-50%) perspective(10px) rotateX(5deg); transition: left 0.15s cubic-bezier(0.25, 0.8, 0.25, 1); z-index: 5; visibility: hidden; pointer-events: none; border: none; }

/* --- Divider --- */
#divider {
    position: absolute; top: 0; left: 50%;
    width: 30px; /* <<< CHANGED: Increased width */
    height: 100%;
    /* background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%); */ /* Removed gradient */
    background-color: rgba(0, 30, 60, 0.75); /* <<< CHANGED: Solid background */
    /* box-shadow: 0 0 3px rgba(255,255,255,0.2); */ /* Removed shadow */
    transform: translateX(-50%); z-index: 120; pointer-events: none;
}

/* --- Progress Tracker --- */
#progress-tracker-container {
    position: relative;
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 10px 2px;
    box-sizing: border-box;
}

.finish-line-marker {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    z-index: 5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.progress-track {
    position: relative;
    width: 6px;
    height: calc(100% - 20px);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #999;
    border: 2px solid rgba(255, 255, 255, 0.8);
    transition: bottom 0.5s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

#p1-progress-indicator {
    transform: translateX(-75%);
}

#p2-progress-indicator {
    transform: translateX(-25%);
}

.progress-indicator.leader-indicator {
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes leader-pulse-p1 {
    0% { transform: translateX(-75%) scale(1); }
    100% { transform: translateX(-75%) scale(1.1); }
}

@keyframes leader-pulse-p2 {
    0% { transform: translateX(-25%) scale(1); }
    100% { transform: translateX(-25%) scale(1.1); }
}

#p1-progress-indicator.leader-indicator {
    animation: leader-pulse-p1 1.5s ease-in-out infinite alternate;
}

#p2-progress-indicator.leader-indicator {
    animation: leader-pulse-p2 1.5s ease-in-out infinite alternate;
}


/* --- Control Buttons --- */
.control-button { position: absolute; bottom: 20px; width: 60px; height: 60px; font-size: 30px; font-weight: bold; color: rgba(255, 255, 255, 0.95); background-image: linear-gradient(to bottom, #448AFF, #2962FF); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 15px; cursor: pointer; z-index: 150; pointer-events: auto; user-select: none; -webkit-user-select: none; -ms-user-select: none; display: flex; justify-content: center; align-items: center; padding-bottom: 0; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 -2px 3px rgba(0,0,0,0.2); transition: transform 0.1s ease, background-image 0.2s ease, box-shadow 0.1s ease; }
.control-button:hover { background-image: linear-gradient(to bottom, #5393ff, #3a70ff); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35), inset 0 -2px 3px rgba(0,0,0,0.2); }
.control-button:active { background-image: linear-gradient(to top, #448AFF, #2962FF); transform: scale(0.92) translateY(1px); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(0,0,0,0.3); }
#leftButton-p1 { left: 4%; } #rightButton-p1 { left: calc(4% + 70px); }
#rightButton-p2 { right: 4%; } #leftButton-p2 { right: calc(4% + 70px); }

/* --- Boost Buttons --- */
.boost-button { position: absolute; bottom: 90px; width: 80px; height: 50px; font-size: 14px; font-weight: bold; color: rgba(255, 255, 255, 0.95); background-image: linear-gradient(to bottom, #FF6B35, #FF4500); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 12px; cursor: pointer; z-index: 150; pointer-events: auto; user-select: none; -webkit-user-select: none; -ms-user-select: none; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 5px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 -2px 3px rgba(0,0,0,0.2); transition: transform 0.1s ease, background-image 0.2s ease, box-shadow 0.1s ease, opacity 0.2s ease; text-align: center; line-height: 1.1; }
.boost-button:hover:not(.disabled) { background-image: linear-gradient(to bottom, #FF7B45, #FF5500); box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35), inset 0 -2px 3px rgba(0,0,0,0.2); }
.boost-button:active:not(.disabled) { background-image: linear-gradient(to top, #FF6B35, #FF4500); transform: scale(0.92) translateY(1px); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(0,0,0,0.3); }
.boost-button.disabled { opacity: 0.4; cursor: not-allowed; background-image: linear-gradient(to bottom, #888, #666); }
.boost-button .boost-cost { font-size: 10px; margin-top: 2px; }
#boostButton-p1 { left: calc(4% + 20px); } 
#boostButton-p2 { right: calc(4% + 20px); }

/* --- Power-Up Button --- */
.power-up-button { 
    position: absolute; 
    bottom: 90px; 
    width: 50px; 
    height: 50px; 
    font-size: 24px; 
    color: rgba(255, 255, 255, 0.95); 
    background-image: linear-gradient(to bottom, #4CAF50, #388E3C); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 50%; 
    cursor: pointer; 
    z-index: 150; 
    pointer-events: auto; 
    user-select: none; 
    -webkit-user-select: none; 
    -ms-user-select: none; 
    display: none; 
    justify-content: center; 
    align-items: center; 
    padding: 5px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 -2px 3px rgba(0,0,0,0.2); 
    transition: transform 0.1s ease, background-image 0.2s ease, box-shadow 0.1s ease; 
}
.power-up-button:hover { 
    background-image: linear-gradient(to bottom, #66BB6A, #4CAF50); 
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35), inset 0 -2px 3px rgba(0,0,0,0.2); 
}
.power-up-button:active { 
    background-image: linear-gradient(to top, #4CAF50, #388E3C); 
    transform: scale(0.92) translateY(1px); 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(0,0,0,0.3); 
}
#powerUpButton-p1 { left: calc(4% + 150px); } 
#powerUpButton-p2 { right: calc(4% + 150px); }

/* --- Modal --- */
#modal { position: absolute; top: 50%; left: 50%; background: linear-gradient(145deg, #2a4a7a, #3f78b9); color: #E1F5FE; padding: 30px 40px; border-radius: 15px; text-align: center; z-index: 300; display: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); border: 1px solid rgba(179, 229, 252, 0.5); min-width: 350px; max-width: 550px; max-height: 90vh; overflow-y: auto; opacity: 0; transform: translate(-50%, -50%) scale(0.8); transition: opacity 0.4s ease-out, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
#modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#modal h2 { margin-top: 0; margin-bottom: 20px; font-size: 28px; color: #FFCA28; text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5); }
#modal p#modalText { font-size: 16px; margin: 15px 0; line-height: 1.5; color: #B3E5FC; }
/* --- Winner Announcement --- */
#winnerAnnouncement {
    background: linear-gradient(45deg, #FFD700, #FFA000);
    color: #424242;
    padding: 15px 25px;
    border-radius: 10px;
    margin: -10px auto 25px auto; /* Pulls up slightly, adds space below */
    display: flex; /* Use flexbox for alignment */
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Vertically center items (now horizontally due to column) */
    justify-content: center; /* Center items horizontally (now vertically due to column) */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 2px solid #FFF;
    animation: winnerPulse 1.5s infinite ease-in-out;
    position: relative; /* Needed for confetti and stars */
    overflow: hidden; /* Keep confetti/stars contained initially */
    z-index: 1; /* Above results table */
}
#winnerPhoto { /* Winner photo */
    width: 150px; /* Larger size */
    height: 150px; /* Larger size */
    border-radius: 50%;
    object-fit: cover;
    margin: 20px auto; /* Center horizontally with margin */
    border: 4px solid #FFF; /* Thicker border */
    background-color: rgba(255, 255, 255, 0.2); /* Placeholder background */
    display: none; /* Hide by default */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Add shadow for depth */
}
@keyframes winnerPulse {
    0% { transform: scale(1); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); }
    50% { transform: scale(1.03); box-shadow: 0 8px 25px rgba(255, 193, 7, 0.5); } /* Slightly smaller pulse */
    100% { transform: scale(1); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); }
}
/* --- Confetti --- */
.confetti-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti {
    position: absolute;
    width: 10px; /* Slightly larger */
    height: 18px; /* Slightly larger */
    background-color: #f00;
    opacity: 0;
    animation: confetti-fall 4s linear infinite; /* Slower fall */
    border-radius: 2px; /* Slightly rounded */
}
.confetti:nth-child(odd) { background-color: #0f0; }
.confetti:nth-child(3n) { background-color: #00f; }
.confetti:nth-child(4n) { background-color: #ff0; }
.confetti:nth-child(5n) { background-color: #f0f; }
.confetti:nth-child(6n) { background-color: #0ff; }
.confetti:nth-child(7n) { background-color: #ffa500; }
.confetti:nth-child(8n) { background-color: #ff4500; }
.confetti:nth-child(9n) { background-color: #adff2f; }
.confetti:nth-child(10n) { background-color: #da70d6; }
.confetti:nth-child(11n) { background-color: #1E90FF; } /* Dodger Blue */
.confetti:nth-child(12n) { background-color: #FF69B4; } /* Hot Pink */
.confetti:nth-child(13n) { background-color: #7FFF00; } /* Chartreuse */

@keyframes confetti-fall {
    0% { transform: translateY(-50px) rotateZ(0deg) rotateY(0deg); opacity: 1; } /* Start higher */
    100% {
        transform: translateY(250px) rotateZ(720deg) rotateY(360deg); /* Fall further, add Y rotation */
        opacity: 0;
    }
}
/* --- Celebration Stars --- */
.star {
    position: absolute;
    font-size: 20px; /* Star size */
    color: #FFEB3B; /* Yellow star */
    opacity: 0;
    animation: pop-star 0.8s ease-out forwards;
    pointer-events: none;
    z-index: 1; /* Above confetti */
    text-shadow: 0 0 5px rgba(255, 235, 59, 0.7);
}

@keyframes pop-star {
    0% { transform: scale(0.5) translateY(10px); opacity: 0.5; }
    50% { transform: scale(1.2) translateY(-5px); opacity: 1; }
    100% { transform: scale(1) translateY(-15px); opacity: 0; }
}

/* Trigger class */
#winnerAnnouncement.celebrate .confetti { opacity: 1; }
/* Stars will be added/animated via JS */

#modal #results { margin: 20px 0; text-align: left; display: inline-block; }
#modal #results table { width: 100%; border-collapse: collapse; }
#modal #results th, #modal #results td { padding: 8px 12px; text-align: left; border-bottom: 1px solid rgba(179, 229, 252, 0.3); }
#modal #results th { color: #FFECB3; font-weight: 600;}
#modal #results tr:last-child td { border-bottom: none; }
#modal button#restartButton { padding: 12px 25px; font-size: 18px; cursor: pointer; margin-top: 20px; border: none; border-radius: 10px; background-color: #FFA000; color: #FFF; font-weight: bold; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease; }
#modal button#restartButton:hover { background-color: #FFB300; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35); }
#modal button#restartButton:active { transform: scale(0.96); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); }

/* --- Setup Form Styles --- */
#setupForm { text-align: left; margin-top: 15px; position: relative; /* Needed for absolute positioning of steps */ overflow: hidden; /* Hide steps sliding out */ min-height: 350px; /* Ensure space for content */ }
.form-step {
    position: absolute; /* Position steps for transitions */
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 5px; /* More padding */
    opacity: 0; /* Start hidden */
    visibility: hidden; /* Start hidden */
    transition: opacity 0.4s ease-out, visibility 0.4s; /* UPDATED: Only fade and visibility */
    background-color: rgba(42, 74, 122, 0.3); /* Subtle background per step */
    border-radius: 8px; /* Rounded corners for step background */
    margin-bottom: 15px; /* Space below step content before nav */
}
.form-step.active-step {
    opacity: 1;
    visibility: visible;
    position: relative; /* Take up space in normal flow */
}
/* Transition effect for previous step */
.form-step.exiting-step {
    opacity: 0;
    visibility: hidden;
    position: absolute; /* Keep it out of flow during fade */
}

#setupForm fieldset { border: none; padding: 0; margin: 0 0 20px 0; }
#setupForm legend { font-size: 1.2em; font-weight: 700; color: #FFECB3; margin-bottom: 15px; padding-bottom: 5px; border-bottom: 1px solid rgba(255, 236, 179, 0.3); display: block; width: 100%;}
#setupForm label { display: block; margin-bottom: 10px; font-size: 1em; color: #E0F2F7; cursor: pointer; }
#setupForm input[type="radio"], #setupForm input[type="checkbox"] { margin-right: 10px; vertical-align: middle; accent-color: #FFA000; transform: scale(1.1); }
#setupForm input[type="number"] { width: 80px; padding: 10px 12px; border-radius: 6px; border: 1px solid rgba(179, 229, 252, 0.5); background-color: rgba(0, 0, 0, 0.3); color: #E0F2F7; font-size: 1em; margin-left: 8px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
#setupForm input[type="number"]:focus { outline: none; border-color: #FFA000; box-shadow: 0 0 5px rgba(255, 160, 0, 0.5); }
#setupForm input[type="text"] {
    width: calc(100% - 24px); /* Full width minus padding */
    padding: 12px; /* More padding */
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid rgba(179, 229, 252, 0.5);
    background-color: rgba(0, 0, 0, 0.3); /* Darker background */
    color: #E0F2F7;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#setupForm input[type="text"]:focus {
     outline: none; border-color: #FFA000; box-shadow: 0 0 5px rgba(255, 160, 0, 0.5);
}
#setupForm input[type="file"] {
    display: block; /* Make it block level */
    margin-top: 8px;
    margin-bottom: 15px;
    color: #B3E5FC; /* Style file input text */
    font-size: 0.95em;
}
#setupForm input[type="file"]::file-selector-button {
    padding: 8px 15px;
    border-radius: 6px;
    border: 1px solid rgba(179, 229, 252, 0.5);
    background-color: #448AFF;
    color: #FFF;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-right: 12px;
}
#setupForm input[type="file"]::file-selector-button:hover {
    background-color: #5393ff;
}
.image-preview-container {
    width: 90px; /* Slightly larger */
    height: 90px;
    border: 2px dashed rgba(179, 229, 252, 0.5); /* Thicker dash */
    border-radius: 50%; /* Make it circular */
    margin-top: 8px;
    margin-bottom: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Clip the image */
    background-color: rgba(0, 0, 0, 0.15); /* Slightly darker */
    transition: border-color 0.2s ease;
}
.image-preview-container:hover {
    border-color: #FFA000;
}
.image-preview {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: cover; /* Cover the area, cropping if needed */
}
.image-preview-placeholder {
    font-size: 0.85em;
    color: #B3E5FC;
    text-align: center;
}
#setupForm .param-group { display: none; margin-top: 15px; padding: 15px; border-left: 3px solid rgba(255, 160, 0, 0.6); margin-bottom: 15px; background-color: rgba(0,0,0,0.1); border-radius: 0 6px 6px 0; }
#setupForm .param-group label { display: inline-block; width: auto; margin-right: 10px; margin-bottom: 8px; }
#setupForm .param-group div { margin-bottom: 12px; }
#setupForm .car-selection-group { margin-bottom: 20px; padding: 15px; background-color: rgba(255, 255, 255, 0.08); border-radius: 8px; }
#setupForm .car-selection-group p { font-weight: 600; color: #FFECB3; margin-bottom: 10px; font-size: 1.05em; }
#setupForm .car-selection-group label { display: inline-block; margin-right: 15px; vertical-align: middle; }

/* Max Result Feature Styles */
#maxResultContainer {
    display: none;
    margin-top: 10px;
    padding-left: 25px;
    border-left: 2px solid rgba(255, 236, 179, 0.4);
}

#limitMaxResult:checked ~ #maxResultContainer {
    display: block;
}

.param-option-toggle {
    margin-top: 20px;
}

.param-option-toggle label[for="limitMaxResult"] {
    display: inline-block;
    margin-bottom: 10px;
    cursor: pointer;
}
#setupForm .car-selection-group select { padding: 10px 15px; border-radius: 6px; border: 1px solid rgba(179, 229, 252, 0.5); background-color: rgba(0, 0, 0, 0.3); color: #E0F2F7; font-size: 1em; font-family: inherit; vertical-align: middle; cursor: pointer; min-width: 130px; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
#setupForm .car-selection-group select:focus { outline: none; border-color: #FFA000; box-shadow: 0 0 5px rgba(255, 160, 0, 0.5); }

.form-navigation { margin-top: 30px; display: flex; justify-content: space-between; padding: 0 5px; } /* Added padding */
.form-navigation button { padding: 12px 25px; font-size: 1.05em; cursor: pointer; border: none; border-radius: 8px; background-color: #448AFF; color: #FFF; font-weight: 600; box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3); transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease; }
.form-navigation button:hover { background-color: #5393ff; box-shadow: 0 4px 9px rgba(0, 0, 0, 0.35); }
.form-navigation button:active { transform: scale(0.97); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); }
.form-navigation button:disabled { background-color: #78909C; color: #CFD8DC; cursor: not-allowed; box-shadow: none; }
.form-navigation button#startSetupButton { background-color: #FFA000; }
.form-navigation button#startSetupButton:hover { background-color: #FFB300; }
#errorMessage { color: #FF8A80; font-weight: bold; margin-top: 20px; min-height: 1.2em; text-align: center; font-size: 0.95em; }

/* --- Burger Menu --- */
.burger-button { position: fixed; top: 15px; right: 15px; width: 45px; height: 35px; display: flex; flex-direction: column; justify-content: space-around; background: rgba(0, 30, 60, 0.75); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; cursor: pointer; padding: 6px 8px; z-index: 250; pointer-events: auto; box-shadow: 0 2px 5px rgba(0,0,0,0.2); transition: background-color 0.2s ease; }
.burger-button:hover { background: rgba(0, 40, 80, 0.85); }
.burger-button span { display: block; width: 100%; height: 3px; background-color: #E0F2F7; border-radius: 3px; transition: transform 0.3s ease, opacity 0.3s ease; }
.burger-button.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger-button.open span:nth-child(2) { opacity: 0; }
.burger-button.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.menu-panel { position: fixed; top: 0; right: 0; width: 200px; height: 100%; background: linear-gradient(160deg, #2a4a7a, #3f78b9); box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3); z-index: 240; padding: 70px 15px 20px 15px; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); pointer-events: auto; display: flex; flex-direction: column; border-left: 1px solid rgba(179, 229, 252, 0.5); }
.menu-panel.open { transform: translateX(0); }
.menu-item { background: none; border: none; color: #E0F2F7; font-family: 'Poppins', sans-serif; font-size: 1.1em; text-align: left; padding: 12px 15px; margin-bottom: 10px; border-radius: 8px; cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease; display: flex; align-items: center; }
.menu-item:hover { background-color: rgba(255, 255, 255, 0.15); color: #FFF; }
.menu-item span { margin-right: 10px; font-size: 1.2em; }

/* Pause Overlay */
.pause-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); color: #FFF; font-size: 5vw; font-weight: bold; display: flex; justify-content: center; align-items: center; z-index: 200; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; visibility: hidden; }
.pause-overlay.visible { opacity: 1; visibility: visible; }

/* --- Media Queries Adjustments --- */
@media (max-width: 800px) {
    .control-button { width: 55px; height: 55px; font-size: 28px; border-radius: 12px;}
    #leftButton-p1 { left: 3%; } #rightButton-p1 { left: calc(3% + 65px); }
    #rightButton-p2 { right: 3%; } #leftButton-p2 { right: calc(3% + 65px); }
    .boost-button { width: 70px; height: 45px; font-size: 12px; bottom: 85px; }
    #boostButton-p1 { left: calc(3% + 15px); } 
    #boostButton-p2 { right: calc(3% + 15px); }
    .power-up-button { width: 45px; height: 45px; font-size: 20px; }
    #powerUpButton-p1 { left: calc(3% + 130px); } 
    #powerUpButton-p2 { right: calc(3% + 130px); }
    .infoPanel { padding: 8px 12px; font-size: 13px; line-height: 1.4;} .infoPanel span { margin-right: 10px;}
    .infoPanel .playerPhoto { width: 28px; height: 28px; margin-right: 8px; }
    .infoPanel .playerId { max-width: 70px; }
    #info-p2 { right: calc(2% + 50px); }
    .problemContainer { padding: 10px 20px; top: 80px; }
    .problemDisplay { font-size: 30px; }
    .answerText { width: 45px; height: 45px; font-size: 22px; }
    .feedbackDisplay { font-size: 24px; padding: 12px 25px; }
    #modal { padding: 25px 30px; max-width: 95%; } #modal h2 { font-size: 26px; }
    #welcomeScreen h1 { font-size: 1.8em; } #welcomeScreen p { font-size: 1em; } #welcomeScreen #initialStartButton { font-size: 1.1em; padding: 12px 30px; }
    #winnerAnnouncement { padding: 12px 20px; margin-bottom: 20px; }
    #winnerPhoto {
        width: 80px; /* Adjusted size for smaller screens */
        height: 80px; /* Adjusted size for smaller screens */
        margin-right: 0; /* Ensure no right margin */
        margin-bottom: 8px; /* Adjusted bottom margin */
    }
    #winnerText { font-size: 1.6em; }
    .infoPanel .playerId { max-width: 80px; }
}
@media (max-width: 500px) {
    .control-button { width: 50px; height: 50px; font-size: 24px; border-radius: 10px; bottom: 15px;}
    #leftButton-p1 { left: 2%; } #rightButton-p1 { left: calc(2% + 60px); }
    #rightButton-p2 { right: 2%; } #leftButton-p2 { right: calc(2% + 60px); }
    .boost-button { width: 60px; height: 40px; font-size: 10px; bottom: 75px; }
    #boostButton-p1 { left: calc(2% + 10px); } 
    #boostButton-p2 { right: calc(2% + 10px); }
    .power-up-button { width: 40px; height: 40px; font-size: 18px; }
    #powerUpButton-p1 { left: calc(2% + 110px); } 
    #powerUpButton-p2 { right: calc(2% + 110px); }
    .infoPanel { font-size: 11px; padding: 6px 10px; border-radius: 8px; top: 15px; flex-wrap: wrap; }
    .infoPanel .playerPhoto { width: 24px; height: 24px; margin-right: 6px; }
    .infoPanel .playerId { max-width: 100%; margin-bottom: 3px; } /* Allow wrap */
    #info-p2 { right: calc(2% + 45px); }
    .problemContainer { padding: 8px 15px; border-radius: 8px; top: 75px; }
    .problemDisplay { font-size: 24px; }
    .answerText { width: 38px; height: 38px; font-size: 18px; }
    .feedbackDisplay { font-size: 18px; padding: 10px 20px; border-radius: 20px;}
    #modal { padding: 20px 25px; min-width: 280px; } #modal h2 { font-size: 24px; }
    #modal p#modalText { font-size: 14px; }
    #modal button#restartButton { font-size: 16px; padding: 10px 20px;}
    #setupForm { min-height: 300px; }
    .form-step { padding: 15px 0px; }
    #setupForm legend { font-size: 1.1em; margin-bottom: 12px; }
    #setupForm label { font-size: 0.9em;}
    #setupForm input[type="number"] { width: 65px; padding: 8px 10px;}
    #setupForm input[type="text"] { padding: 10px; }
    .form-navigation button { font-size: 0.95em; padding: 10px 18px; }
    .image-preview-container { width: 70px; height: 70px; }
    .burger-button { top: 15px; right: 15px; width: 40px; height: 30px; padding: 5px 6px; }
    .burger-button span { height: 2px;}
    .burger-button.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .burger-button.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
    .menu-panel { width: 160px; padding: 60px 10px 15px 10px;}
    .menu-item { font-size: 1em; padding: 10px 12px; }
    #welcomeScreen { padding: 30px 35px; } #welcomeScreen h1 { font-size: 1.6em; } #welcomeScreen p { font-size: 0.9em; } #welcomeScreen #initialStartButton { font-size: 1em; padding: 10px 25px; }
    #setupForm .car-selection-group label { display: block; } /* Stack label and select on small screens */
    #setupForm .car-selection-group select { min-width: 100%; margin-top: 4px;}
    #winnerAnnouncement { padding: 10px 15px; margin-bottom: 15px; }
    #winnerPhoto { width: 40px; height: 40px; margin-right: 10px; border-width: 2px; }
    #winnerText { font-size: 1.4em; }
    .image-preview-container { width: 60px; height: 60px; }
    .star { font-size: 16px; } /* Smaller stars on small screens */
}

/* --- Checkpoint UI --- */
.checkpointUI {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 250;
    display: none;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkpointUI.show {
    display: block;
    pointer-events: all;
    opacity: 1;
}

.checkpointPanel {
    background: linear-gradient(145deg, #FF6B00, #FFB300);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 3px solid #FFF;
    text-align: center;
    min-width: 300px;
    animation: checkpointBounce 0.5s ease-out;
}

@keyframes checkpointBounce {
    0% { transform: scale(0.8) translateY(-20px); opacity: 0; }
    60% { transform: scale(1.05) translateY(0); }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.checkpointPanel h3 {
    margin: 0 0 20px 0;
    font-size: 1.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse 1.2s infinite ease-in-out;
}

.checkpointProblem {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.checkpointAnswer {
    width: 100%;
    padding: 12px;
    font-size: 1.2em;
    text-align: center;
    border: 2px solid white;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.checkpointAnswer:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
}

.checkpointSubmit {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.checkpointSubmit:hover {
    background: #5CBF60;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.checkpointSubmit:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.checkpointSkip {
    padding: 10px 20px;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkpointSkip:hover {
    background: rgba(255, 255, 255, 0.3);
}

.checkpointSkip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkpointFeedback {
    margin-top: 15px;
    font-size: 1.1em;
    font-weight: bold;
    min-height: 25px;
}

.checkpointFeedback.correct {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.checkpointFeedback.incorrect {
    color: #FF5252;
    text-shadow: 0 0 10px rgba(255, 82, 82, 0.5);
}

/* Position checkpoint UI for each player - moved higher to avoid barrier overlap */
#checkpoint-p1.show {
    left: 25%;
    top: 30%; /* Higher position to avoid 3D barrier */
}

#checkpoint-p2.show {
    left: 75%;
    top: 30%; /* Higher position to avoid 3D barrier */
}

/* Single player mode - center checkpoint */
body.single-player-mode #checkpoint-p1.show {
    left: 50%;
    top: 30%;
}

body.single-player-mode #checkpoint-p2 {
    display: none !important;
}

/* --- Barrier Choice Buttons --- */
.barrierChoices {
    position: fixed;
    display: none;
    flex-direction: row;
    gap: 25px;
    z-index: 200;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 25px;
    backdrop-filter: blur(5px);
}

.barrierChoices.show {
    display: flex;
}

.choiceButton {
    width: 100px;
    height: 100px;
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(145deg, #2196F3, #1976D2);
    color: white;
    border: 4px solid #FFF;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.choiceButton:hover {
    background: linear-gradient(145deg, #42A5F5, #2196F3);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.choiceButton:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.choiceButton.correct {
    background: linear-gradient(145deg, #4CAF50, #388E3C);
    animation: correctPulse 0.6s ease-out;
}

.choiceButton.incorrect {
    background: linear-gradient(145deg, #F44336, #D32F2F);
    animation: incorrectShake 0.5s ease-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

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

/* Position barrier choices for each player - lower to avoid screen overlap */
#barrierChoices-p1.show {
    left: 25%;
    top: 80%;
}

#barrierChoices-p2.show {
    left: 75%;
    top: 80%;
}

/* Single player mode - center choices */
body.single-player-mode #barrierChoices-p1.show {
    left: 50%;
    top: 80%;
}

body.single-player-mode #barrierChoices-p2 {
    display: none !important;
}

/* --- Answer Review Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.answer-review-container {
    background: linear-gradient(145deg, #2a4a7a, #3f78b9);
    border-radius: 15px;
    max-width: 90%;
    max-height: 85%;
    width: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(179, 229, 252, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.show .answer-review-container {
    transform: scale(1);
}

.answer-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.answer-review-header h2 {
    margin: 0;
    color: #FFCA28;
    font-size: 1.8em;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.close-button {
    background: none;
    border: none;
    color: #E1F5FE;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.answer-review-tabs {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    margin-top: 15px;
}

.tab-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #E1F5FE;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.2);
    border-bottom-color: transparent;
    color: #FFCA28;
}

.answer-review-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

.answer-list {
    display: none;
}

.answer-list[data-player="p1"] {
    display: block;
}

.answer-summary {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.stat {
    color: #E1F5FE;
    font-size: 1.1em;
    font-weight: 600;
}

.answer-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.answer-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.answer-row.correct {
    border-left-color: #4CAF50;
}

.answer-row.incorrect {
    border-left-color: #f44336;
}

.answer-icon {
    font-size: 1.5em;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.answer-row.correct .answer-icon {
    color: #4CAF50;
}

.answer-row.incorrect .answer-icon {
    color: #f44336;
}

.answer-details {
    flex: 1;
}

.question-number {
    color: #FFCA28;
    font-weight: 600;
    margin-bottom: 5px;
}

.answer-result {
    color: #E1F5FE;
    font-size: 0.95em;
}

.no-answers {
    text-align: center;
    color: #E1F5FE;
    font-size: 1.1em;
    padding: 40px;
    opacity: 0.7;
}

/* Check Answers Button */
#checkAnswersButton {
    background-color: #2196F3;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#checkAnswersButton:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

#checkAnswersButton:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .answer-review-container {
        width: 95%;
        max-height: 90%;
    }
    
    .answer-review-header h2 {
        font-size: 1.4em;
    }
    
    .answer-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .answer-icon {
        align-self: flex-start;
    }
}
