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

/* ---- 2048 — Game Worlds embed ------------------------------------------ */
.twenty48-gamebox#gamebox,
#gamebox.twenty48-gamebox {
    --tw48-gap: 15px;
    --tw48-cell: 80px;
    --tw48-board: 400px;
    --tw48-border: rgba(148, 163, 184, 0.22);
    --tw48-surface: rgba(15, 23, 42, 0.92);
    --tw48-board-bg: rgba(30, 41, 59, 0.85);
    --tw48-slot: rgba(51, 65, 85, 0.75);
    --tw48-cyan: #22d3ee;
    --tw48-cyan-dim: rgba(34, 211, 238, 0.12);

    box-sizing: border-box;
    width: 100%;
    max-width: 680px;
    min-height: 440px;
    margin: 0 auto;
    padding: 1rem 1.1rem 1.25rem;
    position: relative;

    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    color: #e2e8f0;

    background:
        radial-gradient(ellipse 120% 80% at 50% 0%, rgba(34, 211, 238, 0.07) 0%, transparent 55%),
        linear-gradient(165deg, #0b0f14 0%, #111827 48%, #0c1016 100%);
    border: 1px solid var(--tw48-border);
    border-radius: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 18px 48px rgba(0, 0, 0, 0.45);
}

.twenty48-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.twenty48-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.twenty48-brand {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.twenty48-title {
    font-size: clamp(1.75rem, 4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(120deg, #f8fafc 0%, #67e8f9 45%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.twenty48-sub {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.twenty48-score-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.twenty48-score-card {
    min-width: 4.5rem;
    padding: 0.35rem 0.65rem 0.45rem;
    border-radius: 10px;
    background: var(--tw48-surface);
    border: 1px solid var(--tw48-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    text-align: center;
}

.twenty48-score-card--accent {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.14) 0%, var(--tw48-surface) 100%);
    border-color: rgba(34, 211, 238, 0.35);
}

.twenty48-score-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7dd3fc;
    opacity: 0.85;
    line-height: 1.2;
}

.twenty48-score-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #f1f5f9;
    line-height: 1.15;
}

.twenty48-btn-new {
    flex: 0 0 auto;
    align-self: center;
    cursor: pointer;
    border: 1px solid rgba(34, 211, 238, 0.45);
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #0f172a;
    background: linear-gradient(180deg, #5eead4 0%, #22d3ee 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.35) inset,
        0 8px 22px rgba(34, 211, 238, 0.2);
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.twenty48-btn-new:hover {
    filter: brightness(1.06);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.4) inset,
        0 10px 28px rgba(34, 211, 238, 0.28);
}

.twenty48-btn-new:active {
    transform: translateY(1px);
}

.twenty48-float-score#addScore,
#addScore.twenty48-float-score {
    opacity: 0;
    position: absolute;
    top: 120px;
    left: 2rem;
    z-index: 5;
    font-size: 1.85rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #f472b6;
    text-shadow: 0 2px 18px rgba(244, 114, 182, 0.55);
    pointer-events: none;
}

.twenty48-board#gm-content,
#gm-content.twenty48-board {
    width: var(--tw48-board);
    height: var(--tw48-board);
    max-width: 100%;
    margin: 0 auto;
    padding: var(--tw48-gap);
    position: relative;
    box-sizing: border-box;
    float: none;

    background: var(--tw48-board-bg);
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.6);
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.35);
}

.twenty48-gamebox#gamebox::after,
#gamebox.twenty48-gamebox::after {
    content: "";
    display: table;
    clear: both;
}

.s-border.twenty48-tile-slot,
#gm-content .s-border {
    width: var(--tw48-cell);
    height: var(--tw48-cell);
    background-color: var(--tw48-slot);
    border-radius: 10px;
    position: absolute;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.num-border,
#gm-content .num-border {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 42%);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
    line-height: var(--tw48-cell);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.twenty48-mask#mask,
#mask.twenty48-mask {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 999;
    display: none;

    background: rgba(8, 10, 14, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 14px;
}

.twenty48-modal {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 320px);
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;

    background: linear-gradient(180deg, rgba(30, 41, 59, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 16px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.twenty48-modal-title#gameovertext,
#gameovertext.twenty48-modal-title {
    margin: 0 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.twenty48-modal-hint {
    margin: 0 0 1.25rem;
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.4;
}

.twenty48-btn-restart#restart_game,
#restart_game.twenty48-btn-restart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0.65rem 1rem;
    cursor: pointer;

    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0f172a;

    border: none;
    border-radius: 10px;
    background: linear-gradient(180deg, #5eead4 0%, #22d3ee 100%);
    box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25);
    transition: filter 0.12s ease, transform 0.12s ease;
}

.twenty48-btn-restart:hover,
#restart_game:hover {
    filter: brightness(1.05);
}

.twenty48-btn-restart:active,
#restart_game:active {
    transform: translateY(1px);
}

/* Game Worlds: same play column height as sky-shooter.css #gamebox */
.game-worlds-play-shell {
    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%);
}

.game-worlds-play-shell #gamebox.twenty48-gamebox {
    flex: 0 0 auto;
    height: calc(768px * 5 / 7);
    max-height: calc(768px * 5 / 7);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.game-worlds-play-shell #gm-content.twenty48-board {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 640px) {
    .twenty48-gamebox#gamebox,
    #gamebox.twenty48-gamebox {
        padding: 0.85rem 0.75rem 1rem;
    }

    .twenty48-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .twenty48-btn-new {
        width: 100%;
    }

    .twenty48-float-score#addScore,
    #addScore.twenty48-float-score {
        left: 1rem;
        font-size: 1.5rem;
    }
}
