:root {
    color-scheme: dark;
    --page: #151315;
    --surface: #211c1e;
    --surface-deep: #191619;
    --stroke: #43363a;
    --text: #f6ebe2;
    --muted: #c9b9b4;
    --ember: #f4a779;
    --ember-light: #ffc398;
    --danger: #ffb9b5;
    --serif: Georgia, 'Times New Roman', serif;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--page);
    color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; line-height: 1.5; }
a { color: var(--ember-light); text-underline-offset: .2em; }
a:hover { color: #ffdac2; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--ember-light); outline-offset: 4px; }

.shell { width: min(calc(100% - 2rem), 70rem); margin-inline: auto; }
.site-header { border-bottom: 1px solid #362b2f; background: #191619; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: .55rem; min-height: 4rem; }
.wordmark {
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    gap: .58rem;
    font-size: .78rem;
    font-weight: 750;
    letter-spacing: .105em;
    text-transform: uppercase;
    white-space: nowrap;
}
.sigil {
    display: inline-grid;
    position: relative;
    flex: 0 0 1.5rem;
    width: 1.5rem;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid #b47860;
    border-radius: 50%;
    box-shadow: inset 0 0 .8rem #cd6c4e28;
}
.sigil::after {
    content: '';
    height: .82rem;
    width: .38rem;
    background: var(--ember);
    clip-path: polygon(56% 0, 100% 58%, 57% 100%, 0 70%);
    transform: rotate(12deg);
}
.site-nav { display: flex; align-items: center; gap: .4rem; }
.site-nav form { margin: 0; }
.nav-link { display: inline-grid; place-items: center; min-height: 2.75rem; padding: .35rem .48rem; color: var(--muted); font-size: .88rem; }
.nav-link[aria-current='page'] { color: var(--text); text-decoration-color: var(--ember); }

.main-shell { padding-block: 1.25rem 2.75rem; }
.skip-link { position: fixed; top: .5rem; left: .75rem; z-index: 2; padding: .65rem 1rem; background: var(--surface); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    border: 1px solid var(--stroke);
    border-radius: 1rem;
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 1.25rem 3rem #08070845;
}
.auth-art, .hub-hero { background-color: #302025; background-image: url('arena.webp'); background-size: cover; }
.auth-art { min-height: 10rem; background-position: center 50%; border-bottom: 1px solid var(--stroke); }
.auth-panel { display: grid; align-items: center; padding: 1.45rem 1.35rem 1.75rem; }
.form-content { width: min(100%, 24rem); margin-inline: auto; min-width: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; color: var(--text); }
.auth-panel h1, .message-panel h1 { font-size: clamp(2.1rem, 9vw, 3.15rem); letter-spacing: -.045em; }
.auth-form { display: grid; gap: 1rem; margin-top: 1.4rem; }
.field { display: grid; min-width: 0; gap: .35rem; }
.field label { font-size: .9rem; font-weight: 650; }
.field input {
    width: 100%;
    min-width: 0;
    min-height: 3.05rem;
    padding: .55rem .75rem;
    color: var(--text);
    background: var(--surface-deep);
    border: 1px solid #6c555b;
    border-radius: .46rem;
    font-size: 1rem;
}
.field input[aria-invalid='true'] { border-color: var(--danger); }
.field-help { color: var(--muted); font-size: .82rem; }
.field-help ul { padding-left: 1.12rem; margin: 0; }
.errorlist { color: var(--danger); font-size: .86rem; padding-left: 1.15rem; margin: 0; }
.form-alert { padding: .65rem .72rem; background: #3a2023; border: 1px solid #7e484e; border-radius: .45rem; }
.auth-link { font-size: .9rem; margin: 1.2rem 0 0; color: var(--muted); }
.auth-link a { display: inline-block; padding-block: .55rem; font-weight: 650; }
.button {
    display: inline-grid;
    place-items: center;
    min-height: 2.75rem;
    padding: .45rem .65rem;
    border: 1px solid transparent;
    border-radius: .45rem;
    font-weight: 700;
    cursor: pointer;
}
.button-primary { width: 100%; min-height: 3.15rem; background: var(--ember); color: #211515; }
.button-primary:hover { background: var(--ember-light); }
.button-quiet { background: #2b2226; border-color: var(--stroke); color: var(--text); font-size: .82rem; }
.button-quiet:hover { background: #3c2b31; }

.notice { margin: 0 0 1rem; padding: .75rem 1rem; background: #2d261e; border: 1px solid #675338; border-radius: .5rem; }
.hub-hero {
    display: grid;
    align-items: end;
    min-height: 15rem;
    border: 1px solid var(--stroke);
    border-radius: 1rem;
    overflow: hidden;
    background-image: linear-gradient(0deg, #160f13f7, #160f1356 75%), url('arena.webp');
    background-position: center 45%;
}
.hub-hero-content { padding: 1.65rem 1.2rem; }
.hub-hero h1 { font-size: clamp(2rem, 8vw, 3.9rem); letter-spacing: -.05em; overflow-wrap: anywhere; }
.hub-hero h1 span { color: var(--ember-light); }
.hub-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.hub-card { min-width: 0; padding: 1.18rem; border: 1px solid var(--stroke); border-radius: .82rem; background: var(--surface); }
.hub-card h2 { font-size: 1.65rem; }
.hub-card p { margin: .7rem 0 0; color: var(--muted); }
.hub-card strong { color: var(--text); }
.hub-card a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.hub-card .arena-status { display: flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 650; }
.status-dot { width: .53rem; aspect-ratio: 1; flex: 0 0 .53rem; border-radius: 50%; background: var(--ember); }
.message-panel { max-width: 35rem; margin-inline: auto; }

@media (min-width: 39rem) {
    .shell { width: min(calc(100% - 3rem), 70rem); }
    .main-shell { padding-top: 2.25rem; }
    .auth-art { min-height: 14rem; }
    .auth-panel { padding: 2rem; }
    .hub-grid { grid-template-columns: 1.4fr 1fr; }
    .hub-hero { min-height: 19rem; }
    .hub-hero-content { padding: 2rem; }
    .hub-card { padding: 1.4rem; }
}

@media (min-width: 55rem) {
    .header-inner { min-height: 4.5rem; }
    .site-nav { gap: .8rem; }
    .main-shell { padding-block: 3.35rem; }
    .auth-layout { grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); min-height: 33rem; }
    .auth-art { border-bottom: 0; border-right: 1px solid var(--stroke); background-position: 53% center; }
    .auth-panel { padding: 2.45rem; }
    .hub-hero { background-image: linear-gradient(90deg, #160f13f2, #160f134f 76%), url('arena.webp'); }
    .hub-hero-content { padding: 2.8rem; }
}
