body {
    overflow: hidden;
}

main {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 16px;
}

/* Wrapper: fixed 800x600 game area */
.game-wrapper {
    display: flex;
    flex-direction: column;
    width: 800px;
    height: 644px;
    /* 600 game + 44 toolbar */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Toolbar */
.game-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 12px;
    background: #0088bd;
    flex-shrink: 0;
}

.toolbar-thumb {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
    display: none;
}

.toolbar-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    flex: 1;
}

.game-title-bar {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-category-bar {
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
    white-space: nowrap;
}

.fullscreen-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Game frame box: always 800x600 */
.game-frame-box {
    width: 800px;
    height: 600px;
    flex-shrink: 0;
    position: relative;
}

.game-frame-box iframe {
    width: 800px;
    height: 600px;
    border: none;
    display: block;
}

/* Fullscreen state */
.game-wrapper:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.game-wrapper:fullscreen .game-frame-box,
.game-wrapper:fullscreen .game-frame-box iframe {
    width: 100vw;
    height: calc(100vh - 44px);
}

/* Mobile: fill remaining viewport height */
@media screen and (max-width: 840px) {
    body {
        display: flex;
        flex-direction: column;
    }

    main {
        padding: 0;
        flex: 1;
        align-items: stretch;
    }

    .game-wrapper {
        width: 100%;
        border-radius: 0;
        flex: 1;
    }

    .game-frame-box {
        width: 100%;
        flex: 1;
        height: auto;
    }

    .game-frame-box iframe {
        width: 100%;
        height: 100%;
    }

    .share-box {
        margin: 0 0;
        border-radius: 0;
    }
}