/* Letter Swap — viewport-adaptive 6x6 board */

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

#lsPlayShell.game-worlds-play-shell {
    min-height: 0;
    box-sizing: border-box;
    background:
        radial-gradient(ellipse 130% 90% at 50% 45%, rgba(0, 242, 255, 0.045) 0%, transparent 52%),
        radial-gradient(ellipse 85% 100% at 0% 50%, rgba(8, 12, 20, 0.92) 0%, transparent 58%),
        radial-gradient(ellipse 85% 100% at 100% 50%, rgba(8, 12, 20, 0.92) 0%, transparent 58%),
        linear-gradient(165deg, #05070c 0%, #0c1118 42%, #080b10 100%);
}

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

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

.game-worlds-body #lsPlayShell #gamebox.ls-gamebox,
#lsPlayShell #gamebox.ls-gamebox,
#lsPlayShell .ls-gamebox#gamebox {
    --ls-cell: 56px;
    --ls-gap: 5px;
    --ls-board: calc(var(--ls-cell) * 6 + var(--ls-gap) * 5);
    --ls-font: 36px;
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    text-align: center;
    font-family: Arial, sans-serif;
    background-color: #161c1c;
    border: 2px solid #313131;
}

#lsPlayShell #header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    box-sizing: border-box;
    background-color: #333;
    color: #fff;
    font-size: clamp(1rem, calc(var(--ls-cell) * 0.32), 1.5rem);
}

#lsPlayShell .ls-playfield {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    min-width: 0;
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
}

#lsPlayShell #grid.grid,
#lsPlayShell .ls-grid {
    display: grid;
    grid-template-columns: repeat(6, var(--ls-cell));
    grid-template-rows: repeat(6, var(--ls-cell));
    gap: var(--ls-gap);
    width: var(--ls-board);
    height: var(--ls-board);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

#lsPlayShell .cell {
    width: var(--ls-cell);
    height: var(--ls-cell);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--ls-font);
    font-weight: 700;
    line-height: 1;
    background-color: #f0f0f0;
    cursor: pointer;
    color: black;
    user-select: none;
    box-sizing: border-box;
}

#lsPlayShell .highlighted {
    background-color: #ffcc00;
}

#lsPlayShell #gameover {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(22, 28, 28, 0.95);
    z-index: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#lsPlayShell #gameover h2 {
    font-size: 30px;
    margin: 0 0 30px;
    color: #fff;
}

#lsPlayShell #restart-button {
    background-color: #ffcc00;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-size: 26px;
}
