:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #f6f5f8;
    background: #101117;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --surface: #191a22;
    --surface-raised: #20212b;
    --border: #333440;
    --muted: #a6a6b5;
    --accent: #ff665c;
    --accent-bright: #ff8276;
    --violet: #a38aff;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 78% 5%, #32264c88 0, transparent 32rem),
        radial-gradient(ellipse at 7% 40%, #40252d55 0, transparent 34rem),
        #101117;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.site-shell {
    width: min(1180px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.site-header {
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: 34px;
    border-bottom: 1px solid #ffffff12;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-size: 1.12rem;
    font-weight: 850;
    letter-spacing: -.045em;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #ff827677;
    border-radius: 11px;
    background: linear-gradient(145deg, #ff685c, #cf354a);
    box-shadow: 0 5px 18px #ec4d4d33;
    color: white;
    font-size: 1.05rem;
    font-weight: 900;
}

.brand-accent {
    color: var(--accent-bright);
}

.main-nav,
.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-nav {
    flex: 1;
}

.main-nav a {
    color: var(--muted);
    font-size: .92rem;
    transition: color .18s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
}

.main-nav a.active {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 8px;
}

.header-actions {
    gap: 12px;
}

.account-name {
    max-width: 150px;
    overflow: hidden;
    color: #d9d8e1;
    font-size: .9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-form {
    margin: 0;
}

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 19px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-size: .94rem;
    font-weight: 750;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid #a38affaa;
    outline-offset: 3px;
}

.button-primary {
    background: linear-gradient(135deg, #fa685d, #da4350);
    box-shadow: 0 8px 25px #e54b4c30;
    color: #fff;
}

.button-primary:hover {
    background: linear-gradient(135deg, #ff7b70, #e84b58);
    box-shadow: 0 10px 30px #e54b4c45;
}

.button-secondary,
.button-quiet {
    border-color: var(--border);
    background: #ffffff07;
    color: #e8e6ed;
}

.button-secondary:hover,
.button-quiet:hover {
    border-color: #686777;
    background: #ffffff0d;
}

.button-small {
    min-height: 38px;
    padding: 0 13px;
    border-radius: 9px;
    font-size: .84rem;
}

.button-wide {
    width: 100%;
}

main {
    flex: 1;
}

.hero {
    min-height: 440px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin: 34px 0 24px;
    padding: 56px 64px;
    border: 1px solid #ffffff12;
    border-radius: 26px;
    background:
        radial-gradient(ellipse at 78% 49%, #58315955 0, transparent 24rem),
        linear-gradient(118deg, #211c29, #191822 57%, #211a2b);
    box-shadow: 0 28px 80px #0003;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 570px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--accent-bright);
    font-size: .75rem;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

.hero h1,
.auth-aside h1,
.page-heading h1,
.message-card h1 {
    margin-bottom: 17px;
    font-size: clamp(2.5rem, 5.5vw, 4.3rem);
    font-weight: 850;
    letter-spacing: -.065em;
    line-height: 1.04;
}

.hero h1 span {
    color: #ff8276;
}

.hero-content > p,
.auth-aside > p,
.page-heading > p,
.message-card > p {
    max-width: 510px;
    margin-bottom: 26px;
    color: #b9b6c4;
    font-size: 1.04rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-art {
    width: 330px;
    height: 330px;
    position: absolute;
    top: 50%;
    right: 42px;
    transform: translateY(-50%);
}

.hero-orb {
    width: 172px;
    height: 172px;
    position: absolute;
    top: 79px;
    left: 80px;
    display: grid;
    place-items: center;
    border: 1px solid #ffaba55e;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 28%, #ffb0a7 0, #fa685d 20%, #c83850 68%, #612b54 100%);
    box-shadow: 0 0 55px #f05b7444, inset -15px -18px 35px #561d4655, inset 6px 7px 17px #ffe2cb55;
    color: #ffffffcf;
    font-size: 4.8rem;
    font-weight: 900;
    letter-spacing: -.1em;
}

.orbit {
    position: absolute;
    inset: 45px 20px;
    border: 1px solid #c7a4ff30;
    border-radius: 50%;
    transform: rotate(-32deg);
}

.orbit-two {
    inset: 16px 64px;
    border-color: #ff8e8330;
    transform: rotate(45deg);
}

.spark {
    width: 8px;
    height: 8px;
    position: absolute;
    border-radius: 50%;
    background: #ffb49d;
    box-shadow: 0 0 16px #ff8266;
}

.spark-one {
    top: 64px;
    right: 71px;
}

.spark-two {
    bottom: 72px;
    left: 45px;
    width: 5px;
    height: 5px;
    background: #c3a5ff;
    box-shadow: 0 0 15px #a38aff;
}

.spark-three {
    right: 32px;
    bottom: 105px;
    width: 4px;
    height: 4px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 34px;
}

.panel {
    border: 1px solid var(--border);
    border-radius: 17px;
    background: linear-gradient(145deg, #1c1d26, #171820);
    box-shadow: 0 14px 38px #0002;
}

.feature-card {
    min-height: 188px;
    padding: 23px;
}

.feature-icon {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border: 1px solid #ff827633;
    border-radius: 12px;
    background: #ff685c14;
    color: #ff8a7d;
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .04em;
}

.feature-card h2,
.play-card h2 {
    margin-bottom: 8px;
    font-size: 1.08rem;
    letter-spacing: -.02em;
}

.feature-card p,
.play-card p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .91rem;
    line-height: 1.6;
}

.site-footer {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border-top: 1px solid #ffffff12;
    padding: 17px 0;
}

.footer-credit {
    max-width: 800px;
}

.site-footer p {
    margin: 0;
    color: #8e8d9c;
    font-size: .8rem;
    line-height: 1.6;
    text-align: center;
}

.site-footer p + p {
    margin-top: 6px;
}

.site-footer a {
    color: #c4b5fd;
}

.site-footer a:hover {
    color: #e4dcff;
    text-decoration: underline;
}

.auth-layout {
    min-height: 630px;
    display: grid;
    grid-template-columns: 1fr minmax(340px, 470px);
    align-items: center;
    gap: 8%;
    padding: 56px 5%;
}

.auth-aside {
    position: relative;
    min-height: 355px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-aside h1 {
    max-width: 590px;
    font-size: clamp(2.5rem, 5vw, 4rem);
}

.auth-decoration {
    width: 200px;
    height: 7px;
    display: flex;
    gap: 7px;
    margin-top: 14px;
}

.auth-decoration span {
    height: 100%;
    flex: 1;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--accent), #ffba88);
}

.auth-decoration span:nth-child(2) {
    opacity: .55;
}

.auth-decoration span:nth-child(3) {
    opacity: .25;
}

.auth-panel {
    padding: 32px;
}

.auth-panel h2 {
    margin-bottom: 8px;
    font-size: 1.75rem;
    letter-spacing: -.045em;
}

.muted,
.auth-panel > .muted {
    color: var(--muted);
}

.auth-panel > .muted {
    margin-bottom: 22px;
    font-size: .92rem;
}

.stack-form {
    display: grid;
    gap: 17px;
}

.stack-form label {
    display: grid;
    gap: 8px;
    color: #e8e6ed;
    font-size: .88rem;
    font-weight: 700;
}

.stack-form input,
.stack-form textarea,
.editor-select-form select {
    width: 100%;
    min-height: 47px;
    padding: 12px 13px;
    border: 1px solid #444552;
    border-radius: 10px;
    background: #111219;
    color: #f6f5f8;
}

.stack-form textarea {
    min-height: 210px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .82rem;
    line-height: 1.55;
}

.stack-form input:focus,
.stack-form textarea:focus,
.editor-select-form select:focus {
    border-color: var(--accent-bright);
}

.field-hint,
.security-note,
.switch-auth {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.55;
}

.field-hint {
    margin: -8px 0 0;
}

.switch-auth {
    margin: 20px 0 0;
}

.switch-auth a {
    color: var(--accent-bright);
    font-weight: 700;
}

.security-note {
    margin: 15px 0 0;
    padding-top: 14px;
    border-top: 1px solid #ffffff12;
    font-size: .76rem;
}

.honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.notice {
    margin: 0 0 19px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: .9rem;
    line-height: 1.55;
}

.notice.error {
    border-color: #a6434d88;
    background: #5c252d66;
    color: #ffd8da;
}

.notice.info {
    border-color: #64549b88;
    background: #382e5455;
    color: #e1d9ff;
}

.page-heading {
    padding: 62px 0 25px;
}

.page-heading h1,
.message-card h1 {
    font-size: clamp(2.3rem, 5vw, 3.5rem);
}

.page-heading > p {
    margin-bottom: 0;
}

.admin-grid {
    margin-top: 20px;
}

.status-badge {
    display: inline-flex;
    margin-top: 17px;
    padding: 5px 9px;
    border: 1px solid #7562aa66;
    border-radius: 999px;
    background: #7966af18;
    color: #c7b8ff;
    font-size: .72rem;
    font-weight: 750;
}

.admin-footnote {
    margin: -12px 0 32px;
    font-size: .84rem;
}

.editor-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
    padding-bottom: 10px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.editor-tab {
    flex: 0 0 auto;
    padding: 11px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 750;
}

.editor-tab:hover,
.editor-tab.active {
    border-color: #ff827655;
    background: #ff665c18;
    color: #fff;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: 20px;
    margin-bottom: 32px;
}

.editor-form-panel,
.editor-list-panel {
    min-width: 0;
    padding: 25px;
}

.editor-form-panel h2,
.editor-list-heading h2 {
    margin-bottom: 20px;
    font-size: 1.45rem;
    letter-spacing: -.035em;
}

.editor-form-panel .stack-form {
    gap: 14px;
}

.editor-select-form {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.editor-select-form label {
    display: grid;
    gap: 8px;
    color: #e8e6ed;
    font-size: .88rem;
    font-weight: 700;
}

.editor-select-form select {
    width: 100%;
    min-height: 47px;
    padding: 0 13px;
    border: 1px solid #444552;
    border-radius: 10px;
    background: #111219;
    color: #f6f5f8;
}

.delete-confirm {
    position: relative;
}

.delete-confirm summary {
    list-style: none;
}

.delete-confirm summary::-webkit-details-marker {
    display: none;
}

.delete-confirm[open] {
    display: grid;
    gap: 8px;
    justify-items: start;
    padding: 9px;
    border: 1px solid #a6434d88;
    border-radius: 10px;
    background: #28191e;
}

.delete-confirm span {
    color: #ffd8da;
    font-size: .76rem;
}

.editor-form-panel .field-hint {
    margin: -9px 0 0;
}

.editor-form-panel .button-wide {
    width: 100%;
}

.editor-form-panel .button-secondary {
    text-align: center;
}

.editor-list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.editor-list-heading h2 {
    margin-bottom: 16px;
}

.editor-list-heading .eyebrow {
    margin-bottom: 8px;
}

.editor-list-heading .status-badge {
    flex: 0 0 auto;
    margin: 0 0 14px;
}

.editor-entry-list {
    display: grid;
    gap: 10px;
}

.editor-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid #ffffff13;
    border-radius: 12px;
    background: #11121988;
}

.editor-entry-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.editor-entry-copy strong {
    overflow-wrap: anywhere;
}

.editor-entry-copy code,
.editor-entry code,
.json-example pre {
    color: #c2b5ff;
    font-size: .78rem;
}

.editor-entry-copy p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.editor-entry-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
}

.button-danger {
    border-color: #a6434d88;
    background: #5c252d66;
    color: #ffd8da;
}

.button-danger:hover {
    border-color: #e46a73;
    background: #762d36;
}

.json-example {
    color: var(--muted);
    font-size: .85rem;
}

.json-example summary {
    width: fit-content;
    cursor: pointer;
}

.json-example pre {
    max-width: 100%;
    padding: 12px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #111219;
    line-height: 1.55;
}

.notice code {
    color: #fff;
    font-weight: 700;
}

.play-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
}

.play-card .feature-icon {
    margin-bottom: 12px;
}

.play-card .button {
    flex: 0 0 auto;
}

.play-card + .notice {
    margin-top: 18px;
}

.message-card {
    max-width: 720px;
    margin: 100px auto;
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
}

.message-card h1 {
    letter-spacing: -.05em;
}

.message-card .button {
    margin-top: 4px;
}

@media (max-width: 820px) {
    .site-shell {
        width: min(100% - 32px, 660px);
    }

    .site-header {
        min-height: 74px;
        flex-wrap: wrap;
        gap: 14px;
        padding: 14px 0;
    }

    .main-nav {
        order: 3;
        flex-basis: 100%;
        gap: 20px;
    }

    .header-actions {
        margin-left: auto;
    }

    .hero {
        min-height: 400px;
        padding: 42px;
    }

    .hero-content {
        max-width: 470px;
    }

    .hero-art {
        right: -95px;
        opacity: .48;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .editor-layout {
        grid-template-columns: 1fr;
    }

    .feature-card {
        min-height: 0;
    }

    .feature-icon {
        margin-bottom: 12px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 45px 0;
    }

    .auth-aside {
        min-height: 0;
    }

    .auth-aside h1 {
        max-width: 520px;
    }

    .auth-decoration {
        display: none;
    }

    .auth-panel {
        width: min(100%, 520px);
        justify-self: center;
    }
}

@media (max-width: 520px) {
    .site-shell {
        width: calc(100% - 28px);
    }

    .site-header {
        column-gap: 8px;
    }

    .brand {
        gap: 7px;
        font-size: 1rem;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    .header-actions {
        gap: 7px;
    }

    .header-actions .button-small {
        min-height: 34px;
        padding: 0 9px;
        font-size: .75rem;
    }

    .account-name {
        max-width: 75px;
        font-size: .78rem;
    }

    .main-nav {
        gap: 17px;
    }

    .main-nav a {
        font-size: .84rem;
    }

    .hero {
        min-height: 390px;
        margin-top: 18px;
        padding: 30px 23px;
        border-radius: 20px;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 12vw, 3.4rem);
    }

    .hero-art {
        top: 67%;
        right: -144px;
        opacity: .3;
    }

    .hero-content > p {
        max-width: 300px;
    }

    .hero-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 9px;
        padding: 18px 0;
    }

    .site-footer p {
        text-align: left;
    }

    .auth-panel {
        padding: 24px 19px;
    }

    .auth-aside h1 {
        font-size: 2.8rem;
    }

    .page-heading {
        padding-top: 42px;
    }

    .play-card {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .editor-form-panel,
    .editor-list-panel {
        padding: 20px 16px;
    }

    .editor-entry {
        align-items: flex-start;
        flex-direction: column;
    }

    .editor-entry-actions {
        width: 100%;
    }

    .editor-entry-actions > *,
    .editor-entry-actions .button {
        flex: 1;
    }

    .message-card {
        margin: 55px auto;
        padding: 27px 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
