:root {
  --navy: #0a1f66;
  --navy-deep: #06134a;
  --blue: #1546c7;
  --blue-bright: #2563eb;
  --blue-soft: #e8efff;
  --gold: #ffc61a;
  --gold-deep: #f2a900;
  --red: #e5232f;
  --green: #12a150;
  --green-deep: #0b8a42;
  --ink: #12204a;
  --muted: #6b7591;
  --line: #dfe5f2;
  --page: #eef2fa;
  --radius: 14px;
  --shadow: 0 6px 18px rgba(6, 19, 74, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
  min-height: 100vh;
}

body.no-scroll, body.drawer-open { overflow: hidden; }

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; border: 0; background: none; padding: 0; }

a { color: inherit; text-decoration: none; }

[hidden] { display: none !important; }


/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-transform: none;
  transition: transform .1s, filter .15s;
}

.btn:active { transform: scale(.97); }

.btn-block { width: 100%; }

.btn-green { color: #fff; background: linear-gradient(180deg, #1fbf63, var(--green-deep)); box-shadow: 0 4px 0 #076b33; }

.btn-gold { color: var(--navy-deep); background: linear-gradient(180deg, #ffd84d, var(--gold-deep)); box-shadow: 0 4px 0 #b97f00; }

.btn-light { color: var(--ink); background: linear-gradient(180deg, #fff, #e9edf6); border: 1px solid #cfd7e8; box-shadow: 0 3px 0 #c3cbdc; }

.btn-outline { color: var(--blue); background: #fff; border: 1.5px solid #c9d5f2; }

.btn.disabled { filter: grayscale(.8); opacity: .6; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 22px;
  color: #fff;
}

.round-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--blue-bright);
  font-size: 14px;
}

.round-btn.green { background: linear-gradient(180deg, #2bd472, var(--green-deep)); }

.spin i { animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.mini-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}


/* ---------- game page ---------- */

.page-game {
  background:
    radial-gradient(circle at 15% 0%, rgba(64, 120, 255, .45), transparent 40%),
    radial-gradient(circle at 100% 30%, rgba(40, 90, 255, .35), transparent 45%),
    linear-gradient(180deg, #0c2a8f 0%, #0a2073 45%, #071857 100%);
  background-attachment: fixed;
  color: #fff;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(8, 26, 96, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }

.brand img { width: 44px; height: auto; flex: none; }

.brand-text { display: flex; flex-direction: column; line-height: 1; }

.brand-text b { font-family: 'Baloo 2', sans-serif; font-size: 26px; font-weight: 800; letter-spacing: .3px; }

.brand-text small { margin-top: 3px; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255, 255, 255, .75); }

.bell { font-size: 21px; }

.bell-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--navy);
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(120, 165, 255, .8);
  background: rgba(20, 60, 180, .5);
  font-weight: 600;
}

.limit-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  height: 38px;
  padding: 0 4px 0 12px;
  border-radius: 19px;
  border: 1.5px solid rgba(120, 165, 255, .8);
  background: rgba(20, 60, 180, .5);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.limit-pill i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--red);
  font-size: 13px;
}

.has-limit .brand img { width: 38px; }

.has-limit .brand-text b { font-size: 22px; }

.has-limit .brand-text small { display: none; }

.game { max-width: 560px; margin: 0 auto; padding: 10px 8px calc(20px + env(safe-area-inset-bottom)); }

.game > section { margin-bottom: 10px; }


@keyframes blink { 50% { opacity: .4; } }


.options-bar {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr .75fr;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.opt-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 9px 4px;
  text-align: center;
}

.opt-cell + .opt-cell { border-left: 1px solid var(--line); }

.opt-label { font-size: 10px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.opt-value { font-family: 'Baloo 2', sans-serif; font-size: 17px; font-weight: 800; line-height: 1.2; white-space: nowrap; }

.opt-value small { font-size: 10px; font-weight: 700; }

.opt-value.red { color: var(--red); }

.opt-value.closing { animation: blink 1s steps(2) infinite; }

.print-check { position: relative; cursor: pointer; }

.print-row { display: flex; align-items: center; gap: 6px; }

.print-check i { font-size: 18px; color: var(--navy); }

.print-check input { position: absolute; opacity: 0; pointer-events: none; }

.print-check .box { width: 22px; height: 22px; border: 2px solid #9aa6c2; border-radius: 5px; }

.print-check input:checked + .box { background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='white' stroke-width='3' d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--blue); }

.draw-select { display: flex; align-items: center; gap: 4px; max-width: 100%; }

.draw-select i { font-size: 15px; color: var(--blue); }

.draw-select select {
  min-width: 0;
  max-width: 100%;
  padding: 0 18px 0 0;
  border: 0;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  text-overflow: ellipsis;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%2312204a' stroke-width='2.5' d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right center/14px no-repeat;
  appearance: none;
  -webkit-appearance: none;
}


.results-card {
  padding: 8px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(40, 90, 220, .5), rgba(14, 40, 140, .55));
  border: 1px solid rgba(130, 170, 255, .45);
}

.results-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }

.results-head > span { font-weight: 700; text-transform: uppercase; font-size: 14px; display: flex; align-items: center; gap: 7px; }

.results-head .fa-trophy { color: var(--gold); font-size: 18px; }

.results-head a { font-size: 12px; color: rgba(255, 255, 255, .85); }

.live-tag {
  font-style: normal;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 800;
}

.results-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }

.result-tile {
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  text-align: center;
  border: 2px solid #b8cbff;
}

.result-tile b {
  display: block;
  padding: 3px 0 0;
  font-family: 'Baloo 2', sans-serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--blue);
}

.result-tile.red b { color: var(--red); }

.result-tile b sup { font-size: 11px; color: var(--green); margin-left: 1px; }

.result-tile span {
  display: block;
  padding: 3px 0;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #2860e6, #1440b8);
}

.result-tile.latest { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 198, 26, .35); }

.result-tile.loading b { color: #c8d2ea; }

.results-empty { grid-column: 1 / -1; padding: 16px; text-align: center; color: rgba(255, 255, 255, .8); }


.grid-card { overflow: hidden; border-radius: var(--radius); background: #f4f7fd; box-shadow: var(--shadow); }

.bet-grid { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; color: var(--ink); }

.bet-grid thead th {
  padding: 7px 0;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.bet-grid thead .range-head, .bet-grid tbody th, .bet-grid tfoot th { width: 15%; }

.bet-grid tbody th, .bet-grid tfoot th { padding: 0; }

.range-btn {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 38px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--navy-deep);
  background: linear-gradient(180deg, #ffd640, #ffbf0f);
  border-bottom: 1px solid #e6a800;
}

.range-btn.on { background: linear-gradient(180deg, #ffa21a, #f07d00); color: #fff; }

.bet-grid td { padding: 2.5px 1.5px; }

.num-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 33px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #dfe6f3;
  box-shadow: 0 1px 0 #d4dcec;
  font-size: 13px;
  line-height: 1;
  color: #2a3557;
}

.num-btn b { font-weight: 500; }

.num-btn i { font-style: normal; font-size: 10px; font-weight: 800; }

.num-btn.on { background: linear-gradient(180deg, #ffcf3a, #ffad0a); border-color: #e09600; box-shadow: 0 1px 0 #c98400; }

.num-btn.on b { font-size: 11px; font-weight: 700; }

.num-btn:active, .quick-btn:active, .range-btn:active { transform: scale(.94); }

.bet-grid tfoot th.quick-head {
  background: var(--navy);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.bet-grid td.quick-cell { padding: 0; background: var(--navy); }

.quick-cells { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; padding: 6px 4px; }

.lp-btn { width: 100%; height: 100%; min-height: 44px; color: #fff; font: inherit; text-transform: inherit; line-height: inherit; }

.lp-btn:active { transform: scale(.94); }

.quick-btn {
  height: 32px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffd640, #ffbf0f);
  color: var(--navy-deep);
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
}

.quick-btn.on { background: linear-gradient(180deg, #ffa21a, #f07d00); color: #fff; }


.cart-card { padding: 8px 12px 12px; border-radius: var(--radius); background: #fff; color: var(--ink); box-shadow: var(--shadow); }

.cart-totals { display: grid; grid-template-columns: 1fr 1fr; padding-bottom: 6px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }

.cart-total { display: flex; align-items: center; justify-content: center; gap: 10px; }

.cart-total + .cart-total { border-left: 1px solid var(--line); }

.cart-total > i { font-size: 20px; color: var(--navy); }

.cart-total div { display: flex; flex-direction: column; align-items: center; }

.cart-total span { font-size: 11.5px; line-height: 1.3; color: var(--muted); }

.cart-total b { font-family: 'Baloo 2', sans-serif; font-size: 20px; line-height: 1; color: var(--blue); }

.cart-total b.red { color: var(--red); }

.cart-total b span { font: inherit; color: inherit; }

.cart-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }

.cart-actions .btn { min-height: 54px; font-size: 17px; text-transform: uppercase; }

.cart-actions .btn-light { text-transform: none; }


.link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.link-card > i:first-child { font-size: 22px; color: var(--navy); }

.link-card span { flex: 1; display: flex; flex-direction: column; }

.link-card small { font-size: 12px; color: var(--muted); }

.tagline {
  padding: 18px 0 4px;
  text-align: center;
  font-family: 'Brush Script MT', 'Segoe Script', cursive;
  font-style: italic;
  font-size: 26px;
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}


/* ---------- drawer ---------- */

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(84vw, 340px);
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: linear-gradient(180deg, #16248f 0%, #0d1660 22%, #0b1452 100%);
  color: #fff;
  border-radius: 0 22px 22px 0;
  transform: translateX(-105%);
  transition: transform .25s ease;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 8, 30, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.drawer-open .drawer { transform: none; }

.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0 14px; padding-top: max(22px, env(safe-area-inset-top)); }

.drawer-brand { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 700; }

.drawer-brand img {
  width: 64px;
  height: 64px;
  padding: 5px;
  object-fit: contain;
  border-radius: 50%;
  background: #1a1030;
  border: 3px solid var(--gold);
}

.drawer-close { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: 20px; }

.drawer-user { padding: 6px 0 14px; }

.drawer-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }

.drawer-id { display: inline-block; padding: 6px 14px; border-radius: 7px; background: var(--blue-bright); font-weight: 600; }

.drawer-wallet { padding: 14px 16px; border-radius: 18px; background: #1b2a99; margin-bottom: 14px; }

.drawer-wallet-row { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .12); }

.drawer-wallet-icon { font-size: 26px; color: #f0b54b; }

.drawer-wallet-amount { flex: 1; font-size: 22px; font-weight: 700; }

.drawer-wallet-user { padding-top: 12px; color: rgba(255, 255, 255, .8); }

.drawer-wallet-user i { color: #58a6ff; margin-right: 10px; }

.drawer-menu { border-top: 1px solid rgba(255, 255, 255, .12); }

.drawer-menu a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 4px;
  font-size: 18px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.drawer-menu a > i:first-child { width: 24px; text-align: center; font-size: 20px; color: var(--gold); }

.drawer-menu a span { flex: 1; }

.drawer-menu a > i:last-child { font-size: 14px; color: rgba(255, 255, 255, .7); }

.drawer-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  padding: 14px;
  border: 2px solid #ff4d5a;
  border-radius: 14px;
  color: #ff5a64;
  font-size: 18px;
  font-weight: 600;
}


/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 8, 30, .6);
  animation: fade .15s;
}

@keyframes fade { from { opacity: 0; } }

.modal-box {
  width: 100%;
  max-width: 360px;
  padding: 22px 18px 18px;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  animation: pop .2s ease-out;
}

@keyframes pop { from { transform: scale(.85); opacity: 0; } }

.modal-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 18px; }

/* Amount popup sits at the top so its input stays above the phone keyboard */
#amount-modal { place-items: start center; padding-top: max(12px, env(safe-area-inset-top)); }

.amount-box { padding-top: 16px; background: linear-gradient(180deg, #13308e, #0b1d63); color: #fff; text-align: center; }

.amount-title { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255, 255, 255, .7); }

.amount-target {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 10px auto 6px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffd640, #ffb10a);
  color: var(--navy-deep);
  font-family: 'Baloo 2', sans-serif;
  font-size: 32px;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(255, 198, 26, .3);
}

.amount-target.wide { width: auto; min-width: 120px; padding: 0 16px; font-size: 26px; }

.amount-existing { min-height: 20px; font-size: 13px; color: var(--gold); }

#amount-input {
  width: 100%;
  height: 54px;
  margin-top: 12px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  outline: none;
}

#amount-input:focus { border-color: var(--gold); }

#amount-input::placeholder { color: rgba(255, 255, 255, .35); font-weight: 500; }

.chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 12px; }

.chips button { height: 40px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; }

.chips button:active { background: var(--gold); color: var(--navy-deep); }

.amount-box .btn-outline { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }

.success-box { text-align: center; }

.success-icon { font-size: 52px; color: var(--green); }

.success-box h3 { margin: 6px 0 12px; font-size: 22px; }

.success-rows > div { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line); }

.success-rows span { color: var(--muted); }

.success-rows b.red { color: var(--red); }

.success-rows b.gold { color: var(--gold-deep); }

.success-tickets { max-height: 160px; margin-top: 10px; overflow-y: auto; }

.ticket-line { display: flex; align-items: center; gap: 10px; padding: 6px 2px; font-size: 13px; }

.ticket-line span:first-child { flex: 1; text-align: left; font-weight: 600; }

.mini-btn.wa { background: #e3f8ea; color: #25d366; font-size: 19px; }

.rules-box h3 { margin: 0 0 12px; font-size: 20px; }

.rules-box h3 i { color: var(--blue); }

.rules-box ul { margin: 0; padding-left: 18px; line-height: 1.55; }

.rules-box li { margin-bottom: 8px; }

.rules-box p { margin: 0; line-height: 1.6; white-space: pre-line; }


/* ---------- draw animation ---------- */

.draw-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, #1d47c9, #050f3d 70%);
  color: #fff;
  animation: fade .2s;
}

.draw-box { text-align: center; }

.draw-label { font-size: 14px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255, 255, 255, .7); }

.draw-time { font-size: 24px; font-weight: 700; color: var(--gold); }

.draw-number {
  display: grid;
  place-items: center;
  width: 190px;
  height: 190px;
  margin: 26px auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #dfe7ff);
  color: var(--blue);
  font-family: 'Baloo 2', sans-serif;
  font-size: 104px;
  font-weight: 800;
  border: 8px solid var(--gold);
  box-shadow: 0 0 0 10px rgba(255, 198, 26, .2), 0 0 60px rgba(255, 198, 26, .45);
}

.draw-number.reveal { color: var(--red); animation: reveal .5s ease-out; }

@keyframes reveal { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }

.draw-bonus {
  position: relative;
  display: grid;
  place-items: center;
  width: 190px;
  height: 92px;
  margin: 0 auto 18px;
  padding: 6px 10px 16px;
  border-radius: 16px;
  border: 3px solid var(--gold);
  background: radial-gradient(circle at 50% 30%, #3a1d8a, #12093a);
  box-shadow: 0 0 24px rgba(255, 198, 26, .35);
}

.draw-bonus img { max-width: 100%; max-height: 64px; }

.draw-bonus span { font-family: 'Baloo 2', sans-serif; font-size: 34px; font-weight: 800; line-height: 1; color: var(--gold); }

.draw-bonus small { position: absolute; bottom: 3px; left: 0; right: 0; font-size: 10px; font-weight: 800; letter-spacing: 3px; color: rgba(255, 215, 70, .85); }

.draw-bonus.spin img { filter: blur(1px); opacity: .85; }

.draw-bonus.none span { font-size: 18px; color: rgba(255, 255, 255, .6); }

.draw-bonus.reveal img, .draw-bonus.reveal span { animation: reveal .5s ease-out; }


/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: #101a3d;
  color: #fff;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  transform: translate(-50%, 150%);
  opacity: 0;
  transition: transform .25s, opacity .25s;
  pointer-events: none;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }


/* ---------- inner pages ---------- */

.sub-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(180deg, #1a5fe0, #1146c4);
  color: #fff;
}

.sub-header h1 { flex: 1; margin: 0; font-size: 24px; font-weight: 700; }

.sub-header-right { position: relative; }

.inner { max-width: 640px; margin: 0 auto; padding: 12px 10px calc(24px + env(safe-area-inset-bottom)); }

.filter-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

.filter-row > label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }

.date-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--blue-bright);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  font-size: 15px;
}

.date-pill input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

.history-filter { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }

.history-filter .date-pill, .draw-pill { justify-content: space-between; min-width: 0; padding: 7px 12px; }

.draw-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--blue-bright);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-weight: 700;
  font-size: 15px;
}

.draw-pill select { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: inherit; appearance: none; -webkit-appearance: none; outline: none; }

.summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }

.summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 5px;
  border-radius: 10px;
  min-width: 0;
}

.summary > i { font-size: 20px; flex: none; }

.summary > div { min-width: 0; }

.summary span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }

.summary b { display: block; font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.summary.blue { background: #e7f0ff; }
.summary.blue i, .summary.blue b { color: var(--blue); }
.summary.orange { background: #fff2df; }
.summary.orange i, .summary.orange b { color: #f07d00; }
.summary.purple { background: #f3e8ff; cursor: pointer; }
.summary.purple i, .summary.purple b { color: #8a2be2; }
.summary.purple .caret { position: absolute; top: 5px; right: 5px; font-size: 10px; color: #8a2be2; }

.prize-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  width: 190px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(10, 20, 60, .2);
}

.prize-menu button { display: flex; justify-content: space-between; width: 100%; padding: 9px 10px; border-radius: 8px; text-align: left; font-size: 14px; }

.prize-menu button.active { background: #efe4ff; color: #6a1bbf; font-weight: 600; }

.prize-menu button.active::after { content: '\2713'; font-weight: 800; }

.bet-list { display: flex; flex-direction: column; gap: 8px; }

.bet-card { padding: 8px; border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(10, 30, 90, .08); }

.bet-main { display: grid; grid-template-columns: 33% 1fr; gap: 7px; }

.claim-col { display: flex; flex-direction: column; gap: 5px; padding: 6px; border-radius: 10px; text-align: center; }

.claim-col.won { background: #e5f8ec; }
.claim-col.lost { background: #ffe9ea; }
.claim-col.pending { background: #eef2fa; }

.print-mark { display: flex; user-select: none; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); text-align: left; }

.print-mark input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--blue-bright); }

.print-mark input:disabled { opacity: 1; }

.claim-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 4px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  white-space: nowrap;
}

.claim-badge.green { background: var(--green); font-size: 16px; }
.claim-badge.red { background: #f0243a; }
.claim-badge.blue { background: var(--blue-bright); }
.claim-badge.grey { background: #8b95ad; }

.claim-amount { padding: 4px; border-radius: 8px; background: rgba(255, 255, 255, .55); }

.claim-amount small { display: block; font-size: 11px; color: var(--muted); }

.claim-amount b { font-size: 17px; font-weight: 800; }

.claim-col.won .claim-amount b { color: var(--green); }
.claim-col.lost .claim-amount b { color: #e5233a; }
.claim-col.pending .claim-amount b { color: var(--blue); }

.bet-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; align-content: start; min-width: 0; }

.bet-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 6px; }

.draw-chip { padding: 3px 8px; border-radius: 6px; background: #e7f0ff; color: var(--blue); font-weight: 700; font-size: 12.5px; white-space: nowrap; }

.bet-barcode { font-size: 11px; color: var(--muted); white-space: nowrap; }

.info-cell { min-width: 0; padding: 4px 2px; border-radius: 8px; text-align: center; }

.info-cell > small { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; color: var(--ink); white-space: nowrap; }

.info-cell > b { display: block; font-size: 14px; font-weight: 800; white-space: nowrap; letter-spacing: -.2px; }

.info-cell > b.long { font-size: 11.5px; }

.info-cell > b.longer { font-size: 10px; }

.info-cell.qty { background: #f6eaff; }
.info-cell.qty small i, .info-cell.qty b { color: #8a2be2; }
.info-cell.amount { background: #e9f8ee; }
.info-cell.amount small i, .info-cell.amount b { color: var(--green); }
.info-cell.prize { background: #fff2df; }
.info-cell.prize small i, .info-cell.prize b { color: #f07d00; }

.bet-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }

.bet-foot > span { flex: 1; min-width: 0; line-height: 1.3; }

.bet-foot > span small { display: block; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bet-foot > span small.claimed { color: var(--green); }

.wa-btn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #e3f8ea; color: #25d366; font-size: 20px; }

.print-btn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #e3ecff; color: var(--blue); font-size: 15px; }

.expand-btn { display: grid; place-items: center; flex: none; width: 22px; height: 34px; color: var(--blue); font-size: 14px; transition: transform .2s; }

.bet-card.open .expand-btn { transform: rotate(90deg); }

.bet-numbers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

.bet-numbers span { padding: 4px 9px; border-radius: 8px; background: #fff4cc; border: 1px solid #ffd966; font-weight: 700; font-size: 13px; }

.bet-numbers span small { color: var(--muted); font-weight: 500; }

.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }

.empty-state i { display: block; margin-bottom: 10px; font-size: 40px; color: #b8c3dc; }

.card { padding: 14px; border-radius: 14px; background: #fff; box-shadow: 0 2px 10px rgba(10, 30, 90, .08); }

.report-table { width: 100%; border-collapse: collapse; }

.report-table td { padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }

.report-table td:last-child { text-align: right; font-weight: 700; }

.report-table tr.total td { border-bottom: 0; font-size: 17px; color: var(--blue); }

.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }

.results-grid .result-tile b { font-size: 30px; }

.results-grid .result-tile { display: flex; flex-direction: column; }

.results-grid .result-tile span { margin-top: auto; }

.results-grid .result-tile .double { display: block; height: 20px; margin: 0 auto 5px; min-width: 34px; padding: 0 6px; border-radius: 6px; background: #fff4cc; border: 1px solid #ffd966; color: var(--navy-deep); font-style: normal; font-weight: 800; font-size: 13px; line-height: 18px; }

.results-grid .result-tile .double.empty { visibility: hidden; }

.results-grid .result-tile.pending b { color: #c8d2ea; }

.results-grid .result-tile.pending span { background: #9aa8c8; }

.form-field { margin-bottom: 14px; }

.form-field label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }

.form-field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  outline: none;
}

.form-field input:focus { border-color: var(--blue-bright); }

.settings-head { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; }

.settings-head i { color: var(--blue); }

.alert { margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; font-weight: 500; }

.alert.error { background: #ffe9ea; color: #b4141f; }

.alert.ok { background: #e5f8ec; color: #0b6e35; }


/* ---------- login ---------- */

/* Card sits at the top so the fields stay above the phone keyboard */
.page-login {
  display: grid;
  place-items: start center;
  padding: max(16px, env(safe-area-inset-top)) 16px 20px;
  background:
    radial-gradient(circle at 20% 0%, rgba(64, 120, 255, .5), transparent 45%),
    linear-gradient(180deg, #0c2a8f, #071857);
  color: #fff;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 18px 20px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(130, 170, 255, .4);
  backdrop-filter: blur(6px);
  text-align: center;
}

.login-card img { width: 84px; }

.login-card h1 { margin: 2px 0 2px; font-family: 'Baloo 2', sans-serif; font-size: 34px; font-weight: 800; }

.login-card p { margin: 0 0 14px; color: rgba(255, 255, 255, .7); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; }

.login-card .form-field { text-align: left; }

.login-card .form-field label { color: rgba(255, 255, 255, .8); }

.login-card .form-field input { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .95); color: var(--ink); }

.login-card .btn { width: 100%; margin-top: 6px; font-size: 17px; }

.login-card .back-link { display: inline-block; margin-top: 16px; color: rgba(255, 255, 255, .8); font-size: 14px; }

.login-card .switch-link { margin: 16px 0 0; font-size: 14px; letter-spacing: 0; text-transform: none; }

.login-card .switch-link a { color: var(--gold); font-weight: 700; }


/* ---------- small phones ---------- */

@media (max-width: 380px) {
  .limit-pill { font-size: 15px; padding-left: 10px; }
  .round-btn { width: 28px; height: 28px; font-size: 12px; }
  .result-tile b { font-size: 26px; }
  .result-tile span { font-size: 10px; }
  .num-btn { height: 30px; font-size: 12px; }
  .range-btn { font-size: 10px; min-height: 35px; }
  .quick-btn { font-size: 8.5px; height: 30px; }
  .opt-label { font-size: 9px; letter-spacing: 0; }
  .opt-value { font-size: 15px; }
  .draw-select i { display: none; }
  .brand-text b { font-size: 23px; }
  .cart-total b { font-size: 18px; }
  .summary b { font-size: 15px; }
  .summary span { font-size: 10px; }
  .summary > i { font-size: 17px; }
}


/* ---------- print (report page) ---------- */

@media print {
  .sub-header, .report-actions, .filter-row label > i, .toast, .drawer, .drawer-backdrop { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #000; }
  .date-pill { border: 0; padding: 0; }
}


/* ---------- top-up QR, withdraw, profile ---------- */

.topup-box { text-align: center; }

.topup-box img { display: block; width: 180px; height: 180px; margin: 0 auto 12px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; object-fit: contain; background: #fff; }

.topup-box h3 { margin: 0 0 6px; font-size: 20px; }

.topup-box p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.drawer-section { padding: 14px 18px 4px; font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255, 255, 255, .55); }

.wd-balance { margin-bottom: 12px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, #2860e6, #0b1d63); color: #fff; }

.wd-balance small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: .75; }

.wd-balance b { font-size: 28px; font-weight: 800; }

.wd-note { margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid #fde68a; background: #fef3c7; color: #92400e; font-size: 13px; font-weight: 600; line-height: 1.55; }

.wd-sub { margin: -8px 0 12px; color: var(--muted); font-size: 13px; }

.wd-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; padding: 4px; border-radius: 12px; background: #e7edf9; }

.wd-tabs button { padding: 9px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }

.wd-tabs button.on { background: var(--blue); color: #fff; }

.wd-account { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }

.wd-account small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }

.wd-account b { display: block; margin-top: 3px; font-size: 16px; }

.wd-account span { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }

.wd-account em { display: block; margin-top: 8px; font-size: 12px; font-style: normal; color: var(--muted); }

.wd-account > i { font-size: 20px; color: var(--green); }

.inner > .card + .card, .inner > form.card { margin-bottom: 12px; }

.wd-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }

.wd-row b { display: block; font-size: 14px; }

.wd-row small { display: block; font-size: 12px; color: var(--muted); }

.wd-row small.red { color: #dc2626; }

.wd-row > span { font-weight: 800; color: #dc2626; white-space: nowrap; }

.wd-badge { margin-left: 4px; padding: 1px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; }

.wd-badge.pending { background: #fef3c7; color: #92400e; }

.wd-badge.sent { background: #e5f8ec; color: #0b6e35; }

.wd-badge.rejected { background: #ffe9ea; color: #b4141f; }

.profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 16px; border-radius: 14px; background: linear-gradient(135deg, #2860e6, #0b1d63); color: #fff; }

.profile-top > div { flex: 1; min-width: 0; }

.profile-avatar { display: grid; place-items: center; flex: none; width: 58px; height: 58px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .18); font-size: 24px; font-weight: 800; }

.profile-top b { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-top small { display: block; font-size: 12px; opacity: .75; }

.profile-top span { display: block; margin-top: 3px; font-weight: 700; color: var(--gold); }

.profile-top .btn { width: auto; padding: 8px 14px; font-size: 13px; }

.form-field input:disabled { opacity: .55; }
