/* =========================================================
   FREE FIRE ARENA — design tokens
   Palette:
     --void        #0A0D12  base background
     --panel       #131820  card surface
     --panel-raised#1B222D  raised surface (modals, inputs)
     --line        #232B36  hairline borders
     --cyan        #21E6C1  primary accent — live / verified / go
     --orange      #FF7A29  secondary accent — action / fire / alert
     --danger      #FF4D6D  reject / error
     --text        #E8ECF1  primary text
     --muted       #8B96A5  secondary text
   Type:
     display: 'Rajdhani' — condensed, angular, HUD-like
     body:    'Inter'
     mono:    'JetBrains Mono' — UIDs, UTR, room credentials
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root{
  --void:#0A0D12;
  --panel:#131820;
  --panel-raised:#1B222D;
  --line:#232B36;
  --cyan:#21E6C1;
  --cyan-dim: #21E6C133;
  --orange:#FF7A29;
  --orange-dim:#FF7A2933;
  --danger:#FF4D6D;
  --danger-dim:#FF4D6D33;
  --text:#E8ECF1;
  --muted:#8B96A5;
  --radius:10px;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, #1a2536 0%, transparent 60%),
    radial-gradient(ellipse 700px 500px at 110% 10%, #2a1a1c 0%, transparent 55%),
    var(--void);
  color:var(--text);
  font-family:'Inter', sans-serif;
  -webkit-font-smoothing:antialiased;
  min-height:100vh;
}
h1,h2,h3,h4, .display{
  font-family:'Rajdhani', sans-serif;
  font-weight:700;
  letter-spacing:.02em;
  margin:0;
}
.mono{ font-family:'JetBrains Mono', monospace; }
a{ color:inherit; }
button{ font-family:inherit; }
::selection{ background:var(--cyan); color:#031512; }

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible{
  outline:2px solid var(--cyan);
  outline-offset:2px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* ---------- layout shells ---------- */
.app{
  max-width:520px;
  margin:0 auto;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  position:relative;
  padding-bottom:84px; /* space for bottom nav */
}
.admin-shell{
  max-width:960px;
  margin:0 auto;
  min-height:100vh;
  padding:0 16px 40px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 18px 14px;
  position:sticky;
  top:0;
  z-index:20;
  background:linear-gradient(180deg, var(--void) 70%, transparent);
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand-mark{
  width:34px;height:34px;
  display:grid;place-items:center;
  background:var(--panel-raised);
  border:1px solid var(--line);
  clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);
  color:var(--cyan);
  font-family:'Rajdhani',sans-serif;
  font-weight:700;
}
.brand-name{ font-size:1.15rem; }
.brand-name b{ color:var(--orange); }

.icon-btn{
  width:38px;height:38px;
  border-radius:50%;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--text);
  display:grid;place-items:center;
  cursor:pointer;
}
.icon-btn:hover{ border-color:var(--cyan); color:var(--cyan); }

main{ padding:0 16px; flex:1; }

/* ---------- section headers ---------- */
.section-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  margin:22px 0 12px;
}
.section-head h2{ font-size:1.15rem; }
.eyebrow{
  font-family:'Rajdhani',sans-serif;
  font-size:.72rem;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--muted);
}

/* ---------- mode filter chips ---------- */
.chip-row{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:4px;
  margin-bottom:4px;
  scrollbar-width:none;
}
.chip-row::-webkit-scrollbar{ display:none; }
.chip{
  flex:none;
  padding:7px 14px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--muted);
  font-size:.82rem;
  font-weight:600;
  cursor:pointer;
  white-space:nowrap;
}
.chip.active{
  border-color:var(--cyan);
  color:var(--cyan);
  background:var(--cyan-dim);
}

/* ---------- tournament card ---------- */
.t-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:14px;
  position:relative;
  overflow:hidden;
}
.t-card::before{
  content:"";
  position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--cyan);
}
.t-card.mode-clash::before{ background:var(--orange); }

.t-card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.t-title{ font-size:1.15rem; line-height:1.15; }
.t-map{ color:var(--muted); font-size:.82rem; margin-top:2px; }
.mode-tag{
  font-family:'Rajdhani',sans-serif;
  font-size:.7rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  padding:3px 9px;
  border-radius:5px;
  background:var(--panel-raised);
  color:var(--cyan);
  border:1px solid var(--line);
  flex:none;
}

.t-meta{
  display:flex;
  gap:16px;
  margin:12px 0 10px;
  font-size:.82rem;
}
.t-meta div b{
  display:block;
  font-family:'Rajdhani',sans-serif;
  font-size:1rem;
  color:var(--text);
}
.t-meta div span{ color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; }

.prize-row{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}
.prize-pill{
  flex:1;
  background:var(--panel-raised);
  border:1px solid var(--line);
  border-radius:8px;
  padding:8px 10px;
  text-align:center;
}
.prize-pill b{ display:block; font-family:'Rajdhani',sans-serif; color:var(--orange); font-size:1.05rem; }
.prize-pill span{ font-size:.68rem; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }

/* signature element: ammo-belt slot meter */
.slot-meter-label{
  display:flex;
  justify-content:space-between;
  font-size:.75rem;
  color:var(--muted);
  margin-bottom:5px;
}
.slot-meter-label b{ color:var(--text); font-family:'Rajdhani',sans-serif; }
.ammo-belt{
  display:flex;
  gap:2px;
  height:9px;
  margin-bottom:14px;
}
.ammo-belt i{
  flex:1;
  background:var(--panel-raised);
  border:1px solid var(--line);
  border-radius:1px;
}
.ammo-belt i.filled{ background:var(--cyan); border-color:var(--cyan); }
.ammo-belt.hot i.filled{ background:var(--orange); border-color:var(--orange); }

.t-card-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.entry-fee{ font-family:'Rajdhani',sans-serif; font-size:1.1rem; }
.entry-fee span{ color:var(--muted); font-size:.72rem; display:block; font-weight:500; letter-spacing:.05em; }

/* ---------- buttons ---------- */
.btn{
  border:none;
  border-radius:8px;
  padding:11px 18px;
  font-weight:700;
  font-family:'Rajdhani',sans-serif;
  letter-spacing:.03em;
  font-size:.95rem;
  cursor:pointer;
  text-transform:uppercase;
}
.btn-primary{ background:var(--cyan); color:#031814; }
.btn-primary:hover{ filter:brightness(1.08); }
.btn-primary:disabled{ background:var(--line); color:var(--muted); cursor:not-allowed; }
.btn-accent{ background:var(--orange); color:#211000; }
.btn-outline{ background:transparent; border:1px solid var(--line); color:var(--text); }
.btn-outline:hover{ border-color:var(--cyan); color:var(--cyan); }
.btn-danger{ background:var(--danger); color:#2a0008; }
.btn-block{ width:100%; }
.btn-sm{ padding:7px 12px; font-size:.78rem; }

/* ---------- status badges (rank-insignia hexagons) ---------- */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-family:'Rajdhani',sans-serif;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.05em;
  text-transform:uppercase;
  padding:4px 10px 4px 8px;
  border-radius:6px;
}
.badge::before{
  content:"";
  width:9px;height:9px;
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}
.badge-pending{ background:var(--orange-dim); color:var(--orange); }
.badge-pending::before{ background:var(--orange); }
.badge-approved{ background:var(--cyan-dim); color:var(--cyan); }
.badge-approved::before{ background:var(--cyan); }
.badge-rejected{ background:var(--danger-dim); color:var(--danger); }
.badge-rejected::before{ background:var(--danger); }

/* ---------- bottom nav ---------- */
.bottom-nav{
  position:fixed;
  left:0; right:0; bottom:0;
  max-width:520px;
  margin:0 auto;
  background:var(--panel);
  border-top:1px solid var(--line);
  display:flex;
  z-index:30;
}
.nav-item{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  padding:10px 0 12px;
  color:var(--muted);
  cursor:pointer;
  font-size:.7rem;
  font-weight:600;
  border:none;
  background:none;
}
.nav-item svg{ width:20px; height:20px; }
.nav-item.active{ color:var(--cyan); }

/* ---------- modal ---------- */
.modal-backdrop{
  position:fixed; inset:0;
  background:#04060ac0;
  backdrop-filter:blur(2px);
  display:none;
  align-items:flex-end;
  justify-content:center;
  z-index:100;
}
.modal-backdrop.open{ display:flex; }
.modal{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px 16px 0 0;
  width:100%;
  max-width:520px;
  max-height:92vh;
  overflow-y:auto;
  padding:20px 18px 28px;
  animation:sheet-up .22s ease;
}
@keyframes sheet-up{ from{ transform:translateY(24px); opacity:0; } to{ transform:translateY(0); opacity:1; } }
.modal-head{
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:16px;
}
.modal-close{ background:none; border:none; color:var(--muted); font-size:1.4rem; cursor:pointer; line-height:1; }

/* ---------- form elements ---------- */
.field{ margin-bottom:14px; }
.field label{
  display:block;
  font-size:.78rem;
  color:var(--muted);
  margin-bottom:6px;
  font-weight:600;
}
.field input, .field select, .field textarea{
  width:100%;
  background:var(--panel-raised);
  border:1px solid var(--line);
  border-radius:8px;
  padding:11px 12px;
  color:var(--text);
  font-size:.92rem;
  font-family:inherit;
}
.field input:focus, .field select:focus, .field textarea:focus{
  border-color:var(--cyan);
  outline:none;
}
.field small{ color:var(--muted); font-size:.72rem; display:block; margin-top:4px; }
.field-row{ display:flex; gap:10px; }
.field-row .field{ flex:1; }

.qr-box{
  background:var(--panel-raised);
  border:1px solid var(--line);
  border-radius:10px;
  padding:16px;
  text-align:center;
  margin-bottom:16px;
}
.qr-box img{ width:180px; height:180px; object-fit:contain; border-radius:8px; background:#fff; padding:6px; }
.upi-id{
  margin-top:10px;
  font-family:'JetBrains Mono',monospace;
  font-size:.95rem;
  color:var(--cyan);
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.copy-btn{
  background:var(--panel);
  border:1px solid var(--line);
  color:var(--muted);
  border-radius:6px;
  font-size:.68rem;
  padding:3px 8px;
  cursor:pointer;
}

.file-drop{
  border:1.5px dashed var(--line);
  border-radius:10px;
  padding:20px;
  text-align:center;
  color:var(--muted);
  font-size:.85rem;
  cursor:pointer;
  position:relative;
}
.file-drop.has-file{ border-color:var(--cyan); color:var(--cyan); }
.file-drop input{ position:absolute; inset:0; opacity:0; cursor:pointer; }
.preview-thumb{ max-width:100%; max-height:160px; border-radius:8px; margin-top:10px; }

/* ---------- credential unlock ---------- */
.credential-box{
  background:var(--panel-raised);
  border:1px solid var(--cyan);
  border-radius:10px;
  padding:16px;
  margin-top:10px;
}
.credential-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:9px 0;
  border-bottom:1px solid var(--line);
}
.credential-row:last-child{ border-bottom:none; }
.credential-row span{ color:var(--muted); font-size:.8rem; }
.credential-row b{ font-family:'JetBrains Mono',monospace; color:var(--text); font-size:1rem; }
.locked-box{
  background:var(--panel-raised);
  border:1px dashed var(--line);
  border-radius:10px;
  padding:18px;
  text-align:center;
  color:var(--muted);
  font-size:.85rem;
  margin-top:10px;
}
.countdown{
  font-family:'JetBrains Mono',monospace;
  font-size:1.3rem;
  color:var(--orange);
  margin-top:6px;
  letter-spacing:.05em;
}

/* ---------- match list item (my matches) ---------- */
.match-row{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  margin-bottom:12px;
}
.match-row-top{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:8px; }
.match-row-top h3{ font-size:1.02rem; }
.match-sub{ font-size:.78rem; color:var(--muted); margin-top:2px; }

/* ---------- empty state ---------- */
.empty{
  text-align:center;
  padding:50px 20px;
  color:var(--muted);
}
.empty .glyph{
  width:52px;height:52px;
  margin:0 auto 14px;
  border:1px solid var(--line);
  border-radius:50%;
  display:grid;place-items:center;
  color:var(--muted);
}
.empty h3{ color:var(--text); margin-bottom:6px; font-size:1rem; }
.empty p{ font-size:.85rem; margin:0; }

/* ---------- auth screen ---------- */
.auth-wrap{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:32px 22px;
  max-width:460px;
  margin:0 auto;
}
.auth-hero{ text-align:center; margin-bottom:28px; }
.auth-hero .brand-mark{ width:56px;height:56px; margin:0 auto 14px; font-size:1.4rem; }
.auth-hero h1{ font-size:1.7rem; }
.auth-hero h1 b{ color:var(--orange); }
.auth-hero p{ color:var(--muted); font-size:.88rem; margin-top:6px; }

.auth-toggle{
  display:flex;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:10px;
  padding:4px;
  margin-bottom:18px;
}
.auth-toggle button{
  flex:1;
  background:none;
  border:none;
  color:var(--muted);
  padding:9px;
  border-radius:7px;
  font-family:'Rajdhani',sans-serif;
  font-weight:700;
  letter-spacing:.03em;
  cursor:pointer;
}
.auth-toggle button.active{ background:var(--cyan); color:#031814; }

.divider{
  display:flex; align-items:center; gap:10px;
  color:var(--muted); font-size:.75rem;
  margin:16px 0;
}
.divider::before,.divider::after{ content:""; flex:1; height:1px; background:var(--line); }

.google-btn{
  display:flex; align-items:center; justify-content:center; gap:10px;
  width:100%;
  background:var(--panel);
  border:1px solid var(--line);
  color:var(--text);
  padding:11px;
  border-radius:8px;
  font-weight:600;
  font-size:.9rem;
  cursor:pointer;
}
.google-btn:hover{ border-color:var(--cyan); }

/* ---------- toast ---------- */
.toast-wrap{
  position:fixed; top:16px; left:50%; transform:translateX(-50%);
  z-index:200;
  display:flex; flex-direction:column; gap:8px;
  width:calc(100% - 32px);
  max-width:480px;
}
.toast{
  background:var(--panel-raised);
  border:1px solid var(--line);
  border-left:3px solid var(--cyan);
  border-radius:8px;
  padding:12px 14px;
  font-size:.85rem;
  animation:toast-in .2s ease;
}
.toast.error{ border-left-color:var(--danger); }
@keyframes toast-in{ from{ opacity:0; transform:translateY(-8px);} to{opacity:1; transform:translateY(0);} }

/* ---------- whatsapp fab ---------- */
.wa-fab{
  position:fixed;
  right:16px;
  bottom:96px;
  max-width:520px;
  width:52px;height:52px;
  border-radius:50%;
  background:#25D366;
  display:grid;place-items:center;
  box-shadow:0 4px 14px #00000060;
  z-index:40;
  color:#04160c;
}

/* ---------- admin ---------- */
.admin-header{
  display:flex; justify-content:space-between; align-items:center;
  padding:20px 0 16px;
  border-bottom:1px solid var(--line);
  margin-bottom:20px;
  position:sticky; top:0; background:var(--void); z-index:20;
}
.admin-tabs{
  display:flex; gap:6px;
  overflow-x:auto;
  margin-bottom:22px;
}
.admin-tab{
  padding:9px 16px;
  border-radius:8px;
  border:1px solid var(--line);
  background:var(--panel);
  color:var(--muted);
  font-family:'Rajdhani',sans-serif;
  font-weight:700;
  letter-spacing:.03em;
  cursor:pointer;
  white-space:nowrap;
  font-size:.85rem;
}
.admin-tab.active{ background:var(--cyan); color:#031814; border-color:var(--cyan); }

.table-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:14px;
}
.verify-row{
  display:grid;
  grid-template-columns:64px 1fr auto;
  gap:14px;
  align-items:center;
  padding:12px 0;
  border-bottom:1px solid var(--line);
}
.verify-row:last-child{ border-bottom:none; }
.verify-thumb{
  width:64px;height:64px;
  object-fit:cover;
  border-radius:8px;
  border:1px solid var(--line);
  cursor:pointer;
  background:var(--panel-raised);
}
.verify-info b{ display:block; font-size:.95rem; }
.verify-info span{ display:block; color:var(--muted); font-size:.76rem; }
.verify-info .utr{ font-family:'JetBrains Mono',monospace; color:var(--cyan); font-size:.8rem; margin-top:2px; }
.verify-actions{ display:flex; flex-direction:column; gap:6px; }

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (min-width:640px){ .grid-2{ grid-template-columns:1fr 1fr 1fr; } }

.stat-card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  text-align:center;
}
.stat-card b{ display:block; font-family:'Rajdhani',sans-serif; font-size:1.6rem; color:var(--cyan); }
.stat-card span{ color:var(--muted); font-size:.75rem; text-transform:uppercase; letter-spacing:.05em; }

.img-lightbox{
  position:fixed; inset:0; z-index:300;
  background:#000000d8;
  display:none;
  align-items:center; justify-content:center;
  padding:20px;
}
.img-lightbox.open{ display:flex; }
.img-lightbox img{ max-width:100%; max-height:100%; border-radius:8px; }

@media (max-width:480px){
  .verify-row{ grid-template-columns:52px 1fr; }
  .verify-actions{ grid-column:1 / -1; flex-direction:row; }
}
