  :root { --space-dark: #0a0e27; --neon-purple: #7c3aed; --neon-blue: #00f5ff; }
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body {
    background: var(--space-dark);
    min-height: 100vh;
    font-family: 'Segoe UI', sans-serif;
    color: #fff;
    overflow-x: hidden;
  }
  .stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
  .star { position: absolute; border-radius: 50%; background: #fff; animation: twinkle var(--d,3s) ease-in-out infinite alternate; }
  @keyframes twinkle { from{opacity:.2;transform:scale(.8)} to{opacity:1;transform:scale(1.2)} }

  .app { position: relative; z-index: 1; max-width: 420px; margin: 0 auto; padding: 0 0 90px; }

  /* ── TOP BAR ── */
  .top-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 20px 12px;
    background: linear-gradient(180deg, rgba(10,14,39,1) 0%, transparent 100%);
    position: sticky; top: 0; z-index: 10;
  }
  .top-title { font-size: 1.1rem; font-weight: 800; flex: 1; }
  .pts-chip {
    background: linear-gradient(135deg, var(--neon-purple), #4f46e5);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: .78rem; font-weight: 700;
    display: flex; align-items: center; gap: 5px;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 0 12px rgba(124,58,237,.35);
  }

  /* ── XP CARD ── */
  .xp-card {
    margin: 4px 16px 14px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border-radius: 20px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(79,70,229,.35);
  }
  .xp-card::before {
    content: '';
    position: absolute;
    top: -40%; left: -20%;
    width: 200%; height: 200%;
    background: conic-gradient(transparent 0deg, rgba(167,139,250,.07) 60deg, transparent 120deg);
    animation: xpSpin 8s linear infinite;
  }
  @keyframes xpSpin { to { transform: rotate(360deg); } }
  .xp-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
  .xp-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #1d4ed8);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 0 18px rgba(124,58,237,.5);
    flex-shrink: 0;
  }
  .xp-info { flex: 1; }
  .xp-name { font-size: 1rem; font-weight: 800; }
  .xp-level { font-size: .75rem; color: #a78bfa; margin-top: 2px; }
  .xp-badge {
    background: rgba(251,191,36,.15);
    border: 1px solid rgba(251,191,36,.4);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: .72rem;
    color: #fbbf24;
    font-weight: 700;
  }
  .xp-bar-wrap {
    background: rgba(255,255,255,.1);
    border-radius: 8px;
    height: 10px;
    overflow: hidden;
    position: relative;
  }
  .xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #60a5fa);
    border-radius: 8px;
    transition: width .8s ease;
    position: relative;
    overflow: hidden;
  }
  .xp-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
  }
  @keyframes shimmer { from{transform:translateX(-100%)} to{transform:translateX(100%)} }
  .xp-numbers { display: flex; justify-content: space-between; margin-top: 6px; font-size: .7rem; color: rgba(255,255,255,.5); }

  /* ── SECTION HEADER ── */
  .sec-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 18px 8px;
  }
  .sec-title { font-size: .85rem; font-weight: 800; color: rgba(255,255,255,.85); }
  .sec-link { font-size: .72rem; color: #7c3aed; font-weight: 600; text-decoration: none; }

  /* ── DAILY CHALLENGES ── */
  .challenges-wrap { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
  .challenge-card {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 14px 14px 12px;
    position: relative;
    overflow: hidden;
    transition: background .2s;
  }
  .challenge-card.done {
    background: rgba(34,197,94,.08);
    border-color: rgba(34,197,94,.25);
  }
  .challenge-card.done::after {
    content: '✅';
    position: absolute;
    top: 12px; right: 14px;
    font-size: 1.2rem;
  }
  .ch-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
  .ch-icon {
    width: 38px; height: 38px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
  }
  .ch-icon.purple { background: rgba(124,58,237,.25); }
  .ch-icon.blue   { background: rgba(29,78,216,.25); }
  .ch-icon.orange { background: rgba(217,119,6,.25); }
  .ch-icon.green  { background: rgba(34,197,94,.25); }
  .ch-icon.pink   { background: rgba(236,72,153,.25); }
  .ch-meta { flex: 1; }
  .ch-task { font-size: .83rem; font-weight: 700; line-height: 1.3; }
  .ch-reward { font-size: .7rem; color: #a78bfa; margin-top: 3px; font-weight: 600; }
  .ch-bar-wrap { background: rgba(255,255,255,.1); border-radius: 6px; height: 6px; overflow: hidden; }
  .ch-bar-fill { height: 100%; background: linear-gradient(90deg, #7c3aed, #60a5fa); border-radius: 6px; transition: width .6s ease; }
  .ch-numbers { display: flex; justify-content: space-between; margin-top: 5px; font-size: .68rem; color: rgba(255,255,255,.45); }

  /* ── STATS GRID ── */
  .stats-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; padding: 0 16px;
  }
  .stat-card {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 14px 14px;
    text-align: center;
  }
  .stat-icon { font-size: 1.5rem; margin-bottom: 6px; }
  .stat-val { font-size: 1.3rem; font-weight: 800; }
  .stat-lbl { font-size: .68rem; color: rgba(255,255,255,.5); margin-top: 3px; }
  .stat-card.green .stat-val { color: #4ade80; }
  .stat-card.purple .stat-val { color: #a78bfa; }
  .stat-card.orange .stat-val { color: #fb923c; }
  .stat-card.blue .stat-val { color: #60a5fa; }

  /* ── RECORDS ── */
  .records-wrap { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
  .record-row {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.05);
    border-radius: 14px;
    padding: 12px 14px;
  }
  .rec-icon { font-size: 1.3rem; width: 32px; text-align: center; }
  .rec-info { flex: 1; }
  .rec-label { font-size: .8rem; font-weight: 700; }
  .rec-sub { font-size: .68rem; color: rgba(255,255,255,.4); margin-top: 2px; }
  .rec-val { font-size: .95rem; font-weight: 800; color: #fbbf24; }

  /* ── QUICK ACTIONS ── */
  .actions-row { display: flex; gap: 10px; padding: 0 16px; }
  .action-btn {
    flex: 1;
    padding: 14px 10px;
    border-radius: 16px;
    border: none;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: transform .15s;
  }
  .action-btn:active { transform: scale(.96); }
  .action-btn span { font-size: 1.4rem; }
  .action-btn.solo { background: linear-gradient(135deg, #1e3a8a, #1d4ed8); color: #fff; }
  .action-btn.duel { background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; }
  .action-btn.shop { background: linear-gradient(135deg, #92400e, #d97706); color: #fff; }

  /* ── RESET TIMER ── */
  .reset-bar {
    margin: 0 16px;
    background: rgba(255,255,255,.05);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
  }
  .reset-icon { font-size: 1.3rem; }
  .reset-info { flex: 1; }
  .reset-label { font-size: .78rem; font-weight: 700; }
  .reset-sub { font-size: .68rem; color: rgba(255,255,255,.4); margin-top: 2px; }
  .reset-timer { font-size: .85rem; font-weight: 800; color: #60a5fa; font-variant-numeric: tabular-nums; }

  /* ── BOTTOM NAV ── */
  nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 430px;
    background: rgba(7,11,21,.97); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex; align-items: flex-end; justify-content: space-around;
    padding: 10px 4px 24px; z-index: 200;
  }
  .nav-btn{display:flex;flex-direction:column;align-items:center;gap:3px;background:none;border:none;color:#6B7280;font-family:inherit;font-size:10px;font-weight:500;cursor:pointer;padding:0 6px;min-width:52px;transition:color .15s;text-decoration:none;}
  .nav-btn .nav-ico{width:22px;height:22px;display:block;margin-bottom:1px;}
  .nav-btn .nav-ico img{width:100%;height:100%;object-fit:contain;display:block;opacity:.45;transition:opacity .15s;}
  .nav-btn.active{color:#8B5CF6;}
  .nav-btn.active .nav-ico img{opacity:1;filter:brightness(0) saturate(100%) invert(49%) sepia(97%) saturate(1283%) hue-rotate(235deg) brightness(101%) contrast(94%);}
  .nav-center{display:flex;flex-direction:column;align-items:center;gap:4px;margin-top:-26px;cursor:pointer;}
  .nav-disc{width:58px;height:58px;border-radius:50%;background:linear-gradient(135deg,#6d28d9 0%,#8b5cf6 60%,#a78bfa 100%);box-shadow:0 4px 28px rgba(109,40,217,.7),0 0 0 3px #070B15;display:flex;align-items:center;justify-content:center;font-size:27px;}
  .nav-center-lbl{font-size:10px;font-weight:700;color:#6B7280;}
  .nav-item { display: none; }
  .nav-orb {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(124,58,237,.6);
    margin-top: -20px;
    border: 3px solid rgba(10,14,39,.9);
    animation: orbPulse 2s ease-in-out infinite alternate;
    cursor: pointer; text-decoration: none;
  }
  @keyframes orbPulse { from{box-shadow:0 0 14px rgba(124,58,237,.5)} to{box-shadow:0 0 28px rgba(124,58,237,.9)} }
