/* ============================================
   SKIP NAVIGATION - ДОСТУПНОСТЬ
   ============================================ */

.skip-nav-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #1a1813 0%, #0f0e0b 100%);
    border-bottom: 2px solid var(--primary-color, #c9a961);
    padding: 16px 20px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(201, 169, 97, 0.3);
}

.skip-nav-container:focus-within,
.skip-nav-container.skip-nav-visible {
    transform: translateY(0);
}

.skip-nav-title {
    color: var(--primary-color, #c9a961);
    font-weight: 600;
    font-size: 14px;
    margin-right: 16px;
    white-space: nowrap;
}

.skip-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--primary-color, #c9a961);
    color: var(--text-light, #e5dcd0);
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.skip-nav-btn:hover,
.skip-nav-btn:focus {
    background: var(--primary-color, #c9a961);
    color: var(--dark-bg, #0f0e0b);
    outline: none;
    box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.3);
}

.skip-nav-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Скрытый элемент для фокуса */
.skip-nav-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   ПОИСК ПО ПРАВИЛАМ
   ============================================ */

.rules-search-container {
    position: sticky;
    top: 80px;
    z-index: 100;
    background: linear-gradient(135deg, #1a1813 0%, #0f0e0b 100%);
    border: 1px solid var(--primary-color, #c9a961);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(201, 169, 97, 0.15);
    width: 100%;
    box-sizing: border-box;
}

.rules-search-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.rules-search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.rules-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--primary-color, #c9a961);
    opacity: 0.7;
}

.rules-search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: rgba(15, 14, 11, 0.8);
    border: 1px solid var(--border-color, #3a332a);
    border-radius: 6px;
    color: var(--text-light, #e5dcd0);
    font-size: 15px;
    transition: all 0.3s ease;
}

.rules-search-input:focus {
    outline: none;
    border-color: var(--primary-color, #c9a961);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
}

.rules-search-input::placeholder {
    color: var(--text-muted, #b5a892);
}

.rules-search-stats {
    font-size: 13px;
    color: var(--text-muted, #b5a892);
    white-space: nowrap;
}

.rules-search-clear {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color, #3a332a);
    color: var(--text-muted, #b5a892);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.rules-search-clear:hover {
    border-color: var(--primary-color, #c9a961);
    color: var(--primary-color, #c9a961);
}

/* Подсветка найденных результатов */
.rules-highlight {
    background: rgba(255, 200, 50, 0.4);
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 0 4px rgba(255, 200, 50, 0.3);
    transition: all 0.2s ease;
}

/* Текущий активный результат поиска */
.rules-highlight-current {
    background: rgba(255, 150, 0, 0.6);
    color: #000;
    padding: 3px 5px;
    border-radius: 4px;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(255, 150, 0, 0.5);
    animation: pulseHighlight 1s ease-in-out infinite alternate;
}

@keyframes pulseHighlight {
    from {
        box-shadow: 0 0 8px rgba(255, 150, 0, 0.5);
    }
    to {
        box-shadow: 0 0 12px rgba(255, 150, 0, 0.8);
    }
}

/* Навигационные кнопки поиска */
.rules-search-nav {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-shrink: 0;
}

.rules-search-nav-btn {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
    color: var(--text-light, #e5dcd0);
    opacity: 0.6;
}

.rules-search-nav-btn:hover {
    background: rgba(201, 169, 97, 0.15);
    opacity: 1;
}

.rules-search-nav-btn:active {
    background: rgba(201, 169, 97, 0.25);
}

.rules-search-nav-btn svg {
    display: block;
    width: 14px;
    height: 14px;
}

/* Выделение результатов поиска */
.search-match {
    background: rgba(201, 169, 97, 0.15);
    border-radius: 4px;
    padding: 2px 4px;
    margin: 2px 0;
}

.search-current {
    background: rgba(201, 169, 97, 0.3);
    border: 1px solid rgba(201, 169, 97, 0.5);
    border-radius: 4px;
    padding: 2px 4px;
    margin: 2px 0;
}

/* Кнопки вкладок правил */
.rules-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.rules-tab-btn {
    background: rgba(15, 14, 11, 0.6) !important;
    border: 1px solid rgba(201, 169, 97, 0.3) !important;
    color: rgba(229, 220, 208, 0.85) !important;
    padding: 0.6rem 1.2rem !important;
    border-radius: 0.35rem !important;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.rules-tab-btn:hover {
    background: rgba(201, 169, 97, 0.15) !important;
    border-color: rgba(201, 169, 97, 0.5) !important;
    color: rgba(255, 236, 191, 1) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.15);
}

.rules-tab-btn.active {
    background: rgba(201, 169, 97, 0.25) !important;
    border-color: rgba(201, 169, 97, 0.6) !important;
    color: rgba(255, 236, 191, 1) !important;
    box-shadow: 0 0 15px rgba(201, 169, 97, 0.2) !important;
}

/* Изображения в секциях "Об игре" */
.about-section .about-content img.about-section-image {
    display: block !important;
    margin-top: 1.5rem;
    max-width: 400px;
    height: auto;
    border-radius: 0.5rem;
    border: 1px solid rgba(201, 169, 97, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Скрытие неподходящих секций */
.rules-subsection.hidden-by-search {
    display: none;
}

.rules-subsection.has-match {
    animation: highlightMatch 0.5s ease;
}

@keyframes highlightMatch {
    0% {
        background: rgba(201, 169, 97, 0.2);
    }
    100% {
        background: transparent;
    }
}

/* Сообщение "Ничего не найдено" */
.rules-search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted, #b5a892);
}

.rules-search-no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ============================================
   ВИДЕО-ИНСТРУКЦИИ (золотая рамка)
   ============================================ */

.video-instruction-container {
    position: relative;
    margin: 30px 0;
    padding: 4px;
    background: linear-gradient(135deg, 
        #c9a961 0%, 
        #daa835 25%, 
        #c9a961 50%, 
        #a67c52 75%, 
        #c9a961 100%);
    border-radius: 12px;
    box-shadow: 
        0 0 20px rgba(201, 169, 97, 0.3),
        inset 0 0 20px rgba(201, 169, 97, 0.1);
}

.video-instruction-inner {
    background: linear-gradient(135deg, #1a1813 0%, #0f0e0b 100%);
    border-radius: 8px;
    overflow: hidden;
}

.video-instruction-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(201, 169, 97, 0.05);
    border-bottom: 1px solid rgba(201, 169, 97, 0.2);
}

.video-instruction-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #c9a961, #a67c52);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.video-instruction-icon svg {
    width: 24px;
    height: 24px;
    color: #0f0e0b;
}

.video-instruction-title {
    flex: 1;
}

.video-instruction-title h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-color, #c9a961);
}

.video-instruction-title p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    color: var(--text-muted, #b5a892);
}

.video-instruction-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

body.custom-cursor-enabled .video-instruction-player {
    cursor: none !important;
}

.video-instruction-player iframe,
.video-instruction-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Video placeholder styles */
.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(201, 169, 97, 0.1);
    border: 2px dashed rgba(201, 169, 97, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.video-placeholder:hover {
    background: rgba(201, 169, 97, 0.15);
    border-color: rgba(201, 169, 97, 0.4);
}

.video-placeholder-icon {
    margin-bottom: 16px;
    color: var(--primary-color, #c9a961);
    opacity: 0.7;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.video-placeholder-text {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-muted, #b5a892);
    font-weight: 500;
}

.video-load-btn {
    background: var(--primary-color, #c9a961);
    color: var(--text-dark, #0f0e0b);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-load-btn:hover {
    background: var(--primary-hover, #a67c52);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

.video-load-btn:active {
    transform: translateY(0);
}

/* Loading state */
.video-placeholder.loading .video-placeholder-text {
    color: var(--primary-color, #c9a961);
}

.video-placeholder.loading .video-load-btn {
    display: none;
}

.video-instruction-footer {
    padding: 12px 20px;
    background: rgba(201, 169, 97, 0.05);
    border-top: 1px solid rgba(201, 169, 97, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.video-instruction-duration {
    font-size: 13px;
    color: var(--text-muted, #b5a892);
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-instruction-link {
    font-size: 13px;
    color: var(--primary-color, #c9a961);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.video-instruction-link:hover {
    color: var(--accent-color, #a67c52);
}

/* Адаптивность */
@media (max-width: 768px) {
    .skip-nav-container {
        padding: 12px;
        gap: 8px;
    }
    
    .skip-nav-title {
        display: none;
    }
    
    .skip-nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .rules-search-container {
        top: 70px;
        padding: 12px;
    }
    
    .rules-search-wrapper {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .rules-search-input-wrap {
        flex: 1;
        min-width: 200px;
        order: 1;
    }
    
    .rules-search-clear {
        order: 2;
        flex-shrink: 0;
        padding: 10px 12px;
    }
    
    .rules-search-nav {
        display: none;
    }
    
    .rules-search-stats {
        width: 100%;
        text-align: center;
        order: 3;
        font-size: 12px;
    }
    
    .video-instruction-header {
        padding: 12px 16px;
    }
    
    .video-instruction-icon {
        width: 32px;
        height: 32px;
    }
    
    .video-instruction-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .video-instruction-title h3 {
        font-size: 1rem;
    }
}
