:root {
  --bg: #020a1f;
  --bg2: #04122f;
  --card: rgba(14, 32, 74, .55);
  --card-2: rgba(10, 24, 58, .75);
  --line: rgba(92, 150, 255, .20);
  --line-2: rgba(92, 150, 255, .34);
  --text: #eef4ff;
  --muted: #9cb0d8;
  --dim: #6c80aa;
  --blue: #1f8bff;
  --blue-2: #0b5bff;
  --cyan: #45c2ff;
  --gold: #ffc93a;
  --gold-2: #ff9f0a;
  --gold-3: #fff0a8;
  --green: #3ee08f;
  --red: #ff5f74;
  --amber: #ffb53d;
  --r-lg: 22px;
  --r-md: 16px;
  --tab-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.2, .9, .25, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  overflow-x: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 40% at 50% 18%, rgba(30, 110, 255, .30), transparent 70%),
    url(assets/bg.png) center top / cover no-repeat,
    linear-gradient(#03112e, #010614);
}

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(rgba(2, 10, 31, .92), rgba(2, 10, 31, .6) 70%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #2a7bff, #123a9c) center / cover;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  box-shadow: 0 0 0 2px rgba(69, 194, 255, .35), 0 0 14px rgba(31, 139, 255, .45);
}
.me-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.me-sub { font-size: 11.5px; color: var(--muted); }
.balance {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 6px 6px 12px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 201, 58, .16), rgba(255, 159, 10, .08));
  border: 1px solid rgba(255, 201, 58, .45);
  font-weight: 800; font-size: 16px; color: var(--gold-3);
  box-shadow: 0 0 18px rgba(255, 180, 40, .18);
  transition: transform .2s var(--ease-spring);
}
.balance:active { transform: scale(.95); }
.balance .plus {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #ffd45a, #ff9f0a); color: #3a2200; font-size: 18px; line-height: 1;
}
.balance.bump { animation: bump .6s var(--ease-spring); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }

.star-ico {
  display: inline-block; width: 18px; height: 18px; flex: none; vertical-align: -3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff2a6'/%3E%3Cstop offset='.45' stop-color='%23ffc93a'/%3E%3Cstop offset='1' stop-color='%23ff8a00'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' stroke='%23b86200' stroke-width='.6' stroke-linejoin='round' d='M12 1.8c.5 0 .9.3 1.1.7l2.5 5.2 5.6.8c1 .1 1.4 1.4.7 2.1l-4.1 4 1 5.6c.2 1-.9 1.7-1.7 1.3L12 18.8l-5 2.7c-.9.5-1.9-.3-1.8-1.3l1-5.6-4.1-4c-.7-.7-.3-2 .7-2.1l5.6-.8 2.5-5.2c.2-.4.6-.7 1.1-.7z'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(255, 190, 40, .55));
}
.star-ico.lg { width: 34px; height: 34px; vertical-align: -6px; }
.star-ico.md { width: 24px; height: 24px; vertical-align: -4px; }
.star-ico.sm { width: 15px; height: 15px; vertical-align: -2px; }

/* ---------- views ---------- */
.view { display: none; padding: 4px 16px 0; }
.view.active { display: block; animation: viewIn .45s var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(20, 44, 98, .55), rgba(8, 20, 50, .65));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(140, 190, 255, .10), 0 10px 30px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.card + .card { margin-top: 12px; }
.card-title { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.h1 { font-size: 26px; font-weight: 800; text-align: center; margin: 10px 0 6px; letter-spacing: -.01em; }
.sub { color: var(--muted); text-align: center; font-size: 14.5px; line-height: 1.4; margin: 0 0 18px; }

/* ---------- ball ---------- */
.ball {
  --s: 52px;
  width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-weight: 800; font-size: calc(var(--s) * .44); color: #fff; letter-spacing: -.02em;
  text-shadow: 0 2px 3px rgba(0, 20, 80, .6);
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .95) 0, rgba(190, 230, 255, .75) 9%, rgba(80, 170, 255, 0) 26%),
    radial-gradient(circle at 50% 62%, #2a8dff 0%, #1366f2 40%, #0a3bb8 70%, #061f6e 100%);
  border: 2px solid #5cc0ff;
  box-shadow: 0 0 0 1px rgba(0, 30, 110, .7), 0 0 calc(var(--s) * .32) rgba(40, 150, 255, .75), inset 0 -4px 8px rgba(0, 10, 60, .55);
  position: relative;
}
.ball.gold {
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .95) 0, rgba(255, 245, 200, .7) 9%, rgba(255, 220, 120, 0) 26%),
    radial-gradient(circle at 50% 62%, #ffcf3f 0%, #ffaa12 45%, #d96f00 75%, #7d3a00 100%);
  border-color: #ffe27a; color: #fff;
  text-shadow: 0 2px 3px rgba(110, 50, 0, .7);
  box-shadow: 0 0 0 1px rgba(120, 60, 0, .7), 0 0 calc(var(--s) * .4) rgba(255, 190, 40, .8), inset 0 -4px 8px rgba(100, 40, 0, .5);
}
.ball.dim { filter: saturate(.35) brightness(.55); box-shadow: none; }
.ball.hit { animation: hitGlow 1.6s ease-in-out infinite; }
@keyframes hitGlow { 50% { box-shadow: 0 0 0 1px rgba(0, 30, 110, .7), 0 0 calc(var(--s) * .6) rgba(90, 200, 255, 1), inset 0 -4px 8px rgba(0, 10, 60, .55); } }
.balls { display: flex; gap: 10px; align-items: center; }
.balls.center { justify-content: center; }

/* ---------- home hero ---------- */
.hero { position: relative; height: 222px; margin: 0 -16px; overflow: hidden; }
.hero .rays {
  position: absolute; left: 50%; top: 46%; width: 560px; height: 560px; margin: -280px 0 0 -280px;
  background: repeating-conic-gradient(from 0deg, rgba(90, 170, 255, .16) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 60%); mask: radial-gradient(circle, #000 0, transparent 60%);
  animation: spin 40s linear infinite;
}
.hero .glow { position: absolute; left: 50%; top: 50%; width: 300px; height: 180px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(255, 190, 50, .38), transparent); filter: blur(6px); }
@keyframes spin { to { transform: rotate(360deg); } }
.hero .fball { position: absolute; animation: float 5s ease-in-out infinite; }
.hero .fball:nth-child(4) { animation-delay: -1.2s; animation-duration: 6s; }
.hero .fball:nth-child(5) { animation-delay: -2.5s; animation-duration: 5.5s; }
.hero .fball:nth-child(6) { animation-delay: -3.7s; animation-duration: 6.5s; }
@keyframes float { 50% { transform: translateY(-9px) rotate(6deg); } }
.coin {
  position: absolute; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c2 0, #ffd54a 22%, #f0a400 60%, #a86100 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 230, 140, .6), inset 0 -3px 5px rgba(120, 60, 0, .5), 0 0 12px rgba(255, 190, 40, .55);
  transform: rotateX(55deg) rotate(-20deg);
}
.coin::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 2px solid rgba(160, 90, 0, .45); }
.hero .coin { animation: float 4.5s ease-in-out infinite; }

.logo-wrap { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); animation: logoIn .9s var(--ease-spring) both; }
@keyframes logoIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
.crown { position: absolute; left: 50%; top: -34px; width: 64px; transform: translateX(-50%); filter: drop-shadow(0 0 10px rgba(255, 200, 60, .7)); animation: crown 3s ease-in-out infinite; }
@keyframes crown { 50% { transform: translateX(-50%) translateY(-4px) rotate(-3deg); } }
.logo {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 26px 10px; border-radius: 30px;
  background: linear-gradient(180deg, #0d2d6e, #061844);
  border: 3px solid transparent;
  background-clip: padding-box;
  position: relative;
  box-shadow: 0 0 0 3px #ffbf2e, 0 0 26px rgba(255, 190, 40, .55), inset 0 2px 10px rgba(80, 160, 255, .45);
  transform: rotate(-4deg);
}
.logo .g {
  font-size: 66px; font-weight: 900; line-height: 1; letter-spacing: -.03em;
  background: linear-gradient(180deg, #fffbe0 0%, #ffe066 30%, #ffb30f 62%, #ff8c00 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #7a3b00) drop-shadow(0 0 10px rgba(255, 180, 30, .45));
}
.logo .w { font-size: 34px; font-weight: 800; color: #fff; text-shadow: 0 3px 0 #0a1f55, 0 0 10px rgba(255, 255, 255, .35); }
.logo.small { transform: none; padding: 4px 18px 6px; }
.logo.small .g { font-size: 44px; }
.logo.small .w { font-size: 24px; }

.next-draw {
  position: relative; z-index: 2;
  margin: -6px auto 0; width: max-content; min-width: 74%;
  text-align: center; padding: 9px 22px 10px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 48, 110, .78), rgba(8, 24, 64, .85));
  border: 1px solid rgba(92, 170, 255, .45);
  box-shadow: 0 0 22px rgba(30, 130, 255, .25), inset 0 1px 0 rgba(160, 210, 255, .2);
}
.next-draw .l1 { font-size: 13.5px; color: #c9d8f5; }
.next-draw .l2 { font-size: 13.5px; color: #c9d8f5; margin-top: 3px; }
.next-draw .timer { font-size: 18px; font-weight: 700; color: #fff; margin-left: 6px; letter-spacing: .02em; }
.next-draw.soon .timer { color: var(--gold); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }

.jackpot {
  position: relative; margin: 10px 0 14px; padding: 12px 16px 14px; border-radius: 22px; text-align: center; overflow: hidden;
  background: linear-gradient(180deg, #3d2705 0%, #241502 55%, #160c01 100%);
  box-shadow: 0 0 0 2px #ffc23a, 0 0 0 4px rgba(255, 194, 58, .25), 0 0 30px rgba(255, 170, 30, .45), inset 0 0 30px rgba(255, 170, 30, .25);
}
.jackpot::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 240, 180, .28), transparent);
  animation: shine 4.5s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.jackpot .lbl { font-weight: 800; font-size: 17px; letter-spacing: .04em; color: var(--gold); text-shadow: 0 0 10px rgba(255, 190, 40, .45); }
.jackpot .amt {
  font-size: 40px; font-weight: 900; letter-spacing: -.02em; line-height: 1.12;
  background: linear-gradient(180deg, #fffbe0, #ffd84a 45%, #ff9d00);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #5a2a00);
  display: inline-flex; align-items: center; gap: 8px;
}
.jackpot .coin.l { left: 10px; bottom: 6px; } .jackpot .coin.l2 { left: 30px; bottom: -6px; width: 26px; height: 26px; }
.jackpot .coin.r { right: 12px; top: 10px; } .jackpot .coin.r2 { right: 30px; bottom: -4px; width: 28px; height: 28px; }

/* ---------- picker ---------- */
.picker .card-title { text-align: center; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 8px; justify-items: center; }
.num {
  width: min(56px, 15vw); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 20px; color: #e8efff;
  background: radial-gradient(circle at 50% 35%, rgba(40, 70, 140, .55), rgba(8, 18, 46, .9));
  border: 1.5px solid rgba(110, 160, 255, .38);
  box-shadow: inset 0 2px 6px rgba(120, 170, 255, .12), 0 2px 6px rgba(0, 0, 0, .35);
  transition: transform .18s var(--ease-out), border-color .2s, box-shadow .2s;
  position: relative;
}
.num:active { transform: scale(.9); }
.num.sel {
  --s: min(56px, 15vw);
  color: #fff; border-color: #6fd0ff;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .9) 0, rgba(190, 230, 255, .6) 9%, rgba(80, 170, 255, 0) 26%),
    radial-gradient(circle at 50% 62%, #2a9bff 0%, #1366f2 45%, #0a3bb8 80%, #061f6e 100%);
  box-shadow: 0 0 0 1px rgba(0, 30, 110, .7), 0 0 18px rgba(50, 170, 255, .95), 0 0 34px rgba(30, 130, 255, .45);
  text-shadow: 0 2px 3px rgba(0, 20, 80, .6);
  animation: pop .42s var(--ease-spring);
}
.num.sel::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid #7fd6ff; animation: ripple .6s ease-out forwards; }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes ripple { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
.num.full:not(.sel) { opacity: .45; }
.num.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: #cfe0ff;
  background: rgba(10, 30, 70, .7); border: 1px solid var(--line-2);
}
.chip .ok { width: 18px; height: 18px; border-radius: 50%; background: var(--dim); display: grid; place-items: center; transition: background .3s; }
.chip .ok svg { width: 11px; height: 11px; }
.chip.done { color: var(--green); border-color: rgba(62, 224, 143, .4); box-shadow: 0 0 14px rgba(62, 224, 143, .18); }
.chip.done .ok { background: var(--green); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--cyan); padding: 7px 4px; }
.link-btn svg { width: 17px; height: 17px; }
.link-btn:active { opacity: .6; }

.btn {
  position: relative; overflow: hidden;
  width: 100%; height: 58px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 20px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #49b0ff 0%, #1d84ff 45%, #0b5bff 100%);
  box-shadow: 0 0 0 1px rgba(140, 210, 255, .55) inset, 0 8px 26px rgba(20, 110, 255, .55), 0 0 30px rgba(40, 150, 255, .35);
  transition: transform .15s, filter .2s, opacity .2s;
}
.btn::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 35%; left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
}
.btn.ready::before { animation: shine 2.8s ease-in-out infinite; }
.btn:active { transform: scale(.97); }
.btn[disabled] { filter: grayscale(.75) brightness(.6); box-shadow: none; pointer-events: none; }
.btn .chev { position: absolute; right: 22px; width: 20px; height: 20px; }
.btn.secondary { background: rgba(20, 50, 110, .55); box-shadow: 0 0 0 1px var(--line-2) inset; font-size: 16px; height: 48px; color: #bfe1ff; }
.btn.loading { pointer-events: none; }
.btn.loading span, .btn.loading .star-ico, .btn.loading svg { opacity: 0; }
.btn.loading::after { content: ""; position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.home-cta { margin: 14px 0 6px; }

/* ---------- checkout ---------- */
.edit-btn { margin-top: 16px; width: 100%; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #7fc8ff; font-weight: 600; font-size: 15.5px; background: rgba(20, 60, 140, .35); border: 1px solid var(--line-2); }
.edit-btn svg { width: 18px; height: 18px; }
.price-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.price-row .big { font-size: 44px; font-weight: 800; letter-spacing: -.02em; }
.price-row .unit { color: #cfe0ff; font-size: 15px; font-weight: 500; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg button {
  height: 52px; border-radius: 14px; font-size: 19px; font-weight: 700; color: #dfe9ff;
  background: rgba(8, 20, 50, .7); border: 1px solid var(--line-2);
  transition: all .2s var(--ease-out);
}
.seg button.on { color: #fff; border-color: #4fb6ff; background: linear-gradient(180deg, rgba(40, 130, 255, .5), rgba(12, 70, 200, .55)); box-shadow: 0 0 18px rgba(40, 150, 255, .5), inset 0 0 0 1px rgba(150, 215, 255, .4); transform: translateY(-1px); }
.total { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.total .lbl { color: #c7d6f3; font-size: 15px; }
.total .val { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 800; margin-top: 6px; }
.total .bal { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.total .bal.low { color: var(--red); }
.foot-note { text-align: center; color: var(--dim); font-size: 12.5px; margin: 12px 0 0; line-height: 1.4; }
.pay-btn { margin-top: 14px; }

/* ---------- tickets ---------- */
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 16px; background: rgba(8, 20, 50, .75); border: 1px solid var(--line); margin: 6px 0 14px; position: relative; }
.tabs2 .pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 12px; background: linear-gradient(180deg, #3aa6ff, #0d63ff); box-shadow: 0 0 18px rgba(30, 130, 255, .6); transition: transform .35s var(--ease-out); }
.tabs2[data-on="archive"] .pill { transform: translateX(100%); }
.tabs2 button { position: relative; z-index: 1; height: 40px; font-weight: 600; font-size: 15px; color: var(--muted); transition: color .25s; }
.tabs2 button.on { color: #fff; }

.tcard { padding: 14px 16px 12px; animation: viewIn .45s var(--ease-out) both; }
.tcard-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tcard-h .t { font-size: 17px; font-weight: 700; }
.tcard-h .cd { font-size: 18px; font-weight: 600; color: #dce8ff; letter-spacing: .02em; }
.badge2 { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge2.wait { color: var(--amber); background: rgba(255, 181, 61, .14); border: 1px solid rgba(255, 181, 61, .3); }
.badge2.win { color: var(--green); background: rgba(62, 224, 143, .12); border: 1px solid rgba(62, 224, 143, .3); }
.badge2.lose { color: var(--red); background: rgba(255, 95, 116, .12); border: 1px solid rgba(255, 95, 116, .3); }
.tcard .balls { margin: 12px 0 10px; }
.tcard .prize { margin-left: auto; font-size: 18px; font-weight: 800; color: var(--green); text-shadow: 0 0 12px rgba(62, 224, 143, .4); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.tcard-f { display: flex; align-items: center; gap: 8px; color: #8fb6ff; font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.tcard-f .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .7; }
.tcard-f .gold { color: #ffd65a; display: inline-flex; align-items: center; gap: 5px; }
.tcard-f .drawn { margin-left: auto; display: flex; gap: 4px; }
.mini { --s: 22px; font-size: 11px; border-width: 1px; }
.empty { text-align: center; padding: 34px 16px 26px; }
.empty .ico { font-size: 46px; margin-bottom: 8px; filter: drop-shadow(0 0 12px rgba(40, 150, 255, .6)); }
.empty p { color: var(--muted); margin: 6px 0 18px; }

/* ---------- results ---------- */
.res-head { text-align: center; margin: 6px 0 2px; }
.res-head .h1 { margin: 6px 0 4px; font-size: 24px; }
.res-head .date { color: #c7d6f3; font-size: 14.5px; }
.burst { position: relative; height: 130px; display: grid; place-items: center; margin: 4px -16px 0; overflow: hidden; }
.burst .rays { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -260px 0 0 -260px; background: repeating-conic-gradient(rgba(255, 200, 60, .2) 0 5deg, transparent 5deg 15deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 55%); mask: radial-gradient(circle, #000 0, transparent 55%); animation: spin 30s linear infinite; }
.burst .halo { position: absolute; width: 340px; height: 120px; background: radial-gradient(closest-side, rgba(255, 190, 40, .55), transparent); }
.burst .balls { position: relative; gap: 8px; }
.burst .ball { --s: 66px; animation: ballDrop .7s var(--ease-spring) both; }
.burst .ball:nth-child(2) { animation-delay: .12s; } .burst .ball:nth-child(3) { animation-delay: .24s; } .burst .ball:nth-child(4) { animation-delay: .36s; }
@keyframes ballDrop { from { opacity: 0; transform: translateY(-40px) scale(.4); } }
.burst .coin { animation: coinFloat 3.5s ease-in-out infinite; }
@keyframes coinFloat { 50% { transform: rotateX(55deg) rotate(10deg) translateY(-6px); } }

.win-banner {
  position: relative; overflow: hidden; text-align: center; padding: 14px 16px 16px; border-radius: 24px; margin-top: 6px;
  background: linear-gradient(180deg, #4a3005, #251602 60%, #170d01);
  box-shadow: 0 0 0 2.5px #ffc23a, 0 0 34px rgba(255, 170, 30, .55), inset 0 0 34px rgba(255, 170, 30, .3);
  animation: winIn .8s var(--ease-spring) both .3s;
}
.win-banner::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 240, 180, .3), transparent); animation: shine 3.5s ease-in-out infinite; }
@keyframes winIn { from { opacity: 0; transform: scale(.7); } }
.win-banner .t { font-size: 22px; font-weight: 800; color: #ffe9a8; }
.win-banner .v { font-size: 50px; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; background: linear-gradient(180deg, #fffbe0, #ffd84a 45%, #ff9d00); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #5a2a00); display: inline-flex; align-items: center; gap: 8px; }
.win-banner .coin.l { left: 8px; bottom: 10px; } .win-banner .coin.r { right: 10px; top: 14px; }
.lose-banner { text-align: center; padding: 16px; border-radius: 22px; margin-top: 6px; background: rgba(12, 28, 66, .7); border: 1px solid var(--line-2); }
.lose-banner .t { font-size: 18px; font-weight: 700; }
.lose-banner .s { color: var(--muted); font-size: 14px; margin-top: 4px; }
.match-chip { display: flex; justify-content: center; margin: 12px 0 14px; }
.match-chip .chip b { color: var(--green); }
.replay { display: flex; justify-content: center; margin: 10px 0 16px; }

.hist-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hist-h .card-title { margin: 0; }
.hist-row { display: grid; grid-template-columns: 74px 1fr auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; transition: background .2s; border-radius: 10px; }
.hist-row:first-of-type { border-top: 0; }
.hist-row.on { background: rgba(40, 120, 255, .12); }
.hist-row .id { font-weight: 700; font-size: 15px; }
.hist-row .dt { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.hist-row .balls { gap: 6px; }
.hist-row .ball { --s: 30px; font-size: 13px; border-width: 1.5px; }
.hist-row .pz { font-weight: 800; color: var(--green); font-size: 15px; min-width: 56px; text-align: right; display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.hist-row .pz.none { color: var(--dim); font-weight: 600; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 520px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: linear-gradient(180deg, rgba(10, 24, 58, .92), rgba(4, 12, 32, .98));
  border-top: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .4);
}
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #8a9cc4; font-size: 12.5px; font-weight: 600; transition: color .25s; }
.tab svg { width: 28px; height: 28px; fill: currentColor; transition: transform .35s var(--ease-spring), filter .3s; }
.tab svg .stroke { fill: none; stroke: currentColor; }
.tab.on { color: #3aa6ff; }
.tab.on svg { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 0 8px rgba(40, 150, 255, .9)); }
.tab.on::after { content: ""; position: absolute; bottom: 8px; width: 34px; height: 3px; border-radius: 3px; background: #3aa6ff; box-shadow: 0 0 10px #3aa6ff; }
.tab .badge { position: absolute; top: 9px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 10px rgba(255, 95, 116, .6); }

/* ---------- draw overlay ---------- */
.draw-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: radial-gradient(70% 50% at 50% 35%, rgba(20, 70, 180, .55), rgba(1, 6, 20, .97) 70%);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: grid; place-items: center;
  animation: fadeIn .4s ease both;
}
.draw-overlay.out { animation: fadeOut .4s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.draw-inner { width: 100%; max-width: 420px; padding: 0 20px; text-align: center; }
.draw-title { font-size: 28px; font-weight: 900; letter-spacing: -.01em; text-shadow: 0 0 18px rgba(60, 160, 255, .7); }
.draw-sub { color: var(--muted); margin-top: 4px; min-height: 20px; }
.drum { position: relative; width: 240px; height: 240px; margin: 22px auto 18px; border-radius: 50%; }
.drum-glass {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 30%), radial-gradient(circle, rgba(30, 80, 180, .25), rgba(10, 30, 80, .55));
  border: 3px solid rgba(120, 190, 255, .6);
  box-shadow: 0 0 40px rgba(40, 150, 255, .5), inset 0 0 40px rgba(60, 160, 255, .35);
}
.drum.spin .drum-glass { animation: drumPulse 1s ease-in-out infinite; }
@keyframes drumPulse { 50% { box-shadow: 0 0 60px rgba(40, 150, 255, .8), inset 0 0 50px rgba(60, 160, 255, .5); } }
.drum .ball { position: absolute; left: 0; top: 0; --s: 34px; will-change: transform; }
.slots { display: flex; gap: 12px; justify-content: center; }
.slot { width: 68px; height: 68px; border-radius: 50%; border: 2px dashed rgba(120, 180, 255, .35); display: grid; place-items: center; position: relative; }
.slot .ball { --s: 68px; position: absolute; inset: -2px; }
.slot .ball.land { animation: land .55s var(--ease-spring); }
@keyframes land { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }
.draw-result { min-height: 150px; margin-top: 22px; }
.draw-result > * { animation: viewIn .5s var(--ease-out) both; }
.draw-result .big-win { font-size: 46px; font-weight: 900; background: linear-gradient(180deg, #fffbe0, #ffd84a 45%, #ff9d00); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #5a2a00) drop-shadow(0 0 20px rgba(255, 180, 30, .5)); display: inline-flex; gap: 8px; align-items: center; }
.draw-result .msg { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.draw-result .msg2 { color: var(--muted); margin-bottom: 16px; }
.draw-result .btn { margin-top: 14px; }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(0, 4, 16, .6); animation: fadeIn .25s both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-width: 520px; margin: 0 auto;
  padding: 10px 18px calc(20px + var(--safe-b));
  background: linear-gradient(180deg, #0d2453, #06142f);
  border-radius: 26px 26px 0 0; border-top: 1px solid var(--line-2);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .55);
  animation: sheetUp .45s var(--ease-out) both;
}
.sheet.out { animation: sheetDown .3s ease both; }
@keyframes sheetUp { from { transform: translateY(100%); } }
@keyframes sheetDown { to { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(150, 180, 230, .35); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; text-align: center; font-size: 21px; }
.sheet .sub { margin-bottom: 16px; }
.topup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.topup-grid button {
  height: 74px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(180deg, rgba(255, 201, 58, .14), rgba(255, 159, 10, .05)); border: 1px solid rgba(255, 201, 58, .35);
  transition: transform .15s;
}
.topup-grid button:active { transform: scale(.95); }
.topup-grid .v { font-size: 24px; font-weight: 800; color: var(--gold-3); display: flex; align-items: center; gap: 6px; }
.topup-grid .n { font-size: 12px; color: var(--muted); }
.demo-tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #3a2200; background: var(--gold); padding: 2px 8px; border-radius: 6px; vertical-align: 3px; margin-left: 6px; }
.success-ico { width: 84px; height: 84px; margin: 6px auto 10px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(62, 224, 143, .3), rgba(62, 224, 143, .05)); box-shadow: 0 0 0 2px rgba(62, 224, 143, .5), 0 0 30px rgba(62, 224, 143, .4); animation: pop .6s var(--ease-spring); }
.success-ico svg { width: 44px; height: 44px; stroke: var(--green); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .6s .25s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.sheet .balls { margin: 6px 0 14px; }
.sheet .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.sheet .row2 .btn { height: 50px; font-size: 16px; }
.rules li { margin: 6px 0; color: #cfdcf6; }

/* ---------- misc ---------- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }
.toast {
  position: fixed; left: 50%; top: 14px; z-index: 95; transform: translate(-50%, -220%); visibility: hidden;
  max-width: 90vw; padding: 11px 18px; border-radius: 14px; font-size: 14.5px; font-weight: 600;
  background: rgba(16, 36, 80, .96); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  transition: transform .4s var(--ease-spring);
}
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.err { border-color: rgba(255, 95, 116, .55); color: #ffd1d8; }
.boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; gap: 26px; align-items: center; justify-content: center; background: var(--bg); transition: opacity .5s; }
.boot.hide { opacity: 0; pointer-events: none; }
.boot .msg { color: var(--muted); text-align: center; padding: 0 30px; line-height: 1.5; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(80, 150, 255, .25); border-top-color: #3aa6ff; animation: spin .8s linear infinite; }
.skeleton { height: 120px; border-radius: var(--r-lg); background: linear-gradient(90deg, rgba(20, 44, 98, .4), rgba(40, 80, 160, .45), rgba(20, 44, 98, .4)); background-size: 200% 100%; animation: sk 1.2s linear infinite; margin-bottom: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

@media (max-width: 360px) {
  .logo .g { font-size: 56px; } .logo .w { font-size: 28px; }
  .jackpot .amt { font-size: 34px; }
  .burst .ball { --s: 58px; }
  .slot, .slot .ball { width: 60px; height: 60px; --s: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
