/* ============================================================
   ASH'S STUDY TRACKER — ULTRA PREMIUM EDITION
   Glassmorphism · 3D Flowers · Elegant Fonts
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --glass: rgba(255, 255, 255, 0.055);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.38);
    --purple: #a78bfa;
    --purple-light: #c4b5fd;
    --pink: #fb7185;
    --blue: #7dd3fc;
    --gold: #fbbf24;
    --green: #4ade80;
    --lime: #d9f99d;
    --radius: 22px;
    --font-serif: 'Syne', 'Playfair Display', serif;
    --font-sans: 'Outfit', 'Space Grotesk', sans-serif;
    --primary-dark: #6d28d9;
}

body {
    font-family: var(--font-sans);
    background: #070712;
    color: var(--text);
    min-height: 100vh;
    padding: 16px;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ========== ANIMATED BACKGROUND ========== */
.bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: orbFloat 20s ease-in-out infinite alternate;
}

.orb1 {
    width: 600px;
    height: 600px;
    background: var(--purple);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb2 {
    width: 500px;
    height: 500px;
    background: var(--pink);
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.orb3 {
    width: 400px;
    height: 400px;
    background: var(--blue);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.08;
}

.orb4 {
    width: 300px;
    height: 300px;
    background: var(--gold);
    top: 20%;
    right: 20%;
    animation-delay: -21s;
    opacity: 0.06;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(60px, -80px) scale(1.15);
    }

    100% {
        transform: translate(-50px, 60px) scale(0.85);
    }
}

/* ========== PARTICLES ========== */
#floatingParticles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.float-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

.float-particle:nth-child(odd) {
    width: 4px;
    height: 4px;
    background: rgba(139, 92, 246, 0.1);
}

.float-particle:nth-child(3n) {
    width: 2px;
    height: 2px;
    background: rgba(236, 72, 153, 0.08);
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-10vh) scale(0);
        opacity: 0;
    }
}

/* ========== HEADER ========== */
header {
    text-align: center;
    padding: 20px 0 16px 0;
    position: relative;
    z-index: 1;
}

.header-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 120px;
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

h1 {
    font-family: var(--font-serif);
    font-weight: 800;
    font-size: 2.35rem;
    letter-spacing: -1px;
    background: linear-gradient(120deg, #fff 10%, var(--lime) 40%, var(--pink) 75%, var(--purple-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.kicker {
    font-size: 0.68rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--lime);
    font-weight: 600;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 300;
    letter-spacing: 0.2px;
    margin-top: 4px;
}

/* ========== GLASS CARD ========== */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--glass-shadow);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 50px rgba(139, 92, 246, 0.06);
}

.card-icon {
    font-size: 1.1rem;
    margin-bottom: 1px;
}

.card-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ========== NAVIGATION ========== */
nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px;
    background: rgba(12, 10, 24, 0.72);
    backdrop-filter: blur(28px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    margin-bottom: 22px;
    position: sticky;
    top: 10px;
    z-index: 100;
    justify-content: flex-start;
    box-shadow: var(--glass-shadow);
    overflow-x: auto;
    scrollbar-width: none;
}

nav::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 10px;
    border-radius: 14px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 58px;
    flex-shrink: 0;
}

.nav-label {
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 600;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: linear-gradient(180deg, rgba(217, 249, 157, 0.18), rgba(167, 139, 250, 0.22));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(217, 249, 157, 0.25);
}

/* ========== PAGES ========== */
.page {
    display: none;
    animation: fadeUp 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.page.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.page-title {
    font-family: var(--font-serif);
    font-weight: 600;
    font-size: 1.6rem;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #fff, var(--purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========== HOME GRID ========== */
.home-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== COUNTDOWN CARD ========== */
.countdown-card {
    cursor: pointer;
}

.countdown-card:hover {
    border-color: rgba(255, 215, 150, 0.15);
}

.countdown-number {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 600;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--pink), var(--purple-light), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.countdown-target {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 300;
    margin-top: 2px;
}

.phase-pill {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 8px;
    align-self: flex-start;
    color: #fff;
    text-transform: uppercase;
}

.click-hint {
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 6px;
    animation: pulseHint 2s ease-in-out infinite;
}

@keyframes pulseHint {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* ========== PHASE POPUP ========== */
.phase-popup {
    background: rgba(18, 16, 28, 0.92) !important;
    backdrop-filter: blur(40px) !important;
}

.phase-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.3s ease;
}

.phase-item:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.phase-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.phase-1 .phase-dot {
    background: #8b5cf6;
}

.phase-2 .phase-dot {
    background: #ec4899;
}

.phase-3 .phase-dot {
    background: #f59e0b;
}

.phase-4 .phase-dot {
    background: #34d399;
}

.phase-5 .phase-dot {
    background: #ef4444;
}

.phase-info {
    display: flex;
    flex-direction: column;
}

.phase-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.phase-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ========== PROGRESS ========== */
.progress-numbers {
    display: flex;
    justify-content: space-between;
    margin: 6px 0 10px 0;
}

.progress-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.progress-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.progress-value {
    font-weight: 600;
    font-size: 1.05rem;
}

.progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple), var(--pink));
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.progress-day {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* ========== STREAK ========== */
.streak-number {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 600;
    color: var(--pink);
    line-height: 1;
    text-shadow: 0 0 40px rgba(236, 72, 153, 0.15);
}

.streak-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 2px;
    font-weight: 300;
}

/* ========== MISSION CARD ========== */
.mission-card {
    min-height: 180px;
}

.mission-card #missionPreview {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 60px;
}

.mission-card #missionPreview p {
    margin: 0;
    line-height: 1.4;
}

/* ========== GLASS BUTTON ========== */
.glass-btn {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 8px 20px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    font-size: 0.8rem;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: scale(1.01);
}

.glass-btn.primary-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.05));
    border-color: rgba(139, 92, 246, 0.12);
}

.glass-btn.primary-btn:hover {
    background: rgba(139, 92, 246, 0.15);
}

.glass-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========== MISSION BLOCKS ========== */
.mission-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mission-block {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
}

.mission-block.completed {
    opacity: 0.35;
    border-color: rgba(52, 211, 153, 0.1);
}

.mission-block .m-icon {
    font-size: 1.6rem;
}

.mission-block .m-info {
    flex: 1;
}

.mission-block .m-info h4 {
    font-weight: 500;
    font-size: 0.85rem;
}

.mission-block .m-info p {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 1px;
}

.mission-block .m-status {
    font-size: 0.65rem;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.mission-block .m-status.done {
    background: rgba(52, 211, 153, 0.08);
    color: var(--green);
}

.btn-start-block {
    background: var(--purple);
    border: none;
    color: #fff;
    padding: 6px 16px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    font-size: 0.75rem;
}

.btn-start-block:hover {
    background: var(--purple-light);
    transform: scale(1.02);
}

/* ========== TIMER ========== */
.timer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.timer-card {
    text-align: center;
    padding: 20px;
}

.timer-card .t-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.timer-card .t-display {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 600;
    margin: 4px 0;
    color: #fff;
}

.timer-card .t-subject {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-bottom: 10px;
}

.timer-controls {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.timer-controls button {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    font-size: 0.65rem;
}

.timer-controls button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.timer-controls .primary {
    background: var(--purple);
    border-color: var(--purple);
}

.timer-controls .primary:hover {
    background: var(--purple-light);
}

.timer-controls .danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.timer-controls .danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.timer-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========== TEST ========== */
.test-q {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 12px;
}

.test-q .q-text {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.test-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.test-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.test-options label:hover {
    background: rgba(255, 255, 255, 0.04);
}

.test-options input[type="radio"] {
    accent-color: var(--purple);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.test-options label.selected {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.05);
}

.test-submit {
    background: var(--purple);
    border: none;
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
    width: 100%;
    margin-top: 10px;
}

.test-submit:hover {
    background: var(--purple-light);
}

.test-result-detail {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 10px;
}

.test-result-detail.correct {
    border-left: 3px solid var(--green);
}

.test-result-detail.wrong {
    border-left: 3px solid #ef4444;
}

.test-result-detail .q-result {
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.test-result-detail .q-answer {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.test-result-detail .q-explanation {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== CELEBRATION ========== */
#celebrationOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(24px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}

#celebrationOverlay.active {
    display: flex;
}

.celebration-modal {
    background: var(--glass);
    backdrop-filter: blur(40px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 40px 50px;
    text-align: center;
    max-width: 400px;
    position: relative;
    z-index: 2;
    animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from {
        transform: scale(0.8) rotate(-2deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebration-icon {
    font-size: 4rem;
    margin-bottom: 8px;
}

.celebration-modal h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 4px;
    background: linear-gradient(135deg, var(--gold), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.celebration-modal p {
    color: var(--text-secondary);
    margin-bottom: 18px;
}

#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#chapterCelebration {
    display: none;
}

#chapterCelebration.active {
    display: flex;
}

/* ========== SETTINGS ========== */
.setting-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.setting-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.setting-group input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    transition: all 0.3s ease;
}

.setting-group input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.06);
}

/* ========== SYLLABUS ========== */
.syllabus-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin-bottom: 6px;
    border-left: 2px solid var(--purple);
    transition: all 0.3s ease;
}

.syllabus-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.syllabus-item.done {
    opacity: 0.35;
    border-left-color: var(--green);
}

.syllabus-item .s-status {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* ========== WEAKNESS ========== */
.weakness-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin-bottom: 6px;
}

.weakness-item .w-score {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ========== ANALYTICS ========== */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.analytics-item {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
}

.analytics-item .a-num {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--purple-light), var(--pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.analytics-item .a-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========== MOCK ========== */
.mock-question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 100px;
    overflow-y: auto;
    padding: 12px;
}

.mock-question-nav button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.6rem;
    transition: all 0.3s ease;
}

.mock-question-nav button.attempted {
    border-color: var(--green);
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
}

.mock-question-nav button.current {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.2);
    color: #fff;
}

.mock-question-nav button:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mock-pause-btn {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.2);
    color: var(--gold);
}

.mock-pause-btn:hover {
    background: rgba(251, 191, 36, 0.25);
}

/* ========== NOTES ========== */
.notes-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s ease;
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.06);
}

/* ========== MISTAKES ========== */
.mistake-item {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 10px;
    border-left: 3px solid #ef4444;
}

.mistake-item .mistake-q {
    font-weight: 500;
    font-size: 0.85rem;
}

.mistake-item .mistake-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.mistake-item .mistake-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== CHAT ========== */
.chat-message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeInMessage 0.3s ease;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    border: 1px solid var(--glass-border);
}

.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.bot-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 4px;
    color: var(--text-secondary);
}

.user-bubble {
    background: linear-gradient(135deg, var(--purple), var(--primary-dark));
    border-bottom-right-radius: 4px;
    color: #fff;
}

.chat-bubble .typing-dots {
    display: inline-flex;
    gap: 4px;
}

.chat-bubble .typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.chat-bubble .typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-bubble .typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

#chatMessages::-webkit-scrollbar {
    width: 4px;
}

#chatMessages::-webkit-scrollbar-track {
    background: transparent;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 10px;
}

/* ========== FLASHCARD ========== */
.flashcard {
    min-height: 140px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.flashcard:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.12);
}

.flashcard .flashcard-front,
.flashcard .flashcard-back {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    width: 100%;
}

.flashcard .flashcard-back p {
    color: var(--green);
}

/* ========== TIPS ========== */
.formula-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 14px 18px;
    border-left: 3px solid var(--purple);
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.formula-card:hover {
    transform: translateX(4px);
    border-left-color: var(--gold);
    background: rgba(255, 255, 255, 0.05);
}

.formula-card p {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: var(--gold);
    margin-top: 4px;
    word-break: break-word;
}

.formula-item {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: var(--gold);
    font-family: 'Courier New', monospace;
}

.tip-item {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.trick-item {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--pink);
}

.mindmap-btn {
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.2);
    color: var(--blue);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.3s ease;
    font-family: var(--font-sans);
}

.mindmap-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    transform: scale(1.05);
}

/* ========== MIND MAP POPUP ========== */
.mindmap-popup {
    background: rgba(18, 16, 28, 0.92) !important;
    backdrop-filter: blur(40px) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.mindmap-popup .close-btn {
    font-family: var(--font-sans);
    font-weight: 300;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.mindmap-popup .close-btn:hover {
    color: #f0e6d3;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    transform: rotate(90deg);
}

/* 3D Flower Decorations */
.flower-decoration {
    position: absolute;
    font-size: 2.2rem;
    opacity: 0.6;
    filter: drop-shadow(0 4px 15px rgba(255, 200, 150, 0.15));
    z-index: 5;
    animation: flowerFloat 6s ease-in-out infinite;
}

.flower-tl {
    top: 8px;
    left: 12px;
    animation-delay: 0s;
}

.flower-tr {
    top: 8px;
    right: 12px;
    animation-delay: -2s;
}

.flower-bl {
    bottom: 8px;
    left: 12px;
    animation-delay: -4s;
}

.flower-br {
    bottom: 8px;
    right: 12px;
    animation-delay: -1s;
}

@keyframes flowerFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-6px) rotate(5deg);
    }
}

/* Mind Map Content */
#mindmapContent {
    font-family: 'Georgia', 'Playfair Display', serif !important;
    font-size: 1.05rem !important;
    line-height: 2.2 !important;
    color: #e8e0d8 !important;
    background: rgba(20, 18, 30, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 16px !important;
    padding: 28px 32px !important;
    min-height: 250px !important;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.2) !important;
    letter-spacing: 0.3px !important;
}

#mindmapContent .mindmap-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #f0e6d3;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 215, 150, 0.15);
    padding-bottom: 12px;
}

#mindmapContent .branch {
    color: #c4b5a0;
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
    margin-top: 4px;
}

#mindmapContent .sub-branch {
    color: #b8a9b5;
    font-size: 1rem;
    padding-left: 20px;
    display: block;
    font-weight: 400;
    font-style: italic;
}

#mindmapContent .formula-highlight {
    color: #f5d6a8;
    font-weight: 500;
    background: rgba(255, 215, 150, 0.04);
    padding: 2px 10px;
    border-radius: 6px;
    border-left: 2px solid rgba(245, 214, 168, 0.2);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

#mindmapContent .method-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.12);
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #a78bfa;
    margin: 2px 4px 2px 0;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
}

#mindmapContent .section-header {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: #d4c5b0;
    margin-top: 12px;
    display: block;
    border-bottom: 1px dashed rgba(255, 215, 150, 0.06);
    padding-bottom: 4px;
}

#mindmapPopup .glass-card::-webkit-scrollbar {
    width: 4px;
}

#mindmapPopup .glass-card::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 10px;
}

/* ========== INSTALL BANNER ========== */
.install-banner {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: var(--glass);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--glass-shadow);
}

.install-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.install-content>span {
    font-size: 1.4rem;
}

.install-content div {
    flex: 1;
}

.install-content strong {
    display: block;
    font-size: 0.8rem;
}

.install-content p {
    color: var(--text-secondary);
    font-size: 0.65rem;
    margin: 0;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--purple);
    border-radius: 10px;
}

/* ========== FIX DROPDOWN BACKGROUND ========== */
#tipsChapterSelect {
    background: rgba(20, 18, 30, 0.9) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    font-family: 'Space Grotesk', sans-serif !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='white' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    padding-right: 40px !important;
}

#tipsChapterSelect option {
    background: #1a1830 !important;
    color: #ffffff !important;
    padding: 10px !important;
}

#tipsChapterSelect option:hover {
    background: #2a2850 !important;
}

#tipsChapterSelect:focus {
    outline: none !important;
    border-color: var(--purple) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15) !important;
}

/* ========== AI WELCOME ANIMATION ========== */
.chat-message.bot .chat-bubble {
    animation: welcomePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes welcomePop {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-message.bot .chat-avatar {
    animation: avatarFloat 3s ease-in-out infinite;
}

@keyframes avatarFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    h1 {
        font-size: 1.8rem;
    }

    nav {
        gap: 2px;
        padding: 6px 8px;
    }

    .nav-btn {
        font-size: 0.95rem;
        padding: 6px 10px;
    }

    .home-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .countdown-number {
        font-size: 2.6rem;
    }

    .streak-number {
        font-size: 2.6rem;
    }

    .timer-grid {
        grid-template-columns: 1fr;
    }

    .celebration-modal {
        padding: 30px 20px;
        margin: 20px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .mission-block {
        flex-direction: column;
        text-align: center;
    }

    .flower-decoration {
        font-size: 1.5rem;
    }

    #mindmapContent {
        padding: 20px !important;
        font-size: 0.95rem !important;
    }
}

/* ========== PYQ POPUP STYLES ========== */
#pyqPopup .glass-card {
    background: rgba(18, 16, 28, 0.95) !important;
    backdrop-filter: blur(40px) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

#pyqPopup .test-options label {
    transition: all 0.3s ease;
}

#pyqPopup .test-options label:hover {
    background: rgba(139, 92, 246, 0.08);
}

#pyqPopup .test-options label.selected {
    background: rgba(139, 92, 246, 0.12);
    border-color: var(--purple);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========== PHASE POPUP FIX ========== */
#phasePopup .phase-popup {
    cursor: default;
}

#phasePopup .glass-card {
    cursor: default;
}

/* ========== MIND MAP POPUP FIX ========== */
#mindmapPopup .mindmap-popup {
    cursor: default;
}

#mindmapPopup .glass-card {
    cursor: default;
}

/* ========== MIND MAP POPUP FIX ========== */
#mindmapContent {
    overflow: hidden !important;
    word-wrap: break-word !important;
}

#mindmapContent .mindmap-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: #f0e6d3;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 215, 150, 0.15);
    padding-bottom: 12px;
}

#mindmapContent .branch {
    color: #c4b5a0;
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
    margin-top: 4px;
    padding-left: 0;
}

#mindmapContent .sub-branch {
    color: #b8a9b5;
    font-size: 1rem;
    padding-left: 20px;
    display: block;
    font-weight: 400;
    font-style: italic;
}

#mindmapContent .formula-highlight {
    color: #f5d6a8;
    font-weight: 500;
    background: rgba(255, 215, 150, 0);
    padding: 2px 10px;
    border-radius: 6px;
    border-left: 2px solid rgba(245, 214, 168, 0.2);
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

#mindmapContent .method-tag {
    display: inline-block;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.12);
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #a78bfa;
    margin: 2px 4px 2px 0;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.subject-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.subject-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
}

.reset-hint {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.reset-day-btn {
    margin-top: 8px;
    padding: 7px 14px;
    font-size: 0.72rem;
    background: rgba(251, 113, 133, 0.1);
    color: #fb7185;
    border-color: rgba(251, 113, 133, 0.2);
    align-self: flex-start;
}

.diff-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-left: 6px;
}

.diff-easy {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.diff-medium {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.diff-hard {
    background: rgba(251, 113, 133, 0.15);
    color: #fb7185;
}

.syllabus-item {
    cursor: pointer;
}

.app-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    z-index: 3000;
    max-width: min(420px, 92vw);
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(18, 16, 32, 0.94);
    border: 1px solid rgba(217, 249, 157, 0.28);
    color: #fff;
    font-size: 0.88rem;
    line-height: 1.45;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

main {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 0 auto;
}

/* ===== PREMIUM VIBE PASS ===== */
body {
    background: radial-gradient(circle at 12% 0%, #17112d 0, #080812 34%, #050509 100%);
}

main {
    max-width: 1180px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    max-width: 1180px;
    margin: 0 auto;
    padding-top: 34px;
}

header h1 {
    text-shadow: 0 0 42px rgba(167, 139, 250, .2);
}

nav {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.glass-card,
.mission-block {
    background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .025));
    border-color: rgba(255, 255, 255, .13);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.glass-card:hover {
    border-color: rgba(217, 249, 157, .3);
    box-shadow: 0 20px 70px rgba(139, 92, 246, .14);
}

.progress-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.progress-heading strong {
    font-size: 1.2rem;
    color: var(--lime);
    letter-spacing: -.04em;
}

.syllabus-item {
    width: 100%;
    text-align: left;
    color: var(--text);
    font: inherit;
    cursor: pointer;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .05);
    background: transparent;
    padding: 11px 4px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    transition: .25s ease;
}

.syllabus-item:hover {
    color: var(--lime);
    padding-left: 8px;
}

.syllabus-item.done {
    color: var(--green);
}

.mission-description {
    color: var(--text-secondary);
    font-size: .75rem;
    margin-top: 5px;
    line-height: 1.45;
}

.app-toast {
    z-index: 3000;
    border: 1px solid rgba(217, 249, 157, .28);
    background: rgba(16, 13, 28, .92);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}

.practice-modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 2, 8, .74);
    backdrop-filter: blur(18px);
    z-index: 2500;
}

.practice-modal.active {
    animation: fadeUp .25s ease;
}

.practice-dialog {
    position: relative;
    width: min(640px, 100%);
    max-height: 88vh;
    overflow: auto;
    padding: 34px;
    border: 1px solid rgba(217, 249, 157, .22);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(27, 22, 51, .98), rgba(10, 9, 22, .98));
    box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
}

.practice-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.practice-eyebrow {
    color: var(--lime);
    font-size: .65rem;
    letter-spacing: .2em;
    font-weight: 700;
}

.practice-dialog h3 {
    font-family: var(--font-serif);
    font-size: 1.65rem;
    margin: 7px 0 4px;
}

.practice-count {
    color: var(--text-muted);
    font-size: .75rem;
    margin-bottom: 22px;
}

.practice-question {
    font-size: 1.08rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 16px;
}

.practice-options {
    display: grid;
    gap: 10px;
}

.practice-option {
    text-align: left;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .045);
    color: var(--text-secondary);
    padding: 13px 15px;
    border-radius: 14px;
    cursor: pointer;
    font: inherit;
    transition: .2s ease;
}

.practice-option:hover:not(:disabled) {
    border-color: var(--purple-light);
    transform: translateX(4px);
    color: #fff;
}

.practice-option.correct {
    background: rgba(74, 222, 128, .15);
    border-color: var(--green);
    color: #d7ffe3;
}

.practice-option.wrong {
    background: rgba(251, 113, 133, .14);
    border-color: var(--pink);
}

.practice-option:disabled {
    cursor: default;
}

.practice-feedback {
    min-height: 25px;
    color: var(--lime);
    margin-top: 14px;
    font-size: .85rem;
}

.practice-next {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header {
        padding-top: 22px;
    }

    h1 {
        font-size: 1.9rem;
    }

    .practice-dialog {
        padding: 26px 20px;
    }
}


/* ===== IYKYK GEN-Z ART DIRECTION ===== */
:root {
    --ink: #17151c;
    --paper: #f4f0e8;
    --hot: #ff5c8a;
    --electric: #8c7bff;
    --acid: #dcff69;
    --lilac: #c7b8ff;
}

body {
    color: var(--paper);
    background: #17151c;
    background-image: radial-gradient(ellipse at 9% 4%, rgba(255, 92, 138, .22), transparent 28%), radial-gradient(ellipse at 92% 12%, rgba(140, 123, 255, .24), transparent 30%), linear-gradient(145deg, #15131b 0%, #25202e 48%, #101016 100%);
    padding: 24px clamp(12px, 4vw, 56px) 60px;
}

body::before {
    opacity: .13;
    mix-blend-mode: screen;
}

header {
    padding: 34px 0 22px;
}

header h1 {
    font-size: clamp(2.4rem, 6vw, 5.8rem);
    line-height: .94;
    letter-spacing: -.08em;
    max-width: 900px;
    margin: auto;
}

.subtitle {
    margin-top: 13px;
    font-size: clamp(.8rem, 1.4vw, 1rem);
    color: rgba(244, 240, 232, .75);
    letter-spacing: .02em;
}

.header-stickers {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 17px;
}

.header-stickers span,
.eyebrow {
    border: 1px solid rgba(220, 255, 105, .35);
    color: var(--acid);
    border-radius: 99px;
    padding: 6px 10px;
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .15em;
    background: rgba(220, 255, 105, .06);
}

nav {
    background: rgba(12, 11, 17, .66);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 99px;
    padding: 9px 12px;
    margin-bottom: 28px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .28);
}

.nav-btn {
    border-radius: 99px;
    min-width: 64px;
}

.nav-btn.active {
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 5px 22px rgba(244, 240, 232, .16);
}

main {
    max-width: 1240px;
}

.hero-note {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    min-height: 310px;
    padding: clamp(24px, 5vw, 58px);
    margin-bottom: 12px;
    border-radius: 34px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
}

.hero-note::after {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    right: -120px;
    top: -160px;
    background: var(--hot);
    opacity: .9;
    filter: blur(3px);
}

.hero-note-copy {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.hero-note .eyebrow {
    display: inline-block;
    color: #6357bd;
    border-color: rgba(99, 87, 189, .25);
    background: rgba(99, 87, 189, .08);
}

.hero-note h2 {
    font-family: var(--font-serif);
    font-size: clamp(2.3rem, 5.2vw, 5.3rem);
    line-height: .93;
    letter-spacing: -.08em;
    margin: 18px 0 15px;
}

.hero-note h2 em {
    color: #6d5dde;
    font-style: normal;
}

.hero-note p {
    max-width: 420px;
    color: #615b67;
    font-size: 1rem;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 25px;
}

.hero-cta,
.hero-share {
    border: 0;
    border-radius: 14px;
    padding: 13px 17px;
    font: 600 .8rem var(--font-sans);
    cursor: pointer;
}

.hero-cta {
    color: #fff;
    background: #17151c;
    box-shadow: 0 8px 20px rgba(23, 21, 28, .18);
}

.hero-cta span {
    color: var(--acid);
    margin-left: 12px;
    font-size: 1.1rem;
}

.hero-share {
    color: #4e4660;
    background: rgba(23, 21, 28, .07);
}

.hero-orbit {
    position: relative;
    z-index: 2;
    width: min(30vw, 285px);
    min-width: 190px;
    aspect-ratio: 1;
    margin: 5px 4% 0 20px;
}

.orbit-ring {
    position: absolute;
    inset: 11%;
    border: 1px solid rgba(23, 21, 28, .16);
    border-radius: 50%;
    transform: rotate(-25deg);
}

.ring-two {
    inset: 24%;
    border-style: dashed;
    transform: rotate(45deg);
}

.orbit-core {
    position: absolute;
    inset: 35%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--acid);
    font-size: clamp(2rem, 5vw, 4rem);
    box-shadow: 0 0 0 12px rgba(220, 255, 105, .18), 0 14px 35px rgba(23, 21, 28, .22);
    animation: floatCore 4s ease-in-out infinite;
}

.orbit-label {
    position: absolute;
    padding: 6px 9px;
    border-radius: 99px;
    color: #fff;
    background: #17151c;
    font: 700 .55rem var(--font-sans);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.label-one {
    right: -7%;
    top: 24%;
    transform: rotate(7deg);
}

.label-two {
    left: -4%;
    bottom: 22%;
    transform: rotate(-9deg);
}

@keyframes floatCore {
    50% {
        transform: translateY(-8px) rotate(8deg);
    }
}

.progress-ribbon {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 10px 4px 18px;
    color: rgba(244, 240, 232, .58);
    font-size: .64rem;
    letter-spacing: .03em;
}

.progress-ribbon b {
    color: var(--acid);
    letter-spacing: .16em;
}

.home-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
}

.glass-card,
.mission-block {
    border-radius: 28px;
    background: rgba(24, 21, 31, .66);
    border-color: rgba(255, 255, 255, .16);
    box-shadow: 0 16px 55px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .08);
}

.countdown-card {
    min-height: 240px;
    background: linear-gradient(145deg, rgba(140, 123, 255, .34), rgba(255, 92, 138, .16));
}

.countdown-number,
.streak-number {
    font-size: clamp(3.5rem, 7vw, 6.5rem);
    letter-spacing: -.1em;
}

.progress-card {
    min-height: 240px;
}

.share-progress-btn {
    margin-top: 10px;
    color: var(--acid);
    border-color: rgba(220, 255, 105, .22);
}

.mission-card {
    min-height: 240px;
}

@media (max-width:700px) {
    body {
        padding: 12px 10px 42px;
    }

    header {
        padding-top: 22px;
    }

    nav {
        border-radius: 24px;
    }

    .hero-note {
        min-height: 450px;
        padding: 25px;
    }

    .hero-orbit {
        position: absolute;
        right: -18px;
        bottom: -18px;
        width: 210px;
        opacity: .72;
    }

    .hero-note p {
        max-width: 290px;
    }

    .progress-ribbon {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .header-stickers span {
        font-size: .48rem;
    }
}


/* ===== ANIMATION + HEART PORTAL PASS ===== */
html {
    scroll-behavior: smooth;
}

body {
    perspective: 1200px;
}

.glass-card,
.mission-block {
    animation: cardIn .65s both;
}

.glass-card:nth-child(2) {
    animation-delay: .07s;
}

.glass-card:nth-child(3) {
    animation-delay: .14s;
}

.glass-card:nth-child(4) {
    animation-delay: .21s;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.glass-btn,
.hero-cta,
.hero-share,
.nav-btn {
    transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s ease, background .22s ease;
}

.glass-btn:active,
.hero-cta:active,
.hero-share:active,
.nav-btn:active {
    transform: scale(.94);
}

.settings-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 22px;
}

.settings-card>div {
    min-width: 0;
}

.settings-card>div:last-of-type {
    grid-column: 1/-1;
}

.heart-portal-btn {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 1200;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    background: rgba(23, 21, 28, .68);
    color: #ff7ca4;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 0 0 6px rgba(255, 92, 138, .07), 0 12px 25px rgba(0, 0, 0, .2);
    animation: heartPulse 2.7s ease-in-out infinite;
}

.heart-portal-btn span {
    position: absolute;
    top: 45px;
    right: 0;
    white-space: nowrap;
    color: rgba(244, 240, 232, .55);
    font: 600 .5rem var(--font-sans);
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: 0;
    transition: .2s;
}

.heart-portal-btn:hover span {
    opacity: 1;
}

@keyframes heartPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.heart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2200;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 7, 13, .78);
    backdrop-filter: blur(24px);
}

.heart-overlay.visible {
    animation: portalIn .45s cubic-bezier(.2, .85, .2, 1);
}

.heart-gate-card,
.heart-portal-card {
    position: relative;
    width: min(950px, 100%);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 34px;
    background: linear-gradient(145deg, rgba(33, 26, 51, .97), rgba(13, 12, 22, .98));
    box-shadow: 0 30px 110px rgba(0, 0, 0, .52), 0 0 90px rgba(255, 92, 138, .1);
}

.heart-gate-card {
    width: min(430px, 100%);
    padding: 42px 32px 34px;
    text-align: center;
}

.heart-gate-card::before {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: #ff5c8a;
    filter: blur(60px);
    opacity: .18;
    top: -60px;
    left: -50px;
}

.gate-symbol {
    color: #ff86aa;
    font-size: 3.8rem;
    line-height: 1;
    margin-bottom: 16px;
    animation: floatCore 3s ease-in-out infinite;
}

.heart-gate-card h2,
.heart-portal-card h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin: 15px 0 10px;
}

.heart-gate-card p {
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.6;
}

.heart-close {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 2;
    border: 0;
    background: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
}

.heart-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.heart-form input {
    width: 100%;
    text-align: center;
    letter-spacing: .55em;
    font-size: 1.5rem;
    padding: 13px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, .15);
    color: #fff;
    background: rgba(255, 255, 255, .07);
    outline: none;
}

.heart-form input:focus {
    border-color: #ff86aa;
    box-shadow: 0 0 0 4px rgba(255, 92, 138, .1);
}

.heart-unlock {
    padding: 13px;
    border: 0;
    border-radius: 15px;
    color: #1a1420;
    background: var(--acid);
    font: 800 .8rem var(--font-sans);
    cursor: pointer;
}

.heart-error {
    min-height: 22px;
    margin-top: 12px;
    color: #ff91ad;
    font-size: .75rem;
}

.heart-portal-card {
    padding: 38px;
}

.portal-header {
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.portal-header h2 {
    font-size: clamp(2rem, 5vw, 3.7rem);
    letter-spacing: -.07em;
}

.portal-header p {
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.5;
}

.portal-grid {
    display: grid;
    grid-template-columns: .75fr 1.25fr;
    gap: 16px;
    margin-top: 18px;
}

.love-note-card,
.gallery-card {
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 24px;
    background: rgba(255, 255, 255, .045);
}

.portal-kicker {
    color: var(--acid);
    font-size: .58rem;
    letter-spacing: .16em;
    font-weight: 800;
}

.love-note-card textarea {
    display: block;
    width: 100%;
    min-height: 205px;
    margin-top: 17px;
    resize: vertical;
    border: 0;
    outline: 0;
    color: var(--paper);
    background: transparent;
    font: 400 1rem/1.7 var(--font-serif);
}

.note-footer,
.gallery-heading,
.gallery-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.note-footer {
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-top: 13px;
    color: var(--text-muted);
    font-size: .65rem;
}

.note-save {
    border: 1px solid rgba(220, 255, 105, .28);
    color: var(--acid);
    background: rgba(220, 255, 105, .08);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font: 600 .7rem var(--font-sans);
}

.gallery-heading h3 {
    margin-top: 6px;
    font: 600 1.2rem var(--font-serif);
}

.upload-photos {
    cursor: pointer;
    color: #1b1720;
    background: var(--acid);
    padding: 9px 12px;
    border-radius: 11px;
    font: 800 .66rem var(--font-sans);
}

.upload-photos input {
    display: none;
}

.gallery-stage {
    display: grid;
    place-items: center;
    min-height: 250px;
    margin: 17px 0 14px;
    border-radius: 19px;
    overflow: hidden;
    border: 1px dashed rgba(255, 255, 255, .18);
    background: linear-gradient(135deg, rgba(255, 92, 138, .13), rgba(140, 123, 255, .15));
}

.gallery-stage img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    cursor: pointer;
    transition: transform .45s ease;
}

.gallery-stage img:hover {
    transform: scale(1.035);
}

.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.gallery-empty span {
    font-size: 2rem;
    color: var(--acid);
}

.gallery-empty small {
    color: var(--text-muted);
    max-width: 260px;
    line-height: 1.4;
}

.gallery-controls button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    background: rgba(255, 255, 255, .06);
    cursor: pointer;
}

.gallery-controls span {
    color: var(--text-muted);
    font-size: .7rem;
}

.syllabus-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.diff-pill {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: .52rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.diff-easy {
    color: #dfff9a;
    background: rgba(220, 255, 105, .13);
}

.diff-medium {
    color: #bdb3ff;
    background: rgba(140, 123, 255, .15);
}

.diff-hard {
    color: #ff9fbc;
    background: rgba(255, 92, 138, .14);
}

@keyframes portalIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width:700px) {
    .heart-portal-btn {
        top: 10px;
        right: 10px;
    }

    .settings-card {
        grid-template-columns: 1fr;
    }

    .settings-card>div:last-of-type {
        grid-column: auto;
    }

    .heart-portal-card {
        padding: 28px 18px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

    .heart-gate-card {
        padding: 36px 22px 28px;
    }

    .gallery-stage img {
        height: 230px;
    }
}


/* ===== ANIME.JS-INSPIRED MOTION SHOWCASE ===== */
:root {
    --ease-showcase: cubic-bezier(.16, 1, .3, 1);
}

.motion-reveal {
    opacity: 0;
    transform: translateY(38px) scale(.97);
    transition: opacity .9s var(--ease-showcase) var(--motion-delay), transform .9s var(--ease-showcase) var(--motion-delay);
}

.motion-reveal.is-in-view {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hero-note,
.countdown-card,
.mission-card {
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform .5s var(--ease-showcase), box-shadow .35s ease;
}

.hero-note:hover {
    box-shadow: 22px 30px 0 rgba(221, 255, 105, .12), 0 25px 80px rgba(0, 0, 0, .22);
}

.nav-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::after {
    content: '';
    position: absolute;
    left: 15%;
    right: 15%;
    bottom: 5px;
    height: 2px;
    background: var(--acid);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .45s var(--ease-showcase);
}

.nav-btn:hover::after,
.nav-btn.active::after {
    transform: scaleX(1);
}

.hero-orbit {
    animation: showcaseFloat 7s ease-in-out infinite;
}

.orbit-ring {
    animation: spinOrbit 16s linear infinite;
}

.ring-two {
    animation-direction: reverse;
    animation-duration: 11s;
}

.orbit-core {
    animation: corePulse 2.4s ease-in-out infinite;
}

@keyframes showcaseFloat {

    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate(-2deg)
    }

    50% {
        transform: translate3d(0, -13px, 0) rotate(2deg)
    }
}

@keyframes spinOrbit {
    to {
        transform: rotate(360deg)
    }
}

@keyframes corePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 255, 105, .22)
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 18px rgba(220, 255, 105, 0)
    }
}

.progress-fill {
    transition: width 1.3s var(--ease-showcase);
}

.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .09) 50%, transparent 65%);
    transform: translateX(-120%);
    transition: transform .9s ease;
}

.glass-card:hover::after {
    transform: translateX(120%);
}

.reduced-motion * {
    animation: none !important;
    transition: none !important;
}

@media (max-width:700px) {
    .motion-reveal {
        transform: translateY(18px);
    }
}

/* ===== PYQ SHOWCASE REPAIR ===== */
#pyqPopup {
    animation: pyqCurtain .45s var(--ease-showcase, cubic-bezier(.16, 1, .3, 1)) both;
}

#pyqPopup>div {
    animation: pyqCardIn .7s var(--ease-showcase, cubic-bezier(.16, 1, .3, 1)) both;
    box-shadow: 28px 28px 0 rgba(220, 255, 105, .12), 0 30px 100px rgba(0, 0, 0, .45) !important;
}

#pyqPopup label {
    transition: transform .25s var(--ease-showcase), border-color .25s ease, background .25s ease;
}

#pyqPopup label:hover {
    transform: translateX(7px);
    border-color: var(--acid) !important;
    background: rgba(220, 255, 105, .08) !important;
}

#pyqPopup button {
    transition: transform .2s var(--ease-showcase), filter .2s ease;
}

#pyqPopup button:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

@keyframes pyqCurtain {
    from {
        opacity: 0;
        backdrop-filter: blur(0)
    }

    to {
        opacity: 1;
        backdrop-filter: blur(18px)
    }
}

@keyframes pyqCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) rotate(1.5deg) scale(.96)
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(0) scale(1)
    }
}

.mission-block:has(.btn-start-block[onclick*="openPracticePopup"]) {
    border-color: rgba(220, 255, 105, .42);
    background: linear-gradient(100deg, rgba(220, 255, 105, .08), rgba(140, 123, 255, .05));
}

.mission-block:has(.btn-start-block[onclick*="openPracticePopup"])::before {
    content: 'EASY POOL COMPLETE · MATHS DROP';
    position: absolute;
    top: -9px;
    right: 18px;
    padding: 3px 8px;
    border-radius: 99px;
    color: #1a1720;
    background: var(--acid);
    font-size: .5rem;
    font-weight: 900;
    letter-spacing: .1em;
}

@media (max-width:700px) {
    #pyqPopup {
        padding: 10px !important;
    }

    #pyqPopup>div {
        padding: 22px !important;
        border-radius: 20px !important;
    }
}


/* ===== LIGHTWEIGHT PERFORMANCE MODE + LIVE STATUS ===== */
.nav-live-status {
    margin-left: auto;
    min-width: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 15px;
    border-left: 1px solid rgba(255, 255, 255, .12);
    color: rgba(244, 240, 232, .62);
    font: 800 .54rem var(--font-sans);
    letter-spacing: .11em;
    white-space: nowrap;
}

.nav-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--acid);
    box-shadow: 0 0 0 5px rgba(220, 255, 105, .1);
    animation: statusBlink 2.1s ease-in-out infinite;
}

@keyframes statusBlink {

    0%,
    100% {
        opacity: .55;
        transform: scale(.9)
    }

    50% {
        opacity: 1;
        transform: scale(1.15)
    }
}

.performance-setting {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px;
    border: 1px solid rgba(220, 255, 105, .18);
    border-radius: 16px;
    background: linear-gradient(100deg, rgba(220, 255, 105, .08), rgba(140, 123, 255, .06));
}

.performance-setting label {
    margin: 0;
}

.performance-setting small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: .68rem;
}

.toggle {
    position: relative;
    display: inline-flex;
    flex: none;
    width: 46px;
    height: 26px;
    cursor: pointer;
}

.toggle input {
    position: absolute;
    opacity: 0;
}

.toggle span {
    width: 100%;
    height: 100%;
    border-radius: 99px;
    background: rgba(255, 255, 255, .14);
    transition: .25s ease;
}

.toggle span::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: .25s ease;
}

.toggle input:checked+span {
    background: var(--acid);
}

.toggle input:checked+span::after {
    transform: translateX(20px);
    background: #15141a;
}

.performance-mode .bg-orb,
.performance-mode .hero-orbit,
.performance-mode .heart-portal-btn,
.performance-mode .orbit-ring,
.performance-mode .orbit-core,
.performance-mode .nav-live-dot {
    animation: none !important;
}

.performance-mode .glass-card::after {
    display: none;
}

.performance-mode .heart-overlay,
.performance-mode #pyqPopup {
    backdrop-filter: none !important;
}

.performance-mode .glass-card,
.performance-mode .nav-live-status {
    backdrop-filter: none !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14) !important;
}

@media (max-width:1050px) {
    .nav-live-status {
        min-width: 0;
        flex: 1;
        font-size: .48rem;
    }
}

@media (max-width:760px) {
    .nav-live-status {
        display: none;
    }

    .performance-setting {
        grid-column: auto;
    }
}


/* ===== PREMIUM GLASSMORPHISM PASS ===== */
:root {
    --glass-surface: linear-gradient(135deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .035));
    --glass-stroke: rgba(255, 255, 255, .19);
    --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(0, 0, 0, .18);
    --glass-glow: 0 24px 70px rgba(0, 0, 0, .22), 0 0 0 1px rgba(255, 255, 255, .04);
}

body {
    background: radial-gradient(circle at 15% 15%, rgba(251, 113, 133, .12), transparent 30%), radial-gradient(circle at 85% 8%, rgba(167, 139, 250, .14), transparent 32%), #070712;
}

nav,
.glass-card,
.hero-note,
.progress-ribbon,
.mission-block,
.timer-card,
.settings-card,
.phase-popup,
.mindmap-popup,
.practice-dialog,
.heart-gate-card,
.heart-portal-card,
.love-note-card,
.gallery-card {
    background: var(--glass-surface) !important;
    border: 1px solid var(--glass-stroke) !important;
    box-shadow: var(--glass-inset), var(--glass-glow) !important;
    backdrop-filter: blur(18px) saturate(125%);
    -webkit-backdrop-filter: blur(18px) saturate(125%);
}

nav {
    position: relative;
    overflow: hidden;
}

nav::before,
.glass-card::before,
.hero-note::before,
.progress-ribbon::before,
.mission-block::before {
    content: '';
    position: absolute;
    pointer-events: none;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255, 255, 255, .15), transparent 23%, transparent 68%, rgba(255, 255, 255, .04));
    opacity: .65;
}

nav::after {
    content: '';
    position: absolute;
    pointer-events: none;
    width: 240px;
    height: 80px;
    top: -42px;
    left: 18%;
    border-radius: 50%;
    background: rgba(255, 255, 255, .11);
    filter: blur(28px);
    opacity: .35;
}

.glass-card,
.hero-note,
.progress-ribbon,
.mission-block {
    position: relative;
    isolation: isolate;
}

.glass-card:hover,
.mission-block:hover {
    border-color: rgba(220, 255, 105, .34) !important;
    box-shadow: var(--glass-inset), 0 28px 80px rgba(0, 0, 0, .28), 0 0 34px rgba(167, 139, 250, .1) !important;
}

.glass-btn,
.hero-cta,
.hero-share,
.btn-start-block {
    border: 1px solid rgba(255, 255, 255, .22) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .055)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 24px rgba(0, 0, 0, .15);
    backdrop-filter: blur(10px);
}

.glass-btn:hover,
.hero-cta:hover,
.hero-share:hover,
.btn-start-block:hover {
    background: linear-gradient(135deg, rgba(220, 255, 105, .24), rgba(167, 139, 250, .18)) !important;
    border-color: rgba(220, 255, 105, .55) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .23), 0 0 24px rgba(220, 255, 105, .12);
}

.progress-track,
input,
select,
textarea {
    border: 1px solid rgba(255, 255, 255, .16) !important;
    background: rgba(255, 255, 255, .065) !important;
    box-shadow: inset 0 1px 7px rgba(0, 0, 0, .16);
}

.performance-mode nav,
.performance-mode .glass-card,
.performance-mode .hero-note,
.performance-mode .progress-ribbon,
.performance-mode .mission-block,
.performance-mode .timer-card,
.performance-mode .settings-card,
.performance-mode .phase-popup,
.performance-mode .mindmap-popup,
.performance-mode .practice-dialog,
.performance-mode .heart-gate-card,
.performance-mode .heart-portal-card,
.performance-mode .love-note-card,
.performance-mode .gallery-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.performance-mode nav::after,
.performance-mode .glass-card::before,
.performance-mode .hero-note::before,
.performance-mode .progress-ribbon::before,
.performance-mode .mission-block::before {
    display: none;
}

@media (max-width:760px) {
    nav {
        overflow-x: auto;
        justify-content: flex-start;
    }

    nav::after {
        display: none;
    }
}


/* ===== EXPANDED MEMORY WALL ===== */
.gallery-limit {
    display: inline-block;
    margin-left: 4px;
    color: rgba(26, 23, 32, .64);
    font-size: .5rem;
    letter-spacing: .04em;
}

.gallery-frame {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.gallery-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-delete {
    position: absolute;
    right: 12px;
    bottom: 12px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 99px;
    padding: 7px 10px;
    color: #fff;
    background: rgba(10, 10, 18, .64);
    cursor: pointer;
    font: 700 .58rem var(--font-sans);
    backdrop-filter: blur(8px);
    transition: .25s ease;
}

.gallery-delete:hover {
    color: #1a1720;
    background: #ff9fbc;
    transform: translateY(-2px);
}

@media (max-width:700px) {
    .gallery-frame {
        height: 230px;
    }
}


/* ===== FINAL PREMIUM STUDY LOUNGE REBUILD ===== */
:root {
    --ink: #0b1020;
    --ink-2: #11182b;
    --ink-3: #18233a;
    --paper: #f1eadc;
    --champagne: #e8dcc4;
    --sage: #b8c7a2;
    --lavender: #b7a7d9;
    --gold: #d4a574;
    --rose: #d89a9f;
    --acid: var(--sage);
    --purple: var(--lavender);
    --purple-light: #d7cce9;
    --pink: var(--rose);
    --text: #f1eadc;
    --text-secondary: rgba(241, 234, 220, .7);
    --text-muted: rgba(241, 234, 220, .42);
    --glass: rgba(24, 35, 58, .72);
    --glass-border: rgba(232, 220, 196, .2);
    --glass-shadow: 0 18px 55px rgba(0, 0, 0, .2);
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Outfit', Arial, sans-serif;
}

html,
body {
    min-height: 100%;
}

body {
    padding: 0 42px 70px 190px;
    color: var(--paper);
    background: radial-gradient(circle at 82% 10%, rgba(183, 167, 217, .13), transparent 27%), radial-gradient(circle at 62% 90%, rgba(184, 199, 162, .08), transparent 28%), var(--ink);
}

body::before {
    opacity: .055;
    mix-blend-mode: screen;
}

.bg-orb {
    filter: none;
    opacity: .08;
    animation: none;
}

.orb1 {
    width: 460px;
    height: 460px;
    background: var(--lavender);
    top: -220px;
    right: -160px
}

.orb2 {
    width: 360px;
    height: 360px;
    background: var(--sage);
    bottom: -190px;
    left: 25%;
}

.orb3,
.orb4 {
    display: none;
}

header {
    max-width: 1240px;
    padding: 54px 0 30px;
    margin: 0 auto;
    text-align: left;
}

header h1 {
    max-width: 900px;
    margin: 0;
    color: var(--champagne);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(3rem, 7vw, 7.2rem);
    line-height: .88;
    letter-spacing: -.075em;
    text-shadow: none;
}

.kicker {
    color: var(--gold);
    letter-spacing: .2em;
    font-size: .65rem;
    font-weight: 800;
}

.subtitle {
    color: rgba(232, 220, 196, .66);
    margin-top: 16px;
    font-size: .95rem;
    letter-spacing: .04em;
}

.header-stickers {
    justify-content: flex-start;
    margin-top: 18px;
}

.header-stickers span {
    color: var(--sage);
    border-color: rgba(184, 199, 162, .32);
    background: rgba(184, 199, 162, .06);
}

.profile-chip {
    position: absolute;
    top: 32px;
    right: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(232, 220, 196, .24);
    border-radius: 99px;
    padding: 7px 11px 7px 7px;
    color: var(--champagne);
    background: rgba(17, 24, 43, .62);
    cursor: pointer;
    font: 700 .56rem var(--font-sans);
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

.profile-chip>span:first-child,
.profile-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--sage), var(--lavender));
    color: var(--ink);
}

.profile-chip small {
    color: var(--text-muted);
    font-size: .5rem;
    letter-spacing: .1em;
}

nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: 154px;
    height: 100vh;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    padding: 26px 15px;
    margin: 0;
    border: 0 !important;
    border-right: 1px solid rgba(232, 220, 196, .13) !important;
    border-radius: 0 !important;
    background: rgba(9, 15, 29, .86) !important;
    box-shadow: 18px 0 60px rgba(0, 0, 0, .18) !important;
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(14px) !important;
}

nav::before,
nav::after {
    display: none;
}

.nav-btn {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    gap: 10px;
    padding: 11px 10px;
    border-radius: 13px;
    color: rgba(241, 234, 220, .55);
}

.nav-btn:hover {
    color: var(--champagne);
    background: rgba(232, 220, 196, .08) !important;
}

.nav-btn.active {
    color: var(--ink);
    background: var(--paper) !important;
    box-shadow: 0 8px 24px rgba(232, 220, 196, .12) !important;
}

.nav-btn::after {
    display: none;
}

.nav-live-status {
    margin-top: auto;
    min-width: 0;
    padding: 14px 4px 0;
    border-left: 0;
    border-top: 1px solid rgba(232, 220, 196, .13);
    color: rgba(241, 234, 220, .5);
    white-space: normal;
    text-align: center;
    line-height: 1.5;
    font-size: .48rem;
}

main {
    max-width: 1240px;
    margin: 0 auto;
}

.page {
    animation: pageIn .32s ease both;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.hero-note {
    min-height: 350px;
    margin-bottom: 18px;
    padding: clamp(32px, 5vw, 62px);
    border-radius: 30px !important;
    color: var(--ink) !important;
    background: linear-gradient(135deg, #f1eadc 0%, #e8dcc4 62%, #d6d9bd 100%) !important;
    border: 0 !important;
    box-shadow: 0 28px 85px rgba(0, 0, 0, .24) !important;
}

.hero-note::after {
    width: 360px;
    height: 360px;
    right: -100px;
    top: -130px;
    background: var(--rose);
    opacity: .6;
    filter: none;
}

.hero-note::before {
    background: linear-gradient(120deg, rgba(255, 255, 255, .3), transparent 33%, transparent 70%, rgba(11, 16, 32, .06));
}

.hero-note h2 {
    color: var(--ink);
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(3rem, 6.2vw, 6.2rem);
    line-height: .85;
}

.hero-note h2 em {
    color: #6e628e;
}

.hero-note p {
    color: rgba(11, 16, 32, .62);
}

.hero-note .eyebrow {
    color: #6e628e;
    border-color: rgba(110, 98, 142, .25);
    background: rgba(110, 98, 142, .08);
}

.hero-cta {
    color: var(--paper) !important;
    background: var(--ink) !important;
}

.hero-share {
    color: var(--ink) !important;
    background: rgba(11, 16, 32, .08) !important;
}

.hero-orbit {
    opacity: .75;
}

.orbit-ring {
    border-color: rgba(11, 16, 32, .2);
    animation: none !important;
}

.orbit-core {
    background: var(--sage) !important;
    box-shadow: 0 14px 30px rgba(11, 16, 32, .14);
    animation: none !important;
}

.progress-ribbon {
    padding: 10px 3px 19px;
    color: rgba(232, 220, 196, .6);
}

.progress-ribbon b {
    color: var(--gold);
}

.home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.home-grid>.countdown-card {
    grid-column: span 2;
}

.home-grid>.mission-card {
    grid-column: span 2;
}

.home-grid>.glass-card[style*="grid-column"] {
    grid-column: 1/-1;
}

.glass-card,
.mission-block {
    border-radius: 22px !important;
    background: linear-gradient(135deg, rgba(24, 35, 58, .82), rgba(17, 24, 43, .64)) !important;
    border-color: rgba(232, 220, 196, .17) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 18px 48px rgba(0, 0, 0, .16) !important;
    backdrop-filter: blur(12px) !important;
}

.glass-card::before,
.glass-card::after,
.mission-block::before {
    display: none !important;
}

.glass-card:hover,
.mission-block:hover {
    transform: translateY(-3px) !important;
    border-color: rgba(184, 199, 162, .42) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 22px 56px rgba(0, 0, 0, .23) !important;
}

.countdown-card {
    min-height: 230px;
    background: linear-gradient(135deg, rgba(183, 167, 217, .22), rgba(24, 35, 58, .82)) !important;
}

.mission-card {
    min-height: 230px;
}

.streak-number,
.countdown-number {
    color: var(--champagne);
}

.card-label,
.page-title {
    color: var(--champagne);
}

.page-title {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: -.04em;
}

.progress-fill {
    background: linear-gradient(90deg, var(--sage), var(--gold)) !important;
}

.subject-progress-grid {
    gap: 20px;
}

.subject-row {
    color: var(--champagne);
}

/* remove legacy continuous motion while preserving quick interaction feedback */
.motion-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.hero-note,
.countdown-card,
.mission-card {
    transform: none !important;
    transition: transform .2s ease, box-shadow .2s ease !important;
}

.hero-orbit {
    animation: none !important;
}

.orbit-ring,
.orbit-core,
.heart-portal-btn,
.bg-orb {
    animation: none !important;
}

.profile-settings-card {
    margin-bottom: 16px;
}

.profile-settings-preview {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-settings-preview h3 {
    margin: 4px 0;
    font-family: var(--font-serif);
    color: var(--champagne);
}

.profile-settings-preview p {
    color: var(--text-muted);
    font-size: .76rem;
}

.profile-avatar-large {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--sage), var(--lavender));
    color: var(--ink);
    font: 700 1.7rem var(--font-sans);
    flex: none;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-upload-btn {
    margin-left: auto;
}

.profile-upload-btn input {
    display: none;
}

.crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 4000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 12, 24, .82);
}

.crop-modal.visible {
    animation: pageIn .22s ease both;
}

.crop-card {
    width: min(580px, 100%);
    padding: 28px;
    border-radius: 24px;
    background: var(--ink-2);
    border: 1px solid rgba(232, 220, 196, .22);
    box-shadow: 0 30px 100px rgba(0, 0, 0, .4);
}

.crop-card h3 {
    color: var(--champagne);
    font: 400 1.8rem var(--font-serif);
    margin: 8px 0;
}

.crop-help {
    color: var(--text-secondary);
    font-size: .78rem;
    line-height: 1.5;
}

.crop-stage {
    height: 300px;
    margin: 18px 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 18px;
    background: #070b15;
    border: 1px solid rgba(232, 220, 196, .18);
}

.crop-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: grab;
    transform-origin: center;
    user-select: none;
}

.crop-zoom {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: .75rem;
}

.crop-zoom input {
    flex: 1;
}

.crop-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width:850px) {
    body {
        padding-left: 84px;
        padding-right: 18px;
    }

    nav {
        width: 70px;
        padding: 18px 10px;
        align-items: center;
    }

    .nav-btn {
        justify-content: center;
        padding: 11px 8px;
    }

    .nav-label {
        display: none;
    }

    .nav-live-status {
        display: none;
    }

    header {
        padding-top: 34px;
    }

    .profile-chip {
        right: 18px;
    }

    .profile-chip small,
    .profile-chip>span:last-of-type {
        display: none;
    }
}

@media (max-width:650px) {
    body {
        padding: 0 12px 40px;
    }

    nav {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 8px;
        margin: 0 -12px 20px;
        border-right: 0 !important;
        border-bottom: 1px solid rgba(232, 220, 196, .13) !important;
        overflow-x: auto;
    }

    .nav-btn {
        flex: none;
        width: 44px;
    }

    .nav-btn:first-child {
        margin-left: 0;
    }

    header {
        padding: 28px 0 22px;
    }

    .profile-chip {
        top: 16px;
        right: 8px;
    }

    .profile-chip>span:last-of-type {
        display: none;
    }

    .hero-note {
        min-height: 430px;
    }

    .hero-note h2 {
        font-size: clamp(2.8rem, 13vw, 4.5rem);
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    .home-grid>.countdown-card,
    .home-grid>.mission-card {
        grid-column: auto;
    }

    .profile-settings-preview {
        flex-wrap: wrap;
    }

    .profile-upload-btn {
        margin-left: 0;
    }
}


/* ===== RESTORED FULL BUILD · LOW-LAG ATMOSPHERE ===== */
#floatingParticles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: .46
}

.float-particle {
    display: none !important
}

#particleCanvas {
    display: block;
    width: 100%;
    height: 100%
}

.bg-orb {
    animation: none !important;
    filter: blur(38px) !important;
    opacity: .13 !important
}

.header-glow {
    animation: none !important;
    opacity: .3 !important
}

.hero-orbit,
.orbit-ring,
.orbit-core {
    animation: none !important
}

.glass-card,
.hero-note,
.progress-ribbon,
.mission-block,
.countdown-card,
.mission-card,
.settings-card,
.heart-gate-card,
.heart-portal-card {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important
}

.glass-card:hover,
.mission-block:hover,
.settings-card:hover {
    transform: translateY(-2px) !important;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease !important
}

.nav-btn::after {
    transition: transform .2s ease !important
}

.motion-reveal {
    transition: opacity .25s ease, transform .25s ease !important
}

.performance-mode #floatingParticles,
.performance-mode .bg-orb,
.performance-mode .header-glow {
    display: none !important
}

.performance-mode .glass-card,
.performance-mode .hero-note,
.performance-mode .progress-ribbon,
.performance-mode .mission-block,
.performance-mode .settings-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important
}

.performance-mode * {
    animation: none !important;
    transition: none !important
}

@media(max-width:700px) {
    #floatingParticles {
        opacity: .25
    }

    .glass-card,
    .hero-note,
    .progress-ribbon,
    .mission-block,
    .countdown-card,
    .mission-card,
    .settings-card,
    .heart-gate-card,
    .heart-portal-card {
        backdrop-filter: blur(5px) !important;
        -webkit-backdrop-filter: blur(5px) !important
    }
}


/* ===== ELEGANT EDITORIAL TYPE SYSTEM ===== */
:root {
    --font-elegant: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --font-ui: 'Outfit', 'Avenir Next', Arial, sans-serif;
}

/* One cohesive elegant face across the tracker; UI controls stay comfortably readable. */
body,
body * {
    font-family: var(--font-elegant) !important;
}

body {
    font-size: 18px;
    letter-spacing: 0.01em;
}

button,
input,
textarea,
select,
option,
.nav-btn,
.glass-btn,
.btn-start-block,
.diff-pill,
.card-label,
.t-label,
.reset-hint,
.progress-ribbon,
.badge,
.status,
small {
    font-family: var(--font-ui) !important;
}

button,
input,
textarea,
select {
    letter-spacing: 0.01em;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-title,
.hero-title,
.card-title {
    font-family: var(--font-elegant) !important;
    font-weight: 600;
    letter-spacing: -0.025em;
}

p,
li,
.m-info,
.t-subject,
.mission-description,
.glass-card {
    font-family: var(--font-elegant) !important;
}

/* Preserve compact sizing in dense navigation and status UI. */
.nav-btn,
.nav-label,
.card-label,
.diff-pill,
.reset-hint,
.progress-ribbon,
.t-label,
.timer-controls,
.m-status {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

/* Avoid the title/header wrapping regression while retaining the new typeface. */
header h1,
.brand-title,
.hero-title {
    white-space: nowrap;
}

@media (max-width: 700px) {
    body {
        font-size: 17px;
    }

    header h1,
    .brand-title,
    .hero-title {
        white-space: normal;
    }
}


/* ===== DARK MODE TOGGLE + MOONLIGHT COUNTERPART ===== */
.theme-setting {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px;
    border: 1px solid rgba(232, 220, 196, .24);
    border-radius: 16px;
    background: linear-gradient(100deg, rgba(232, 220, 196, .09), rgba(183, 167, 217, .08));
}

.theme-setting>div {
    min-width: 0;
}

.theme-setting label {
    margin: 0;
}

.theme-setting small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: .68rem;
    line-height: 1.45;
}

.theme-setting .toggle input:focus-visible+span,
.performance-setting .toggle input:focus-visible+span {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

/* Warm paper, graphite, and muted lavender: an elegant daytime alternative. */
:root[data-theme="light"] {
    --ink: #f3ede2;
    --ink-2: #e9dfd0;
    --ink-3: #ded1c0;
    --paper: #211d28;
    --champagne: #41354b;
    --sage: #70856d;
    --lavender: #89739d;
    --gold: #a67542;
    --rose: #b96e78;
    --acid: #718c69;
    --purple: #8f79a5;
    --purple-light: #665376;
    --pink: #b96e78;
    --text: #211d28;
    --text-secondary: rgba(33, 29, 40, .72);
    --text-muted: rgba(33, 29, 40, .54);
    --glass: rgba(255, 251, 244, .72);
    --glass-border: rgba(65, 53, 75, .18);
    --glass-shadow: 0 18px 55px rgba(65, 53, 75, .15);
}

:root[data-theme="light"] body {
    color: var(--paper);
    background: radial-gradient(circle at 82% 10%, rgba(183, 167, 217, .18), transparent 27%), radial-gradient(circle at 62% 90%, rgba(184, 199, 162, .16), transparent 28%), var(--ink);
}

:root[data-theme="light"] body::before {
    opacity: .035;
    mix-blend-mode: multiply;
}

:root[data-theme="light"] nav {
    background: rgba(248, 242, 232, .9) !important;
    border-right-color: rgba(65, 53, 75, .14) !important;
    box-shadow: 18px 0 60px rgba(65, 53, 75, .08) !important;
}

:root[data-theme="light"] .nav-btn {
    color: rgba(33, 29, 40, .62);
}

:root[data-theme="light"] .nav-btn:hover {
    color: var(--champagne);
    background: rgba(65, 53, 75, .08) !important;
}

:root[data-theme="light"] .nav-btn.active {
    color: var(--ink);
    background: var(--champagne) !important;
}

:root[data-theme="light"] header h1 {
    color: var(--champagne);
}

:root[data-theme="light"] .subtitle {
    color: rgba(65, 53, 75, .68);
}

:root[data-theme="light"] .header-stickers span {
    color: var(--sage);
    border-color: rgba(112, 133, 109, .34);
    background: rgba(112, 133, 109, .08);
}

:root[data-theme="light"] .profile-chip {
    color: var(--champagne);
    background: rgba(255, 251, 244, .78);
    border-color: rgba(65, 53, 75, .2);
}

:root[data-theme="light"] .glass-card,
:root[data-theme="light"] .mission-block,
:root[data-theme="light"] .progress-ribbon {
    color: var(--paper);
    background: linear-gradient(135deg, rgba(255, 251, 244, .9), rgba(235, 225, 211, .74)) !important;
    border-color: rgba(65, 53, 75, .16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72), 0 18px 48px rgba(65, 53, 75, .1) !important;
}

:root[data-theme="light"] .countdown-card {
    background: linear-gradient(135deg, rgba(214, 201, 222, .72), rgba(255, 251, 244, .92)) !important;
}

:root[data-theme="light"] .hero-note {
    background: linear-gradient(135deg, #fbf4e8 0%, #eadfce 62%, #d8e0cc 100%) !important;
    box-shadow: 0 28px 85px rgba(65, 53, 75, .14) !important;
}

:root[data-theme="light"] .theme-setting {
    border-color: rgba(112, 133, 109, .28);
    background: linear-gradient(100deg, rgba(112, 133, 109, .1), rgba(143, 121, 165, .08));
}

:root[data-theme="light"] .setting-group input,
:root[data-theme="light"] #aiInput,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
    color: var(--paper) !important;
    background: rgba(65, 53, 75, .06) !important;
}

:root[data-theme="light"] .heart-portal-btn {
    background: rgba(255, 251, 244, .82);
    color: var(--rose);
    border-color: rgba(65, 53, 75, .2);
}

:root[data-theme="light"] .heart-overlay {
    background: rgba(49, 40, 56, .42);
}

@media (max-width: 700px) {
    .theme-setting {
        align-items: flex-start;
    }
}


/* ===== POMODORO REMINDERS ===== */
.pomodoro-setting {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px;
    border: 1px solid rgba(212, 165, 116, .28);
    border-radius: 16px;
    background: linear-gradient(100deg, rgba(212, 165, 116, .1), rgba(216, 154, 159, .08));
}

.pomodoro-setting>div {
    min-width: 0;
}

.pomodoro-setting label {
    margin: 0;
}

.pomodoro-setting small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: .68rem;
    line-height: 1.45;
}

.pomodoro-status {
    margin: 7px auto 2px;
    color: var(--gold);
    font: 600 .68rem var(--font-ui);
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}

.timer-card .pomodoro-status {
    opacity: .86;
}

:root[data-theme="light"] .pomodoro-setting {
    border-color: rgba(166, 117, 66, .28);
    background: linear-gradient(100deg, rgba(166, 117, 66, .1), rgba(185, 110, 120, .08));
}

@media (max-width: 700px) {
    .pomodoro-setting {
        align-items: flex-start;
    }
}


/* ===== WEEKLY RHYTHM ===== */
.weekly-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.week-day {
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, .035);
    font-family: var(--font-ui);
}

.week-day span {
    font-size: .62rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.week-day b {
    font: 600 1.25rem var(--font-elegant);
    color: var(--text-secondary);
}

.week-day.is-studied {
    border-color: rgba(184, 199, 162, .45);
    background: linear-gradient(145deg, rgba(184, 199, 162, .16), rgba(183, 167, 217, .08));
    color: var(--sage);
}

.week-day.is-studied b {
    color: var(--sage);
}

.week-day.is-today {
    outline: 1px solid var(--gold);
    outline-offset: 2px;
}

.weekly-message {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: .78rem;
    line-height: 1.5;
}

:root[data-theme="light"] .week-day {
    background: rgba(65, 53, 75, .045);
}

:root[data-theme="light"] .week-day.is-studied {
    background: linear-gradient(145deg, rgba(112, 133, 109, .16), rgba(143, 121, 165, .1));
}

@media (max-width: 520px) {
    .weekly-calendar {
        gap: 5px;
    }

    .week-day {
        min-height: 56px;
    }

    .week-day span {
        font-size: .52rem;
    }

    .week-day b {
        font-size: 1.05rem;
    }
}


/* ===== MISTAKE INTELLIGENCE ===== */
.mistake-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.mistake-toolbar small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font: 500 .66rem var(--font-ui);
    line-height: 1.5;
}

.mistake-toolbar select {
    min-width: 125px;
    padding: 9px 10px;
    border: 1px solid var(--glass-border);
    border-radius: 11px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, .06);
    font: 500 .7rem var(--font-ui);
}

.repeat-mistakes-btn {
    margin-bottom: 8px;
    padding: 9px 13px;
    color: var(--gold);
    border-color: rgba(212, 165, 116, .3);
    background: rgba(212, 165, 116, .08);
}

.mistake-category {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: .08em;
}

:root[data-theme="light"] .mistake-toolbar select {
    color: var(--paper);
    background: rgba(65, 53, 75, .06);
}

@media (max-width:520px) {
    .mistake-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .mistake-toolbar select {
        width: 100%;
    }
}


/* ===== ANALYTICS INSIGHTS ===== */
.analytics-insight {
    margin-top: 16px;
    padding: 22px;
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.insight-grid span {
    padding: 14px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
}

.insight-grid b {
    display: block;
    color: var(--champagne);
    font: 600 1.55rem var(--font-elegant);
}

.insight-grid small {
    color: var(--text-muted);
    font: 500 .62rem var(--font-ui);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.analytics-insight p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .84rem;
    line-height: 1.55;
}

.analytics-insight strong {
    color: var(--gold);
}

@media (max-width:560px) {
    .insight-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== FOCUS ROOM + REFLECTIONS ===== */
.timer-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.timer-page-heading .page-title {
    margin-bottom: 0;
}

.focus-room-btn {
    color: var(--gold);
    border-color: rgba(212, 165, 116, .35);
    background: rgba(212, 165, 116, .08);
}

.reflection-box {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--glass-border);
}

.reflection-box label {
    display: block;
    margin-bottom: 8px;
    color: var(--champagne);
    font: 600 .72rem var(--font-ui);
    letter-spacing: .09em;
    text-transform: uppercase;
}

.reflection-box textarea {
    width: 100%;
    min-height: 74px;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: 13px;
    color: var(--text);
    background: rgba(255, 255, 255, .035);
    font: 400 1rem/1.4 var(--font-elegant);
}

.reflection-box textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, .1);
}

.achievement-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.achievement-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 11px;
    border: 1px solid rgba(184, 199, 162, .28);
    border-radius: 12px;
    background: rgba(184, 199, 162, .07);
}

.achievement-chip b {
    color: var(--sage);
    font: 600 .78rem var(--font-elegant);
}

.achievement-chip small {
    color: var(--text-muted);
    font: 500 .58rem var(--font-ui);
}

body.focus-room-active {
    padding-left: 42px;
}

body.focus-room-active header,
body.focus-room-active nav,
body.focus-room-active .hero-note,
body.focus-room-active .progress-ribbon,
body.focus-room-active .home-grid {
    display: none;
}

body.focus-room-active main {
    max-width: 1080px;
    padding-top: 12vh;
}

body.focus-room-active #page-timer {
    display: block !important;
}

body.focus-room-active .focus-room-btn {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 3000;
}

@media (max-width:700px) {
    .timer-page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .focus-room-btn {
        align-self: stretch;
    }

    .timer-page-heading .page-title {
        font-size: 2.2rem;
    }

    body.focus-room-active {
        padding: 12px;
    }

    body.focus-room-active main {
        padding-top: 8vh;
    }
}


/* ===== HEART SPACE EXPANSION ===== */
.shared-space-card {
    grid-column: 1/-1;
    padding: 22px;
    border: 1px solid rgba(216, 154, 159, .2);
    border-radius: 24px;
    background: rgba(255, 255, 255, .04);
}

.shared-space-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.shared-space-heading h3 {
    margin-top: 6px;
    font: 600 1.2rem var(--font-elegant);
}

.portal-sync-status {
    color: var(--sage);
    font: 600 .6rem var(--font-ui);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.shared-goal {
    margin: 18px 0 12px;
    padding: 13px;
    border-radius: 14px;
    background: rgba(212, 165, 116, .07);
}

.shared-goal label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font: 600 .62rem var(--font-ui);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.shared-goal>div,
.win-composer {
    display: flex;
    gap: 8px;
}

.shared-goal input,
.win-composer input {
    min-width: 0;
    flex: 1;
    padding: 10px 11px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--paper);
    background: rgba(255, 255, 255, .05);
    font: 400 .9rem var(--font-elegant);
}

.win-composer {
    margin-top: 12px;
}

.little-wins-list {
    display: grid;
    gap: 7px;
    margin-top: 13px;
}

.little-win {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(184, 199, 162, .18);
    border-radius: 12px;
    background: rgba(184, 199, 162, .05);
}

.little-win>span {
    color: var(--gold);
}

.little-win p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .84rem;
    line-height: 1.35;
}

.little-win small,
.little-wins-empty {
    color: var(--text-muted);
    font-size: .62rem;
}

.little-wins-empty {
    margin: 7px 0 0;
}

@media (max-width:700px) {
    .shared-space-card {
        grid-column: auto;
    }

    .shared-goal>div,
    .win-composer {
        flex-direction: column;
    }
}


.ambient-setting {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px;
    border: 1px solid rgba(183, 167, 217, .28);
    border-radius: 16px;
    background: linear-gradient(100deg, rgba(183, 167, 217, .09), rgba(184, 199, 162, .06));
}

.ambient-setting>div {
    min-width: 0;
}

.ambient-setting label {
    margin: 0;
}

.ambient-setting small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: .68rem;
    line-height: 1.45;
}

:root[data-theme="light"] .ambient-setting {
    border-color: rgba(143, 121, 165, .26);
    background: linear-gradient(100deg, rgba(143, 121, 165, .1), rgba(112, 133, 109, .07));
}

@media (max-width:700px) {
    .ambient-setting {
        align-items: flex-start;
    }
}
/* ========== JEE STUDY FLOW REFINEMENTS ========== */
body { transition: padding-left .35s ease; }
body:not(.is-home) header { display: none; }
body.is-home header { display: block; }
@media (min-width: 861px) {
 body { padding-left: 142px; }
 nav { position: fixed; inset: 16px auto 16px 16px; width: 108px; margin: 0; padding: 10px 7px; flex-direction: column; align-items: stretch; overflow-y: auto; overflow-x: hidden; border-radius: 24px; }
 .nav-btn { width: 100%; min-width: 0; padding: 10px 5px; }
 .nav-live-status { margin-top: auto; writing-mode: horizontal-tb; transform: none; align-self: stretch; padding: 12px 4px; }
 .nav-live-dot { margin: 0 0 6px 0; }
}
.energy-home-card { display: grid; grid-template-columns: minmax(220px, .9fr) 1.4fr; gap: 20px; align-items: center; background: linear-gradient(135deg, rgba(217,249,157,.08), rgba(167,139,250,.08)); border-color: rgba(217,249,157,.16); }
.energy-home-copy h3 { margin: 7px 0 5px; font-size: 1.18rem; font-weight: 500; color: var(--lime); }
.energy-home-copy p { color: var(--text-secondary); font-size: .78rem; line-height: 1.5; max-width: 440px; }
.energy-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.energy-option { border: 1px solid var(--glass-border); border-radius: 16px; padding: 13px 8px; color: var(--text); background: rgba(255,255,255,.035); cursor: pointer; transition: transform .25s ease, border-color .25s ease, background .25s ease; font-family: var(--font-sans); }
.energy-option:hover, .energy-option.selected { transform: translateY(-3px); border-color: var(--lime); background: rgba(217,249,157,.12); }
.energy-option span, .energy-option b, .energy-option small { display: block; }
.energy-option span { font-size: 1.25rem; margin-bottom: 4px; }.energy-option b { font-size: .78rem; font-weight: 600; }.energy-option small { color: var(--text-muted); font-size: .62rem; margin-top: 3px; }
.welcome-overlay, .mood-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(circle at 50% 25%, rgba(167,139,250,.2), transparent 42%), rgba(5,5,16,.93); backdrop-filter: blur(22px); z-index: 10000; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s ease; }
.welcome-overlay.active, .mood-overlay.active { opacity: 1; visibility: visible; }
.welcome-card, .mood-card { position: relative; width: min(560px, 100%); padding: 42px 34px 34px; text-align: center; border: 1px solid rgba(217,249,157,.2); border-radius: 30px; background: linear-gradient(145deg, rgba(25,22,43,.94), rgba(16,15,30,.97)); box-shadow: 0 30px 100px rgba(0,0,0,.55); transform: translateY(16px) scale(.97); transition: transform .45s cubic-bezier(.23,1,.32,1); }
.welcome-overlay.active .welcome-card, .mood-overlay.active .mood-card { transform: translateY(0) scale(1); }
.welcome-sparkle { color: var(--gold); font-size: 2rem; animation: welcomeFloat 2.4s ease-in-out infinite; }
.welcome-card h2 { margin: 8px 0; font-family: var(--font-serif); font-size: clamp(2.2rem, 8vw, 3.5rem); background: linear-gradient(120deg, #fff, var(--lime), var(--pink)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.welcome-subtitle { color: var(--text-secondary); font-size: 1rem; line-height: 1.6; }.welcome-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0; }.welcome-stats span { padding: 13px 7px; border-radius: 15px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }.welcome-stats b, .welcome-stats small { display: block; }.welcome-stats b { color: var(--lime); font-size: 1.05rem; }.welcome-stats small { color: var(--text-muted); font-size: .62rem; margin-top: 4px; text-transform: uppercase; letter-spacing: .08em; }.welcome-continue { width: 100%; padding: 13px 18px; }.welcome-petal { position: absolute; color: var(--pink); font-size: 3rem; opacity: .65; animation: welcomeFloat 3s ease-in-out infinite; }.petal-one { top: 12%; left: 12%; }.petal-two { top: 20%; right: 13%; color: var(--gold); animation-delay: .8s; }.petal-three { bottom: 16%; left: 18%; color: var(--purple-light); animation-delay: 1.3s; }@keyframes welcomeFloat { 50% { transform: translateY(-8px) rotate(7deg); } }
.mood-card { text-align: left; padding: 30px; }.mood-card h2 { margin: 5px 0 8px; font-family: var(--font-serif); font-size: 2rem; color: var(--lime); }.mood-card > p { color: var(--text-secondary); line-height: 1.5; font-size: .88rem; }.mood-question { margin-top: 21px; }.mood-question h3 { font-size: .95rem; font-weight: 500; margin-bottom: 9px; }.mood-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.mood-choice { padding: 10px 7px; border: 1px solid var(--glass-border); border-radius: 12px; background: rgba(255,255,255,.035); color: var(--text-secondary); cursor: pointer; font-family: var(--font-sans); transition: .2s ease; }.mood-choice:hover, .mood-choice.selected { border-color: var(--purple-light); background: rgba(167,139,250,.15); color: #fff; }.mood-choice small { display:block; font-size:.62rem; margin-top:3px; color:var(--text-muted); }.mood-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:24px; }
@media (max-width: 860px) { body { padding-bottom: 92px; } nav { position: fixed; left: 10px; right: 10px; bottom: 10px; top: auto; margin: 0; z-index: 1000; padding: 7px; } .nav-live-status { display: none; } .nav-btn { min-width: 54px; } .energy-home-card { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .welcome-card, .mood-card { padding: 26px 19px; } .welcome-petal { display:none; } .mood-choices { grid-template-columns: 1fr; } .mood-choice { text-align:left; } .welcome-stats { gap: 6px; } .welcome-stats b { font-size: .88rem; } }

/* ========== VISUAL REGRESSION PATCH ========== */
header { display: block; }
body:not(.is-home) header { display: none; }
@media (min-width: 861px) {
  nav { top: 50%; bottom: auto; transform: translateY(-50%); max-height: calc(100vh - 32px); }
}
.mindmap-popup, .phase-popup { max-height: 76vh !important; overflow-y: auto !important; }
#mindmapPopup, #phasePopup, #welcomeOverlay, #moodOverlay { padding: 16px; }
#pyqPopup { align-items: center !important; justify-content: center !important; padding: 16px !important; }
#pyqPopup > div { max-height: 76vh !important; overflow-y: auto !important; margin: 0 auto !important; }
@media (max-width: 860px) {
  nav { transform: none; }
  .mindmap-popup, .phase-popup, #pyqPopup > div { max-height: 82vh !important; }
}

/* ========== VIEWPORT CENTERING FIX ========== */
@media (min-width: 861px) {
  nav { top: 50vh !important; bottom: auto !important; transform: translateY(-50%) !important; max-height: calc(100dvh - 32px) !important; }
}
#mindmapPopup, #phasePopup, #welcomeOverlay, #moodOverlay { width: 100vw !important; height: 100dvh !important; min-height: 0 !important; inset: 0 !important; }
#mindmapPopup, #phasePopup, #welcomeOverlay, #moodOverlay { align-items: center !important; justify-content: center !important; }
.mindmap-popup, .phase-popup { max-height: min(76dvh, 760px) !important; }
#pyqPopup { width: 100vw !important; height: 100dvh !important; }
#pyqPopup > div { max-height: min(76dvh, 760px) !important; }

/* Keep the desktop navigation visually centered rather than full-height. */
@media (min-width: 861px) {
  nav { height: min(760px, calc(100dvh - 48px)) !important; max-height: none !important; overflow-y: auto; }
}

/* ========== UNWANTED TEXT-CARET REPAIR ========== */
body { caret-color: transparent; cursor: default; }
input, textarea, select, [contenteditable="true"] { caret-color: auto; cursor: text; }
button, a, label, select { cursor: pointer; }

/* ========== SMOOTH SECTION SWITCHING ========== */
.page.section-enter {
    animation: studySectionEnter .32s cubic-bezier(.22, 1, .36, 1) both !important;
    will-change: opacity, transform;
}
@keyframes studySectionEnter {
    from { opacity: 0; transform: translate3d(0, 12px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .page.section-enter { animation: none !important; }
}

/* ========== STRAIGHT SIDEBAR STATUS ========== */
@media (min-width: 861px) {
    body { padding-left: 250px; }
    nav { width: 190px !important; box-sizing: border-box; }
    .nav-live-status {
        display: flex !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
        white-space: nowrap !important;
        overflow: visible !important;
        padding: 12px 4px 0 !important;
        font-size: .56rem !important;
        letter-spacing: .04em !important;
        line-height: 1.2 !important;
    }
}

/* Final override: keep the live status readable left-to-right. */
@media (min-width: 861px) {
    .nav-live-status {
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        align-self: stretch !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }
}

/* ========== IMAGE-REQUESTED FEATURE UI ========== */
.feature-center { margin-top: 18px; padding: 20px; }
.feature-center-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.feature-center-heading h3 { margin:5px 0 5px; font:500 1.35rem var(--font-serif); color:var(--champagne); }
.feature-center-heading p { margin:0; color:var(--text-secondary); font-size:.78rem; max-width:650px; line-height:1.5; }
.feature-status-dot { width:10px; height:10px; border-radius:50%; background:var(--sage); box-shadow:0 0 0 6px rgba(184,199,162,.1); flex:0 0 auto; }
.feature-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:16px; }
.feature-toggle-row, .feature-note { min-height:74px; padding:13px 14px; border:1px solid rgba(232,220,196,.13); border-radius:15px; background:rgba(255,255,255,.035); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.feature-toggle-row span, .feature-note { min-width:0; }
.feature-toggle-row b, .feature-note b { display:block; color:var(--champagne); font-size:.78rem; }
.feature-toggle-row small, .feature-note span { display:block; margin-top:5px; color:var(--text-muted); font-size:.67rem; line-height:1.35; }
.feature-toggle-row input { position:absolute; opacity:0; pointer-events:none; }
.feature-toggle-row i { width:38px; height:22px; border-radius:99px; background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.14); position:relative; flex:0 0 auto; transition:background .2s ease; }
.feature-toggle-row i::after { content:''; position:absolute; width:16px; height:16px; top:2px; left:2px; border-radius:50%; background:var(--paper); transition:transform .2s ease; }
.feature-toggle-row input:checked + i { background:var(--sage); }
.feature-toggle-row input:checked + i::after { transform:translateX(16px); background:var(--ink); }
.pyq-filter-bar { display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:10px; margin:0 0 12px; padding:11px 12px; border:1px solid rgba(232,220,196,.13); border-radius:14px; background:rgba(255,255,255,.035); }
.pyq-filter-bar b, .pyq-filter-bar small { display:block; }
.pyq-filter-bar b { color:var(--champagne); font-size:.75rem; }
.pyq-filter-bar small { color:var(--text-muted); font-size:.64rem; margin-top:3px; }
.pyq-filter-bar select { width:auto; padding:8px 10px; }
.pyq-filter-bar label { color:var(--text-secondary); font-size:.68rem; white-space:nowrap; }
.pyq-filter-bar input { accent-color:var(--sage); }
.analytics-depth { margin-top:16px; padding:20px; }
.depth-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:13px; }
.depth-grid span { padding:12px; border-radius:13px; background:rgba(255,255,255,.035); border:1px solid rgba(232,220,196,.1); }
.depth-grid b { display:block; color:var(--champagne); font:500 1.15rem var(--font-serif); }
.depth-grid small { display:block; margin-top:4px; color:var(--text-muted); font-size:.65rem; }
.analytics-depth p { color:var(--text-secondary); font-size:.75rem; line-height:1.5; margin:14px 0 0; }
@media (max-width:700px) { .feature-grid, .pyq-filter-bar { grid-template-columns:1fr; } .pyq-filter-bar select { width:100%; } .depth-grid { grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce) { .feature-toggle-row i, .feature-toggle-row i::after { transition:none; } }

/* ========== HIGH-CONTRAST SELECT MENUS ========== */
select,
#tipsChapterSelect,
#settingsEnergy,
.pyq-filter-bar select {
    color: #f7f1e5 !important;
    background-color: #151b2d !important;
    border: 1px solid rgba(232, 220, 196, .32) !important;
    color-scheme: dark;
}
select option,
select optgroup {
    color: #f7f1e5 !important;
    background-color: #151b2d !important;
}
select option:checked,
select option:hover {
    color: #101525 !important;
    background-color: #b8c7a2 !important;
}
select:focus {
    outline: 2px solid rgba(184, 199, 162, .7) !important;
    outline-offset: 2px;
}
[data-theme="light"] select,
[data-theme="light"] #tipsChapterSelect,
[data-theme="light"] #settingsEnergy,
[data-theme="light"] .pyq-filter-bar select {
    color: #202536 !important;
    background-color: #fffaf0 !important;
    border-color: rgba(45, 51, 69, .28) !important;
    color-scheme: light;
}
[data-theme="light"] select option,
[data-theme="light"] select optgroup {
    color: #202536 !important;
    background-color: #fffaf0 !important;
}
[data-theme="light"] select option:checked,
[data-theme="light"] select option:hover {
    color: #fffaf0 !important;
    background-color: #5e6478 !important;
}

/* ========== WEEKLY PROGRESS CHART ========== */
.weekly-progress-chart { margin-top:16px; padding:20px; }
.weekly-chart-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.weekly-chart-heading h3 { margin:5px 0 4px; color:var(--champagne); font:500 1.35rem var(--font-serif); }
.weekly-chart-heading p { color:var(--text-secondary); font-size:.72rem; }
.weekly-streak-badge { min-width:72px; padding:8px 10px; border-radius:13px; text-align:center; background:rgba(184,199,162,.1); border:1px solid rgba(184,199,162,.24); }
.weekly-streak-badge b { display:block; color:var(--sage); font:500 1.25rem var(--font-serif); }
.weekly-streak-badge small { color:var(--text-muted); font-size:.6rem; }
.weekly-bars { display:grid; grid-template-columns:repeat(7,1fr); align-items:end; gap:10px; height:190px; margin-top:22px; padding:0 4px; }
.weekly-bar-column { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:5px; min-width:0; }
.weekly-bar-count { color:var(--text-secondary); font-size:.65rem; min-height:12px; }
.weekly-bar-track { height:130px; width:100%; max-width:40px; padding:3px; display:flex; align-items:flex-end; border-radius:10px; background:rgba(255,255,255,.05); border:1px solid rgba(232,220,196,.1); }
.weekly-bar-fill { width:100%; min-height:3px; border-radius:7px; background:rgba(232,220,196,.18); transition:height .35s ease; }
.weekly-bar-fill.has-progress { background:linear-gradient(180deg,var(--sage),var(--lavender)); box-shadow:0 0 18px rgba(184,199,162,.18); }
.weekly-bar-fill.today { background:linear-gradient(180deg,var(--gold),var(--rose)); }
.weekly-bar-day { color:var(--champagne); font-size:.65rem; text-transform:uppercase; }
.weekly-bar-date { color:var(--text-muted); font-size:.58rem; }
.weekly-chart-legend { display:flex; gap:16px; flex-wrap:wrap; margin-top:14px; color:var(--text-muted); font-size:.62rem; }
.legend-dot { display:inline-block; width:7px; height:7px; margin-right:5px; border-radius:50%; background:var(--sage); }
.legend-dot.today { background:var(--gold); }
@media (max-width:600px) { .weekly-progress-chart { padding:15px; } .weekly-bars { gap:5px; height:160px; } .weekly-bar-track { height:110px; } }
@media (prefers-reduced-motion:reduce) { .weekly-bar-fill { transition:none; } }

/* ========== HEART GALLERY SLIDESHOW ========== */
.gallery-frame img { animation: galleryPhotoIn .45s ease both; }
@keyframes galleryPhotoIn { from { opacity: .3; transform: scale(1.015); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .gallery-frame img { animation: none; } }

/* Final gallery polish: gentle cross-fade instead of a strong opaque pop. */
.gallery-frame { overflow: hidden; }
.gallery-frame img { animation: galleryPhotoSoftFade .7s ease both; will-change: opacity, transform; }
@keyframes galleryPhotoSoftFade {
    from { opacity: .72; transform: scale(1.006); filter: saturate(.94); }
    55% { opacity: .9; transform: scale(1.002); filter: saturate(.98); }
    to { opacity: 1; transform: scale(1); filter: saturate(1); }
}
@media (prefers-reduced-motion: reduce) { .gallery-frame img { animation: none; } }

/* Keep the requested gallery transition available in Performance Mode: it is a
   single low-cost opacity/transform animation, while reduced-motion still wins. */
@media (prefers-reduced-motion: no-preference) {
    .performance-mode .gallery-frame img {
        animation: galleryPhotoSoftFade .7s ease both !important;
        will-change: opacity, transform;
    }
}

/* True sequential gallery transition: old image leaves, then new image enters. */
.gallery-frame img.gallery-fade-out {
    animation: galleryFadeOut .85s ease forwards !important;
}
.gallery-frame img.gallery-fade-in {
    animation: galleryFadeIn 1.05s ease both !important;
}
@keyframes galleryFadeOut {
    from { opacity: 1; transform: scale(1); filter: saturate(1); }
    to { opacity: .08; transform: scale(.995); filter: saturate(.72); }
}
@keyframes galleryFadeIn {
    from { opacity: .08; transform: scale(1.005); filter: saturate(.72); }
    to { opacity: 1; transform: scale(1); filter: saturate(1); }
}
@media (prefers-reduced-motion: reduce) {
    .gallery-frame img.gallery-fade-out,
    .gallery-frame img.gallery-fade-in { animation: none !important; opacity: 1 !important; filter: none !important; transform: none !important; }
}
