* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Segoe UI", sans-serif;
    color: #172033;
    background:
        radial-gradient(circle at top left, rgba(60, 126, 255, 0.28), transparent 34rem),
        radial-gradient(circle at bottom right, rgba(255, 70, 92, 0.18), transparent 30rem),
        linear-gradient(135deg, #eef4ff 0%, #f8fbff 48%, #f6f0ff 100%);
}

button,
select {
    font: inherit;
}

.page-shell {
    width: min(1040px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chain-game-root {
    width: 100%;
}

.hero-card,
.game-shell {
    width: 100%;
    border: 1px solid rgba(60, 85, 140, 0.16);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 80px rgba(40, 56, 90, 0.18);
}

.hero-card {
    max-width: 780px;
    margin: 0 auto;
    padding: 42px;
    text-align: center;
}

.eyebrow {
    margin: 0 0 8px;
    color: #3255d9;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    margin-bottom: 16px;
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.hero-copy {
    max-width: 620px;
    margin: 0 auto 28px;
    color: #526079;
    line-height: 1.8;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 28px 0;
}

.setting-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    text-align: left;
    border-radius: 18px;
    background: #f4f7ff;
}

.setting-card span {
    font-weight: 800;
}

.setting-card select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #c8d3ee;
    border-radius: 12px;
    background: white;
}

.primary-btn,
.ghost-btn,
.option-btn {
    border: 0;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-btn {
    padding: 15px 28px;
    border-radius: 999px;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, #3159e7, #ef4056);
    box-shadow: 0 12px 28px rgba(49, 89, 231, 0.24);
}

.primary-btn.small {
    padding: 11px 20px;
}

.ghost-btn {
    padding: 11px 18px;
    border: 1px solid #b8c5e7;
    border-radius: 999px;
    color: #3159e7;
    font-weight: 800;
    background: #fff;
}

.primary-btn:hover,
.ghost-btn:hover,
.option-btn:hover {
    transform: translateY(-2px);
}

.bank-summary,
.back-link {
    display: block;
    margin-top: 22px;
    color: #64708a;
}

.back-link {
    color: #3159e7;
    font-weight: 800;
    text-decoration: none;
}

.game-shell {
    padding: 28px;
}

.top-bar {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
}

.score-card {
    min-width: 92px;
    padding: 14px 18px;
    border-radius: 18px;
    text-align: center;
    background: #172033;
    color: #fff;
}

.score-card span,
.score-card strong {
    display: block;
}

.score-card strong {
    font-size: 1.8rem;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 22px;
}

.meta-row span {
    padding: 8px 12px;
    border-radius: 999px;
    color: #3159e7;
    background: #edf2ff;
    font-weight: 700;
}

.clue-board,
.question-card {
    padding: 22px;
    border-radius: 22px;
}

.clue-board {
    margin-bottom: 18px;
    background: #fff8ed;
}

.clue-board ol {
    margin: 0;
    padding-left: 24px;
    line-height: 1.8;
}

.question-card {
    background: #f6f8ff;
}

.step-label {
    margin-bottom: 8px;
    color: #ef4056;
    font-weight: 900;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.option-btn {
    min-height: 58px;
    padding: 14px;
    border-radius: 16px;
    color: #172033;
    font-weight: 900;
    background: #fff;
    box-shadow: inset 0 0 0 1px #d8e0f4;
}

.option-btn:disabled {
    cursor: default;
    opacity: 0.68;
    transform: none;
}

.feedback {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
}

.feedback.correct {
    background: #e8f9ef;
    color: #17633a;
}

.feedback.wrong {
    background: #fff0f1;
    color: #8d2530;
}

.feedback p {
    margin: 8px 0 14px;
    line-height: 1.7;
}

.memory-visible {
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    font-weight: 900;
}

.review-card p,
.memory-card p {
    line-height: 1.8;
}

@media (max-width: 680px) {
    .page-shell {
        padding: 18px 12px;
        align-items: flex-start;
    }

    .hero-card,
    .game-shell {
        padding: 22px;
        border-radius: 22px;
    }

    .settings-grid,
    .top-bar {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .score-card {
        width: 100%;
    }
}
