/* Home page (Components/Pages/Home.razor): the visitor hero, the try question, features, and the student mission view.
   The try question reuses the quiz tiles and verdict (quiz-round.css). */

/* Highlighted words: an underline that skips the dots of the letters. */
.hl {
    color: var(--link);
    text-decoration: underline .16em var(--accent);
    text-underline-offset: .32em;
    text-decoration-skip-ink: auto;
}
.section-title { font-size: var(--fs-2xl); text-align: center; margin-bottom: var(--space-5); }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Visitor hero: the character next to the title, even on a phone ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: var(--space-3) var(--space-2);
    align-items: center;
    padding: 0 0 var(--space-5);
}
.hero-copy { grid-column: 1; grid-row: 1; min-width: 0; }
.hero-art { grid-column: 2; grid-row: 1; }
.hero-cta { grid-column: 1 / -1; grid-row: 2; }
.hero-copy > *, .hero-cta { animation: rise .6s var(--ease-out) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-cta { animation-delay: .24s; }
.hero-copy .chip-tilt { margin-bottom: var(--space-3); }
.hero-title { font-size: clamp(1.75rem, 7.6vw, 3.75rem); line-height: 1.25; margin-bottom: var(--space-3); }
.hero-sub { margin: 0; font-size: var(--fs-md); color: var(--text-muted); max-width: 34em; }
.hero-cta .actions { margin-top: 0; }
.hero-cta .actions .btn { flex: 1 1 200px; }
.hero-note { display: flex; align-items: center; gap: 6px; margin: var(--space-3) 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.hero-note .icon { color: var(--success); }

.hero-art { position: relative; display: grid; place-items: center; }
.hero-mascot { position: relative; z-index: 2; width: 104px; height: auto; }
.hero-bubble, .orbit, .float-chip { display: none; }
.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 2px dashed color-mix(in srgb, var(--primary) 45%, transparent);
    pointer-events: none;
}
.orbit-1 { animation: spin 40s linear infinite; }
.orbit-2 {
    border-style: solid;
    border-color: transparent;
    background: radial-gradient(circle, color-mix(in srgb, var(--primary) 30%, transparent), transparent 70%);
}
@keyframes spin { to { transform: rotate(360deg); } }
.float-chip {
    position: absolute;
    z-index: 3;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 4px 0 var(--edge);
    font-family: var(--font-title);
    font-size: .95rem;
    white-space: nowrap;
    animation: bob 3s ease-in-out infinite alternate;
}
.fc-1 { top: 40%; inset-inline-start: 4%; background: var(--amber); border-color: var(--accent-edge); color: var(--navy); }
.fc-2 { top: 70%; inset-inline-end: 2%; background: var(--primary); border-color: var(--primary-edge); color: var(--on-primary); animation-delay: .8s; }
.fc-3 { bottom: 4%; inset-inline-start: 12%; animation-delay: 1.5s; }
@keyframes bob { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-10px) rotate(3deg); } }

@media (min-width: 900px) {
    .hero { grid-template-columns: 1.15fr .85fr; gap: 0 var(--space-5); padding-top: var(--space-5); min-height: 480px; }
    .hero-copy { align-self: end; }
    .hero-cta { grid-column: 1; align-self: start; margin-top: var(--space-5); }
    .hero-art { grid-row: 1 / span 2; min-height: 420px; padding-top: 56px; }
    .hero-mascot { width: 250px; }
    .hero-bubble { display: inline-block; position: absolute; top: 0; z-index: 3; }
    .orbit { display: block; }
    .float-chip { display: inline-flex; }
    .orbit-1 { width: 360px; height: 360px; margin: -150px 0 0 -180px; }
    .orbit-2 { width: 250px; height: 250px; margin: -95px 0 0 -125px; }
    .hero-cta .actions .btn { flex: 0 1 auto; }
}

/* ---------- Try one question without an account ---------- */
.try { max-width: 720px; margin: 0 auto var(--space-5); scroll-margin-top: 12px; animation: rise .6s var(--ease-out) .3s both; }
.try-head { display: grid; justify-items: start; gap: 6px; margin-bottom: var(--space-4); }
.try-title { margin: 0; font-size: var(--fs-lg); }
.try .qz-stem { flex: 1; min-width: 0; padding: 12px 14px; border: 2px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2); font-size: var(--fs-md); }
.try .qz-ask-mascot { width: 56px; }
.try .qz-explain { margin-bottom: var(--space-4); }

/* ---------- Feature cards: real game parts on a dark screen ---------- */
.features { padding: var(--space-5) 0; }
.feature-grid { display: grid; gap: var(--space-4); }
.feature-card { display: flex; flex-direction: column; transition: transform .2s var(--ease-out); animation: rise .6s var(--ease-out) both; }
.feature-card:nth-child(2) { animation-delay: .08s; }
.feature-card:nth-child(3) { animation-delay: .16s; }
.feature-card:nth-child(4) { animation-delay: .24s; }
.feature-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.feature-card h3 { font-size: var(--fs-lg); margin: var(--space-4) 0 var(--space-2); }
.feature-card p { color: var(--text-muted); }
.feature-demo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 150px;
    padding: 14px;
    overflow: hidden;
    border-radius: var(--radius);
    background:
        radial-gradient(14rem 8rem at 100% 0%, color-mix(in srgb, var(--turquoise) 28%, transparent), transparent 70%),
        radial-gradient(color-mix(in srgb, var(--on-console) 8%, transparent) 1.2px, transparent 1.4px) 0 0 / 16px 16px,
        var(--console);
    color: var(--on-console);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--turquoise) 35%, transparent);
}
.demo-xp { flex: 1; min-width: 0; display: grid; gap: 6px; max-width: 170px; }
.demo-level .level-badge-lg { --size: 58px; }
.demo-xp-text { display: flex; justify-content: space-between; gap: 6px; font-size: .8rem; color: var(--on-console-muted); white-space: nowrap; }
.demo-xp-text b { color: var(--on-console); font-family: var(--font-title); font-weight: 700; }
.demo-level .xp-bar { background: #0A1220; }
.demo-level .pop-chip { position: absolute; top: 14px; inset-inline-end: 14%; }

.demo-podium { display: grid; grid-template-columns: repeat(3, 76px); align-items: end; gap: 8px; height: 100%; }
.demo-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.demo-step-1 { grid-column: 2; grid-row: 1; }
.demo-step-2 { grid-column: 1; grid-row: 1; }
.demo-step-3 { grid-column: 3; grid-row: 1; }
.demo-step .lb-av { width: 44px; height: 44px; font-size: 1.2rem; }
.demo-step-1 .lb-av { box-shadow: 0 0 0 3px var(--console), 0 0 0 5px var(--gold), var(--glow-accent); }
.demo-step .lb-crown { position: static; margin-bottom: -6px; fill: var(--gold); animation: lb-crown 2.4s ease-in-out 1s infinite; }
.demo-step .chip { position: absolute; top: 34px; }
.demo-block {
    display: grid;
    place-items: start center;
    width: 100%;
    padding-top: 4px;
    border-radius: 12px 12px 4px 4px;
    color: var(--navy);
    font-family: var(--font-title);
    font-size: 1.4rem;
    line-height: 1.2;
    transform-origin: 50% 100%;
    animation: lb-rise .6s var(--ease-spring) .2s both;
}
.demo-step-1 .demo-block { height: 62px; background: linear-gradient(170deg, var(--gold), var(--accent-edge)); }
.demo-step-2 .demo-block { height: 44px; background: linear-gradient(170deg, var(--silver), color-mix(in srgb, var(--silver) 70%, var(--navy))); }
.demo-step-3 .demo-block { height: 32px; background: linear-gradient(170deg, var(--bronze), color-mix(in srgb, var(--bronze) 75%, var(--navy))); }

.demo-map { justify-content: space-around; }
.demo-road {
    position: absolute;
    inset-inline: 15%;
    top: 50%;
    height: 12px;
    margin-top: -6px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--on-console) 14%, transparent);
}
.demo-road::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 50%; border-radius: inherit; background: var(--primary); }
.demo-stop {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 3px dashed color-mix(in srgb, var(--on-console) 40%, transparent);
    border-radius: 50%;
    background: var(--console-2);
    font-family: var(--font-title);
}
.demo-stop.is-done { border: 3px solid var(--accent-edge); background: var(--amber); color: var(--navy); box-shadow: 0 4px 0 var(--accent-edge), var(--glow-accent); }
.demo-stop.is-current { width: 66px; height: 66px; border: 3px solid var(--primary-edge); background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 0 var(--primary-edge), var(--glow); }
.demo-stop.is-current::after { content: ""; position: absolute; inset: -10px; border: 3px solid var(--primary); border-radius: 50%; opacity: 0; animation: ring 1.8s var(--ease-out) infinite; }
.demo-stop .stars, .demo-stop .chip { position: absolute; top: -26px; }
.demo-stop .stars .icon { width: 16px; height: 16px; }

.demo-video { flex-direction: column; gap: 10px; }
.demo-video .lp-screen-dots { position: absolute; top: 12px; inset-inline-start: 14px; }
.demo-video .lp-slot-play { width: 64px; height: 64px; }
.demo-video .lp-page { background: var(--console-2); border-color: color-mix(in srgb, var(--amber) 60%, transparent); color: var(--amber); }

@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .feature-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- How it works: one stop per column on wide screens ---------- */
.how { max-width: 560px; margin: var(--space-5) auto; padding-bottom: 8px; }
.how .section-title { font-size: var(--fs-xl); }
@media (min-width: 900px) {
    .how { max-width: none; }
    .how .level-map-steps { --row: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
    .how .map-node { height: auto; padding: 0 !important; }
    .how .map-node::before { display: none; }
    .how .map-stop { height: auto; flex-direction: column; text-align: center; }
    .how .map-label { -webkit-line-clamp: unset; }
}

/* ---------- Call to action band and the channels ---------- */
.cta-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-4) var(--space-5);
    margin: var(--space-6) 0 var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(30rem 12rem at 80% 0%, rgba(32, 184, 166, .35), transparent 70%),
        var(--console);
    color: var(--on-console);
    border: 2px solid rgba(32, 184, 166, .45);
    box-shadow: var(--shadow-2);
    text-align: center;
}
.cta-band > div { flex: 1 1 240px; }
.cta-title { font-size: var(--fs-xl); margin-bottom: 4px; }
.cta-band p { margin: 0; color: var(--on-console-muted); }
@media (min-width: 700px) { .cta-band { flex-wrap: nowrap; text-align: start; } }
.channels { display: grid; justify-items: center; gap: var(--space-3); margin-bottom: var(--space-4); text-align: center; }
.channels-title { margin: 0; font-size: var(--fs-md); color: var(--text-muted); }
.social-lg a { width: 52px; height: 52px; }

/* ---------- Student home ---------- */
.greet { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.greet .bubble { font-size: 1.15rem; }
.home-grid { display: grid; gap: var(--space-4); }
.home-soon { display: grid; gap: var(--space-3); align-content: start; }
.home-soon .gr-soon { margin-bottom: 0; }
.mission-card { display: grid; gap: var(--space-3); justify-items: start; padding: 22px 20px; animation: rise .5s var(--ease-out) both; }
.mission-card .btn-block { justify-self: stretch; margin-top: var(--space-2); }
.mission-todo {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: stretch;
    min-height: 44px;
    padding: 6px 12px;
    border: 2px solid var(--accent-edge);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 500;
    text-decoration: none;
}
.mission-todo span { flex: 1; }
.mission-todo-arrow { flex: none; }
.mission-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font-size: var(--fs-xl); margin: 0; }
.mission-unit { margin: 0; }
.mission-progress { justify-self: stretch; }
.lesson-number {
    font-family: var(--font-title);
    color: var(--link);
    direction: ltr;
    unicode-bidi: isolate;
}
.mission-title .lesson-number {
    padding: 0 10px;
    border-radius: 10px;
    background: var(--primary-soft);
    font-size: .8em;
}
.level-card { display: flex; align-items: center; gap: var(--space-4); animation: rise .5s var(--ease-out) .08s both; }
.level-card-body { flex: 1; min-width: 0; }
.level-card-title { font-size: var(--fs-lg); margin: 0; }
.level-card-next { margin: 0 0 var(--space-2); }
.level-card-next .num { color: var(--accent-text); }
.map-card { animation: rise .5s var(--ease-out) .16s both; }
.map-title { display: flex; align-items: center; gap: 8px; }
.map-title .icon { color: var(--link); }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); align-content: start; }
.shortcut { display: flex; align-items: center; gap: 10px; padding: 14px; }
.shortcut b { display: block; font-family: var(--font-title); font-size: 1.05rem; }
.shortcut .muted { font-size: var(--fs-sm); line-height: 1.4; }
.shortcut-icon.amber { color: var(--accent-text); }
.shortcut-icon.turq { color: var(--link); }

@media (min-width: 900px) {
    .home-grid { grid-template-columns: 1.25fr 1fr; align-items: start; }
    .map-card { grid-row: span 2; }
}
