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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 70%, #90EE90 70%, #90EE90 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 20px;
    max-width: 900px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.header h1 {
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.score-board {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
}

/* Botão de Info no Header */
.powerups-btn-header {
    padding: 6px 10px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.powerups-btn-header:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

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

#gameCanvas {
    border: 3px solid #333;
    border-radius: 5px;
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #87CEEB 70%, #C2B280 70%, #C2B280 100%);
}

.controls {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: #333;
    font-size: 0.9em;
}

.controls-left,
.controls-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.controls-text {
    flex: 1;
    text-align: center;
}

.controls p {
    margin: 5px 0;
}

.controls strong {
    color: #667eea;
    font-weight: bold;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
        min-height: 100vh;
    }

    .game-container {
        padding: 10px;
        max-width: 100%;
        width: 100%;
    }

    .header {
        flex-direction: column;
        gap: 10px;
        padding: 8px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .score-board {
        gap: 10px;
        font-size: 0.8em;
        flex-wrap: wrap;
        justify-content: center;
    }

    .powerups-btn-header {
        padding: 4px 8px;
        font-size: 0.9em;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
        touch-action: none;
        -webkit-tap-highlight-color: transparent;
    }

    .controls {
        font-size: 0.8em;
    }

    .controls p {
        display: none;
    }

    .controls::after {
        content: "Toque na tela para pular!";
        display: block;
        font-weight: bold;
        color: #667eea;
        font-size: 1.1em;
    }
}

/* Prevenir seleção de texto e zoom indesejado no mobile */
canvas {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

/* Conteúdo do Modal de Power-ups */
.powerups-legend-content {
    padding: 10px 0;
}

.legend-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.legend-icon {
    font-size: 1.8em;
    flex-shrink: 0;
}

.legend-text {
    color: #333;
    font-size: 0.95em;
    font-weight: 500;
}

@media (max-width: 768px) {
    .legend-item {
        padding: 10px 12px;
        font-size: 0.9em;
    }

    .legend-icon {
        font-size: 1.5em;
    }

    .legend-text {
        font-size: 0.85em;
    }
}

/* Botões de Compartilhamento */
.share-buttons {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    text-align: center;
}

.share-buttons h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.share-button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.3);
}

.share-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.share-btn.whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.share-btn.facebook {
    background: linear-gradient(135deg, #1877F2 0%, #0C5DBD 100%);
}

.share-btn.instagram {
    background: linear-gradient(135deg, #E1306C 0%, #C13584 50%, #833AB4 100%);
}

/* Responsividade para botões de compartilhamento */
@media (max-width: 768px) {
    .share-buttons {
        margin-top: 15px;
        padding: 12px;
    }

    .share-buttons h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .share-button-group {
        flex-direction: column;
        gap: 8px;
    }

    .share-btn {
        width: 100%;
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

/* Controle de Som - Compacto */
.sound-btn {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1.5em;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 50px;
}

.sound-btn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

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

.sound-btn.muted {
    opacity: 0.5;
}

/* Botão de Ranking - Igual ao som */
.ranking-btn {
    padding: 8px 12px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    font-size: 1.5em;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 50px;
}

.ranking-btn:hover {
    background: #FFF9E6;
    transform: scale(1.05);
}

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

/* Botão de Info Power-ups - Igual aos outros */
.powerups-btn {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1.5em;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 50px;
}

.powerups-btn:hover {
    background: #E6E9F8;
    transform: scale(1.05);
}

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

/* Botões de Compartilhamento - Ícones compactos */
.share-icon-btn {
    padding: 8px 12px;
    border: 2px solid;
    border-radius: 8px;
    font-size: 1.5em;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 50px;
}

.share-icon-btn:hover {
    transform: scale(1.05);
}

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

.whatsapp-icon {
    border-color: #25D366;
}

.whatsapp-icon:hover {
    background: #E8F8EE;
}

.facebook-icon {
    border-color: #1877F2;
}

.facebook-icon:hover {
    background: #E7F3FF;
}

.instagram-icon {
    border-color: #E1306C;
}

.instagram-icon:hover {
    background: #FDE8F0;
}

/* Modal de Ranking */
.ranking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ranking-modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.ranking-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.ranking-modal-header h2 {
    margin: 0;
    color: #667eea;
    font-size: 1.8em;
}

.close-ranking {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-ranking:hover {
    background: #f0f0f0;
    color: #333;
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin: 8px 0;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.ranking-item.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    font-weight: bold;
    border-left-color: #FF8C00;
}

.ranking-item.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: white;
    font-weight: bold;
    border-left-color: #888;
}

.ranking-item.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B8722D 100%);
    color: white;
    font-weight: bold;
    border-left-color: #8B5A2B;
}

.ranking-position {
    font-weight: bold;
    font-size: 1.2em;
    margin-right: 10px;
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: bold;
    font-size: 1.1em;
}

.ranking-details {
    font-size: 0.9em;
    opacity: 0.8;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .controls {
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
    }

    .controls-text {
        display: none;
    }

    .sound-btn,
    .ranking-btn,
    .share-icon-btn {
        font-size: 1.5em;
        padding: 8px 10px;
        min-width: 50px;
    }

    .controls-left,
    .controls-right {
        gap: 5px;
    }

    .ranking-modal-content {
        width: 95%;
        padding: 20px;
    }

    .ranking-modal-header h2 {
        font-size: 1.5em;
    }

    .ranking-item {
        padding: 10px 12px;
        font-size: 0.9em;
    }
}
