@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    background-color: #111;
    color: #fff;
    font-family: 'Press Start 2P', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    touch-action: none; /* Prevent scroll on touch devices */
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 720px;
    max-height: 1280px;
    background-color: #050510;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
}

@media (min-aspect-ratio: 9/16) {
    #game-container {
        aspect-ratio: 9/16;
        height: 100vh;
        width: auto;
    }
}

@media (max-aspect-ratio: 9/16) {
    #game-container {
        width: 100vw;
        height: calc(100vw * 16 / 9);
    }
}

#top-bar {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 20px;
    flex-shrink: 0;
    background-color: #111;
    border-bottom: 2px solid #333;
}

#game-area {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

#header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
    font-size: 14px;
    pointer-events: none;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;
}

#pause-btn {
    background: transparent;
    border: 2px solid #ff00ff;
    color: #ff00ff;
    padding: 8px 12px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
    border-radius: 4px;
    text-shadow: 0 0 5px #ff00ff;
    box-shadow: 0 0 5px #ff00ff, inset 0 0 5px #ff00ff;
    transition: all 0.2s;
    outline: none;
}

#pause-btn:hover {
    background: rgba(255, 0, 255, 0.2);
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: none;
    /* Remove image-rendering to allow anti-aliasing for smoother ball movement */
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 30;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
}

#overlay.visible {
    visibility: visible;
    opacity: 1;
}

#message-title {
    font-size: 32px;
    color: #0ff;
    text-shadow: 0 0 15px #0ff;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

#message-subtitle {
    font-size: 12px;
    color: #fff;
    margin-bottom: 40px;
    text-align: center;
    line-height: 1.5;
}

.btn {
    background: transparent;
    border: 3px solid #0f0;
    color: #0f0;
    padding: 15px 25px;
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    cursor: pointer;
    border-radius: 8px;
    text-shadow: 0 0 10px #0f0;
    box-shadow: 0 0 10px #0f0, inset 0 0 10px #0f0;
    transition: all 0.2s;
    outline: none;
}

.btn:hover {
    background: rgba(0, 255, 0, 0.2);
    transform: scale(1.05);
}

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

@media (max-width: 480px) {
    #message-title {
        font-size: 24px;
    }
    #message-subtitle {
        font-size: 10px;
    }
    #header {
        font-size: 10px;
        padding: 15px;
    }
    #pause-btn {
        font-size: 8px;
        padding: 6px 10px;
    }
    #top-bar {
        height: 40px;
        padding: 0 10px;
    }
    .btn {
        font-size: 12px;
        padding: 12px 20px;
    }
}
