/* ═══════════════════════════════════════════════════════════
   NVFS — Premium Dark × Gold × Red Theme
   Glassmorphism · Mobile-first · Card UI
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Rajdhani:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --bg0:   #0a0a0f;
  --bg1:   #0f0f1a;
  --bg2:   #141420;
  --bg3:   #1a1a2e;
  --bg4:   #1e1e35;
  --glass: rgba(255,255,255,0.04);
  --glass2:rgba(255,255,255,0.07);
  --bdr:   rgba(255,255,255,0.08);
  --bdr2:  rgba(255,255,255,0.14);
  --red:   #c0392b;
  --red2:  #e74c3c;
  --red3:  #ff6b6b;
  --gold:  #e6a817;
  --gold2: #f5c842;
  --gold3: #ffd700;
  --tx1:   #f0ece4;
  --tx2:   #a09880;
  --tx3:   #5a5648;
  --r:     14px;
  --rs:    8px;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
  --shadow-gold: 0 0 24px rgba(230,168,23,.18);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100%;
  background: var(--bg0);
  color: var(--tx1);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
input, select, button, textarea { font-family: inherit; font-size: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Typography ───────────────────────────────────────────── */
.bebas    { font-family: 'Bebas Neue', sans-serif; letter-spacing: .04em; }
.raj      { font-family: 'Rajdhani', sans-serif; font-weight: 700; }
.title-xl { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; letter-spacing: .06em; color: var(--gold); }
.title-lg { font-family: 'Rajdhani', sans-serif; font-size: 1.3rem; font-weight: 700; }
.subtitle { font-size: .78rem; color: var(--tx2); }
.label    { font-size: .7rem; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; }

/* ── Background mesh ─────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(192,57,43,.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 90%, rgba(230,168,23,.08) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

/* ── Screens ──────────────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  position: relative; z-index: 1;
}
.screen.active { display: flex; }

#appScreen {
  display: none;
  flex-direction: column;
  min-height: 100svh;
  position: relative; z-index: 1;
}
#appScreen.active { display: flex; }

/* ── Auth card ────────────────────────────────────────────── */
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--bdr2);
  border-radius: var(--r);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
}
.logo-ring {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(192,57,43,.4), var(--shadow-gold);
  overflow: hidden;
  margin: 0 auto 1.25rem;
  flex-shrink: 0;
}
.logo-ring img { width: 100%; height: 100%; object-fit: cover; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--glass);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: 1rem;
  margin-bottom: .625rem;
  backdrop-filter: blur(12px);
}
.card-gold { border-color: rgba(230,168,23,.3); background: rgba(230,168,23,.04); }
.card-red  { border-color: rgba(192,57,43,.3);  background: rgba(192,57,43,.04); }
.card-glass2 { background: var(--glass2); }

/* ── Form fields ──────────────────────────────────────────── */
.fld { margin-bottom: .875rem; }
.lbl {
  display: block;
  font-size: .7rem; color: var(--tx3);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .35rem;
}
.fld-hint { font-size: .67rem; color: var(--tx3); margin-top: .25rem; }
.fld-err  { font-size: .72rem; color: var(--red3); margin-top: .25rem; min-height: 1em; }
input[type="text"], input[type="password"], input[type="tel"],
input[type="number"], input[type="url"], input[type="email"],
select, textarea {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--bdr2);
  border-radius: var(--rs);
  padding: .65rem .875rem;
  color: var(--tx1);
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
select option { background: var(--bg3); color: var(--tx1); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .65rem 1.25rem;
  border: none; border-radius: var(--rs);
  font-weight: 600; font-size: .85rem;
  cursor: pointer; transition: all .18s;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn-full { width: 100%; }
.btn-red    { background: var(--red);  color: #fff; }
.btn-red:hover    { background: var(--red2); }
.btn-gold   { background: var(--gold); color: #111; }
.btn-gold:hover   { background: var(--gold2); }
.btn-ghost  { background: var(--glass2); color: var(--tx2); border: 1px solid var(--bdr2); }
.btn-ghost:hover  { background: rgba(255,255,255,.1); color: var(--tx1); }
.btn-danger { background: rgba(127,29,29,.8); color: #fca5a5; }
.btn-sm { padding: .4rem .85rem; font-size: .78rem; }
.btn-xs { padding: .3rem .6rem; font-size: .72rem; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 99px;
  font-size: .68rem; font-weight: 600;
  white-space: nowrap;
}
.b-gold   { background: rgba(230,168,23,.15); color: var(--gold2); }
.b-red    { background: rgba(192,57,43,.2);   color: var(--red3); }
.b-green  { background: rgba(34,197,94,.12);  color: #4ade80; }
.b-blue   { background: rgba(59,130,246,.15); color: #93c5fd; }
.b-orange { background: rgba(234,88,12,.15);  color: #fb923c; }
.b-gray   { background: rgba(255,255,255,.08); color: var(--tx2); }

/* ── Avatar ───────────────────────────────────────────────── */
.av {
  border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Rajdhani', sans-serif;
  flex-shrink: 0;
  background: var(--bg3);
  border: 2px solid var(--bdr2);
  color: var(--gold);
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-lg  { width: 80px;  height: 80px;  font-size: 1.4rem; border: 3px solid var(--red); }
.av-md  { width: 44px;  height: 44px;  font-size: .9rem; }
.av-sm  { width: 32px;  height: 32px;  font-size: .7rem; }
.av-xs  { width: 26px;  height: 26px;  font-size: .58rem; }

/* ── Photo upload ─────────────────────────────────────────── */
.photo-up {
  border-radius: 50%; overflow: hidden;
  border: 2px dashed var(--bdr2);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  background: var(--bg3);
  transition: border-color .2s;
}
.photo-up:hover { border-color: var(--gold); }
.photo-up img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-up .ov {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center;
  font-size: 1.1rem; border-radius: 50%;
}
.photo-up:hover .ov { display: flex; }

/* ── Header ───────────────────────────────────────────────── */
.hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bdr);
  position: sticky; top: 0; z-index: 100;
  flex-shrink: 0;
}
.hdr-logo { display: flex; align-items: center; gap: .6rem; }
.hdr-logo img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold); }
.htitle { font-family: 'Bebas Neue', sans-serif; font-size: 1.2rem; color: var(--gold); letter-spacing: .04em; line-height: 1; }
.hsub   { font-size: .65rem; color: var(--tx3); line-height: 1; margin-top: 1px; }
.hav {
  width: 34px; height: 34px; border-radius: 50%;
  overflow: hidden; cursor: pointer;
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: var(--gold);
  background: var(--bg3); flex-shrink: 0;
}
.hav img { width: 100%; height: 100%; object-fit: cover; }

/* ── Bottom nav ───────────────────────────────────────────── */
.bnav {
  display: flex; align-items: center;
  background: rgba(10,10,15,.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--bdr);
  position: sticky; bottom: 0; z-index: 100;
  flex-shrink: 0;
}
.ni {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; padding: .55rem .25rem;
  cursor: pointer; color: var(--tx3);
  transition: color .2s; font-size: .6rem;
  position: relative; border: none; background: none;
}
.ni.active { color: var(--gold); }
.ni-ic { font-size: 1.2rem; line-height: 1; }
.ni .badge {
  position: absolute; top: 4px; right: 12px;
  width: 8px; height: 8px; padding: 0;
  background: var(--red); border-radius: 50%;
  border: 1.5px solid var(--bg0);
}

/* ── Pages ────────────────────────────────────────────────── */
.page-wrap {
  flex: 1; overflow-y: auto;
  padding: .875rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
}
.page { display: none; }
.page.active { display: block; }

/* ── Stat boxes ───────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .5rem; margin-bottom: .75rem; }
.stat-box {
  background: var(--glass);
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  padding: .75rem .5rem;
  text-align: center;
}
.sv { font-family: 'Bebas Neue', sans-serif; font-size: 1.7rem; color: var(--gold); line-height: 1; }
.sl { font-size: .62rem; color: var(--tx3); margin-top: 2px; text-transform: uppercase; letter-spacing: .05em; }

/* ── Member row ───────────────────────────────────────────── */
.mrow {
  display: flex; align-items: center; gap: 10px;
  padding: .6rem 0;
  border-bottom: 1px solid var(--bdr);
  cursor: pointer;
}
.mrow:last-child { border: none; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: .35rem; margin-bottom: .875rem; }
.tab {
  flex: 1; text-align: center;
  padding: .5rem; border-radius: var(--rs);
  font-size: .78rem; font-weight: 600;
  cursor: pointer; color: var(--tx3);
  background: var(--glass);
  border: 1px solid var(--bdr);
  transition: all .18s;
}
.tab.active { background: var(--red); color: #fff; border-color: transparent; }

/* ── Divider ──────────────────────────────────────────────── */
.divider { height: 1px; background: var(--bdr); margin: .875rem 0; }

/* ── Modal ────────────────────────────────────────────────── */
.mover {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
  display: none; align-items: flex-end; justify-content: center;
}
.mover.open { display: flex; }
.modal {
  width: 100%; max-width: 440px;
  background: var(--bg2);
  border: 1px solid var(--bdr2);
  border-radius: var(--r) var(--r) 0 0;
  padding: 1.25rem 1rem 2rem;
  max-height: 90svh; overflow-y: auto;
}
.mhdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.mtitle { font-family: 'Rajdhani', sans-serif; font-size: 1.1rem; font-weight: 700; }
.xbtn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--glass2); border: 1px solid var(--bdr2);
  color: var(--tx2); cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg3); border: 1px solid var(--bdr2);
  border-radius: 99px; padding: .55rem 1.25rem;
  font-size: .8rem; color: var(--tx1);
  white-space: nowrap; z-index: 999;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, bottom .25s;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; bottom: 90px; }

/* ── Podium ───────────────────────────────────────────────── */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: .5rem; margin-bottom: 1rem; }
.pod { flex: 1; max-width: 100px; border-radius: var(--rs) var(--rs) 0 0; padding: .75rem .5rem; text-align: center; }
.pod1 { background: linear-gradient(180deg, rgba(230,168,23,.25) 0%, rgba(230,168,23,.08) 100%); border: 1px solid rgba(230,168,23,.3); min-height: 100px; }
.pod2 { background: linear-gradient(180deg, rgba(192,200,212,.15) 0%, rgba(192,200,212,.04) 100%); border: 1px solid rgba(192,200,212,.2); min-height: 80px; }
.pod3 { background: linear-gradient(180deg, rgba(180,100,46,.15) 0%, rgba(180,100,46,.04) 100%); border: 1px solid rgba(180,100,46,.2); min-height: 65px; }

/* ── Toggle ───────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.tsl {
  position: absolute; inset: 0;
  background: var(--bg4); border-radius: 99px;
  transition: background .2s;
  border: 1px solid var(--bdr2);
}
.tsl::after {
  content: ''; position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--tx3); transition: all .2s;
}
.toggle input:checked + .tsl { background: var(--red); border-color: var(--red); }
.toggle input:checked + .tsl::after { left: 20px; background: #fff; }

/* ── Attendance list ──────────────────────────────────────── */
.att-row {
  display: flex; align-items: center; gap: 10px;
  padding: .55rem 0; border-bottom: 1px solid var(--bdr);
}

/* ── Request row ──────────────────────────────────────────── */
.req-row {
  display: flex; align-items: center; gap: 10px;
  padding: .75rem; border-radius: var(--rs);
  background: var(--glass); border: 1px solid var(--bdr);
  margin-bottom: .5rem;
}

/* ── Score input grid ─────────────────────────────────────── */
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

/* ── Section header ───────────────────────────────────────── */
.ch { display: flex; align-items: center; justify-content: space-between; margin-bottom: .625rem; }
.ct { font-family: 'Rajdhani', sans-serif; font-size: .95rem; font-weight: 700; }

/* ── Leaderboard row ──────────────────────────────────────── */
.lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: .5rem 0; border-bottom: 1px solid var(--bdr);
}
.lb-rank { font-family: 'Bebas Neue', sans-serif; font-size: 1.1rem; color: var(--tx3); width: 20px; text-align: center; flex-shrink: 0; }

/* ── Payment row ──────────────────────────────────────────── */
.pay-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem 0; border-bottom: 1px solid var(--bdr);
}

/* ── Search ───────────────────────────────────────────────── */
.search-bar {
  width: 100%;
  background: var(--glass);
  border: 1px solid var(--bdr2);
  border-radius: var(--rs);
  padding: .6rem .875rem;
  color: var(--tx1);
  outline: none;
  font-size: .88rem;
  margin-bottom: .75rem;
}
.search-bar:focus { border-color: var(--gold); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bdr2); border-radius: 2px; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card, .auth-card, .req-row, .mrow { animation: fadeIn .25s ease both; }

/* ── Light mode ───────────────────────────────────────────── */
body[data-theme="light"] {
  --bg0: #f4f0e8; --bg1: #ede8dc; --bg2: #e8e2d4; --bg3: #e0d9c8;
  --bg4: #d8cfba; --glass: rgba(0,0,0,.03); --glass2: rgba(0,0,0,.05);
  --bdr: rgba(0,0,0,.1); --bdr2: rgba(0,0,0,.18);
  --tx1: #1a1810; --tx2: #6b6048; --tx3: #a09068;
}

/* ── Utility ──────────────────────────────────────────────── */
.flex { display: flex; } .flex-1 { flex: 1; }
.gap4  { gap: .25rem; } .gap8  { gap: .5rem; }
.gap12 { gap: .75rem; } .gap16 { gap: 1rem; }
.mt8  { margin-top: .5rem; } .mt12 { margin-top: .75rem; }
.mb8  { margin-bottom: .5rem; } .mb12 { margin-bottom: .75rem; }
.tc   { text-align: center; }
.bold { font-weight: 700; }
.gold { color: var(--gold); }
.red  { color: var(--red3); }
.tx2  { color: var(--tx2); } .tx3 { color: var(--tx3); }
.f78  { font-size: .78rem; } .f72 { font-size: .72rem; }
