﻿/* ============================================
   СТРАНИЦА "ПРАВИЛА И ИНСТРУКЦИИ"
   ============================================ */

.rules-page {
    background-image: url('../images/Back2.jpeg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    position: relative;
    padding: clamp(120px, 14vh, 160px) var(--page-padding-x) clamp(40px, 6vw, 80px);
    min-height: 100vh;
}

    .rules-page::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1;
        pointer-events: none;
    }

.rules-inner {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
}

/* ---------- Заголовок страницы ---------- */

.rules-title {
    font-size: clamp(1.8rem, 2.8vw, 2.6rem);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin: 0 0 15px;
}

.rules-desc {
    font-size: 1rem;
    color: #b8c4d4;
    line-height: 1.65;
    margin: 0 0 clamp(35px, 4vw, 55px);
}

/* ---------- Секции ---------- */

.rules-section {
    margin-bottom: clamp(35px, 4vw, 55px);
}

.rules-section-title {
    font-size: clamp(1.4rem, 2vw, 1.75rem);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f39c12;
    display: inline-block;
}

/* ---------- Список правил ---------- */

.rules-list {
    list-style: none;
    counter-reset: rule;
    padding: 0;
    margin: 0;
}

    .rules-list li {
        position: relative;
        counter-increment: rule;
        padding: 16px 20px 16px 60px;
        margin-bottom: 12px;
        background: linear-gradient(160deg, #0d1b3a 0%, #0a1428 100%);
        border: 1px solid rgba(243, 156, 18, 0.25);
        border-left: 3px solid #f39c12;
        border-radius: 10px;
        color: #ccc;
        font-size: 0.95rem;
        line-height: 1.55;
        transition: border-color 0.2s, transform 0.15s;
    }

        .rules-list li:hover {
            border-color: #f39c12;
            transform: translateX(3px);
        }

        .rules-list li::before {
            content: counter(rule);
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f39c12;
            color: #fff;
            font-weight: 700;
            font-size: 0.9rem;
            border-radius: 50%;
            box-shadow: 0 3px 10px rgba(243, 156, 18, 0.4);
        }

/* ---------- Блоки инструкций ---------- */

.instruction-block {
    margin-bottom: 35px;
    padding: 25px clamp(18px, 2.5vw, 30px);
    background: linear-gradient(160deg, #0d1b3a 0%, #0a1428 100%);
    border: 1px solid rgba(93, 173, 226, 0.3);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.instruction-title {
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
    color: #5dade2;
    font-weight: 700;
    margin: 0 0 12px;
    letter-spacing: 1px;
}

.instruction-desc {
    font-size: 0.95rem;
    color: #b8c4d4;
    line-height: 1.6;
    margin: 0 0 18px;
}

    .instruction-desc code {
        padding: 2px 7px;
        background: rgba(93, 173, 226, 0.15);
        border: 1px solid rgba(93, 173, 226, 0.3);
        border-radius: 5px;
        color: #5dade2;
        font-family: 'Consolas', 'Monaco', monospace;
        font-size: 0.88rem;
    }

    .instruction-desc kbd {
        padding: 2px 8px;
        background: #222;
        border: 1px solid #444;
        border-radius: 5px;
        color: #fff;
        font-family: 'Consolas', 'Monaco', monospace;
        font-size: 0.85rem;
        box-shadow: 0 2px 0 #111;
    }

.instruction-hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
    line-height: 1.5;
}

    .instruction-hint code {
        color: #5dade2;
        font-family: 'Consolas', 'Monaco', monospace;
        background: rgba(93, 173, 226, 0.1);
        padding: 1px 6px;
        border-radius: 4px;
    }

/* ---------- Блок кода ---------- */

.code-block {
    background: #0a0f1e;
    border: 1px solid rgba(93, 173, 226, 0.25);
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(93, 173, 226, 0.2);
}

    .code-block-header > span {
        font-size: 0.8rem;
        color: #5dade2;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

.code-copy-btn {
    padding: 5px 12px;
    background: rgba(93, 173, 226, 0.1);
    border: 1px solid rgba(93, 173, 226, 0.4);
    border-radius: 6px;
    color: #5dade2;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

    .code-copy-btn:hover {
        background: #5dade2;
        color: #fff;
    }

.code-block pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.65;
}

.code-block code {
    color: #b8c4d4;
}

/* ---------- Таблица команд ---------- */

.commands-table {
    border: 1px solid rgba(93, 173, 226, 0.25);
    border-radius: 10px;
    overflow: hidden;
    background: #0a0f1e;
}

.commands-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}

    .commands-row:last-child {
        border-bottom: none;
    }

    .commands-row:hover {
        background: rgba(93, 173, 226, 0.05);
    }

.commands-header {
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(93, 173, 226, 0.25);
    color: #5dade2;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 18px;
}

    .commands-header:hover {
        background: rgba(0, 0, 0, 0.4);
    }

.commands-row code {
    color: #f39c12;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(243, 156, 18, 0.1);
    padding: 3px 10px;
    border-radius: 5px;
    display: inline-block;
    width: fit-content;
}

.commands-row > span {
    color: #b8c4d4;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ---------- Мобильная адаптация ---------- */

@media (max-width: 700px) {
    .rules-list li {
        padding: 14px 15px 14px 55px;
        font-size: 0.9rem;
    }

        .rules-list li::before {
            left: 14px;
            width: 26px;
            height: 26px;
            font-size: 0.85rem;
        }

    .commands-row {
        grid-template-columns: 130px 1fr;
        gap: 10px;
        padding: 10px 14px;
    }

        .commands-row code {
            font-size: 0.82rem;
            padding: 2px 8px;
        }

        .commands-row > span {
            font-size: 0.85rem;
        }
}

@media (max-width: 500px) {
    .commands-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .commands-header {
        display: none;
    }
}
