:root {
  --bg: #0c0b10;
  --panel: #1c1824;
  --panel-2: #151018;
  --line: #2a2533;
  --gold: #f0c14b;
  --ink: #111111;
  --white: #ffffff;
  --muted: #8b8494;
  --blue: #1e4a8c;
  --green: #34d399;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background:
    radial-gradient(120% 60% at 50% -10%, #2a1f0a 0%, transparent 55%),
    var(--bg);
  color: var(--white);
  min-height: 100%;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
body { padding-bottom: calc(78px + var(--safe-b)); }
button, input { font-family: inherit; }

#app { max-width: 430px; margin: 0 auto; min-height: 100vh; position: relative; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .05em;
}
.logo {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--gold);
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px #f0c14b55;
}
.icon-btn {
  background: transparent;
  border: 0;
  padding: 6px;
  cursor: pointer;
}

.search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 14px 10px;
}
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1c1824;
  border-radius: 22px;
  padding: 11px 14px;
  border: 1px solid #2a253355;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
}
.search input::placeholder { color: var(--muted); }

.balance {
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 16px #f0c14b33;
}
.balance.sm { font-size: 11px; padding: 6px 10px; }

.screen { display: none; padding: 0 14px 28px; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.user-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #1e4a8c, #163a70);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
}
.user-strip .av {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe08a, var(--gold));
  flex-shrink: 0;
  box-shadow: inset 0 0 0 2px #ffffff33;
}
.user-strip .meta { flex: 1; min-width: 0; }
.user-strip .meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-strip .exit {
  color: var(--green);
  display: grid;
  place-items: center;
}

.sub-gate {
  background: #1a1210;
  border: 1px solid #f0c14b88;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
}
.sub-gate p { color: var(--muted); font-size: 13px; margin: 8px 0 12px; }
.sub-gate .btn { display: block; margin-bottom: 8px; text-decoration: none; }
.sub-gate .btn.ghost { width: 100%; }

.hero {
  background:
    radial-gradient(80% 80% at 50% 120%, #f0c14b22, transparent 60%),
    var(--panel-2);
  border: 1px solid #f0c14b55;
  border-radius: 20px;
  padding: 26px 16px 22px;
  text-align: center;
  margin-bottom: 12px;
  box-shadow: 0 0 40px #f0c14b14;
}
.hero h1 {
  margin: 8px 0 16px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.live {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}

.btn {
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  font-size: 14px;
  padding: 14px 16px;
  cursor: pointer;
}
.btn.gold {
  background: linear-gradient(180deg, #ffd56a, var(--gold));
  color: var(--ink);
  box-shadow: 0 8px 24px #f0c14b40;
}
.btn.wide { width: 100%; }
.btn.mb { margin: 10px 0 14px; }
.btn.ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 8px 10px;
  font-size: 11px;
}
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

.muted { color: var(--muted); font-size: 13px; margin: 8px 0 12px; font-weight: 500; }
h2 { margin: 4px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
h3.sub { margin: 16px 0 8px; font-size: 14px; color: var(--muted); font-weight: 700; }

.streak-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.streak-card .label { font-size: 11px; color: var(--muted); font-weight: 600; }
.streak-card .value { font-size: 18px; font-weight: 800; color: var(--gold); }

.cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.casino-card {
  background: #fff;
  color: #111;
  border-radius: 14px;
  padding: 12px 10px;
  font-size: 12px;
  box-shadow: 0 10px 30px #00000055;
}
.casino-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.casino-card h3 { margin: 0; font-size: 13px; font-weight: 800; }
.casino-card .info {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid #9ca3af; color: #9ca3af;
  font-size: 10px; font-weight: 800;
  display: grid; place-items: center;
}
.casino-card p { margin: 0 0 4px; font-weight: 600; }
.casino-card .promo { color: #6b7280; font-weight: 600; }
.casino-card ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.casino-card li {
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 3px;
}
.casino-card li::before {
  content: "✓ ";
  color: #ca8a04;
  font-weight: 800;
}

.float-banner {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #ffd56a, var(--gold));
  color: var(--ink);
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  min-height: 84px;
  overflow: visible;
  box-shadow: 0 12px 30px #f0c14b44;
}
.float-text { flex: 1; z-index: 1; }
.float-banner strong { display: block; font-size: 13px; margin-bottom: 8px; font-weight: 800; }
.float-banner .pill {
  display: inline-block;
  background: #111;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  padding: 7px 11px;
  border-radius: 10px;
}
.float-x {
  position: absolute;
  top: 6px; right: 10px;
  font-size: 18px;
  opacity: .55;
  z-index: 2;
}

.wheel-art {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 5px solid #111;
  background:
    conic-gradient(
      #f0c14b 0 60deg,
      #1c1824 60deg 120deg,
      #f0c14b 120deg 180deg,
      #1c1824 180deg 240deg,
      #f0c14b 240deg 300deg,
      #1c1824 300deg 360deg
    );
  box-shadow: 0 8px 20px #0006, inset 0 0 0 8px #111;
  position: relative;
  margin-right: -4px;
  transform: translateY(-4px);
}
.wheel-art::after {
  content: "";
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: #111;
  border: 3px solid var(--gold);
}
.wheel-art::before {
  content: "";
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid #e11d48;
  z-index: 2;
}
.wheel-art.sm {
  width: 78px; height: 78px;
  border-width: 4px;
  transform: none;
  margin: 0;
}

.list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.list.compact { gap: 6px; }
.task, .ledger-row {
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
}
.task {
  display: flex;
  align-items: center;
  gap: 12px;
}
.task.done { border-color: #2ebf6b66; }
.task .pts { margin-left: auto; color: var(--gold); font-weight: 800; }
.task button {
  margin-left: auto;
  background: var(--gold);
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
  font-size: 12px;
  color: var(--ink);
}

.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.shop-card {
  background: #fff;
  color: #111;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 24px #00000044;
}
.shop-card .price { color: #b45309; font-size: 18px; font-weight: 800; margin: 6px 0; }
.shop-card .badge {
  float: right;
  background: var(--gold);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
}
.shop-card button {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(180deg, #ffd56a, var(--gold));
  border: 0;
  border-radius: 10px;
  padding: 9px;
  font-weight: 800;
  color: var(--ink);
}

.draw-list { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 18px; }
.draw-card {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 20px;
  padding: 14px 8px 14px 14px;
  overflow: hidden;
}
.draw-card.pink { background: linear-gradient(120deg, #c0265a, #7a1f4a); }
.draw-card.green { background: linear-gradient(120deg, #22a05a, #145a32); }
.draw-card.blue { background: linear-gradient(120deg, #3b6fd9, #1e3a6e); }
.draw-main { flex: 1; min-width: 0; }
.draw-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.draw-top h3 { margin: 0; font-size: 14px; font-weight: 800; }
.prize-pill {
  background: #e11d48;
  border-radius: 12px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.chip {
  display: inline-block;
  background: #ffffff28;
  border-radius: 10px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}
.timers { display: flex; gap: 5px; margin-bottom: 10px; }
.timers span {
  background: #ffffff28;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}
.draw-btn {
  background: #00000055;
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 10px 16px;
  font-weight: 800;
}

.spin-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  margin-top: 8px;
}
.wheel-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 8px auto 12px;
}
.wheel-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 6px solid var(--gold);
  background:
    conic-gradient(
      #f0c14b 0 60deg,
      #1c1824 60deg 120deg,
      #f0c14b 120deg 180deg,
      #1c1824 180deg 240deg,
      #f0c14b 240deg 300deg,
      #1c1824 300deg 360deg
    );
  transition: transform 3s cubic-bezier(.15,.85,.25,1);
  box-shadow: 0 0 40px #f0c14b33;
}
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  color: #e11d48;
  font-size: 22px;
  z-index: 2;
}
.prize {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  min-height: 28px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.stats div {
  background: var(--panel);
  border-radius: 14px;
  padding: 14px 8px;
  text-align: center;
  border: 1px solid var(--line);
}
.stats strong {
  display: block;
  color: var(--gold);
  font-size: 18px;
}
.stats span { font-size: 11px; color: var(--muted); font-weight: 600; }

.ledger-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 10px 12px;
  font-weight: 600;
}
.ledger-row .pos { color: var(--green); }
.ledger-row .neg { color: #f87171; }

.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  background: rgba(16, 14, 21, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(10px + var(--safe-b));
  z-index: 10;
}
.tabs button {
  flex: 1;
  background: transparent;
  border: 0;
  color: #7a7166;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
}
.tabs button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabs button.active { color: var(--gold); }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + var(--safe-b));
  transform: translateX(-50%);
  background: #1c1824;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--gold);
  z-index: 20;
  font-size: 13px;
  font-weight: 700;
  max-width: 90%;
  box-shadow: 0 10px 30px #0008;
}
