body {
    margin: 0;
    padding: 0;
    background-color: #000;
    font-family: Arial, sans-serif;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

#gameContainer {
    width: 100%;
    min-height: 95vh;
    height: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background:#5f6ca9;
    padding: 20px;
    box-sizing: border-box;
}

#firstScreen {
    background-color: #6479d7;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 20px;
    box-sizing: border-box;
}

#firstScreen h2 {
    color: #FFD700;
    font-size: 48px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 40px;
}

#firstScreen h3 {
    color: #87CEEB;
    font-size: 24px;
    font-weight: bold;
}

#firstScreen h4 {
    color: #FFFFFF;
    font-size: 18px;
    line-height: 1.5;
    font-weight: normal;
}

#startButton {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 30px;
    transition: transform 0.2s;
}

#startButton:hover {
    transform: scale(1.05);
}

#secondScreen {
    width: 100%;
    height: 100%;
    position: relative;
}

#gameStatus {
    position: absolute;
    top: 100px;
    left: 10px;
    font-size: 18px;
    color: #FFF;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
}

#gameStatus div {
    margin-bottom: 5px;
}

#gameStatus div:last-child {
    margin-bottom: 0;
}

#gameBoard {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(2, 30px);
    grid-template-rows: repeat(4, 40px);
    gap: 1px;
    background-color: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 30px;
}

.block {    
    width: 50%;
    height: 50%;
    border-radius: 1%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.block:before {
    content: '';
    position: absolute;  
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%, rgba(0,0,0,0.2) 100%);
    border-radius: 4px;
}

.block.red {
    background: linear-gradient(135deg, #FF6B6B, #E74C3C);
}

.block.blue {
    background: linear-gradient(135deg, #4ECDC4, #3498DB);
}

.block.green {
    background: linear-gradient(135deg, #98D8C8, #27AE60);
}

.block.yellow {
    background: linear-gradient(135deg, #FFD93D, #F39C12);
}

.block.purple {
    background: linear-gradient(135deg, #A8E6CF, #9B59B6);
}

.block.orange {
    background: linear-gradient(135deg, #FFB347, #E67E22);
}

.block:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
}

.block.highlighted {
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from {
        box-shadow: 0 0 10px rgba(255,255,255,0.8);
    }
    to {
        box-shadow: 0 0 20px rgba(255,255,255,1);
    }
}

.block.removing {
    animation: explode 0.5s ease-out forwards;
}

@keyframes explode {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

#mobileControls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

#gameOverModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-top: 0;
    color: #FFD700;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.modal-content p {
    font-size: 18px;
    margin: 15px 0;
}

.modal-content button {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin: 10px 5px;
    transition: transform 0.2s;
}

.modal-content button:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    #gameBoard {
        grid-template-columns: repeat(8, 35px);
        grid-template-rows: repeat(10, 35px);
        gap: 1px;
    }
    
    .block {
        width: 35px;
        height: 35px;
    }
    
    #firstScreen h2 {
        font-size: 36px;
    }
    
    #firstScreen h3 {
        font-size: 20px;
    }
    
    #firstScreen h4 {
        font-size: 16px;
    }
    
    #mobileControls {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    #gameBoard {
        grid-template-columns: repeat(6, 30px);
        grid-template-rows: repeat(8, 30px);
    }
    
    .block {
        width: 30px;
        height: 30px;
    }
    
    #firstScreen h2 {
        font-size: 28px;
    }
    
    #gameStatus {
        font-size: 14px;
        padding: 8px;
    }
}