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

body {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace;
}

#game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-container {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

/* Bottom Bar Layout */
#bottom-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

#lives-display {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    background: rgba(0, 20, 40, 0.8);
    border: 2px solid #00ffff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.lives-label {
    color: #00ff00;
    font-size: 24px;
    font-weight: bold;
    margin-right: 15px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

#lives-icons {
    display: flex;
    gap: 10px;
}

.life-icon {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid #00ff00;
    filter: drop-shadow(0 0 5px rgba(0, 255, 0, 0.6));
}

/* Power-Up Indicators */
.powerup-indicator {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid #444;
    border-radius: 8px;
    min-width: 100px;
    justify-content: center;
    gap: 10px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.powerup-indicator.active {
    opacity: 1;
    animation: powerupPulse 1s ease-in-out infinite;
}

#shield-indicator.active {
    border-color: #00aaff;
    background: rgba(0, 100, 180, 0.4);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.6);
}

#rapid-indicator.active {
    border-color: #ffaa00;
    background: rgba(180, 100, 0, 0.4);
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
}

#double-indicator.active {
    border-color: #00ff00;
    background: rgba(0, 180, 0, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

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

.powerup-icon {
    font-size: 24px;
    font-weight: bold;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #666;
}

.shield-icon {
    background: rgba(0, 100, 180, 0.3);
    border: 2px solid #00aaff;
    color: #00aaff;
}

.rapid-icon {
    background: rgba(180, 100, 0, 0.3);
    border: 2px solid #ffaa00;
    color: #ffaa00;
}

.double-icon {
    background: rgba(0, 180, 0, 0.3);
    border: 2px solid #00ff00;
    color: #00ff00;
}

.powerup-indicator.active .powerup-icon {
    color: #fff;
}

.powerup-timer {
    color: #00ff00;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.6);
    min-width: 30px;
}

/* Start Screen */
#start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 100, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(255, 0, 100, 0.1) 0%, transparent 50%),
        #000;
    animation: backgroundPulse 8s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.title-container {
    text-align: center;
    margin-bottom: 40px;
}

/* Retro 3D Title */
.game-title {
    font-size: 96px;
    font-weight: bold;
    letter-spacing: 8px;
    margin: 0;
    background: linear-gradient(180deg, #00ffff 0%, #0088ff 50%, #0044ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow:
        3px 3px 0px #ff00ff,
        6px 6px 0px #ff0088,
        9px 9px 0px #aa0066,
        12px 12px 0px #660044,
        15px 15px 20px rgba(0, 0, 0, 0.8);
    animation: titleFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.5));
}

@keyframes titleFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 24px;
    color: #ff00ff;
    letter-spacing: 6px;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
    animation: subtitleGlow 2s ease-in-out infinite;
}

@keyframes subtitleGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Instructions */
.instructions {
    background: rgba(0, 20, 40, 0.85);
    border: 3px solid #00ffff;
    border-radius: 15px;
    padding: 30px 40px;
    margin-bottom: 40px;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.4),
        inset 0 0 20px rgba(0, 100, 255, 0.2);
    max-width: 900px;
}

.instructions h2 {
    text-align: center;
    color: #00ffff;
    font-size: 32px;
    margin: 0 0 30px 0;
    letter-spacing: 4px;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.instruction-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.instruction-column h3 {
    color: #ff00ff;
    font-size: 20px;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.6);
}

.instruction-column p {
    color: #00ff88;
    font-size: 16px;
    margin: 8px 0;
    line-height: 1.6;
}

.instruction-column strong {
    color: #ffff00;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
}

/* Start Button */
.retro-button {
    background: linear-gradient(180deg, #ff00ff 0%, #aa00aa 100%);
    border: 4px solid #00ffff;
    border-radius: 10px;
    padding: 20px 60px;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    box-shadow:
        0 0 30px rgba(255, 0, 255, 0.6),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255, 0, 255, 0.6);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 50px rgba(255, 0, 255, 0.9);
    }
}

.retro-button:hover {
    background: linear-gradient(180deg, #ff44ff 0%, #cc00cc 100%);
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.9);
}

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

.button-text {
    letter-spacing: 3px;
}

.tip {
    color: #ffaa00;
    font-size: 18px;
    font-style: italic;
    margin-top: 30px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.6);
}

/* Problem Type Selector */
.problem-selector-container {
    margin: 30px 0;
    text-align: center;
}

.problem-selector-container h3 {
    color: #00ffff;
    font-size: 24px;
    letter-spacing: 3px;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
}

.problem-type-grid {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.problem-type-column {
    background: rgba(0, 20, 40, 0.85);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 20px;
    min-width: 280px;
    text-align: left;
}

.problem-type-column h4 {
    color: #ff00ff;
    font-size: 18px;
    letter-spacing: 2px;
    margin: 0 0 15px 0;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.6);
}

.problem-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin: 5px 0;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    position: relative;
}

.problem-checkbox:hover {
    background: rgba(0, 255, 255, 0.1);
}

.problem-checkbox input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #666;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.problem-checkbox input:checked + .checkbox-custom {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.2);
}

.problem-checkbox input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #00ff00;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    flex: 1;
}

.checkbox-desc {
    color: #888;
    font-size: 12px;
    font-style: italic;
}

.column-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.select-all-btn,
.deselect-all-btn {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-all-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #00ffff;
    color: #00ffff;
}

.select-all-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.deselect-all-btn {
    background: rgba(255, 0, 100, 0.1);
    border: 2px solid #ff0066;
    color: #ff0066;
}

.deselect-all-btn:hover {
    background: rgba(255, 0, 100, 0.3);
    box-shadow: 0 0 15px rgba(255, 0, 100, 0.5);
}

/* Floating Title Bar */
#floating-title-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 10, 30, 0.95);
    border-bottom: 3px solid #00ffff;
    padding: 10px 0;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    z-index: 100;
}

.game-title-floating {
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 6px;
    margin: 0;
    background: linear-gradient(180deg, #00ffff 0%, #0088ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow:
        2px 2px 0px #ff00ff,
        4px 4px 0px #ff0088,
        6px 6px 10px rgba(0, 0, 0, 0.5);
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4));
}

/* Game Info Bar */
#game-info-bar {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(0, 30, 60, 0.95);
    border: 3px solid #00ffff;
    border-radius: 8px;
    padding: 12px 24px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    z-index: 200;
}

#grade-display {
    color: #00ffaa;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(0, 255, 170, 0.8);
}

#grade-text {
    color: #ffff00;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.8);
}

#game-wrapper {
    position: relative;
    padding-top: 60px;
}

/* Responsive */
@media (max-width: 900px) {
    .game-title {
        font-size: 64px;
    }

    .instruction-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .instructions {
        padding: 20px;
    }
}
