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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(180deg, #2B0467 0%, #1a0033 100%);
    color: white;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    position: relative;
}

.home-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 14px;
    color: #000;
    background-color: #FFE66D;
    border: none;
    padding: 12px 25px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFE66D,
        0 6px 0 4px #000,
        0 6px 0 6px #C4A747;
    transition: all 0.1s ease;
    z-index: 100;
}

.home-btn:hover {
    background-color: #FFF4A3;
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFF4A3,
        0 6px 0 4px #000,
        0 6px 0 6px #D4B757;
}

.home-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFE66D,
        0 2px 0 4px #000,
        0 2px 0 6px #C4A747;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2em;
    padding: 2em;
}

.score-board {
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 12px;
    color: #000;
    background-color: #FFE66D;
    padding: 12px 25px;
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFE66D,
        0 6px 0 4px #000,
        0 6px 0 6px #C4A747;
    z-index: 100;
}

#gameCanvas {
    background: rgba(0, 0, 0, 0.3);
    border: 6px solid #FFE66D;
    border-radius: 20px;
    box-shadow: 
        0 0 0 4px #000,
        0 0 30px rgba(255, 230, 109, 0.5);
}

.controls {
    display: flex;
    gap: 1em;
}

.mobile-controls {
    display: none;
    grid-template-areas:
        ". up ."
        "left down right";
    grid-template-columns: 80px 80px 80px;
    grid-template-rows: 80px 80px;
    gap: 10px;
    margin-top: 20px;
}

.arrow-btn {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 24px;
    color: #000;
    background-color: #FFE66D;
    border: none;
    cursor: pointer;
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFE66D,
        0 6px 0 4px #000,
        0 6px 0 6px #C4A747;
    transition: all 0.1s ease;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arrow-btn:hover {
    background-color: #FFF4A3;
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFF4A3,
        0 6px 0 4px #000,
        0 6px 0 6px #D4B757;
}

.arrow-btn:active {
    transform: translateY(4px);
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFE66D,
        0 2px 0 4px #000,
        0 2px 0 6px #C4A747;
}

#upBtn { grid-area: up; }
#leftBtn { grid-area: left; }
#rightBtn { grid-area: right; }
#downBtn { grid-area: down; }

button {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    font-size: 18px;
    color: #000;
    background-color: #FFE66D;
    border: none;
    padding: 15px 40px;
    cursor: pointer;
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFE66D,
        0 8px 0 4px #000,
        0 8px 0 6px #C4A747;
    transition: all 0.1s ease;
}

button:hover {
    background-color: #FFF4A3;
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFF4A3,
        0 8px 0 4px #000,
        0 8px 0 6px #D4B757;
}

button:active {
    transform: translateY(4px);
    box-shadow: 
        0 0 0 4px #000,
        0 0 0 6px #FFE66D,
        0 4px 0 4px #000,
        0 4px 0 6px #C4A747;
}

@media (max-width: 1366px) {
    .home-btn {
        font-size: 10px;
        padding: 10px 20px;
    }

    .score-board {
        font-size: 12px;
    }

    button {
        font-size: 14px;
        padding: 12px 30px;
    }

    #gameCanvas {
        max-width: 35vw;
    }
}

@media (max-width: 768px) {
    body {
        min-height: 120vh;
    }

    .home-btn {
        font-size: 10px;
        padding: 10px 20px;
    }

    .score-board {
        font-size: 10px;
    }

    button {
        font-size: 14px;
        padding: 12px 30px;
    }

    #gameCanvas {
        max-width: 90vw;
    }

    .mobile-controls {
        display: grid;
    }

    .arrow-btn {
        width: 70px;
        height: 70px;
        font-size: 20px;
    }

    .mobile-controls {
        grid-template-columns: 70px 70px 70px;
        grid-template-rows: 70px 70px;
    }
}