:root {
    --tile-size: 52px;
    --gap: 6px;
    --bg: #0b0f14;
    --panel: #121826;
    --text: #e7eefc;
    --muted: #9fb0cc;
    --border: rgba(255, 255, 255, .10);

    /* Sprites (serão preenchidos via JS) */
    --spr-cell: url("sprites/cell.png");
    --spr-hit: url("sprites/hit.png");
    --spr-mine: url("sprites/mine.png");
}

html,
body {
    height: 100%;
    overflow: hidden;
    /* kiosk: sem rolagem */
    background: #0b0f14;
    /* mesmo bg do app */
}

body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 100vh;
    overflow: hidden;
}

/* Em celular/tablet, painel pode virar "gaveta" em cima */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .panel {
        order: 1;
        max-height: 42vh;
        overflow: auto;
    }

    .board-wrap {
        order: 2;
        height: 58vh;
        overflow: hidden;
    }
}

/* Para o tabuleiro caber melhor */
.board-wrap {
    height: calc(100vh - 80px);
    /* ajusta conforme sua topbar */
}

.board {
    justify-content: center;
    justify-content: center;
    align-content: center;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.topbar {
    margin-top: 50px;
    padding: 14px 16px;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    height: 64px;
    /* fixo ajuda cálculo */
}

.brand {
    font-weight: 700;
    display: flex;
    align-items: center;
    height: 64px;
}

.brand img {
    height: 80%;
    width: auto;
    object-fit: contain;
}


.status {
    color: var(--muted);
    display: flex;
    gap: 12px;
    font-size: large;
}

.container {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 14px;
    padding: 14px;
    height: calc(100vh - 64px);
    overflow: hidden;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    display: none;
}

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

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

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
}

input {
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    outline: none;
}

.actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    font-weight: 600;
}

button:disabled {
    opacity: .5;
}

.message {
    margin-top: 12px;
    min-height: 22px;
    font-weight: 700;
}

.board-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    overflow: auto;
}

.board {
    display: grid;
    gap: var(--gap);
    align-content: start;
}

.tile {
    width: var(--tile-size);
    height: var(--tile-size);
    border-radius: 10px;
    border: 1px solid var(--border);
    background-size: cover;
    background-position: center;
    touch-action: manipulation;
    user-select: none;
}

.tile.hidden {
    background-image: var(--spr-cell);
}

.tile.safe {
    background-image: var(--spr-hit);
}

.tile.mine {
    background-image: var(--spr-mine);
}

/* Tablet: se quiser aumentar automaticamente em telas maiores */
@media (min-width: 900px) {
    :root {
        --tile-size: 58px;
    }
}

/* Kiosk layout */
.kiosk {
    height: 100vh;
    overflow: hidden;
}

.overlay {
    pointer-events: auto;
}

.overlay-card {
    pointer-events: auto;
}

.overlay-btn {
    pointer-events: auto;
}

/* Overlay fim de jogo */
.overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(1px);
    z-index: 9999;
}

.overlay.hidden {
    display: none;
}

.overlay-card {
    width: min(92vw, 520px);
    border-radius: 22px;
    padding: 22px 18px;
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
    text-align: center;
    transform-origin: center;
    animation: popIn .55s cubic-bezier(.16, 1, .3, 1);
}

/* Vitória/Derrota */
.overlay.win .overlay-card {
    background: rgba(0, 90, 30, .85);
}

.overlay.lose .overlay-card {
    background: rgba(120, 0, 0, .85);
}

.overlay-title {
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin: 6px 0 6px;
    text-shadow: 0 4px 22px rgba(0, 0, 0, .35);
}

.overlay-subtitle {
    font-size: 16px;
    opacity: .95;
    margin-bottom: 14px;
}

.overlay-btn {
    width: 100%;
    padding: 14px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
}

/* animação “pula na tela” */
@keyframes popIn {
    0% {
        transform: translateY(20px) scale(.86);
        opacity: 0;
    }

    55% {
        transform: translateY(-6px) scale(1.04);
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* pequeno “bounce” no título */
.overlay-title {
    animation: titleBounce .7s cubic-bezier(.16, 1, .3, 1) .05s both;
}

@keyframes titleBounce {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }

    60% {
        transform: translateY(-4px);
        opacity: 1;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}