@import "external/font-cinzel-lora.css";

* {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

:root {
    --rules-bg: #0E0B08;
    --rules-panel: #1E1711;
    --rules-panel-light: #2A231B;
    --rules-border: #3A2E22;
    --rules-border-highlight: #5A4A3A;
    --rules-trim: #785A3C;
    --rules-trim-highlight: #9B7853;

    /* Accent colours */
    --rules-gold: #C8A355;
    --rules-gold-highlight: #E9C989;
    --rules-gold-shadow: #8B6B35;
    --rules-red: #A83232;

    /* Text colours */
    --rules-text: #E8D8B8;
    --rules-text-muted: #B8A88F;
    --rules-text-dark: #7A6A55;

    /* Effects */
    --rules-shadow: rgba(0, 0, 0, 0.8);
    --rules-inner-shadow: rgba(0, 0, 0, 0.4);
    --rules-glow: rgba(200, 163, 85, 0.15);

    /* Layout */
    --sidebar-width: 280px;
    --content-max-width: auto-fit;
}

/* Base Layout */
.rules-container {
    min-height: 100vh;
    background:
        url('../../layout/2024/images/body-texture.webp'),
        linear-gradient(to bottom, var(--rules-panel-light), var(--rules-panel));
    background-blend-mode: overlay, normal;
    background-size: auto, 100% 100%;
    background-repeat: repeat, no-repeat;
    color: var(--rules-text);
    font-family: 'Lora', serif;
    position: relative;
}

.rules-container::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Guide Button */
.rules-guide-notice {
    background: linear-gradient(to bottom, var(--rules-panel-light), var(--rules-panel));
    border: 2px solid var(--rules-border);
    border-radius: 8px;
    padding: 10px;
    margin: 20px;
    text-align: center;
    position: relative;
    z-index: 10;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 0 20px var(--rules-glow);
}

.rules-guide-notice a {
    color: var(--rules-gold-highlight);
    text-decoration: none;
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.rules-guide-notice a:hover {
    color: var(--rules-gold);
    text-shadow: 0 0 8px var(--rules-glow);
}

/* Sidebar Navigation */
.rules-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    border-right: 3px solid var(--rules-border);
    box-shadow:
        3px 0 15px var(--rules-shadow),
        inset 0 0 20px var(--rules-inner-shadow);
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--rules-trim) var(--rules-panel);
    background: var(--rules-panel);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px var(--rules-trim);
    background-image: url('../../layout/2024/images/noise-texture.webp');
    background-blend-mode: overlay;
    background-size: 50px;
}

.rules-sidebar::-webkit-scrollbar {
    width: 8px;
}

.rules-sidebar::-webkit-scrollbar-track {
    background: var(--rules-panel);
}

.rules-sidebar::-webkit-scrollbar-thumb {
    background: var(--rules-trim);
    border-radius: 4px;
}

.rules-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--rules-trim-highlight);
}

.rules-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: -3px;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom,
            var(--rules-trim),
            var(--rules-trim-highlight),
            var(--rules-trim));
    z-index: 1;
}

.sidebar-header {
    padding: 25px 20px 20px;
    border-bottom: 2px solid var(--rules-trim);
    position: relative;
    background: linear-gradient(to bottom, var(--rules-panel-light), var(--rules-panel));
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
}

.sidebar-title {
    color: var(--rules-gold-highlight);
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 5px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.sidebar-subtitle {
    color: var(--rules-text-muted);
    font-size: 12px;
    text-align: center;
    margin: 0;
    font-style: italic;
}

.sidebar-nav {
    padding: 0;
    margin: 0;
    list-style: none;
}

.sidebar-nav li {
    border-bottom: 1px solid var(--rules-gold-shadow);
}

.sidebar-nav li:last-child {
    border-bottom: none;
}

.sidebar-nav a {
    display: block;
    padding: 12px 20px;
    color: var(--rules-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Cinzel', serif;
}

.sidebar-nav a:hover {
    background: rgba(200, 163, 85, 0.1);
    color: var(--rules-gold-highlight);
    border-left-color: var(--rules-gold);
    padding-left: 25px;
}

.sidebar-nav a:active,
.sidebar-nav a.active {
    background: rgba(200, 163, 85, 0.2);
    color: var(--rules-gold);
    border-left-color: var(--rules-gold-highlight);
    font-weight: 600;
}

/* Main Content */
.rules-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.rules-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 6px 12px;
}

/* Header */
.rules-header {
    background: linear-gradient(to bottom, var(--rules-panel-light), var(--rules-panel));
    border: 2px solid var(--rules-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    box-shadow:
        0 8px 20px var(--rules-shadow),
        inset 0 0 30px var(--rules-inner-shadow);
}

.rules-header::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid var(--rules-trim);
    border-radius: 6px;
    pointer-events: none;
}

.rules-title {
    color: var(--rules-gold);
    font-family: 'Cinzel', serif;
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 10px 0;
    text-shadow:
        0 3px 6px rgba(0, 0, 0, 0.7),
        0 0 15px var(--rules-glow);
    letter-spacing: 1px;
}

.rules-year {
    display: block;
    font-size: 28px;
    margin-top: 5px;
}

.last-edit {
    color: var(--rules-text-muted);
    font-family: 'Lora', serif;
    font-size: clamp(10px, 2.5vw, 14px);
    letter-spacing: 1px;
    margin-top: 5px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--rules-border-highlight);
    border-radius: 4px;
    text-align: center;
    position: relative;
}

.last-edit:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    opacity: 0.5;
    pointer-events: none;
}

/* Sections */
.rules-section {
    background: var(--rules-panel);
    border: 2px solid var(--rules-border);
    border-radius: 6px;
    margin-bottom: 25px;
    position: relative;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px var(--rules-trim);
    background-image: url('../../layout/2024/images/noise-texture.webp');
    background-blend-mode: overlay;
    background-size: 25px;
    scroll-margin-top: 20px;
}

.rules-section::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid rgba(120, 90, 60, 0.3);
    border-radius: 4px;
    pointer-events: none;
}

.section-header {
    background: linear-gradient(to bottom, var(--rules-panel-light), var(--rules-panel));
    padding: 20px 25px;
    border-bottom: 2px solid var(--rules-border);
    border-radius: 4px 4px 0 0;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right,
            var(--rules-trim),
            var(--rules-trim-highlight),
            var(--rules-trim));
}

.section-title {
    color: var(--rules-gold-highlight);
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.section-content {
    padding: 25px;
}

/* Content */
.section-content p {
    margin: 0 0 16px 0;
    line-height: 1.6;
    font-size: 14px;
    color: var(--rules-text);
}

.section-content p:last-child {
    margin-bottom: 0;
}

.section-content strong {
    color: var(--rules-gold-highlight);
    font-weight: 600;
}

.section-content em,
.section-content i {
    color: var(--rules-gold);
    font-style: italic;
}

.section-content u {
    text-decoration: none;
    border-bottom: 1px solid var(--rules-gold);
    color: var(--rules-gold-highlight);
    font-weight: 500;
}

/* Lists */
.rules-list {
    margin: 16px 0;
    padding-left: 0;
    list-style: none;
}

.rules-list li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
    font-size: 14px;
}

.rules-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--rules-gold);
    font-weight: bold;
}

.sub-list {
    margin: 8px 0 8px 20px;
    padding-left: 0;
    list-style: none;
}

.sub-list li {
    margin-bottom: 8px;
    padding-left: 15px;
    font-size: 13px;
}

.sub-list li::before {
    content: '•';
    color: var(--rules-trim-highlight);
}

/* Punishment */
.punishment-sequence {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--rules-border-highlight);
    border-radius: 4px;
    padding: 20px;
    margin: 16px 0;
}

.punishment-sequence .sequence-title {
    color: var(--rules-gold);
    font-weight: 600;
    margin-bottom: 12px;
    text-decoration: underline;
}

.punishment-sequence ol {
    margin: 0;
    padding-left: 20px;
    color: var(--rules-text);
}

.punishment-sequence li {
    margin-bottom: 8px;
    line-height: 1.5;
    font-size: 13px;
}

/* Important Callouts */
.important-notice {
    background: linear-gradient(to right,
            rgba(200, 163, 85, 0.1),
            rgba(200, 163, 85, 0.15),
            rgba(200, 163, 85, 0.1));
    border: 2px solid var(--rules-gold);
    border-radius: 6px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    position: relative;
}

.important-notice::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid var(--rules-gold-highlight);
    border-radius: 4px;
    pointer-events: none;
}

.important-notice p {
    margin: 0;
    font-weight: 600;
    color: var(--rules-text);
    font-size: 15px;
}

/* Warning Boxes */
.warning-box {
    background: rgba(168, 50, 50, 0.1);
    border: 2px solid var(--rules-red);
    border-radius: 6px;
    padding: 15px;
    margin: 16px 0;
}

.warning-box p {
    margin: 0;
    color: #FFB3B3;
    font-weight: 500;
}

/* Glossary */
.glossary-term {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(58, 46, 34, 0.3);
}

.glossary-term:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.glossary-term strong {
    color: var(--rules-gold-highlight);
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

.glossary-term p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* Links */
.rules-content a {
    color: var(--rules-gold);
    text-decoration: none;
    border-bottom: 1px solid rgba(200, 163, 85, 0.3);
    transition: all 0.2s ease;
    font-weight: 500;
}

.rules-content a:hover {
    color: var(--rules-gold-highlight);
    border-bottom-color: var(--rules-gold-highlight);
    text-shadow: 0 0 8px var(--rules-glow);
}

/* Responsive Design */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 250px;
        --content-max-width: 800px;
    }

    .rules-content {
        padding: 30px;
    }
}

@media (max-width: 900px) {
    .rules-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .rules-main {
        margin-left: 0;
    }

    .rules-content {
        padding: 20px;
    }

    .rules-title {
        font-size: 28px;
    }

    .rules-year {
        font-size: 22px;
    }

    .section-title {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .rules-content {
        padding: 15px;
    }

    .rules-header {
        padding: 20px;
    }

    .rules-title {
        font-size: 24px;
    }

    .rules-year {
        font-size: 18px;
    }

    .section-content {
        padding: 20px;
    }

    .section-header {
        padding: 15px 20px;
    }

    .section-title {
        font-size: 18px;
    }
}

html {
    scroll-behavior: smooth;
}

.sidebar-nav a:focus,
.rules-content a:focus {
    outline: 2px solid var(--rules-gold);
    outline-offset: 2px;
}

.guide-policy {
    margin-left: 0;
}

.guide-policy .rules-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 40px;
}

.guide-navigation {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--rules-border);
}

.back-to-rules-button {
    display: inline-block;
    background: linear-gradient(to bottom,
            var(--rules-gold),
            var(--rules-gold-shadow));
    color: var(--rules-bg) !important;
    padding: 12px 25px;
    border-radius: 6px;
    text-decoration: none !important;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    letter-spacing: 0.5px;
    border: 2px solid var(--rules-border);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
}

.back-to-rules-button:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid var(--rules-gold-highlight);
    border-radius: 4px;
    opacity: 0.7;
    pointer-events: none;
}

.back-to-rules-button:hover {
    background: linear-gradient(to bottom,
            var(--rules-gold-highlight),
            var(--rules-gold));
    transform: translateY(-2px);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.back-to-rules-button:active {
    transform: translateY(0);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(to bottom,
            var(--rules-gold-shadow),
            var(--rules-gold));
}

/* Privacy Policy Specific Styles */
.privacy-policy {
    margin-left: 0;
}

.privacy-policy .rules-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
}

.privacy-policy .rules-title {
    font-size: 32px;
}

.privacy-policy .guide-navigation {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--rules-border);
}