/* 1eegame design system */
:root {
  --brand: #2563eb; --brand-600: #1d4ed8; --brand-50: #eff6ff;
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --line: #e9eef5; --bg: #f5f7fb; --card: #ffffff;
  --green: #16a34a; --green-50: #ecfdf3;
  --radius: 16px;
}
[x-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; max-width: 100%; }
body { -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--ink); font-size: 14px; -webkit-tap-highlight-color: transparent; }
img, svg, canvas { max-width: 100%; }
.tnum { font-variant-numeric: tabular-nums; }

/* Surfaces */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15,23,42,.03); min-width: 0; }
.card-pad { padding: 16px; }
@media (min-width: 640px) { .card-pad { padding: 20px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.link-more { font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.divide > * + * { border-top: 1px solid #f1f4f9; }

/* Page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.2; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (min-width: 1024px) { .page-title { font-size: 26px; } .page-head { margin-bottom: 20px; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .08s, opacity .15s; cursor: pointer; border: 1px solid transparent; user-select: none; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -8px rgba(37,99,235,.7); }
.btn-primary:hover { background: var(--brand-600); }
.btn-success { background: var(--green); color: #fff; box-shadow: 0 6px 16px -8px rgba(22,163,74,.7); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #e11d48; color: #fff; }
.btn-danger:hover { background: #be123c; }
.btn-light { background: #fff; color: var(--ink); border-color: #e2e8f0; }
.btn-light:hover { background: #f8fafc; }
.btn-soft { background: var(--brand-50); color: var(--brand); }
.btn-soft:hover { background: #dbeafe; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }

/* Forms */
.input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; padding: 0 14px; font-size: 14px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 11px 14px; line-height: 1.5; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath d='M5.2 7.2a.75.75 0 0 1 1.06.04L10 11.1l3.74-3.86a.75.75 0 1 1 1.08 1.04l-4.28 4.42a.75.75 0 0 1-1.08 0L5.18 8.28a.75.75 0 0 1 .02-1.08z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 38px; }
.input:focus { border-color: #93c5fd; box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
.input::placeholder { color: #a3aec0; }
@media (max-width: 639px) { .input { font-size: 16px; } }
.input-sm { height: 34px; font-size: 13px; border-radius: 9px; padding: 0 10px; }
.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.dropzone { display: block; border: 1.5px dashed #d5deea; border-radius: 14px; padding: 22px 16px; text-align: center; cursor: pointer; background: #fafcff; transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: #93c5fd; background: var(--brand-50); }
.check { width: 18px; height: 18px; border-radius: 5px; accent-color: var(--brand); }

/* Segmented pills */
.pills { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px; min-width: 0; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line); white-space: nowrap; cursor: pointer; }
.pill:hover { color: var(--ink); }
.pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill .count { font-size: 11px; opacity: .75; }

/* List rows */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; min-width: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reward { font-size: 13px; font-weight: 700; color: var(--green); white-space: nowrap; }
.meta { font-size: 11px; color: var(--faint); white-space: nowrap; }
.ico { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 16px; }
.ico-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.ico-lg { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }

/* Stats */
.stat { display: flex; align-items: center; gap: 10px; padding: 14px; }
.stat-label { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.stat-mini { padding: 12px 8px; text-align: center; }
.stat-mini .ico { margin: 0 auto 6px; }

/* Balance hero */
.balance-hero { position: relative; overflow: hidden; border-radius: 20px; padding: 20px; color: #fff; background: linear-gradient(135deg, #16a34a 0%, #22c55e 55%, #34d399 100%); box-shadow: 0 16px 32px -18px rgba(22,163,74,.75); }
.balance-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 999px; background: rgba(255,255,255,.12); }
.balance-hero::before { content: ""; position: absolute; right: 30px; bottom: -80px; width: 160px; height: 160px; border-radius: 999px; background: rgba(255,255,255,.08); }
.balance-hero > * { position: relative; z-index: 1; }
.coin-badge { width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 22px; }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* Tables (admin + desktop) */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; text-align: left; padding: 10px 14px; background: #f8fafc; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid #f1f4f9; font-size: 13px; color: var(--ink-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Navigation */
.nav-link { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 11px; color: var(--muted); font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s; }
.nav-link:hover { background: #f4f7fb; color: var(--ink); }
.nav-link.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.nav-link i { width: 18px; text-align: center; font-size: 15px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 60px; font-size: 10.5px; font-weight: 600; color: var(--faint); position: relative; }
.tabbar a i { font-size: 18px; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.app-main { padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .app-main { padding: 28px 32px 40px; } }

/* Dropdown */
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 40px -12px rgba(15,23,42,.18); z-index: 50; overflow: hidden; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13.5px; color: var(--ink-2); }
.menu a:hover { background: #f8fafc; }

/* Empty state */
.empty { text-align: center; padding: 36px 16px; }
.empty .ico { margin: 0 auto 10px; background: #f1f5f9; color: var(--faint); }
.empty p { font-size: 13px; color: var(--muted); }

/* Landing */
.hero-bg { background: radial-gradient(900px 420px at 90% -10%, rgba(59,130,246,.16), transparent 60%), radial-gradient(700px 380px at -10% 40%, rgba(139,92,246,.08), transparent 60%), #f8fbff; }
.float-slow { animation: floaty 5s ease-in-out infinite; }
.float-fast { animation: floaty 3.5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* Games */
.game-thumb { position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 1 / 1; }
.game-thumb svg { width: 100%; height: 100%; display: block; }
.game-frame { touch-action: none; user-select: none; -webkit-user-select: none; }

/* Toast flash */
.flash { display: flex; align-items: flex-start; gap: 10px; border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.flash-ok { background: #ecfdf3; color: #166534; border: 1px solid #bbf7d0; }
.flash-err { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

/* Admin compatibility helpers */
.tab-pill { flex: none; height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--line); white-space: nowrap; }
.tab-pill:hover { color: var(--ink); }
.tab-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.card.p-5, .card.p-6 { padding: 16px; }
@media (min-width: 640px) { .card.p-5 { padding: 20px; } .card.p-6 { padding: 24px; } }

/* Auth screens */
.auth-hero { background: radial-gradient(600px 300px at 100% 0%, rgba(99,102,241,.55), transparent 60%), radial-gradient(500px 300px at 0% 100%, rgba(14,165,233,.35), transparent 60%), linear-gradient(160deg, #1d4ed8 0%, #1e3a8a 55%, #172554 100%); }
.auth-grid { background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 36px 36px; mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%); }
.field { position: relative; }
.field > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 14px; pointer-events: none; transition: color .15s; }
.field > .input { padding-left: 42px; height: 50px; border-radius: 14px; background: #f8fafc; border-color: #e8edf4; }
.field > .input:focus { background: #fff; }
.field:focus-within > i { color: var(--brand); }
.field .field-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 10px; color: #94a3b8; display: flex; align-items: center; justify-content: center; }
.field .field-action:hover { color: var(--ink); background: #f1f5f9; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: #f1f5f9; }
.seg a { height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.seg a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.glass { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.auth-phone { transform-origin: center; }
@media (max-height: 860px) { .auth-phone { scale: .82; } }
@media (max-height: 760px) { .auth-desc { display: none; } .auth-phone { scale: .68; } }
@media (max-height: 640px) { .auth-stats { display: none; } .auth-phone { scale: .6; } }

.field-sm > .input { height: 46px; border-radius: 12px; font-size: 14px; padding-left: 39px; }
@media (max-width: 639px) { .field-sm > .input { font-size: 16px; } }
.field-sm > i { left: 14px; }

/* Notched tab bar with a floating centre Wallet button */
.tabbar { background: transparent; border-top: 0; backdrop-filter: none; }
.tabbar-bg { position: absolute; inset: 0; display: flex; pointer-events: none; filter: drop-shadow(0 -1px 0 rgba(15,23,42,.06)) drop-shadow(0 -6px 16px rgba(15,23,42,.06)); }
.tabbar-bg > span { flex: 1; background: #fff; }
.tabbar-notch { width: 96px; display: flex; flex-direction: column; }
.tabbar-notch svg { display: block; flex: none; }
.tabbar-notch i { flex: 1; background: #fff; margin-top: -1px; }
.tabbar a.tab-fab { justify-content: flex-end; padding-bottom: 9px; color: var(--muted); }
.tabbar a.tab-fab::before { display: none; }
.tabbar .fab { position: absolute; top: -33px; left: 50%; width: 56px; height: 56px; margin-left: -28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff;
  background: linear-gradient(150deg, #60a5fa 0%, #2563eb 48%, #4338ca 100%);
  box-shadow: 0 14px 24px -10px rgba(37,99,235,.85), 0 4px 10px -4px rgba(67,56,202,.5), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 8px rgba(30,27,75,.25);
  transition: transform .18s cubic-bezier(.3,1.5,.6,1), box-shadow .2s; }
.tabbar .fab::after { content: ""; position: absolute; left: 10px; right: 10px; top: 4px; height: 22px; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,0)); }
.tabbar .fab i { font-size: 21px; position: relative; z-index: 1; filter: drop-shadow(0 2px 3px rgba(30,27,75,.35)); }
.tabbar a.tab-fab:active .fab { transform: scale(.92); }
.tabbar .fab-label { font-size: 10.5px; font-weight: 700; }
.tabbar a.tab-fab.active { color: var(--brand); }
.tabbar a.tab-fab.active .fab { box-shadow: 0 0 0 4px rgba(59,130,246,.16), 0 14px 26px -8px rgba(37,99,235,.9), inset 0 1px 0 rgba(255,255,255,.45), inset 0 -3px 8px rgba(30,27,75,.25); }

/* Mobile home hero */
.home-hero { background: radial-gradient(260px 200px at 100% 0%, rgba(129,140,248,.55), transparent 70%), radial-gradient(240px 180px at 0% 100%, rgba(56,189,248,.35), transparent 70%), linear-gradient(150deg, #2563eb 0%, #1d4ed8 50%, #1e3a8a 100%); box-shadow: 0 18px 36px -18px rgba(29,78,216,.8); }
.home-hero::after { content: ""; position: absolute; right: -50px; top: -50px; width: 170px; height: 170px; border-radius: 999px; border: 26px solid rgba(255,255,255,.06); }
