 
    :root{--bg:#0b1020;--card:#0f1724;--accent:#ffd24a;--muted:#9aa6c1}
    *{box-sizing:border-box;font-family:Inter,ui-sans-serif,system-ui,Arial,Helvetica,sans-serif}
    body{margin:0;min-height:100vh;background:linear-gradient(180deg,#061021 0%,#07122b 60%);
      color:#e6eef8;display:flex;flex-direction:column;padding:0}
    
    /* Fixed Top Navbar */
    .top-navbar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      background: var(--card);
      border-bottom: 1px solid rgba(255,255,255,0.03);
      padding: 0.8rem 1rem;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 2px 10px rgba(0,0,0,0.3);
      height: 60px;
    }
    
    /* Fixed Bottom Navbar */
    .bottom-navbar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: var(--card);
      border-top: 1px solid rgba(255,255,255,0.03);
      padding: 0.5rem 0;
      z-index: 100;
      display: flex;
      align-items: center;
      justify-content: space-around;
      box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
      height: 70px;
    }


        /* More Page Styles */
    .more-container {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }
    
    .more-header {
      text-align: center;
      margin-bottom: 1.5rem;
    }
    
    .features-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 1.5rem;
    }
    
    .feature-card {
      background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
      border-radius: 14px;
      padding: 1.5rem;
      border: 1px solid rgba(255,255,255,0.03);
      display: flex;
      flex-direction: column;
      transition: all 0.3s ease;
      height: 100%;
    }
    
    .feature-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 10px 25px rgba(0,0,0,0.4);
      border-color: rgba(255,210,74,0.2);
    }
    
    .feature-icon {
      font-size: 2.5rem;
      margin-bottom: 1rem;
      text-align: center;
    }
    
    .feature-title {
      font-size: 1.3rem;
      font-weight: 700;
      margin: 0 0 0.5rem 0;
      text-align: center;
    }
    
    .feature-description {
      color: var(--muted);
      margin-bottom: 1.5rem;
      flex-grow: 1;
      text-align: center;
    }
    
    .feature-button {
      padding: 0.8rem;
      background: linear-gradient(180deg, #ffd24a, #f0b42a);
      color: #1b1b1b;
      border: none;
      border-radius: 8px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
    }
    
    .feature-button:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(240,180,42,0.3);
    }
    
    .feature-button.secondary {
      background: rgba(255,255,255,0.05);
      color: white;
      border: 1px solid rgba(255,255,255,0.1);
    }
    
    .feature-button.secondary:hover {
      background: rgba(255,255,255,0.1);
    }
    
    .stats-section {
      margin-top: 2rem;
    }
    
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 1rem;
      margin-top: 1rem;
    }
    
    .stat-item {
      background: rgba(255,255,255,0.02);
      border-radius: 12px;
      padding: 1rem;
      text-align: center;
    }
    
    .stat-value {
      font-size: 1.8rem;
      font-weight: 700;
      margin: 0.5rem 0;
      color: var(--accent);
    }
    
    .stat-label {
      color: var(--muted);
      font-size: 0.9rem;
    }
    
    .quick-actions {
      margin-top: 2rem;
    }
    
    .actions-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 1rem;
      margin-top: 1rem;
    }
    
    .action-item {
      display: flex;
      align-items: center;
      gap: 1rem;
      padding: 1rem;
      background: rgba(255,255,255,0.02);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .action-item:hover {
      background: rgba(255,255,255,0.05);
      transform: translateY(-2px);
    }
    
    .action-icon {
      font-size: 1.5rem;
      width: 40px;
      text-align: center;
    }
    
    .action-text {
      flex-grow: 1;
    }
    
    .action-title {
      font-weight: 600;
      margin-bottom: 0.2rem;
    }
    
    .action-description {
      font-size: 0.8rem;
      color: var(--muted);
    }
    
    .page {
      display: none;
    }
    
    .page.active {
      display: block;
    }
    
    @media(max-width:880px){
      .layout{grid-template-columns:1fr;}
      .mine-btn{width:100%;height:72px;}
      .features-grid{grid-template-columns:1fr;}
    }
    
    @media(max-width:600px){
      .app {
        margin: 60px auto 70px;
        padding: 0.5rem;
      }
      .top-navbar, .bottom-navbar {
        padding: 0.6rem 0.8rem;
      }
      h1 {
        font-size: 1.1rem;
      }
      .nav-label {
        font-size: 0.65rem;
      }
      .stats-grid {
        grid-template-columns: 1fr 1fr;
      }
      .actions-grid {
        grid-template-columns: 1fr;
      }
    }
  </style>


    /* Style for logged-in user badge */
#userBadge.logged-in {
    color: var(--accent);
    font-weight: 600;
}

/* Style for guest badge */
#userBadge.guest {
    color: var(--muted);
}
    
    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 20%;
      padding: 0.4rem;
      cursor: pointer;
      transition: all 0.2s;
      border-radius: 8px;
    }
    
    .nav-item:hover {
      background: rgba(255,255,255,0.05);
    }
    
    .nav-item.active {
      color: var(--accent);
    }
    
    .nav-icon {
      font-size: 1.2rem;
      margin-bottom: 0.2rem;
    }
    
    .nav-label {
      font-size: 0.7rem;
      color: var(--muted);
    }
    
    .nav-item.active .nav-label {
      color: var(--accent);
    }
    
    .app{
      width:100%;
      max-width:1000px;
      margin: 70px auto 80px; /* Account for fixed navbars */
      padding: 1rem;
    }
    header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem}
    h1{margin:0;font-size:1.3rem}
    .card{background:linear-gradient(180deg,rgba(255,255,255,0.02),rgba(255,255,255,0.01));border-radius:14px;padding:1rem;box-shadow:0 6px 18px rgba(0,0,0,0.6);border:1px solid rgba(255,255,255,0.03)}
    .layout{display:grid;grid-template-columns:1fr 360px;gap:1rem}
    .mine-area{display:flex;flex-direction:column;align-items:center;gap:1rem}
    .balance{display:flex;align-items:center;gap:.75rem}
    .coin{width:48px;height:48px;background:radial-gradient(circle at 30% 30%,#fff, #ffd24a 20%, #e6b12c 60%);border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#1b1b1b}
    .big-balance{font-size:2.2rem;font-weight:700}
    .mine-btn{width:260px;height:90px;border-radius:18px;background:linear-gradient(180deg,#ffd24a,#f0b42a);color:#1b1b1b;font-size:1.6rem;font-weight:800;border:none;cursor:pointer;box-shadow:0 8px 24px rgba(240,180,42,0.18)}
    .mine-btn:active{transform:translateY(2px)}
    .muted{color:var(--muted);font-size:.95rem}
    .shop{display:flex;flex-direction:column;gap:.75rem}
    .shop-item{display:flex;align-items:center;justify-content:space-between;padding:.6rem;border-radius:10px;background:rgba(255,255,255,0.02)}
    .flex{display:flex;gap:.5rem;align-items:center}
    .small{font-size:.9rem}
    footer{margin-top:1rem;text-align:center;color:var(--muted);font-size:.85rem}
    .leaderboard{margin-top:.75rem}
    .mini{font-size:.85rem}
    .spark{position:fixed;pointer-events:none;z-index:50}
    
    /* User Rank Badge */
    .user-rank {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 0.5rem;
    }
    
    .rank-badge {
      padding: 0.3rem 0.6rem;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }
    
    .rank-novice { background: linear-gradient(90deg, #7c7c7c, #5a5a5a); color: white; }
    .rank-amateur { background: linear-gradient(90deg, #4c7eff, #2a5bff); color: white; }
    .rank-normal { background: linear-gradient(90deg, #4caf50, #2e7d32); color: white; }
    .rank-standard { background: linear-gradient(90deg, #9c27b0, #7b1fa2); color: white; }
    .rank-professional { background: linear-gradient(90deg, #ff9800, #f57c00); color: white; }
    .rank-vip { background: linear-gradient(90deg, #e91e63, #c2185b); color: white; }
    .rank-gold { background: linear-gradient(90deg, #ffd700, #ffc400); color: #1b1b1b; }
    .rank-hero { background: linear-gradient(90deg, #00bcd4, #0097a7); color: white; }
    .rank-angel { background: linear-gradient(90deg, #9c27b0, #7b1fa2); color: white; }
    .rank-superhero { background: linear-gradient(90deg, #ff0000, #c62828); color: white; }
    
    .rank-icon {
      font-size: 0.9rem;
    }
    
    .rank-progress {
      width: 100%;
      height: 6px;
      background: rgba(255,255,255,0.1);
      border-radius: 3px;
      margin-top: 0.3rem;
      overflow: hidden;
    }
    
    .rank-progress-bar {
      height: 100%;
      background: linear-gradient(90deg, #ffd24a, #f0b42a);
      border-radius: 3px;
      transition: width 0.3s ease;
    }
    
    .rank-info {
      display: flex;
      justify-content: space-between;
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 0.2rem;
    }
    
    /* Profile Page Styles */
    .profile-container {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }
    
    .profile-header {
      display: flex;
      align-items: center;
      gap: 1.5rem;
      padding: 1.5rem;
    }
    
    .profile-avatar {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      background: linear-gradient(135deg, #ffd24a, #f0b42a);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.5rem;
    }
    
    .profile-info {
      flex: 1;
    }
    
    .profile-username {
      font-size: 1.5rem;
      font-weight: 700;
      margin: 0 0 0.5rem 0;
    }
    
    .profile-stats {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 1rem;
      margin-top: 1rem;
    }
    
    .stat-card {
      background: rgba(255,255,255,0.02);
      border-radius: 12px;
      padding: 1rem;
      display: flex;
      flex-direction: column;
    }
    
    .stat-value {
      font-size: 1.8rem;
      font-weight: 700;
      color: var(--accent);
    }
    
    .stat-label {
      font-size: 0.85rem;
      color: var(--muted);
    }
    
    .profile-section {
      margin-top: 1rem;
    }
    
    .profile-section-title {
      font-size: 1.2rem;
      font-weight: 700;
      margin-bottom: 1rem;
      padding-bottom: 0.5rem;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    
    .achievement-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 1rem;
    }
    
    .achievement-item {
      background: rgba(255,255,255,0.02);
      border-radius: 12px;
      padding: 1rem;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    
    .achievement-icon {
      font-size: 2rem;
      margin-bottom: 0.5rem;
    }
    
    .achievement-name {
      font-weight: 700;
      font-size: 0.9rem;
    }
    
    .achievement-desc {
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 0.3rem;
    }
    
    .settings-list {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    
    .settings-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.8rem;
      background: rgba(255,255,255,0.02);
      border-radius: 8px;
      cursor: pointer;
      transition: background 0.2s;
    }
    
    .settings-item:hover {
      background: rgba(255,255,255,0.05);
    }
    
    .logout-btn {
      background: rgba(255, 80, 80, 0.15);
      color: #ff5050;
      border: none;
      padding: 0.8rem;
      border-radius: 8px;
      cursor: pointer;
      font-weight: 700;
      margin-top: 1rem;
      width: 100%;
      transition: background 0.2s;
    }
    
    .logout-btn:hover {
      background: rgba(255, 80, 80, 0.25);
    }
    
    /* Swap Page Styles */
    .swap-container {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }
    
    .swap-card {
      background: rgba(255,255,255,0.02);
      border-radius: 12px;
      padding: 1.5rem;
    }
    
    .swap-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 1.5rem;
    }
    
    .swap-title {
      font-size: 1.5rem;
      font-weight: 700;
    }
    
    .swap-rate {
      font-size: 0.9rem;
      color: var(--muted);
    }
    
    .swap-form {
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }
    
    .input-group {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    
    .input-label {
      font-size: 0.9rem;
      color: var(--muted);
    }
    
    .input-field {
      display: flex;
      align-items: center;
      background: rgba(255,255,255,0.05);
      border-radius: 10px;
      padding: 0.8rem;
      border: 1px solid rgba(255,255,255,0.06);
    }
    
    .input-field input {
      flex: 1;
      background: none;
      border: none;
      color: white;
      font-size: 1.2rem;
      outline: none;
    }
    
    .input-field .token {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-weight: 700;
    }
    
    .token-icon {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .tm-icon {
      background: radial-gradient(circle at 30% 30%,#fff, #ffd24a 20%, #e6b12c 60%);
      color: #1b1b1b;
      font-weight: 700;
      font-size: 0.8rem;
    }
    
    .em-icon {
      background: linear-gradient(135deg, #4c7eff, #2a5bff);
      color: white;
      font-weight: 700;
      font-size: 0.8rem;
    }
    
    .swap-button {
      background: linear-gradient(180deg, #ffd24a, #f0b42a);
      color: #1b1b1b;
      border: none;
      padding: 1rem;
      border-radius: 10px;
      font-weight: 700;
      cursor: pointer;
      margin-top: 1rem;
      transition: all 0.2s;
    }
    
    .swap-button:disabled {
      background: rgba(255,255,255,0.1);
      color: var(--muted);
      cursor: not-allowed;
    }
    
    .swap-button:not(:disabled):hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(240,180,42,0.3);
    }
    
    .swap-history {
      margin-top: 1.5rem;
    }
    
    .history-title {
      font-size: 1.2rem;
      font-weight: 700;
      margin-bottom: 1rem;
      padding-bottom: 0.5rem;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    
    .history-list {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    
    .history-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.8rem;
      background: rgba(255,255,255,0.02);
      border-radius: 8px;
    }
    
    .history-details {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }
    
    .history-amount {
      font-weight: 700;
    }
    
    .history-date {
      font-size: 0.75rem;
      color: var(--muted);
    }
    
    .page {
      display: none;
    }
    
    .page.active {
      display: block;
    }
    
    /* Auth Modal Styles */
    .auth-modal {
      position: fixed;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      display: none;
      align-items: center;
      justify-content: center;
      background: rgba(2,6,23,0.6);
      z-index: 40;
    }
    
    .auth-tabs {
      display: flex;
      border-bottom: 1px solid rgba(255,255,255,0.06);
      margin-bottom: 1rem;
    }
    
    .auth-tab {
      flex: 1;
      text-align: center;
      padding: 0.8rem;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .auth-tab.active {
      color: var(--accent);
      border-bottom: 2px solid var(--accent);
    }
    
    .auth-form {
      display: none;
    }
    
    .auth-form.active {
      display: block;
    }
    
    .form-group {
      margin-bottom: 1rem;
    }
    
    .form-group label {
      display: block;
      margin-bottom: 0.5rem;
      font-size: 0.9rem;
      color: var(--muted);
    }
    
    .form-group input {
      width: 100%;
      padding: 0.8rem;
      border-radius: 8px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(255,255,255,0.05);
      color: white;
    }
    
    .auth-btn {
      width: 100%;
      padding: 0.8rem;
      border-radius: 8px;
      border: none;
      background: var(--accent);
      color: #1b1b1b;
      font-weight: 700;
      cursor: pointer;
      margin-top: 0.5rem;
    }
    
    .auth-error {
      color: #ff6b6b;
      font-size: 0.85rem;
      margin-top: 0.5rem;
      display: none;
    }
    
    /* JSON Data Management Styles */
    .json-management {
      margin-top: 1rem;
      padding: 1rem;
      background: rgba(255,255,255,0.02);
      border-radius: 12px;
    }
    
    .json-buttons {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1rem;
    }
    
    .json-btn {
      padding: 0.5rem 1rem;
      border-radius: 8px;
      border: none;
      background: rgba(255,255,255,0.05);
      color: white;
      cursor: pointer;
      font-size: 0.85rem;
      transition: background 0.2s;
    }
    
    .json-btn:hover {
      background: rgba(255,255,255,0.1);
    }
    
    .json-textarea {
      width: 100%;
      height: 200px;
      background: rgba(255,255,255,0.05);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 8px;
      padding: 0.8rem;
      color: white;
      font-family: monospace;
      font-size: 0.85rem;
      resize: vertical;
    }
    
    @media(max-width:880px){
      .layout{grid-template-columns:1fr;}
      .mine-btn{width:100%;height:72px}
      .profile-stats {
        grid-template-columns: 1fr;
      }
      .achievement-list {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      }
    }
    
    @media(max-width:600px){
      .app {
        margin: 60px auto 70px;
        padding: 0.5rem;
      }
      .top-navbar, .bottom-navbar {
        padding: 0.6rem 0.8rem;
      }
      h1 {
        font-size: 1.1rem;
      }
      .nav-label {
        font-size: 0.65rem;
      }
      .profile-header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
      }
      .swap-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
      }
    }
  