* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.container {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 100vw;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header {
    margin-bottom: 5px;
}

.header h1 {
    font-size: 1.2em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-size: 0.75em;
    font-weight: bold;
}

.stats span {
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
}

#gameCanvas {
    border: 2px solid #fff;
    border-radius: 8px;
    background: #87CEEB;
    display: block;
    margin: 0 auto 8px auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    /* Escala automática para caber na tela */
    max-width: 100%;
    max-height: calc(100vh - 200px);
    height: auto;
    width: auto;
}

/* Touch Controls */
.touch-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    padding: 5px;
    gap: 10px;
}

.left-controls,
.right-controls {
    display: flex;
    gap: 8px;
}

.touch-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    font-size: 1.5em;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.touch-btn:active {
    transform: scale(0.92);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.jump-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    width: 60px;
    height: 60px;
    font-size: 1.8em;
}

.jump-btn:active {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.run-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    width: 48px;
    height: 48px;
}

.run-btn:active {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.overlay.hidden {
    display: none;
}

.overlay h2 {
    font-size: 2em;
    margin-bottom: 15px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7);
}

.overlay p {
    font-size: 1.1em;
    margin-bottom: 20px;
    text-align: center;
}

.overlay button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 15px 35px;
    font-size: 1.1em;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.overlay button:active {
    transform: scale(0.95);
}

/* Landscape mode */
@media (orientation: landscape) {
    #gameCanvas {
        max-height: calc(100vh - 120px);
    }

    .touch-controls {
        padding: 2px;
    }

    .touch-btn {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .jump-btn {
        width: 55px;
        height: 55px;
    }
}

/* Prevenir scroll */
html, body {
    overscroll-behavior: none;
}
