:root { color-scheme: dark; }

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font: 15px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: #0f1524;
    color: #e6e9f2;
    display: grid;
    place-items: center;
    padding: 24px;
}

.card {
    width: 100%;
    max-width: 440px;
    background: #19223a;
    border: 1px solid #26314f;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

/* Secondary to the operator line above it — this is a form title, not the page's headline. */
h1 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9aa4bf;
}

label {
    display: block;
    margin-top: 14px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #9aa4bf;
}

input,
select {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    background: #0f1524;
    border: 1px solid #2a3654;
    border-radius: 8px;
    color: #e6e9f2;
    font: inherit;
}

input:focus,
select:focus { outline: none; border-color: #5b7cfa; }

button {
    margin-top: 22px;
    width: 100%;
    padding: 12px;
    background: #5b7cfa;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

button:hover { background: #4b6bea; }

.hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: #7a8299;
}

.hint code {
    color: #aeb8d6;
    background: #0f1524;
    padding: 1px 5px;
    border-radius: 4px;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.status {
    margin-top: 18px;
    font-size: 13px;
    color: #9aa4bf;
    word-break: break-all;
}

.status span { color: #e6e9f2; font-weight: 600; }

/* Selector row: the operator this launcher is pointed at, plus the info button on its right.
   Deliberately NOT styled as a control — the operator is read from auth's config, nothing here
   is clickable except the info button. */
.mode-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #26314f;
}

/* The operator is the single most important fact on this page — it decides which flow the form
   even shows — so it outranks the "Launch a game" heading below it. */
.mode-status {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mode-status-caption {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7a8299;
}

.mode-status-value {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mode-status-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5b7cfa;
    box-shadow: 0 0 0 3px rgba(91, 124, 250, .18);
}

/* Operator could not be read — auth unreachable or unconfigured. */
.mode-status.is-unknown .mode-status-dot {
    background: #d9a441;
    box-shadow: 0 0 0 3px rgba(217, 164, 65, .18);
}

.mode-status.is-unknown .mode-status-name { color: #d9a441; }

.mode-status-name {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .2px;
    color: #c3d0ff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-btn {
    flex: 0 0 auto;
    width: 34px;
    margin-top: 0;
    padding: 0;
    align-self: flex-start;
    height: 34px;
    border-radius: 50%;
    background: #0f1524;
    border: 1px solid #2a3654;
    color: #9aa4bf;
    font-size: 13px;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    cursor: pointer;
}

.info-btn:hover,
.info-btn[aria-expanded="true"] {
    background: #222d4c;
    border-color: #5b7cfa;
    color: #e6e9f2;
}

.info-popover {
    margin: -8px 0 18px;
    background: #0f1524;
    border: 1px solid #2a3654;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.5;
    color: #9aa4bf;
}

.info-popover p { margin: 0 0 8px; }
.info-popover p:last-child { margin-bottom: 0; }
.info-popover strong { color: #cdd5ea; }

.info-popover code {
    color: #aeb8d6;
    background: #19223a;
    padding: 1px 5px;
    border-radius: 4px;
}

.section-title {
    margin: 22px 0 4px;
    font-size: 13px;
    color: #9aa4bf;
    border-top: 1px solid #26314f;
    padding-top: 14px;
}

#log {
    margin-top: 12px;
    max-height: 240px;
    overflow: auto;
    background: #0f1524;
    border: 1px solid #2a3654;
    border-radius: 8px;
    padding: 10px 12px;
    font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #b8c0d8;
    white-space: pre-wrap;
    word-break: break-word;
}
