/**
 * ORAKUL.SU — Фон: видео + переключатель оракулов
 */

/* ===== ВИДЕО-ФОН ===== */
.bg-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    overflow: hidden;
}

.bg-video {
    position: absolute;
    top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    object-fit: cover;
    /* Затемняем — чёрно-синий оверлей через filter */
    filter: brightness(0.55);
}

.bg-video.active {
    opacity: 1;
}

/* Оверлей поверх видео — чёрно-синий слой для контраста золотых бордеров */
.bg-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    background: linear-gradient(135deg,
        rgba(0, 0, 10, 0.65) 0%,
        rgba(4, 4, 28, 0.55) 50%,
        rgba(0, 0, 10, 0.60) 100%);
    pointer-events: none;
}

/* Canvas-заглушка (если видео не загрузились) */
.bg-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
    background: #000008;
}

/* ===== КНОПКА ПЕРЕКЛЮЧЕНИЯ ОРАКУЛОВ — стиль как "Спросить Оракула" ===== */
/* Кнопка удалена. Стили .oracle-switcher оставлены как референс для боковых меню. */
.oracle-switcher,
.oracle-switcher.red-mode { display: none !important; }

/* ===== БОКОВЫЕ ПАНЕЛИ МЕНЮ — те же бордеры/свечение что у удалённой кнопки ===== */
.oracle-sidebar {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 14px;
    background: transparent;
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    box-shadow: 0 0 8px var(--gold-glow), inset 0 0 8px var(--gold-glow);
    backdrop-filter: blur(10px);
    font-family: 'Montserrat', sans-serif;
    max-width: 160px;
}

.oracle-sidebar .sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oracle-sidebar-left  { left: 15px; }
.oracle-sidebar-right { right: 15px; }

.sidebar-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    color: var(--gold-light);
    border: 1px solid var(--gold-border);
    border-radius: 8px;
    box-shadow: 0 0 8px var(--gold-glow), inset 0 0 8px var(--gold-glow);
    cursor: pointer;
    transition: all 0.4s ease;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
    color: #ffffff;
    font-weight: 700;
}

.sidebar-btn:hover {
    background: rgba(197, 165, 90, 0.15);
    border-color: var(--gold-light);
    box-shadow: 0 0 16px var(--gold-glow), inset 0 0 16px var(--gold-glow);
    transform: translateX(2px);
}

.save-answer-btn {
    margin-top: 16px;
    width: 100%;
    font-size: 0.9rem;
    padding: 10px 14px;
}

.sub-status-badge {
    display: inline-block;
    margin: 8px auto 16px;
    padding: 6px 14px;
    border: 1px solid var(--gold-border);
    border-radius: 6px;
    box-shadow: 0 0 6px var(--gold-glow), inset 0 0 6px var(--gold-glow);
    color: var(--gold-light);
    font-size: 0.78rem;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.5px;
}
.sub-status-badge.premium { color: #ffd76a; border-color: #ffd76a; }
.sub-status-badge.demo    { color: #b9f0ff; border-color: #6cc7e0; box-shadow: 0 0 6px rgba(108,199,224,0.4), inset 0 0 6px rgba(108,199,224,0.4); }
.sub-status-badge.limit   { color: #ffb6b6; border-color: #ff7676; box-shadow: 0 0 6px rgba(239,68,68,0.4), inset 0 0 6px rgba(239,68,68,0.4); }
.sub-status-badge a { color: inherit; text-decoration: underline; }

.payment-required {
    text-align: center;
    padding: 20px 10px;
}
.payment-required h3 { color: #ffb6b6; margin-bottom: 8px; }
@media (max-width: 768px) {
    .oracle-sidebar { display: none; }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 800px) {
    .oracle-result-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 16px;
        padding: 0 10px;
    }
    .result-col {
        padding: 12px;
        font-size: 0.88rem;
        max-height: none;
    }
    .qmdj-grid { gap: 4px; }
    .qmdj-palace {
        min-height: 64px;
        padding: 4px 2px;
        font-size: 0.7rem;
    }
    .qmdj-palace-label { font-size: 0.55rem; }
    .qmdj-row1, .qmdj-row2 { font-size: 0.75rem; gap: 1px; }
    .four-pillars {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 3px !important;
    }
    .four-pillars .pillar { padding: 4px 1px !important; }
    .pillar-label { font-size: 0.65rem !important; }
    .pillar-vertical .ns { font-size: 1.05rem; }
    .pillar-vertical .zv { font-size: 0.95rem; }
    .chinese-calendar h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
}

@media (max-width: 480px) {
    .oracle-title { font-size: 1.6rem !important; }
    .oracle-subtitle { font-size: 0.8rem !important; padding: 0 10px; }
    .glass-panel { padding: 14px !important; margin: 10px !important; }
    .question-input { font-size: 0.9rem; }
    .ask-button { font-size: 0.9rem; padding: 12px 16px; }
    .gender-buttons { flex-wrap: wrap; }
    .gender-btn { font-size: 0.8rem; padding: 8px 12px; }
    .qmdj-palace { min-height: 56px; font-size: 0.6rem; }
    .qmdj-palace-label { font-size: 0.48rem; }
    .qmdj-row1, .qmdj-row2 { font-size: 0.66rem; }
    .pillar-vertical .ns { font-size: 0.95rem; }
    .pillar-vertical .zv { font-size: 0.85rem; }
    .qmdj-header { font-size: 0.6rem; }
    .qmdj-header > span { padding: 1px 4px; }
    .structures-section, .walks-section { font-size: 0.62rem; padding: 4px; }
}

/* ===== РАСШИРЕННЫЕ САЙДБАРЫ (когда задан вопрос) ===== */
.oracle-sidebar.expanded {
    width: 38vw;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}
.oracle-sidebar .sidebar-chart,
.oracle-sidebar .sidebar-answer {
    width: 100%;
    color: #f5e9c8;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ===== Сетка дворцов 3×3 (внутри двухколоночного блока) ===== */
.qmdj-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 12px;
}
.qmdj-palace {
    border: 1px solid var(--gold-border);
    box-shadow: 0 0 6px var(--gold-glow), inset 0 0 6px var(--gold-glow);
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
    background: rgba(15, 15, 25, 0.55);
    font-size: 0.85rem;
    line-height: 1.3;
    min-height: 80px;
    display: grid;
    grid-template-rows: auto 1fr 1fr;
    gap: 2px;
}
.qmdj-palace.kongwang { opacity: 0.55; }
.qmdj-palace.mastar { border-color: var(--gold-light); }
.qmdj-palace-label {
    font-size: 0.62rem;
    color: var(--gold-light);
    opacity: 0.85;
    border-bottom: 1px solid rgba(197,165,90,0.25);
    padding-bottom: 2px;
}
/* Первая строка: Дух · Ворота · НебоНС */
/* Вторая строка: Звезда · _ · ЗемляНС */
.qmdj-row1, .qmdj-row2 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 2px;
}
.qmdj-row1 .qmdj-shen { color: #f0d68a; font-family:'Noto Sans SC', serif; }
.qmdj-row1 .qmdj-men  { color: #f0d68a; font-family:'Noto Sans SC', serif; }
.qmdj-row1 .qmdj-tian { color: #ffd76a; font-weight:700; font-family:'Noto Sans SC', serif; }
.qmdj-row2 .qmdj-xing { color: #f0d68a; font-family:'Noto Sans SC', serif; }
.qmdj-row2 .qmdj-di   { color: #b9c8e8; font-family:'Noto Sans SC', serif; grid-column: 3; }
.qmdj-row2 .qmdj-spacer { }

.qmdj-header {
    display:flex; flex-wrap:wrap; gap:4px; justify-content:center;
    font-size:0.68rem; margin-bottom:6px;
}
.qmdj-header > span {
    border:1px solid var(--gold-border);
    padding: 2px 6px; border-radius:4px;
    color: var(--gold-light);
}
.structures-section, .walks-section {
    font-size: 0.7rem;
    margin: 6px 0;
    padding: 6px;
    border:1px solid rgba(197,165,90,0.3);
    border-radius:4px;
}
.structures-section h4, .walks-section h4 { font-size: 0.72rem; margin-bottom: 3px; color: var(--gold-light); }
.structures-section ul, .walks-section ul { list-style:none; padding-left:0; }
.structures-section li, .walks-section li { padding: 2px 0; }

/* ===== Двухколоночный блок результата ===== */
.oracle-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.result-col {
    border: 1px solid var(--gold-border);
    box-shadow: 0 0 8px var(--gold-glow), inset 0 0 8px var(--gold-glow);
    border-radius: 8px;
    padding: 16px;
    background: rgba(15, 15, 25, 0.45);
    color: #f5e9c8;
    font-size: 0.9rem;
    line-height: 1.5;
    min-height: 200px;
    overflow-y: auto;
    max-height: 75vh;
}
@media (max-width: 800px) {
    .oracle-result-grid { grid-template-columns: 1fr; }
}

/* ===== Столпы вертикально: НС над ЗВ ===== */
.pillar-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
}
.pillar-vertical .ns { font-size: 1.4rem; color: var(--gold-light); }
.pillar-vertical .zv { font-size: 1.2rem; color: #d8c896; }
.four-pillars { gap: 4px !important; }
.four-pillars .pillar { padding: 6px 2px !important; }

/* ===== Dot-анимация "оракул думает" ===== */
.oracle-thinking, .oracle-thinking-mini {
    display:flex; gap:8px; justify-content:center; align-items:center;
    padding: 30px 0;
}
.oracle-thinking-mini { padding: 12px 0; }
.oracle-thinking span, .oracle-thinking-mini span {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 8px var(--gold-glow);
    animation: orakul-think 1.2s infinite ease-in-out;
}
.oracle-thinking span:nth-child(2), .oracle-thinking-mini span:nth-child(2) { animation-delay: 0.2s; }
.oracle-thinking span:nth-child(3), .oracle-thinking-mini span:nth-child(3) { animation-delay: 0.4s; }
@keyframes orakul-think {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== КОНТЕЙНЕР ОРАКУЛА ===== */
.oracle-container {
    position: relative;
    z-index: 1;
}
