* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-gradient-2: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    --bg-gradient-3: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
    --bg-gradient-4: linear-gradient(135deg, #10b981 0%, #eab308 100%);
    --bg-gradient-5: linear-gradient(135deg, #eab308 0%, #f97316 100%);
    --bg-gradient-6: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
    --bg-gradient-7: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}

body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    background: var(--bg-gradient-1);
    transition: background 1s ease;
    overflow: hidden;
    color: white;
    user-select: none;
    -webkit-user-select: none;
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

/* Menu Styling */
.menu-container {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
}

.game-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.title-word {
    display: block;
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

.title-word:nth-child(2) {
    animation-delay: 0.3s;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    font-weight: 400;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 1.2rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.menu-btn:active {
    transform: translateY(-1px);
}

.menu-btn.primary {
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    color: #4f46e5;
    border: none;
}

.menu-btn.primary:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.btn-icon {
    font-size: 1.4rem;
}

/* High Score Screen */
.screen-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.high-score-display {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
}

.score-number {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(251, 191, 36, 0.3);
}

.score-label {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* About Screen */
.about-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: left;
    line-height: 1.6;
}

.about-content ul {
    list-style-position: inside;
    padding-left: 1rem;
}

.about-content li {
    margin: 0.5rem 0;
}

.warning-text {
    color: #fbbf24;
    font-weight: 600;
}

/* Game Screen */
#gameScreen {
    flex-direction: column;
    padding: 1rem;
}

.score-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.score, .high-score-small {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Game Area */
.game-area {
    flex: 1;
    width: 100%;
    max-width: 500px;
    position: relative;
    margin: 1rem 0;
}

.deadline-line {
    position: absolute;
    bottom: 30%;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        #ef4444,
        #ef4444 10px,
        transparent 10px,
        transparent 20px
    );
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    z-index: 5;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Falling Shape */
.falling-shape {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    display: none;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    animation: rotate 2s linear infinite;
}

.falling-shape.active {
    display: block;
}

.falling-shape svg {
    width: 100%;
    height: 100%;
}

@keyframes rotate {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

/* Shape colors */
.shape-green { color: #10b981; }
.shape-red { color: #ef4444; }
.shape-yellow { color: #eab308; }

/* Controls */
.controls-container {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
    padding: 0 0.5rem;
}

.controls-left, .controls-right {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.shape-btn, .color-btn {
    width: 70px;
    height: 70px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.shape-btn:active, .color-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.shape-btn.selected, .color-btn.selected {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

.shape-btn svg {
    width: 45px;
    height: 45px;
}

.color-btn {
    position: relative;
    overflow: hidden;
}

.color-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Pause Button */
.pause-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pause-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Game Over Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.overlay.active {
    display: flex;
}

.game-over-container {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
    width: 100%;
}

.game-over-title {
    font-size: 3rem;
    font-weight: 800;
    color: #ef4444;
    margin-bottom: 2rem;
    text-shadow: 0 4px 20px rgba(239, 68, 68, 0.5);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.final-score {
    margin-bottom: 2rem;
}

.new-high-score {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 2rem;
    display: none;
    animation: bounce 1s ease infinite;
}

.new-high-score.show {
    display: block;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-title {
        font-size: 3rem;
    }
    
    .shape-btn, .color-btn {
        width: 65px;
        height: 65px;
    }
    
    .falling-shape {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .shape-btn, .color-btn {
        width: 60px;
        height: 60px;
    }
    
    .falling-shape {
        width: 60px;
        height: 60px;
    }
    
    .menu-btn {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
}

/* Flash effects */
@keyframes flash-correct {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(16, 185, 129, 0.3); }
}

@keyframes flash-wrong {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(239, 68, 68, 0.3); }
}

.flash-correct {
    animation: flash-correct 0.5s ease;
}

.flash-wrong {
    animation: flash-wrong 0.5s ease;
}
