:root {
    --unexpected-ink: #34314c;
    --unexpected-muted: #625f79;
    --unexpected-surface: rgba(255, 255, 255, 0.82);
    --unexpected-line: rgba(78, 79, 115, 0.16);
    --unexpected-shadow: 0 18px 50px rgba(78, 79, 115, 0.08);
}

body {
    background:
        radial-gradient(circle at top left, rgba(244, 196, 48, 0.08), transparent 24%),
        radial-gradient(circle at top right, rgba(78, 79, 115, 0.08), transparent 20%),
        linear-gradient(180deg, #fcfbff 0%, #f7f4ee 100%);
}

.unexpected-page {
    padding-bottom: 80px;
}

.unexpected-page .section-title {
    font-size: clamp(2.2rem, 6vw, 4.6rem);
    line-height: 0.95;
    margin-bottom: 10px;
    text-wrap: balance;
}

.unexpected-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
    gap: 28px;
    align-items: start;
}

.eyebrow {
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    font-weight: 700;
    color: #9a7a24;
}

.hero-note {
    max-width: 760px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--unexpected-muted);
}

.hero-card,
.prompt-card,
.stack-panel,
.storage-card,
.guide-card {
    border: 1px solid var(--unexpected-line);
    border-radius: 24px;
    background: var(--unexpected-surface);
    box-shadow: var(--unexpected-shadow);
    backdrop-filter: blur(8px);
}

.hero-card {
    padding: 24px;
}

.hero-card h2,
.prompt-card h2,
.storage-card h2,
.stack-panel h2,
.board-head h2,
.story-copy h3,
.reflection-box h3 {
    margin: 0 0 10px;
    color: var(--unexpected-ink);
}

.hero-card ol {
    margin: 0;
    padding-left: 18px;
    color: var(--unexpected-muted);
}

.hero-card li {
    margin-bottom: 8px;
}

.mode-strip {
    display: inline-flex;
    gap: 8px;
    padding: 8px;
    margin-top: 24px;
    border: 1px solid var(--unexpected-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
}

.mode-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: transparent;
    color: var(--unexpected-muted);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
}

.mode-btn.active {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 10px 22px rgba(78, 79, 115, 0.18);
}

.btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(78, 79, 115, 0.22);
    border-radius: 14px;
    padding: 11px 16px;
    min-height: 44px;
    background: linear-gradient(180deg, #ffffff 0%, #f3f2f8 100%);
    color: var(--primary-dark);
    font-family: 'OpenSans', sans-serif;
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
    box-shadow: 0 8px 20px rgba(78, 79, 115, 0.12);
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(78, 79, 115, 0.38);
    box-shadow: 0 12px 24px rgba(78, 79, 115, 0.16);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 12px rgba(78, 79, 115, 0.16);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    border-color: rgba(78, 79, 115, 0.56);
    background: linear-gradient(180deg, #5b5d89 0%, #4e4f73 100%);
    color: #fff;
}

.btn-primary:hover {
    border-color: rgba(78, 79, 115, 0.7);
    box-shadow: 0 14px 28px rgba(78, 79, 115, 0.25);
}

.add-card-btn {
    min-width: 126px;
    align-self: stretch;
}

.prompt-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 22px;
}

.prompt-card {
    padding: 22px;
}

.examples-panel {
    margin-top: 18px;
}

.examples-card {
    border: 1px solid var(--unexpected-line);
    border-radius: 24px;
    background: var(--unexpected-surface);
    box-shadow: var(--unexpected-shadow);
    backdrop-filter: blur(8px);
    padding: 22px;
}

.examples-head h2 {
    margin: 0 0 6px;
    color: var(--unexpected-ink);
}

.examples-head p {
    margin: 0;
    color: var(--unexpected-muted);
}

.examples-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.example-btn {
    border: 1px solid rgba(78, 79, 115, 0.2);
    border-radius: 16px;
    padding: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f3f8 100%);
    cursor: pointer;
    text-align: left;
    color: var(--unexpected-ink);
    transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    box-shadow: 0 8px 20px rgba(78, 79, 115, 0.08);
    display: grid;
    gap: 3px;
}

.example-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(78, 79, 115, 0.4);
    box-shadow: 0 12px 24px rgba(78, 79, 115, 0.14);
}

.example-btn:active {
    transform: translateY(0);
}

.example-num {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: var(--primary-dark);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.example-title {
    font-size: 0.98rem;
    font-weight: 700;
}

.example-sub {
    font-size: 0.82rem;
    color: var(--unexpected-muted);
}

.stack-guide {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.guide-card {
    padding: 18px;
}

.guide-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.guide-card p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--unexpected-muted);
}

.facts-card {
    background: linear-gradient(180deg, rgba(234, 240, 255, 0.95), rgba(255, 255, 255, 0.9));
}

.guesses-card {
    background: linear-gradient(180deg, rgba(255, 242, 223, 0.98), rgba(255, 255, 255, 0.9));
}

.actions-card {
    background: linear-gradient(180deg, rgba(235, 248, 239, 0.98), rgba(255, 255, 255, 0.9));
}

.outcomes-card {
    background: linear-gradient(180deg, rgba(243, 236, 255, 0.98), rgba(255, 255, 255, 0.9));
}

.summary-card {
    background: linear-gradient(180deg, rgba(253, 236, 239, 0.98), rgba(255, 255, 255, 0.9));
}

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

.stack-panel {
    padding: 22px;
}

.stack-panel[data-stack="summary"] {
    grid-column: 1 / -1;
}

.stack-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.stack-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--primary-dark);
    color: #fff;
    font-weight: 700;
}

.stack-desc {
    margin: 8px 0 16px;
    color: var(--unexpected-muted);
}

.stack-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--unexpected-ink);
}

.stack-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.stack-entry textarea,
.prompt-card textarea,
.summary-fixed input {
    width: 100%;
    border: 1px solid rgba(78, 79, 115, 0.18);
    border-radius: 16px;
    padding: 14px 16px;
    font: inherit;
    color: var(--unexpected-ink);
    background: rgba(255, 255, 255, 0.9);
    resize: vertical;
}

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

.quick-samples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.sample-chip {
    border: 1px dashed rgba(78, 79, 115, 0.24);
    border-radius: 999px;
    padding: 10px 14px;
    min-height: 42px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--unexpected-muted);
    cursor: pointer;
    font-size: 0.88rem;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.16s ease;
}

.sample-chip:hover {
    border-color: rgba(78, 79, 115, 0.42);
    background: rgba(255, 255, 255, 1);
    color: var(--unexpected-ink);
    transform: translateY(-1px);
}

.cards-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.card-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--unexpected-line);
    background: rgba(255, 255, 255, 0.9);
}

.card-item p {
    margin: 0;
    line-height: 1.5;
}

.card-remove {
    border: 0;
    background: transparent;
    color: #9e4d52;
    cursor: pointer;
    font-weight: 700;
}

.layout-board {
    margin-top: 34px;
    padding: 26px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(54, 48, 83, 0.96), rgba(39, 34, 61, 0.98));
    color: #fff;
    box-shadow: 0 30px 70px rgba(52, 49, 76, 0.22);
}

.board-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.board-head h2,
.board-head p {
    color: #fff;
}

.board-head p {
    margin: 0;
    opacity: 0.78;
}

.board-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.board-actions .btn {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    box-shadow: none;
    min-height: 42px;
    border-radius: 12px;
}

.board-actions .btn-primary {
    background: #f4c430;
    border-color: #f4c430;
    color: #342c11;
    box-shadow: 0 12px 22px rgba(244, 196, 48, 0.24);
}

.board-actions .btn:hover {
    border-color: rgba(255, 255, 255, 0.44);
    background: rgba(255, 255, 255, 0.14);
}

.board-actions .btn-primary:hover {
    border-color: #f6cb4f;
    background: #f6cb4f;
    box-shadow: 0 14px 24px rgba(244, 196, 48, 0.3);
}

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

.spread-card {
    min-height: 170px;
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.spread-label {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.72;
}

.spread-card p {
    margin: 0;
    line-height: 1.55;
}

.story-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 20px;
    margin-top: 22px;
}

.story-copy,
.reflection-box {
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reflection-box ul {
    margin: 0;
    padding-left: 18px;
}

.reflection-box li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.storage-panel {
    margin-top: 26px;
}

.storage-card {
    padding: 22px;
}

.storage-card p {
    margin: 0 0 14px;
    color: var(--unexpected-muted);
}

.storage-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .stack-guide,
    .spread-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spread-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .unexpected-page {
        padding-bottom: 60px;
    }

    .unexpected-page .section-description,
    .hero-note {
        font-size: 0.98rem;
    }

    .unexpected-hero,
    .prompt-panel,
    .stacks-grid,
    .story-panel {
        grid-template-columns: 1fr;
    }

    .stack-entry,
    .summary-fixed {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .unexpected-page {
        padding-left: 14px;
        padding-right: 14px;
        padding-bottom: 44px;
    }

    .unexpected-page .section-title {
        font-size: 2rem;
        line-height: 0.98;
    }

    .unexpected-hero {
        gap: 16px;
    }

    .hero-card,
    .prompt-card,
    .examples-card,
    .stack-panel,
    .storage-card {
        padding: 16px;
        border-radius: 18px;
    }

    .mode-strip {
        display: flex;
        width: 100%;
        padding: 6px;
        gap: 6px;
        margin-top: 14px;
    }

    .mode-btn {
        flex: 1;
        min-height: 42px;
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    .stack-guide,
    .spread-grid {
        grid-template-columns: 1fr;
    }

    .layout-board {
        padding: 16px;
        border-radius: 20px;
        margin-top: 24px;
    }

    .board-head {
        gap: 12px;
    }

    .board-head h2 {
        margin-bottom: 6px;
    }

    .spread-card {
        min-height: 138px;
        padding: 12px;
        border-radius: 16px;
    }

    .spread-label {
        margin-bottom: 8px;
        font-size: 0.74rem;
    }

    .story-copy,
    .reflection-box {
        padding: 14px;
        border-radius: 16px;
    }

    .stack-entry textarea,
    .prompt-card textarea,
    .summary-fixed input {
        border-radius: 12px;
        padding: 12px 13px;
    }

    .sample-chip {
        width: 100%;
        justify-content: flex-start;
        display: inline-flex;
        align-items: center;
    }

    .add-card-btn,
    .board-actions .btn,
    .storage-actions .btn,
    .example-btn,
    .btn {
        width: 100%;
        min-height: 44px;
    }

    .storage-actions,
    .board-actions,
    .quick-samples {
        gap: 8px;
    }
}

@media (max-width: 420px) {
    .unexpected-page {
        padding-left: 12px;
        padding-right: 12px;
    }

    .unexpected-page .section-title {
        font-size: 1.8rem;
    }

    .stack-head h2 {
        font-size: 1.25rem;
    }

    .stack-count {
        min-width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
}
