body {
    margin: 0;
    padding: 20px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #87CEEB, #98FB98);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    max-width: 800px;
    width: 100%;
}

.phase-header {
    text-align: center;
    margin-bottom: 20px;
}

.phase-title {
    font-size: 2.5em;
    color: #2c3e50;
    margin: 0;
}

.timer {
    font-size: 1.5em;
    color: #e74c3c;
    margin: 10px 0;
}

/* Math Phase Styles */
.math-phase {
    text-align: center;
}

.problem-display {
    font-size: 3em;
    color: #2c3e50;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    position: relative;
    transition: background-color 0.3s ease;
}

.problem-display.correct {
    background-color: #d4edda;
}

.problem-display.incorrect {
    background-color: #f8d7da;
}

.feedback-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 2em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-icon.show {
    opacity: 1;
}

.feedback-icon.correct {
    color: #28a745;
}

.feedback-icon.incorrect {
    color: #dc3545;
}

.input-section {
    margin: 20px 0;
}

.answer-input {
    font-size: 2em;
    padding: 10px 20px;
    border: 3px solid #3498db;
    border-radius: 10px;
    text-align: center;
    width: 150px;
    transition: border-color 0.3s ease;
}

.numberpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 200px;
    margin: 20px auto;
}

.numberpad button {
    padding: 15px;
    font-size: 1.5em;
    border: none;
    border-radius: 8px;
    background: #3498db;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.numberpad button:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.numberpad button:active {
    transform: scale(0.95);
}

.numberpad .wide {
    grid-column: span 2;
}

.score-display {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    font-size: 1.3em;
}

.wind-counter {
    display: flex;
    align-items: center;
    gap: 10px;
}

#windDisplayMath, #windDisplay {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 400px;
}

.wind-point {
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    display: inline-block;
    margin: 2px;
    animation: windPointDrop 0.5s ease-out;
    border: 2px solid #2980b9;
    position: relative;
}

.wind-point::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #85C1E9;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wind-point-large {
    width: 30px;
    height: 30px;
    background: #2980b9;
    border-radius: 50%;
    display: inline-block;
    margin: 2px;
    animation: windPointDrop 0.5s ease-out;
    position: relative;
    border: 2px solid #1a5f8a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.wind-point-large::after {
    content: '10';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

@keyframes windPointDrop {
    from { 
        transform: translateY(-20px) rotate(0deg); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) rotate(360deg); 
        opacity: 1; 
    }
}

/* Flight Phase Styles */
.flight-phase {
    text-align: center;
}

.game-canvas {
    border: 3px solid #34495e;
    border-radius: 10px;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
}

.flight-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.control-button {
    padding: 15px 20px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.button-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.button-label {
    font-weight: bold;
}

.button-key {
    font-size: 0.8em;
    opacity: 0.8;
}

.wind-button {
    background: #27ae60;
    color: white;
}

.wind-button:hover:not(:disabled) {
    background: #229954;
}

.wind-button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.brake-button {
    background: #e74c3c;
    color: white;
}

.brake-button:hover {
    background: #c0392b;
}

.gauge {
    width: 120px;
    height: 60px;
    margin: 0 20px;
    position: relative;
}

.gauge-label {
    font-weight: bold;
    font-size: 0.8em;
    color: #2c3e50;
    margin-top: 5px;
}

.speed-needle {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform-origin: bottom center;
    width: 3px;
    height: 40px;
    background: #2c3e50;
    transform: translateX(-50%) rotate(-90deg);
    transition: transform 0.1s ease-out;
    z-index: 10;
    border-radius: 1px;
}

.altitude-indicator {
    font-size: 1.1em;
    color: #2c3e50;
    font-weight: bold;
}

.phase-transition {
    text-align: center;
    padding: 40px;
    font-size: 1.5em;
    color: #2c3e50;
}

.start-button {
    padding: 15px 40px;
    font-size: 1.5em;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 20px;
}

.start-button:hover {
    background: #229954;
}

.hidden {
    display: none;
}

/* Sound toggle button */
.sound-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 8px 12px;
    font-size: 1.2em;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.sound-toggle:hover {
    background: #2980b9;
}

.sound-toggle.muted {
    background: #95a5a6;
}

/* Airplane selection */
.airplane-selection {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.airplane-option {
    padding: 15px;
    border: 3px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: #ecf0f1;
}

.airplane-option:hover {
    transform: scale(1.05);
    background: #e8f4f8;
}

.airplane-option.selected {
    border-color: #3498db;
    background: #e8f4f8;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.airplane-preview {
    width: 80px;
    height: 60px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    margin: 0 auto 10px;
}

.airplane-name {
    text-align: center;
    font-size: 0.9em;
    color: #2c3e50;
    font-weight: bold;
}

/* Wind display during flight */
.wind-display-flight {
    margin: 10px 0;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2em;
}

.launch-indicator {
    background: #f39c12;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-weight: bold;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}