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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff6b9d, #c44569, #f8b5d3);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 900px;
    width: 100%;
}

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

.header h1 {
    color: #e91e63;
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.instructions {
    margin-bottom: 20px;
}

.instructions p {
    color: #666;
    font-size: 1.1em;
    margin: 5px 0;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    font-weight: bold;
    color: #e91e63;
}

.maze-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

#mazeCanvas {
    border: 3px solid #e91e63;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
}

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

button {
    background: linear-gradient(45deg, #e91e63, #ff6b9d);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(233, 30, 99, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(233, 30, 99, 0.4);
}

button:active {
    transform: translateY(0);
}

.accelerometer-btn {
    background: linear-gradient(45deg, #9b59b6, #8e44ad) !important;
    margin-left: 10px;
}

.mobile-controls {
    display: none;
    justify-content: center;
    margin: 20px 0;
    gap: 10px;
}

.direction-row {
    display: flex;
    gap: 10px;
}

.direction-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    border-radius: 50%;
    background: linear-gradient(45deg, #e91e63, #ff6b9d);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.direction-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(233, 30, 99, 0.4);
}

.direction-btn:active {
    transform: scale(0.95);
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1em;
    color: #666;
}

.player-icon, .target-icon, .wall-icon, .heart-icon, .moving-wall-icon {
    font-size: 1.5em;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(233, 30, 99, 0.1);
}

.heart-icon {
    background: rgba(255, 107, 157, 0.2);
}

.moving-wall-icon {
    background: rgba(231, 76, 60, 0.2);
}

/* Animations for effects */
@keyframes heartFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.5);
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 15% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

.start-modal {
    max-width: 600px;
    text-align: left;
}

.game-features {
    margin: 20px 0;
    text-align: left;
}

.game-features ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

.game-features li {
    padding: 5px 0;
    color: #666;
    font-size: 1em;
}

.game-features p {
    color: #e91e63;
    font-weight: bold;
    margin: 15px 0 5px 0;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    color: #e91e63;
    font-size: 2em;
    margin-bottom: 20px;
}

.modal-content p {
    font-size: 1.2em;
    margin: 15px 0;
    color: #666;
}

.modal-content button {
    margin-top: 20px;
    font-size: 1.2em;
    padding: 15px 30px;
}

/* Responsive design */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
        padding: 15px;
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }
    
    .instructions {
        margin-bottom: 15px;
    }
    
    .instructions p {
        font-size: 1em;
        margin: 3px 0;
    }
    
    #mazeCanvas {
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: 60vh;
    }
    
    .legend {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-top: 15px;
    }
    
    .stats {
        flex-direction: column;
        gap: 8px;
        font-size: 1em;
    }
    
    .legend-item {
        font-size: 0.9em;
    }
    
    /* Show mobile controls on touch devices */
    .mobile-controls {
        display: flex;
        margin: 15px 0;
    }
    
    .controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .accelerometer-btn {
        margin-left: 0;
        margin-top: 8px;
    }
    
    /* Make directional buttons bigger on mobile */
    .direction-btn {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .direction-row {
        gap: 15px;
    }
    
    .mobile-controls {
        gap: 15px;
    }
}

/* Hide mobile controls on desktop */
@media (min-width: 769px) {
    .mobile-controls {
        display: none !important;
    }
}
