:root {
    --bg-top: #06111a;
    --bg-mid: #0d2233;
    --bg-bottom: #10293d;
    --panel: rgba(9, 19, 30, 0.82);
    --panel-strong: rgba(10, 20, 31, 0.94);
    --line: rgba(163, 220, 255, 0.17);
    --line-strong: rgba(163, 220, 255, 0.32);
    --text: #f2f7fb;
    --muted: #b3c8d6;
    --accent: #89e0ff;
    --accent-soft: rgba(137, 224, 255, 0.14);
    --sun: #ffd76f;
    --mint: #90f1c4;
    --rose: #ff9b8b;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-pill: 999px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Trebuchet MS", Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(137, 224, 255, 0.18), transparent 28%),
        radial-gradient(circle at 85% 12%, rgba(255, 215, 111, 0.14), transparent 26%),
        radial-gradient(circle at 80% 75%, rgba(144, 241, 196, 0.12), transparent 26%),
        linear-gradient(180deg, var(--bg-top), var(--bg-mid) 42%, var(--bg-bottom));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 92%);
}

a {
    color: inherit;
}

button,
textarea,
input {
    font: inherit;
}

.page-shell {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 20px 0 48px;
}

.noscript-banner {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 155, 139, 0.18);
    border: 1px solid rgba(255, 155, 139, 0.32);
}

.site-header {
    position: sticky;
    top: 14px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: rgba(6, 16, 25, 0.7);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.brand {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.site-nav a,
.button-link,
button {
    text-decoration: none;
    border: none;
    border-radius: var(--radius-pill);
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.site-nav a {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
}

.site-nav a:hover,
.button-link:hover,
button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.panel,
.stat-card,
.preview-card,
.faq-card,
.feature-card,
.chart-card,
.sidebar-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.panel {
    border-radius: var(--radius-xl);
    backdrop-filter: blur(14px);
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 22px;
    padding: 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(137, 224, 255, 0.18), transparent 68%);
    pointer-events: none;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
}

h1 {
    font-size: clamp(40px, 6vw, 68px);
    line-height: 0.96;
    max-width: 10.5ch;
    margin-bottom: 16px;
}

h2 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
}

h3 {
    font-size: clamp(24px, 3vw, 34px);
}

h5 {
    font-size: 18px;
    margin-bottom: 10px;
}

p {
    line-height: 1.6;
}

.hero-text,
.section-heading p,
.muted,
.share-label,
.progress-copy,
.answer-hint,
.copy-status,
.faq-card p,
.stat-copy p,
.preview-card p,
.sidebar-card p,
.site-footer p {
    color: var(--muted);
}

.hero-text {
    max-width: 56ch;
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 16px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button-primary {
    color: #06121b;
    background: linear-gradient(90deg, var(--sun), var(--accent));
}

.button-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.hero-side {
    display: grid;
    gap: 14px;
}

.feature-tile,
.sidebar-card,
.preview-card,
.faq-card,
.stat-card,
.feature-card,
.chart-card {
    border-radius: var(--radius-lg);
    padding: 18px;
}

.feature-kicker,
.result-label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--sun);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.feature-tile h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.overview-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
}

.stat-number {
    min-width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(137, 224, 255, 0.2), rgba(255, 215, 111, 0.18));
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 28px;
    font-weight: 700;
}

.stat-copy h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.section-block {
    margin-bottom: 34px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading p {
    margin: 8px 0 0;
    max-width: 60ch;
}

.preview-grid,
.faq-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.preview-card {
    position: relative;
    overflow: hidden;
    min-height: 220px;
}

.preview-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 5px;
    background: var(--card-accent, linear-gradient(90deg, var(--accent), var(--sun)));
}

.preview-card h3 {
    font-size: 23px;
    margin-bottom: 10px;
}

.preview-card .mini-label {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quiz-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    padding: 18px;
}

.quiz-sidebar {
    display: grid;
    gap: 14px;
}

.tag-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    background: rgba(137, 224, 255, 0.12);
    border: 1px solid rgba(137, 224, 255, 0.18);
}

.quiz-main {
    min-width: 0;
}

.state-panel {
    padding: 10px;
}

.state-panel p:first-of-type {
    margin-top: 0;
}

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

.mode-card {
    display: grid;
    gap: 8px;
    text-align: left;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.mode-card strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
    line-height: 1;
}

.mode-card span:last-child,
.mode-note,
.detail-card p:last-child {
    color: var(--muted);
}

.mode-card.selected {
    border-color: rgba(255, 215, 111, 0.52);
    background:
        radial-gradient(circle at top right, rgba(137, 224, 255, 0.16), transparent 35%),
        linear-gradient(180deg, rgba(255, 215, 111, 0.18), rgba(137, 224, 255, 0.08));
}

.mode-kicker,
.detail-label {
    color: var(--sun);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.question-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.progress-wrap {
    flex: 1;
}

.question-side {
    display: grid;
    justify-items: end;
    gap: 10px;
}

.mode-pill {
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mode-switch-button {
    padding: 10px 14px;
    font-size: 13px;
}

.progress-line {
    width: 100%;
    height: 12px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--sun));
    transition: width 200ms ease;
}

.question-text {
    margin-bottom: 18px;
    line-height: 1.14;
}

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

.option-card {
    width: 100%;
    text-align: left;
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.option-card.selected {
    border-color: rgba(255, 215, 111, 0.52);
    background: linear-gradient(180deg, rgba(255, 215, 111, 0.16), rgba(137, 224, 255, 0.08));
}

.option-title {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.option-note {
    color: var(--muted);
    line-height: 1.45;
}

.button-row,
.result-head,
.result-actions {
    display: flex;
    gap: 12px;
}

.button-row {
    justify-content: space-between;
    margin-top: 20px;
}

.result-head {
    justify-content: space-between;
    align-items: start;
    margin-bottom: 18px;
}

.result-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
}

.result-card {
    border-radius: var(--radius-lg);
    padding: 20px;
}

.result-name {
    font-size: clamp(30px, 5vw, 44px);
    margin-bottom: 10px;
}

.subsection {
    margin-top: 22px;
}

.result-analysis {
    margin-top: 24px;
}

.result-tags .tag {
    font-weight: 700;
}

.tag.tag-gold {
    background: rgba(255, 215, 111, 0.14);
    border-color: rgba(255, 215, 111, 0.28);
}

.tag.tag-plain {
    background: rgba(255, 155, 139, 0.12);
    border-color: rgba(255, 155, 139, 0.28);
}

.share-box {
    margin-top: 22px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

#shareText {
    width: 100%;
    min-height: 112px;
    padding: 14px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    resize: vertical;
}

.copy-status {
    min-height: 1.4em;
    margin-bottom: 0;
}

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

.detail-card {
    min-width: 0;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-card p {
    margin: 0;
}

.detail-card p:last-child {
    margin-top: 8px;
    line-height: 1.55;
}

.chart-block + .chart-block {
    margin-top: 24px;
}

.score-row + .score-row {
    margin-top: 12px;
}

.score-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 14px;
}

.score-label {
    color: var(--muted);
}

.score-bar {
    width: 100%;
    height: 10px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--accent), var(--mint));
}

.faq-card h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.site-footer {
    padding: 12px 8px 0;
}

@media (max-width: 1040px) {
    .hero,
    .quiz-shell,
    .result-layout,
    .preview-grid,
    .faq-grid,
    .overview-strip {
        grid-template-columns: 1fr;
    }

    .site-header,
    .question-top,
    .result-head,
    .button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .result-actions {
        flex-wrap: wrap;
    }

    .mode-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 18px, 1180px);
        padding-top: 12px;
    }

    .site-header {
        position: static;
        border-radius: 22px;
    }

    .hero,
    .quiz-shell {
        padding: 16px;
    }

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

    .question-side {
        justify-items: stretch;
    }

    .brand {
        font-size: 18px;
    }

    .site-nav {
        gap: 8px;
    }

    .site-nav a,
    .button-link,
    button {
        width: 100%;
        text-align: center;
    }
}
