/* Don't Touch Red - Mobile-first styles */

:root {
    --color-bg: #87CEEB;
    --color-ground: #8B4513;
    --color-ground-dark: #654321;
    --color-player: #4A90D9;
    --color-player-dark: #357ABD;
    --color-obstacle: #E74C3C;
    --color-obstacle-dark: #C0392B;
    --color-text: #FFFFFF;
    --color-text-dark: #2C3E50;
    --color-overlay: rgba(0, 0, 0, 0.6);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--color-bg);
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-bg);
}

#game-canvas {
    display: block;
    background-color: var(--color-bg);
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

/* Share button */
#share-btn {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--color-text);
    background-color: var(--color-player);
    border: 3px solid var(--color-player-dark);
    border-radius: 24px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s ease, background-color 0.1s ease;
    z-index: 10;
}

#share-btn:active {
    transform: translateX(-50%) scale(0.95);
    background-color: var(--color-player-dark);
}

#share-btn.hidden {
    display: none;
}

#share-btn svg {
    width: 20px;
    height: 20px;
}

/* Prevent pull-to-refresh and overscroll */
html {
    overscroll-behavior: none;
}

body {
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Prevent text selection during gameplay */
canvas {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Desktop hover state */
@media (hover: hover) {
    #share-btn:hover {
        background-color: var(--color-player-dark);
    }
}

/* Landscape warning for very short heights */
@media (max-height: 300px) {
    #game-container::before {
        content: 'Rota tu dispositivo';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 16px;
        color: var(--color-text-dark);
        font-weight: bold;
        z-index: 100;
        background: rgba(255, 255, 255, 0.9);
        padding: 10px 20px;
        border-radius: 8px;
    }
}
