:root {

    --bg: #040404;

    --panel: #080808;
    --panel-2: #0c0c0c;

    --text: #bcbcbc;
    --muted: #626262;
    --dim: #3b3b3b;

    --red: #d21f26;
    --red-soft: #79282d;

    --green: #56a779;

    --border: #292929;

    --mono: "Share Tech Mono", monospace;
    --display: "Special Elite", monospace;
    --thai: "Noto Sans Thai", sans-serif;
}


/* =========================================================
   RESET
========================================================= */

* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {

    margin: 0;

    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(130,0,0,.10),
            transparent 35%
        ),
        #040404;

    color: var(--text);

    font-family: var(--mono);

}


body[data-lang="th"] {

    font-family: var(--thai);

}


/* =========================================================
   CRT
========================================================= */

body::before {

    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 90;

    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255,255,255,.015) 0,
            rgba(255,255,255,.015) 1px,
            transparent 1px,
            transparent 4px
        );

    opacity: .42;

}


body::after {

    content: "";

    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 91;

    background:
        radial-gradient(
            circle,
            transparent 45%,
            rgba(0,0,0,.85) 100%
        );

}


.noise {

    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 88;

    opacity: .09;

    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");

    animation:
        noiseShift 8s steps(8) infinite;

}


@keyframes noiseShift {

    0% {
        transform: translate(0,0);
    }

    25% {
        transform: translate(-1%,1%);
    }

    50% {
        transform: translate(1%,-1%);
    }

    75% {
        transform: translate(-1%,-1%);
    }

    100% {
        transform: translate(0,0);
    }

}


.scanlines {

    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 89;

    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 5px,
            rgba(180,0,0,.018) 6px
        );

}


.vignette {

    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 87;

    background:
        radial-gradient(
            circle,
            transparent 50%,
            rgba(0,0,0,.65) 100%
        );

}


/* =========================================================
   HEADER
========================================================= */

.rules-site-header {

    min-height: 125px;

    padding: 20px 42px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    border-bottom:
        1px solid #242424;

    position: relative;

    z-index: 5;

}


.rules-brand {

    display: flex;

    align-items: center;

    gap: 20px;

}


.rules-logo {

    width: 66px;

    height: 66px;

    border:
        1px solid #858585;

    display: grid;

    place-items: center;

    transform:
        rotate(45deg);

}


.rules-logo svg {

    width: 34px;

    height: 34px;

    color: #c8c8c8;

    transform:
        rotate(-45deg);

}


.rules-brand h1 {

    margin: 0;

    color: #d8d8d8;

    font-size: 23px;

    letter-spacing: 4px;

}


.rules-brand h2 {

    margin: 3px 0 0;

    color: #858585;

    font-size: 17px;

    letter-spacing: 6px;

}


.rules-brand p {

    margin: 7px 0 0;

    color: var(--red);

    font-size: 8px;

    letter-spacing: 2px;

}


.rules-system-status {

    min-width: 235px;

    padding: 13px 16px;

    border:
        1px solid #292929;

    background:
        rgba(10,10,10,.8);

    color: #555;

    font-size: 8px;

    line-height: 1.9;

}


.rules-system-status strong {

    color: var(--green);

}


.system-dot {

    display: inline-block;

    width: 6px;

    height: 6px;

    margin-right: 6px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 8px rgba(86,167,121,.8);

    animation:
        systemBlink 1.6s infinite;

}


@keyframes systemBlink {

    0%,50% {
        opacity: 1;
    }

    51%,100% {
        opacity: .25;
    }

}


/* =========================================================
   PAGE
========================================================= */

.rules-page {

    width: min(1100px, calc(100% - 30px));

    margin: 0 auto;

    padding:
        25px 0 70px;

    position: relative;

    z-index: 3;

}


/* =========================================================
   TOPBAR
========================================================= */

.rules-topbar {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 12px;

}


.back-link {

    display: inline-flex;

    align-items: center;

    gap: 8px;

    padding: 8px 11px;

    border:
        1px solid #282828;

    background:
        #080808;

    color: #666;

    text-decoration: none;

    font-size: 8px;

    letter-spacing: 1px;

    transition: .2s;

}


.back-link svg {

    width: 15px;

    height: 15px;

}


.back-link:hover {

    color: #d13a40;

    border-color:
        #5e2024;

    background:
        rgba(100,0,0,.08);

}


.language-switch {

    display: flex;

    align-items: center;

    padding: 5px;

    border:
        1px solid #292929;

    background:
        #080808;

    color: #626262;

    cursor: pointer;

}


.language-switch svg {

    width: 15px;

    height: 15px;

    margin: 0 8px;

}


.lang {

    padding: 6px 8px;

    color: #555;

    font-size: 8px;

}


.lang.active {

    color: var(--red);

    background:
        rgba(100,0,0,.12);

    border:
        1px solid #4c1a1d;

}


/* =========================================================
   DOCUMENT HEADER
========================================================= */

.document-header {

    padding: 34px;

    border:
        1px solid #292929;

    background:
        radial-gradient(
            circle at 80% 20%,
            rgba(120,0,0,.09),
            transparent 35%
        );

}


.document-code {

    color: #64272b;

    font-size: 8px;

    letter-spacing: 2px;

}


.document-header h1 {

    margin: 14px 0 8px;

    color: #c6c6c6;

    font-family: var(--display);

    font-size: 34px;

    letter-spacing: 3px;

}


.document-header p {

    margin: 0;

    color: #565656;

    font-size: 9px;

}


/* =========================================================
   WARNING
========================================================= */

.rules-warning {

    margin-top: 10px;

    padding: 15px 17px;

    display: flex;

    align-items: center;

    gap: 9px;

    border:
        1px solid #572125;

    background:
        rgba(95,0,0,.09);

    color: var(--red);

    font-size: 8px;

    letter-spacing: 1px;

}


.rules-warning svg {

    width: 17px;

    height: 17px;

    flex-shrink: 0;

}


/* =========================================================
   PROTOCOL CARDS
========================================================= */

.protocol-card {

    position: relative;

    display: grid;

    grid-template-columns:
        70px
        1fr;

    gap: 20px;

    margin-top: 10px;

    padding: 27px;

    border:
        1px solid #282828;

    background:
        linear-gradient(
            180deg,
            rgba(17,17,17,.65),
            rgba(6,6,6,.95)
        );

    transition:
        border-color .2s,
        background .2s;

}


.protocol-card:hover {

    border-color:
        #3c2224;

    background:
        linear-gradient(
            180deg,
            rgba(20,12,12,.65),
            rgba(6,6,6,.95)
        );

}


.protocol-number {

    color: #762b30;

    font-size: 15px;

    letter-spacing: 2px;

}


.protocol-classification {

    margin-bottom: 9px;

    color: #4a4a4a;

    font-size: 7px;

    letter-spacing: 1px;

}


.protocol-content h2 {

    margin: 0 0 10px;

    color: #aaa;

    font-size: 12px;

    letter-spacing: 1px;

}


.protocol-content p {

    max-width: 760px;

    margin: 0;

    color: #555;

    font-size: 9px;

    line-height: 1.9;

}


/* =========================================================
   FINAL NOTICE
========================================================= */

.final-notice {

    margin-top: 22px;

    padding: 25px;

    display: grid;

    grid-template-columns:
        3px
        1fr
        auto;

    gap: 20px;

    border:
        1px solid #421a1d;

    background:
        radial-gradient(
            circle at 10% 50%,
            rgba(110,0,0,.08),
            transparent 45%
        );

}


.final-notice-line {

    background:
        var(--red);

    box-shadow:
        0 0 13px rgba(210,31,38,.35);

}


.final-label {

    margin-bottom: 8px;

    color: #6e292e;

    font-size: 7px;

    letter-spacing: 2px;

}


.final-notice h2 {

    margin: 0 0 9px;

    color: #a64045;

    font-size: 11px;

    letter-spacing: 1px;

}


.final-notice p {

    margin: 0;

    color: #505050;

    font-size: 8px;

    line-height: 1.8;

}


.final-stamp {

    align-self: center;

    min-width: 95px;

    padding: 12px;

    border:
        1px solid #4d2023;

    text-align: center;

    color: #5d2529;

    font-size: 7px;

}


.final-stamp span {

    display: block;

    margin-bottom: 5px;

}


.final-stamp strong {

    color: #97363c;

    font-size: 9px;

    letter-spacing: 1px;

}


/* =========================================================
   SIGNOFF
========================================================= */

.rules-signoff {

    margin-top: 14px;

    display: flex;

    justify-content: space-between;

    color: #404040;

    font-size: 7px;

    letter-spacing: 1px;

}


/* =========================================================
   THAI
========================================================= */

body[data-lang="th"] .document-header h1,
body[data-lang="th"] .protocol-content h2,
body[data-lang="th"] .final-notice h2 {

    letter-spacing: 0;

}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 750px) {

    .rules-site-header {

        padding: 18px 15px;

        flex-direction: column;

        align-items: flex-start;

        gap: 15px;

    }


    .rules-system-status {

        width: 100%;

    }


    .rules-page {

        width:
            calc(100% - 20px);

    }


    .rules-topbar {

        flex-wrap: wrap;

        gap: 10px;

    }


    .document-header {

        padding: 25px 20px;

    }


    .document-header h1 {

        font-size: 24px;

    }


    .protocol-card {

        grid-template-columns: 1fr;

        gap: 8px;

        padding: 21px;

    }


    .final-notice {

        grid-template-columns:
            3px
            1fr;

    }


    .final-stamp {

        grid-column:
            2;

        justify-self: start;

    }


    .rules-signoff {

        flex-direction: column;

        gap: 7px;

    }

}


@media (max-width: 500px) {

    .rules-brand h1 {

        font-size: 18px;

        letter-spacing: 2px;

    }


    .rules-brand h2 {

        font-size: 14px;

        letter-spacing: 3px;

    }


    .rules-logo {

        width: 52px;

        height: 52px;

    }

}