/* ==========================================================================
   ГЕЙМКОНТРОЛЬ ТЮМЕНЬ (PlayControl) — ДВУХТЕМНАЯ ДИЗАЙН-СИСТЕМА
   PS5 Midnight (Dark) + PS5 White Slim (Light) | Zero Horizontal Overflow
   ========================================================================== */

:root,
[data-theme="dark"] {
    --gc-bg: #070b16;
    --gc-bg-gradient: radial-gradient(ellipse at 80% 0%, rgba(0, 112, 209, 0.22) 0%, #070b16 55%);
    --gc-surface-card: #0f172a;
    --gc-surface-elevated: #16213d;
    --gc-surface-subtle: #131d35;
    --gc-navbar-bg: rgba(7, 11, 22, 0.90);
    --gc-border: rgba(148, 163, 184, 0.16);
    --gc-border-strong: rgba(0, 212, 255, 0.35);
    --gc-text-main: #f8fafc;
    --gc-text-sub: #cbd5e1;
    --gc-text-muted: #94a3b8;
    --gc-ps-blue: #0070d1;
    --gc-ps-blue-bright: #0095ff;
    --gc-ps-cyan: #00d4ff;
    --gc-success: #10b981;
    --gc-warning: #f59e0b;
    --gc-danger: #ef4444;
    --gc-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
    --gc-input-bg: #091022;
}

[data-theme="light"] {
    --gc-bg: #f3f6fc;
    --gc-bg-gradient: radial-gradient(ellipse at 80% 0%, rgba(0, 112, 209, 0.10) 0%, #f3f6fc 55%);
    --gc-surface-card: #ffffff;
    --gc-surface-elevated: #f8fafc;
    --gc-surface-subtle: #edf2f9;
    --gc-navbar-bg: rgba(255, 255, 255, 0.92);
    --gc-border: rgba(15, 23, 42, 0.11);
    --gc-border-strong: rgba(0, 112, 209, 0.32);
    --gc-text-main: #0f172a;
    --gc-text-sub: #334155;
    --gc-text-muted: #64748b;
    --gc-ps-blue: #0066cc;
    --gc-ps-blue-bright: #0077ed;
    --gc-ps-cyan: #0284c7;
    --gc-success: #059669;
    --gc-warning: #d97706;
    --gc-danger: #dc2626;
    --gc-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    --gc-input-bg: #ffffff;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--gc-bg);
    background-image: var(--gc-bg-gradient);
    background-attachment: fixed;
    color: var(--gc-text-main);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.55;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 992px) {
    body {
        padding-bottom: 0 !important;
    }
}

.gc-text-main { color: var(--gc-text-main) !important; }
.gc-text-sub { color: var(--gc-text-sub) !important; }
.gc-text-muted { color: var(--gc-text-muted) !important; }
.text-ps-blue { color: var(--gc-ps-blue-bright) !important; }
.text-ps-cyan { color: var(--gc-ps-cyan) !important; }
.max-w-720 { max-width: 720px; }

/* Навигация */
.gc-navbar {
    background: var(--gc-navbar-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--gc-border);
    padding: 0.6rem 0;
    z-index: 1030;
}

.gc-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none !important;
    color: var(--gc-text-main) !important;
}

.gc-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #0055b8 0%, #00b4ff 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 149, 255, 0.38);
    flex-shrink: 0;
}

.gc-brand-title {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.gc-brand-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 149, 255, 0.14);
    border: 1px solid rgba(0, 149, 255, 0.32);
    color: var(--gc-ps-cyan);
    white-space: nowrap;
}

.gc-nav-link {
    color: var(--gc-text-sub) !important;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.45rem 0.68rem !important;
    border-radius: 999px;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.gc-nav-link:hover,
.gc-nav-link.active {
    color: var(--gc-text-main) !important;
    background: var(--gc-surface-subtle);
}

.gc-theme-btn {
    border: 1px solid var(--gc-border);
    background: var(--gc-surface-subtle);
    color: var(--gc-text-main);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Кнопки */
.gc-btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #00a3ff 100%);
    color: #ffffff !important;
    border: none;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(0, 132, 255, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gc-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 132, 255, 0.45);
}

.gc-btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff !important;
    border: none;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.28);
}

.gc-btn-outline {
    background: var(--gc-surface-subtle);
    color: var(--gc-text-main) !important;
    border: 1px solid var(--gc-border);
    font-weight: 600;
}

.gc-btn-outline:hover {
    border-color: var(--gc-ps-cyan);
    color: var(--gc-ps-cyan) !important;
}

/* Бейджи */
.gc-bento-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.32rem 0.85rem;
    border-radius: 999px;
    background: rgba(0, 149, 255, 0.13);
    border: 1px solid rgba(0, 149, 255, 0.32);
    color: var(--gc-ps-cyan);
}

.gc-badge-green, .gc-badge-yellow, .gc-badge-red, .gc-badge-blue, .gc-badge-muted {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.gc-badge-green { background: rgba(16, 185, 129, 0.16); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.38); }
.gc-badge-yellow { background: rgba(245, 158, 11, 0.16); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.38); }
.gc-badge-red { background: rgba(239, 68, 68, 0.16); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.38); }
.gc-badge-blue { background: rgba(0, 149, 255, 0.16); color: var(--gc-ps-cyan); border: 1px solid rgba(0, 149, 255, 0.38); }
.gc-badge-muted { background: var(--gc-surface-subtle); color: var(--gc-text-muted); border: 1px solid var(--gc-border); }

/* Карточки и Hero */
.gc-card, .gc-bento-card {
    background: var(--gc-surface-card);
    border: 1px solid var(--gc-border);
    border-radius: 22px;
    padding: 1.5rem;
    box-shadow: var(--gc-shadow);
    transition: border-color 0.2s ease, transform 0.15s ease;
}

.gc-bento-card {
    height: 100%;
}

.gc-bento-card:hover {
    border-color: var(--gc-border-strong);
}

.gc-hero-title {
    font-size: clamp(1.85rem, 4.2vw, 3.25rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.gc-hero-stage {
    background: linear-gradient(155deg, #0b132b 0%, #091d42 100%);
    border: 1px solid rgba(0, 212, 255, 0.30);
    border-radius: 26px;
    padding: 1.4rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    color: #f8fafc;
}

.gc-hero-img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gc-spec-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.35rem 0.78rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: gcPulse 2s infinite;
}

@keyframes gcPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Тарифы и Комплект */
.gc-tariff-featured {
    border: 2px solid var(--gc-ps-cyan) !important;
    position: relative;
}

.gc-price-big {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.1;
}

.kit-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.95rem 1.15rem;
    margin-bottom: 0.75rem;
    border-radius: 16px;
    background: var(--gc-surface-card);
    border: 1px solid var(--gc-border);
}

/* Калькулятор */
.gc-calc-box {
    background: linear-gradient(135deg, #081229 0%, #0b2559 100%);
    border: 1px solid rgba(0, 212, 255, 0.38);
    border-radius: 26px;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    color: #fff;
    box-shadow: 0 24px 60px rgba(0, 20, 60, 0.45);
}

.gc-calc-result {
    background: rgba(7, 11, 22, 0.68);
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
}

/* Сравнительная таблица */
.gc-comp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--gc-surface-card);
    border: 1px solid var(--gc-border);
    border-radius: 18px;
    overflow: hidden;
}

.gc-comp-table th, .gc-comp-table td {
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid var(--gc-border);
    font-size: 0.9rem;
}

.gc-comp-table .col-highlight {
    background: rgba(0, 149, 255, 0.07);
}

/* Формы */
.form-control, .form-select {
    background-color: var(--gc-input-bg);
    color: var(--gc-text-main);
    border: 1px solid var(--gc-border);
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--gc-input-bg);
    color: var(--gc-text-main);
    border-color: var(--gc-ps-cyan);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.18);
}

/* Суб-навигация ЛК и ERP */
.erp-tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--gc-text-sub);
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.erp-tab-pill:hover {
    background: var(--gc-surface-subtle);
    color: var(--gc-text-main);
}

.erp-tab-pill.active {
    background: linear-gradient(135deg, #0066cc, #0095ff);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 132, 255, 0.35);
}

.gc-kpi-card {
    background: var(--gc-surface-card);
    border-radius: 20px;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--gc-border);
    height: 100%;
}

/* Нижняя панель ТОЛЬКО для мобильных экранов (< 992px) */
.mobile-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--gc-navbar-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--gc-border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 992px) {
    .mobile-nav-bar {
        display: none !important;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--gc-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    text-decoration: none !important;
    padding: 2px 6px;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--gc-ps-cyan);
}

/* Плавающая кнопка Telegram */
.gc-floating-tg {
    position: fixed;
    right: 18px;
    bottom: 22px;
    z-index: 1025;
}

@media (max-width: 991.98px) {
    .gc-floating-tg {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        right: 14px;
    }
}

.gc-tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0088cc, #00aee6);
    color: #fff !important;
    text-decoration: none !important;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.86rem;
    box-shadow: 0 8px 24px rgba(0, 136, 204, 0.42);
}

/* Умный PWA баннер и iOS шторка */
.pwa-install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    z-index: 1042;
    max-width: 480px;
    margin: 0 auto;
    background: var(--gc-surface-elevated);
    border: 1px solid var(--gc-border-strong);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

@media (min-width: 992px) {
    .pwa-install-banner { bottom: 20px; left: 20px; right: auto; margin: 0; }
}

.pwa-ios-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
}

.pwa-ios-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.pwa-ios-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 480px;
    margin: 0 auto;
    background: var(--gc-surface-card);
    border-top: 2px solid var(--gc-ps-cyan);
    border-radius: 24px 24px 0 0;
    padding: 20px 20px calc(22px + env(safe-area-inset-bottom, 0px));
}


/* Дополнительные флагманские компоненты ERP, Таблиц, Hero и Камеры */
.max-w-720 {
    max-width: 740px;
}

.gc-hero-box {
    background: var(--gc-surface-card);
    border: 1px solid var(--gc-border-strong);
    border-radius: 26px;
    box-shadow: var(--gc-shadow);
}

.gc-hero-photo-wrap {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(0, 212, 255, 0.32);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.gc-hero-photo-wrap img {
    width: 100%;
    height: auto;
    max-height: 390px;
    object-fit: cover;
    display: block;
}

.gc-hero-floating-chip {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    background: rgba(7, 11, 22, 0.86);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 14px;
    padding: 10px 14px;
}

.gc-table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--gc-text-main) !important;
    --bs-table-border-color: var(--gc-border) !important;
    color: var(--gc-text-main) !important;
}

.gc-table thead th {
    color: var(--gc-text-muted) !important;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--gc-border) !important;
    padding: 0.85rem 0.9rem;
    white-space: nowrap;
}

.gc-table tbody td {
    color: var(--gc-text-main) !important;
    border-bottom: 1px solid var(--gc-border) !important;
    padding: 0.9rem;
    font-size: 0.9rem;
}

.erp-kpi-card {
    background: var(--gc-surface-card);
    border: 1px solid var(--gc-border);
    border-radius: 20px;
    padding: 1.25rem 1.35rem;
    box-shadow: var(--gc-shadow);
    height: 100%;
    border-left-width: 4px;
}

.erp-kpi-card.kpi-blue { border-left-color: #0095ff; }
.erp-kpi-card.kpi-green { border-left-color: #10b981; }
.erp-kpi-card.kpi-amber { border-left-color: #f59e0b; }
.erp-kpi-card.kpi-red { border-left-color: #ef4444; }

.gc-alert-success, .gc-alert-danger, .gc-alert-info {
    border-radius: 16px;
    padding: 0.95rem 1.15rem;
    border: 1px solid transparent;
}

.gc-alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.38);
    color: var(--gc-text-main);
}

.gc-alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.42);
    color: var(--gc-text-main);
}

.gc-alert-info {
    background: rgba(0, 149, 255, 0.12);
    border-color: rgba(0, 149, 255, 0.38);
    color: var(--gc-text-main);
}

.gc-camera-viewport {
    position: relative;
    width: 100%;
    min-height: 240px;
    max-height: 360px;
    background: radial-gradient(circle at center, #0e1e3f 0%, #070b16 100%);
    border: 1px dashed rgba(0, 212, 255, 0.45);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-camera-viewport video {
    width: 100%;
    max-height: 356px;
    object-fit: cover;
}
