:root {
    color-scheme: dark;
    --cyan: #5fe7ff;
    --cyan-dim: rgba(90, 216, 240, 0.55);
    --red: #ff2a2a;
    --ink: #e7f8ff;
    --panel: rgba(4, 28, 46, 0.92);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: "Segoe UI", Bahnschrift, sans-serif;
    color: var(--ink);
    background-color: #07161c;
    background-image:
        radial-gradient(ellipse at 50% 18%, rgba(48, 140, 160, 0.22), transparent 52%),
        radial-gradient(ellipse at 80% 100%, rgba(8, 30, 36, 0.9), transparent 46%),
        linear-gradient(180deg, #081c24 0%, #0c3946 46%, #081c22 100%);
}
.stage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 16px 32px;
}
.stage:has(.top-brand) {
    justify-content: flex-start;
    padding-top: 34px;
}
.frame {
    --radius: 18px;
    --edge: 2px;
    width: min(720px, 100%);
    height: min(680px, calc(100vh - 230px));
    min-height: 420px;
    display: flex;
    padding: var(--edge);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #8af6ff 0%, #1e9dba 100%);
    filter: drop-shadow(0 0 14px rgba(0, 196, 230, 0.38));
}
.frame-gate,
.frame-server,
.frame-players { height: auto; min-height: 0; }
.frame-server { margin-bottom: 12px; }
.frame-players { margin-top: 12px; }
.frame-server .sheet,
.frame-players .sheet { padding: 10px 16px 12px; }
.frame-server label { margin-bottom: 6px; }
.frame-players h1 { margin-bottom: 8px; font-size: 16px; letter-spacing: 0.14em; }
.top-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: min(720px, 100%);
    margin: 0 0 24px;
}
.top-logo {
    display: block;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 14px rgba(0, 196, 230, 0.35);
}
.top-download {
    color: var(--cyan);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    border-bottom: 1px solid rgba(95, 231, 255, 0.45);
    padding-bottom: 2px;
}
.top-download:hover,
.top-download:focus-visible {
    color: #dff8ff;
    border-bottom-color: var(--cyan);
    outline: none;
}
.players {
    margin: 0;
    padding: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    overflow-wrap: anywhere;
}
.players.empty { color: rgba(255, 70, 70, 0.55); font-weight: 500; }
.sub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 0 0 14px;
}
.sub-label {
    margin: 0;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
}
.sub-value {
    margin: 6px 0 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
}
.sub-meta {
    margin: 6px 0 0;
    color: rgba(231, 248, 255, 0.82);
    font-size: 14px;
    letter-spacing: 0.03em;
}
.sub-extend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid rgba(95, 231, 255, 0.22);
}
.sub-extend button {
    width: auto;
    min-width: 138px;
    margin: 0;
}
.frame-server select {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid var(--cyan-dim);
    border-radius: 2px;
    background: rgba(0, 12, 22, 0.55);
    color: var(--ink);
    font: 15px/1.2 "Segoe UI", Bahnschrift, sans-serif;
    letter-spacing: 0.03em;
}
.sheet {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 18px 16px;
    border-radius: calc(var(--radius) - var(--edge));
    background: var(--panel);
}
h1 {
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(95, 231, 255, 0.35);
    color: var(--cyan);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.2em;
    line-height: 1;
}
.mark {
    display: block;
    width: min(280px, 86%);
    height: auto;
    margin: 2px auto 18px;
    border-radius: 50%;
}
.log-lines {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: 6px;
    color: #cccccc;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.28;
}
.log-lines p { margin: 0 0 0.28em; overflow-wrap: anywhere; }
.log-lines .tone-neutral { color: #cccccc; }
.log-lines .tone-tame { color: #00ff00; }
.log-lines .tone-death { color: #ff0000; }
.log-lines .tone-tribe { color: #c918e0; }
.log-lines .tone-ruin { color: #ffe7a7; }
.log-lines .tone-demo { color: #ffff00; }
.log-lines .tone-down { color: #00ffff; }
.log-lines .empty { color: rgba(255, 70, 70, 0.55); font-weight: 500; }
label {
    display: block;
    margin: 0 0 6px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
}
input {
    display: block;
    width: 100%;
    margin: 0 0 16px;
    padding: 11px 12px;
    border: 1px solid var(--cyan-dim);
    border-radius: 2px;
    background: rgba(0, 12, 22, 0.55);
    color: var(--ink);
    font: 16px/1.2 "Segoe UI", Bahnschrift, sans-serif;
    letter-spacing: 0.14em;
}
input:focus { outline: 1px solid var(--cyan); border-color: var(--cyan); }
.error { margin: -4px 0 14px; color: var(--red); font-size: 14px; font-weight: 600; }
button {
    display: block;
    margin: 8px auto 0;
    padding: 9px 28px;
    border: 1px solid var(--cyan-dim);
    border-radius: 999px;
    background: rgba(0, 28, 42, 0.55);
    color: #dff8ff;
    font: 13px/1 "Segoe UI", Bahnschrift, sans-serif;
    font-weight: 600;
    letter-spacing: 0.16em;
    cursor: pointer;
}
.sheet button { width: 100%; margin-top: 4px; }
button:hover, button:focus-visible { border-color: var(--cyan); background: rgba(0, 60, 80, 0.55); outline: none; }
.seed { margin: 16px 0 0; color: rgba(95, 231, 255, 0.8); font-size: 12px; letter-spacing: 0.16em; }
.stage-gate { justify-content: flex-start; gap: 22px; }
.plans { list-style: none; margin: 0; padding: 0; }
.plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid rgba(95, 231, 255, 0.22);
}
.plan-name {
    margin: 0;
    color: var(--cyan);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.14em;
}
.plan-meta { margin: 4px 0 0; color: rgba(231, 248, 255, 0.82); font-size: 14px; letter-spacing: 0.03em; }
.plan form { margin: 0; }
.plan button { width: auto; min-width: 138px; margin: 0; }
.contact-label {
    margin: 18px 0 6px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-align: center;
}
.contact { margin: 0; text-align: center; font-size: 15px; letter-spacing: 0.06em; }
.contact a { color: var(--ink); text-decoration: none; }
.contact a:hover, .contact a:focus-visible { color: var(--cyan); }
.ready { margin: 0 0 8px; color: var(--ink); font-size: 15px; line-height: 1.4; }
.credential {
    margin: 12px 0 0;
    color: var(--cyan);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    overflow-wrap: anywhere;
}
.credential span { display: block; margin-top: 4px; color: var(--ink); font-size: 18px; letter-spacing: 0.12em; }
@media (max-width: 520px) {
    .frame { min-height: 0; height: calc(100vh - 220px); }
    .frame-gate, .frame-server, .frame-players { height: auto; }
    .log-lines { font-size: 13.5px; }
    .plan { align-items: stretch; flex-direction: column; }
    .plan button { width: 100%; }
    .sub-grid { grid-template-columns: 1fr; }
    .sub-extend { align-items: stretch; flex-direction: column; }
    .sub-extend button { width: 100%; }
    .top-brand { flex-direction: column; gap: 12px; text-align: center; }
}
