/* ═══════════════════════════════════════════════
   AMBIENT BACKGROUND
   ═══════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════
   AMBIENT BACKGROUND — scoped to #dashboard only
   ═══════════════════════════════════════════════ */
#dashboard {
    position: relative;         /* ensure ambient is clipped to this box */
   
}

.ambient-bg {
    position: sticky;      /* instead of absolute */
    top: 30px;
    left: 0;
    width: 100%;
    height: calc(100vh);   /* same height as .feed-content */
    margin-bottom: -100vh;         /* pull content up so it overlays */
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
    background:
        radial-gradient(1200px 800px at 20% 10%, #eef2ff 0%, transparent 60%),
        radial-gradient(1000px 700px at 90% 90%, #ffe4e6 0%, transparent 55%),
        radial-gradient(800px 600px at 50% 50%, #ecfeff 0%, transparent 60%);
}

.dark .ambient-bg {
    background:
        radial-gradient(1200px 800px at 20% 10%, #0b1220 0%, transparent 60%),
        radial-gradient(1000px 700px at 90% 90%, #1a0b1a 0%, transparent 55%),
        radial-gradient(800px 600px at 50% 50%, #04181c 0%, transparent 60%);
}


/* Slow drifting clouds/continents */
.ambient-layer {
    position: absolute;
    inset: -10%;
    opacity: 0.5;
    background-image:
        radial-gradient(closest-side, rgba(59,130,246,0.18), transparent 70%),
        radial-gradient(closest-side, rgba(236,72,153,0.14), transparent 70%),
        radial-gradient(closest-side, rgba(16,185,129,0.14), transparent 70%);
    background-repeat: no-repeat;
    background-position: 10% 20%, 80% 70%, 40% 90%;
    background-size: 45% 45%, 55% 55%, 40% 40%;
    filter: blur(40px);
    animation: driftA 90s linear infinite alternate;
}
.dark .ambient-layer { opacity: 0.35; }

.ambient-layer.layer-2 {
    animation: driftB 130s linear infinite alternate;
    opacity: 0.4;
}
.ambient-layer.layer-3 {
    animation: driftC 180s linear infinite alternate;
    opacity: 0.3;
}

@keyframes driftA {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(4%, -3%, 0) scale(1.08); }
}
@keyframes driftB {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-5%, 4%, 0) scale(1.12); }
}
@keyframes driftC {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(3%, 6%, 0) scale(1.06); }
}

/* Optional rotating globe emoji pulse in the corner */
.ambient-globe {
    position: absolute;
    right: 4%;
    bottom: 12%;
    font-size: 140px;
    opacity: 0.06;
    filter: blur(1px);
    animation: globeSpin 120s linear infinite;
    user-select: none;
}
.dark .ambient-globe { opacity: 0.08; }
@keyframes globeSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Ensure page content sits above ambient */
.ambient-content { position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════
   COMPACT BALANCE STRIP
   ═══════════════════════════════════════════════ */
.compact-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    min-height: 62px;
    max-height: 72px;
    border-radius: 16px;
    overflow: hidden;
}
.compact-balance .cell {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 4px 2px;
    border-radius: 10px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(6px);
}
.dark .compact-balance .cell { background: rgba(255,255,255,0.06); }
.compact-balance .cell .lbl {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.compact-balance .cell .val {
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (min-width: 480px) {
    .compact-balance .cell .lbl { font-size: 10px; }
    .compact-balance .cell .val { font-size: 13px; }
}

/* ═══════════════════════════════════════════════
   LIVE NOW CARD
   ═══════════════════════════════════════════════ */
.live-now-card {
    position: relative;
    border-radius: 20px;
    padding: 12px 14px;
    min-height: 74px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(236,72,153,0.10));
    border: 1px solid rgba(99,102,241,0.18);
    transition: opacity .5s ease;
}
.dark .live-now-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.14), rgba(236,72,153,0.14));
    border-color: rgba(99,102,241,0.25);
}
.live-now-card .pulse-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239,68,68,0.7);
    animation: livePulse 1.6s infinite;
}
@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.live-now-card .bar {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #ec4899);
    transition: width .95s linear;
}

.live-item-enter { animation: liveItemIn .4s ease; }
@keyframes liveItemIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   FEATURE GRID
   ═══════════════════════════════════════════════ */
.feature-grid { display: grid; gap: 10px; }
.feature-grid.two   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.feature-btn {
    position: relative;
    border-radius: 20px;
    padding: 12px 8px;                 /* slightly less horizontal, more breathing room top/bottom */
    display: flex;
    flex-direction: column;
    align-items: center;                /* ← THE FIX: center everything horizontally */
    justify-content: center;
    gap: 6px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Safari */
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    overflow: visible;
    width: 100%;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.dark .feature-btn {
    background: rgba(24, 24, 27, 0.55);
    border-color: rgba(255, 255, 255, 0.06);
}

.feature-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}
.dark .feature-btn:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.feature-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ── Icon ────────────────────────────────── */
.feature-btn .icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    /* mx-auto not needed anymore — parent uses align-items:center */
}

/* ── Title ───────────────────────────────── */
.feature-btn .title {
    font-weight: 900;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;      /* ← add "…" when truncated */
    max-width: 100%;
    width: 100%;                  /* ← ensure it can be centered */
}

/* ── Subtitle ─────────────────────────────── */
.feature-btn .sub {
    font-size: 9.5px;
    opacity: .7;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;      /* ← add "…" when truncated */
    max-width: 100%;
    width: 100%;                  /* ← ensure it can be centered */
}

/* ── Bubble (kept for your existing animation) ── */
.feature-btn-wrapper { position: relative; }
.feature-bubble {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
}

/* ── Responsive tweak: tighter on very narrow screens ── */
@media (max-width: 360px) {
    .feature-btn { padding: 10px 6px; gap: 4px; }
    .feature-btn .icon { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
    .feature-btn .title { font-size: 11px; }
    .feature-btn .sub { font-size: 9px; }
}
/* Badge bubble ("speech" style) */
.feature-bubble {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    max-width: 220px;
    width: max-content;
    padding: 8px 10px;
    border-radius: 14px;
    background: #111827;
    color: #fff;
    font-size: 11px;
    line-height: 1.3;
    box-shadow: 0 20px 40px -12px rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 40;
}
.dark .feature-bubble { background: #f4f4f5; color: #111827; }
.feature-bubble::after {
    content: '';
    position: absolute;
    left: 50%; bottom: -6px;
    transform: translateX(-50%) rotate(45deg);
    width: 12px; height: 12px;
    background: inherit;
    border-radius: 2px;
}
.feature-bubble.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(-2px);
}
.feature-bubble .cta {
    display: inline-block;
    margin-top: 6px;
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
}
.feature-bubble .close {
    position: absolute;
    top: -6px; right: -6px;
    background: #ef4444;
    color: #fff;
    width: 18px; height: 18px;
    border-radius: 50%;
    font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════
   FLOATING BOTTOM NAV
   ═══════════════════════════════════════════════ */
.floating-nav {
    position: fixed;
    bottom: 84px;              /* sits above mobile bottom nav */
    left: 50%;
    transform: translateX(-50%);
    z-index: 45;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 999px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 20px 40px -18px rgba(0,0,0,0.25);
}
.dark .floating-nav {
    background: rgba(24,24,27,0.75);
    border-color: rgba(255,255,255,0.08);
}
.floating-nav button, .floating-nav a {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex; align-items: center; gap: 6px;
    color: #111;
    transition: background .2s ease, transform .2s ease;
}
.dark .floating-nav button, .dark .floating-nav a { color: #f4f4f5; }
.floating-nav button:hover, .floating-nav a:hover {
    background: rgba(99,102,241,0.14);
    transform: translateY(-1px);
}
.floating-nav .active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
}

@media (min-width: 1024px) {
    .floating-nav { bottom: 24px; } /* desktop: bottom center */
}

/* Hides when task modal is open, whatever */
body.modal-open .floating-nav { display: none; }

/* ═══════════════════════════════════════════════
   MUSIC BUTTON
   ═══════════════════════════════════════════════ */
.music-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(99,102,241,0.12);
    color: #6366f1;
    transition: transform .2s ease, background .2s ease;
}
.music-btn:hover { transform: scale(1.08); background: rgba(99,102,241,0.2); }
.music-btn.playing { animation: musicBeat 1.4s ease-in-out infinite; }
@keyframes musicBeat {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}