* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #2D3748;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    margin: 20px;
}

.game-header {
    background: linear-gradient(135deg, #E53E3E, #F56565);
    padding: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-title {
    max-height: 60px;
    margin-bottom: 15px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.05); }
}

.game-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.game-info > div {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.label {
    font-weight: bold;
    margin-right: 8px;
}

.game-board {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #F7FAFC;
}

#gameCanvas {
    border: 4px solid #E53E3E;
    border-radius: 10px;
    background: #C53030;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.start-screen, .game-over, .difficulty-screen, .victory-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 90%;
}

.difficulty-screen {
    max-width: 800px;
    width: 95%;
}

.start-screen h2, .game-over h2, .victory-screen h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #E53E3E;
}

.victory-screen h2 {
    color: #E53E3E;
    animation: victoryGlow 2s ease-in-out infinite alternate;
}

@keyframes victoryGlow {
    from { text-shadow: 0 0 5px rgba(229, 62, 62, 0.5); }
    to { text-shadow: 0 0 20px rgba(229, 62, 62, 0.8); }
}

.start-screen p, .game-over p, .victory-screen p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #555;
}

.unlock-message {
    background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    animation: unlockPulse 2s ease-in-out infinite;
}

@keyframes unlockPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.continue-button {
    background: linear-gradient(135deg, #E53E3E, #C53030);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    margin-top: 10px;
}

.continue-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4);
    filter: brightness(1.1);
}

.difficulty-bonus {
    background: linear-gradient(135deg, #3742fa 0%, #2f3542 100%);
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.controls-info {
    background: #F7FAFC;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #E53E3E;
}

.controls-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.start-button, .restart-button {
    background: linear-gradient(135deg, #E53E3E, #C53030);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.start-button:hover, .restart-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.start-button:active, .restart-button:active {
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}

.game-footer {
    background: #34495e;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        align-items: center;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 600px;
        height: auto;
    }
    
    .start-screen, .game-over, .victory-screen {
        padding: 20px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .game-info > div {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .start-screen h2, .game-over h2, .victory-screen h2 {
        font-size: 1.5rem;
    }
    
    .start-button, .restart-button, .continue-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

/* Efeitos de animação para elementos do jogo */
.score-animation {
    animation: scoreUp 0.5s ease-out;
}

@keyframes scoreUp {
    0% {
        transform: scale(1);
        color: inherit;
    }
    50% {
        transform: scale(1.2);
        color: #ff6b6b;
    }
    100% {
        transform: scale(1);
        color: inherit;
    }
}

/* Estilos para personalização */
.customization-panel {
    background: #f1f2f6;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    border: 2px solid #e0e0e0;
}

.customization-panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1rem;
}

.burger-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.carousel-btn {
    background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 60px;
    min-height: 60px;
}

.carousel-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #F56565 0%, #E53E3E 100%);
}

.carousel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.burger-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    min-width: 200px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#burgerPreview {
    border-radius: 10px;
    margin-bottom: 15px;
    background: #1a252f;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.burger-info {
    text-align: center;
    color: #2c3e50;
}

.burger-info h4 {
    margin: 5px 0;
    font-size: 1.2em;
    color: #2c3e50;
}

.burger-info p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #666;
}

.unlock-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.unlock-status.unlocked {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
}

.unlock-status.locked {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
}

.unlocked {
    color: #28a745;
}

.locked {
    color: #dc3545;
}

.progression-info {
    text-align: center;
    color: #2c3e50;
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.progression-info p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #666;
}

.progress-bar {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.progress-bar span {
    color: #2c3e50;
    font-weight: bold;
}

/* Responsividade para personalização */
@media (max-width: 480px) {
    .burger-carousel {
        gap: 15px;
    }
    
    .carousel-btn {
        padding: 12px 15px;
        font-size: 16px;
        min-width: 50px;
        min-height: 50px;
    }
    
    .burger-display {
        min-width: 160px;
        padding: 15px;
    }
    
    #burgerPreview {
        width: 100px;
        height: 100px;
    }
    
    .burger-info h4 {
        font-size: 1em;
    }
    
    .burger-info p {
        font-size: 0.8em;
    }
    
    .customization-panel {
        padding: 15px;
        margin: 15px 0;
    }
    
    .customization-panel h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .progression-info {
        padding: 10px;
    }
    
    .progression-info p {
        font-size: 0.8em;
    }
}

/* Estilos para seleção de dificuldade */
.difficulty-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.difficulty-option {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 3px solid #e9ecef;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.difficulty-option:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #E53E3E;
}

.difficulty-option.poppys-special {
    background: linear-gradient(135deg, #E53E3E, #C53030);
    color: white;
    border-color: #E53E3E;
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    from { 
        box-shadow: 0 0 20px rgba(229, 62, 62, 0.5);
        transform: scale(1);
    }
    to { 
        box-shadow: 0 0 30px rgba(229, 62, 62, 0.8);
        transform: scale(1.02);
    }
}

.difficulty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.difficulty-option h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #E53E3E;
}

.difficulty-option.poppys-special h3 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.difficulty-option p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #555;
}

.difficulty-option.poppys-special p {
    color: rgba(255, 255, 255, 0.9);
}

.difficulty-btn {
    background: linear-gradient(135deg, #E53E3E, #C53030);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    font-weight: bold;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.difficulty-btn.poppys-btn {
    background: linear-gradient(135deg, #C53030, #9B2C2C);
    box-shadow: 0 0 20px rgba(229, 62, 62, 0.3);
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

.difficulty-btn.poppys-btn:hover {
    box-shadow: 0 5px 25px rgba(229, 62, 62, 0.5);
}

.back-button {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

/* Responsividade para tela de dificuldade */
@media (max-width: 768px) {
    .difficulty-screen {
        max-width: 95%;
        width: calc(100vw - 20px);
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        padding: 15px;
    }
    
    .difficulty-screen h2 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .difficulty-options {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 15px 0;
    }
    
    .difficulty-option {
        padding: 15px;
    }
    
    .difficulty-icon {
        font-size: 2rem;
        margin-bottom: 8px;
    }
    
    .difficulty-option h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    
    .difficulty-option p {
        margin: 4px 0;
        font-size: 0.85rem;
    }
    
    .difficulty-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .difficulty-screen {
        padding: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .difficulty-screen h2 {
        font-size: 1.3rem;
        margin-bottom: 8px;
    }
    
    .difficulty-options {
        gap: 8px;
        margin: 10px 0;
    }
    
    .difficulty-option {
        padding: 12px;
    }
    
    .difficulty-icon {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }
    
    .difficulty-option h3 {
        font-size: 1.1rem;
        margin-bottom: 5px;
    }
    
    .difficulty-option p {
        font-size: 0.8rem;
        margin: 3px 0;
    }
    
    .difficulty-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        margin-top: 5px;
    }
    
    .back-button {
        padding: 8px 15px;
        font-size: 0.85rem;
        margin-top: 10px;
    }
}

/* Canvas Touch Interactions */
#gameCanvas {
    touch-action: none; /* Previne zoom e scroll em mobile */
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Responsividade aprimorada */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
    }
    
    .game-container {
        margin: 0;
        max-width: none;
        width: 100vw;
        min-height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .game-header {
        padding: 10px 15px;
        flex-shrink: 0;
    }

    .game-title {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }

    .game-info {
        flex-direction: row;
        gap: 8px;
        justify-content: space-between;
    }

    .game-info > div {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .game-board {
        padding: 5px;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }

    #gameCanvas {
        width: calc(100vw - 20px) !important;
        height: calc(50vh) !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 8px;
    }

    .game-footer {
        padding: 8px 15px;
        flex-shrink: 0;
        font-size: 0.75rem;
    }


}

@media (max-width: 480px) {
    .game-header {
        padding: 8px 12px;
    }
    
    .game-title {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }
    
    .game-info > div {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    #gameCanvas {
        width: calc(100vw - 15px) !important;
        height: calc(45vh) !important;
        border-radius: 6px;
    }
    
    .game-footer {
        padding: 6px 12px;
        font-size: 0.7rem;
        flex-shrink: 0;
    }
    
    /* Ajustar outras telas para mobile */
    .start-screen, .game-over, .victory-screen {
        padding: 15px;
        width: calc(100vw - 30px);
        max-width: none;
        border-radius: 8px;
    }
    
    .start-screen h2, .game-over h2, .victory-screen h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
}

/* Touch device detection */
@media (hover: none) and (pointer: coarse) {
    .game-footer #controlsText {
        display: none;
    }
    
    .game-footer #touchControlsText {
        display: block;
    }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .game-container {
        height: 100vh;
        overflow: hidden;
    }
    
    .game-board {
        height: calc(100vh - 120px);
    }
    
    #gameCanvas {
        max-height: calc(100vh - 150px);
    }
}