﻿:root {
    --bg: #050505;
    --bg-soft: #0d0a14;
    --panel: #151022;
    --line: #31214e;
    --text: #f3efff;
    --muted: #b6a7db;
    --accent: #8f42ff;
    --accent-2: #c57dff;
    --success: #52d7a2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(7, 5, 12, 0.86), rgba(5, 5, 5, 0.96)),
        url('assets/hero-bg.png') center top / cover fixed no-repeat,
        radial-gradient(circle at 15% 15%, rgba(143, 66, 255, 0.22), transparent 35%),
        radial-gradient(circle at 85% 0%, rgba(197, 125, 255, 0.18), transparent 30%),
        var(--bg);
    line-height: 1.65;
    overflow-x: hidden;
}

.skip-link {
    position: fixed;
    left: 0.8rem;
    top: 0.8rem;
    transform: translateY(-140%);
    border-radius: 10px;
    background: #ffffff;
    color: #111111;
    font-weight: 800;
    padding: 0.45rem 0.7rem;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 110;
    background: rgba(197, 125, 255, 0.12);
}

.progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6f2ddb, var(--accent-2));
}

.bg-glow {
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.2;
    z-index: -1;
}

.bg-glow-left {
    left: -140px;
    top: 120px;
    background: #7f3df0;
}

.bg-glow-right {
    right: -130px;
    top: 320px;
    background: #b060ff;
}

.header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem clamp(0.9rem, 3vw, 2.2rem);
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(143, 66, 255, 0.28);
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    overflow: visible;
}

.logo img {
    height: 62px;
    width: auto;
    max-width: min(320px, 34vw);
    transform: scale(1.5);
    transform-origin: left center;
    display: block;
}

.logo span {
    display: none;
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.08em;
    font-size: 1.4rem;
    color: var(--text);
}

.menu-toggle {
    display: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    padding: 0.38rem 0.72rem;
    cursor: pointer;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.32rem 0.58rem;
    border-radius: 999px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.nav a:hover,
.nav a.active {
    color: var(--text);
    background: rgba(143, 66, 255, 0.24);
}

main {
    width: min(1240px, calc(100% - 2rem));
    margin: 0 auto;
}

.welcome-hero {
    position: relative;
    min-height: clamp(380px, 65vh, 620px);
    margin-top: clamp(0.8rem, 2vw, 1.4rem);
    border: 1px solid rgba(197, 125, 255, 0.32);
    border-radius: 22px;
    overflow: hidden;
    padding: clamp(1.2rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: url('assets/hero-bg.png') center center / cover no-repeat;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.welcome-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(8, 6, 16, 0.9) 18%, rgba(40, 15, 72, 0.58) 55%, rgba(8, 6, 16, 0.85) 100%);
}

.welcome-hero > * {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.welcome-kicker {
    color: #d7b6ff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
}

.welcome-hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.4rem, 6.6vw, 5.8rem);
    line-height: 0.92;
    letter-spacing: 0.03em;
    margin-top: 0.35rem;
}

.welcome-slogan {
    margin-top: 0.45rem;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.2rem, 2.3vw, 2rem);
    letter-spacing: 0.14em;
    color: #ffcf76;
}

.welcome-text {
    margin-top: 0.55rem;
    color: #f0e4ff;
    font-weight: 500;
}

.welcome-hero .cta {
    margin-top: 1rem;
    width: fit-content;
}

.hero {
    padding: clamp(1.5rem, 4vw, 2.8rem) 0 1.5rem;
}

.tag {
    color: var(--accent-2);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
}

.hero h1 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: 0.03em;
    margin: 0.55rem 0 0.9rem;
}

.hero p {
    max-width: 840px;
    color: var(--muted);
}

.full-rp-focus {
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.7rem;
    border-left: 4px solid var(--accent-2);
    border-radius: 8px;
    background: rgba(143, 66, 255, 0.13);
    color: #ead8ff;
    font-weight: 700;
}

.hero-actions {
    margin-top: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.cta,
.ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 800;
    padding: 0.62rem 1rem;
    font-size: 0.92rem;
    border: 1px solid transparent;
    cursor: pointer;
}

.cta {
    color: #ffffff;
    background: linear-gradient(90deg, #6f2ddb, var(--accent-2));
}

.ghost {
    color: var(--text);
    background: rgba(143, 66, 255, 0.12);
    border-color: rgba(143, 66, 255, 0.28);
}

.cta:hover,
.ghost:hover {
    transform: translateY(-1px);
}

.meta-grid {
    margin-top: 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
}

.meta-grid article {
    background: linear-gradient(160deg, rgba(21, 16, 34, 0.9), rgba(8, 8, 12, 0.92));
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.9rem;
}

.meta-grid h2 {
    font-size: 0.95rem;
    color: var(--accent-2);
    margin-bottom: 0.2rem;
}

.meta-grid p,
.meta-grid a,
.meta-grid code {
    color: var(--text);
    font-size: 0.92rem;
    text-decoration: none;
}

.rules-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(165deg, rgba(20, 14, 34, 0.86), rgba(8, 8, 12, 0.92));
}

.search-wrap label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.search-wrap input {
    width: 100%;
    border: 1px solid rgba(182, 167, 219, 0.35);
    border-radius: 10px;
    background: rgba(5, 5, 5, 0.82);
    color: var(--text);
    font: inherit;
    padding: 0.65rem 0.75rem;
}

.search-wrap input:focus {
    outline: 2px solid rgba(143, 66, 255, 0.45);
    outline-offset: 1px;
}

.hint {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.status-wrap {
    display: grid;
    gap: 0.5rem;
    justify-items: end;
}

.status-wrap p {
    color: var(--muted);
    font-size: 0.9rem;
}

.toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.toolbar-actions button,
.toolbar-actions a {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(143, 66, 255, 0.2);
    color: var(--text);
    font-weight: 700;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.86rem;
}

.toolbar-actions button:hover,
.toolbar-actions a:hover {
    background: rgba(143, 66, 255, 0.32);
}

.rules-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
    padding-bottom: 3rem;
}

.rules-index {
    position: sticky;
    top: 95px;
    align-self: start;
    background: linear-gradient(180deg, rgba(20, 14, 34, 0.9), rgba(8, 8, 12, 0.9));
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
}

.rules-index h2 {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.06em;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.rules-index ul {
    list-style: none;
}

.rules-index li + li {
    margin-top: 0.4rem;
}

.rules-index a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.rules-index a:hover {
    color: var(--text);
}

.rules-content {
    display: grid;
    gap: 1rem;
}

.rule-box {
    background: linear-gradient(165deg, rgba(20, 14, 34, 0.9), rgba(8, 8, 12, 0.92));
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.15rem;
}

.rule-box h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
    color: var(--accent-2);
}

.rule-box ul {
    margin-left: 1.1rem;
}

.rule-box li + li {
    margin-top: 0.45rem;
}

.small-note {
    margin-top: 0.7rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.penalty-table {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
}

.row span {
    padding: 0.7rem;
    border-bottom: 1px solid rgba(182, 167, 219, 0.24);
    font-size: 0.92rem;
}

.row span + span {
    border-left: 1px solid rgba(182, 167, 219, 0.24);
}

.row.head {
    background: rgba(143, 66, 255, 0.24);
}

.row.head span {
    font-weight: 700;
    color: #edd8ff;
}

.rule-box details {
    border: 1px solid rgba(182, 167, 219, 0.34);
    border-radius: 10px;
    padding: 0.72rem;
    background: rgba(13, 10, 20, 0.7);
}

.rule-box details + details {
    margin-top: 0.6rem;
}

.rule-box summary {
    cursor: pointer;
    font-weight: 700;
}

.rule-box details p {
    color: var(--muted);
    margin-top: 0.45rem;
}

.footer {
    margin-top: 1rem;
    text-align: center;
    padding: 1.8rem 1rem 2.5rem;
    border-top: 1px solid rgba(143, 66, 255, 0.25);
    color: var(--muted);
}

.footer a {
    color: var(--accent-2);
    text-decoration: none;
}

.footer code {
    color: var(--text);
}

.copy {
    margin-top: 0.35rem;
}

.back-top {
    display: inline-block;
    margin-top: 0.7rem;
    color: var(--accent-2);
    font-weight: 700;
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.rule-box.is-hidden {
    display: none;
}

.rule-hit {
    background: rgba(143, 66, 255, 0.35);
    color: #f7edff;
    border-radius: 4px;
    padding: 0 0.15rem;
}

@media (max-width: 1020px) {
    .meta-grid {
        grid-template-columns: 1fr;
    }

    .rules-layout {
        grid-template-columns: 1fr;
    }

    .rules-index {
        position: relative;
        top: 0;
    }
}

@media (max-width: 860px) {
    .header {
        padding: 0.45rem 0.8rem;
    }

    main {
        width: min(1240px, calc(100% - 1rem));
    }

    .welcome-hero {
        min-height: 340px;
        border-radius: 16px;
        padding: 1.1rem;
    }

    .welcome-text {
        font-size: 0.95rem;
    }

    .logo img {
        height: 50px;
        max-width: min(250px, 55vw);
    }

    .menu-toggle {
        display: inline-block;
    }

    .nav {
        position: absolute;
        right: 1rem;
        top: calc(100% + 0.5rem);
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: min(290px, calc(100vw - 2rem));
        background: rgba(5, 5, 5, 0.97);
        border: 1px solid var(--line);
        border-radius: 14px;
        padding: 0.5rem;
    }

    .nav.is-open {
        display: flex;
    }

    .nav a {
        border-radius: 10px;
    }

    .rules-toolbar {
        grid-template-columns: 1fr;
    }

    .status-wrap {
        justify-items: start;
    }

    .toolbar-actions {
        justify-content: flex-start;
    }

    .row {
        grid-template-columns: 1.6fr 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .header {
        padding: 0.4rem 0.65rem;
    }

    .hero h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .welcome-hero {
        min-height: 300px;
        padding: 1rem;
    }

    .welcome-hero h1 {
        font-size: clamp(1.9rem, 10vw, 2.9rem);
    }

    .welcome-slogan {
        font-size: 1.05rem;
        letter-spacing: 0.09em;
    }

    .welcome-hero .cta {
        width: 100%;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .cta,
    .ghost {
        width: 100%;
    }

    .row {
        grid-template-columns: 1fr;
    }

    .row span + span {
        border-left: none;
    }

    .row span {
        border-bottom: 1px solid rgba(182, 167, 219, 0.24);
    }

    .row.head {
        display: none;
    }

    .logo img {
        height: 42px;
        max-width: min(210px, 62vw);
    }
}

@media print {
    .skip-link,
    .progress-bar,
    .bg-glow,
    .header,
    .welcome-hero,
    .rules-toolbar,
    .rules-index,
    .menu-toggle,
    .hero-actions,
    .back-top {
        display: none !important;
    }

    body {
        background: #ffffff;
        color: #111111;
        line-height: 1.4;
        font-size: 11pt;
    }

    main {
        width: 100%;
        max-width: none;
    }

    .hero {
        padding: 0 0 0.6rem;
    }

    .tag {
        color: #444444;
    }

    .hero h1 {
        color: #000000;
        font-size: 24pt;
        margin: 0.2rem 0 0.4rem;
    }

    .hero p,
    .meta-grid p,
    .meta-grid a,
    .meta-grid code,
    .small-note,
    .rule-box details p {
        color: #222222;
    }

    .meta-grid {
        grid-template-columns: 1fr;
    }

    .meta-grid article,
    .rule-box,
    .penalty-table,
    .rule-box details {
        background: #ffffff;
        border-color: #888888;
        break-inside: avoid;
    }

    .rule-box h2,
    .meta-grid h2 {
        color: #000000;
    }

    .footer {
        color: #222222;
        border-top: 1px solid #999999;
        padding: 0.7rem 0 0;
    }

    .footer a,
    .footer code {
        color: #111111;
    }
}
