:root {
    --quest-navy: #071a2d;
    --quest-blue: #4f9cf9;
    --quest-teal: #67e8d2;
    --quest-gold: #f8d76a;
    --quest-purple: #a98cff;
    --quest-ink: #17324d;
    --quest-card: rgba(10, 31, 54, 0.88);
}

body.quest-app {
    font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
}

/* Onboarding sets its own pairing (Barlow Condensed for display, Nunito for
   body) and loads before this file, so it needs the rule above not to win. */
body.quest-onboarding {
    font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
}

/* The player chip now sits inside the nav pill rather than in a separate bar
   below it, so every quest page just needs the nav's own height cleared. */
body.quest-app.has-site-nav {
    padding-top: var(--site-nav-space);
}

body.quest-app .page-brand::before {
    content: "⚡";
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    margin-right: 8px;
    color: var(--quest-navy);
    background: var(--quest-gold);
    border-radius: 10px;
    font-size: 0.82rem;
    box-shadow: 0 0 16px rgba(248, 215, 106, 0.52);
}

body.quest-app nav.site-nav {
    --site-nav-width: 1600px;
}

body.quest-app .site-nav .nav-links {
    gap: 6px;
}

body.quest-app .site-nav .nav-btn {
    padding: 0 12px;
    font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
}

body.quest-app .site-nav .nav-btn.active {
    color: var(--quest-navy);
    background: linear-gradient(135deg, var(--quest-gold), #fbd38d);
    box-shadow: 0 5px 14px rgba(248, 215, 106, 0.28);
}

@media (min-width: 701px) {
    body.quest-app.user-logged-in nav.site-nav,
    body.quest-app.user-logged-in.has-settings nav.site-nav {
        width: min(980px, calc(100% - var(--nav-inset) - var(--gear-size) - 12px));
        max-width: min(980px, calc(100% - var(--nav-inset) - var(--gear-size) - 12px));
        box-sizing: border-box;
    }

    body.quest-app.user-logged-in .site-nav .nav-links {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 4px;
    }

    body.quest-app.user-logged-in .site-nav .nav-btn,
    body.quest-app.user-logged-in .site-nav a.nav-btn,
    body.quest-app.user-logged-in .site-nav button.nav-btn {
        width: 100%;
        min-width: 0;
        padding-right: 6px;
        padding-left: 6px;
        box-sizing: border-box;
    }
}

/* Docked directly under the nav pill, same width/alignment, so the player
   identity + XP reads as part of one nav unit instead of a separate floating
   card further down the page. */
/* Lives INSIDE the nav pill itself (inserted as the first child of
   nav.site-nav, before .nav-links) so identity + XP reads as part of the
   same bar instead of a separate card. Compact single row, sized to the
   nav's own height. */
.mz-player-hud {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding-right: 10px;
    margin-right: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    flex-shrink: 0;
}

body.overlay-open .mz-player-hud {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mz-hud-player {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.mz-hud-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: linear-gradient(145deg, #6ce6d3, #4f9cf9);
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 9px;
    font-size: 0.85rem;
    box-shadow: 0 0 12px rgba(103, 232, 210, 0.35);
}

.mz-hud-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.1;
}

.mz-hud-copy small,
.mz-hud-progress-label {
    color: #9ed7ff;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mz-hud-copy strong {
    max-width: 92px;
    overflow: hidden;
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mz-hud-progress {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mz-hud-progress-label {
    display: none;
}

.mz-hud-track {
    width: 56px;
    height: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    flex-shrink: 0;
}

.mz-hud-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--quest-blue), var(--quest-teal), var(--quest-gold));
    border-radius: inherit;
    box-shadow: 0 0 8px rgba(103, 232, 210, 0.55);
    transition: width 0.35s ease;
}

/* Below the width where the nav pill relocates to a bottom bar (see the
   700px breakpoint), there isn't room for identity + all the nav buttons —
   the level/XP chip is dropped there and stays reachable from the dashboard. */
@media (max-width: 700px) {
    .mz-player-hud {
        display: none;
    }
}

.quest-page-hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
    width: min(1120px, calc(100% - 40px));
    margin: 24px auto 18px;
    padding: 24px 30px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 20%, rgba(103, 232, 210, 0.22), transparent 28%),
        linear-gradient(135deg, rgba(11, 43, 73, 0.94), rgba(13, 31, 57, 0.94));
    border: 2px solid rgba(129, 230, 217, 0.42);
    border-radius: 28px;
    box-shadow: 0 20px 48px rgba(2, 12, 25, 0.3);
    overflow: hidden;
}

.quest-page-kicker {
    margin: 0 0 7px;
    color: var(--quest-gold);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.quest-page-hero h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.65rem);
    line-height: 1.05;
}

.quest-page-hero-copy > p:last-of-type {
    max-width: 690px;
    margin: 9px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 700;
}

.quest-page-mascot {
    width: 112px;
    height: 142px;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

.quest-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.quest-chip {
    padding: 6px 10px;
    color: #eafffb;
    background: rgba(103, 232, 210, 0.11);
    border: 1px solid rgba(103, 232, 210, 0.36);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 900;
}

/* Skill Zones */
body.quest-zones .activity-grid {
    grid-template-rows: minmax(270px, 1fr);
    width: min(1120px, calc(100% - 40px));
    height: auto;
    min-height: 320px;
    margin: 0 auto 60px;
    padding: 0;
}

body.quest-zones .activity-box {
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 270px;
    padding: 28px;
    border-radius: 26px;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.quest-zones .activity-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 38px rgba(2, 12, 25, 0.42);
}

.zone-kicker {
    color: var(--quest-gold);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.zone-description {
    max-width: 430px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
    font-weight: 700;
}

.zone-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.zone-meta span {
    padding: 6px 9px;
    color: #fff;
    background: rgba(2, 12, 25, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 900;
}

body.quest-zones .open-now-btn {
    color: var(--quest-navy);
    background: linear-gradient(135deg, var(--quest-gold), #fbd38d);
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 14px;
}

/* Choice challenge shell sizing */
body.quest-challenge .avatar-page-shell {
    padding-top: 18px;
}

body.quest-challenge .avatar-page-panel {
    width: min(1120px, calc(100% - 40px));
    border: 2px solid rgba(237, 100, 166, 0.62);
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(74, 4, 78, 0.42);
}

.challenge-mission-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(135deg, rgba(79, 156, 249, 0.22), rgba(169, 140, 255, 0.2));
    border: 1px solid rgba(169, 140, 255, 0.45);
    border-radius: 15px;
    font-weight: 800;
}

.challenge-reward {
    color: var(--quest-navy);
    background: var(--quest-gold);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: nowrap;
}

/* Dashboard details */
body.quest-dashboard .dashboard-welcome {
    border: 2px solid rgba(129, 230, 217, 0.42);
    box-shadow: 0 22px 52px rgba(2, 12, 25, 0.3);
}

body.quest-dashboard .tool-card,
body.quest-dashboard .games-block {
    border-width: 2px;
}

.coach-starters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.coach-starter {
    padding: 7px 10px;
    color: #e6fffa;
    background: rgba(103, 232, 210, 0.1);
    border: 1px solid rgba(103, 232, 210, 0.36);
    border-radius: 999px;
    font: 800 0.72rem 'Nunito', sans-serif;
    cursor: pointer;
}

.coach-starter:hover {
    background: rgba(103, 232, 210, 0.2);
}

body.quest-app .video-panel,
body.quest-app .rewards-panel {
    border: 2px solid rgba(129, 230, 217, 0.5);
    border-radius: 26px;
    box-shadow: 0 28px 70px rgba(2, 12, 25, 0.48);
}

body.quest-app .video-kicker,
body.quest-app .rewards-kicker {
    color: var(--quest-gold);
    letter-spacing: 0.14em;
}

.film-room-mission {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 0 18px;
    padding: 12px 15px;
    color: var(--quest-ink);
    background: linear-gradient(135deg, #e6fffa, #ebf8ff);
    border: 2px solid #81e6d9;
    border-radius: 15px;
}

.film-room-mission > span {
    font-size: 1.45rem;
}

.film-room-mission p {
    margin: 0;
    font-size: 0.83rem;
    font-weight: 700;
}

/* Public entry + onboarding */
body.quest-entry .auth-hero-text,
body.quest-onboarding .page-header {
    position: relative;
}

.entry-krish {
    display: block;
    width: 150px;
    height: 188px;
    margin: 6px auto -14px;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.32));
}

body.quest-entry .auth-card {
    border: 2px solid rgba(129, 230, 217, 0.42);
    box-shadow: 0 24px 58px rgba(2, 12, 25, 0.34);
}

body.quest-entry .submit-btn {
    color: var(--quest-navy);
    background: linear-gradient(135deg, var(--quest-gold), #fbd38d);
}

@media (max-width: 900px) {
    body.quest-app nav.site-nav {
        --site-nav-width: calc(100% - var(--nav-inset));
    }

    body.quest-zones .activity-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }
}

@media (max-width: 700px) {
    body.quest-app.has-site-nav {
        padding-top: 126px;
        padding-bottom: 78px;
    }

    body.quest-app:not(.quest-no-hud) nav.site-nav {
        top: auto;
        right: 12px;
        bottom: 10px;
        left: 12px;
        width: auto;
        max-width: none;
        height: 58px;
        padding: 0 8px;
    }

    body.quest-app:not(.quest-no-hud) .site-nav .nav-links {
        justify-content: space-around;
    }

    body.quest-app:not(.quest-no-hud) .site-nav .nav-btn[data-nav-key="videos"],
    body.quest-app:not(.quest-no-hud) .site-nav .nav-btn[data-nav-key="rewards"] {
        display: none;
    }

    body.quest-app .site-nav .nav-btn {
        padding: 0 8px;
        font-size: 0.68rem;
    }

    .quest-page-hero {
        grid-template-columns: 1fr;
        padding: 22px;
        text-align: center;
    }

    .quest-page-mascot {
        display: none;
    }

    .quest-chip-row {
        justify-content: center;
    }

    body.quest-zones .activity-grid {
        width: min(100% - 24px, 1120px);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.quest-app *,
    body.quest-app *::before,
    body.quest-app *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Make Quest Hub pop without moving anything. */
body.quest-dashboard::before {
    background:
        radial-gradient(ellipse at 18% 8%, rgba(248, 215, 106, 0.24), transparent 36%),
        radial-gradient(ellipse at 82% 12%, rgba(103, 232, 210, 0.18), transparent 34%),
        radial-gradient(120% 80% at 50% 0%, rgba(14, 23, 41, 0.55), rgba(14, 23, 41, 0.94));
}

body.quest-dashboard .dashboard-welcome {
    border: 2px solid rgba(248, 215, 106, 0.5);
    box-shadow:
        0 26px 60px rgba(2, 12, 25, 0.45),
        0 0 48px rgba(103, 232, 210, 0.2);
}

body.quest-dashboard .dashboard-kicker,
body.quest-dashboard .section-eyebrow,
body.quest-dashboard .plan-eyebrow {
    color: var(--quest-gold);
    text-shadow: 0 0 18px rgba(248, 215, 106, 0.5);
}

body.quest-dashboard .dashboard-flow b {
    color: var(--quest-navy);
    background: var(--quest-gold);
    box-shadow: 0 0 14px rgba(248, 215, 106, 0.55);
}

body.quest-dashboard .tool-plan {
    border: 2px solid rgba(248, 215, 106, 0.55);
    box-shadow:
        0 28px 64px rgba(2, 12, 25, 0.46),
        0 0 40px rgba(248, 215, 106, 0.2);
}

body.quest-dashboard .tool-ai-coach {
    border: 2px solid rgba(103, 232, 210, 0.6);
    box-shadow:
        0 28px 64px rgba(2, 12, 25, 0.5),
        0 0 52px rgba(103, 232, 210, 0.32);
}

body.quest-dashboard .page > #emotionCheckinSection {
    border: 2px solid rgba(248, 215, 106, 0.48);
    box-shadow:
        0 24px 56px rgba(2, 12, 25, 0.4),
        0 0 36px rgba(248, 215, 106, 0.16);
}

body.quest-dashboard #generatePlanButton {
    background: linear-gradient(135deg, #1d6fd4 0%, #3ec6ff 48%, #67e8d2 100%);
    box-shadow: 0 12px 28px rgba(62, 198, 255, 0.45), 0 0 22px rgba(248, 215, 106, 0.22);
}

body.quest-dashboard .coach-send-btn {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 52%, #67e8d2 100%);
    box-shadow: 0 12px 26px rgba(20, 184, 166, 0.48);
}

body.quest-dashboard .coach-starter {
    border-color: rgba(248, 215, 106, 0.4);
}

body.quest-dashboard #emotionCheckinSection .emotion-cell:hover {
    transform: translateY(-3px);
    border-color: var(--quest-teal);
    box-shadow: 0 12px 22px rgba(103, 232, 210, 0.3);
}

body.quest-dashboard #emotionCheckinSection .emotion-cell.is-selected {
    transform: translateY(-3px) scale(1.04);
    border-color: var(--quest-gold);
    box-shadow: 0 0 0 2px var(--quest-gold), 0 12px 24px rgba(248, 215, 106, 0.4);
}

/* Keep Choices as a heat-of-the-moment arena. */
body.quest-challenge.avatar-page {
    background:
        radial-gradient(circle at 18% 16%, rgba(251, 182, 206, 0.4), transparent 30%),
        radial-gradient(circle at 84% 78%, rgba(229, 62, 62, 0.38), transparent 28%),
        linear-gradient(145deg, #4a044e 0%, #702459 40%, #9b2c2c 100%);
}

body.quest-challenge .quest-page-hero {
    border-color: rgba(251, 182, 206, 0.5);
    background:
        radial-gradient(circle at 86% 16%, rgba(237, 100, 166, 0.28), transparent 32%),
        linear-gradient(135deg, rgba(74, 4, 78, 0.96), rgba(123, 31, 62, 0.94));
}

body.quest-challenge .quest-page-kicker {
    color: #fbb6ce;
    text-shadow: 0 0 16px rgba(237, 100, 166, 0.45);
}
