* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", sans-serif;
}

body {
    background: #f4f6f8;
    color: #333;
}

.rules-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.rules-nav {
    width: 260px;
    background: #1f3d2b;
    color: #fff;
    padding: 20px;

    position: sticky;
    top: 0;
    height: 100vh;          /* IMPORTANT */
    overflow-y: auto;      /* Scroll inside sidebar if long */
}

.rules-nav h2 {
    margin-bottom: 15px;
}

.rules-nav input {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: none;
}

.rules-nav ul {
    list-style: none;
}

.rules-nav li {
    margin-bottom: 10px;
}

.rules-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #d9f2e6;
    text-decoration: none;
    transition: background 0.2s ease;
}
.rules-nav a .material-icons {
    font-size: 20px;
}

.rules-nav a:hover {
    text-decoration: underline;
}

/* Content */
.rules-content {
    flex: 1;
    padding: 30px;
}

.rules-header {
    margin-bottom: 25px;
}

.rules-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.rule-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.rule-section h3 {
    margin-bottom: 10px;
    color: #1f3d2b;
}

.rule-section ul {
    padding-left: 20px;
}

.rule-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.rule-section.highlight {
    border-left: 6px solid #1f3d2b;
}
/* ACTIVE NAV LINK */
.rules-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 10px;
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
}

/* RULE CARD HIGHLIGHT */
.rule-section.active-rule {
    border-left: 6px solid #1f3d2b;
    box-shadow: 0 0 0 2px rgba(31, 61, 43, 0.15),
                0 10px 25px rgba(0, 0, 0, 0.08);
    transform: scale(1.01);
    transition: all 0.3s ease;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    .rules-nav {
        position: relative;
        height: auto;
        width: 100%;
    }

    .rules-content {
        margin-left: 0;
    }
}

/* ============================= */
/* RESPONSIVE ONLY – NO STYLE CHANGE */
/* ============================= */

@media (max-width: 768px) {

    .rules-wrapper {
        flex-direction: column;
    }

    .rules-nav {
        position: relative;
        width: 100%;
        height: auto;
        max-height: none;
        display: block;
    }

    /* Make nav scroll horizontally on mobile */
    .rules-nav ul {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .rules-nav li {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .rules-nav a {
        white-space: nowrap;
        font-size: 14px;
    }

    .rules-content {
        padding: 20px;
    }

    .rules-header h1 {
        font-size: 22px;
    }
}
