/* ══════════════════════════════════════════════════════════════════════
   GUIDED TOUR — full-screen walkthrough + chapter overview
   Paired with tutorial.js. Replaces onboarding-tutorial.css.
   ══════════════════════════════════════════════════════════════════════ */

.tut-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;          /* above the app nav (9000) and the quiz nudge */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: rgba(8, 4, 16, 0.82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.tut-overlay.tut-open { opacity: 1; }

/* Freeze the page behind the tour so an iOS momentum scroll can't drag
   the app around underneath a modal walkthrough. */
body.tut-locked { overflow: hidden; }

/* ── Sheet ────────────────────────────────────────────────────────── */

.tut-sheet {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 26px;
    padding: 26px 22px 22px;
    background: linear-gradient(168deg, #1E1030 0%, #150B26 55%, #10071C 100%);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.6);
    transform: translateY(14px) scale(0.98);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.tut-open .tut-sheet { transform: none; }

/* Accent drives the icon halo and the primary button, so each chapter
   has its own temperature without restyling the whole sheet. */
.tut-accent--pink   { --tut-a: #E91E63; --tut-b: #FF80AB; }
.tut-accent--violet { --tut-a: #7C4DFF; --tut-b: #B388FF; }
.tut-accent--blue   { --tut-a: #2979FF; --tut-b: #64B5F6; }
.tut-accent--gold   { --tut-a: #F5A623; --tut-b: #FFD54F; }

.tut-x {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.16s ease;
}
.tut-x:hover { background: rgba(255, 255, 255, 0.15); }

/* ── Progress dots ────────────────────────────────────────────────── */

.tut-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 22px;
}
.tut-dot {
    width: 6px; height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    transition: width 0.3s ease, background 0.3s ease;
}
.tut-dot--past { background: rgba(255, 255, 255, 0.38); }
.tut-dot--on {
    width: 20px;
    background: linear-gradient(90deg, var(--tut-a, #E91E63), var(--tut-b, #FF80AB));
}

/* ── Chapter body ─────────────────────────────────────────────────── */

.tut-body { text-align: center; }

.tut-icn {
    width: 76px; height: 76px;
    margin: 4px auto 18px;
    display: grid; place-items: center;
    font-size: 36px;
    line-height: 1;
    border-radius: 24px;
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--tut-a, #E91E63) 34%, transparent),
        color-mix(in srgb, var(--tut-b, #FF80AB) 16%, transparent));
    border: 1px solid color-mix(in srgb, var(--tut-a, #E91E63) 42%, transparent);
    box-shadow: 0 12px 34px color-mix(in srgb, var(--tut-a, #E91E63) 28%, transparent);
}

.tut-step {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
    margin: 0 0 8px;
}

.tut-t {
    font-size: 21px;
    font-weight: 800;
    line-height: 1.22;
    color: #fff;
    margin: 0 0 12px;
}

.tut-b {
    font-size: 14px;
    line-height: 1.62;
    color: rgba(255, 255, 255, 0.66);
    margin: 0;
}

/* ── Actions ──────────────────────────────────────────────────────── */

.tut-actions { margin-top: 26px; }

.tut-btn {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 14px 18px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 750;
    color: #fff;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease;
}
.tut-btn--primary {
    background: linear-gradient(135deg, var(--tut-a, #E91E63), var(--tut-b, #FF80AB));
    box-shadow: 0 10px 26px color-mix(in srgb, var(--tut-a, #E91E63) 38%, transparent);
}
.tut-btn:active { transform: scale(0.975); }
.tut-btn:hover  { filter: brightness(1.06); }

.tut-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    min-height: 20px;
}
.tut-link {
    border: 0;
    background: none;
    padding: 4px 2px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.42);
    cursor: pointer;
    transition: color 0.16s ease;
}
.tut-link:hover { color: rgba(255, 255, 255, 0.75); }

/* ── Overview grid ────────────────────────────────────────────────── */

.tut-sheet--grid { padding-top: 30px; }

.tut-ov-t {
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 5px;
    padding-right: 34px;   /* clear of the close button */
}
.tut-ov-s {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 18px;
}

.tut-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.tut-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: 14px 13px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.tut-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: color-mix(in srgb, var(--tut-a, #E91E63) 45%, transparent);
}
.tut-card:active { transform: scale(0.97); }

.tut-card-icn {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    font-size: 19px;
    line-height: 1;
    border-radius: 12px;
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--tut-a, #E91E63) 32%, transparent),
        color-mix(in srgb, var(--tut-b, #FF80AB) 14%, transparent));
}
.tut-card-t {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.88);
}

/* ── Small screens ────────────────────────────────────────────────── */

@media (max-height: 640px) {
    .tut-icn { width: 58px; height: 58px; font-size: 27px; margin-bottom: 13px; border-radius: 19px; }
    .tut-t { font-size: 18.5px; }
    .tut-b { font-size: 13px; }
    .tut-dots { margin-bottom: 16px; }
    .tut-actions { margin-top: 20px; }
}

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

/* color-mix is well supported but not universal; without it the halos
   fall back to a flat tint rather than disappearing. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
    .tut-icn,
    .tut-card-icn { background: rgba(233, 30, 99, 0.22); border-color: rgba(233, 30, 99, 0.4); }
    .tut-btn--primary { background: linear-gradient(135deg, #E91E63, #FF80AB); }
}

@media (prefers-reduced-motion: reduce) {
    .tut-overlay,
    .tut-sheet,
    .tut-dot,
    .tut-btn,
    .tut-card { transition-duration: 0.01ms; }
}
