:root {
    --gold: #FFB711;
    --bg: #050505;
    --card: #0d0d0d;
    --card-glow: rgba(255, 183, 17, 0.03);
    --mut: #808080;
    --brd: #1a1a1a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    background-image: 
        linear-gradient(rgba(26, 26, 26, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 26, 26, 0.4) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center;
    color: #fff;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.cb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.cb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cb-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.cb-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.border-top {
    border-top: 1px solid var(--brd);
}

.text-center {
    text-align: center !important;
}

/* ==================== СТИЛИ ДЛЯ ИКОНОК LUCIDE ==================== */
.lucide {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2px;
    display: inline-block;
    vertical-align: middle;
}

.btn-icon {
    margin-right: 8px;
    width: 1.1rem;
    height: 1.1rem;
    stroke-width: 2.2px;
}

.badge-icon {
    margin-right: 6px;
    width: 1rem;
    height: 1rem;
    color: var(--gold);
    stroke-width: 2.5px;
}

.catalog-tag-icon {
    margin-right: 6px;
    width: 0.95rem;
    height: 0.95rem;
    color: var(--gold);
}

.timeline-header-icon, .news-header-icon {
    margin-right: 8px;
    width: 1.4rem;
    height: 1.4rem;
    color: var(--gold);
    vertical-align: -2px;
}

.refresh-icon {
    margin-right: 6px;
    width: 1.05rem;
    height: 1.05rem;
}

.lucide-lg {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--gold);
    stroke-width: 1.5px;
}
/* ================================================================= */

/* ==================== СТИЛИ ДЛЯ ПРЕДОТВРАЩЕНИЯ РАСТЯГИВАНИЯ ИЗОБРАЖЕНИЙ ==================== */
.logo-box {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    overflow: hidden !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #000 !important;
    border: 1px solid rgba(255, 183, 17, 0.3) !important;
}

.logo-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.glowing-ring {
    width: 130px !important;
    height: 130px !important;
    max-width: 130px !important;
    max-height: 130px !important;
    min-width: 130px !important;
    min-height: 130px !important;
    margin: 0 auto 24px auto !important;
    border-radius: 50% !important;
    padding: 6px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, var(--gold), #553b00) !important;
    box-shadow: 0 0 30px rgba(255, 183, 17, 0.2) !important;
}

.team-avatar-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

.team-logo-wrap {
    width: 120px !important;
    height: 120px !important;
    max-width: 120px !important;
    max-height: 120px !important;
    min-width: 120px !important;
    min-height: 120px !important;
    margin: 40px auto 32px auto !important;
    border-radius: 50% !important;
    padding: 5px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, var(--gold), #222) !important;
}

.team-center-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}
/* ========================================================================================= */

/* Header */
.cb-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--brd);
    padding: 16px 0;
}

.cb-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #fff;
}

.logo-sub {
    font-size: 9px;
    color: var(--gold);
    letter-spacing: 0.25em;
    font-weight: 600;
}

.cb-nav {
    display: flex;
    gap: 24px;
}

.cb-nav a {
    font-size: 14px;
    color: var(--mut);
    transition: color 0.2s;
    font-weight: 500;
}

.cb-nav a:hover {
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-home {
    display: flex;
    align-items: center;
    background: rgba(255, 183, 17, 0.1);
    color: var(--gold);
    border: 1px solid rgba(255, 183, 17, 0.2);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-home:hover {
    background: rgba(255, 183, 17, 0.18);
}

.cb-lang {
    background: #111;
    border: 1px solid var(--brd);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.btn-start {
    background: var(--gold);
    color: #000;
    padding: 8px 20px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

/* Hero Section */
.cb-hero {
    padding: 100px 0 80px 0;
    position: relative;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cb-badge {
    align-self: flex-start;
    background: rgba(255, 183, 17, 0.1);
    color: var(--gold);
    border: 1px solid rgba(255, 183, 17, 0.2);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

.cb-h1 {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 24px;
}

.glow-text {
    color: var(--gold);
    text-shadow: 0 0 30px rgba(255, 183, 17, 0.2);
}

.hero-desc {
    color: var(--mut);
    font-size: 16px;
    margin-bottom: 36px;
    max-width: 500px;
}

.hero-ctas {
    display: flex;
    gap: 16px;
}

.btn-primary {
    background: var(--gold);
    color: #000;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    transition: transform 0.2s, background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #e0a20f;
}

.btn-outline {
    border: 1px solid var(--brd);
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: border 0.2s;
}

.btn-outline:hover {
    border-color: var(--gold);
}

.hero-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Командная карточка */
.hero-team-card {
    background: radial-gradient(circle at center, rgba(255, 183, 17, 0.08) 0%, rgba(20, 20, 20, 0.8) 80%);
    border: 1px solid rgba(255, 183, 17, 0.15);
    border-radius: 28px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.hero-team-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.hero-team-card p {
    font-size: 11px;
    color: var(--mut);
    letter-spacing: 0.15em;
    font-weight: 600;
}

/* Статистика */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(13, 13, 13, 0.6);
    border: 1px solid var(--brd);
    border-radius: 20px;
    padding: 24px;
    margin-top: 60px;
}

.stat-col {
    text-align: center;
    border-right: 1px solid var(--brd);
}

.stat-col:last-child {
    border-right: none;
}

.stat-val {
    font-family: 'Oswald', sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--gold);
}

.stat-lbl {
    font-size: 11px;
    color: var(--mut);
    margin-top: 4px;
    letter-spacing: 0.1em;
}

/* Секционные заголовки */
.cb-section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-tag {
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--mut);
    max-width: 600px;
    margin: 0 auto;
}

/* Карточки */
.cb-card {
    background: var(--card);
    border: 1px solid var(--brd);
    border-radius: 24px;
    padding: 32px;
    transition: transform 0.2s, border 0.2s;
}

.cb-card:hover {
    border-color: rgba(255, 183, 17, 0.2);
}

/* Блок загрузки */
.scan-uploader-card {
    display: flex;
    flex-direction: column;
}

.cb-drop {
    border: 2px dashed rgba(255, 183, 17, 0.3);
    border-radius: 18px;
    padding: 48px 24px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.uploader-icon-wrap {
    width: 64px;
    height: 64px;
    background: rgba(255, 183, 17, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--gold);
}

.uploader-icon-wrap .lucide {
    width: 28px;
    height: 28px;
}

.uploader-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.uploader-subtitle {
    color: var(--mut);
    font-size: 13px;
    margin-bottom: 24px;
}

.uploader-buttons {
    display: flex;
    gap: 12px;
}

.btn-primary-mini {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-mini {
    background: transparent;
    border: 1px solid var(--brd);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-outline-mini:hover {
    border-color: var(--gold);
}

.btn-primary-block {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    margin-top: 16px;
    text-align: center;
}

/* Превью результата */
.result-display-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 380px;
}

.result-placeholder {
    text-align: center;
    padding: 32px;
}

.placeholder-icon {
    font-size: 40px;
    color: var(--gold);
    margin-bottom: 20px;
}

.result-placeholder h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.result-placeholder p {
    color: var(--mut);
    font-size: 14px;
    line-height: 1.6;
}

/* Веб-камера (ИСПРАВЛЕНО: Видео обрезается строго внутри изолированного контейнера, не ломая кнопки) */
.video-zoom-container {
    position: relative !important;
    width: 100% !important;
    height: 260px !important;
    overflow: hidden !important; /* Обрезает увеличенное при зуме видео */
    border-radius: 12px !important;
    background: #000 !important;
}

#video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    transition: transform 0.15s ease-out !important; /* Плавный переход для зума */
}

#preview {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-radius: 12px;
}

.cb-zoom {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    position: relative;
    z-index: 5;
}

.cb-zoom button {
    background: #222;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 5;
}

/* ==================== СТИЛИ ДЛЯ КНОПОК КАМЕРЫ (Түсіру / Бас тарту) ==================== */
.cam-controls {
    display: flex !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-top: 16px !important;
    position: relative !important;
    z-index: 10 !important;
}

.cam-controls button {
    padding: 12px 24px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
    border: none !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.1s, border-color 0.2s !important;
}

/* Кнопка "Түсіру" (Сделать снимок) — Золотая */
#btnCapture {
    background: var(--gold) !important;
    color: #000 !important;
    box-shadow: 0 4px 15px rgba(255, 183, 17, 0.2) !important;
}

#btnCapture:hover {
    background: #e0a20f !important;
    transform: translateY(-1px) !important;
}

#btnCapture:active {
    transform: translateY(1px) !important;
}

/* Кнопка "Бас тарту" (Отмена) — Темная графитовая */
#btnCancel {
    background: #111 !important;
    color: #fff !important;
    border: 1px solid var(--brd) !important;
}

#btnCancel:hover {
    background: #1c1c1c !important;
    border-color: #333 !important;
    transform: translateY(-1px) !important;
}

#btnCancel:active {
    transform: translateY(1px) !important;
}

/* Процесс (Шаги) */
.step-card {
    display: flex;
    flex-direction: column;
}

.step-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.step-icon {
    color: var(--gold);
}

.step-icon.lucide {
    width: 2.25rem;
    height: 2.25rem;
    stroke-width: 1.8px;
}

.step-num {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--brd);
}

.step-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.step-card p {
    color: var(--mut);
    font-size: 14px;
}

/* Каталог наследия */
.catalog-grid {
    margin-bottom: 60px;
}

.catalog-card {
    height: 240px;
    border-radius: 24px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--brd);
}

.map-card {
    background: linear-gradient(rgba(0,0,0,0.65), #000), url('../img/map_bg.png') center/cover !important;
}

.stones-card {
    background: linear-gradient(rgba(0,0,0,0.65), #000), url('../img/excavation.png') center/cover !important;
}

.catalog-tag {
    align-self: flex-start;
    background: rgba(255, 183, 17, 0.15);
    color: var(--gold);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.catalog-content h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    color: #fff;
    margin-bottom: 6px;
}

.catalog-content p {
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
}

/* Стилизация Таймлайна */
.timeline-container {
    background: rgba(13, 13, 13, 0.4);
    border: 1px solid var(--brd);
    border-radius: 24px;
    padding: 40px;
}

.timeline-title {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    margin-bottom: 32px;
    color: var(--gold);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(to bottom, var(--gold), #222);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -32px;
    top: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.timeline-dot .lucide {
    width: 13px !important;
    height: 13px !important;
    color: var(--gold);
    stroke-width: 2.2px;
}

.timeline-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid var(--brd);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.timeline-card:hover {
    background: rgba(25, 25, 25, 0.8);
}

.timeline-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timeline-era {
    font-family: 'Oswald', sans-serif;
    color: var(--gold);
    font-weight: 700;
    font-size: 14px;
}

.timeline-badge {
    background: rgba(255, 183, 17, 0.08);
    border: 1px solid rgba(255, 183, 17, 0.15);
    color: var(--gold);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.timeline-name {
    font-size: 16px;
    font-weight: 500;
}

/* Блок Новостей */
.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.news-subtitle {
    margin-top: 8px !important;
    text-align: left !important;
}

.source-link {
    color: var(--gold);
    font-weight: 600;
    font-size: 13px;
    margin-top: 4px;
    display: inline-block;
}

.source-link a {
    text-decoration: underline;
}

.btn-refresh {
    background: rgba(255, 183, 17, 0.1);
    border: 1px solid rgba(255, 183, 17, 0.2);
    color: var(--gold);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background: rgba(255, 183, 17, 0.18);
}

.error-alert-box {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    color: #f88;
    padding: 16px;
    font-size: 13px;
    margin-bottom: 24px;
    font-family: monospace;
    white-space: pre-wrap;
    line-height: 1.5;
}

/* ==================== ИСПРАВЛЕНО ЦЕНТРИРОВАНИЕ КНОПКИ I-STARS.KZ ==================== */
.team-action {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    margin-top: 36px !important;
    width: 100% !important;
}

.btn-outline-large {
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 14px 40px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    display: inline-block;
    text-align: center !important;
}

.btn-outline-large:hover {
    background: var(--gold);
    color: #000;
}
/* ==================================================================================== */

/* СТИЛИЗАЦИЯ БЕЙДЖА РЕДКОСТИ */
.rarity-badge {
    background: rgba(255, 183, 17, 0.15) !important;
    color: var(--gold) !important;
    border: 2px solid var(--gold) !important;
    padding: 6px 16px !important;
    border-radius: 8px !important;
    font-weight: 800 !important;
    font-size: 15px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    display: inline-block !important;
    box-shadow: 0 0 15px rgba(255, 183, 17, 0.2) !important;
    animation: pulseGlow 2s infinite alternate !important;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px rgba(255, 183, 17, 0.2);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 183, 17, 0.45);
    }
}

/* Футер */
.cb-foot {
    border-top: 1px solid var(--brd);
    padding: 32px 0;
    text-align: center;
    color: var(--mut);
    font-size: 13px;
}

/* Медиа-запросы */
@media (max-width: 880px) {
    .cb-grid-2, .cb-grid-3 {
        grid-template-columns: 1fr;
    }
    .cb-nav {
        display: none;
    }
    .flex-header {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
    .timeline-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}