:root {
  --blue: #1ea7e5;
  --blue-deep: #1689c4;
  --blue-top: #2db4ee;
  --green: #2fb24c;
  --green-2: #279a42;
  --red: #e8392b;
  --gold: #f5c518;
  --gold-2: #e6b400;
  --bg-light: #e7eff6;
  --card: #ffffff;
  --card-2: #f4f8fb;
  --line: #e2e8f0;
  --line-2: #eef2f6;
  --txt: #213040;
  --muted: #7c8aa0;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(30, 80, 130, 0.12);
  --shadow-sm: 0 3px 10px rgba(30, 80, 130, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  font-family: "Nunito", system-ui, sans-serif;
  background-color: var(--bg-light);
  background-image: linear-gradient(180deg, var(--blue-top) 0, #43bdf0 70px, var(--bg-light) 200px);
  background-repeat: no-repeat;
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
}

.bg-glow { display: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 14px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-logo {
  height: 50px;
  width: auto;
  display: block;
  flex: 0 1 auto;
  max-width: 62vw;
  object-fit: contain;
}

.wallet-area { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px;
  border: none;
  background: #ffffff;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn.muted { opacity: 0.55; }
.wallet {
  background: #ffffff;
  border-radius: 12px;
  padding: 5px 14px;
  text-align: right;
  box-shadow: var(--shadow-sm);
}
.wallet-label { display: block; font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.wallet-value { font-size: 15px; font-weight: 800; color: var(--blue-deep); }
.wallet-value.flash { animation: flash 0.6s ease; }
@keyframes flash { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.recharge-btn {
  width: 38px; height: 38px; flex: 0 0 38px;
  border: none;
  background: var(--green);
  color: #fff;
  border-radius: 12px;
  font-weight: 800; font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}
.recharge-btn:active { transform: scale(0.94); }
.recharge-btn.pulse { animation: pulse 1s ease infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* ---------- Stage / painel ---------- */
.stage {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 4px 16px 24px;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.block { padding: 15px 16px; border-bottom: 1px solid var(--line-2); }
.block:last-child { border-bottom: none; }
.block-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.block-label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }

/* Prêmio em destaque, centralizado */
.prize-block { text-align: center; }
.prize-block .block-label { text-align: left; }
.big-prize {
  display: block;
  font-family: "Baloo 2", cursive;
  font-size: 38px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.05;
  margin: 2px 0 14px;
}

/* ---------- Sliders ---------- */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px;
  border-radius: 8px;
  background: #dfe7ef;
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 65%, var(--gold-2));
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(246, 166, 9, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border: 3px solid #fff; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 65%, var(--gold-2));
}
#prizeSlider { background: linear-gradient(90deg, #cfe8f6, var(--blue) 90%); }
#luckSlider { background: linear-gradient(90deg, #cfe8f6, var(--blue) 90%); }

/* ---------- Sorte ---------- */
.block > .block-label { display: block; margin-bottom: 10px; }
.ends-scale {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted); font-weight: 800;
  margin-top: 9px;
}
.chance-note {
  margin-top: 12px;
  font-size: 10px; font-weight: 600;
  color: #b3bcc7;            /* bem discreto — apenas para fins regulatórios */
  letter-spacing: 0.2px;
}
.chance-note span { color: #a4adb9; }

/* ---------- Bolas / picks ---------- */
.balls { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
/* Bolas com efeito 3D (esfera) — exceção proposital ao "sem gradientes" */
.ball {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #f6f8fa 32%, #dfe5ec 72%, #c4cdd8 100%);
  box-shadow: 0 5px 9px rgba(20, 50, 80, 0.22),
              inset -4px -5px 9px rgba(20, 40, 70, 0.14),
              inset 3px 3px 6px rgba(255, 255, 255, 0.95);
  display: grid; place-items: center;
  font-family: "Baloo 2", cursive;
  font-weight: 800; font-size: 21px; color: var(--txt);
  animation: pop 0.3s ease backwards;
}
@keyframes pop { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.picks .pick-input {
  width: 56px; height: 56px;
  text-align: center;
  font-family: "Baloo 2", cursive;
  font-size: 27px; font-weight: 800;
  color: var(--blue-deep);
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #f4f8fc 32%, #d8e4ef 74%, #bcccdc 100%);
  box-shadow: 0 5px 9px rgba(20, 50, 80, 0.22),
              inset -4px -5px 9px rgba(20, 40, 70, 0.14),
              inset 3px 3px 6px rgba(255, 255, 255, 0.95);
  transition: box-shadow 0.15s ease;
  -moz-appearance: textfield;
}
.picks .pick-input::-webkit-outer-spin-button,
.picks .pick-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.picks .pick-input:focus {
  outline: none;
  box-shadow: 0 5px 9px rgba(20, 50, 80, 0.22),
              inset -4px -5px 9px rgba(20, 40, 70, 0.14),
              inset 3px 3px 6px rgba(255, 255, 255, 0.95),
              0 0 0 3px rgba(30, 167, 229, 0.5);
}

.ghost-btn {
  background: #fff; border: 1.5px solid var(--line); color: var(--blue-deep);
  border-radius: 10px; padding: 7px 12px; font-size: 12px; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}
.ghost-btn:active { transform: scale(0.96); }

/* ---------- Aposta ---------- */
.bet-block { background: var(--card-2); }
.bet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ticket-label { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.ticket-price { font-family: "Baloo 2", cursive; font-size: 28px; font-weight: 800; color: var(--gold); }

.stepper { display: flex; align-items: center; gap: 6px; }
.step-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--blue-deep);
  font-size: 20px; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease;
}
.step-btn:active { transform: scale(0.9); }
#qtyInput {
  width: 52px; height: 36px; text-align: center;
  font-size: 17px; font-weight: 800; color: var(--txt);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  -moz-appearance: textfield;
}
#qtyInput::-webkit-outer-spin-button, #qtyInput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.play-btn {
  width: 100%; border: none; border-radius: 14px; padding: 15px;
  background: var(--green);
  color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  font-family: "Baloo 2", cursive; font-weight: 800; letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background 0.12s ease;
}
.play-btn span { font-size: 19px; }
.play-btn:hover { background: var(--green-2); }
.play-btn:active { transform: scale(0.99); }
.play-btn:disabled { background: #c3ccd6; color: #fff; cursor: not-allowed; transform: none; }
.play-btn.small { width: auto; padding: 12px 30px; margin: 16px auto 0; }

/* ---------- Footer / toggle / histórico ---------- */
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px 4px; }
.link-btn { background: none; border: none; color: var(--blue-deep); text-decoration: underline; cursor: pointer; font-size: 12px; font-weight: 700; }

.sim-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.sim-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.sim-track {
  width: 36px; height: 20px; border-radius: 20px;
  background: #d3dce6; position: relative;
  transition: background 0.15s ease;
}
.sim-knob {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
}
.sim-toggle input:checked + .sim-track { background: var(--green); }
.sim-toggle input:checked + .sim-track .sim-knob { transform: translateX(16px); }
.sim-text { font-size: 12px; color: var(--muted); font-weight: 700; }
.sim-toggle input:checked ~ .sim-text { color: var(--green-2); }

.history-acc { margin-top: 8px; }
.acc-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: none; border-radius: 12px;
  padding: 12px 16px; cursor: pointer;
  color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  box-shadow: var(--shadow-sm);
}
.acc-arrow { font-size: 11px; color: var(--blue); }
.acc-body { padding-top: 8px; }
.acc-body .link-btn { margin-top: 8px; }

.history ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.history li {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 10px; padding: 9px 13px; font-size: 12px;
  box-shadow: var(--shadow-sm); font-weight: 700;
}
.history .h-win { color: var(--green); font-weight: 800; }
.history li:has(.h-win) { background: #effaf1; box-shadow: inset 0 0 0 1.5px var(--green); }
.history .h-lose { color: var(--muted); font-weight: 700; }
.history .h-meta { color: var(--muted); font-weight: 700; }

/* ---------- Overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 50, 80, 0.45);
  backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  animation: fade 0.25s ease;
}
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.draw-box, .how-box {
  background: #fff;
  border-radius: 20px; padding: 28px;
  max-width: 440px; width: 100%; text-align: center;
  box-shadow: 0 20px 50px rgba(20, 50, 80, 0.3);
  max-height: 90vh; overflow-y: auto;
}
.draw-box h3 { font-family: "Baloo 2", cursive; font-size: 17px; margin-bottom: 20px; color: var(--muted); letter-spacing: 0.5px; }
.draw-balls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; min-height: 48px; }
.draw-balls .ball.spin { animation: spin 0.08s linear infinite; }
@keyframes spin { 0% { transform: translateY(0); } 50% { transform: translateY(-6px); } 100% { transform: translateY(0); } }
.draw-balls .ball.win {
  color: #fff;
  background: radial-gradient(circle at 34% 28%, #86e6a0 0%, #4cc66e 42%, #2fb24c 78%, #228f3c 100%);
  box-shadow: 0 5px 9px rgba(47, 178, 76, 0.32),
              inset -4px -5px 9px rgba(0, 60, 20, 0.22),
              inset 3px 3px 6px rgba(255, 255, 255, 0.45);
}
.draw-balls .ball.miss {
  color: #aab4c0; text-decoration: line-through;
  background: radial-gradient(circle at 34% 28%, #ffffff 0%, #eef1f4 45%, #d6dce2 78%, #c2cad3 100%);
}

.draw-counter { margin-top: 14px; font-size: 14px; color: var(--muted); font-weight: 700; }
.draw-counter strong { color: var(--green-2); }
.ball.pop2 { animation: pop 0.22s ease; }

.result { margin-top: 22px; animation: pop 0.4s ease; }
.result-emblem { font-size: 46px; }
.result-title { font-family: "Baloo 2", cursive; font-size: 25px; font-weight: 800; margin-top: 6px; }
.result-title.win { color: var(--green-2); }
.result-title.lose { color: var(--muted); }
.result-amount { font-family: "Baloo 2", cursive; font-size: 21px; font-weight: 800; color: var(--gold); margin-top: 6px; }
.result-detail { font-size: 13px; color: var(--muted); margin-top: 8px; font-weight: 700; }
.result-detail strong { color: var(--txt); }

.how-box { text-align: left; }
.how-box h3 { font-family: "Baloo 2", cursive; font-size: 21px; margin-bottom: 12px; color: var(--blue-deep); }
.how-box p { font-size: 13.5px; color: var(--txt); line-height: 1.5; margin-bottom: 10px; font-weight: 600; }
.how-box ul { margin: 0 0 10px 18px; display: flex; flex-direction: column; gap: 8px; }
.how-box li { font-size: 13px; color: var(--muted); line-height: 1.45; font-weight: 600; }
.how-box strong { color: var(--txt); }
.how-note { font-size: 12px; color: var(--muted); font-style: italic; }

/* ---------- Telas baixas ---------- */
@media (max-height: 720px) {
  .brand-logo { height: 44px; }
  .block { padding: 11px 16px; }
  .block-top { margin-bottom: 8px; }
  .ball, .picks .pick-input { width: 44px; height: 44px; font-size: 19px; }
  .big-prize { font-size: 30px; }
  .ticket-price { font-size: 24px; }
  .play-btn { padding: 13px; }
}
