/* ═══════════════════════════════════════════════════════════
   StreamG — Components
   Общие компоненты для всех страниц
   ═══════════════════════════════════════════════════════════ */

/* ─── Кнопки ─── */
.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    display: inline-block;
    text-align: center;
    font-family: inherit;
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #0a0a0a;
}
.btn-primary:hover {
    background: var(--accent-bright);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.btn-lg {
    padding: 16px 40px;
    font-size: 16px;
}

/* ─── Инпуты ─── */
.input {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.input:focus { border-color: var(--accent); }

/* ─── Breadcrumb ─── */
.breadcrumb {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { color: var(--accent-bright); }

/* ─── Section title ─── */
.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* ─── Empty / Loading ─── */
.empty {
    color: var(--text-secondary);
    padding: 40px 0;
    text-align: center;
}
.loading {
    color: var(--text-secondary);
    padding: 80px 0;
    text-align: center;
}

/* ─── Карточка (общий контейнер) ─── */
.card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 32px;
}

/* ─── Сообщения ─── */
.msg {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 16px;
    display: none;
}
.msg.visible { display: block; }
.msg.error {
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    color: var(--danger);
}
.msg.success {
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    color: var(--accent);
}

/* ─── Статус-точка ─── */
.status-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #333;
}
.status-dot.online {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}
.status-dot.offline { background: #666; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════
   КАРТОЧКА ИГРЫ
   ═══════════════════════════════════════════════════════════ */
.game-card {
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s;
    width: 220px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.game-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-4px);
}

.game-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center;
    background-color: #0f1408;
}

.game-bar {
    background: rgba(0, 0, 0, 0.95);
    height: 50px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.game-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    line-height: 1.3;
    width: 100%;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   КАРТОЧКА ХОСТА
   ═══════════════════════════════════════════════════════════ */
.host-card {
    background: var(--bg-card);
    border: 2px solid var(--border-strong);
    border-radius: 10px;
    padding: 20px 22px;
    width: 330px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.25s;
    cursor: pointer;
    flex-shrink: 0;
}

.host-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-4px);
}

.host-card.static { cursor: default; }
.host-card.static:hover { transform: none; }

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.pc-code {
    font-family: 'Consolas', monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.card-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fav {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
    padding: 2px;
    user-select: none;
}
.fav:hover { color: #ff4d4d; transform: scale(1.1); }
.fav.active { color: #ff4d4d; }

.host-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}
.host-status .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s infinite;
}
.host-status.offline {
    color: #666;
    background: rgba(255, 255, 255, 0.05);
}
.host-status.offline .dot {
    background: #666;
    box-shadow: none;
    animation: none;
}
.host-status.busy {
    color: var(--warning);
    background: var(--warning-soft);
}
.host-status.busy .dot {
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
    animation: pulse 2s infinite;
}

.host-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.host-gpu {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.host-cpu {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.host-ping {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

.host-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.host-price-btn {
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.host-price-btn:hover { border-color: var(--accent); }

.host-price-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.host-price-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

/* ─── Тумблер ─── */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.toggle-track {
    width: 42px;
    height: 22px;
    background: #333;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: left 0.2s;
}
.toggle.on .toggle-track { background: var(--accent); }
.toggle.on .toggle-track::after { left: 23px; }
.toggle-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}
.toggle.on .toggle-label { color: var(--accent); }

/* ─── Модалка ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal {
    width: 480px;
    max-width: 92vw;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 28px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-close {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.modal-close:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-bg-soft);
}

/* ─── Плашка активной сессии ─── */
.session-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border: 2px solid var(--danger);
    border-radius: 10px;
    background: var(--danger-bg-soft);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.session-badge-link {
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-decoration: none;
}
.session-badge-link:hover {
    text-decoration: underline;
}

/* ─── Адаптив ─── */
@media (max-width: 768px) {
    .btn { padding: 8px 16px; font-size: 13px; }
    .btn-lg { padding: 14px 28px; font-size: 15px; }
}

@media (max-width: 640px) {
    .session-badge {
        position: static;
        transform: none;
        padding: 4px 10px;
    }
    .session-badge-link { font-size: 11px; }
}