.page-game .container {
    max-width: none;
}

.page-game .main-content {
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
}

.page-game .header {
    padding: 28px;
}

.page-game .info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.page-game .info-item {
    background: rgba(14, 165, 164, 0.08);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-game .info-item label {
    font-weight: 600;
    color: var(--muted);
}

.page-game .info-item input,
.page-game .info-item select {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    font-size: 0.95rem;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
}

.page-game .info-item input:focus,
.page-game .info-item select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.18);
}

.page-game .game-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-game .level-info {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-strong);
}

.page-game .map-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.page-game .game-mapping-panel {
    margin-bottom: 18px;
    padding: 16px;
}

.page-game .compact-panel-header {
    margin-bottom: 12px;
}

.page-game .mapping-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 10px;
}

.page-game .mapping-grid label {
    display: grid;
    gap: 7px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 118, 110, 0.12);
}

.page-game .mapping-grid span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.page-game .mapping-grid select {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.page-game .game-container {
    position: relative;
    background: rgba(255, 255, 255, 0.92);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.page-game #game-canvas {
    border: 3px solid var(--accent);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    display: block;
    touch-action: none;
}

.page-game .victory-message {
    position: absolute;
    inset: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(14, 165, 164, 0.95), rgba(249, 115, 22, 0.95));
    color: #fff;
    padding: 32px 44px;
    border-radius: 18px;
    text-align: center;
    box-shadow: var(--shadow-strong);
    animation: victoryPulse 1.1s ease-in-out infinite;
}

.page-game .victory-message.hidden {
    display: none;
}

.page-game .victory-message h2 {
    font-size: 2rem;
    font-weight: 700;
}

@keyframes victoryPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.04);
    }
}

@media (max-width: 768px) {
    .page-game .mapping-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-game .game-container {
        padding: 16px;
    }

    .page-game .victory-message {
        width: calc(100% - 40px);
        padding: 28px 30px;
    }

    .page-game .victory-message h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .page-game .info-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-game .info-item input,
    .page-game .info-item select {
        width: 100%;
    }

    .page-game .mapping-grid {
        grid-template-columns: 1fr;
    }
}
