/* ================================================================
   Quizwinz – Global Stylesheet v2
   Clean, flat dark design. Minimal shadows. GPU-safe transitions.
   ================================================================ */

/* ── Variables ────────────────────────────────────────────────── */
:root {
  --primary:        #6c3de9;
  --primary-light:  #8b5cf6;
  --primary-dark:   #4f1fba;
  --secondary:      #f59e0b;
  --accent:         #ec4899;
  --success:        #10b981;
  --danger:         #ef4444;
  --bg:             #0c0b18;
  --bg-card:        #15132a;
  --bg-card-hover:  #1c1935;
  --border:         rgba(255,255,255,0.09);
  --border-active:  rgba(139,92,246,0.55);
  --text:           #f0eeff;
  --text-muted:     rgba(240,238,255,0.5);
  --radius:         12px;
  --radius-sm:      8px;
  --nav-h:          62px;
  --tr:             0.15s ease;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
a    { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
img  { max-width: 100%; display: block; }
ul   { list-style: none; }

/* ── Layout ────────────────────────────────────────────────────── */
section.h-auto { min-height: 100vh; }
main { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: var(--nav-h); }
.main_page { min-height: 100vh; display: flex; flex-direction: column; }

.content_set {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: rgba(12,11,24,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0; z-index: 100;
}
.navbar-brand {
  display: flex; align-items: center; gap: 9px;
}
.navbar-brand span {
  font-size: 1.2rem; font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #f472b6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar-coins {
  display: flex; align-items: center; gap: 5px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.28);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: .82rem; font-weight: 600; color: var(--secondary);
}
.navbar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff; overflow: hidden;
}
.navbar-user .avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Hero ──────────────────────────────────────────────────────── */
.hero-section {
  text-align: center;
  padding: 40px 20px 28px;
}
.hero-logo {
  width: 80px; height: 80px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
}
.hero-title {
  font-size: 1.9rem; font-weight: 800; line-height: 1.15; margin-bottom: 10px;
  background: linear-gradient(135deg, #e0d9ff 0%, #f9a8d4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub { font-size: .9rem; color: var(--text-muted); margin-bottom: 24px; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 12px 26px;
  border-radius: 50px;
  font-size: .97rem; font-weight: 700;
  transition: opacity var(--tr);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}
.btn-primary:hover   { opacity: .88; }
.btn-primary:active  { opacity: 1; }

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), #d97706);
  color: #0d0b1e; font-weight: 700;
}
.btn-secondary:hover { opacity: .88; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); }

.btn-danger  { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: #fff; }

.btn-full { width: 100%; }
.btn-lg   { padding: 15px 36px; font-size: 1.05rem; }
.btn-sm   { padding: 7px 16px; font-size: .8rem; border-radius: 30px; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

/* ── Stats row ─────────────────────────────────────────────────── */
.stats-row {
  display: flex; gap: 10px; padding: 14px 18px;
}
.stat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}
.stat-card .val {
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #f472b6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; display: block;
}
.stat-card .label {
  font-size: .68rem; color: var(--text-muted); margin-top: 2px; display: block;
}

/* ── Section title ─────────────────────────────────────────────── */
.section-title {
  font-size: .82rem; font-weight: 700; padding: 0 18px 10px;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em;
}

/* ── Category grid ─────────────────────────────────────────────── */
.cat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding: 0 18px 18px;
}
.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex; align-items: center; gap: 11px;
  cursor: pointer; transition: border-color var(--tr), background var(--tr);
  color: inherit;
}
.cat-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}
.cat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.cat-name { font-size: .85rem; font-weight: 600; line-height: 1.2; }

/* ── Leaderboard ───────────────────────────────────────────────── */
.lb-list { padding: 0 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.lb-item {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.lb-rank { font-size: .95rem; font-weight: 800; min-width: 26px; text-align: center; }
.lb-rank.gold   { color: #f59e0b; }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #b45309; }
.lb-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; overflow: hidden;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-info { flex: 1; }
.lb-name  { font-size: .88rem; font-weight: 600; }
.lb-games { font-size: .7rem; color: var(--text-muted); }
.lb-score { font-size: .95rem; font-weight: 800; color: var(--secondary); }

/* ── Start page ────────────────────────────────────────────────── */
.start-hero { padding: 28px 18px 14px; text-align: center; }
.start-hero .trophy { font-size: 3.6rem; margin-bottom: 10px; }
.start-hero h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 5px; }
.start-hero p  { font-size: .88rem; color: var(--text-muted); }

.info-cards {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px;
}
.info-chip {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 30px; padding: 7px 12px;
  font-size: .78rem; font-weight: 500; color: var(--text-muted);
}
.info-chip i { color: var(--secondary); }

.lifelines-section { padding: 4px 18px 18px; }
.lifelines-section h3 { font-size: .92rem; font-weight: 700; margin-bottom: 10px; }
.lifeline-grid { display: flex; flex-direction: column; gap: 8px; }
.lifeline-item {
  display: flex; align-items: center; gap: 11px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.lifeline-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.lifeline-item .ll-name  { font-size: .85rem; font-weight: 600; }
.lifeline-item .ll-desc  { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.lifeline-item .ll-cost  { margin-left: auto; font-size: .73rem; font-weight: 700; color: var(--secondary); white-space: nowrap; }
.start-actions { padding: 6px 18px 28px; display: flex; flex-direction: column; gap: 9px; }

/* ── Rules page ────────────────────────────────────────────────── */
.rules_set { padding: 20px 18px 28px; }
.rules_set > ul { display: flex; flex-direction: column; gap: 9px; }
.rules_set > ul > li {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: .88rem; line-height: 1.5; color: var(--text-muted);
  display: flex; gap: 9px; align-items: flex-start;
}
.rules_set > ul > li::before {
  content: '•'; color: var(--primary-light); font-size: 1.1rem; flex-shrink: 0; margin-top: -1px;
}
.rules_set ul ul { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; padding-left: 4px; }
.rules_set ul ul li {
  background: rgba(255,255,255,0.03); border-radius: 6px; padding: 7px 10px;
  font-size: .8rem; display: flex; gap: 7px;
}
.rules_set ul ul li::before { content: '–'; color: var(--secondary); flex-shrink: 0; }
.rules-header { display: flex; align-items: center; gap: 13px; padding: 18px 18px 0; }
.rules-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}

/* ── Auth / Login ──────────────────────────────────────────────── */
.auth-wrap { padding: 28px 18px; display: flex; flex-direction: column; gap: 0; }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .logo-icon {
  width: 68px; height: 68px; margin: 0 auto 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px; display: flex; align-items: center;
  justify-content: center; font-size: 2rem;
}
.auth-logo h1 { font-size: 1.35rem; font-weight: 800; margin-bottom: 4px; }
.auth-logo p  { font-size: .83rem; color: var(--text-muted); }

.auth-tabs {
  display: flex; gap: 0; background: rgba(255,255,255,0.05);
  border-radius: 10px; padding: 3px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 9px; border-radius: 8px;
  font-size: .86rem; font-weight: 600; color: var(--text-muted);
  background: transparent; transition: background var(--tr), color var(--tr);
  text-align: center;
}
.auth-tab.active { background: var(--primary); color: #fff; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
.form-control {
  width: 100%; padding: 12px 15px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px; color: var(--text);
  font-size: .9rem; font-family: inherit;
  transition: border-color var(--tr);
  -webkit-appearance: none;
}
.form-control:focus { outline: none; border-color: var(--primary-light); }
.form-control::placeholder { color: var(--text-muted); }
.input-icon-wrap { position: relative; }
.input-icon-wrap > i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .95rem; pointer-events: none;
}
.input-icon-wrap .form-control { padding-left: 38px; }
.input-icon-wrap .toggle-pw {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: .95rem; background: none; padding: 0;
}
.divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0; color: var(--text-muted); font-size: .78rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-google {
  width: 100%; padding: 11px;
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: .88rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: border-color var(--tr);
}
.btn-google:hover { border-color: var(--border-active); }
.btn-google img { width: 19px; }

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
  padding: 11px 14px; border-radius: 9px;
  font-size: .83rem; margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-danger  { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.alert-info    { background: rgba(108,61,233,0.1); border: 1px solid rgba(108,61,233,.3); color: #c4b5fd; }

/* ── Profile ───────────────────────────────────────────────────── */
.profile-header { padding: 22px 18px 0; text-align: center; }
.profile-avatar {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; font-weight: 800; color: #fff;
  border: 2px solid rgba(255,255,255,0.12); overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name  { font-size: 1.15rem; font-weight: 800; margin-bottom: 3px; }
.profile-email { font-size: .78rem; color: var(--text-muted); margin-bottom: 7px; }
.rank-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px; padding: 4px 13px;
  font-size: .75rem; font-weight: 700;
}
.user-menu { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 14px;
  transition: border-color var(--tr); color: inherit;
}
.menu-item:hover { border-color: var(--border-active); }
.menu-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.menu-text .mt { font-size: .88rem; font-weight: 600; }
.menu-text .ms { font-size: .73rem; color: var(--text-muted); margin-top: 1px; }
.menu-arrow { margin-left: auto; color: var(--text-muted); font-size: .85rem; }

/* ── Bottom nav ────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: var(--nav-h);
  background: rgba(12,11,24,0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex; z-index: 100;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px 10px;
  color: var(--text-muted); font-size: .62rem; font-weight: 600;
  gap: 3px; transition: color var(--tr); text-decoration: none;
}
.nav-item i { font-size: 1.3rem; }
.nav-item.active { color: var(--primary-light); }
.nav-item.play { color: #fff; }
.nav-item.play .play-btn {
  width: 48px; height: 48px; margin-top: -20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  border: 3px solid var(--bg);
}

/* ── Page bar ──────────────────────────────────────────────────── */
.page-bar {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px; border-bottom: 1px solid var(--border);
}
.page-bar .back-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--bg-card); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: .95rem; flex-shrink: 0;
}
.page-bar h2 { font-size: .97rem; font-weight: 700; }

/* ── Toast ─────────────────────────────────────────────────────── */
.Toastify { position: fixed; top: 14px; right: 14px; z-index: 9999; }
.toast-msg {
  background: #1a1830; border: 1px solid var(--border);
  color: var(--text); padding: 11px 18px; border-radius: 10px;
  font-size: .86rem; animation: slideIn .25s ease;
  max-width: 270px;
}
@keyframes slideIn { from { transform: translateX(50px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Ad slots ──────────────────────────────────────────────────── */
.ad-slot {
  width: 100%;
  overflow: hidden;
  /* transparent bg — AdSense fills it */
}
.ad-slot--banner {
  /* 320×50 leaderboard / smart banner */
  min-height: 60px;
  padding: 0 18px;
  margin: 8px 0;
}
.ad-slot--rect {
  /* 300×250 medium rectangle */
  min-height: 250px;
  padding: 0 18px;
  margin: 12px 0;
}
.ad-slot--inline {
  /* between-content native-feel banner */
  min-height: 90px;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.ad-slot--inline ins { display: block; }

/* ── Utilities ─────────────────────────────────────────────────── */
.text-center   { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.p-20  { padding: 20px; }
.flex  { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full    { width: 100%; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }

/* ── Desktop border ────────────────────────────────────────────── */
@media (min-width: 480px) {
  .content_set { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .bottom-nav  { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
