/* ============================================
   BASE — Variables, Reset, Layout
   NIT Hamirpur Ground Run
   ============================================ */

   :root {
    /* Colors */
    --bg-primary: #0d0f0d;
    --bg-card: #141a14;
    --bg-elevated: #1c251c;
    --bg-input: #1a201a;
  
    --green: #6db36d;
    --green-dim: #3a6e3a;
    --green-bright: #8fd68f;
    --green-glow: rgba(109, 179, 109, 0.15);
  
    --amber: #e8b84b;
    --amber-dim: #7a5e1a;
    --red: #ff4d2e;
    --red-dim: #7a2010;
  
    --text-primary: #f0f4f0;
    --text-secondary: #8a9e8a;
    --text-muted: #4a5e4a;
    --border: rgba(109, 179, 109, 0.12);
    --border-strong: rgba(109, 179, 109, 0.25);
  
    /* Typography */
    --font-display: 'Barlow Condensed', sans-serif;
    --font-body: 'Barlow', sans-serif;
  
    /* Sizes */
    --nav-height: 70px;
    --header-height: 56px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
  }
  
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  
  html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  
  /* ============================================
     SCREEN SYSTEM
     ============================================ */
  .screen {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
  }
  .screen.active { display: flex; }
  
  /* ============================================
     SPLASH SCREEN
     ============================================ */
  #screen-splash {
    background: var(--bg-primary);
    position: relative;
  }
  .splash-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
  }
  .track-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--border);
    transform: translate(-50%, -50%);
    top: 0;
    left: 0;
  }
  .ring.r1 { width: 260px; height: 260px; }
  .ring.r2 { width: 420px; height: 420px; border-color: rgba(109,179,109,0.07); }
  .ring.r3 { width: 580px; height: 580px; border-color: rgba(109,179,109,0.04); }
  
  .splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 24px 24px 48px;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
  }
  .brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--green-glow);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
  }
  .brand-text {
    display: flex;
    flex-direction: column;
  }
  .brand-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
  }
  .brand-sub {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    font-weight: 500;
  }
  .splash-headline {
    font-family: var(--font-display);
    font-size: 72px;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -1px;
    color: var(--text-primary);
    margin-bottom: 16px;
  }
  .splash-tagline {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 36px;
    max-width: 300px;
  }
  .splash-actions { display: flex; flex-direction: column; gap: 12px; }
  
  /* ============================================
     AUTH SCREENS
     ============================================ */
  .screen-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-secondary);
    height: var(--header-height);
    flex-shrink: 0;
  }
  .btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
  }
  .btn-back:hover { color: var(--text-primary); }
  
  .form-screen {
    flex: 1;
    overflow-y: auto;
    padding: 24px 24px 40px;
  }
  .form-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
    gap: 8px;
  }
  .avatar-picker {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--green-glow);
    border: 2px solid var(--green-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 1px;
  }
  .login-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
  }
  .form-hint {
    font-size: 13px;
    color: var(--text-muted);
  }
  
  /* ============================================
     APP LAYOUT
     ============================================ */
  #screen-app { background: var(--bg-primary); }
  
  .app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-primary);
  }
  .app-header-left { display: flex; align-items: center; gap: 10px; }
  .app-header-right { display: flex; align-items: center; gap: 8px; }

  .user-avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--green-glow);
    border: 1px solid var(--green-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: var(--green);
    flex-shrink: 0;
  }
  .user-name-sm {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
  }
  .user-meta-sm {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
  }
  .streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(232,184,75,0.1);
    border: 1px solid rgba(232,184,75,0.2);
    border-radius: 20px;
    padding: 4px 10px;
    color: var(--amber);
    font-size: 13px;
    font-weight: 600;
  }
  
  .page {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
  }
  .page.active { display: flex; }
  .page-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px calc(var(--nav-height) + 20px);
    scroll-behavior: smooth;
  }
  .page-scroll::-webkit-scrollbar { display: none; }
  
  /* Bottom Nav */
  .bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    z-index: 10;
  }
  .nav-item {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    font-family: var(--font-body);
  }
  .nav-item.active { color: var(--green); }
  .nav-item:hover { color: var(--text-secondary); }
  
  /* Toast */
  .toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    z-index: 100;
  }
  .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  
  /* Section titles */
  .section-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 10px;
  }
  .section-block { margin-top: 20px; }