/* Responsivo para tablets e celulares */
@media (max-width: 900px) {
    #game-title-bar {
        width: 96vw;
        font-size: 1.1rem;
        padding: 2vw 0;
        border-radius: 12px 12px 0 0;
    }
    #app {
        max-width: 98vw;
        width: 98vw;
        padding: 3vw;
        box-sizing: border-box;
        border-radius: 0 0 12px 12px;
    }
    .memory-grid {
        gap: 2vw;
        margin: 3vw 0;
    }
    .header, .result {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    .result-buttons {
        gap: 6px;
        margin-top: 10px;
    }
    .restart-btn-container {
        margin-top: 12px;
    }
}

@media (max-width: 600px) {
                .memory-btn img {
                    width: 150% !important;
                    height: 150% !important;
                }
            .memory-grid[data-size="9"] .memory-btn img,
            .memory-grid[data-size="12"] .memory-btn img {
                border-radius: 22px;
                object-fit: contain;
            }
        .memory-grid[data-size="4"] .memory-btn img {
            width: 150% !important;
            height: 150% !important;
        }
    body {
        min-height: 100vh;
        min-width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    #main-container {
        width: 100vw;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 7vw !important;
        box-sizing: border-box;
    }
    #game-title-bar {
        margin-top: 5vw !important;
        font-size: 5vw !important;
        padding: 2vw 0 !important;
        border-radius: 8px 8px 0 0 !important;
        width: 98vw !important;
        white-space: pre-line !important;
        word-break: break-word !important;
        box-sizing: border-box !important;
        text-align: center !important;
        overflow-wrap: break-word !important;
        margin: 0 auto !important;
    }
    #app {
        max-width: 99vw;
        width: 99vw;
        padding: 2vw;
        border-radius: 0 0 8px 8px;
    }
    .memory-btn {
        width: 14vw;
        height: 14vw;
        min-width: 36px;
        min-height: 36px;
    }
    .memory-btn img {
        width: 150% !important;
        height: 150% !important;
        border-radius: 16px !important;
        object-fit: cover;
        aspect-ratio: 1/1;
    }
    .memory-grid {
        gap: 2vw;
        margin: 2vw 0;
    }
    input, select, button {
        font-size: 0.95rem;
        padding: 6px;
        border-radius: 6px;
        margin: 6px 0;
    }
    .start-center input, .start-center select, .start-center button {
        width: 98%;
        max-width: 98vw;
        min-width: 80px;
    }
    .result-buttons {
        gap: 4px;
        margin-top: 8px;
    }
    .restart-btn-container {
        margin-top: 8px;
    }
}
.result, .result * {
    color: #fff !important;
    text-shadow:
        -1px -1px 0 #bfa14a,
        1px -1px 0 #bfa14a,
        -1px 1px 0 #bfa14a,
        1px 1px 0 #bfa14a;
}
.result-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}
.start-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
}
#game-title-bar {
    width: 440px;
    margin: 0 auto;
    padding: 10px 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 2px;
    background: rgba(0,0,0,0.5);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 2px 8px #0006;
    z-index: 2;
}
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #222 url('assets/img/background.png') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.restart-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

#restartBtn {
    margin: 0 auto;
    display: block;
}
#app {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background: #333 url('assets/img/wall.png') no-repeat center center;
    background-size: cover;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 4px 24px #0008;
    transition: background 0.4s;
    z-index: 1;
}

#app.in-game {
    background: linear-gradient(135deg, #111 60%, #bfa14a 100%);
    background-size: cover;
}
.memory-grid {
    display: grid;
    gap: 18px;
    margin: 24px 0;
    justify-items: center;
    align-items: center;
    min-height: 220px;
}
.memory-grid[data-size="4"] {
    gap: 24px;
}
.memory-grid[data-size="9"] {
    gap: 16px;
}
.memory-grid[data-size="12"] {
    gap: 10px;
}


.memory-btn img {
    border: 3px solid #bfa14a;
    border-radius: 16px !important;
    box-sizing: border-box;
    background: rgba(0,0,0,0.12);
    box-shadow: 0 0 8px 2px #bfa14a99;
    transition: width 0.2s, height 0.2s, border-radius 0.2s;
    object-fit: cover;
    aspect-ratio: 1/1;
}

.memory-grid[data-size="9"] .memory-btn img,
.memory-grid[data-size="12"] .memory-btn img {
    width: 110% !important;
    height: 110% !important;
}
.memory-grid[data-size="9"] {
    gap: 10px;
}
.memory-grid[data-size="12"] {
    gap: 7px;
}
.memory-btn {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: none;
    outline: none;
    background: #444;
    box-shadow: 0 2px 8px #0006;
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
    font-size: 0;
}
.memory-btn.active {
    box-shadow: 0 0 32px 16px #6cf8ff, 0 0 48px 24px #b3eaff;
    filter: brightness(2.5) saturate(2);
    border: 2.5px solid #6cf8ff;
    z-index: 2;
}
.header, .result {
    text-align: center;
    margin-bottom: 16px;
}
input, select, button {
    font-size: 1rem;
    padding: 8px;
    border-radius: 8px;
    border: none;
    margin: 8px 0;
}

.start-center input, .start-center select, .start-center button {
    width: 80%;
    max-width: 260px;
    min-width: 120px;
    margin-left: auto;
    margin-right: auto;
}

button {
    background: #08f;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}
button:hover {
    background: #06c;
}
.mute-btn {
    background: #666;
    color: #fff;
    margin-left: 8px;
}
/* Botão flutuante para voltar ao menu principal */
.floating-menu-btn {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    background: #bfa14a;
    color: #222;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    box-shadow: 0 4px 16px #0008;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.floating-menu-btn:hover {
    background: #fff;
    color: #bfa14a;
}
@media (max-width: 600px) {
    #app {
        max-width: 98vw;
        width: 98vw;
        padding: 4vw;
        box-sizing: border-box;
    }
    .memory-btn {
        width: 21vw;
        height: 21vw;
        min-width: 54px;
        min-height: 54px;
    }
    .memory-grid {
        gap: 2vw;
        margin: 4vw 0;
    }
}
