/* Number Snake — viewport-adaptive 740×440 board */

@media screen and (max-height: 640px) {
    #nsnPlayShell .container.container-single {
        padding-top: 3px !important;
    }
}

#nsnPlayShell.game-worlds-play-shell {
    min-height: 0;
    box-sizing: border-box;
}

#nsnPlayShell.game-worlds-play-shell:not([data-casual-sized]) {
    height: 0;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}

#nsnPlayShell .casual-outer-shell {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.game-worlds-body #nsnPlayShell #gamebox.nsn-gamebox,
#nsnPlayShell #gamebox.nsn-gamebox {
    --nsn-scale-x: 1;
    --nsn-scale-y: 1;
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    background-color: #000;
}

#nsnPlayShell #scoreAndTime {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px 16px;
    box-sizing: border-box;
    z-index: 2;
}

#nsnPlayShell #scoreBoard,
#nsnPlayShell #remainRow,
#nsnPlayShell #remain,
#nsnPlayShell #timer {
    font-size: clamp(18px, 2.4vw, 24px);
    font-weight: bold;
    color: #fff;
}

#nsnPlayShell #remainRow {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

#nsnPlayShell #timer {
    color: #f87171;
}

#nsnPlayShell .nsn-playfield {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

#nsnPlayShell #gameArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 740px;
    height: 440px;
    background-color: #161c1c;
    transform: scale(var(--nsn-scale-x, 1), var(--nsn-scale-y, 1));
    transform-origin: top left;
}

#nsnPlayShell .snake-segment {
    width: 20px;
    height: 20px;
    background-color: green;
    position: absolute;
}

#nsnPlayShell .number {
    width: 20px;
    height: 20px;
    background-color: red;
    position: absolute;
    color: white;
    text-align: center;
    line-height: 20px;
}

#nsnPlayShell .overlay {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(22, 28, 28, 0.95);
    z-index: 3;
    cursor: pointer;
}

#nsnPlayShell .overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#nsnPlayShell .overlay-content h2 {
    color: red;
    font-size: 36px;
}

#nsnPlayShell .overlay-content #resultDetail {
    margin: 8px 0 16px;
    color: #fff;
    font-size: 18px;
    min-height: 1.2em;
}

#nsnPlayShell button,
#nsnPlayShell #restartButton {
    padding: 10px 20px;
    font-size: 20px;
    cursor: pointer;
}
