/* ═══════════════════════════════════════════════════════════════
   Masti Arcade — home dashboard
   ═══════════════════════════════════════════════════════════════ */
:root {
  --saffron: #FF9933;
  --green: #1a9f2e;
  --gold: #FFC94A;
  --ink: #0a0518;
  --ink-2: #120a26;
  --panel: #150c2c;
  --panel-2: #1c1138;
  --stroke: rgba(255, 201, 74, 0.18);
  --stroke-hi: rgba(255, 201, 74, 0.45);
  --text: #f3ecff;
  --muted: #9d92bf;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(255, 153, 51, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(94, 235, 208, 0.10), transparent 55%),
    var(--ink);
  color: var(--text);
  font-family: 'Segoe UI', Roboto, system-ui, -apple-system, 'Noto Sans Devanagari', 'Noto Sans Tamil', 'Noto Sans Telugu', 'Noto Sans Malayalam', sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
.muted { color: var(--muted); font-size: 13px; font-weight: 600; }

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(10, 5, 24, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--stroke);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 900; }
.brand-mark { font-size: 22px; }
.brand-name { font-size: 18px; letter-spacing: 0.4px; background: linear-gradient(90deg, var(--saffron), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.auth-slot { display: flex; align-items: center; gap: 10px; min-height: 38px; }
#langSel {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--stroke); border-radius: 8px;
  padding: 6px 8px; font: 600 13px inherit; cursor: pointer;
}
#langSel option { background: var(--panel-2); color: var(--text); }
.who { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.who img, .who .avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--panel-2); display: grid; place-items: center; font-size: 14px; }
.skeleton-pill { width: 96px; height: 32px; border-radius: 999px; background: var(--panel-2); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  font: 700 14px/1 inherit; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(90deg, var(--saffron), #ff7a1a); color: #1a0d00; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--stroke-hi); color: var(--text); width: 100%; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.05); }
.btn.small { padding: 7px 13px; font-size: 13px; }
.linkbtn { background: none; border: 0; color: var(--muted); font: 600 13px inherit; cursor: pointer; padding: 4px; }
.linkbtn:hover { color: var(--text); }

/* ── Layout ──────────────────────────────────────────────────── */
.wrap { max-width: 1160px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 60px; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 900; letter-spacing: -0.5px; }
.hero .grad { background: linear-gradient(90deg, var(--saffron), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 52ch; margin-top: 10px; font-size: 15px; }

.cols { display: grid; grid-template-columns: 1fr; gap: 28px; margin-top: 34px; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 320px; align-items: start; } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--gold); }

/* ── Game cards ──────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.game-card {
  position: relative; overflow: hidden;
  border: 1px solid var(--stroke); border-radius: 18px;
  background: var(--panel);
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--stroke-hi); }
.game-cover { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; background: var(--ink-2); }
.game-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-title { font-size: 17px; font-weight: 800; }
.game-tag { color: var(--muted); font-size: 13px; flex: 1; }
.game-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 700; }
.game-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.game-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.pill-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; padding: 3px 8px; border-radius: 999px; background: rgba(255, 201, 74, 0.12); color: var(--gold); }
.pill-soon { background: rgba(157, 146, 191, 0.14); color: var(--muted); }
.card-skeleton { height: 280px; border-radius: 18px; background: var(--panel); border: 1px solid var(--stroke); animation: pulse 1.4s infinite; }

/* ── Rail panels ─────────────────────────────────────────────── */
.rail { display: flex; flex-direction: column; gap: 20px; }
.panel { border: 1px solid var(--stroke); border-radius: 16px; background: var(--panel); padding: 16px; }
.leaders { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.leaders li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.leaders .rank { width: 20px; text-align: center; font-weight: 900; color: var(--gold); font-size: 13px; }
.leaders .lname { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders .lscore { font-weight: 800; color: var(--saffron); font-variant-numeric: tabular-nums; }
.leaders .lguest { color: var(--muted); font-size: 11px; font-weight: 700; }
.highlights { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.highlights li { font-size: 13px; color: var(--text); border-left: 2px solid var(--stroke-hi); padding-left: 10px; }
.highlights .h-when { color: var(--muted); font-size: 11px; font-weight: 700; display: block; margin-top: 2px; }

/* ── Footer ──────────────────────────────────────────────────── */
.foot { max-width: 1160px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 40px) 40px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 20px;
  background: rgba(4, 2, 12, 0.72); backdrop-filter: blur(4px);
}
.modal {
  position: relative; width: 100%; max-width: 380px;
  background: var(--panel-2); border: 1px solid var(--stroke-hi);
  border-radius: 20px; padding: 28px 24px 22px; text-align: center;
}
.modal-x { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.modal-mark { font-size: 30px; }
.modal h3 { margin-top: 6px; font-size: 20px; font-weight: 900; }
.modal .muted { margin: 6px 0 16px; }
.providers { display: flex; flex-direction: column; gap: 9px; }
.prov-btn {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 11px 14px; border-radius: 12px; cursor: pointer; font: 700 14px inherit;
  border: 1px solid var(--stroke-hi); background: #fff; color: #1a1a1a; text-decoration: none;
}
.prov-btn:hover { filter: brightness(0.96); }
.prov-btn.google { background: #fff; }
.prov-btn.facebook { background: #1877f2; color: #fff; border-color: #1877f2; }
.prov-btn.instagram { background: linear-gradient(90deg, #feda75, #d62976, #4f5bd5); color: #fff; border-color: transparent; }
.prov-btn.dev { background: #2a1c4a; color: var(--text); border-style: dashed; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--stroke); }
.guest-form { display: flex; flex-direction: column; gap: 9px; }
.guest-form input {
  padding: 11px 14px; border-radius: 12px; font: 500 14px inherit;
  background: var(--ink); border: 1px solid var(--stroke-hi); color: var(--text);
}
.guest-form input:focus { outline: 2px solid var(--saffron); outline-offset: 0; }
.fineprint { color: var(--muted); font-size: 11px; margin-top: 12px; }

/* ── Arcade Pass ─────────────────────────────────────────────── */
.pass-panel { border-color: var(--stroke-hi); background: linear-gradient(180deg, rgba(255,201,74,.08), var(--panel)); }
.pass-perks { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; font-size: 13px; }
.pass-perks li { padding-left: 18px; position: relative; }
.pass-perks li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); }
.pass-price { font-size: 20px; font-weight: 900; color: var(--gold); margin: 4px 0 12px; }
.colour-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.colour-row input[type=color] { width: 44px; height: 30px; border: 1px solid var(--stroke-hi); border-radius: 8px; background: none; cursor: pointer; }
#passModal .modal { text-align: center; }
#passModal .pass-perks { text-align: left; max-width: 240px; margin: 10px auto 16px; }

/* ── Ads / install ──────────────────────────────────────────── */
.ad-slot { min-height: 0; }
.ad-slot[data-filled] { margin-top: 4px; }
.install-hint {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--stroke-hi);
  border-radius: 14px; padding: 10px 12px; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.install-hint span { flex: 1; }
@media (min-width: 640px) { .install-hint { left: auto; max-width: 360px; } }
.leader-game { font: inherit; font-size: 12px; font-weight: 700; color: inherit; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 3px 6px; max-width: 55%; }
.leader-game option { color: #222; }

.install-hint [hidden], .install-hint .btn[hidden] { display: none !important; }

/* ── games left, invites, referral card ── */
.plan-panel { border-color: rgba(47,191,113,.5); background: linear-gradient(180deg, rgba(47,191,113,.10), var(--panel)); }
.games-left { font-weight: 900; font-size: 18px; color: #7ee0a9; }
.plan-line { font-size: 13px; color: var(--muted); margin: 4px 0; }
.invite-row { display: flex; gap: 6px; margin: 10px 0 6px; }
.invite-row input { flex: 1; min-width: 0; font: inherit; font-size: 12px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--stroke); background: rgba(0,0,0,.25); color: inherit; }
.friend-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.ref-card { margin: 0 0 14px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid rgba(47,191,113,.6); background: linear-gradient(90deg, rgba(47,191,113,.16), rgba(255,201,74,.10)); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ref-card .ref-text { flex: 1; min-width: 200px; } .ref-card b { display: block; font-size: 16px; } .ref-card span { font-size: 13px; color: var(--muted); }
.ref-card .btns { display: flex; gap: 8px; }

.foot-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.foot-links a, .fineprint a { color: var(--gold); }

.email-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.email-form input { font: inherit; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--stroke); background: rgba(0,0,0,.25); color: inherit; }
.email-form .fineprint.ok { color: #7ee0a9; } .email-form .fineprint.bad { color: #ff8a92; }

/* ── family / kid mode ── */
.family-panel { border-color: rgba(94,224,208,.5); background: linear-gradient(180deg, rgba(94,224,208,.08), var(--panel)); }
.kid-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.kid-row .em { font-size: 26px; } .kid-row b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.kid-form input[type=text], .kid-form input[type=password], .kid-form input[inputmode] { font: inherit; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--stroke); background: rgba(0,0,0,.25); color: inherit; }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; } .emoji-pick button { font-size: 22px; width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--stroke); background: rgba(255,255,255,.06); cursor: pointer; }
.emoji-pick button.on { border-color: #ffc94a; background: rgba(255,201,74,.2); }
.kid-form label.consent { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.kid-banner { margin: 0 0 14px; padding: 12px 16px; border-radius: 16px; border: 1.5px solid rgba(94,224,208,.7); background: linear-gradient(90deg, rgba(94,224,208,.18), rgba(255,201,74,.12)); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.kid-banner .txt { flex: 1; min-width: 180px; font-weight: 700; } .kid-banner .txt small { display: block; font-weight: 400; color: var(--muted); }
.fam-msg { font-size: 12px; min-height: 16px; } .fam-msg.bad { color: #ff8a92; } .fam-msg.ok { color: #7ee0a9; }

.rule-note { margin: -4px 0 16px; padding: 10px 14px; border-radius: 14px; border: 1px solid rgba(255,201,74,.45); background: rgba(255,201,74,.08); font-size: 14px; font-weight: 600; text-align: center; }

.anon-row { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 4px; font-size: 14px; }
.anon-row small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
.anon-row input { margin-top: 4px; width: 18px; height: 18px; }
