:root {
    --bg: #070b12;
    --bg-soft: #0e1522;
    --panel: rgba(13, 20, 33, 0.78);
    --panel-strong: rgba(12, 18, 30, 0.94);
    --text: #f3f2ee;
    --muted: #b7c1cf;
    --gold: #f1c879;
    --gold-strong: #e2a93d;
    --line: rgba(255, 255, 255, 0.09);
    --success: #73d19b;
    --danger: #ff8f8f;
    --shadow: 0 22px 80px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(28, 53, 94, 0.35), transparent 32%),
        radial-gradient(circle at 80% 10%, rgba(163, 97, 16, 0.18), transparent 24%),
        linear-gradient(180deg, #0a1019 0%, #06090f 35%, #05070c 100%);
}

body::before,
body::after {
    position: fixed;
    inset: 0;
    content: '';
    pointer-events: none;
}

body::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 25%);
}

body::after {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 75%);
}

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

code,
pre {
    font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

.page-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 48px;
}

.topbar {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(6, 10, 16, 0.65);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
}

.brand small {
    color: var(--muted);
}

.brand-mark {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(241, 200, 121, 0.35);
    background: radial-gradient(circle at 32% 35%, #f9e1a8 0%, #e0a74d 38%, #4e2f0f 100%);
    box-shadow: 0 0 28px rgba(241, 200, 121, 0.35);
}

.brand-mark::after {
    position: absolute;
    inset: 8px 6px 8px 18px;
    content: '';
    border-radius: 50%;
    background: rgba(6, 10, 16, 0.85);
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
    color: var(--muted);
}

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

.topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-user {
    color: var(--muted);
    font-size: 0.9rem;
}

.hero {
    display: grid;
    grid-template-columns: 1.25fr 0.85fr;
    gap: 28px;
    align-items: start;
    padding: 56px 0 24px;
}

.hero-copy,
.hero-panel,
.content-card,
.feature-card,
.adventure-card,
.step-card,
.realmlist-box {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hero-copy {
    min-height: 100%;
    padding: 48px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 30%),
        radial-gradient(circle at top right, rgba(241, 200, 121, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(17, 25, 40, 0.96), rgba(8, 12, 18, 0.92));
}

.hero-copy h1 {
    max-width: 13ch;
    margin: 16px 0;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.hero-text {
    max-width: 60ch;
    margin: 0;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.8;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-actions,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.hero-actions {
    margin: 28px 0 34px;
    gap: 14px;
    flex-wrap: wrap;
}

.button {
    min-height: 50px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 700;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--gold {
    color: #1b1204;
    background: linear-gradient(135deg, #f7db9c 0%, #e6ae44 60%, #c37d1f 100%);
}

.button--ghost {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.button--full {
    width: 100%;
}

.highlight-grid,
.pillar-grid,
.adventure-grid,
.steps-grid,
.portal-grid,
.character-grid,
.account-list {
    display: grid;
    gap: 18px;
}

.highlight-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.highlight-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
}

.highlight-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.4rem;
}

.highlight-card span,
.section-heading p,
.content-card p,
.feature-card p,
.feature-points,
.adventure-card p,
.step-card p,
.panel-header p,
.server-card dt,
.checkbox-field,
.form-field small,
.footer p {
    color: var(--muted);
}

.hero-panel {
    padding: 28px;
    background:
        radial-gradient(circle at top, rgba(96, 157, 255, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(16, 24, 39, 0.96), rgba(9, 14, 22, 0.94));
}

.panel-header h2,
.section-heading h2,
.feature-card h2,
.realmlist-box pre,
.server-card h3 {
    margin: 12px 0 0;
}

.register-form {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

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

.form-field {
    display: grid;
    gap: 9px;
}

.form-field span {
    font-size: 0.95rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.form-control:focus {
    border-color: rgba(241, 200, 121, 0.5);
    box-shadow: 0 0 0 3px rgba(241, 200, 121, 0.1);
}

.form-control--textarea {
    min-height: 220px;
    padding: 16px;
    resize: vertical;
    line-height: 1.6;
    font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

.is-invalid {
    border-color: rgba(255, 143, 143, 0.6);
}

.form-error {
    color: var(--danger);
    font-size: 0.88rem;
}

.form-error--stack {
    margin-top: -8px;
}

.checkbox-field {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    font-size: 0.93rem;
    line-height: 1.55;
}

.checkbox-field input {
    margin-top: 4px;
}

.alert {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    font-size: 0.95rem;
}

.alert--success {
    border-color: rgba(115, 209, 155, 0.22);
    color: var(--success);
    background: rgba(115, 209, 155, 0.08);
}

.alert--error {
    border-color: rgba(255, 143, 143, 0.22);
    color: var(--danger);
    background: rgba(255, 143, 143, 0.08);
}

.server-card {
    display: grid;
    gap: 18px;
    margin-top: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
}

.server-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.server-card dt,
.server-card dd {
    margin: 0;
}

.server-card dd {
    font-size: 1.1rem;
    font-weight: 700;
}

.section {
    padding: 42px 0;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 24px;
}

.section-heading h2 {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.pillar-grid,
.adventure-grid,
.steps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-card,
.adventure-card,
.step-card,
.realmlist-box {
    padding: 28px;
}

.content-card h3,
.adventure-card h3,
.step-card h3 {
    margin: 0 0 12px;
}

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

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

.feature-card {
    padding: 30px;
}

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

.feature-points li {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
}

.start-section {
    padding-bottom: 24px;
}

.step-card {
    min-height: 220px;
}

.step-index {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--gold);
    font-size: 2rem;
    font-weight: 800;
}

.realmlist-box {
    margin-top: 20px;
    background: var(--panel-strong);
}

.realmlist-box pre {
    margin-top: 16px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    white-space: pre-wrap;
    word-break: break-word;
}

.stats-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0 0;
}

.stats-list--compact {
    margin-top: 20px;
}

.stats-list dt,
.stats-list dd {
    margin: 0;
}

.stats-list dt {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.stats-list dd {
    font-size: 1rem;
    font-weight: 700;
}

.action-stack,
.account-list {
    display: grid;
    gap: 16px;
}

.stack-form,
.news-card {
    display: grid;
    gap: 16px;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
}

.checkbox-inline input {
    margin: 0;
}

.muted-note {
    color: var(--muted);
    font-size: 0.92rem;
}

.code-block,
.feed-preview {
    margin: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    font-size: 0.92rem;
    line-height: 1.65;
}

.code-block {
    display: block;
}

.feed-preview--compact {
    min-height: 100%;
}

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

.character-card {
    position: relative;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: var(--shadow);
}

.character-card__top,
.account-card__header,
.character-row,
.search-form,
.inline-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.character-card__top {
    align-items: flex-start;
}

.character-card h3,
.account-card h3 {
    margin: 0 0 8px;
}

.character-card p,
.account-card p,
.character-row span,
.empty-inline {
    color: var(--muted);
}

.tag,
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 8px 12px;
    border: 1px solid rgba(241, 200, 121, 0.22);
    border-radius: 999px;
    background: rgba(241, 200, 121, 0.08);
    color: var(--gold);
    font-size: 0.84rem;
    font-weight: 700;
}

.empty-state {
    text-align: center;
}

.search-form {
    margin-top: 18px;
}

.tab-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.search-form .form-control {
    flex: 1 1 auto;
}

.inline-form {
    margin-top: 20px;
    align-items: end;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.inline-form .form-field {
    flex: 1 1 auto;
}

.account-card,
.character-list {
    display: grid;
    gap: 18px;
}

.character-list {
    margin-top: 18px;
}

.character-row {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.character-row strong {
    display: block;
    margin-bottom: 4px;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 24px;
    padding: 26px 0 8px;
    border-top: 1px solid var(--line);
}

@media (max-width: 1120px) {
    .hero,
    .section--split,
    .portal-grid {
        grid-template-columns: 1fr;
    }

    .pillar-grid,
    .adventure-grid,
    .steps-grid,
    .highlight-grid,
    .character-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 20px, 1240px);
    }

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

    .topnav {
        justify-content: flex-start;
    }

    .topbar-actions,
    .tab-switcher,
    .search-form,
    .inline-form,
    .character-card__top,
    .account-card__header,
    .character-row {
        flex-direction: column;
        align-items: stretch;
    }

    .hero {
        padding-top: 18px;
    }

    .hero-copy,
    .hero-panel,
    .feature-card,
    .content-card,
    .adventure-card,
    .step-card,
    .realmlist-box {
        padding: 22px;
        border-radius: 22px;
    }

    .hero-copy h1 {
        max-width: none;
    }

    .form-row,
    .pillar-grid,
    .adventure-grid,
    .steps-grid,
    .highlight-grid,
    .server-card dl,
    .stats-list,
    .character-grid {
        grid-template-columns: 1fr;
    }
}
