:root {
    --bg: #16140e;
    --bg-soft: #211d13;
    --card: rgba(47, 68, 42, 0.72);
    --card-2: rgba(86, 57, 28, 0.72);
    --line: rgba(230, 214, 170, 0.18);
    --text: #f8f0d7;
    --muted: #d7cba6;
    --green: #81b26a;
    --green-strong: #5f934f;
    --amber: #e3b15b;
    --lava: #d86f41;
    --cream: #fff7df;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(133, 89, 28, 0.18), transparent 24%),
        linear-gradient(180deg, #2b291c 0%, #1a1811 24%, #14120d 100%);
    min-height: 100vh;
}

a {
    color: inherit;
}

.site-shell,
.page-container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.topbar,
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: -0.03em;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(227, 177, 91, 0.28), rgba(95, 147, 79, 0.34));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.back-btn,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 12px 18px;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid var(--line);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.back-btn:hover,
.topic-card:hover,
.info-card:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, #6b9d54, #386f46);
    color: var(--cream);
}

.btn-secondary,
.back-btn {
    background: rgba(255, 255, 255, 0.05);
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    align-items: stretch;
    padding: 10px 0 20px;
}

.hero-copy,
.hero-scene,
.info-card,
.topic-card,
.fact-chip,
.quiz-question-card,
.quiz-result,
.quiz-container,
.parent-panel {
    background: linear-gradient(180deg, rgba(39, 49, 29, 0.88), rgba(27, 24, 17, 0.94));
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 34px;
}

.eyebrow {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--amber);
    background: rgba(227, 177, 91, 0.1);
    border: 1px solid rgba(227, 177, 91, 0.18);
}

.hero h1,
.page-title {
    margin: 16px 0 10px;
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.hero h1 {
    font-size: clamp(2.9rem, 8vw, 5.4rem);
}

.page-title {
    font-size: clamp(2.1rem, 5vw, 3.6rem);
}

.hero p,
.page-subtitle,
.info-card p,
.info-card li {
    color: var(--muted);
    line-height: 1.65;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.hero-scene {
    position: relative;
    overflow: hidden;
    padding: 24px;
    min-height: 380px;
    background:
        radial-gradient(circle at 50% 10%, rgba(227, 177, 91, 0.25), transparent 22%),
        linear-gradient(180deg, rgba(47, 93, 59, 0.78), rgba(30, 27, 19, 0.96));
}

.scene-sun {
    position: absolute;
    top: 34px;
    right: 44px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff9c7, #f0b34f 55%, rgba(240, 179, 79, 0.2));
    box-shadow: 0 0 60px rgba(240, 179, 79, 0.3);
}

.scene-hill {
    position: absolute;
    left: -5%;
    right: -5%;
    border-radius: 50%;
}

.scene-hill.back {
    bottom: 92px;
    height: 170px;
    background: #355338;
}

.scene-hill.front {
    bottom: -36px;
    height: 210px;
    background: #243620;
}

.scene-volcano {
    position: absolute;
    right: 85px;
    bottom: 130px;
    width: 120px;
    height: 160px;
    clip-path: polygon(20% 100%, 50% 8%, 80% 100%);
    background: linear-gradient(180deg, #6d4a34, #342317);
}

.scene-volcano::before {
    content: "";
    position: absolute;
    left: 36%;
    top: 0;
    width: 28px;
    height: 38px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 210, 138, 0.9), rgba(216, 111, 65, 0.8) 52%, transparent 72%);
}

.scene-dino {
    position: absolute;
    font-size: clamp(3.6rem, 6vw, 5.6rem);
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.25));
}

.scene-dino.trex {
    left: 42px;
    bottom: 54px;
}

.scene-dino.herbivore {
    right: 56px;
    bottom: 64px;
}

.scene-bubble {
    position: absolute;
    top: 24px;
    left: 24px;
    width: min(280px, calc(100% - 48px));
    padding: 18px;
    border-radius: 20px;
    background: rgba(17, 21, 13, 0.62);
    border: 1px solid var(--line);
}

.scene-bubble h3 {
    margin: 0 0 8px;
    color: var(--cream);
}

.scene-bubble p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.section-heading {
    margin: 34px 0 16px;
}

.section-heading h2 {
    margin: 0 0 8px;
    font-size: clamp(1.5rem, 4vw, 2.3rem);
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.topic-grid,
.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.topic-card,
.fact-chip,
.info-card {
    padding: 24px;
    text-decoration: none;
}

.topic-card strong,
.fact-chip strong,
.info-card h2 {
    display: block;
    margin-bottom: 10px;
    color: var(--cream);
}

.topic-card span {
    display: block;
    font-size: 2rem;
    margin-bottom: 12px;
}

.page-subtitle {
    margin: 0 0 22px;
    max-width: 720px;
}

.info-stack {
    display: grid;
    gap: 18px;
    margin-bottom: 22px;
}

.fact-chip {
    background: linear-gradient(180deg, rgba(86, 57, 28, 0.78), rgba(35, 26, 16, 0.92));
}

.fact-chip p,
.topic-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.highlight {
    color: var(--amber);
    font-weight: 800;
}

.main-footer {
    width: min(1120px, calc(100% - 32px));
    margin: 34px auto 46px;
    padding: 18px 22px;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.quiz-container {
    padding: 26px;
}

.quiz-progress {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

.progress-dot {
    width: 13px;
    height: 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.progress-dot.active {
    background: var(--amber);
}

.progress-dot.done {
    background: var(--green);
}

.progress-dot.wrong {
    background: var(--lava);
}

.quiz-question-card,
.quiz-result {
    padding: 28px;
}

.quiz-question-num {
    font-size: 0.95rem;
    color: var(--amber);
    margin-bottom: 10px;
    font-weight: 800;
}

.quiz-question-text {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 900;
    margin-bottom: 18px;
}

.quiz-options {
    display: grid;
    gap: 12px;
}

.quiz-option,
.quiz-next-btn,
.quiz-restart-btn {
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 15px 16px;
    font-size: 1rem;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    color: var(--cream);
}

.quiz-option {
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
    align-items: center;
}

.quiz-option.correct {
    background: rgba(95, 147, 79, 0.38);
}

.quiz-option.wrong {
    background: rgba(216, 111, 65, 0.36);
}

.quiz-feedback {
    margin-top: 16px;
    border-radius: 18px;
    padding: 14px 16px;
    line-height: 1.55;
}

.correct-fb {
    background: rgba(95, 147, 79, 0.18);
}

.wrong-fb {
    background: rgba(216, 111, 65, 0.18);
}

.quiz-next-btn,
.quiz-restart-btn {
    margin-top: 14px;
    background: linear-gradient(135deg, #6b9d54, #386f46);
    text-align: center;
}

.quiz-result {
    text-align: center;
}

.quiz-score-emoji {
    display: block;
    font-size: 4rem;
    margin-bottom: 10px;
}

.quiz-score-text {
    font-size: 1.8rem;
    font-weight: 900;
}

.quiz-score-sub {
    color: var(--muted);
    margin-top: 8px;
}

.parent-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10;
    padding: 16px;
}

.parent-panel {
    width: min(680px, 100%);
    padding: 24px;
}

.close-parent {
    float: right;
    border: 0;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--cream);
    cursor: pointer;
}

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

.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 820px) {
    .hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .topbar,
    .page-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-copy,
    .hero-scene,
    .quiz-container,
    .quiz-question-card,
    .quiz-result,
    .info-card,
    .topic-card,
    .fact-chip,
    .parent-panel {
        padding: 20px;
        border-radius: 22px;
    }
}
