:root {
    color-scheme: dark;
    --bg: #0b0f14;
    --surface: #151b23;
    --surface-strong: #1f2935;
    --line: #2d3a48;
    --text: #eef5f8;
    --muted: #a8b5bf;
    --teal: #3dd6c6;
    --amber: #f3b64f;
    --coral: #ff6f61;
    --green: #58d68d;
    --blue: #69a7ff;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body.demo-body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    letter-spacing: 0;
    background:
        linear-gradient(135deg, rgba(61, 214, 198, 0.12), transparent 32%),
        linear-gradient(315deg, rgba(255, 111, 97, 0.10), transparent 34%),
        var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 10;
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--teal);
    color: #061013;
    transition: top 0.18s ease;
}

.skip-link:focus {
    top: 16px;
}

.demo-topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 15, 20, 0.86);
    backdrop-filter: blur(14px);
}

.demo-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(61, 214, 198, 0.45);
    border-radius: 8px;
    background: #101821;
    color: var(--teal);
    font-weight: 800;
}

.demo-brand strong,
.demo-brand small {
    display: block;
}

.demo-brand small,
.demo-kicker,
.field-help,
.context-list dt,
.metric-row span,
.wallet-balance span,
.bank-main small,
.bank-meta,
.bank-required {
    color: var(--muted);
}

.demo-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.demo-nav a,
.secondary-action,
.text-action,
.frame-fallback {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 13px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
}

.demo-nav a.active,
.demo-nav a:hover,
.secondary-action:hover,
.frame-fallback:hover {
    border-color: rgba(61, 214, 198, 0.68);
    background: rgba(61, 214, 198, 0.12);
}

.demo-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 56px;
}

.launch-grid,
.customer-grid,
.payment-grid,
.payment-frame-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.72fr);
    gap: 24px;
    align-items: start;
}

.launch-copy,
.game-stage,
.payment-intro,
.status-header,
.scenario-head,
.result-hero {
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(31, 41, 53, 0.78), rgba(21, 27, 35, 0.68));
    box-shadow: var(--shadow);
}

.demo-panel,
.wallet-panel,
.frame-card,
.scenario-card {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: rgba(21, 27, 35, 0.92);
    box-shadow: var(--shadow);
}

.demo-panel,
.wallet-panel,
.scenario-card {
    padding: 22px;
}

.demo-kicker {
    margin: 0 0 12px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: 2.35rem;
    line-height: 1.05;
}

h2 {
    margin: 0 0 18px;
    font-size: 1.2rem;
}

.lead {
    max-width: 720px;
    margin: 18px 0 0;
    color: #d8e2e8;
    line-height: 1.65;
}

.status-strip,
.game-actions,
.metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.status-strip span,
.metric-row div {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
}

.metric-row div {
    min-width: 150px;
}

.metric-row span,
.metric-row strong {
    display: block;
}

.metric-row strong {
    margin-top: 4px;
}

.demo-form {
    display: grid;
    gap: 16px;
}

.field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 12px;
}

.demo-form label,
.amount-field {
    display: grid;
    gap: 8px;
}

.demo-form label span,
.bank-fieldset legend {
    color: #dce9ee;
    font-weight: 700;
}

.demo-form input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #0f151d;
    color: var(--text);
    padding: 11px 12px;
}

.demo-form input:focus,
.bank-card:focus-within,
.primary-action:focus,
.secondary-action:focus,
.text-action:focus,
.demo-nav a:focus {
    outline: 3px solid rgba(61, 214, 198, 0.38);
    outline-offset: 2px;
}

.primary-action {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 12px 18px;
    background: var(--teal);
    color: #041112;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.primary-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.secondary-action.full {
    width: 100%;
}

.text-action {
    width: 100%;
    cursor: pointer;
    color: var(--muted);
}

.demo-alert {
    margin: 18px 0 0;
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.demo-alert.error,
.status-pill.failed,
.status-pill.rejected {
    background: rgba(255, 111, 97, 0.14);
    color: #ffd5d1;
    border-color: rgba(255, 111, 97, 0.48);
}

.demo-alert.success,
.status-pill.success {
    background: rgba(88, 214, 141, 0.14);
    color: #c9f7dc;
    border-color: rgba(88, 214, 141, 0.50);
}

.demo-alert.info {
    background: rgba(105, 167, 255, 0.13);
    color: #d4e5ff;
    border-color: rgba(105, 167, 255, 0.42);
}

.demo-alert.warning,
.status-pill.expired {
    background: rgba(243, 182, 79, 0.14);
    color: #ffe8b8;
    border-color: rgba(243, 182, 79, 0.48);
}

.wallet-balance {
    display: grid;
    gap: 8px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.wallet-balance strong {
    font-size: 2rem;
}

.context-list {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.context-list div {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
}

.context-list dt,
.context-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.active-payment {
    display: grid;
    gap: 8px;
    margin: 18px 0;
    padding: 14px;
    border: 1px solid rgba(61, 214, 198, 0.35);
    border-radius: 8px;
    background: rgba(61, 214, 198, 0.08);
}

.bank-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.bank-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.bank-card {
    position: relative;
    min-height: 148px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    align-content: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #101720;
    cursor: pointer;
}

.bank-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.bank-card.selected,
.bank-card:has(input:checked) {
    border-color: var(--teal);
    background: rgba(61, 214, 198, 0.10);
}

.bank-card.inactive {
    opacity: 0.48;
    cursor: not-allowed;
}

.bank-logo {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    background: rgba(243, 182, 79, 0.15);
    color: var(--amber);
    font-weight: 900;
}

.bank-main,
.bank-main strong,
.bank-main small,
.bank-meta,
.bank-required {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bank-meta,
.bank-required {
    grid-column: 1 / -1;
    font-size: 0.9rem;
}

.empty-state {
    color: var(--muted);
}

.status-shell {
    display: grid;
    gap: 20px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 1px solid rgba(105, 167, 255, 0.42);
    border-radius: 8px;
    padding: 7px 11px;
    background: rgba(105, 167, 255, 0.13);
    color: #d4e5ff;
    font-weight: 800;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.timeline-step {
    min-height: 86px;
    display: grid;
    gap: 8px;
    align-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #101720;
}

.timeline-step span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--muted);
    font-weight: 800;
}

.timeline-step.done {
    border-color: rgba(61, 214, 198, 0.55);
}

.timeline-step.done span {
    background: var(--teal);
    color: #041112;
}

.frame-card {
    min-height: 620px;
    overflow: hidden;
}

.frame-card iframe {
    display: block;
    width: 100%;
    height: 620px;
    border: 0;
    background: #fff;
}

.frame-fallback {
    margin: 12px;
}

.status-side {
    min-width: 0;
}

.final-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 620px;
    gap: 12px;
    padding: 28px;
    text-align: center;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
}

.scenario-card {
    display: grid;
    gap: 14px;
}

.result-shell {
    display: grid;
    gap: 22px;
}

.result-hero {
    min-height: 420px;
    display: grid;
    align-content: center;
    gap: 16px;
}

.event-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.event-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

@media (max-width: 920px) {
    .launch-grid,
    .customer-grid,
    .payment-grid,
    .payment-frame-grid,
    .scenario-grid {
        grid-template-columns: 1fr;
    }

    .timeline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .demo-topbar,
    .status-header {
        align-items: stretch;
        flex-direction: column;
    }

    .demo-shell {
        width: min(100% - 22px, 1180px);
        padding-top: 22px;
    }

    h1 {
        font-size: 1.86rem;
    }

    .launch-copy,
    .game-stage,
    .payment-intro,
    .status-header,
    .scenario-head,
    .result-hero,
    .demo-panel,
    .wallet-panel {
        padding: 18px;
    }

    .field-row,
    .bank-grid,
    .timeline,
    .context-list div {
        grid-template-columns: 1fr;
    }

    .frame-card,
    .frame-card iframe,
    .final-placeholder {
        min-height: 520px;
        height: 520px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* Modern light demo payment theme */
:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f9fafc;
    --border: #dfe5ec;
    --text: #182230;
    --muted: #667085;
    --accent: #19b7ad;
    --accent-hover: #14988f;
    --success: #159b67;
    --danger: #d64545;
    --warning: #d98a16;
    --teal: var(--accent);
    --line: var(--border);
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body.demo-body {
    background: var(--bg);
    color: var(--text);
}

.demo-topbar {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.brand-mark {
    border-color: rgba(25, 183, 173, 0.32);
    background: #e9fbf8;
    color: var(--accent-hover);
}

.demo-brand small,
.demo-kicker,
.field-help,
.context-list dt,
.metric-row span,
.wallet-balance span,
.bank-main small,
.bank-meta,
.bank-required,
.section-heading p,
.summary-note {
    color: var(--muted);
}

.demo-nav a,
.secondary-action,
.text-action,
.frame-fallback {
    border-color: var(--border);
    color: var(--text);
    background: var(--surface);
}

.demo-nav a.active,
.demo-nav a:hover,
.secondary-action:hover,
.frame-fallback:hover {
    border-color: rgba(25, 183, 173, 0.54);
    background: #eefdfb;
}

.launch-copy,
.game-stage,
.payment-intro,
.status-header,
.scenario-head,
.result-hero,
.demo-panel,
.wallet-panel,
.frame-card,
.scenario-card,
.payment-summary {
    border-color: var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.lead {
    color: #344054;
}

.status-strip span,
.metric-row div,
.timeline-step {
    border-color: var(--border);
    background: var(--surface-soft);
}

.demo-form input {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.demo-form label span,
.bank-fieldset legend {
    color: var(--text);
}

.demo-form input:focus,
.bank-card:focus-within,
.quick-amount:focus-visible,
.primary-action:focus,
.secondary-action:focus,
.text-action:focus,
.demo-nav a:focus {
    outline: 3px solid rgba(25, 183, 173, 0.26);
}

.primary-action {
    background: var(--accent);
    color: #ffffff;
}

.primary-action:hover {
    background: var(--accent-hover);
}

.primary-action:disabled {
    background: #b7c3cf;
    color: #ffffff;
    opacity: 1;
}

.payment-shell-modern {
    display: grid;
    gap: 22px;
}

.modern-head {
    display: grid;
    gap: 18px;
}

.demo-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.demo-stepper li {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--surface-soft);
    color: var(--muted);
    font-weight: 700;
}

.demo-stepper span {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #e7eef6;
    color: #475467;
}

.demo-stepper li.active,
.demo-stepper li.done {
    border-color: rgba(25, 183, 173, 0.45);
    color: var(--text);
    background: #eefdfb;
}

.demo-stepper li.active span,
.demo-stepper li.done span {
    background: var(--accent);
    color: #ffffff;
}

.payment-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 24px;
    align-items: start;
}

.payment-main {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.amount-block,
.bank-section {
    display: grid;
    gap: 14px;
}

.amount-field input {
    min-height: 56px;
    border-radius: 8px;
    font-size: 1.22rem;
    font-weight: 800;
}

.field-error {
    min-height: 22px;
    margin: -4px 0 0;
    color: var(--danger);
    font-size: 0.92rem;
    font-weight: 700;
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.quick-amount {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
}

.quick-amount:hover,
.quick-amount.selected {
    border-color: var(--accent);
    background: #eefdfb;
    color: var(--accent-hover);
}

.section-heading {
    display: grid;
    gap: 4px;
}

.section-heading h2,
.section-heading p {
    margin: 0;
}

.bank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.bank-card {
    min-height: 128px;
    grid-template-columns: 52px minmax(0, 1fr) 26px;
    align-items: center;
    border-color: var(--border);
    background: var(--surface);
    box-shadow: 0 5px 16px rgba(15, 23, 42, 0.05);
}

.bank-card:hover {
    border-color: rgba(25, 183, 173, 0.55);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.09);
}

.bank-card.selected,
.bank-card:has(input:checked) {
    border-color: var(--accent);
    background: #eefdfb;
}

.bank-logo {
    width: 52px;
    height: 52px;
    border: 1px solid #d9f5f1;
    background: #f0fbfa;
    color: var(--accent-hover);
    overflow: hidden;
}

.bank-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 7px;
}

.bank-logo.has-image .bank-monogram {
    display: none;
}

.bank-main {
    display: grid;
    gap: 5px;
}

.bank-main strong {
    font-size: 1rem;
}

.bank-meta,
.bank-required {
    grid-column: 2 / 4;
}

.bank-radio {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid #c5cfda;
    border-radius: 999px;
    background: var(--surface);
}

.bank-card.selected .bank-radio,
.bank-card:has(input:checked) .bank-radio {
    border-color: var(--accent);
}

.bank-card.selected .bank-radio::after,
.bank-card:has(input:checked) .bank-radio::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
}

.payment-summary {
    position: sticky;
    top: 90px;
    display: grid;
    gap: 18px;
    border-radius: 8px;
    padding: 22px;
}

.summary-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.summary-list div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.summary-list dt,
.summary-list dd {
    margin: 0;
}

.summary-list dt {
    color: var(--muted);
}

.summary-list dd {
    color: var(--text);
    font-weight: 800;
    text-align: right;
}

.summary-note {
    border: 1px solid #c9efe9;
    border-radius: 8px;
    background: #f0fbfa;
    padding: 12px;
    line-height: 1.55;
}

.summary-submit {
    width: 100%;
}

.status-stack {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.countdown {
    min-width: 84px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 8px 12px;
    text-align: center;
    font-size: 1.15rem;
}

.countdown.warning {
    border-color: rgba(217, 138, 22, 0.42);
    background: #fff7ed;
    color: var(--warning);
}

.payment-stepper {
    margin: 0;
}

.frame-card {
    position: relative;
    border-radius: 8px;
    background: var(--surface);
}

.iframe-skeleton {
    position: absolute;
    inset: 16px 16px auto 16px;
    height: 88px;
    border-radius: 8px;
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
    background-size: 220% 100%;
    animation: iframePulse 1.6s ease-in-out infinite;
    pointer-events: none;
}

.frame-card iframe {
    position: relative;
    z-index: 1;
    border-radius: 8px 8px 0 0;
}

.status-pill {
    border-color: rgba(25, 183, 173, 0.28);
    background: #eefdfb;
    color: var(--accent-hover);
}

.status-pill.success {
    border-color: rgba(21, 155, 103, 0.35);
    background: #ecfdf3;
    color: var(--success);
}

.status-pill.failed,
.status-pill.rejected {
    border-color: rgba(214, 69, 69, 0.35);
    background: #fff1f1;
    color: var(--danger);
}

.status-pill.expired {
    border-color: rgba(217, 138, 22, 0.35);
    background: #fff7ed;
    color: var(--warning);
}

.empty-state {
    display: grid;
    gap: 10px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    padding: 18px;
}

.demo-player-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.demo-player-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 16px;
}

.demo-player-card strong {
    font-size: 1.1rem;
}

.demo-player-card span {
    color: var(--muted);
}

.demo-player-card button {
    width: 100%;
}

@keyframes iframePulse {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: -220% 0;
    }
}

@media (max-width: 920px) {
    .payment-layout {
        grid-template-columns: 1fr;
    }

    .payment-summary {
        position: static;
    }
}

@media (max-width: 640px) {
    .demo-stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-amounts,
    .bank-grid,
    .demo-player-grid {
        grid-template-columns: 1fr;
    }

    .bank-card {
        grid-template-columns: 52px minmax(0, 1fr) 26px;
    }

    .bank-meta,
    .bank-required {
        grid-column: 1 / 4;
    }

    .summary-submit {
        position: sticky;
        bottom: 12px;
        z-index: 3;
        box-shadow: 0 12px 28px rgba(20, 152, 143, 0.22);
    }

    .status-stack {
        justify-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .iframe-skeleton {
        animation: none;
    }
}
