:root {
    --bg: #fff8ec;
    --ink: #2a2630;
    --muted: #665d74;
    --line: #eadcc8;
    --surface: rgba(255, 255, 255, 0.92);
    --accent-a: #ff7f50;
    --accent-b: #18a0a8;
    --accent-c: #ffb347;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow: 0 22px 54px rgba(42, 38, 48, 0.14);
    --font-display: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
    --font-main: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 179, 71, 0.28), transparent 34%),
        radial-gradient(circle at 82% 16%, rgba(24, 160, 168, 0.2), transparent 36%),
        radial-gradient(circle at 44% 88%, rgba(255, 127, 80, 0.2), transparent 30%),
        var(--bg);
}

.bg-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 0.5px, transparent 0.5px);
    background-size: 4px 4px;
    opacity: 0.08;
}

.bg-blob {
    position: fixed;
    border-radius: 999px;
    filter: none;
    pointer-events: none;
    z-index: -1;
}

.blob-a {
    width: 220px;
    height: 220px;
    top: 80px;
    left: -90px;
    background: rgba(255, 127, 80, 0.24);
    animation: float 8s ease-in-out infinite;
}

.blob-b {
    width: 180px;
    height: 180px;
    right: 10%;
    top: 24%;
    background: rgba(24, 160, 168, 0.26);
    animation: float 9s ease-in-out infinite reverse;
}

.blob-c {
    width: 260px;
    height: 260px;
    right: -100px;
    bottom: -30px;
    background: rgba(255, 179, 71, 0.28);
    animation: float 11s ease-in-out infinite;
}

.top-bar {
    text-align: center;
    padding: 12px;
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    background: rgba(42, 38, 48, 0.92);
}

.top-bar a {
    color: #fff6e7;
}

.container {
    width: min(980px, calc(100% - 26px));
    margin: 0 auto;
    padding: 34px 0 60px;
}

.hero {
    margin-bottom: 20px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b45f2f;
    font-weight: 700;
}

.hero h1 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: 0.01em;
}

.hero p {
    margin: 0;
    max-width: 68ch;
    color: var(--muted);
}

.app-card {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.progress-wrap {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(120deg, rgba(255, 179, 71, 0.14), rgba(24, 160, 168, 0.12));
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.84rem;
}

#stepLabel {
    font-family: var(--font-display);
    font-weight: 700;
}

#routeLabel {
    color: var(--muted);
    text-align: right;
}

.progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(42, 38, 48, 0.08);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-a), var(--accent-c), var(--accent-b));
    transition: width 0.28s ease;
}

.view {
    display: none;
    padding: 28px 22px 26px;
}

.view-active {
    display: block;
}

.start-badge {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid #f5c79f;
    background: #fff2e3;
    color: #9f5a31;
    font-weight: 700;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    padding: 5px 11px;
}

#startView h2 {
    margin: 12px 0 10px;
    font-size: clamp(1.45rem, 3.5vw, 2rem);
}

#startView p {
    margin: 0;
    color: var(--muted);
}

.start-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 11px 18px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary {
    background: linear-gradient(130deg, var(--accent-a), var(--accent-b));
    color: #fff;
    box-shadow: 0 10px 24px rgba(24, 160, 168, 0.28);
}

.btn-sub {
    background: #fff;
    border-color: var(--line);
    color: #52485f;
}

.question-meta {
    font-size: 0.8rem;
    color: #8a5a31;
    font-weight: 700;
    letter-spacing: 0.02em;
}

#questionText {
    margin: 8px 0 8px;
    font-size: clamp(1.25rem, 3.6vw, 1.8rem);
    line-height: 1.4;
}

.question-sub {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

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

.option-btn {
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.option-btn:hover {
    transform: translateY(-1px);
    border-color: #ffb98f;
    box-shadow: 0 8px 18px rgba(42, 38, 48, 0.1);
}

.option-btn.is-selected {
    border-color: #ff9567;
    background: linear-gradient(140deg, #fff9f2, #f3fffd);
    box-shadow: 0 0 0 3px rgba(255, 149, 103, 0.18);
}

.option-title {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    color: #2f2838;
}

.option-note {
    display: block;
    font-size: 0.83rem;
    color: var(--muted);
}

.quiz-tools {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.result-lead {
    margin: 0 0 10px;
    font-size: 0.84rem;
    color: #8d5d35;
    font-weight: 700;
}

.result-main {
    border: 1px solid #f0d7be;
    border-radius: var(--radius-md);
    background: linear-gradient(150deg, #fff7ee, #f1fbf9);
    padding: 16px;
}

.result-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.result-symbol {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #efd9c3;
}

.result-title h2 {
    margin: 0;
    font-size: 1.35rem;
}

.result-title p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.result-copy {
    margin: 0;
    line-height: 1.75;
    font-size: 0.92rem;
}

.result-block {
    margin-top: 16px;
}

.result-block h3 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.trait-list {
    display: grid;
    gap: 8px;
}

.trait-row {
    display: grid;
    grid-template-columns: 115px 1fr 38px;
    align-items: center;
    gap: 10px;
}

.trait-name {
    font-size: 0.82rem;
    color: #574c63;
}

.trait-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(42, 38, 48, 0.08);
    overflow: hidden;
}

.trait-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff8d62, #ffc56d, #1db4ab);
}

.trait-value {
    text-align: right;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.8rem;
}

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

.sub-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    font-size: 0.84rem;
}

.sub-card strong {
    display: block;
    margin-bottom: 4px;
}

.result-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.small-note {
    min-height: 1.4em;
    margin: 10px 0 0;
    color: #785434;
    font-size: 0.82rem;
}

.burst {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    pointer-events: none;
    animation: pop 900ms ease-out forwards;
}

@keyframes pop {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0.4);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-16px);
    }
}

@media (max-width: 820px) {
    .bg-noise,
    .bg-blob {
        display: none;
    }

    .app-card,
    .btn-primary,
    .option-btn:hover,
    .option-btn.is-selected {
        box-shadow: none;
    }

    .container {
        width: calc(100% - 16px);
        padding-top: 20px;
    }

    .options {
        grid-template-columns: 1fr;
    }

    .sub-results {
        grid-template-columns: 1fr;
    }

    .trait-row {
        grid-template-columns: 98px 1fr 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
