html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    background: #020208;
}

body.wyrd-app-page {
    color: rgba(255, 255, 255, 0.9);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.wyrd-app-page .site-shell,
body.wyrd-app-page .page-main {
    display: block;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

body.wyrd-app-page .site-header,
body.wyrd-app-page .site-footer {
    display: none;
}

.wyrd-app {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #020208;
}

.wyrd-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    background: rgba(10, 10, 16, 0.5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    user-select: none;
    z-index: 50;
}

.bar-left {
    display: flex;
    gap: 16px;
    opacity: 0.6;
    font-size: 12px;
}

.shortcut {
    white-space: nowrap;
}

.bar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.state-name {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.mode-info {
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

.brand {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.brand:hover,
.brand:focus-visible {
    color: white;
}

.github-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.brand:hover .github-icon,
.brand:focus-visible .github-icon {
    opacity: 1;
}

.dev-panel,
.legend-panel {
    position: fixed;
    width: min(340px, calc(100vw - 36px));
    padding: 14px 16px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(10, 10, 16, 0.65);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    font-size: 12px;
    z-index: 60;
}

.dev-panel {
    top: 18px;
    left: 18px;
    width: min(280px, calc(100vw - 36px));
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.legend-panel {
    top: 18px;
    right: 18px;
}

.dev-panel h3,
.legend-panel h3 {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

.dev-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 0;
}

.dev-row .k {
    opacity: 0.6;
}

.dev-row .v {
    font-variant-numeric: tabular-nums;
}

.dev-row.demo {
    color: rgba(255, 200, 100, 0.9);
}

.dev-row.episode {
    color: rgba(180, 220, 255, 0.9);
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    line-height: 1.4;
}

.swatch {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: radial-gradient(
        circle at 30% 30%,
        hsla(var(--h) 90% 70% / 0.95),
        hsla(var(--h) 90% 45% / 0.95)
    );
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
    flex: 0 0 auto;
}

.indicator {
    width: 14px;
    text-align: center;
    font-weight: 600;
    opacity: 0.9;
    flex: 0 0 auto;
}

.demo-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 100;
}

.demo-label-main {
    font-size: clamp(2rem, 8vw, 5rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow:
        0 0 40px rgba(0, 0, 0, 0.8),
        0 0 80px rgba(0, 0, 0, 0.6),
        0 4px 20px rgba(0, 0, 0, 0.9);
    text-align: center;
    padding: 0 1rem;
}

.demo-label-pearson {
    font-size: clamp(1rem, 4vw, 2rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    text-shadow:
        0 0 30px rgba(0, 0, 0, 0.8),
        0 2px 10px rgba(0, 0, 0, 0.9);
    margin-top: 0.5rem;
    text-align: center;
}

.demo-progress {
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 200;
}

.help-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(600px, calc(100vw - 48px));
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 28px 32px;
    border-radius: 18px;
    background: rgba(18, 18, 26, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.9);
    z-index: 210;
}

.help-modal::backdrop {
    background: transparent;
}

.help-modal h2 {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 600;
}

.help-modal h3 {
    margin: 20px 0 10px;
    font-size: 15px;
    font-weight: 600;
    opacity: 0.95;
}

.help-modal p {
    margin: 0 0 12px;
    line-height: 1.6;
    font-size: 14px;
    opacity: 0.85;
}

.help-modal ul {
    margin: 0 0 12px;
    padding-left: 20px;
    line-height: 1.7;
    font-size: 14px;
    opacity: 0.85;
}

.help-modal li {
    margin-bottom: 6px;
}

.help-modal strong {
    color: white;
    font-weight: 600;
}

.help-modal a {
    color: #9bd8ff;
}

.help-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.help-hint {
    font-size: 12px;
    opacity: 0.5;
}

.help-modal kbd {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 800px) {
    .bar-left {
        display: none;
    }

    .bottom-bar {
        justify-content: center;
        gap: 20px;
        padding-inline: 14px;
    }

    .bar-center {
        position: static;
        transform: none;
    }

    .bar-right {
        margin-left: 0;
        gap: 10px;
    }

    .mode-info {
        display: none;
    }
}

@media (max-width: 520px) {
    .legend-panel,
    .dev-panel {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .dev-panel {
        right: auto;
    }

    .help-modal {
        width: min(100vw - 24px, 600px);
        max-height: calc(100vh - 48px);
        padding: 22px 20px;
    }
}
