:root {
    color-scheme: dark;
    --bg: #070b0d;
    --panel: rgba(17, 25, 27, 0.9);
    --panel-strong: #11191b;
    --line: rgba(180, 213, 207, 0.18);
    --text: #edf4f1;
    --muted: #a7b7b2;
    --accent: #a7e0c5;
    --accent-strong: #74c89f;
    --danger: #ff8f86;
    --warning: #ffd27d;
    --shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 17% 12%, rgba(83, 132, 113, 0.16), transparent 28rem),
        radial-gradient(circle at 86% 78%, rgba(100, 58, 65, 0.16), transparent 34rem),
        linear-gradient(150deg, #071012 0%, #080b0d 43%, #0b1112 100%);
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    content: "";
    opacity: 0.24;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

button,
input {
    font: inherit;
}

a {
    color: var(--accent);
}

button,
.button-link {
    min-height: 48px;
    border: 1px solid rgba(167, 224, 197, 0.45);
    border-radius: 12px;
    padding: 0.78rem 1.1rem;
    color: #07100c;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 10px 28px rgba(68, 159, 116, 0.18);
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.015em;
    text-decoration: none;
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

button:hover,
.button-link:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(68, 159, 116, 0.26);
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(167, 224, 197, 0.65);
    outline-offset: 3px;
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

button.secondary,
.button-link.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.055);
    border-color: var(--line);
    box-shadow: none;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"] {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 0.76rem 0.9rem;
    color: var(--text);
    background: rgba(2, 7, 8, 0.68);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

input::placeholder {
    color: #6f817c;
}

label {
    display: grid;
    gap: 0.42rem;
    color: #d8e5e0;
    font-size: 0.9rem;
    font-weight: 700;
}

.shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 850;
    letter-spacing: 0.015em;
}

.brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(167, 224, 197, 0.35);
    border-radius: 10px;
    color: var(--accent);
    background: rgba(167, 224, 197, 0.09);
    box-shadow: inset 0 0 20px rgba(167, 224, 197, 0.07);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.48rem 0.72rem;
    color: var(--muted);
    background: rgba(6, 11, 12, 0.65);
    font-size: 0.78rem;
    font-weight: 700;
}

.status-pill::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    content: "";
    background: var(--accent-strong);
    box-shadow: 0 0 14px rgba(116, 200, 159, 0.8);
}

.status-pill.offline::before {
    background: var(--warning);
    box-shadow: 0 0 14px rgba(255, 210, 125, 0.55);
}

.hero {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    gap: clamp(2rem, 7vw, 6rem);
    align-items: center;
    min-height: calc(100vh - 90px);
    padding: 3rem 0 6rem;
}

.eyebrow {
    margin: 0 0 0.8rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.hero h1 {
    max-width: 800px;
    margin-bottom: 1.2rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.15rem, 8vw, 7rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.88;
}

.hero h1 span {
    display: block;
    color: transparent;
    background: linear-gradient(135deg, #eef6f3 18%, #90c6ad 72%);
    background-clip: text;
}

.hero-copy {
    max-width: 680px;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.22rem);
    line-height: 1.7;
}

.feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.6rem;
}

.feature-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.52rem 0.76rem;
    color: #c8d7d2;
    background: rgba(255,255,255,.035);
    font-size: 0.78rem;
    font-weight: 750;
}

.entry-panel,
.setup-panel,
.message-panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(1.25rem, 3vw, 2rem);
    background:
        linear-gradient(145deg, rgba(21, 31, 33, 0.96), rgba(10, 16, 18, 0.94));
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.04);
    backdrop-filter: blur(18px);
}

.entry-panel h1,
.entry-panel h2,
.setup-panel h1,
.message-panel h1 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.panel-intro {
    margin-bottom: 1.35rem;
    color: var(--muted);
    line-height: 1.55;
}

.field-stack {
    display: grid;
    gap: 1rem;
}

.world-name-fields {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.world-name-fields legend {
    margin-bottom: 0.45rem;
    font-weight: 800;
}

.player-name-confirmation strong {
    color: var(--mint, #9de8c8);
    font-size: 1.05rem;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 1rem;
}

.join-box {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.1rem;
    border-top: 1px solid var(--line);
    padding-top: 1.1rem;
}

.room-code-input {
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.05rem;
    font-weight: 850;
}

.form-message {
    min-height: 1.45rem;
    margin: 0.85rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.form-message.error {
    color: var(--danger);
}

.form-message.success {
    color: var(--accent);
}

.warning-banner,
.success-banner,
.error-banner {
    border: 1px solid rgba(255, 210, 125, 0.28);
    border-radius: 13px;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    color: #ffe4ac;
    background: rgba(105, 70, 17, 0.22);
    line-height: 1.5;
}

.success-banner {
    border-color: rgba(116, 200, 159, 0.32);
    color: #c7f3dc;
    background: rgba(29, 91, 63, 0.22);
}

.error-banner {
    border-color: rgba(255, 143, 134, 0.35);
    color: #ffc6c1;
    background: rgba(110, 31, 31, 0.24);
}

.setup-page {
    padding: 1rem 0 5rem;
}

.setup-header {
    max-width: 760px;
    margin: 3rem auto 2rem;
    text-align: center;
}

.setup-header h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 6vw, 4.7rem);
    font-weight: 500;
    letter-spacing: -0.045em;
}

.setup-header p {
    color: var(--muted);
    line-height: 1.65;
}

.setup-panel {
    width: min(800px, 100%);
    margin: 0 auto;
}

.form-section {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
}

.form-section:first-of-type {
    margin-top: 0;
    border-top: 0;
    padding-top: 0;
}

.form-section h2 {
    margin: 0;
    font-size: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-weight: 700;
}

.checkbox-row input {
    width: 20px;
    height: 20px;
    margin-top: 0.1rem;
    accent-color: var(--accent-strong);
}

.checkbox-copy small,
.field-help {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.5;
}

.secret-fields {
    display: grid;
    gap: 1rem;
    border: 1px dashed rgba(167, 224, 197, 0.2);
    border-radius: 14px;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.15);
}

.setup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.result-list {
    margin: 1rem 0 1.5rem;
    padding-left: 1.15rem;
    color: #d2e4dc;
    line-height: 1.6;
}

.message-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
}

.message-panel {
    width: min(600px, 100%);
    text-align: center;
}

.message-panel p {
    color: var(--muted);
    line-height: 1.6;
}

.footer-note {
    margin-top: 1.5rem;
    color: #71827d;
    font-size: 0.76rem;
    text-align: center;
}

.release-history {
    padding-block: clamp(2rem, 6vw, 5rem);
}

.release-hero,
.release-card {
    border: 1px solid rgba(143, 196, 175, 0.24);
    border-radius: 1rem;
    background: rgba(8, 22, 19, 0.9);
    box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.24);
}

.release-hero {
    padding: clamp(1.4rem, 4vw, 3rem);
}

.release-hero h1,
.release-card h2 {
    margin: 0.2rem 0 0.7rem;
}

.release-hero p,
.release-card p,
.release-card li {
    color: var(--muted);
    line-height: 1.65;
}

.release-hero code {
    overflow-wrap: anywhere;
}

.release-list {
    display: grid;
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.release-card {
    padding: clamp(1.2rem, 3vw, 2rem);
}

.release-qualifications {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.3rem;
}

.release-qualifications section {
    padding: 1rem;
    border: 1px solid rgba(143, 196, 175, 0.18);
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.14);
}

.release-qualifications h3 {
    margin-top: 0;
}

@media (max-width: 820px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 2.5rem;
    }

    .hero h1 {
        font-size: clamp(3.3rem, 16vw, 6rem);
    }

    .release-qualifications {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .shell {
        width: min(100% - 1.15rem, 1180px);
    }

    .site-header {
        align-items: flex-start;
    }

    .brand span:last-child {
        display: none;
    }

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

    .form-grid .wide {
        grid-column: auto;
    }

    .setup-actions {
        flex-direction: column;
    }
}
