/* ── Intro band ───────────────────────────────── */

.cb-page {
    padding-top: 20px;
    padding-bottom: 100px;
}

.cb-intro {
    text-align: center;
    padding: 30px 8% 10px;
}

.cb-intro h1 {
    font-size: 3.4rem;
    letter-spacing: 8px;
    margin: 10px 0 14px;
    color: #f2e0b7;
    text-shadow:
        0 0 10px rgba(242, 224, 183, .25),
        0 0 30px rgba(200, 164, 106, .15);
}

.cb-intro p {
    color: #d5d5d5;
    letter-spacing: 1px;
    max-width: 640px;
    margin: 0 auto;
}

/* ── Stepper ──────────────────────────────────── */

.cb-stepper {
    width: min(700px, 90%);
    margin: 30px auto 0;
    display: flex;
    justify-content: space-between;
    position: relative;
}

.cb-stepper::before {
    content: '';
    position: absolute;
    top: 17px;
    left: 5%;
    right: 5%;
    height: 1px;
    background: rgba(200, 164, 106, .3);
    z-index: 0;
}

.cb-step-dot {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #6b6252;
    cursor: pointer;
}

.cb-step-dot:disabled {
    cursor: not-allowed;
}

.cb-step-num {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(200, 164, 106, .35);
    background: rgba(0, 0, 0, .4);
    border-radius: 50%;
    font-size: .9rem;
    color: #6b6252;
    transition: .25s;
}

.cb-step-label {
    font-size: .72rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cb-step-dot.completed .cb-step-num {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(200, 164, 106, .12);
}

.cb-step-dot.completed .cb-step-label {
    color: var(--gold);
}

.cb-step-dot.active .cb-step-num {
    border-color: var(--gold-light);
    color: var(--gold-light);
    background: rgba(200, 164, 106, .22);
    box-shadow: 0 0 14px rgba(200, 164, 106, .35);
}

.cb-step-dot.active .cb-step-label {
    color: var(--gold-light);
}

/* ── Panel & steps ────────────────────────────── */

/* Panel chrome (background/border/backdrop-filter) is shared with
   .lore-entry, .rule-section, and .sidebar — defined in style.css */
.cb-panel {
    width: min(900px, 90%);
    margin: 30px auto 0;
    padding: 30px clamp(20px, 4vw, 40px);
}

.cb-step {
    display: none;
}

.cb-step.active {
    display: block;
    animation: cbReveal .3s ease both;
}

@keyframes cbReveal {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cb-step-title {
    color: #f2e0b7;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(200, 164, 106, .25);
}

.cb-subhead {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: .95rem;
    margin: 26px 0 12px;
}

.cb-optional {
    color: #7a7263;
    text-transform: none;
    letter-spacing: 0;
    font-size: .8rem;
    font-style: italic;
}

.cb-hint {
    color: #8a8272;
    font-style: italic;
}

.cb-quote {
    color: #d9c19a;
    font-style: italic;
}

/* ── Form fields ──────────────────────────────── */

.cb-field {
    margin-bottom: 20px;
}

.cb-field-appearance {
    margin-top: 28px;
}

.cb-field label {
    display: block;
    font-size: .8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
}

.cb-field input,
.cb-field textarea {
    background: rgba(0, 0, 0, .3);
    border: 1px solid rgba(200, 164, 106, .35);
    color: var(--gold-light);
    font-family: var(--font-serif);
    font-size: 1.1rem;
    padding: 12px 16px;
    width: 100%;
    outline: none;
    transition: border-color .2s;
    resize: vertical;
}

.cb-field input:focus,
.cb-field textarea:focus {
    border-color: var(--gold);
}

.cb-field input::placeholder,
.cb-field textarea::placeholder {
    color: #5a5142;
}

/* ── Selection grids (lineage / background / occupation) ─────────────── */

.cb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.cb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(200, 164, 106, .25);
    padding: 16px 18px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: .2s;
    overflow: hidden;
}

.cb-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform .2s;
}

.cb-card:hover {
    border-color: rgba(200, 164, 106, .55);
    background: rgba(200, 164, 106, .06);
}

.cb-card:hover::before {
    transform: scaleX(1);
}

.cb-card.selected {
    border-color: var(--gold);
    background: rgba(200, 164, 106, .1);
}

.cb-card.selected::before {
    transform: scaleX(1);
}

.cb-card h4 {
    color: var(--gold-light);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.cb-card p {
    font-size: .85rem;
    color: #c4ad83;
    line-height: 1.5;
}

/* ── Detail panels (origin / background feature+traits) ───────────────── */

.cb-detail {
    background: rgba(0, 0, 0, .2);
    border: 1px solid rgba(200, 164, 106, .2);
    padding: 20px 24px;
    margin-top: 18px;
}

.cb-detail p {
    color: #d9c19a;
    line-height: 1.7;
    margin-bottom: 10px;
}

.cb-trait-list {
    list-style: none;
    margin: 10px 0;
}

.cb-trait-list li {
    color: #d9c19a;
    line-height: 1.6;
    padding-left: 16px;
    position: relative;
    margin-bottom: 6px;
}

.cb-trait-list li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--gold);
}

.cb-feature {
    margin-bottom: 16px;
}

.cb-feature h4 {
    color: var(--gold);
    margin-bottom: 4px;
}

/* ── Origin picker ────────────────────────────── */

.cb-origin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.cb-origin-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(200, 164, 106, .25);
    padding: 14px 16px;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: .2s;
}

.cb-origin-card:hover {
    border-color: rgba(200, 164, 106, .55);
}

.cb-origin-card.selected {
    border-color: var(--gold);
    background: rgba(200, 164, 106, .1);
}

.cb-origin-card h5 {
    color: var(--gold-light);
    margin-bottom: 6px;
}

.cb-origin-card p {
    font-size: .85rem;
    color: #c4ad83;
    line-height: 1.5;
    margin-bottom: 6px;
}

.cb-origin-trait {
    color: var(--gold) !important;
    font-size: .8rem !important;
}

/* ── Alignment grid ───────────────────────────── */

.cb-alignment-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 500px;
}

.cb-alignment-cell {
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(200, 164, 106, .25);
    color: #c4ad83;
    padding: 12px 8px;
    font-size: .82rem;
    text-align: center;
    cursor: pointer;
    transition: .2s;
}

.cb-alignment-cell:hover {
    border-color: rgba(200, 164, 106, .55);
}

.cb-alignment-cell.selected {
    border-color: var(--gold);
    background: rgba(200, 164, 106, .15);
    color: var(--gold-light);
}

/* ── Trait pickers ────────────────────────────── */

.cb-trait-group {
    margin-bottom: 24px;
}

.cb-trait-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cb-trait-header h5 {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: .85rem;
}

.cb-roll-btn {
    background: rgba(0, 0, 0, .3);
    border: 1px solid rgba(200, 164, 106, .35);
    color: var(--gold);
    font-size: .75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 5px 12px;
    cursor: pointer;
    transition: .2s;
}

.cb-roll-btn:hover {
    color: var(--gold-light);
    border-color: var(--gold);
    background: rgba(200, 164, 106, .15);
}

.cb-trait-options {
    list-style: none;
    margin-bottom: 10px;
}

.cb-trait-options.rolling .cb-trait-option {
    animation: cbRollFlash .25s ease;
}

@keyframes cbRollFlash {
    0%, 100% { background: rgba(0, 0, 0, .18); }
    50% { background: rgba(200, 164, 106, .25); }
}

.cb-trait-option {
    background: rgba(0, 0, 0, .18);
    border: 1px solid rgba(200, 164, 106, .18);
    color: #c4ad83;
    padding: 9px 14px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: .9rem;
    line-height: 1.5;
    transition: .2s;
}

.cb-trait-option:hover {
    border-color: rgba(200, 164, 106, .45);
}

.cb-trait-option.selected {
    border-color: var(--gold);
    background: rgba(200, 164, 106, .12);
    color: var(--gold-light);
}

.cb-trait-custom {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cb-trait-custom label {
    font-size: .8rem;
    color: #8a8272;
    white-space: nowrap;
}

.cb-trait-custom-input {
    flex: 1;
    background: rgba(0, 0, 0, .25);
    border: 1px solid rgba(200, 164, 106, .25);
    color: var(--gold-light);
    font-family: var(--font-serif);
    font-size: .9rem;
    padding: 8px 12px;
    outline: none;
    transition: border-color .2s;
}

.cb-trait-custom-input:focus {
    border-color: var(--gold);
}

/* ── Occupation toggle ────────────────────────── */

.cb-occ-toggle {
    display: flex;
    border: 1px solid rgba(200, 164, 106, .35);
    background: rgba(0, 0, 0, .25);
    margin-bottom: 18px;
    max-width: 400px;
}

.cb-occ-toggle button {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    border-right: 1px solid rgba(200, 164, 106, .25);
    color: var(--gold);
    font-family: var(--font-serif);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: .85rem;
    cursor: pointer;
    transition: .2s;
}

.cb-occ-toggle button:last-child {
    border-right: none;
}

.cb-occ-toggle button:hover {
    color: var(--gold-light);
}

.cb-occ-toggle button.active {
    color: var(--gold-light);
    background: rgba(200, 164, 106, .12);
}

/* ── Review sheet ─────────────────────────────── */

.cb-review-header {
    text-align: center;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(200, 164, 106, .25);
}

.cb-review-header h3 {
    color: #f2e0b7;
    letter-spacing: 2px;
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.cb-review-subline {
    color: var(--gold);
    letter-spacing: 1px;
    font-size: .9rem;
}

.cb-review-section {
    margin-bottom: 22px;
}

.cb-review-section h4 {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: .85rem;
    margin-bottom: 8px;
}

.cb-review-section p {
    color: #d9c19a;
    line-height: 1.7;
}

.cb-review-traits {
    margin-top: 10px;
}

.cb-review-trait {
    color: #d9c19a;
    line-height: 1.6;
    margin-bottom: 6px;
}

.cb-gold-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.cb-gold-section h4,
.cb-gold-section p {
    margin: 0;
}

.cb-review-note {
    padding-top: 16px;
    border-top: 1px solid rgba(200, 164, 106, .2);
}

.cb-review-note p {
    color: #8a8272;
    font-style: italic;
    font-size: .9rem;
    line-height: 1.6;
}

.cb-review-note a {
    color: var(--gold);
}

.cb-review-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 10px;
}

/* ── Nav buttons ──────────────────────────────── */

.cb-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(200, 164, 106, .2);
}

.cb-danger {
    border-color: rgba(200, 90, 70, .5);
    color: #d99a86;
}

.cb-danger:hover {
    border-color: rgba(200, 90, 70, .8);
    background: rgba(200, 90, 70, .12);
}

/* ── Print ────────────────────────────────────── */

@media print {
    .particles,
    .background-overlay,
    .top-nav,
    .cb-intro,
    .cb-stepper,
    .cb-nav-buttons,
    .cb-review-actions {
        display: none !important;
    }

    .cb-panel {
        border: none;
        backdrop-filter: none;
        background: none;
    }
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 768px) {
    .cb-intro h1 {
        font-size: 1.9rem;
        letter-spacing: 4px;
    }

    .cb-step-label {
        display: none;
    }

    .cb-panel {
        padding: 22px 16px;
    }

    .cb-alignment-grid {
        max-width: 100%;
    }

    .cb-gold-section {
        flex-direction: column;
        align-items: flex-start;
    }
}
