/* Orb Serpent — violet night palette */
:root {
    --os-bg: #100c1f;
    --os-panel: #1b1533;
    --os-panel-2: #241c44;
    --os-line: #372b63;
    --os-text: #f0ecff;
    --os-dim: #a99cd6;
    --os-accent: #ffd66b;
    --os-teal: #3ee0b0;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--os-bg);
    color: var(--os-text);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-text-size-adjust: 100%;
}

.os-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 12px 14px 48px;
    min-height: 100vh;
}

.os-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 10px;
}

.os-back {
    color: var(--os-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 10px;
    border: 1px solid var(--os-line);
    border-radius: 8px;
    background: var(--os-panel);
    white-space: nowrap;
}

.os-back:hover { color: var(--os-accent); border-color: var(--os-accent); }

.os-title {
    flex: 1;
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: center;
    color: var(--os-teal);
}

.os-header-actions { display: flex; gap: 6px; }

.os-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid var(--os-line);
    background: var(--os-panel);
    font-size: 17px;
    cursor: pointer;
    line-height: 1;
}

.os-icon-btn:hover { border-color: var(--os-accent); }

.os-hud {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.os-chip {
    flex: 1 1 84px;
    background: var(--os-panel);
    border: 1px solid var(--os-line);
    border-radius: 10px;
    padding: 6px 8px;
    text-align: center;
    min-width: 0;
}

.os-chip-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--os-dim);
    text-transform: uppercase;
}

.os-chip-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--os-accent);
    font-variant-numeric: tabular-nums;
}

.os-stage {
    position: relative;
    background: var(--os-panel);
    border: 1px solid var(--os-line);
    border-radius: 14px;
    padding: 8px;
    overflow: hidden;
}

#orbSerpentCanvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    touch-action: none;
}

.os-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.os-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 7, 22, 0.93);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 50;
}

.os-overlay.hidden { display: none; }

.os-panel {
    background: var(--os-panel);
    border: 1px solid var(--os-line);
    border-radius: 16px;
    padding: 22px 20px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.os-kicker {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--os-teal);
    text-transform: uppercase;
}

.os-panel-title {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 800;
    color: var(--os-accent);
}

.os-tagline {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--os-dim);
}

.os-name-row { text-align: left; margin-bottom: 14px; }

.os-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--os-dim);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.os-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 9px;
    border: 1px solid var(--os-line);
    background: #100c1f;
    color: var(--os-text);
}

.os-input:focus { outline: 2px solid var(--os-accent); border-color: transparent; }

.os-btn {
    display: block;
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    border-radius: 11px;
    cursor: pointer;
    margin-bottom: 10px;
    border: 1px solid var(--os-line);
}

.os-btn-primary {
    background: var(--os-accent);
    border-color: var(--os-accent);
    color: #1b1405;
}

.os-btn-ghost { background: transparent; color: var(--os-dim); }
.os-btn-primary:hover { filter: brightness(1.08); }
.os-btn-ghost:hover { color: var(--os-text); border-color: var(--os-dim); }

.os-controls-hint {
    margin-top: 6px;
    text-align: left;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--os-dim);
}

.os-controls-hint p { margin: 0 0 7px; }

.os-over-reason {
    margin: -4px 0 14px;
    font-size: 14px;
    color: #ff8a72;
    font-weight: 600;
}

.os-results {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.os-result {
    flex: 1;
    background: var(--os-panel-2);
    border: 1px solid var(--os-line);
    border-radius: 10px;
    padding: 9px 6px;
}

.os-result-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--os-dim);
    text-transform: uppercase;
}

.os-result-value {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: var(--os-accent);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 420px) {
    .os-title { font-size: 18px; }
    .os-chip { flex: 1 1 72px; padding: 5px 6px; }
    .os-chip-value { font-size: 16px; }
    .os-panel { padding: 18px 15px; }
    .os-panel-title { font-size: 22px; }
}
