:root {
    --qp-bg: #0a0a1a;
    --qp-cyan: #22d3ee;
    --qp-magenta: #f472b6;
    --qp-card: rgba(16, 18, 40, 0.82);
    --qp-border: rgba(34, 211, 238, 0.25);
    --qp-scrollbar-size: 10px;
    --qp-scrollbar-track: rgba(6, 8, 22, 0.92);
    --qp-scrollbar-thumb: rgba(34, 211, 238, 0.55);
    --qp-scrollbar-thumb-hover: rgba(244, 114, 182, 0.85);
}

body.qp-body {
    background: radial-gradient(circle at top, #15153a 0%, var(--qp-bg) 55%);
    color: #f8fafc;
    min-height: 100vh;
}

.rain-layer {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 2px 28px;
    animation: rain 12s linear infinite;
    opacity: 0.25;
    z-index: 0;
}

@keyframes rain {
    from { background-position: 0 0; }
    to { background-position: 0 280px; }
}

.qp-navbar,
main,
.qp-footer {
    position: relative;
    z-index: 1;
}

.qp-navbar {
    background: rgba(10, 10, 26, 0.95);
    border-bottom: 1px solid var(--qp-border);
    backdrop-filter: blur(12px);
    padding: 0.65rem 0;
}

.qp-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.qp-navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem 1.25rem;
    flex: 1;
    min-width: 0;
}

.qp-navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    text-decoration: none;
    margin: 0;
    padding: 0;
}

.qp-navbar-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.qp-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.qp-stat-points .bi-star-fill {
    color: #fbbf24;
    font-size: 0.8rem;
}

.qp-stat-streak .bi-fire {
    color: #fb923c;
    font-size: 0.95rem;
}

.qp-stat-level {
    background: linear-gradient(135deg, var(--qp-cyan), var(--qp-magenta));
    border: none;
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
    min-width: 2.75rem;
    justify-content: center;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

.qp-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 50%;
    border: 2px solid var(--qp-cyan);
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.qp-profile-btn:hover,
.qp-profile-btn:focus {
    color: #fff;
    background: rgba(34, 211, 238, 0.12);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
}

.qp-profile-btn .bi-person-fill {
    font-size: 1.1rem;
}

.qp-navbar-menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.qp-navbar-menu::-webkit-scrollbar {
    display: none;
}

/* —— Neon scrollbars —— */
.qp-scrollbar,
html:has(.map-page),
body.qp-body:has(.map-page) {
    scrollbar-width: thin;
    scrollbar-color: var(--qp-scrollbar-thumb) var(--qp-scrollbar-track);
}

.qp-scrollbar::-webkit-scrollbar,
html:has(.map-page)::-webkit-scrollbar,
body.qp-body:has(.map-page)::-webkit-scrollbar {
    width: var(--qp-scrollbar-size);
    height: var(--qp-scrollbar-size);
}

.qp-scrollbar::-webkit-scrollbar-track,
html:has(.map-page)::-webkit-scrollbar-track,
body.qp-body:has(.map-page)::-webkit-scrollbar-track {
    background: var(--qp-scrollbar-track);
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.14);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.qp-scrollbar::-webkit-scrollbar-thumb,
html:has(.map-page)::-webkit-scrollbar-thumb,
body.qp-body:has(.map-page)::-webkit-scrollbar-thumb {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(
        180deg,
        rgba(34, 211, 238, 0.9) 0%,
        rgba(244, 114, 182, 0.75) 100%
    );
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}

.qp-scrollbar::-webkit-scrollbar-thumb:hover,
html:has(.map-page)::-webkit-scrollbar-thumb:hover,
body.qp-body:has(.map-page)::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--qp-cyan) 0%, var(--qp-magenta) 100%);
}

.qp-scrollbar::-webkit-scrollbar-corner,
html:has(.map-page)::-webkit-scrollbar-corner,
body.qp-body:has(.map-page)::-webkit-scrollbar-corner {
    background: var(--qp-scrollbar-track);
}

.qp-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.qp-nav-link:hover,
.qp-nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.qp-nav-link.is-active {
    color: var(--qp-cyan);
    background: rgba(34, 211, 238, 0.1);
}

.qp-nav-link .bi {
    font-size: 0.95rem;
}

.qp-logo,
.qp-logo-float,
.neon-text {
    color: #fff;
}

.qp-navbar-brand.qp-logo {
    text-shadow: none;
}

.qp-logo-float,
.neon-text {
    text-shadow: 0 0 12px var(--qp-cyan), 0 0 24px var(--qp-magenta);
}

@media (max-width: 991.98px) {
    .qp-navbar-inner {
        flex-wrap: wrap;
        row-gap: 0.65rem;
    }

    .qp-navbar-left {
        flex: 1 1 auto;
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .qp-navbar-menu {
        flex: 1 1 100%;
        width: 100%;
    }
}

@media (max-width: 400px) {
    .qp-navbar-stats {
        gap: 0.35rem;
    }

    .qp-stat-pill {
        padding: 0.35rem 0.55rem;
        font-size: 0.8rem;
    }

    .qp-profile-btn {
        width: 2.1rem;
        height: 2.1rem;
    }

    .qp-nav-link span {
        display: none;
    }

    .qp-nav-link {
        padding: 0.45rem 0.55rem;
    }
}

.qp-logo-float {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.qp-card,
.achievement-card {
    background: var(--qp-card);
    border: 1px solid var(--qp-border);
    border-radius: 1rem;
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.08);
}

.qp-input,
.form-control.qp-input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.qp-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--qp-cyan);
    box-shadow: 0 0 0 0.2rem rgba(34, 211, 238, 0.15);
    color: #fff;
}

.btn-neon {
    background: linear-gradient(135deg, var(--qp-cyan), var(--qp-magenta));
    border: 0;
    color: #0a0a1a;
    font-weight: 700;
}

.btn-neon:hover {
    filter: brightness(1.08);
    color: #0a0a1a;
}

.qp-streak-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(244, 114, 182, 0.12);
    border: 1px solid rgba(244, 114, 182, 0.35);
}

/* —— Night City map —— */
.map-fullbleed {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

main:has(.night-city) {
    padding-top: 0.5rem;
    padding-bottom: 0;
    max-width: 100%;
    overflow-x: clip;
}

main:has(.map-page) {
    padding-top: 0.35rem;
    padding-bottom: 0.25rem;
}

main:has(.map-page) > .word-of-day {
    display: none;
}

body.qp-body:has(.map-page) {
    overflow-x: clip;
}

.night-city {
    position: relative;
    min-height: clamp(560px, 92vh, 920px);
    margin-bottom: 1rem;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.2);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.night-city__stage {
    position: relative;
    min-height: clamp(560px, 92vh, 920px);
    background: #050510;
    container-type: inline-size;
    container-name: map-stage;
    --map-card-size: clamp(3.5rem, 11vw, 7rem);
    --map-node-anchor-y: -50%;
    --map-path-anchor: 0.5;
}

.night-city__nodes {
    position: absolute;
    z-index: 4;
    top: 22%;
    right: 10%;
    bottom: 20%;
    left: 10%;
    pointer-events: none;
}

.night-city__nodes .map-node {
    pointer-events: auto;
}

.night-city__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.night-city__skyline {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(5, 8, 24, 0.35) 0%, rgba(5, 5, 16, 0.15) 45%, rgba(3, 4, 12, 0.45) 100%),
        radial-gradient(ellipse 70% 35% at 50% 100%, rgba(34, 211, 238, 0.1), transparent 55%),
        radial-gradient(ellipse 45% 25% at 75% 25%, rgba(244, 114, 182, 0.08), transparent 50%);
}

.night-city__path {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.night-city__path-glow {
    opacity: 0.35;
    filter: blur(6px);
}

.night-city__path-line {
    opacity: 0.9;
}

.night-city__hud {
    position: absolute;
    z-index: 5;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    background: rgba(8, 10, 28, 0.72);
    border: 1px solid rgba(34, 211, 238, 0.28);
    backdrop-filter: blur(14px);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}

.night-city__hud--tl {
    top: max(1rem, env(safe-area-inset-top, 0px));
    left: max(1rem, env(safe-area-inset-left, 0px));
    max-width: min(320px, calc(100vw - 2rem));
}

.night-city__hud--tr {
    top: max(1rem, env(safe-area-inset-top, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.night-city__eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--qp-cyan);
    opacity: 0.85;
}

.night-city__title {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.night-city__tagline {
    margin: 0.35rem 0 0.85rem;
    font-size: 0.78rem;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.night-city__progress {
    height: 0.55rem;
    margin-bottom: 0.35rem;
}

.night-city__progress-label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
}

.night-city__level {
    margin: 0.65rem 0 0;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.night-city__stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 700;
}

.night-city__stat .bi-star-fill {
    color: #fbbf24;
}

.night-city__stat .bi-fire {
    color: #fb923c;
}

.night-city__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.45);
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.night-city__icon-btn:hover {
    color: #fff;
    background: rgba(34, 211, 238, 0.15);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
}

.night-city__legend {
    position: absolute;
    left: 1rem;
    bottom: 4.5rem;
    z-index: 5;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    background: rgba(8, 10, 28, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    font-size: 0.72rem;
    color: #94a3b8;
}

.night-city__legend p {
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.night-city__legend p:last-child {
    margin-bottom: 0;
}

.night-city__footer {
    position: absolute;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.night-city__counter {
    font-size: 0.8rem;
    color: #94a3b8;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.night-city__achievements-btn {
    font-size: 0.85rem;
    padding: 0.55rem 1rem;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.35);
}

.map-node {
    --tower-glow: rgba(34, 211, 238, 0.85);
    --tower-ring: rgba(34, 211, 238, 0.55);
    position: absolute;
    z-index: 4;
    transform: translate(-50%, var(--map-node-anchor-y, -50%));
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--map-card-size, clamp(3.5rem, 11vw, 7rem));
    text-decoration: none;
    color: #f8fafc;
    text-align: center;
    transition: transform 0.25s ease, filter 0.25s ease;
    touch-action: manipulation;
}

.map-node--green {
    --tower-glow: rgba(74, 222, 128, 0.9);
    --tower-ring: rgba(74, 222, 128, 0.55);
}

.map-node--cyan {
    --tower-glow: rgba(34, 211, 238, 0.85);
    --tower-ring: rgba(34, 211, 238, 0.55);
}

.map-node--orange {
    --tower-glow: rgba(251, 146, 60, 0.9);
    --tower-ring: rgba(251, 146, 60, 0.55);
}

.map-node--violet {
    --tower-glow: rgba(192, 132, 252, 0.9);
    --tower-ring: rgba(192, 132, 252, 0.55);
}

.map-node--red {
    --tower-glow: rgba(248, 113, 113, 0.9);
    --tower-ring: rgba(248, 113, 113, 0.55);
}

.map-node--completed {
    --tower-glow: rgba(74, 222, 128, 0.95);
    --tower-ring: rgba(74, 222, 128, 0.6);
}

a.map-node:hover {
    transform: translate(-50%, calc(var(--map-node-anchor-y, -50%) - 2%)) scale(1.03);
    color: #fff;
}

a.map-node:hover .map-node__hover-ring {
    opacity: 1;
    transform: scale(1.08);
}

.map-node__chip {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    margin-bottom: 0.35rem;
    padding: 0.35rem 0.55rem 0.4rem;
    min-width: 5.5rem;
    max-width: 7.5rem;
    border-radius: 0.5rem;
    background: rgba(8, 12, 32, 0.82);
    border: 1px solid rgba(34, 211, 238, 0.45);
    box-shadow:
        0 0 16px rgba(34, 211, 238, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.map-node--violet .map-node__chip,
.map-node--apex .map-node__chip {
    border-color: rgba(244, 114, 182, 0.5);
    box-shadow: 0 0 16px rgba(244, 114, 182, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.map-node--completed .map-node__chip {
    border-color: rgba(74, 222, 128, 0.55);
    box-shadow: 0 0 18px rgba(74, 222, 128, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.map-node__chip-num {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--qp-cyan);
    line-height: 1;
}

.map-node--completed .map-node__chip-num {
    color: #4ade80;
}

.map-node__chip-title {
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.map-node__status-badge {
    position: absolute;
    top: 0.1rem;
    right: -0.1rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(1.15rem, 18%, 1.35rem);
    height: clamp(1.15rem, 18%, 1.35rem);
    border-radius: 50%;
    font-size: clamp(0.58rem, 2.5vw, 0.7rem);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(8, 10, 28, 0.9);
    box-shadow: 0 0 10px var(--tower-glow);
}

.map-node__status-badge--completed {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.6);
}

.map-node__status-badge--available {
    color: var(--qp-cyan);
    border-color: rgba(34, 211, 238, 0.55);
}

.map-node__status-badge--locked {
    color: #94a3b8;
}

.map-node__card-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 572 / 1024;
}

.map-node__card {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center center;
    filter: drop-shadow(0 4px 18px var(--tower-glow));
    transition: filter 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    user-select: none;
}

.map-node__tower-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 6.875rem;
    height: 8.125rem;
    margin-bottom: 0.15rem;
}

.map-node__tower-wrap--lg {
    width: 8.125rem;
    height: 9.75rem;
}

.map-node__sprite {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 4px 18px var(--tower-glow));
    transition: filter 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    user-select: none;
}

.map-node__base-glow {
    position: absolute;
    left: 50%;
    bottom: 0.1rem;
    transform: translateX(-50%);
    width: 70%;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--tower-glow);
    filter: blur(10px);
    opacity: 0.85;
}

.map-node__hover-ring {
    position: absolute;
    left: 50%;
    bottom: 0.5rem;
    transform: translateX(-50%);
    width: 85%;
    height: 1.25rem;
    border-radius: 50%;
    border: 1px solid var(--tower-ring);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.map-node--available .map-node__card,
.map-node--available .map-node__sprite {
    animation: map-tower-pulse 2.4s ease-in-out infinite;
}

@keyframes map-tower-pulse {
    0%, 100% { filter: drop-shadow(0 4px 14px var(--tower-glow)); }
    50% { filter: drop-shadow(0 6px 28px var(--tower-glow)); }
}

.map-node--locked {
    opacity: 0.72;
    cursor: not-allowed;
}

.map-node--locked .map-node__card,
.map-node--locked .map-node__sprite {
    filter: grayscale(0.35) saturate(0.65) drop-shadow(0 2px 10px rgba(100, 116, 139, 0.5));
}

.map-node__meta {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.1rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 600;
    color: #94a3b8;
    background: rgba(8, 10, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-node--completed .map-node__meta {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.35);
}

.map-node--available .map-node__meta {
    color: var(--qp-cyan);
    border-color: rgba(34, 211, 238, 0.35);
}

.map-guide {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.map-guide.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.map-guide[hidden] {
    display: none;
}

.map-guide.is-open[hidden] {
    display: flex;
}

.map-guide__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(34, 211, 238, 0.12), transparent 55%),
        rgba(3, 5, 18, 0.82);
    backdrop-filter: blur(6px);
}

.map-guide__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 26rem);
    max-height: min(90vh, 640px);
    overflow-y: auto;
    padding: 1.25rem 1.35rem 1.15rem;
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow:
        0 0 40px rgba(34, 211, 238, 0.18),
        0 24px 64px rgba(0, 0, 0, 0.55);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.28s ease;
}

.map-guide.is-open .map-guide__panel {
    transform: translateY(0) scale(1);
}

.map-guide__eyebrow {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--qp-cyan);
    opacity: 0.9;
}

.map-guide__title {
    margin: 0;
    font-size: clamp(1.15rem, 4vw, 1.45rem);
    line-height: 1.15;
}

.map-guide__lead {
    margin: 0.55rem 0 0;
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.45;
}

.map-guide__steps {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.map-guide__step {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.map-guide__step strong {
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.15rem;
}

.map-guide__step p {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
}

.map-guide__step-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 0.95rem;
}

.map-guide__step-icon--play {
    color: var(--qp-cyan);
    background: rgba(34, 211, 238, 0.15);
    border: 1px solid rgba(34, 211, 238, 0.35);
}

.map-guide__step-icon--lock {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.map-guide__step-icon--done {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.map-guide__step-icon--xp {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.map-guide__next {
    margin: 0.85rem 0 0;
    padding: 0.55rem 0.7rem;
    border-radius: 0.65rem;
    font-size: 0.82rem;
    color: #cbd5e1;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.22);
}

.map-guide__next .bi {
    color: var(--qp-cyan);
    margin-right: 0.25rem;
}

.map-guide__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.map-guide__remember {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
    cursor: pointer;
    user-select: none;
}

.map-guide__remember .form-check-input {
    margin: 0;
}

body.map-guide-open {
    overflow: hidden;
}

@container map-stage (max-width: 420px) {
    .map-node {
        width: var(--map-card-size, 3.25rem);
    }
}

@container map-stage (min-width: 900px) {
    .map-node {
        width: var(--map-card-size, 6.75rem);
    }
}

@media (min-width: 1400px) {
    .night-city,
    .night-city__stage {
        min-height: min(94vh, 980px);
    }

    .night-city__stage {
        --map-card-size: 7.5rem;
    }
}

@media (max-width: 991.98px) {
    .night-city,
    .night-city__stage {
        min-height: clamp(600px, 88vh, 920px);
    }

    .night-city__stage {
        --map-card-size: clamp(3.25rem, 10vw, 6rem);
    }

    .night-city__nodes {
        top: 24%;
        right: 8%;
        bottom: 22%;
        left: 8%;
    }

    .night-city__bg {
        object-position: 50% center;
    }

    .night-city__legend {
        left: 0.75rem;
        bottom: 5rem;
        font-size: 0.68rem;
    }

    .night-city__footer {
        bottom: 0.75rem;
    }
}

@media (max-width: 767.98px) {
    .night-city {
        min-height: clamp(640px, 92dvh, 920px);
        border-radius: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .night-city__stage {
        min-height: clamp(640px, 92dvh, 920px);
        --map-card-size: clamp(3rem, 16vw, 4.75rem);
    }

    .night-city__nodes {
        top: 26%;
        right: 6%;
        bottom: 24%;
        left: 6%;
    }

    .night-city__bg {
        object-position: 50% 52%;
    }

    .night-city__hud {
        padding: 0.65rem 0.8rem;
        border-radius: 0.85rem;
    }

    .night-city__hud--tl {
        max-width: min(280px, calc(100% - 5.5rem));
    }

    .night-city__title {
        font-size: clamp(1.1rem, 4.5vw, 1.45rem);
    }

    .night-city__tagline {
        font-size: 0.72rem;
        margin-bottom: 0.65rem;
    }

    .night-city__progress-label,
    .night-city__level {
        font-size: 0.75rem;
    }

    .night-city__hud--tr {
        gap: 0.35rem;
    }

    .night-city__stat {
        padding: 0.32rem 0.55rem;
        font-size: 0.78rem;
    }

    .night-city__icon-btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }

    .night-city__legend {
        display: none;
    }

    .night-city__footer {
        left: 0.75rem;
        right: 0.75rem;
        align-items: stretch;
    }

    .night-city__achievements-btn {
        width: 100%;
        justify-content: center;
    }

    .map-node--pos-1 { left: 14% !important; top: 80% !important; }
    .map-node--pos-2 { left: 30% !important; top: 34% !important; }
    .map-node--pos-3 { left: 50% !important; top: 78% !important; }
    .map-node--pos-4 { left: 72% !important; top: 32% !important; }
    .map-node--pos-5 { left: 90% !important; top: 76% !important; }
}

@media (max-width: 575.98px) {
    main:has(.map-page) {
        padding-top: 0.15rem;
    }

    .map-fullbleed {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .night-city,
    .night-city__stage {
        min-height: clamp(680px, 94dvh, 920px);
        border-radius: 0.65rem;
    }

    .night-city__stage {
        --map-card-size: clamp(2.85rem, 18vw, 4rem);
    }

    .night-city__nodes {
        top: 28%;
        right: 4%;
        bottom: 26%;
        left: 4%;
    }

    .night-city__hud--tl {
        top: 0.5rem;
        left: 0.5rem;
        max-width: calc(100% - 7.5rem);
        padding: 0.55rem 0.65rem;
    }

    .night-city__tagline {
        display: none;
    }

    .night-city__level {
        margin-top: 0.45rem;
        font-size: 0.72rem;
    }

    .night-city__hud--tr {
        top: 0.5rem;
        right: 0.5rem;
    }

    .night-city__stat span {
        display: none;
    }

    .night-city__stat {
        width: 2rem;
        height: 2rem;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .night-city__footer {
        bottom: 0.5rem;
    }

    .night-city__counter {
        text-align: center;
        font-size: 0.72rem;
    }

    .night-city__achievements-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.85rem;
    }

    .map-node--pos-1 { left: 16% !important; top: 82% !important; }
    .map-node--pos-2 { left: 32% !important; top: 30% !important; }
    .map-node--pos-3 { left: 52% !important; top: 80% !important; }
    .map-node--pos-4 { left: 74% !important; top: 28% !important; }
    .map-node--pos-5 { left: 92% !important; top: 78% !important; }
}

@media (max-width: 399.98px) {
    .night-city__stage {
        --map-card-size: clamp(2.5rem, 19vw, 3.5rem);
    }

    .night-city__nodes {
        top: 30%;
        bottom: 28%;
    }

    .night-city__eyebrow {
        font-size: 0.62rem;
    }

    .night-city__title {
        font-size: 1.05rem;
    }

    .night-city__level {
        display: none;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .night-city,
    .night-city__stage {
        min-height: 95vh;
    }

    .night-city__stage {
        --map-card-size: clamp(2.5rem, 14vh, 4rem);
    }

    .night-city__nodes {
        top: 18%;
        right: 12%;
        bottom: 14%;
        left: 12%;
    }

    .night-city__hud--tl {
        max-width: 240px;
        padding: 0.45rem 0.6rem;
    }

    .night-city__tagline,
    .night-city__level {
        display: none;
    }

    .night-city__legend,
    .night-city__footer .night-city__achievements-btn {
        display: none;
    }

    .night-city__footer {
        bottom: 0.35rem;
        right: 0.5rem;
        left: auto;
        align-items: flex-end;
    }

    .map-node--pos-1 { left: 12% !important; top: 72% !important; }
    .map-node--pos-2 { left: 28% !important; top: 28% !important; }
    .map-node--pos-3 { left: 50% !important; top: 70% !important; }
    .map-node--pos-4 { left: 72% !important; top: 26% !important; }
    .map-node--pos-5 { left: 88% !important; top: 68% !important; }
}

@media (hover: none) and (pointer: coarse) {
    a.map-node:hover {
        transform: translate(-50%, var(--map-node-anchor-y, -50%));
    }

    a.map-node:active {
        transform: translate(-50%, calc(var(--map-node-anchor-y, -50%) - 1%)) scale(1.02);
    }
}

.floating-card,
.onboarding-card {
    animation: float 6s ease-in-out infinite;
}

.recording-pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* —— Voice assistant FAB & modal —— */
.voice-fab {
    position: fixed;
    right: 1.15rem;
    bottom: 5.35rem;
    z-index: 1040;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 3.75rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    isolation: isolate;
    transition: transform 0.22s ease;
}

.voice-fab__rings {
    position: absolute;
    top: 0;
    left: 50%;
    width: 3.75rem;
    height: 3.75rem;
    margin-left: -1.875rem;
    border-radius: 50%;
    background: conic-gradient(from 210deg, #00f2ff, #22d3ee, #c026d3, #e879f9, #00f2ff);
    opacity: 0.55;
    animation: voice-fab-spin 8s linear infinite;
    pointer-events: none;
}

.voice-fab__rings::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--qp-bg);
}

.voice-fab__icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #00e5ff 0%, #22d3ee 42%, #a855f7 100%);
    font-size: 1.4rem;
    line-height: 1;
    box-shadow:
        0 0 24px rgba(0, 242, 255, 0.55),
        0 0 48px rgba(168, 85, 247, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 6px 20px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.25s ease, transform 0.22s ease;
}

.voice-fab__icon i {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.voice-fab__badge {
    position: relative;
    z-index: 1;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ecfeff;
    background: rgba(8, 12, 28, 0.88);
    border: 1px solid rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.25);
}

.voice-fab:hover .voice-fab__icon,
.voice-fab:focus-visible .voice-fab__icon {
    transform: scale(1.06);
    box-shadow:
        0 0 32px rgba(0, 242, 255, 0.75),
        0 0 56px rgba(244, 114, 182, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.45);
}

.voice-fab:focus-visible {
    outline: none;
}

.voice-fab:focus-visible .voice-fab__icon {
    outline: 2px solid rgba(0, 242, 255, 0.9);
    outline-offset: 3px;
}

.voice-fab:active .voice-fab__icon {
    transform: scale(0.98);
}

.voice-fab.recording-pulse .voice-fab__icon {
    animation: voice-fab-pulse 1.1s ease-in-out infinite;
}

.voice-fab.recording-pulse .voice-fab__rings {
    opacity: 0.9;
    animation-duration: 2.5s;
}

@keyframes voice-fab-spin {
    to { transform: rotate(360deg); }
}

@keyframes voice-fab-pulse {
    0%, 100% {
        box-shadow:
            0 0 22px rgba(0, 242, 255, 0.6),
            0 0 44px rgba(0, 229, 255, 0.28);
    }

    50% {
        box-shadow:
            0 0 38px rgba(0, 242, 255, 0.95),
            0 0 64px rgba(244, 114, 182, 0.55);
    }
}

@media (min-width: 992px) {
    .voice-fab {
        right: 1.5rem;
        bottom: 2rem;
        width: 4rem;
    }

    .voice-fab__rings,
    .voice-fab__icon {
        width: 4rem;
        height: 4rem;
    }

    .voice-fab__rings {
        margin-left: -2rem;
    }

    .voice-fab__icon {
        font-size: 1.5rem;
    }
}

.voice-modal {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.75rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.voice-modal.active {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.voice-modal.active .voice-modal__panel {
    transform: translateY(0) scale(1);
}

.voice-modal.active .voice-modal__orb-ring {
    animation-play-state: running;
}

.voice-modal.active .voice-modal__wave span {
    animation-play-state: running;
}

.voice-modal__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% 100%, rgba(34, 211, 238, 0.12), transparent 55%),
        rgba(4, 8, 18, 0.78);
    backdrop-filter: blur(8px);
}

.voice-modal__panel {
    position: relative;
    width: min(100%, 22.5rem);
    padding: 1.25rem 1.25rem 1.1rem;
    border-radius: 1.35rem 1.35rem 1rem 1rem;
    border: 1px solid rgba(34, 211, 238, 0.32);
    background:
        linear-gradient(165deg, rgba(12, 18, 38, 0.97) 0%, rgba(22, 14, 42, 0.96) 55%, rgba(10, 14, 32, 0.98) 100%);
    box-shadow:
        0 -8px 40px rgba(34, 211, 238, 0.12),
        0 24px 48px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
    transform: translateY(1.25rem) scale(0.96);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.voice-modal__glow {
    position: absolute;
    inset: -40% -20%;
    background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, 0.22), transparent 50%),
        radial-gradient(circle at 80% 60%, rgba(236, 72, 153, 0.18), transparent 45%);
    z-index: 0;
    pointer-events: none;
}

.voice-modal__shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.7), rgba(244, 114, 182, 0.5), transparent);
    z-index: 1;
    pointer-events: none;
}

.voice-modal__header,
.voice-modal__orb-wrap,
.voice-modal__body,
.voice-modal__footer {
    position: relative;
    z-index: 2;
}

.voice-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.voice-modal__brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.voice-modal__avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.85rem;
    font-size: 1.1rem;
    color: #ecfeff;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(168, 85, 247, 0.3));
    border: 1px solid rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.voice-modal__brand-text {
    min-width: 0;
}

.voice-modal__eyebrow {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(244, 114, 182, 0.9);
}

.voice-modal__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    color: #f0fdfa;
}

.voice-modal__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.voice-modal__close:hover,
.voice-modal__close:focus-visible {
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.35);
    color: #fff;
}

.voice-modal__orb-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.9rem;
}

.voice-modal__orb {
    position: relative;
    width: 5.5rem;
    height: 5.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-modal__orb-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.35);
    animation: voice-orb-pulse 2.4s ease-out infinite;
    animation-play-state: paused;
}

.voice-modal__orb-ring--delay {
    animation-delay: 1.2s;
}

.voice-modal__orb-core {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.75rem;
    height: 3.75rem;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.35), rgba(168, 85, 247, 0.45));
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 0 28px rgba(34, 211, 238, 0.35),
        inset 0 0 24px rgba(34, 211, 238, 0.15);
}

.voice-modal__orb-icon {
    font-size: 1.65rem;
    color: #ecfeff;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.6));
}

.voice-modal__wave {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.28rem;
    height: 1.1rem;
    margin-top: 0.35rem;
}

.voice-modal__wave span {
    display: block;
    width: 0.22rem;
    height: 0.35rem;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--qp-cyan), var(--qp-magenta));
    opacity: 0.65;
    animation: voice-wave 1.1s ease-in-out infinite;
    animation-play-state: paused;
}

.voice-modal__wave span:nth-child(1) { animation-delay: 0s; }
.voice-modal__wave span:nth-child(2) { animation-delay: 0.12s; }
.voice-modal__wave span:nth-child(3) { animation-delay: 0.24s; }
.voice-modal__wave span:nth-child(4) { animation-delay: 0.12s; }
.voice-modal__wave span:nth-child(5) { animation-delay: 0s; }

@keyframes voice-orb-pulse {
    0% {
        transform: scale(0.85);
        opacity: 0.85;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@keyframes voice-wave {
    0%, 100% { height: 0.35rem; opacity: 0.45; }
    50% { height: 1rem; opacity: 1; }
}

.voice-modal__body {
    margin-bottom: 0.85rem;
}

.voice-modal__text {
    margin: 0;
    padding: 0.85rem 1rem;
    border-radius: 0.85rem;
    font-size: 0.95rem;
    line-height: 1.55;
    min-height: 3.25rem;
    color: #cffafe;
    background: rgba(6, 12, 28, 0.65);
    border: 1px solid rgba(34, 211, 238, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.voice-modal__text.is-error {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(40, 12, 18, 0.55);
}

.voice-modal__typing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: rgba(244, 114, 182, 0.95);
}

.voice-modal__typing-dots {
    display: inline-flex;
    gap: 0.2rem;
}

.voice-modal__typing-dots span {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: var(--qp-magenta);
    animation: voice-typing-dot 1.2s ease-in-out infinite;
}

.voice-modal__typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.voice-modal__typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes voice-typing-dot {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.voice-modal__footer {
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.voice-modal__hint-label {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.9);
}

.voice-modal__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.voice-modal__chips li {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(34, 211, 238, 0.2);
    white-space: nowrap;
}

.voice-modal__chips li i {
    font-size: 0.7rem;
    color: var(--qp-cyan);
    opacity: 0.9;
}

@media (min-width: 576px) {
    .voice-modal {
        align-items: center;
        padding: 1rem;
    }

    .voice-modal__panel {
        width: min(100%, 24rem);
        padding: 1.35rem 1.35rem 1.15rem;
        border-radius: 1.25rem;
        transform: translateY(0.75rem) scale(0.94);
    }

    .voice-modal.active .voice-modal__panel {
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.5); }
    50% { box-shadow: 0 0 0 12px rgba(34, 211, 238, 0); }
}

.word-card.glitch,
[data-word-card].glitch {
    animation: glitch 0.35s linear 2;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); filter: hue-rotate(20deg); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, 2px); filter: hue-rotate(-20deg); }
    100% { transform: translate(0); }
}

.qp-progress {
    height: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
}

.qp-progress .progress-bar {
    background: linear-gradient(90deg, var(--qp-cyan), var(--qp-magenta));
}

.achievement-card.locked {
    opacity: 0.45;
}

.achievement-card.unlocked {
    border-color: rgba(34, 211, 238, 0.55);
}

.qp-alert {
    border: 0;
    background: rgba(255, 255, 255, 0.08);
}

.qp-footer {
    color: rgba(248, 250, 252, 0.7);
}

.wave-canvas {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.75rem;
}

.word-of-day {
    border-color: rgba(34, 211, 238, 0.35);
}

.phrase-kz {
    font-size: 1.1rem;
    font-weight: 700;
}

/* —— Dictionary neon hover (cyan tube glow) —— */
.dictionary-shell {
    --dict-neon: #00eeff;
    --dict-neon-soft: rgba(0, 238, 255, 0.72);
    --dict-neon-glow: rgba(0, 238, 255, 0.48);
}

.dictionary-word-card,
.dictionary-due-card,
.dictionary-translator {
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

.dictionary-result {
    border-radius: 0.75rem;
    margin-inline: -0.35rem;
    padding-inline: 0.35rem;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

@media (hover: hover) {
    .dictionary-word-card:hover,
    .dictionary-due-card:hover,
    .dictionary-translator:hover {
        border-color: var(--dict-neon);
        background: rgba(8, 14, 28, 0.95);
        box-shadow:
            0 0 0 1px var(--dict-neon),
            0 0 14px var(--dict-neon-soft),
            0 0 28px var(--dict-neon-glow),
            0 0 48px rgba(0, 238, 255, 0.32),
            0 0 64px rgba(0, 238, 255, 0.18);
    }

    .dictionary-word-card:hover {
        animation-play-state: paused;
    }

    .dictionary-word-card:hover .neon-text,
    .dictionary-due-card:hover strong {
        color: var(--dict-neon);
        text-shadow:
            0 0 12px var(--dict-neon),
            0 0 26px rgba(0, 238, 255, 0.95),
            0 0 42px rgba(0, 238, 255, 0.55);
    }

    .dictionary-result:hover {
        background: rgba(0, 238, 255, 0.08);
        box-shadow:
            0 0 0 1px rgba(0, 238, 255, 0.5),
            0 0 18px rgba(0, 238, 255, 0.35),
            0 0 32px rgba(0, 238, 255, 0.2),
            inset 0 0 24px rgba(0, 238, 255, 0.08);
    }

    .dictionary-result:hover strong {
        color: var(--dict-neon);
        text-shadow:
            0 0 12px var(--dict-neon),
            0 0 26px rgba(0, 238, 255, 0.9);
    }
}

.forum-topic-card:hover {
    border-color: rgba(34, 211, 238, 0.55);
    transform: translateX(4px);
}

.video-section .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 0.75rem;
}

.video-section iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.course-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: rgba(34, 211, 238, 0.12);
    color: var(--qp-neon);
    font-size: 1.25rem;
}

.course-progress {
    height: 0.45rem;
    background: rgba(255, 255, 255, 0.08);
}

.course-card:hover {
    border-color: rgba(34, 211, 238, 0.45);
    transform: translateY(-2px);
}

.course-lesson-row.is-locked {
    opacity: 0.7;
}

.course-lesson-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.15);
    color: var(--qp-neon);
    font-weight: 600;
    font-size: 0.9rem;
}

.video-lesson-card.is-locked {
    opacity: 0.65;
}

.video-lesson-card:hover:not(.is-locked) {
    border-color: rgba(34, 211, 238, 0.55);
    transform: translateY(-2px);
}

.qp-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0.25rem;
    padding: 0.5rem;
    background: rgba(10, 10, 26, 0.95);
    border-top: 1px solid var(--qp-border);
    backdrop-filter: blur(12px);
}

.qp-bottom-link {
    color: #cbd5e1;
    text-decoration: none;
    text-align: center;
    font-size: 0.7rem;
}

.qp-bottom-link:hover,
.qp-bottom-link:focus {
    color: #fff;
}

.qp-bottom-link.is-active {
    color: var(--qp-cyan);
}

.qp-bottom-link i {
    display: block;
    font-size: 1rem;
}

@media (max-width: 991.98px) {
    body.qp-body {
        padding-bottom: 4.5rem;
    }
}

/* Leaderboard */
.leaderboard-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.leaderboard-hero__you {
    min-width: min(100%, 260px);
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.12);
}

.leaderboard-panel {
    overflow: hidden;
}

.leaderboard-board__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.leaderboard-board__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.leaderboard-board__count {
    font-size: 0.8rem;
    color: #94a3b8;
    white-space: nowrap;
}

.leaderboard-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
}

.leaderboard-empty .bi {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.leaderboard-podium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
}

.leaderboard-podium__slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
}

.leaderboard-podium__slot--1 {
    order: 2;
}

.leaderboard-podium__slot--2 {
    order: 1;
}

.leaderboard-podium__slot--3 {
    order: 3;
}

.leaderboard-podium__pedestal {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.leaderboard-podium__medal {
    position: absolute;
    top: -0.35rem;
    z-index: 2;
    font-size: 1.1rem;
}

.lb-medal-gold { color: #fbbf24; filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6)); }
.lb-medal-silver { color: #cbd5e1; }
.lb-medal-bronze { color: #d97706; }

.leaderboard-podium__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--qp-cyan), var(--qp-magenta));
    color: #0a0a1a;
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.35);
}

.leaderboard-podium__slot--1 .leaderboard-podium__avatar {
    width: 4rem;
    height: 4rem;
    font-size: 1.5rem;
}

.leaderboard-podium__place {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.65rem 0.35rem 0.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
    font-weight: 800;
    font-size: 1.25rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--qp-border);
    border-bottom: none;
}

.leaderboard-podium__slot--1 .leaderboard-podium__place {
    padding-top: 1.35rem;
    padding-bottom: 0.85rem;
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.2), rgba(255, 255, 255, 0.04));
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 -8px 24px rgba(251, 191, 36, 0.15);
}

.leaderboard-podium__slot--2 .leaderboard-podium__place {
    padding-top: 0.85rem;
}

.leaderboard-podium__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}

.leaderboard-podium__name {
    font-size: 0.9rem;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-podium__xp {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
}

.leaderboard-podium__xp .bi {
    font-size: 0.7rem;
}

.leaderboard-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--qp-cyan), var(--qp-magenta));
    color: #0a0a1a;
}

.leaderboard-you-badge {
    display: inline-flex;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(34, 211, 238, 0.2);
    border: 1px solid rgba(34, 211, 238, 0.45);
    color: var(--qp-cyan);
}

.leaderboard-streak {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fb923c;
}

.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 0.65rem 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(34, 211, 238, 0.2);
}

.leaderboard-row.is-you {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.35);
    box-shadow: 0 0 16px rgba(34, 211, 238, 0.1);
}

.leaderboard-row--top .leaderboard-row__rank {
    color: #fbbf24;
    font-weight: 800;
}

.leaderboard-row__rank {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 700;
    color: #94a3b8;
    font-size: 0.9rem;
}

.leaderboard-row__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--qp-border);
    flex-shrink: 0;
}

.leaderboard-row__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    min-width: 0;
}

.leaderboard-row__name {
    font-size: 0.9rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-row__bar {
    height: 0.35rem;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.leaderboard-row__bar-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--qp-cyan), var(--qp-magenta));
    transition: width 0.4s ease;
}

.leaderboard-row__stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
}

.leaderboard-row__xp {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
}

.leaderboard-row__xp .bi {
    font-size: 0.7rem;
}

.leaderboard-board--compact .leaderboard-board__head {
    margin-bottom: 1rem;
}

.leaderboard-board--compact .leaderboard-board__title {
    font-size: 1rem;
}

.leaderboard-list--compact {
    gap: 0.4rem;
}

.leaderboard-board--compact .leaderboard-row {
    padding: 0.55rem 0.65rem;
}

.leaderboard-podium__slot.is-you .leaderboard-podium__avatar,
.leaderboard-row.is-you .leaderboard-row__avatar {
    border-color: var(--qp-cyan);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}

/* Lesson practice (immersive screen) */
.lesson-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #0b0e1e;
    color: #f8fafc;
}

.lesson-body .qp-navbar {
    position: relative;
    z-index: 2;
}

.lesson-body__grid {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 100% 3px;
    opacity: 0.35;
    z-index: 0;
}

.lesson-body__main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 4.25rem);
    max-width: 440px;
    margin: 0 auto;
    padding: 1rem 1rem 1.5rem;
}

.lesson-focus {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-height: 0;
}

.lesson-focus__header {
    display: grid;
    grid-template-columns: 2.75rem 1fr auto;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.lesson-focus__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    background: #00e5ff;
    color: #0b0e1e;
    font-size: 1.15rem;
    text-decoration: none;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.4);
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.lesson-focus__back:hover,
.lesson-focus__back:focus {
    color: #0b0e1e;
    filter: brightness(1.08);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.55);
}

.lesson-focus__heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.lesson-focus__title {
    margin: 0;
    font-size: clamp(0.95rem, 3.5vw, 1.05rem);
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.lesson-focus__difficulty {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(0, 229, 255, 0.95);
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.35);
}

.lesson-focus__difficulty-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.62);
    text-align: center;
}

.lesson-focus__step {
    font-size: 1rem;
    font-weight: 700;
    color: #00e5ff;
    white-space: nowrap;
}

.lesson-focus__video-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    align-self: center;
    margin: -0.5rem 0 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #00e5ff;
    text-decoration: none;
}

.lesson-focus__video-link:hover {
    color: #fff;
}

.lesson-focus__card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1.35rem 1.35rem;
    margin-bottom: auto;
    border-radius: 1.35rem;
    background: linear-gradient(180deg, rgba(12, 16, 42, 0.98) 0%, rgba(6, 8, 28, 0.99) 100%);
    border: 1px solid rgba(0, 229, 255, 0.42);
    box-shadow:
        0 0 36px rgba(0, 229, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.lesson-focus__card.is-recording {
    border-color: rgba(0, 229, 255, 0.72);
    box-shadow: 0 0 44px rgba(0, 229, 255, 0.2);
}

.lesson-focus__card.is-perfect {
    border-color: rgba(74, 222, 128, 0.55);
}

.lesson-focus__wave-wrap {
    width: 100%;
    margin-bottom: 1.25rem;
}

.lesson-focus__wave {
    display: block;
    width: 100%;
    height: 88px;
}

.lesson-focus__word {
    margin: 0 0 0.5rem;
    font-size: clamp(2.5rem, 11vw, 3.25rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #00e5ff;
    background: linear-gradient(90deg, #00e5ff 0%, #c000ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .lesson-focus__word {
        color: transparent;
    }
}

.lesson-focus__translation {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #94a3b8;
}

.lesson-focus__transcription {
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    color: #64748b;
    font-style: normal;
}

.lesson-focus__record-hint {
    margin: -0.75rem 0 1rem;
    padding: 0.55rem 0.75rem;
    width: 100%;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    color: #94a3b8;
    background: rgba(192, 0, 255, 0.12);
    border: 1px solid rgba(192, 0, 255, 0.28);
}

.lesson-focus__record-hint strong {
    color: #00e5ff;
    font-weight: 700;
}

.lesson-focus__actions,
.lesson-focus__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    width: 100%;
}

.lesson-focus__actions {
    margin-bottom: 0.65rem;
}

.lesson-focus__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.lesson-focus__btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lesson-focus__btn--listen,
.lesson-focus__btn--prev {
    background: transparent;
    border: 2px solid rgba(0, 229, 255, 0.55);
    color: #00e5ff;
}

.lesson-focus__btn--listen:hover:not(:disabled),
.lesson-focus__btn--prev:hover:not(:disabled) {
    background: rgba(0, 229, 255, 0.08);
    color: #fff;
}

.lesson-focus__btn--record {
    background: #c000ff;
    color: #fff;
    box-shadow: 0 4px 22px rgba(192, 0, 255, 0.4);
}

.lesson-focus__btn--record:hover {
    filter: brightness(1.1);
}

.lesson-focus__btn--next {
    background: #00e5ff;
    color: #fff;
    box-shadow:
        0 0 0 1px rgba(0, 229, 255, 0.35),
        0 0 28px rgba(0, 229, 255, 0.55);
}

.lesson-focus__btn--next:hover {
    filter: brightness(1.06);
    box-shadow:
        0 0 0 1px rgba(0, 229, 255, 0.45),
        0 0 36px rgba(0, 229, 255, 0.65);
}

.lesson-focus__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-top: 1.5rem;
    padding-top: 0.5rem;
}

.lesson-focus__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1rem 0.75rem;
    border-radius: 1rem;
    background: rgba(4, 6, 20, 0.85);
    border: 1px solid rgba(0, 229, 255, 0.12);
}

.lesson-focus__stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #00e5ff;
    margin-bottom: 0.15rem;
}

.lesson-focus__stat-icon--xp .bi {
    filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.5));
}

.lesson-focus__stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.lesson-focus__stat-label {
    font-size: 0.8rem;
    color: #94a3b8;
}

.lesson-focus__empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

[x-cloak] {
    display: none !important;
}

@media (max-width: 575.98px) {
    .lesson-body__main {
        padding: 1rem 0.85rem 1.25rem;
    }

    .lesson-focus__header {
        grid-template-columns: 2.5rem 1fr auto;
    }

    .lesson-focus__back {
        width: 2.5rem;
        height: 2.5rem;
    }

    .lesson-focus__card {
        padding: 1.25rem 1rem 1.1rem;
    }

    .lesson-focus__btn {
        font-size: 0.82rem;
        padding: 0.65rem 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .leaderboard-podium__name {
        font-size: 0.8rem;
    }

    .leaderboard-row {
        grid-template-columns: auto auto 1fr;
        grid-template-rows: auto auto;
    }

    .leaderboard-row__stats {
        grid-column: 2 / -1;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0.75rem;
        padding-left: calc(1.5rem + 0.75rem);
    }
}

.profile-telegram {
    border-color: rgba(34, 211, 238, 0.2);
}

.profile-telegram__title {
    color: #fff;
    font-weight: 600;
}

.profile-telegram__title .bi-telegram {
    color: var(--qp-cyan);
    margin-right: 0.35rem;
}

.profile-telegram__code {
    font-size: 1.35rem;
    letter-spacing: 0.12em;
}

.profile-telegram__regen {
    color: var(--qp-cyan);
    border: 1px solid rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.08);
}

.profile-telegram__regen:hover,
.profile-telegram__regen:focus {
    color: #fff;
    background: rgba(34, 211, 238, 0.2);
    border-color: var(--qp-cyan);
}

.profile-telegram__bot-link {
    color: var(--qp-cyan);
    text-decoration: none;
    font-weight: 500;
}

.profile-telegram__bot-link:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--qp-cyan);
}

/* —— Home page —— */
main:has(.home-page) {
    max-width: 100%;
    padding-top: 0.5rem;
    overflow-x: clip;
}

main:has(.home-page) > .word-of-day {
    display: none;
}

.home-page {
    padding-bottom: 1rem;
}

.home-hero {
    position: relative;
    min-height: clamp(420px, 72vh, 640px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    border-radius: 0 0 1.5rem 1.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--qp-border);
}

.home-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

.home-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 10, 26, 0.35) 0%, rgba(10, 10, 26, 0.92) 72%, var(--qp-bg) 100%),
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(34, 211, 238, 0.12), transparent 60%);
}

.home-hero__glow {
    position: absolute;
    bottom: -20%;
    left: 50%;
    width: min(90vw, 720px);
    height: 45%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse, rgba(244, 114, 182, 0.25), transparent 70%);
    pointer-events: none;
}

.home-hero__scanlines {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.04) 2px,
        rgba(255, 255, 255, 0.04) 4px
    );
    pointer-events: none;
}

.home-hero__content {
    position: relative;
    z-index: 2;
    padding: 2.5rem 1rem 2.75rem;
    text-align: center;
    max-width: 720px;
}

.home-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #cbd5e1;
    background: rgba(10, 10, 26, 0.55);
    border: 1px solid rgba(34, 211, 238, 0.2);
    backdrop-filter: blur(8px);
}

.home-hero__dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--qp-cyan);
    box-shadow: 0 0 10px var(--qp-cyan);
    animation: home-pulse 2s ease-in-out infinite;
}

@keyframes home-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.home-hero__title {
    font-size: clamp(2.75rem, 8vw, 4.25rem);
    font-weight: 800;
    line-height: 1.05;
    margin: 0 0 0.35rem;
}

.home-hero__tagline {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 600;
    color: var(--qp-cyan);
    margin: 0 0 1rem;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.35);
}

.home-hero__lead {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin: 0 auto 1.5rem;
    max-width: 36rem;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.home-hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.home-hero__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    color: #94a3b8;
}

.home-hero__stats li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.home-hero__stats .bi {
    color: var(--qp-cyan);
}

.home-section__head {
    margin-bottom: 1.5rem;
}

.home-section__title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.home-section__lead {
    font-size: 0.95rem;
}

.home-quick {
    margin-bottom: 2.5rem;
}

.home-quick__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
}

.home-quick__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 1rem;
    text-decoration: none;
    color: #f8fafc;
    background: var(--qp-card);
    border: 1px solid var(--qp-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-quick__card:hover,
.home-quick__card:focus {
    color: #fff;
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 8px 28px rgba(34, 211, 238, 0.15);
}

.home-quick__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    font-size: 1.15rem;
}

.home-quick__card--map .home-quick__icon { background: rgba(34, 211, 238, 0.15); color: var(--qp-cyan); }
.home-quick__card--courses .home-quick__icon { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.home-quick__card--phrase .home-quick__icon { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.home-quick__card--dict .home-quick__icon { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.home-quick__card--game .home-quick__icon { background: rgba(244, 114, 182, 0.15); color: var(--qp-magenta); }
.home-quick__card--kids .home-quick__icon { background: rgba(251, 146, 60, 0.15); color: #fb923c; }

.home-quick__label {
    font-size: 0.8rem;
    font-weight: 600;
}

.home-features {
    margin-bottom: 2.5rem;
}

.home-features__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.home-feature {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(34, 211, 238, 0.12);
}

.home-feature__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.home-feature--audio .home-feature__icon-wrap {
    background: rgba(34, 211, 238, 0.12);
    color: var(--qp-cyan);
}

.home-feature--map .home-feature__icon-wrap {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.home-feature--bot .home-feature__icon-wrap {
    background: rgba(244, 114, 182, 0.12);
    color: var(--qp-magenta);
}

.home-feature__title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
}

.home-feature__text {
    font-size: 0.925rem;
    line-height: 1.55;
    color: #94a3b8;
    margin: 0;
    flex: 1;
}

.home-feature__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--qp-cyan);
    text-decoration: none;
}

.home-feature__link:hover {
    color: #fff;
}

.home-cta {
    margin-bottom: 2.5rem;
}

.home-cta__card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    border-color: rgba(244, 114, 182, 0.3);
    background: linear-gradient(135deg, rgba(16, 18, 40, 0.95), rgba(34, 211, 238, 0.06));
}

.home-cta__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.home-cta__text {
    font-size: 0.95rem;
    max-width: 32rem;
}

.home-leaderboard-wrap .leaderboard-widget {
    margin-top: 0;
}

@media (max-width: 991.98px) {
    .home-quick__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-features__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .home-hero {
        min-height: 380px;
        border-radius: 0 0 1rem 1rem;
        margin-bottom: 2rem;
    }

    .home-hero__content {
        padding: 1.75rem 0.75rem 2rem;
    }

    .home-hero__actions .btn-lg {
        width: 100%;
        justify-content: center;
    }

    .home-cta__card {
        padding: 1.25rem;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .home-cta__card .btn {
        width: 100%;
    }
}

.phrase-text .phrase-kz,
.phrase-text .phrase-ru,
.phrase-text .phrase-transcription {
    white-space: pre-line;
}
