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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    touch-action: none;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 800px;
    max-height: 600px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

/* Screen Overlay Styles */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10;
    animation: fadeIn 0.5s ease-in-out;
}

.screen-content {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    max-width: 90%;
}

.game-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
    }

    to {
        filter: drop-shadow(0 0 20px rgba(118, 75, 162, 0.8));
    }
}

.game-subtitle {
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 30px;
    opacity: 0.9;
}

.instructions {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid #667eea;
}

.instructions p {
    color: #fff;
    font-size: 1rem;
    margin: 10px 0;
    opacity: 0.9;
}

.game-button {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.game-button:active {
    transform: translateY(0);
}

/* Game UI */
#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.ui-top {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.line-counter,
.stage-counter {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.counter-label {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
}

.counter-value {
    color: #667eea;
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 30px;
    text-align: center;
}

/* Result Screen */
.result-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 0 0 20px currentColor;
}

.result-title.success {
    color: #4ade80;
}

.result-title.failure {
    color: #f87171;
}

.result-message {
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #gameContainer {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .game-title {
        font-size: 2.5rem;
    }

    .game-subtitle {
        font-size: 1rem;
    }

    .instructions p {
        font-size: 0.9rem;
    }

    .game-button {
        padding: 12px 30px;
        font-size: 1rem;
    }

    .result-title {
        font-size: 2rem;
    }

    .result-message {
        font-size: 1.1rem;
    }

    .screen-content {
        padding: 20px;
    }
}

@media (max-height: 600px) {
    .game-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .instructions {
        margin: 15px 0;
        padding: 10px;
    }

    .instructions p {
        margin: 5px 0;
        font-size: 0.85rem;
    }
}