/* ============================================
   Production rules styling for the rules page
   ============================================ */

#quick-rules,
#detailed-rules {
    background: rgba(22, 20, 16, 0.8);
    border: 1px solid rgba(201, 169, 97, 0.18);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* ============================================
   СТИЛИ ДЛЯ КРАТКИХ ПРАВИЛ
   ============================================ */

/* Контейнер для кратких правил */
#quick-rules {
    position: relative;
}

/* Заголовок для кратких правил */
#quick-rules h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    background: linear-gradient(135deg, #c9a961 0%, #a67c52 50%, #c9a961 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

/* Контейнер для ключевых точек */
#quick-rules .key-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 50vw, 280px), 1fr));
    gap: clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

/* Блоки с ключевыми точками */
#quick-rules .point-item {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.1) 0%, rgba(166, 124, 82, 0.06) 100%);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: clamp(0.7rem, 1.5vw, 0.9rem);
    padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1.1rem, 2.8vw, 1.6rem);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Декоративная линия сверху */
#quick-rules .point-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(201, 169, 97, 0.5) 20%, 
        rgba(201, 169, 97, 0.8) 50%, 
        rgba(201, 169, 97, 0.5) 80%, 
        transparent 100%
    );
}

/* Hover эффект для блоков */
#quick-rules .point-item:hover {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.15) 0%, rgba(166, 124, 82, 0.1) 100%);
    border-color: rgba(201, 169, 97, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(201, 169, 97, 0.15);
}

/* Иконка блока */
#quick-rules .point-icon {
    margin-bottom: clamp(0.8rem, 2vw, 1rem);
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(40px, 8vw, 48px);
    height: clamp(40px, 8vw, 48px);
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.15), rgba(166, 124, 82, 0.08));
    border-radius: clamp(0.5rem, 1.2vw, 0.6rem);
    border: 1px solid rgba(201, 169, 97, 0.25);
}

#quick-rules .point-icon img {
    width: clamp(20px, 4vw, 24px);
    height: clamp(20px, 4vw, 24px);
    opacity: 0.9;
    filter: drop-shadow(0 0 4px rgba(201, 169, 97, 0.3));
}

/* Заголовок блока */
#quick-rules .point-item h4 {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    font-weight: 600;
    margin-bottom: clamp(0.6rem, 1.5vw, 0.8rem);
    color: #e8d4b0;
    line-height: 1.4;
}

/* Текст блока */
#quick-rules .point-item p {
    font-size: clamp(0.85rem, 2.2vw, 0.95rem);
    line-height: 1.7;
    color: #c9b896;
    margin-bottom: 0;
}

/* Улучшенная типографика для заголовков */
#detailed-rules h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    background: linear-gradient(135deg, #c9a961 0%, #a67c52 50%, #c9a961 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}

#detailed-rules h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    margin-bottom: clamp(1rem, 2.5vw, 1.2rem);
    color: #e8dcc8;
    border-bottom: clamp(1px, 0.3vw, 2px) solid rgba(201, 169, 97, 0.3);
    padding-bottom: clamp(0.4rem, 1vw, 0.5rem);
}

#detailed-rules h4 {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    font-weight: 600;
    margin-bottom: clamp(0.6rem, 1.5vw, 0.8rem);
    color: #d4b896;
}

/* Оптимизированные подсекции */
#detailed-rules .rules-subsection {
    background: linear-gradient(135deg, rgba(26, 24, 19, 0.6) 0%, rgba(20, 18, 15, 0.8) 100%);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: clamp(0.8rem, 2vw, 1rem);
    padding: clamp(1.4rem, 3.5vw, 1.8rem) clamp(1.5rem, 4vw, 2rem);
    margin-bottom: clamp(1.5rem, 4vw, 2rem);
    position: relative;
    overflow: hidden;
}

/* Атмосферное свечение для подсекций */
#detailed-rules .rules-subsection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(201, 169, 97, 0.5) 20%, 
        rgba(201, 169, 97, 0.8) 50%, 
        rgba(201, 169, 97, 0.5) 80%, 
        transparent 100%
    );
}

/* Улучшенная читаемость параграфов */
#detailed-rules p {
    color: #c9b896;
    line-height: 1.8;
    margin-bottom: clamp(0.8rem, 2vw, 1rem);
    font-size: clamp(0.9rem, 2.3vw, 1rem);
}

#detailed-rules p strong {
    color: #e8d4b0;
    font-weight: 600;
}

/* Минималистичные списки без лишних маркеров */
#detailed-rules ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem 0;
}

#detailed-rules ul li {
    position: relative;
    padding-left: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: clamp(0.6rem, 1.5vw, 0.8rem);
    line-height: 1.7;
    color: #c9b896;
    font-size: clamp(0.88rem, 2.2vw, 0.98rem);
}

/* Тонкий декоративный маркер */
#detailed-rules ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 6px;
    height: 6px;
    background: rgba(201, 169, 97, 0.4);
    border-radius: 50%;
    transition: all 0.3s ease;
}

#detailed-rules ul li:hover::before {
    background: rgba(201, 169, 97, 0.8);
    transform: scale(1.3);
}

/* Улучшенные блоки типов карт */
#detailed-rules .card-type-block {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, rgba(166, 124, 82, 0.05) 100%);
    border: 1px solid rgba(201, 169, 97, 0.15);
    border-radius: clamp(0.6rem, 1.5vw, 0.8rem);
    padding: clamp(1.1rem, 2.8vw, 1.4rem) clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: clamp(1rem, 2.5vw, 1.2rem);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#detailed-rules .card-type-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(201, 169, 97, 0.6) 0%, 
        rgba(201, 169, 97, 0.2) 100%
    );
}

#detailed-rules .card-type-block:hover {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.12) 0%, rgba(166, 124, 82, 0.08) 100%);
    border-color: rgba(201, 169, 97, 0.3);
    transform: translateX(4px);
}

/* Заголовки с иконками */
#detailed-rules .rules-heading-with-icon {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

#detailed-rules .rules-heading-icon-img {
    width: clamp(20px, 4vw, 24px);
    height: clamp(20px, 4vw, 24px);
    opacity: 0.8;
    filter: drop-shadow(0 0 4px rgba(201, 169, 97, 0.3));
}

/* Оптимизированные блоки правил */
#detailed-rules .rule-block {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.06) 0%, rgba(107, 165, 71, 0.04) 100%);
    border: 1px solid rgba(201, 169, 97, 0.12);
    border-radius: clamp(0.6rem, 1.5vw, 0.8rem);
    padding: clamp(1rem, 2.5vw, 1.3rem) clamp(1.1rem, 2.8vw, 1.5rem);
    margin-bottom: clamp(0.8rem, 2vw, 1rem);
}

#detailed-rules .rule-block h4 {
    color: #d4a574;
    margin-bottom: 0.7rem;
}

/* Сетка фаз */
#detailed-rules .phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 45vw, 220px), 1fr));
    gap: clamp(1rem, 2.5vw, 1.2rem);
    margin-top: clamp(1rem, 2.5vw, 1.2rem);
}

#detailed-rules .phase {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.1) 0%, rgba(166, 124, 82, 0.06) 100%);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: clamp(0.6rem, 1.5vw, 0.8rem);
    padding: clamp(1rem, 2.5vw, 1.2rem);
    transition: all 0.3s ease;
}

#detailed-rules .phase:hover {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.15) 0%, rgba(166, 124, 82, 0.1) 100%);
    border-color: rgba(201, 169, 97, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(201, 169, 97, 0.15);
}

#detailed-rules .phase h4 {
    color: #e8d4b0;
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    margin-bottom: clamp(0.5rem, 1.2vw, 0.6rem);
}

#detailed-rules .phase p {
    color: #c9b896;
    font-size: clamp(0.83rem, 2.1vw, 0.93rem);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Оптимизированное оглавление */
#detailed-rules .table-of-contents {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.08) 0%, rgba(166, 124, 82, 0.05) 100%);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: clamp(0.7rem, 1.8vw, 0.9rem);
    padding: clamp(1.1rem, 2.8vw, 1.4rem) clamp(1.3rem, 3.5vw, 1.8rem);
    margin-bottom: clamp(2rem, 5vw, 2.5rem);
}

#detailed-rules .table-of-contents h3 {
    color: #e8d4b0;
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
    margin-bottom: clamp(0.8rem, 2vw, 1rem);
    border-bottom: none;
    padding-bottom: 0;
}

#detailed-rules .table-of-contents ul {
    columns: 2;
    column-gap: clamp(1.5rem, 4vw, 2rem);
}

#detailed-rules .table-of-contents li {
    margin-bottom: clamp(0.4rem, 1vw, 0.5rem);
}

#detailed-rules .table-of-contents a {
    color: #c9b896;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

#detailed-rules .table-of-contents a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #c9a961, transparent);
    transition: width 0.3s ease;
}

#detailed-rules .table-of-contents a:hover {
    color: #e8d4b0;
}

#detailed-rules .table-of-contents a:hover::after {
    width: 100%;
}

/* Оптимизированные примеры */
#detailed-rules .example-block {
    background: linear-gradient(135deg, 
        rgba(201, 169, 97, 0.15) 0%, 
        rgba(166, 124, 82, 0.08) 50%,
        rgba(139, 109, 76, 0.05) 100%
    );
    border: 1px solid rgba(201, 169, 97, 0.35);
    border-radius: clamp(0.6rem, 1.5vw, 0.8rem);
    padding: clamp(1.1rem, 2.8vw, 1.4rem) clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: clamp(1rem, 2.5vw, 1.2rem);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#detailed-rules .example-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(201, 169, 97, 0.6) 30%,
        rgba(232, 212, 176, 0.8) 50%,
        rgba(201, 169, 97, 0.6) 70%,
        transparent 100%
    );
}

#detailed-rules .example-block:hover {
    background: linear-gradient(135deg, 
        rgba(201, 169, 97, 0.2) 0%, 
        rgba(166, 124, 82, 0.12) 50%,
        rgba(139, 109, 76, 0.08) 100%
    );
    border-color: rgba(201, 169, 97, 0.5);
    transform: translateX(4px);
    box-shadow: 0 8px 20px rgba(201, 169, 97, 0.15);
}

#detailed-rules .example-block h4 {
    color: #f0e6d2;
    margin-bottom: clamp(0.6rem, 1.5vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.3px;
}

#detailed-rules .example-block p {
    color: #d4c4a8;
    line-height: 1.75;
}

#detailed-rules .example-block strong {
    color: #f5e6d3;
    font-weight: 700;
}

/* Описание фаз */
#detailed-rules .phase-description {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.05) 0%, rgba(107, 165, 71, 0.03) 100%);
    border-radius: clamp(0.6rem, 1.5vw, 0.8rem);
    padding: clamp(1rem, 2.5vw, 1.3rem) clamp(1.1rem, 2.8vw, 1.5rem);
    margin-bottom: clamp(0.8rem, 2vw, 1rem);
}

#detailed-rules .phase-description > p {
    margin-bottom: 0;
    color: #d4c4a8;
}

/* Атмосферная анимация появления для подсекций */
@keyframes atmosphericReveal {
    0% {
        opacity: 0;
        transform: translateY(25px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#detailed-rules .rules-subsection {
    animation: atmosphericReveal 0.8s ease-out forwards;
}

/* Плавное появление по рядам */
#detailed-rules .card-type-block:nth-child(1) { animation-delay: 0.1s; }
#detailed-rules .card-type-block:nth-child(2) { animation-delay: 0.15s; }
#detailed-rules .card-type-block:nth-child(3) { animation-delay: 0.2s; }
#detailed-rules .card-type-block:nth-child(4) { animation-delay: 0.25s; }
#detailed-rules .card-type-block:nth-child(5) { animation-delay: 0.3s; }
#detailed-rules .card-type-block:nth-child(6) { animation-delay: 0.35s; }
#detailed-rules .card-type-block:nth-child(7) { animation-delay: 0.4s; }

#detailed-rules .phase:nth-child(1) { animation-delay: 0.1s; }
#detailed-rules .phase:nth-child(2) { animation-delay: 0.15s; }
#detailed-rules .phase:nth-child(3) { animation-delay: 0.2s; }
#detailed-rules .phase:nth-child(4) { animation-delay: 0.25s; }

/* Мобильная адаптация */
@media (max-width: 768px) {
    #detailed-rules h2 {
        font-size: 1.6rem;
    }
    
    #detailed-rules h3 {
        font-size: 1.3rem;
    }
    
    #detailed-rules .rules-subsection {
        padding: 1.4rem 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    #detailed-rules .card-type-block {
        padding: 1.2rem 1.3rem;
    }
    
    #detailed-rules .table-of-contents ul {
        columns: 1;
    }
    
    #detailed-rules .phases-grid {
        grid-template-columns: 1fr;
    }
    
    #detailed-rules p {
        font-size: 0.95rem;
    }
    
    #detailed-rules ul li {
        font-size: 0.95rem;
    }
}

/* Production override styles */
#quick-rules,
#detailed-rules {
    background: rgba(22, 20, 16, 0.8);
    border: 1px solid rgba(201, 169, 97, 0.18);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

#quick-rules h2,
#detailed-rules h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: #f7e7c4;
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
}

#quick-rules .rule-block,
#detailed-rules .rule-block,
#detailed-rules .card-type-block,
#detailed-rules .example-block {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(201, 169, 97, 0.14) !important;
    border-radius: 0.9rem !important;
    padding: 1.2rem 1.3rem !important;
    margin-bottom: 1.1rem !important;
}

#detailed-rules .rule-block h4,
#detailed-rules .card-type-block h4,
#detailed-rules .example-block h4 {
    color: #f3e8ca !important;
    font-size: clamp(1rem, 2vw, 1.2rem) !important;
    margin-bottom: 0.75rem !important;
}

#detailed-rules .rules-subsection {
    background: linear-gradient(135deg, rgba(26, 24, 19, 0.7) 0%, rgba(20, 18, 15, 0.86) 100%) !important;
    border: 1px solid rgba(201, 169, 97, 0.22) !important;
    border-radius: 1rem !important;
    padding: 1.8rem !important;
    margin-bottom: 1.6rem !important;
}

#detailed-rules .rules-subsection::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(201, 169, 97, 0.5) 20%, rgba(201, 169, 97, 0.8) 50%, rgba(201, 169, 97, 0.5) 80%, transparent 100%);
}

#detailed-rules .table-of-contents {
    box-shadow: inset 0 0 0 1px rgba(201, 169, 97, 0.12);
}

#detailed-rules .table-of-contents ul {
    display: grid !important;
    gap: 0.75rem !important;
}

#detailed-rules .table-of-contents a {
    color: #d8c9a5 !important;
}

#detailed-rules .table-of-contents a:hover {
    color: #f7e7c4 !important;
}

#detailed-rules .phase {
    border-color: rgba(201, 169, 97, 0.14) !important;
}

#detailed-rules .phase h4,
#detailed-rules .phase p {
    color: #e8d4b0 !important;
}

#detailed-rules .card-type-block {
    padding: 1.25rem 1.4rem !important;
}

#detailed-rules .rules-heading-with-icon {
    gap: 0.75rem !important;
}

#detailed-rules .rules-download-btn a {
    background: rgba(201, 169, 97, 0.12) !important;
    color: #f7e7c4 !important;
    text-decoration: none !important;
}

#detailed-rules .example-block {
    border-color: rgba(201, 169, 97, 0.18) !important;
}

@media (max-width: 768px) {
    #detailed-rules,
    #quick-rules {
        padding: 1.4rem !important;
    }
    #detailed-rules .table-of-contents ul {
        columns: 1 !important;
    }
    #detailed-rules .phases-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    #detailed-rules .rules-subsection {
        padding: 1.2rem 1.3rem;
    }
    
    #detailed-rules h2 {
        font-size: 1.4rem;
    }
}
