.game-page {
    --accent: #7c3aed;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: #14101f;
    font-family: var(--font-body);
}

.game-bar {
    background: #1e1a2e;
    color: white;
    padding: 0.7rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    border-bottom: 3px solid var(--accent);
}

.game-bar-info {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.game-back {
    color: #c9c0e0;
    text-decoration: none;
    font-size: 1.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.6rem;
    flex-shrink: 0;
}

.game-back:hover { background: #2a2440; color: white; }

.game-bar-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.game-bar-icon img {
    width: 34px;
    height: 34px;
    border-radius: 0.6rem;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.game-bar-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-bar-sub {
    font-size: 0.75rem;
    color: #a99fc4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.game-bar-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.game-bar-actions button {
    background: var(--accent);
    color: white;
    border: none;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.8rem;
    cursor: pointer;
    font-size: 1.05rem;
}

.game-bar-actions button:hover { filter: brightness(1.1); }

.game-container {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.game-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    color: #a99fc4;
    font-size: 0.85rem;
    font-weight: 700;
    background: #000;
    transition: opacity 0.25s ease;
}

.game-loader.hidden { opacity: 0; pointer-events: none; }

.spinner {
    width: 34px;
    height: 34px;
    border: 4px solid #2a2440;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#gameFrame { width: 100%; height: 100%; border: none; background: white; }

.python-code {
    background: #14101f;
    color: #d4cfe8;
    border-top: 3px solid var(--accent);
    max-height: 180px;
    overflow: auto;
}

.python-code summary {
    padding: 0.6rem 1.1rem;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    color: #a99fc4;
    user-select: none;
}

.python-code pre {
    padding: 0 1.1rem 0.75rem;
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.72rem;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 640px) {
    .game-bar-actions button {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.2rem;
    }
    .game-bar-title { font-size: 0.92rem; }
    .game-bar-sub { display: none; } /* на маленьком экране убираем, чтобы не переполнять шапку */
}
