:root {
    color-scheme: dark light;
    --bg: #111214;
    --surface: #191b1f;
    --surface-strong: #22252a;
    --border: #343840;
    --text: #f5f7fa;
    --muted: #aeb5c0;
    --accent: #73a7ff;
    --accent-strong: #91b9ff;
    --focus: #a9c8ff;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f6f8;
        --surface: #ffffff;
        --surface-strong: #eef1f5;
        --border: #d5dae2;
        --text: #17191d;
        --muted: #5b6471;
        --accent: #245fbd;
        --accent-strong: #174a99;
        --focus: #245fbd;
    }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a, button { font: inherit; }

a { color: var(--accent); }

a:hover { color: var(--accent-strong); }

a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.playground-bar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.playground-brand {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
}

.playground-brand strong { white-space: nowrap; }

.playground-brand span {
    color: var(--muted);
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playground-bar nav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.playground-bar nav a,
.playground-bar nav button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.playground-bar nav button { cursor: pointer; }

.playground-bar nav button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.playground-workspace {
    position: relative;
    height: calc(100% - 64px);
}

#wordpress {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.boot-panel {
    width: min(620px, calc(100% - 32px));
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.version-panel {
    width: min(680px, calc(100% - 32px));
    position: absolute;
    z-index: 5;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    padding: clamp(28px, 5vw, 44px);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.version-panel h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.2;
}

.version-panel p:not(.eyebrow) {
    margin: 16px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.version-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.version-actions button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
}

.version-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.version-actions a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.version-actions .primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.mission-steps {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding-inline-start: 24px;
    color: var(--muted);
    line-height: 1.5;
}

.mission-steps li::marker {
    color: var(--muted);
}

.mission-steps label {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: var(--text);
    cursor: pointer;
}

.mission-steps input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--accent);
}

.mission-steps input:checked + span {
    color: var(--muted);
    text-decoration: line-through;
}

.mission-progress {
    font-weight: 700;
}

.mission-feedback {
    padding: 12px 14px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--text) !important;
    background: var(--surface-strong);
}

.mission-picker {
    max-height: min(92vh, 860px);
    overflow: auto;
}

.mission-picker-list {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.mission-option {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-strong);
}

.mission-option h3,
.mission-option p,
.mission-option ol {
    margin: 0;
}

.mission-option h3 {
    font-size: 1.1rem;
}

.mission-option p,
.mission-option ol {
    color: var(--muted);
    line-height: 1.5;
}

.mission-option-purpose {
    color: var(--text) !important;
}

.mission-option-outcome {
    font-size: 0.9rem;
    font-weight: 700;
}

.mission-option ol {
    display: grid;
    gap: 4px;
    padding-inline-start: 22px;
}

.mission-option button {
    justify-self: start;
    min-height: 42px;
    margin-top: 4px;
    padding: 0 14px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.boot-panel h1 {
    margin: 0;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    line-height: 1.16;
}

#boot-message {
    margin: 18px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.progress-track {
    height: 8px;
    margin: 28px 0 20px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-strong);
}

.progress-track span {
    display: block;
    width: 12%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
    transition: width 240ms ease;
}

.boot-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

#retry-button {
    min-height: 44px;
    margin-top: 24px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

@media (max-width: 720px) {
    .playground-bar { min-height: 120px; padding: 10px 12px; flex-direction: column; align-items: stretch; gap: 8px; }
    .playground-brand { display: block; }
    .playground-brand span { display: block; margin-top: 3px; max-width: none; }
    .playground-bar nav { gap: 5px; padding-bottom: 2px; }
    .playground-bar nav a,
    .playground-bar nav button { min-height: 42px; padding: 0 9px; flex: 0 0 auto; }
    .playground-workspace { height: calc(100% - 120px); }
    .version-actions { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
    .progress-track span { transition: none; }
}
