* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: "Microsoft YaHei", sans-serif;
    background: linear-gradient(170deg, #123a5e, #071627); color: #eaf8ff; touch-action: none; }

header { text-align: center; padding: 2.6vh 0 1vh; }
header h1 { font-size: clamp(22px, 2.2vw, 36px); letter-spacing: 6px; color: #8fd6ff; }
#level-bar { display: flex; gap: 10px; justify-content: center; margin-top: 1.2vh; }
#level-bar .lv-btn {
    padding: 6px 18px; border-radius: 18px; cursor: pointer;
    border: 1px solid rgba(140, 210, 255, .4);
    background: rgba(20, 60, 100, .35); color: #cfe9ff; font-size: 14px;
}
#level-bar .lv-btn.done { border-color: #58c790; color: #7fe0b0; }
#level-bar .lv-btn.on { background: #1a7fd4; }
#hud { margin-top: 1vh; color: #9fc4e2; font-size: clamp(13px, 1.2vw, 18px); letter-spacing: 2px; }
#hud span { color: #ffd76a; font-weight: 700; }

main { display: flex; align-items: center; justify-content: center; gap: 3vw; height: 74%; }

#board {
    position: relative;
    width: min(56vh, 44vw); height: min(56vh, 44vw);
    background: rgba(10, 30, 52, .6);
    border: 2px solid rgba(140, 210, 255, .35);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 160, 255, .18) inset;
}
.piece {
    position: absolute;
    background-size: calc(100% * var(--grid));
    cursor: grab; touch-action: none;
    border-radius: 4px;
    transition: box-shadow .2s;
    z-index: 2;
}
.piece.dragging { z-index: 9; box-shadow: 0 10px 34px rgba(0, 190, 255, .5); }
.piece.locked { cursor: default; outline: 2px solid rgba(120, 230, 160, .8); outline-offset: -2px; z-index: 1; }

#goal-hint { text-align: center; }
#goal-img { width: clamp(110px, 14vw, 200px); border-radius: 10px; border: 2px solid rgba(140,210,255,.4); }
#goal-hint p { margin-top: 1vh; color: #9fc4e2; font-size: 14px; letter-spacing: 3px; }

/* 过关弹层 */
#pass-overlay {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(4, 14, 26, .8); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
}
#pass-overlay.hidden { display: none; }
.pass-card {
    text-align: center; padding: 6vh 6vw;
    background: linear-gradient(160deg, #14426b, #0a2340);
    border: 1px solid rgba(140, 230, 180, .45);
    border-radius: 18px;
    animation: pop .4s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.pass-card h2 { font-size: clamp(24px, 2.6vw, 40px); color: #7fe0b0; }
#pass-info { margin: 2.4vh 0; color: #cfe9ff; font-size: clamp(14px, 1.3vw, 20px); }
#next-btn {
    padding: 12px 44px; border: none; border-radius: 28px;
    background: linear-gradient(90deg, #1a9f5c, #58c790);
    color: #fff; font-size: 18px; cursor: pointer; letter-spacing: 3px;
}
