:root {
    color-scheme: dark;
    --bg: #101216;
    --panel: #191c22;
    --line: #30343b;
    --text: #e3e4df;
    --muted: #989da7;
    --accent: #c4d8a0;
    --gold: #cabb91;
    font: 14px system-ui,sans-serif;
    color: var(--text);
    background: var(--bg);
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
}
button,
input,
select,
textarea {
    font: inherit;
}
button,
a,
input,
select,
textarea {
    outline-offset: 4px;
}
button {
    cursor: pointer;
    background: #292f36;
    color: var(--text);
    border: 1px solid #414750;
    border-radius: 5px;
    padding: 10px 15px;
}
button:hover {
    background: #38414a;
}
button:active {
    background: #181e23;
}
button:disabled {
    opacity: .5;
    cursor: wait;
}
button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #20281c;
    font-weight: 600;
}
button.quiet {
    background: transparent;
    border-color: transparent;
    color: var(--muted);
}
a {
    color: inherit;
    text-decoration: none;
}
a:hover {
    color: var(--accent);
}
h1,
h2,
h3,
p {
    margin-top: 0;
}
h1 {
    font: 400 42px Georgia,serif;
    letter-spacing: -1px;
}
h2 {
    font: 400 28px Georgia,serif;
}
h3 {
    font-size: 17px;
}
.muted,
small {
    color: var(--muted);
}
.eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--gold);
    font-weight: 600;
}
.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.login form {
    max-width: 390px;
    width: 85%;
    margin: auto;
    padding: 50px 0;
}
.mark {
    font: 50px Georgia;
    color: var(--accent);
    margin-bottom: 54px;
}
.login h1 {
    font-size: 40px;
}
.login label {
    display: block;
    margin: 25px 0 16px;
}
.login input {
    display: block;
    width: 100%;
    margin-top: 10px;
}
.login button {
    width: 100%;
    text-align: left;
    margin-top: 18px;
}
.login button span {
    float: right;
}
.login-art {
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 60% 60%,#363b36,#1c2325 40%,#12171b 75%);
    display: flex;
    align-items: flex-end;
    padding: 60px;
    border-left: 1px solid var(--line);
}
.login-art p {
    font: 48px Georgia;
    color: #98a599;
    line-height: 1.15;
    z-index: 1;
}
.orb {
    width: 440px;
    height: 440px;
    border-radius: 50%;
    position: absolute;
    top: 16%;
    left: 16%;
    border: 1px solid #64716b;
    box-shadow: inset -70px -50px 100px #090c10,inset 30px 15px 80px #6d746044,0 0 140px #89998a18;
    background: repeating-radial-gradient(ellipse at 20% 30%,#6474680a 0 1px,transparent 1px 6px);
}
input,
select,
textarea {
    background: #11151a;
    color: var(--text);
    border: 1px solid #3c424b;
    border-radius: 4px;
    padding: 10px;
    min-width: 0;
}
input:focus,
textarea:focus {
    border-color: var(--accent);
}
header {
    height: 72px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    gap: 24px;
}
.brand {
    font-weight: 600;
    letter-spacing: 2px;
    white-space: nowrap;
}
.brand b {
    font: 30px Georgia;
    margin-right: 12px;
    color: var(--accent);
}
.brand span {
    font-size: 10px;
    margin-left: 10px;
    color: var(--muted);
}
nav {
    display: flex;
    gap: 25px;
    color: #b5b8bb;
}
.account {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.workspace-bar {
    height: 38px;
    background: #181d20;
    display: flex;
    gap: 25px;
    padding: 0 30px;
    align-items: center;
    font-size: 11px;
    color: var(--muted);
}
.workspace-bar i {
    display: inline-block;
    background: #8bad79;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
}
#status {
    margin-left: auto;
}
.intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 42px 0 30px;
}
.intro h1 {
    margin-bottom: 10px;
}
.page {
    max-width: 1440px;
    padding: 0 42px 40px;
    margin: auto;
}
.cards {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 18px;
}
.card {
    position: relative;
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 26px;
    min-height: 175px;
    border-radius: 7px;
}
.card:hover {
    border-color: #72816c;
    color: var(--text);
}
.card .symbol {
    font: 28px Georgia;
    color: var(--gold);
    display: block;
    margin-bottom: 24px;
}
.card p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    max-width: 310px;
}
.card .arrow {
    position: absolute;
    right: 24px;
    top: 27px;
    color: var(--muted);
}
.section-title {
    display: flex;
    justify-content: space-between;
    margin: 32px 0 15px;
    color: var(--muted);
    font-size: 12px;
}
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 0;
}
.toolbar label {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 12px;
}
.toolbar input[type=number] {
    width: 85px;
}
.toolbar .active {
    outline: 2px solid var(--accent);
    outline-offset: 0;
}
.spacer {
    flex: 1;
}
.editor-frame {
    border: 0;
    width: 100%;
    height: calc(100vh - 158px);
}
.world-layout {
    display: grid;
    grid-template-columns: 1fr 270px;
    gap: 16px;
}
.viewport {
    height: calc(100vh - 260px);
    min-height: 400px;
    background: #151b22;
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}
.viewport canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.viewport .hint {
    position: absolute;
    bottom: 14px;
    left: 16px;
    pointer-events: none;
    color: #bac1c5;
    background: #1118;
    padding: 6px 10px;
    font-size: 11px;
}
.inspector {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 18px;
    overflow: auto;
    max-height: calc(100vh - 260px);
}
.inspector label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin: 14px 0 7px;
}
.inspector input,
.inspector select {
    width: 100%;
}
.row {
    display: flex;
    gap: 10px;
}
.row > * {
    flex: 1;
}
.document-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
}
.file-list {
    height: 65vh;
    overflow: auto;
    border: 1px solid var(--line);
    background: var(--panel);
}
.file-list button {
    display: block;
    width: 100%;
    border: 0;
    text-align: left;
    background: transparent;
    border-radius: 0;
    font-size: 12px;
    overflow-wrap: anywhere;
}
.file-list button.active {
    background: #354034;
}
.code {
    font: 13px/1.65 ui-monospace,monospace;
    resize: vertical;
    width: 100%;
    height: 55vh;
    tab-size: 2;
}
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 24px;
    border-radius: 6px;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table td,
.table th {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.table th {
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.badge {
    font-size: 11px;
    border: 1px solid #4b5b41;
    border-radius: 4px;
    padding: 3px 8px;
    color: var(--accent);
}
.feed {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}
.feed article {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 20px;
    border-radius: 6px;
}
.feed p {
    white-space: pre-wrap;
    line-height: 1.7;
    margin: 12px 0 0;
}
.feed small {
    display: block;
}
.notice {
    padding: 15px 20px;
    background: #22291e;
    border: 1px solid #4a583d;
    margin: 20px 0;
    line-height: 1.6;
}
#loginError {
    color: #e2a39c;
    margin-top: 20px;
}
[hidden] {
    display: none!important;
}
@media (max-width:850px) {
    .login {
        grid-template-columns: 1fr;
    }
    .login-art {
        display: none;
    }
    header {
        padding: 0 15px;
    }
    header nav {
        display: none;
    }
    .page {
        padding: 0 18px 30px;
    }
    .cards {
        grid-template-columns: 1fr 1fr;
    }
    .world-layout,
    .document-grid {
        grid-template-columns: 1fr;
    }
    .inspector {
        max-height: none;
    }
    .workspace-bar {
        padding: 0 15px;
        gap: 10px;
    }
    .intro h1 {
        font-size: 32px;
    }
}
@media (max-width:520px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .brand span {
        display: none;
    }
    .account button {
        padding: 6px;
    }
    .workspace-bar > span:first-child {
        display: none;
    }
}
.page:has(.world-layout) .intro {
    margin: 20px 0 8px;
}
.page:has(.world-layout) .intro h1 {
    font-size: 32px;
}
.page:has(.world-layout) .viewport {
    height: calc(100vh - 375px);
}
.page:has(.world-layout) .inspector {
    max-height: calc(100vh - 375px);
}
.page:has([aria-label="World dimension"]) .viewport { height: calc(100vh - 435px); min-height: 360px; }
.page:has([aria-label="World dimension"]) .inspector { max-height: calc(100vh - 435px); }
