/* Perewal Loto PWA — themed to match the Perewal app (Flutter POS) design system.
   Light theme · primary blue #0060AA · dark-blue app bar #001A3F · Inter · 12px radii. */
:root {
    --bg: #F7F7F7;          /* greyBGColor */
    --surface: #FFFFFF;
    --appbar: #001A3F;      /* darkBlueColor */
    --primary: #0060AA;     /* kPrimaryColor */
    --primary-2: #00AAF6;   /* blueColor */
    --text: #111827;        /* blueBlackColor */
    --muted: #737373;       /* greyColor */
    --line: #EEEEEE;        /* dividerColor */
    --field-line: #E2E2E2;  /* textFilledColor */
    --danger: #ED0000;      /* error */
    --pos: #27af60;         /* green */
    --neg: #ED0000;
    --yellow: #F4B536;
    --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
    font-family: Inter, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--primary); text-decoration: none; font-weight: 600; }
h1 { font-size: 1.35rem; margin: 4px 0 14px; font-weight: 700; }
h3 { font-size: 1rem; margin: 0 0 10px; font-weight: 700; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.center { text-align: center; }

/* top bar (dark blue, centered wordmark — like home_appbar) */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: flex-end;
    padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
    background: var(--appbar); color: #fff; }
.topbar-logo { position: absolute; left: 50%; transform: translateX(-50%); height: 34px; width: auto; }
.lang-toggle { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 8px;
    padding: 4px 10px; font-weight: 700; }

.view { min-height: 100vh; }
.page { padding: 16px 16px 90px; max-width: 640px; margin: 0 auto; }

/* tab bar */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; z-index: 10;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(0,0,0,.04); }
.tab { flex: 1; text-align: center; padding: 10px 0 8px; color: var(--muted); font-size: .72rem; display: grid; gap: 2px; }
.tab.active { color: var(--primary); }
.tab-ico { font-size: 1.15rem; }

/* auth */
.auth { max-width: 420px; margin: 0 auto; padding: 32px 20px calc(32px + env(safe-area-inset-top)); }
.logo { text-align: center; margin: 12px 0 20px; }
.logo-img { width: 260px; max-width: 78%; height: auto; }
.auth-title { text-align: center; font-size: 1.15rem; font-weight: 700; margin: 8px 0 4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 6px; }
.auth label { display: block; margin: 14px 0 6px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.auth input, .card input { width: 100%; padding: 13px 14px; border-radius: var(--radius); border: 1px solid var(--field-line);
    background: var(--surface); color: var(--text); font-size: 1rem; font-family: inherit; }
.auth input:focus, .card input:focus { outline: none; border-color: var(--primary); }
.phone-row { display: flex; gap: 8px; align-items: stretch; }
.phone-row .cc { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--field-line);
    border-radius: var(--radius); background: #fff; color: var(--muted); font-weight: 700; }
.phone-row input { flex: 1; }
.otp { letter-spacing: 8px; text-align: center; font-size: 1.4rem; }
.fineprint { font-size: .75rem; color: var(--muted); margin: 10px 0 0; }

/* buttons */
.btn { border: 0; border-radius: var(--radius); padding: 13px 16px; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); }
.btn.block { display: block; width: 100%; margin-top: 14px; }
.btn.loading, .btn:disabled { opacity: .6; pointer-events: none; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(17,24,39,.04); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two { grid-template-columns: 1fr; } }
.pill { background: #EAF2FB; color: var(--primary); border-radius: 999px; padding: 2px 8px; font-size: .7rem; font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

/* draws / betting */
.draw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.draw .closes { color: var(--primary); font-size: .8rem; white-space: nowrap; font-weight: 600; }
.bet-row { display: flex; gap: 8px; margin-top: 12px; }
.bet-row .num { width: 34%; text-align: center; font-weight: 700; }
.bet-row .amt { flex: 1; }
.bet-row input { padding: 12px; border-radius: var(--radius); border: 1px solid var(--field-line); background: #fff; color: var(--text); font-size: 1rem; font-family: inherit; }
.bet-row input:focus { outline: none; border-color: var(--primary); }
.bet-row .btn { white-space: nowrap; }

/* wallet */
.balance-card { background: linear-gradient(135deg, var(--appbar), var(--primary)); border-radius: var(--radius);
    padding: 20px; margin-bottom: 16px; color: #fff; }
.balance-card .muted { color: rgba(255,255,255,.75); }
.balance { font-size: 2rem; font-weight: 800; color: #fff; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.tx { text-transform: capitalize; font-weight: 600; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

/* bets */
.bet-top { display: flex; justify-content: space-between; align-items: center; }
.num-badge { background: #EAF2FB; border: 1px solid #d6e6f7; border-radius: 8px; padding: 2px 10px; font-weight: 700; color: var(--primary); }
.status { font-size: .72rem; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; font-weight: 700; }
.status.won { background: rgba(39,175,96,.12); color: var(--pos); }
.status.lost { background: rgba(237,0,0,.10); color: var(--danger); }
.status.pending { background: #F1F3F5; color: var(--muted); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
    background: var(--appbar); color: #fff; border-radius: var(--radius);
    padding: 12px 18px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; max-width: 90%; text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--pos); }
.toast.error { background: var(--danger); }

/* ---- step 4: home section picker, location sheet, wallet chips ---- */
.sel { width: 100%; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--field-line); background: var(--surface); color: var(--text); font-size: 1rem; font-family: inherit; margin-bottom: 4px; }
.sel:focus { outline: none; border-color: var(--primary); }
.terr-block { margin-top: 16px; padding: 12px; border: 1px dashed var(--field-line); border-radius: var(--radius); }
.terr-title { font-weight: 700; font-size: .95rem; }
.terr-block label, .card label { display: block; margin: 10px 0 4px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.chips .muted { flex-basis: 100%; }
.chip { border: 1px solid var(--field-line); background: #fff; color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600; font-family: inherit; }
.chip.active { border-color: var(--primary); background: #EAF2FB; color: var(--primary); }
.btn.link { background: transparent; color: var(--muted); border: 0; padding: 8px; font-size: .85rem; margin-top: 4px; }
.dep-status { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.right { text-align: right; max-width: 60%; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,26,63,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 520px; border-radius: 16px 16px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.25); }
.sheet h3 { margin-bottom: 8px; }
.sheet p { color: var(--text); line-height: 1.45; margin: 0 0 6px; }
