/* =========================================================================
   Quizdegaeltredificile — feuille de style principale
   ========================================================================= */

:root {
    --bg:        #0a0a12;
    --bg-soft:   #12121f;
    --card:      #171728;
    --card-2:    #1e1e33;
    --line:      #2a2a45;
    --text:      #f2f2ff;
    --muted:     #9a9ac0;
    --violet:    #7c5cff;
    --violet-2:  #a855f7;
    --green:     #22c55e;
    --red:       #ef4444;
    --amber:     #f59e0b;
    --blue:      #38bdf8;
    --radius:    18px;
    --radius-sm: 12px;
    --shadow:    0 18px 40px -18px rgba(0, 0, 0, .85);
    --font:      ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --safe-top:  env(safe-area-inset-top, 0px);
    --safe-bot:  env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

[hidden] { display: none !important; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: calc(76px + var(--safe-bot));
}

body.no-nav { padding-bottom: 0; }

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px 500px at 12% -8%, rgba(124, 92, 255, .28), transparent 60%),
        radial-gradient(700px 460px at 96% 4%, rgba(239, 68, 68, .18), transparent 62%),
        radial-gradient(700px 600px at 50% 110%, rgba(56, 189, 248, .12), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

.wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.strong { font-weight: 700; }
.mt { margin-top: 14px; }
.mt-lg { margin-top: 30px; }
.mb { margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap-sm { gap: 8px; }

/* ------------------------------------------------------------------ topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(10, 10, 18, .86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding-top: var(--safe-top);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 58px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--violet), var(--red));
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    flex: 0 0 auto;
}

.brand-name {
    font-weight: 800;
    font-size: .98rem;
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-sub { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .85rem;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .16);
    flex: 0 0 auto;
}

.avatar-lg { width: 62px; height: 62px; font-size: 1.5rem; border-radius: 20px; }

/* ------------------------------------------------------------------ boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 14px;
    font-weight: 700;
    font-size: .92rem;
    background: var(--card-2);
    color: var(--text);
    border: 1px solid var(--line);
    transition: transform .14s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    white-space: nowrap;
}

.btn:active { transform: scale(.97); }
.btn:hover { border-color: rgba(124, 92, 255, .6); }

.btn-primary {
    background: linear-gradient(135deg, var(--violet), var(--violet-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 26px -14px rgba(124, 92, 255, .95);
}

.btn-danger { background: linear-gradient(135deg, #ef4444, #b91c1c); border-color: transparent; color: #fff; }
.btn-green  { background: linear-gradient(135deg, #22c55e, #15803d); border-color: transparent; color: #fff; }
.btn-ghost  { background: transparent; }
.btn-sm     { padding: 9px 13px; font-size: .82rem; border-radius: 11px; }
.btn-block  { width: 100%; }
.btn-icon   { padding: 10px; width: 40px; height: 40px; border-radius: 12px; }

.btn[disabled] { opacity: .55; pointer-events: none; }

/* -------------------------------------------------------------------- cartes */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.card-tight { padding: 14px; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 26px 0 12px;
}

.section-title h2 { font-size: 1.12rem; letter-spacing: -.3px; }
.section-title p { font-size: .82rem; color: var(--muted); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    background: rgba(124, 92, 255, .16);
    color: #c9bcff;
    border: 1px solid rgba(124, 92, 255, .3);
}

.pill-green { background: rgba(34, 197, 94, .14); color: #8ef0b4; border-color: rgba(34, 197, 94, .32); }
.pill-red   { background: rgba(239, 68, 68, .14); color: #ffb0b0; border-color: rgba(239, 68, 68, .32); }
.pill-amber { background: rgba(245, 158, 11, .14); color: #ffd58a; border-color: rgba(245, 158, 11, .32); }
.pill-blue  { background: rgba(56, 189, 248, .14); color: #a8e4ff; border-color: rgba(56, 189, 248, .32); }

/* --------------------------------------------------------------------- hero */
.hero {
    position: relative;
    margin-top: 18px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    box-shadow: var(--shadow);
}

.hero-media { position: absolute; inset: 0; }

.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }

.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 10, 18, .35) 0%, rgba(10, 10, 18, .88) 62%, var(--bg) 100%);
}

.hero-body { position: relative; padding: 26px 20px; width: 100%; }

.hero h1 {
    font-size: clamp(1.7rem, 7vw, 3rem);
    line-height: 1.06;
    letter-spacing: -1.2px;
    margin-bottom: 10px;
}

.hero h1 span {
    background: linear-gradient(120deg, #a78bfa, #f87171 60%, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p { color: #d3d3ec; max-width: 620px; font-size: .95rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* --------------------------------------------------------------- statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
}

.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(124, 92, 255, .16);
    color: #c4b5fd;
    flex: 0 0 auto;
}

.stat-value { font-size: 1.4rem; font-weight: 800; letter-spacing: -.6px; }
.stat-label { font-size: .78rem; color: var(--muted); }

/* ----------------------------------------------------------------- catégories */
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.cat-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card);
    display: flex;
    flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}

.cat-card:hover { transform: translateY(-3px); }
.cat-card img { height: 132px; width: 100%; object-fit: cover; opacity: .68; }

.cat-body { padding: 15px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cat-body h3 { font-size: 1.05rem; }
.cat-body p { font-size: .84rem; color: var(--muted); }
.cat-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }

/* ------------------------------------------------------------------ classement */
.lead-list { display: flex; flex-direction: column; gap: 10px; }

.lead-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--card);
    border: 1px solid var(--line);
}

.lead-item.me { border-color: rgba(124, 92, 255, .65); background: rgba(124, 92, 255, .1); }

.lead-rank {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .82rem;
    background: var(--card-2);
    color: var(--muted);
    flex: 0 0 auto;
}

.lead-rank.top1 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #21150a; }
.lead-rank.top2 { background: linear-gradient(135deg, #e5e7eb, #94a3b8); color: #14161c; }
.lead-rank.top3 { background: linear-gradient(135deg, #f59e0b, #92400e); color: #fff; }

.lead-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow: hidden; }
.lead-meta b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-score { margin-left: auto; text-align: right; flex: 0 0 auto; }
.lead-score b { display: block; font-size: 1rem; }

/* ---------------------------------------------------------------------- quiz */
.quiz-head {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0 12px;
}

.hud {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.hud b { display: block; font-size: 1.15rem; letter-spacing: -.4px; }
.hud span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.timer-track { height: 9px; border-radius: 999px; background: var(--card-2); overflow: hidden; margin-bottom: 14px; }

.timer-fill {
    height: 100%;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #22c55e, #a3e635);
    transition: width .25s linear, background .3s ease;
}

.question-card {
    background: linear-gradient(160deg, var(--card-2), var(--card));
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 26px 18px;
    text-align: center;
    box-shadow: var(--shadow);
}

.question-label { font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.question-text {
    font-size: clamp(1.9rem, 11vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    margin: 12px 0 4px;
    line-height: 1.1;
}

.answer-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }

.answer-btn {
    padding: 18px;
    border-radius: 16px;
    font-size: 1.3rem;
    font-weight: 800;
    background: var(--card-2);
    border: 2px solid var(--line);
    color: var(--text);
    transition: transform .12s ease, border-color .16s ease, background .16s ease;
    letter-spacing: -.5px;
}

.answer-btn:hover { border-color: var(--violet); }
.answer-btn:active { transform: scale(.97); }
.answer-btn.correct { background: rgba(34, 197, 94, .22); border-color: var(--green); color: #c9ffd9; }
.answer-btn.wrong   { background: rgba(239, 68, 68, .22); border-color: var(--red); color: #ffd0d0; }
.answer-btn.reveal  { border-color: var(--green); border-style: dashed; opacity: .95; }
.answer-btn[disabled] { pointer-events: none; }

.feedback {
    margin-top: 14px;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--card);
    text-align: left;
    font-size: .9rem;
}

.feedback.ok  { border-color: rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .08); }
.feedback.no  { border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .08); }
.feedback b { font-size: 1rem; }

.progress-line { font-size: .78rem; color: var(--muted); text-align: center; margin-top: 12px; }

/* ----------------------------------------------------- carte photo (rate) */
.reaction-layer {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    background: rgba(4, 4, 10, .9);
    backdrop-filter: blur(10px);
    padding: 22px;
    pointer-events: none;
}

.reaction-card {
    position: relative;
    width: 100%;
    max-width: 330px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .14);
    background: var(--card);
    box-shadow: 0 30px 70px -22px rgba(0, 0, 0, .95), 0 0 60px -24px var(--rc, #ef4444);
}

.reaction-shot-wrap {
    position: relative;
    background: var(--card-2);
    aspect-ratio: 4 / 5;
}

.reaction-shot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reaction-shot-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 4, 10, .35) 0%, transparent 34%, rgba(4, 4, 10, .55) 100%);
    pointer-events: none;
}

.reaction-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(5, 5, 13, .72);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(7px);
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--rc, #ef4444);
}

.reaction-caption {
    padding: 13px 16px 15px;
    border-top: 3px solid var(--rc, #ef4444);
}

.reaction-caption b { display: block; font-size: .95rem; font-weight: 800; letter-spacing: -.2px; line-height: 1.25; }
.reaction-caption span { display: block; margin-top: 3px; font-size: .78rem; color: var(--muted); line-height: 1.35; }

.reaction-caption b:empty, .reaction-caption span:empty { display: none; }

.reaction-card.no-shot .reaction-shot-wrap { display: none; }
.reaction-card.no-shot .reaction-caption { border-top-width: 3px; padding-top: 16px; }

@keyframes rx-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    18% { transform: translateX(-9px) rotate(-1.4deg); }
    40% { transform: translateX(7px) rotate(1.4deg); }
    62% { transform: translateX(-5px) rotate(-.8deg); }
    82% { transform: translateX(3px) rotate(.4deg); }
}
@keyframes rx-bounce {
    0% { transform: scale(.82) translateY(26px); opacity: 0; }
    45% { transform: scale(1.03) translateY(-8px); opacity: 1; }
    72% { transform: scale(.985) translateY(2px); }
    100% { transform: scale(1) translateY(0); }
}
@keyframes rx-zoom {
    0% { transform: scale(.72); opacity: 0; }
    60% { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(1); }
}
@keyframes rx-tilt {
    0% { transform: rotate(-7deg) scale(.9); opacity: 0; }
    60% { transform: rotate(2.5deg) scale(1.02); opacity: 1; }
    100% { transform: rotate(0) scale(1); }
}
@keyframes rx-flash {
    0% { opacity: 0; filter: brightness(2); }
    22% { opacity: 1; filter: brightness(1); }
    45% { opacity: .72; }
    100% { opacity: 1; filter: brightness(1); }
}
@keyframes rx-explode {
    0% { transform: scale(1.18); filter: blur(7px); opacity: 0; }
    55% { transform: scale(.98); filter: blur(0); opacity: 1; }
    100% { transform: scale(1); }
}

.anim-shake   { animation: rx-shake .62s ease both; }
.anim-bounce  { animation: rx-bounce .58s cubic-bezier(.3, 1.4, .5, 1) both; }
.anim-zoom    { animation: rx-zoom .5s ease both; }
.anim-tilt    { animation: rx-tilt .55s ease both; }
.anim-flash   { animation: rx-flash .7s ease both; }
.anim-explode { animation: rx-explode .55s ease both; }

body.shake-screen { animation: rx-shake .4s ease; }

@media (prefers-reduced-motion: reduce) {
    .anim-shake, .anim-bounce, .anim-zoom, .anim-tilt, .anim-flash,
    .anim-explode, body.shake-screen { animation-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- résultat */
.result-hero { text-align: center; padding: 26px 18px; }
.result-score { font-size: clamp(2.6rem, 16vw, 4.6rem); font-weight: 900; letter-spacing: -3px; line-height: 1; }

.result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 18px;
}

.result-cell {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    text-align: center;
}

.result-cell b { display: block; font-size: 1.35rem; letter-spacing: -.6px; }
.result-cell span { font-size: .74rem; color: var(--muted); }

.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(250, 204, 21, .22), rgba(245, 158, 11, .12));
    border: 1px solid rgba(250, 204, 21, .45);
    font-size: .8rem;
    font-weight: 700;
    color: #ffe6a3;
}

/* ------------------------------------------------------------------ profil */
.level-box { display: flex; flex-direction: column; gap: 8px; }

.level-track { height: 12px; border-radius: 999px; background: var(--card-2); overflow: hidden; border: 1px solid var(--line); }

.level-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--violet), var(--violet-2), #f472b6);
    transition: width .5s ease;
}

.badges-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }

.badge-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border-radius: var(--radius-sm);
    background: var(--card);
    border: 1px solid var(--line);
    opacity: .55;
}

.badge-card.earned { opacity: 1; border-color: rgba(250, 204, 21, .45); background: rgba(250, 204, 21, .06); }

.badge-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--card-2);
    color: var(--muted);
    flex: 0 0 auto;
}

.badge-card.earned .badge-mark { background: linear-gradient(135deg, #fbbf24, #d97706); color: #241704; }

.mini-bar { height: 6px; border-radius: 999px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.mini-bar i { display: block; height: 100%; background: var(--violet); border-radius: 999px; }

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--card);
    border: 1px solid var(--line);
}

.history-date { font-size: .74rem; color: var(--muted); }

/* ------------------------------------------------------------------ comptes */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 16px;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 26px 20px;
    box-shadow: var(--shadow);
}

.auth-visual {
    height: 130px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.auth-visual img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }

.auth-visual span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(160deg, rgba(124, 92, 255, .5), rgba(10, 10, 18, .85));
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .8rem; color: var(--muted); font-weight: 600; }

.input, .select, .textarea {
    width: 100%;
    padding: 13px 14px;
    border-radius: 13px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--text);
    font-size: .95rem;
    font-family: inherit;
}

.input:focus, .select:focus, .textarea:focus { outline: 2px solid rgba(124, 92, 255, .55); border-color: transparent; }
.textarea { min-height: 88px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch input { width: 46px; height: 26px; appearance: none; background: var(--card-2); border-radius: 999px; position: relative; transition: background .2s ease; border: 1px solid var(--line); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .2s ease, background .2s ease; }
.switch input:checked { background: rgba(34, 197, 94, .3); border-color: rgba(34, 197, 94, .6); }
.switch input:checked::after { transform: translateX(20px); background: var(--green); }

/* ------------------------------------------------------------------- nav bas */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(12, 12, 22, .95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: var(--safe-bot);
}

.bottom-nav ul {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    max-width: 620px;
    margin: 0 auto;
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 2px;
    font-size: .66rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .02em;
}

.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: #c4b5fd; }
.bottom-nav a.active svg { filter: drop-shadow(0 0 10px rgba(124, 92, 255, .8)); }

/* ------------------------------------------------------------------- toasts */
.toast-zone {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(88px + var(--safe-bot));
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 420px;
    pointer-events: none;
}

.toast {
    padding: 13px 16px;
    border-radius: 14px;
    background: rgba(23, 23, 40, .97);
    border: 1px solid var(--line);
    font-size: .88rem;
    box-shadow: var(--shadow);
    animation: toast-in .25s ease both;
}

.toast.ok { border-color: rgba(34, 197, 94, .6); }
.toast.err { border-color: rgba(239, 68, 68, .6); }

@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* --------------------------------------------------------------- installation */
.install-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(124, 92, 255, .45);
    background: linear-gradient(135deg, rgba(124, 92, 255, .18), rgba(23, 23, 40, .9));
    margin-top: 18px;
}

.install-bar svg { flex: 0 0 auto; }
.install-bar .grow b { display: block; font-size: .92rem; }
.install-bar .grow span { font-size: .78rem; color: var(--muted); }

.modal-back {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(5, 5, 10, .8);
    display: grid;
    place-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal {
    width: 100%;
    max-width: 430px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow);
    max-height: 88vh;
    overflow-y: auto;
}

.modal h3 { font-size: 1.1rem; margin-bottom: 8px; }
.modal ol { margin: 14px 0 0 18px; display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.modal ol li { list-style: decimal; }
.store-logos { display: flex; gap: 14px; justify-content: center; margin-top: 18px; }
.store-logos svg { width: 34px; height: 34px; }

/* ------------------------------------------------------------------- footer */
.footer {
    margin-top: 40px;
    padding: 26px 0 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .82rem;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.footer-links a:hover { color: #c4b5fd; }

/* -------------------------------------------------------------------- vide */
.empty {
    padding: 26px 18px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: .88rem;
}

.skeleton { height: 14px; border-radius: 8px; background: var(--card-2); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 9px 15px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.tab.active { background: linear-gradient(135deg, var(--violet), var(--violet-2)); border-color: transparent; color: #fff; }

/* ============================================================ responsive === */
@media (min-width: 620px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .answer-grid { grid-template-columns: repeat(2, 1fr); }
    .result-grid { grid-template-columns: repeat(2, 1fr); }
    .badges-grid { grid-template-columns: repeat(2, 1fr); }
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-body { padding: 34px 28px; }
    .card { padding: 22px; }
}

@media (min-width: 900px) {
    body { padding-bottom: 0; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .result-grid { grid-template-columns: repeat(4, 1fr); }
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .badges-grid { grid-template-columns: repeat(3, 1fr); }
    .hero { min-height: 440px; }
    .bottom-nav { display: none; }
    .toast-zone { bottom: 28px; }
    .wrap { padding: 0 24px; }
    .quiz-head { grid-template-columns: repeat(3, minmax(0, 220px)); justify-content: center; }
}

@media (min-width: 1100px) {
    .layout-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
}
