:root {
    --accent-pink: #ff8fab;
    --soft-pink: #fff0f3;
    --text-dark: #4a4a4a;
    --cell-size: 32px; /* Reduced for mobile fit */
    --gap: 3px;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    background: transparent;
    font-family: sans-serif;
    overflow: hidden; /* Prevents accidental bouncing/scrolling */
}

.mobile-game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 90vh; /* Keeps content within thumb-reach */
    padding: 20px 0;
}

.main-card {
    background: transparent;
    text-align: center;
}

#maze-container {
    position: relative;
    display: grid;
    grid-template-columns: repeat(10, var(--cell-size));
    grid-template-rows: repeat(10, var(--cell-size));
    background: var(--soft-pink);
    padding: 8px;
    border-radius: 12px;
    gap: var(--gap);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.wall {
    background: #fde2e4;
}

#player, #goal {
    width: var(--cell-size);
    height: var(--cell-size);
    position: absolute;
    z-index: 10;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

#player {
    transition: all 0.1s ease-out;
    background-image: url('shaymin.png');
}

#goal {
    background-image: url('heart.png');
    animation: heartBeat 1.2s infinite ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Fixed Bottom D-Pad */
.d-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pad-row {
    display: flex;
    gap: 12px;
}

.pad-btn {
    width: 50px; /* Larger for easy thumb tapping */
    height: 50px;

    background: var(--accent-pink);
    color: white;
    border: none;
    border-radius: 50%; /* Rounded for better mobile feel */
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.pad-btn:active {
    transform: scale(0.9);
    background: #ff758c;
}

#popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.popup-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    text-align: center;
}

.btn {
    background: var(--accent-pink);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
}