@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=Inter:wght@400;600&display=swap');

/* Reset só dentro do nosso wrapper */
#blk-wrapper, #blk-wrapper * {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
#blk-wrapper *:not(input) {
    -webkit-user-select: none;
    user-select: none;
}

#blk-wrapper {
    display: flex;
    justify-content: center;
    padding: 16px 10px 24px;
    background: radial-gradient(ellipse at 50% 0%, #1a0a2e 0%, #0a0a14 60%);
    font-family: 'Inter', sans-serif;
}

#blk-game {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── HUD ── */
#blk-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #ffffff08;
    border: 1px solid #ffffff12;
    border-radius: 12px;
}

.blk-hud-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 60px;
}

.blk-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #ffffff44;
}

#blk-score {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 16px #00ffc388;
    text-align: center;
}

#blk-best {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 900;
    color: #ffd93d;
    text-shadow: 0 0 16px #ffd93d88;
    text-align: center;
}

#blk-combo {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #a78bfa;
    text-shadow: 0 0 12px #a78bfa;
    min-height: 18px;
    text-align: center;
}

/* ── VIDAS ── */
#blk-lives {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.blk-heart {
    font-size: 20px;
    line-height: 1;
    transition: opacity .3s;
}
.blk-heart-on  { color: #ff6b9d; text-shadow: 0 0 10px #ff6b9d; }
.blk-heart-off { color: #ffffff18; }

/* ── CANVAS ── */
#blk-canvas-wrap {
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #ffffff10, 0 8px 32px #00000080, 0 0 60px #00ffc308;
}

#blk-canvas {
    display: block;
    width: 100%;
    background: #0e0e1e;
    touch-action: none;
}

/* ── PEÇAS ── */
#blk-pieces {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 4px;
    background: #ffffff06;
    border: 1px solid #ffffff10;
    border-radius: 14px;
    min-height: 90px;
    gap: 4px;
    touch-action: none;
}

.blk-slot {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    padding: 14px 10px;
    border-radius: 10px;
    transition: opacity .2s;
    touch-action: none;
    cursor: grab;
}

.blk-slot.empty { opacity: 0 !important; pointer-events: none; }
.blk-slot:not(.empty):active { background: #ffffff08; }

.blk-piece {
    display: grid;
    gap: 3px;
    touch-action: none !important;
    cursor: grab;
    transition: transform .15s, filter .15s;
}
.blk-piece:hover  { transform: scale(1.1); filter: brightness(1.2); }
.blk-piece:active { cursor: grabbing; }

/* ── INPUT NOME ── */
#blk-name-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px;
    background: #ffffff08;
    border: 1px solid #ffffff14;
    border-radius: 12px;
}

#blk-name-wrap label {
    color: #ffffff88;
    font-size: 13px;
    font-weight: 600;
}

#blk-name-input {
    width: 100%;
    padding: 10px 14px;
    background: #0e0e1e;
    border: 1px solid #ffffff20;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
    text-align: center;
}
#blk-name-input:focus { border-color: #00ffc3; box-shadow: 0 0 0 2px #00ffc320; }

#blk-confirm-name {
    all: unset;
    display: block;
    width: 100%;
    padding: 10px;
    background: #00ffc3;
    color: #000 !important;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    touch-action: manipulation;
}

/* ── PLACAR ── */
#blk-scoreboard {
    display: none;
    background: #ffffff06;
    border: 1px solid #ffffff10;
    border-radius: 12px;
    padding: 12px 16px;
}

.blk-sb-title {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #ffd93d;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: .1em;
}

.blk-sb-row {
    display: grid;
    grid-template-columns: 20px 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #ffffff08;
    font-size: 13px;
    color: #fff;
}
.blk-sb-row:last-child { border-bottom: none; }
.blk-sb-rank  { color: #ffd93d; font-weight: 700; text-align: center; }
.blk-sb-name  { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-sb-score { color: #00ffc3; font-family: 'Orbitron', monospace; font-size: 12px; font-weight: 700; }
.blk-sb-date  { color: #ffffff38; font-size: 11px; }

/* ── BOTÃO JOGAR NOVAMENTE ── */
#blk-play-again {
    all: unset;
    display: none;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #00ffc3, #00b4d8);
    color: #000 !important;
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 0 24px #00ffc340, 0 4px 12px #00000060;
    transition: transform .15s, box-shadow .15s;
    touch-action: manipulation;
}
#blk-play-again:hover  { transform: translateY(-2px); box-shadow: 0 0 36px #00ffc360, 0 8px 20px #00000060; }
#blk-play-again:active { transform: translateY(0); }

/* ── MODAL VIDA PERDIDA ── */
#blk-life-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
}

/* Quando ativo, JS seta style.display = 'flex' */
#blk-life-modal-box {
    background: #12122a;
    border: 1px solid #ff6b9d55;
    border-radius: 20px;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 340px;
    width: 92%;
    box-shadow: 0 0 80px #ff6b9d33, 0 8px 40px #00000099;
    animation: blkPop .28s cubic-bezier(.34,1.56,.64,1);
}

@keyframes blkPop {
    from { transform: scale(.75); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

#blk-modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 28px;
    font-weight: 900;
    color: #ff6b9d;
    text-shadow: 0 0 24px #ff6b9d;
    text-align: center;
}

#blk-modal-hearts {
    display: flex;
    gap: 10px;
    font-size: 28px;
    line-height: 1;
}

#blk-modal-msg {
    font-size: 14px;
    font-weight: 600;
    color: #ffffffcc;
    text-align: center;
}

#blk-next-life {
    all: unset;
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff6b9d, #a855f7);
    color: #fff !important;
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 0 24px #ff6b9d44;
    transition: transform .15s, box-shadow .15s;
    touch-action: manipulation;
}
#blk-next-life:hover  { transform: translateY(-2px); box-shadow: 0 0 36px #ff6b9d66; }
#blk-next-life:active { transform: translateY(0); }
