/* Rozgar Esports — iPhone web app. Black + gold glass, animated. */
:root {
  --bg: #050507; --bg2: #0d0d13; --card: rgba(255,255,255,.055); --card2: rgba(255,255,255,.09);
  --line: rgba(255,255,255,.09); --gold: #f5c542; --gold2: #d4920f; --gold-soft: rgba(245,197,66,.14);
  --text: #f6f3ea; --muted: #9b98a3; --ok: #3ddc84; --bad: #ff4d5e; --warn: #ffb020; --blue: #4aa8ff;
  --r: 18px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overflow-x: hidden; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); text-decoration: none; }
img { display: block; max-width: 100%; }

/* Animated backdrop */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 80% at 50% -10%, #22180a 0%, var(--bg) 55%); }
.bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; animation: float 18s ease-in-out infinite; }
.bg i:nth-child(1) { width: 320px; height: 320px; background: #b07a10; top: -80px; left: -90px; }
.bg i:nth-child(2) { width: 260px; height: 260px; background: #5a3cff; bottom: 10%; right: -110px; opacity: .22; animation-delay: -6s; }
.bg i:nth-child(3) { width: 200px; height: 200px; background: #f5c542; bottom: -60px; left: 20%; opacity: .18; animation-delay: -11s; }
.bg .grid { position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(70% 50% at 50% 0%, #000 0%, transparent 80%); opacity: .35; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(40px,30px) scale(1.1); } 66% { transform: translate(-30px,20px) scale(.95); } }

/* Layout */
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; padding: calc(var(--safe-t) + 10px) 16px calc(var(--safe-b) + 96px); }
.view { animation: viewIn .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.stagger > * { animation: viewIn .5s cubic-bezier(.2,.8,.2,1) both; }
.stagger > *:nth-child(2) { animation-delay: .05s } .stagger > *:nth-child(3) { animation-delay: .1s } .stagger > *:nth-child(4) { animation-delay: .15s }
.stagger > *:nth-child(5) { animation-delay: .2s } .stagger > *:nth-child(6) { animation-delay: .25s } .stagger > *:nth-child(n+7) { animation-delay: .3s }

.topbar { display: flex; align-items: center; gap: 10px; padding: 6px 0 14px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 60%, transparent); }
.topbar .logo { width: 38px; height: 38px; filter: drop-shadow(0 0 10px rgba(245,197,66,.4)); }
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: .3px; flex: 1; }
.topbar h1 small { display: block; font-size: 11px; color: var(--gold); font-weight: 600; letter-spacing: 1.5px; }
.back { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; font-size: 18px; }
.coinpill { display: flex; align-items: center; gap: 6px; padding: 7px 12px 7px 8px; border-radius: 999px; background: var(--gold-soft); border: 1px solid rgba(245,197,66,.35); font-weight: 700; font-size: 14px; cursor: pointer; }

/* Glass card */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); margin-bottom: 12px; overflow: hidden; }
.card.glow::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(245,197,66,.7), transparent 40%, transparent 60%, rgba(245,197,66,.4)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.card h3 { margin: 0 0 10px; font-size: 15px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .gold { color: var(--gold); } .ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.center { text-align: center; } .mt { margin-top: 12px; } .mt2 { margin-top: 20px; } .hide { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 16px; border: 0; cursor: pointer; font-weight: 800; font-size: 15px; letter-spacing: .2px; position: relative; overflow: hidden; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.gold { background: linear-gradient(135deg, #ffe08a, var(--gold) 45%, var(--gold2)); color: #1a1205; box-shadow: 0 8px 30px rgba(245,197,66,.25); }
.btn.gold::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn.ghost { background: var(--card2); border: 1px solid var(--line); color: var(--text); }
.btn.red { background: rgba(255,77,94,.14); color: var(--bad); border: 1px solid rgba(255,77,94,.35); }
.btn.sm { height: 38px; font-size: 13px; border-radius: 12px; width: auto; padding: 0 14px; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.link { background: none; border: 0; color: var(--gold); cursor: pointer; padding: 6px 0; font-size: 13px; font-weight: 600; }

/* Inputs */
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px 4px; }
.input, select.input { width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.35); padding: 0 14px; font-size: 16px; outline: none; transition: border .2s, box-shadow .2s; -webkit-appearance: none; appearance: none; }
.input:focus { border-color: rgba(245,197,66,.6); box-shadow: 0 0 0 4px rgba(245,197,66,.12); }
.input.code { letter-spacing: 10px; text-align: center; font-size: 24px; font-weight: 800; }
.pw { position: relative; } .pw button { position: absolute; right: 6px; top: 6px; height: 38px; padding: 0 10px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; }
.selrow { display: grid; grid-template-columns: 1fr 1.4fr 1.1fr; gap: 8px; }

/* Auth hero */
.hero { text-align: center; padding: 20px 0 10px; }
.hero .emblem { width: 150px; height: 150px; margin: 0 auto; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 10px 40px rgba(245,197,66,.45)); }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(1deg); } }
.hero h2 { font-size: 28px; margin: 10px 0 2px; font-weight: 900; background: linear-gradient(180deg, #fff, #f5d27a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .tag { color: var(--gold); font-weight: 700; letter-spacing: 3px; font-size: 12px; text-transform: uppercase; }
.rules { background: rgba(245,197,66,.06); border: 1px dashed rgba(245,197,66,.35); border-radius: 14px; padding: 12px 14px; font-size: 12px; color: #d8d3c4; line-height: 1.7; }
.rules b { color: var(--gold); }

/* Chips / tabs */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .2s; }
.chip.on { background: linear-gradient(135deg, #ffe08a, var(--gold)); color: #1a1205; border-color: transparent; box-shadow: 0 6px 20px rgba(245,197,66,.25); }

/* Match card */
.match { padding: 0; cursor: pointer; transition: transform .15s; }
.match:active { transform: scale(.98); }
.match .ban { height: 112px; background-size: cover; background-position: center; position: relative; }
.match .ban::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(5,5,7,.95)); }
.match .ban .badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; z-index: 1; }
.match .body { padding: 0 14px 14px; margin-top: -34px; position: relative; z-index: 1; }
.match h4 { margin: 0 0 4px; font-size: 16px; }
.tag2 { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 8px; background: rgba(0,0,0,.6); border: 1px solid var(--line); backdrop-filter: blur(8px); letter-spacing: .4px; }
.tag2.live { background: var(--bad); border-color: transparent; animation: pulse 1.4s infinite; }
.tag2.gold { background: var(--gold); color: #1a1205; border-color: transparent; }
.tag2.ok { background: rgba(61,220,132,.18); color: var(--ok); border-color: rgba(61,220,132,.4); }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,77,94,.6); } 50% { box-shadow: 0 0 0 8px rgba(255,77,94,0); } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.stat { background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.stat b { display: block; font-size: 15px; } .stat span { font-size: 11px; color: var(--muted); }
.bar { height: 7px; border-radius: 9px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--gold2), #ffe08a); transition: width 1s cubic-bezier(.2,.8,.2,1); }

/* Wallet */
.balance { text-align: center; padding: 26px 16px; background: radial-gradient(120% 120% at 50% 0%, rgba(245,197,66,.22), rgba(255,255,255,.03) 60%); }
.balance .big { font-size: 44px; font-weight: 900; letter-spacing: -1px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff4c2, var(--gold) 45%, var(--gold2)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.25), 0 0 12px rgba(245,197,66,.5); display: inline-block; flex: none; position: relative; }
.coin::after { content: "R"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #6b4a00; }
.balance .big .coin { width: 34px; height: 34px; animation: spinY 4s ease-in-out infinite; } .balance .big .coin::after { font-size: 17px; }
@keyframes spinY { 0%, 70% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack { border: 1px solid var(--line); background: rgba(0,0,0,.3); border-radius: 14px; padding: 12px 6px; text-align: center; cursor: pointer; transition: all .2s; }
.pack b { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 18px; } .pack span { font-size: 12px; color: var(--muted); }
.pack.on { border-color: var(--gold); background: var(--gold-soft); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,197,66,.18); }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.qr { background: #fff; border-radius: 16px; padding: 12px; width: 200px; margin: 0 auto; }
.upiapps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.upiapps a { display: grid; place-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); font-size: 11px; color: var(--text); font-weight: 700; }
.upiapps a i { font-style: normal; font-size: 20px; }
.copy { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: rgba(0,0,0,.35); border: 1px dashed rgba(245,197,66,.4); border-radius: 12px; padding: 10px 12px; font-weight: 700; }

/* Avatars */
.av { border-radius: 50%; object-fit: cover; background: #111; border: 2px solid rgba(245,197,66,.55); flex: none; }
.avgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avgrid button { border: 2px solid transparent; background: none; border-radius: 50%; padding: 2px; cursor: pointer; transition: transform .2s; }
.avgrid button.on { border-color: var(--gold); transform: scale(1.06); box-shadow: 0 0 20px rgba(245,197,66,.35); }
.avgrid img { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }

/* Profile hero */
.phero { text-align: center; padding: 26px 16px 18px; background: linear-gradient(180deg, rgba(245,197,66,.18), transparent); }
.phero .ring { width: 104px; height: 104px; margin: 0 auto; border-radius: 50%; padding: 3px; background: conic-gradient(from 0deg, var(--gold), transparent 40%, var(--gold) 70%, transparent); animation: rot 6s linear infinite; }
.phero .ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); animation: rot 6s linear infinite reverse; }
.badges3 { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.menu .item { cursor: pointer; }
.menu .item .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); font-size: 17px; flex: none; }

/* Bottom nav */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 10px); width: min(492px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 22px; background: rgba(18,16,12,.78); border: 1px solid rgba(245,197,66,.18); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); z-index: 20; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.nav a { display: grid; place-items: center; gap: 2px; padding: 7px 0; border-radius: 16px; color: var(--muted); font-size: 10.5px; font-weight: 700; transition: all .25s; }
.nav a svg { width: 22px; height: 22px; }
.nav a.on { color: #1a1205; background: linear-gradient(135deg, #ffe08a, var(--gold)); box-shadow: 0 6px 18px rgba(245,197,66,.3); }

/* Modal / sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .25s both; backdrop-filter: blur(4px); }
.sheet { width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; background: #111016; border: 1px solid var(--line); border-bottom: 0; border-radius: 26px 26px 0 0; padding: 10px 18px calc(var(--safe-b) + 20px); animation: up .35s cubic-bezier(.2,.8,.2,1) both; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.2); margin: 0 auto 14px; }
.sheet.danger { border-color: rgba(255,77,94,.6); box-shadow: 0 -10px 60px rgba(255,77,94,.25); }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(100%); } }

/* Toast */
#toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translate(-50%, -150%); z-index: 60; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 14px; background: #1b1a20; border: 1px solid var(--line); font-size: 14px; font-weight: 600; box-shadow: 0 10px 40px rgba(0,0,0,.6); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
#toast.show { transform: translate(-50%, 0); } #toast.err { border-color: rgba(255,77,94,.5); } #toast.ok { border-color: rgba(61,220,132,.5); }

/* Skeleton */
.sk { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04)); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--r); height: 190px; margin-bottom: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); } .empty .e { font-size: 44px; margin-bottom: 8px; }

/* Winners podium */
.rank { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; flex: none; }
.r1 { background: linear-gradient(135deg, #ffe08a, #d4920f); color: #1a1205; } .r2 { background: linear-gradient(135deg, #eef2f7, #9aa3ad); color: #111; } .r3 { background: linear-gradient(135deg, #f1b48a, #a3602d); color: #1a0d05; }

/* Install hint (iOS Safari) */
.install { position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 92px); z-index: 30; max-width: 496px; margin: 0 auto; }
.install .card { background: rgba(24,22,16,.92); border-color: rgba(245,197,66,.4); animation: up .5s both; }
.share-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--blue); color: #fff; font-size: 13px; vertical-align: middle; }

/* Confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 8px; height: 14px; border-radius: 2px; animation: fall 1.8s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .8; } }

/* Gate (non-iPhone) */
.gate { min-height: 90dvh; display: grid; place-items: center; text-align: center; }
.gate .card { padding: 26px 20px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Rate us */
.stars { display: flex; justify-content: center; gap: 10px; font-size: 32px; color: rgba(255,255,255,.15); cursor: pointer; user-select: none; }
.stars.big { font-size: 44px; gap: 12px; margin-top: 10px; }
.stars span { transition: color .2s, transform .2s, text-shadow .2s; }
.stars span.on { color: var(--gold); text-shadow: 0 0 18px rgba(245,197,66,.6); }
.stars span.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.45) rotate(-8deg); } }
.rate { cursor: pointer; background: linear-gradient(135deg, rgba(245,197,66,.16), rgba(255,255,255,.04)); }
.wiggle { animation: wiggle 2.6s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-14deg) scale(1.15); } 90% { transform: rotate(12deg) scale(1.15); } 95% { transform: rotate(-6deg); } }
textarea.input { font-size: 15px; resize: vertical; }

/* Arrow pointing at Safari's Share button */
.share-arrow { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 4px); transform: translateX(-50%); font-size: 40px; color: var(--gold); text-shadow: 0 0 20px rgba(245,197,66,.8); z-index: 50; animation: nudge 1s ease-in-out infinite; pointer-events: none; }
.share-arrow.top { bottom: auto; top: calc(var(--safe-t) + 4px); left: auto; right: 90px; transform: none; animation-name: nudgeUp; }
@keyframes nudge { 50% { transform: translate(-50%, 10px); } }
@keyframes nudgeUp { 50% { transform: translateY(-10px); } }
.sheet-bg:has(.share-arrow) .sheet { margin-bottom: 54px; border-radius: 26px; border-bottom: 1px solid var(--line); }

/* Animated Free Fire hero banner */
.hero-banner { position: relative; height: 178px; border-radius: 22px; overflow: hidden; margin-bottom: 14px; border: 1px solid rgba(245,197,66,.35); box-shadow: 0 18px 50px rgba(245,180,40,.18); }
.hero-banner .hb-img { position: absolute; inset: -6%; background-size: cover; background-position: center; animation: kenburns 14s ease-in-out infinite alternate; }
.hero-banner:not(.custom)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,5,7,.92) 0%, rgba(5,5,7,.55) 55%, rgba(5,5,7,.1)); }
.hero-banner .hb-shine { position: absolute; inset: 0; z-index: 2; background: linear-gradient(110deg, transparent 35%, rgba(255,230,150,.28) 50%, transparent 65%); background-size: 250% 100%; animation: sweep 4.5s ease-in-out infinite; pointer-events: none; }
.hero-banner .hb-text { position: absolute; z-index: 3; left: 18px; top: 18px; right: 40%; }
.hero-banner h2 { margin: 8px 0 4px; font-size: 26px; line-height: 1.05; font-weight: 900; text-transform: uppercase; }
.hero-banner h2 em { font-style: normal; background: linear-gradient(180deg, #ffe9a6, #f5c542 50%, #c98a0e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-banner p { margin: 0; font-size: 12px; color: #d8d3c4; }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.12) translate(-3%, -2%); } }
@keyframes sweep { 0% { background-position: 150% 0; } 60%, 100% { background-position: -50% 0; } }
/* BGMI coming soon */
.card.soon { padding: 0; display: flex; align-items: stretch; min-height: 110px; border-style: dashed; }
.soon-img { width: 42%; background-size: cover; background-position: center; filter: grayscale(.6) brightness(.7); }
.soon-txt { padding: 14px; flex: 1; } .soon-txt h4 { margin: 8px 0 4px; }
