:root {
    --bg: #0d0b14;
    --bg-soft: #1a1525;
    --bg-alt: #130f1e;
    --primary: #9b2355;
    --primary-dark: #8b1a6b;
    --accent: #c03afc;
    --accent-soft: #b030e0;
    --text: #ffffff;
    --text-muted: #cccccc;
    --border: #8b1a6b;
    --grid: rgba(255, 255, 255, 0.05);
    --shadow: 0 0 18px rgba(192, 58, 252, 0.22);
    --shadow-strong: 0 0 22px rgba(176, 48, 224, 0.45);
    --header-height: 88px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        linear-gradient(90deg, transparent 0, transparent 31px, var(--grid) 32px),
        linear-gradient(180deg, transparent 0, transparent 31px, var(--grid) 32px),
        var(--bg);
    background-size: 32px 32px;
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

img {
    max-width: 100%;
    display: block;
}

main {
    overflow: hidden;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    background: rgba(13, 11, 20, 0.95);
    border-bottom: 1px solid var(--accent);
    backdrop-filter: blur(8px);
}

.header-inner {
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.brand-mark {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    background:
        linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    border: 2px solid var(--text);
    box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.08);
}

.brand-mark.has-label {
    min-width: 22px;
    padding: 0 4px;
    color: var(--text);
    font-size: 0.52rem;
    line-height: 1;
}

.brand-media {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border: 2px solid var(--text);
    box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.brand-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-nav ul,
.site-footer ul {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav a,
.site-footer a {
    display: inline-block;
    padding: 10px 12px;
    border: 2px solid transparent;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible {
    border-color: var(--accent);
    color: var(--text);
    background: rgba(192, 58, 252, 0.08);
    box-shadow: var(--shadow);
    outline: none;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--header-height) + 56px) 0 72px;
    background:
        linear-gradient(135deg, rgba(139, 26, 107, 0.28) 0%, rgba(13, 11, 20, 0.95) 55%, rgba(155, 35, 85, 0.18) 100%);
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 16px, transparent 16px, transparent 32px);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    text-align: center;
    display: grid;
    gap: 18px;
    justify-items: center;
}

.eyebrow,
.section-label {
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.85rem;
    font-weight: 700;
}

.hero h1,
.section-heading h2,
.panel-card h3 {
    font-family: 'Press Start 2P', cursive;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 5.8rem);
    line-height: 1.1;
    color: var(--text);
    text-shadow: 0 0 14px rgba(192, 58, 252, 0.45);
}

.hero-text {
    max-width: 720px;
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.hero-actions {
    padding-top: 8px;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    padding: 16px 24px;
    border: 2px solid var(--accent);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-soft) 100%);
    color: var(--text);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.08em;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
    cursor: pointer;
}

.cta-button:hover,
.cta-button:focus-visible {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 rgba(192, 58, 252, 0.16), var(--shadow-strong);
    filter: brightness(1.08);
    outline: none;
}

.cta-button.is-copied {
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent) 100%);
    box-shadow: 8px 8px 0 rgba(192, 58, 252, 0.16), var(--shadow-strong);
}

.server-ip {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.server-ip span,
.hero-link {
    color: var(--text);
    font-weight: 700;
}

.hero-link {
    border-bottom: 2px solid rgba(192, 58, 252, 0.45);
    padding-bottom: 2px;
}

.hero-link:hover,
.hero-link:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    outline: none;
}

.state-page .site-header {
    backdrop-filter: blur(8px);
}

.state-main {
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.state-hero {
    min-height: calc(100vh - 88px);
}

.state-shell {
    width: min(1120px, calc(100% - 32px));
    display: grid;
    gap: 28px;
}

.state-hero-inner {
    gap: 24px;
    max-width: 760px;
}

.state-text {
    margin: 0;
    max-width: 48rem;
}

.state-actions {
    padding-top: 8px;
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.state-card {
    min-height: auto;
}

.state-button {
    min-width: 220px;
}

.section {
    padding: 88px 0;
}

.section-alt {
    background: var(--bg-alt);
    border-top: 2px solid rgba(192, 58, 252, 0.3);
    border-bottom: 2px solid rgba(155, 35, 85, 0.3);
}

.section-heading {
    margin-bottom: 32px;
}

.section-heading h2 {
    margin: 12px 0 0;
    font-size: clamp(1.4rem, 3vw, 2.3rem);
    line-height: 1.4;
}

.feature-grid,
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.panel-card {
    min-height: 100%;
    padding: 24px;
    background: linear-gradient(180deg, rgba(26, 21, 37, 0.96) 0%, rgba(19, 15, 30, 0.96) 100%);
    border: 2px solid var(--border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 6px 6px 0 rgba(0, 0, 0, 0.24);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel-card h3 {
    margin: 0 0 16px;
    font-size: 1rem;
    line-height: 1.5;
}

.panel-card p {
    margin: 0;
    color: var(--text-muted);
}

.feature-card {
    display: grid;
    gap: 20px;
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 10px 10px 0 rgba(0, 0, 0, 0.22), var(--shadow);
}

.feature-card-header {
    display: grid;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 2px solid rgba(176, 48, 224, 0.25);
}

.feature-tag {
    display: inline-flex;
    width: fit-content;
    margin: 0;
    padding: 6px 10px;
    border: 2px solid var(--accent);
    background: rgba(192, 58, 252, 0.08);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
}

.feature-copy {
    margin: 0;
}

.feature-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding: 12px 14px 12px 34px;
    border: 2px solid rgba(176, 48, 224, 0.2);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
}

.feature-list li::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 14px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: 2px solid var(--text);
    transform: translateY(-50%);
}

.avatar-placeholder {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 2px solid var(--accent);
    background: rgba(192, 58, 252, 0.1);
    font-size: 1.8rem;
    box-shadow: var(--shadow);
}

.rules-table {
    border: 2px solid var(--accent-soft);
    background: rgba(13, 11, 20, 0.45);
}

.rule-row {
    display: grid;
    grid-template-columns: 88px 1fr;
}

.rule-row + .rule-row {
    border-top: 2px solid rgba(176, 48, 224, 0.35);
}

.rule-number,
.rule-text {
    padding: 18px 20px;
}

.rule-number {
    display: grid;
    place-items: center;
    border-right: 2px solid rgba(176, 48, 224, 0.35);
    font-family: 'Press Start 2P', cursive;
    color: var(--accent);
    font-size: 0.95rem;
}

.rule-text {
    color: var(--text-muted);
}

.team-card {
    display: grid;
    gap: 16px;
    align-content: start;
}

.avatar-placeholder {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.4rem;
    color: var(--text);
}

.site-footer {
    padding: 28px 0;
    background: #09070f;
    border-top: 2px solid var(--accent);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-footer p {
    margin: 0;
    color: var(--text-muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid rgba(176, 48, 224, 0.3);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

label span {
    display: inline-block;
    margin-bottom: 8px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.compact-form {
    margin-top: 16px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.admin-summary-grid {
    margin-bottom: 28px;
}

.admin-section {
    margin-top: 24px;
}

.admin-card-list {
    display: grid;
    gap: 20px;
    margin-top: 24px;
}

.admin-narrow {
    max-width: 560px;
}

.two-col-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notice,
.alert {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 2px solid;
}

.notice {
    border-color: rgba(48, 176, 224, 0.7);
    background: rgba(48, 176, 224, 0.12);
}

.alert {
    border-color: rgba(255, 99, 132, 0.7);
    background: rgba(155, 35, 85, 0.18);
}

.muted {
    color: var(--text-muted);
}

.mono {
    font-family: Consolas, Monaco, monospace;
}

.divider {
    height: 2px;
    margin: 24px 0;
    background: linear-gradient(90deg, rgba(176, 48, 224, 0.55), transparent);
}

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.table th,
.table td {
    padding: 14px 12px;
    border-bottom: 2px solid rgba(176, 48, 224, 0.2);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 2px solid rgba(176, 48, 224, 0.45);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.button:hover,
.button:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow);
    background: rgba(192, 58, 252, 0.1);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.check input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.check span {
    margin: 0;
}

.choice-group {
    display: grid;
    gap: 12px;
}

.choice-title {
    margin: 0;
}

.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.check-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid rgba(176, 48, 224, 0.25);
    background: rgba(255, 255, 255, 0.02);
}

.check-tile input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.check-tile span {
    margin: 0;
    color: var(--text);
}

.inner-card {
    min-height: auto;
    padding: 20px;
    background: rgba(13, 11, 20, 0.5);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 2px solid rgba(176, 48, 224, 0.3);
    background: rgba(176, 48, 224, 0.08);
    color: var(--text);
    font-size: 0.85rem;
}

.pill-ok {
    border-color: rgba(40, 200, 120, 0.45);
    background: rgba(40, 200, 120, 0.12);
}

.pill-bad {
    border-color: rgba(255, 99, 132, 0.45);
    background: rgba(255, 99, 132, 0.12);
}

.status-list {
    display: grid;
    gap: 10px;
    margin: 0 0 18px;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text-muted);
}

.status-dot {
    width: 12px;
    height: 12px;
    border: 2px solid var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.status-ok {
    background: #38d36f;
}

.status-bad {
    background: #ff6384;
}

.code-block {
    margin: 0;
    padding: 12px 14px;
    overflow-x: auto;
    border: 2px solid rgba(176, 48, 224, 0.2);
    background: rgba(0, 0, 0, 0.24);
    color: #f3d7ff;
    font-family: Consolas, Monaco, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.compact-code {
    max-width: 360px;
    font-size: 0.8rem;
}

@media (max-width: 980px) {
    .feature-grid,
    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .header-inner,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav ul,
    .site-footer ul {
        flex-wrap: wrap;
    }

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

    .two-col-grid,
    .three-col-grid {
        grid-template-columns: 1fr;
    }

    .user-card-header {
        flex-direction: column;
    }

    .user-meta {
        justify-content: flex-start;
    }

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

@media (max-width: 640px) {
    :root {
        --header-height: 132px;
    }

    .container {
        width: min(1120px, calc(100% - 24px));
    }

    .state-shell {
        width: min(1120px, calc(100% - 24px));
    }

    .hero {
        padding-top: calc(var(--header-height) + 36px);
    }

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

    .feature-grid,
    .team-grid,
    .rule-row {
        grid-template-columns: 1fr;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .table {
        min-width: 0;
    }

    .rule-number {
        border-right: 0;
        border-bottom: 2px solid rgba(176, 48, 224, 0.35);
    }

    .cta-button {
        width: 100%;
        min-width: 0;
    }

    .state-actions {
        width: 100%;
    }

    .brand {
        font-size: 0.8rem;
    }

    .section {
        padding: 72px 0;
    }
}
