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

:root {
  --bg: #1b1f20;
  --panel: #1d2425;
  --panel2: #232b2d;
  --card: #1d2425;
  --line: rgba(255, 255, 255, .06);
  --txt: #d7e0e8;
  --dim: #8b98a5;
  --green: #5fd68f;
  --green2: #3f9d63;
  --yellow: #ffd52b;
  --purple: #b032a8;
}

html,
body {
  background: #000;
  color: var(--txt);
  font-family: Inter, Roboto, Arial, sans-serif;
  min-height: 100%
}

body {
  display: flex;
  justify-content: center
}

.phone {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: radial-gradient(600px 300px at 50% -40px, #1f2827 0%, var(--bg) 60%);
  padding-bottom: 26px;
  position: relative
}

.hidden {
  display: none !important
}

/* money bar on top (same ids as the other games; graph.js adds
   DerkoshBET home + ETB/USDT selector + vault inside it) */
#money {
  position: relative;
  height: 2%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #111813;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  min-height: 60px
}

#money_box {
  min-width: 140px;
  text-align: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  background: #232b2d;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 18px
}

#money #homepage {
  height: auto;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem
}

/* top bar */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111813;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20
}

.top-title {
  flex: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .3px;
  color: #f2f5f7
}

.icon-btn {
  background: none;
  border: none;
  color: #e6edf2;
  font-size: 22px;
  cursor: pointer;
  padding: 2px 8px
}

.icon-btn.dots {
  font-size: 26px;
  letter-spacing: 2px
}

/* balance bar */
.balancebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px
}

.bg-logo {
  background: linear-gradient(135deg, #a020b8, #6a1a9e);
  border-radius: 14px;
  padding: 4px 12px;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 1px;
  border: 2px solid #7a2aa0
}

.bg-logo .bg-b {
  color: #3a0a44;
  background: #0c0c0c;
  border-radius: 6px;
  padding: 0 4px;
  margin-right: 2px
}

.bg-logo .bg-g {
  color: #1a0b1e
}

.bal-pill {
  flex: 1;
  background: #232b2d;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 15px;
  color: #cfd8e0;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  white-space: nowrap
}

.bal-pill b {
  font-size: 17px;
  color: #fff
}

.deposit-btn {
  background: linear-gradient(135deg, #b032a8, #7e2a9e);
  border: none;
  color: #1c0f22;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap
}

.profile-btn {
  background: linear-gradient(135deg, #b032a8, #7e2a9e);
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer
}

/* game bar */
.gamebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #111813;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative
}

.fast-keno {
  color: var(--green);
  font-weight: 900;
  font-style: italic;
  line-height: .95;
  font-size: 20px;
  letter-spacing: .5px;
  text-shadow: 0 0 12px rgba(61, 220, 132, .35)
}

.id-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d1a12;
  border: 1px solid rgba(61, 220, 132, .25);
  border-radius: 14px;
  padding: 6px 10px;
  font-size: 13px;
  color: #cfe3d4;
  overflow: hidden;
  white-space: nowrap
}

.id-pill .gold {
  color: var(--yellow);
  font-weight: 800
}

.id-sep {
  width: 1px;
  height: 18px;
  background: rgba(61, 220, 132, .25);
  margin: 0 6px
}

.shield {
  font-size: 15px
}

.hamburger {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  cursor: pointer
}

.hamburger span {
  display: block;
  width: 30px;
  height: 4px;
  border-radius: 4px;
  background: var(--green)
}

.dropdown {
  display: none;
  position: absolute;
  right: 8px;
  top: calc(100% + 6px);
  background: #161d1e;
  border: 1px solid var(--line);
  border-radius: 10px;
  z-index: 60;
  overflow: hidden;
  width: 180px
}

.dropdown.open {
  display: block
}

.dropdown button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--txt);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  font-size: 14px
}

.dropdown button:hover {
  background: #222c2d
}

.vol-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--txt);
  font-size: 13px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #121a1b;
}

.vol-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.vol-row #volVal {
  min-width: 38px;
  text-align: right;
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
}

/* timer */
.timer {
  text-align: center;
  font-family: Consolas, monospace;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #eafff3;
  text-shadow: 0 0 18px rgba(61, 220, 132, .8);
  padding: 8px 0 4px
}

.timer.urgent {
  color: var(--yellow);
  text-shadow: 0 0 18px rgba(255, 213, 43, .9);
  animation: blink .6s ease-in-out infinite
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .45
  }
}

/* banner */
.banner {
  margin: 6px 10px;
  background: linear-gradient(180deg, #27302f, #222b2a);
  border-radius: 12px;
  padding: 16px 14px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line)
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(300px 120px at 70% 20%, rgba(61, 220, 132, .08), transparent);
  pointer-events: none
}

.balls-deco {
  position: relative;
  width: 110px;
  height: 86px;
  flex-shrink: 0
}

.mini-ball {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, #3a4b5e, #0d1620 70%);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .6)
}

.b80 {
  width: 38px;
  height: 38px;
  font-size: 15px;
  left: 0;
  top: 0
}

.b10 {
  width: 54px;
  height: 54px;
  font-size: 22px;
  left: 44px;
  top: 0
}

.b1 {
  width: 72px;
  height: 72px;
  font-size: 38px;
  left: 0;
  top: 22px;
  color: var(--green);
  border: 2px solid rgba(61, 220, 132, .8);
  box-shadow: 0 0 16px rgba(61, 220, 132, .5), inset 0 -6px 12px rgba(0, 0, 0, .6)
}

.banner-text h2 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1
}

.banner-text p {
  color: var(--green);
  font-weight: 800;
  font-size: 20px;
  margin-top: 4px
}

.help-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #2a3436;
  color: var(--green);
  font-weight: 900;
  font-size: 18px;
  cursor: pointer
}

/* draw stage */
.drawstage {
  position: relative;
  margin: 6px 10px;
  background: radial-gradient(340px 200px at 50% 30%, #103425 0%, #0a1512 55%, #1b1f20 100%);
  border: 1px solid rgba(61, 220, 132, .18);
  border-radius: 12px;
  padding: 14px 12px 16px;
  text-align: center;
  min-height: 360px;
  overflow: hidden
}

.drawstage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 118px;
  width: 400px;
  height: 400px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: repeating-conic-gradient(rgba(61, 220, 132, .28) 0 10deg, transparent 10deg 42deg);
  -webkit-mask: radial-gradient(circle, transparent 64px, #000 65px, #000 67px, transparent 68px, transparent 108px, #000 109px, #000 111px, transparent 112px, transparent 152px, #000 153px, #000 155px, transparent 156px);
  mask: radial-gradient(circle, transparent 64px, #000 65px, #000 67px, transparent 68px, transparent 108px, #000 109px, #000 111px, transparent 112px, transparent 152px, #000 153px, #000 155px, transparent 156px);
  animation: spinSlow 28s linear infinite
}

.drawstage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 118px;
  width: 400px;
  height: 400px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: repeating-conic-gradient(transparent 0 24deg, rgba(61, 220, 132, .20) 24deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 84px, #000 85px, #000 87px, transparent 88px, transparent 130px, #000 131px, #000 133px, transparent 134px);
  mask: radial-gradient(circle, transparent 84px, #000 85px, #000 87px, transparent 88px, transparent 130px, #000 131px, #000 133px, transparent 134px);
  animation: spinSlowRev 20s linear infinite
}

@keyframes spinSlow {
  to {
    transform: translate(-50%, -50%) rotate(360deg)
  }
}

@keyframes spinSlowRev {
  to {
    transform: translate(-50%, -50%) rotate(-360deg)
  }
}

.draw-top {
  position: relative;
  text-align: right;
  color: #fff;
  font-family: Consolas, monospace;
  font-size: 17px;
  font-weight: 700;
  opacity: .95;
  z-index: 1
}

.big-ball {
  position: relative;
  z-index: 1;
  width: 118px;
  height: 118px;
  margin: 10px auto 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 8px rgba(0, 0, 0, .75);
  background: radial-gradient(circle at 34% 26%, #6d87a3 0%, #2a4258 28%, #0d1826 62%, #050b13 100%);
  border: 1px solid rgba(170, 210, 240, .5);
  box-shadow: 0 0 40px rgba(120, 255, 190, .35), 0 0 90px rgba(61, 220, 132, .18), inset 0 -14px 24px rgba(0, 0, 0, .7), inset 0 10px 16px rgba(255, 255, 255, .12);
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .6))
}

.big-ball::after {
  content: "";
  position: absolute;
  left: 14%;
  top: 5%;
  width: 46%;
  height: 30%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .05));
  filter: blur(1px);
  pointer-events: none
}

.big-ball.new {
  animation: bigGrow 1.15s cubic-bezier(.34, 1.2, .64, 1)
}

.big-ball.new .num {
  display: inline-block;
  animation: numGrow 1.15s ease-out
}

@keyframes bigGrow {
  0% {
    transform: scale(.2) translateY(26px);
    opacity: 0
  }

  60% {
    transform: scale(1.08) translateY(-2px);
    opacity: 1
  }

  100% {
    transform: scale(1) translateY(0);
    opacity: 1
  }
}

@keyframes numGrow {
  0% {
    transform: scale(.4);
    opacity: 0
  }

  100% {
    transform: scale(1);
    opacity: 1
  }
}

@keyframes pop {
  0% {
    transform: scale(.5);
    opacity: 0
  }

  60% {
    transform: scale(1.12)
  }

  100% {
    transform: scale(1);
    opacity: 1
  }
}

.drawn-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  min-height: 76px;
  overflow: hidden
}

.drow {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px
}

.drow:empty {
  display: none
}

.drawn-row.swapped #rowA {
  order: 2
}

.drawn-row.swapped #rowB {
  order: 1
}

#rowA.push {
  animation: pushDown .45s ease
}

@keyframes pushDown {
  from {
    transform: translateY(-48px);
    opacity: .4
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.ball {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: clamp(11px, 3.8vw, 16px);
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .8);
  background: radial-gradient(circle at 34% 26%, #6d87a3 0%, #2a4258 26%, #0d1826 62%, #060c14 100%);
  border: 1px solid rgba(170, 210, 240, .65);
  box-shadow: inset 0 -6px 10px rgba(0, 0, 0, .7), inset 0 5px 8px rgba(255, 255, 255, .12), 0 1px 3px rgba(0, 0, 0, .6), 0 0 10px rgba(120, 200, 255, .30);
  animation: ballIn .32s ease-out both
}

/* fallback: browsers without aspect-ratio get a fixed square so the
   50% radius still draws a circle instead of a stretched box */
@supports not (aspect-ratio: 1 / 1) {
  .ball {
    height: 30px;
  }

  .drow {
    justify-items: center
  }
}

.ball::after {
  content: "";
  position: absolute;
  left: 16%;
  top: 7%;
  width: 42%;
  height: 26%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .7), transparent);
  filter: blur(1px);
  pointer-events: none
}

.ball.latest {
  border-color: rgba(150, 200, 240, .45);
  box-shadow: inset 0 -5px 9px rgba(0, 0, 0, .65), inset 0 4px 7px rgba(255, 255, 255, .10)
}

.ball.hit {
  background: radial-gradient(circle at 34% 26%, #6ff2a4 0%, #27b563 28%, #0e6536 62%, #073a1f 100%);
  border-color: rgba(255, 255, 255, .65);
  box-shadow: 0 0 16px rgba(61, 220, 132, .9), inset 0 -5px 9px rgba(0, 0, 0, .5), inset 0 4px 7px rgba(255, 255, 255, .22)
}

.ball.ghost {
  opacity: 0;
  animation: none
}

.ball.land {
  animation: landSettle .3s ease-out
}

@keyframes landSettle {
  0% {
    transform: scale(1.35)
  }

  100% {
    transform: scale(1)
  }
}

.fly-ball {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 80;
  margin: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #c9d8e8;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  background: radial-gradient(circle at 34% 26%, #33475c 0%, #16232f 40%, #080e15 75%);
  border: 1px solid rgba(140, 180, 210, .3);
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .7);
  pointer-events: none;
  transition: transform .45s cubic-bezier(.3, .7, .3, 1);
  animation: flyFade .3s ease
}

@keyframes flyFade {
  0% {
    opacity: 0
  }

  100% {
    opacity: 1
  }
}

@keyframes ballIn {
  0% {
    transform: scale(.3);
    opacity: 0
  }

  100% {
    transform: scale(1);
    opacity: 1
  }
}

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

.cell {
  position: relative;
  background: #283134;
  border-radius: 7px;
  aspect-ratio: .92;
  color: #9aa8b4;
  font-weight: 700;
  font-size: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .04);
  transition: transform .08s, background .15s;
  user-select: none
}

.cell:active {
  transform: scale(.94)
}

.cell.sel {
  background: #23402f;
  color: #fff;
  border: 1px solid var(--green);
  box-shadow: 0 0 10px rgba(61, 220, 132, .5)
}

.cell.hit {
  background: var(--green2);
  color: #fff;
  border-color: #fff
}

.cell.miss {
  opacity: .55
}

.cell.lock {
  pointer-events: none
}

.dot {
  position: absolute;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%
}

.dot.red {
  background: #ff4d5e;
  left: 3px;
  box-shadow: 0 0 6px #ff4d5e
}

.dot.blue {
  background: #7dd3fc;
  right: 3px;
  left: auto;
  box-shadow: 0 0 6px #7dd3fc
}

/* controls */
.controls {
  padding: 8px 10px
}

.amount-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px
}

.stepper {
  flex: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #202a2e;
  border-radius: 10px;
  padding: 6px 8px
}

.stepper button {
  width: 52px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #cbd5dd;
  font-size: 30px;
  cursor: pointer;
  line-height: 1
}

.amount {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  width: 100%;
  min-width: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

.amount::-webkit-outer-spin-button,
.amount::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mult-btn {
  flex: .6;
  background: #202a2e;
  border: none;
  border-radius: 10px;
  color: var(--green);
  font-weight: 900;
  font-size: 19px;
  cursor: pointer
}

.bet-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 10px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #cdd6cd;
  background: linear-gradient(180deg, #2e4e3c, #264532);
  cursor: pointer
}

.bet-btn:not(:disabled) {
  color: #eafff3;
  background: linear-gradient(180deg, #3fae6d, #1f7a44);
  box-shadow: 0 4px 18px rgba(61, 220, 132, .35)
}

.bet-btn:disabled {
  opacity: .85;
  cursor: not-allowed
}

/* tabs */
.tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 10px 4px 0;
  white-space: nowrap;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  overflow: hidden
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  background: none;
  border: none;
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  opacity: .9;
  padding: 4px 1px 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.tab.active {
  box-shadow: inset 0 -2px 0 var(--green)
}

/* tickets */
.ticket-head {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  color: var(--dim);
  font-size: 14px
}

.green {
  color: var(--green)
}

.tickets {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 10px 20px
}

.ticket {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px
}

.ticket.mine {
  border-color: rgba(61, 220, 132, .4)
}

.t-user {
  color: var(--green);
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 6px
}

.t-nums {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin-bottom: 6px
}

.t-num {
  background: #2b363a;
  border-radius: 6px;
  text-align: center;
  padding: 7px 0;
  font-weight: 800;
  font-size: 15px;
  color: #e7eef3
}

.t-num.hit {
  background: var(--green2);
  color: #fff
}

.t-foot {
  display: flex;
  background: #141b1c;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700
}

.t-foot .bet {
  flex: 1;
  color: #e6edf2
}

.t-foot .st {
  color: var(--yellow)
}

.t-foot .st.won {
  color: var(--green)
}

.t-foot .st.rej {
  color: #ff7a7a
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #161d1e;
  border: 1px solid rgba(61, 220, 132, .4);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 99;
  max-width: 90vw
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px
}

.modal-overlay.open {
  display: flex
}

.modal {
  background: #182021;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  max-width: 400px;
  width: 100%
}

.modal h3 {
  margin-bottom: 10px;
  color: #fff
}

.modal ol {
  margin: 0 0 12px 18px;
  color: #c7d2db;
  font-size: 14px;
  line-height: 1.6
}

.modal button {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: var(--green2);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  font-size: 15px
}

/* tab panels (HISTORY / RESULTS / STATS) */
.tabpanel {
  margin: 2px 10px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  min-height: 120px
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 8px
}

.panel-close {
  background: #2a3436;
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 14px
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto
}

.hist-row {
  background: #141b1c;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px
}

.hist-row .hr-top {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-weight: 700;
  margin-bottom: 6px
}

.hist-row .hr-top b {
  color: var(--green)
}

.hist-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.hist-balls span {
  background: #2b363a;
  border-radius: 6px;
  padding: 3px 7px;
  font-weight: 800;
  color: #e7eef3;
  font-size: 12px
}

.results-body {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.res-balls {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px
}

.res-balls span {
  background: #2b363a;
  border-radius: 6px;
  text-align: center;
  padding: 7px 0;
  font-weight: 800;
  font-size: 14px;
  color: #e7eef3
}

.res-balls span.hit {
  background: var(--green2);
  color: #fff
}

.res-empty,
.stats-empty {
  color: var(--dim);
  font-size: 14px;
  padding: 12px 4px
}

.stats-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow: auto
}

.stat-group {
  font-size: 13px
}

.stat-group h4 {
  color: var(--green);
  margin-bottom: 6px;
  font-size: 13px
}

.stat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px
}

.stat-chips span {
  background: #141b1c;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  font-weight: 800;
  font-size: 13px;
  color: #fff
}

.stat-chips span small {
  color: var(--yellow);
  font-weight: 700;
  margin-left: 4px
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px
}

.stat-cell {
  background: #141b1c;
  border-radius: 6px;
  text-align: center;
  padding: 5px 0;
  font-size: 12px;
  font-weight: 800;
  color: #cfd8e0
}

.stat-cell b {
  display: block;
  color: var(--green);
  font-size: 11px
}

.stat-cell.hot {
  border: 1px solid rgba(255, 77, 94, .6)
}

.stat-cell.cold {
  border: 1px solid rgba(125, 211, 252, .6)
}

/* payouts under pick count */
.payouts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 10px 8px;
  min-height: 34px
}

.payouts:empty {
  display: none
}

.pay-pill {
  background: #141b1c;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap
}

.pay-pill b {
  color: var(--green)
}

.pay-pill small {
  color: var(--yellow);
  font-weight: 700;
  margin-left: 4px
}

.pay-pill.zero {
  opacity: .45
}

.pay-hint {
  color: var(--dim);
  font-size: 13px;
  padding: 4px 2px
}

/* win text under big ball */
.win-text {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--green);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 1px;
  margin: 8px 0 0;
  text-shadow: 0 0 16px rgba(61, 220, 132, .7);
  animation: bigGrow .6s ease-out
}

@media(min-width:520px) {
  .cell {
    font-size: 20px
  }
}

/* Tablet / small window: compact single column.
   No scroll-locking — page can still scroll if the viewport is short. */
@media(min-width:521px) and (max-width:1023px) {
  .phone {
    max-width: 400px;
  }

  #money {
    min-height: 48px;
    padding: 4px 10px;
  }

  #money_box {
    padding: 5px 14px;
    font-size: 15px;
  }

  .gamebar {
    padding: 4px 10px;
  }

  .fast-keno {
    font-size: 16px;
  }

  .id-pill {
    padding: 4px 8px;
    font-size: 12px;
  }

  .timer {
    font-size: 20px;
    padding: 4px 0 2px;
  }

  .banner {
    margin: 4px 10px;
    padding: 8px 10px;
  }

  .balls-deco {
    width: 76px;
    height: 60px;
  }

  .b80 {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .b10 {
    width: 38px;
    height: 38px;
    font-size: 16px;
    left: 30px;
  }

  .b1 {
    width: 50px;
    height: 50px;
    font-size: 26px;
    top: 14px;
  }

  .banner-text h2 {
    font-size: 17px;
  }

  .banner-text p {
    font-size: 14px;
  }

  .drawstage {
    margin: 4px 10px;
    padding: 8px;
    min-height: 0;
  }

  .big-ball {
    width: 76px;
    height: 76px;
    font-size: 38px;
    margin: 4px auto 2px;
  }

  .drawn-row {
    margin-top: 6px;
    min-height: 0;
  }

  .grid {
    gap: 4px;
    padding: 6px 10px 2px;
  }

  .cell {
    font-size: 14px;
    aspect-ratio: .92;
    height: auto;
  }

  .controls {
    padding: 4px 10px;
  }

  .amount-row {
    margin-bottom: 4px;
  }

  .stepper button {
    height: 30px;
    width: 44px;
    font-size: 22px;
  }

  .amount {
    font-size: 20px;
  }

  .mult-btn {
    font-size: 15px;
  }

  .bet-btn {
    padding: 9px;
    font-size: 20px;
  }

  .payouts {
    min-height: 0;
    padding-bottom: 4px;
  }

  .pay-pill {
    padding: 4px 6px;
    font-size: 11px;
  }

  .tabs {
    padding-top: 4px;
  }

  .tab {
    padding: 2px 1px 6px;
  }

  .ticket-head {
    padding: 4px 12px;
    font-size: 13px;
  }
}

/* =====================================================================
   Shared bits (all sizes)
   ===================================================================== */
.draw-top i {
  font-style: normal
}

.t-foot .st.lost {
  color: var(--dim)
}

.fast-keno .fk-a,
.fast-keno .fk-b {
  color: inherit
}

/* wrapper elements are invisible on mobile/tablet; right column is desktop only */
.layout,
.kl-center,
.kl-left {
  display: contents
}

.kl-right {
  display: none
}

/* =====================================================================
   DESKTOP (>= 1024px): 3 columns
   left = my tickets | centre = draw + number board | right = results
   ===================================================================== */
@media (min-width: 1024px) {
  body {
    display: block;
    background: radial-gradient(1100px 520px at 50% -120px, #17322a 0%, #0a100e 62%) fixed, #080c0b;
  }

  .phone {
    max-width: none;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    padding: 0 14px 12px;
    background: none;
    display: grid;
    grid-template-columns: minmax(230px, 310px) minmax(400px, 500px) minmax(230px, 310px);
    grid-template-rows: auto auto minmax(0, 1fr);
    column-gap: 14px;
    justify-content: center;
    overflow: hidden;
  }

  /* slim wallet bar (graph.js injects home / currency / vault into it) */
  #money {
    grid-column: 1 / -1;
    grid-row: 1;
    height: auto;
    min-height: 36px;
    padding: 2px 10px;
    margin: 0 -14px 8px;
  }

  #money_box {
    padding: 5px 14px;
    font-size: 15px
  }

  /* logo row, centre column */
  .gamebar {
    grid-column: 2;
    grid-row: 2;
    background: none;
    border: none;
    padding: 0 0 6px;
    min-height: 44px;
    justify-content: center;
  }

  .fast-keno {
    font-size: 30px;
    line-height: 1;
    letter-spacing: -1px;
    text-shadow: none;
    white-space: nowrap;
  }

  .fast-keno br {
    display: none
  }

  .fast-keno .fk-a {
    color: #f2f5f7
  }

  .fast-keno .fk-b {
    color: var(--green)
  }

  .hamburger {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    gap: 4px;
    padding: 4px;
  }

  .hamburger span {
    width: 20px;
    height: 3px
  }

  .dropdown {
    right: 8px;
    top: calc(100% + 6px);
    z-index: 60
  }

  .layout {
    display: contents
  }

  /* ---- panels ---- */
  .kl-left,
  .kl-right {
    display: flex;
    flex-direction: column;
    min-height: 0;
    grid-row: 2 / 4;
    background: rgba(29, 34, 35, .92);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 8px 8px;
  }

  .kl-left {
    grid-column: 1
  }

  .kl-right {
    grid-column: 3
  }

  .kl-center {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    position: relative;
    scrollbar-width: none;
  }

  .kl-center::-webkit-scrollbar {
    display: none
  }

  /* thin scrollbars like the reference */
  .tickets,
  .kl-side-list {
    scrollbar-width: thin;
    scrollbar-color: #46524f transparent
  }

  .tickets::-webkit-scrollbar,
  .kl-side-list::-webkit-scrollbar {
    width: 8px
  }

  .tickets::-webkit-scrollbar-thumb,
  .kl-side-list::-webkit-scrollbar-thumb {
    background: #46524f;
    border-radius: 6px
  }

  .tickets::-webkit-scrollbar-track,
  .kl-side-list::-webkit-scrollbar-track {
    background: transparent
  }

  /* ---- left column ---- */
  .kl-left .id-pill {
    flex: none;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(61, 220, 132, .18);
    border-radius: 0;
    padding: 2px 2px 10px;
    gap: 8px;
    justify-content: flex-start;
    font-size: 12px;
    font-weight: 700;
    overflow: visible;
  }

  .kl-left .id-pill>span:first-child {
    border: 1px solid var(--yellow);
    border-radius: 12px;
    padding: 2px 9px;
    font-size: 11px;
  }

  .kl-left .id-sep {
    display: none
  }

  .kl-left .id-pill>span:nth-child(3) {
    margin-left: auto
  }

  .kl-left .tabs {
    flex: none;
    margin: 0;
    border: none;
    padding: 8px 0 0;
    justify-content: flex-start;
    gap: 14px;
    overflow: visible;
  }

  .kl-left .tab {
    flex: none;
    font-size: 11px;
    padding: 2px 0 6px
  }

  .kl-left .tab[data-tab="results"],
  .kl-left .tab[data-tab="stats"] {
    display: none
  }

  .ticket-head {
    flex: none;
    gap: 6px;
    padding: 6px 4px;
    font-size: 12px;
    white-space: nowrap;
  }

  .tickets {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    gap: 6px;
    padding: 0 6px 0 0;
  }

  .ticket {
    background: #1d2425;
    border-radius: 6px;
    padding: 6px
  }

  .t-user {
    font-size: 11px;
    margin-bottom: 4px
  }

  .t-nums {
    gap: 3px;
    margin-bottom: 4px
  }

  .t-num {
    background: #2b363a;
    border-radius: 4px;
    padding: 5px 0;
    font-size: 12px
  }

  .t-foot {
    background: none;
    padding: 0;
    gap: 4px
  }

  .t-foot .bet,
  .t-foot .st {
    flex: 1;
    background: #141b1c;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
  }

  .t-foot .st {
    text-align: right
  }

  /* ---- centre column ---- */
  .timer {
    flex: none;
    font-size: 20px;
    padding: 0 0 6px;
  }

  /* drawing: the stage shows the counter instead */
  .kl-center:has(.drawstage:not(.hidden)) .timer {
    display: none
  }

  .banner,
  .drawstage {
    flex: none;
    margin: 0;
    min-height: 150px;
  }

  .banner {
    padding: 10px 16px;
    border-radius: 12px
  }

  .drawstage {
    padding: 8px 4px 6px;
    background: none;
    border: none;
    border-radius: 0;
  }

  .drawstage::before,
  .drawstage::after {
    top: 40px;
    opacity: .8
  }

  .draw-top {
    position: static;
    text-align: right;
    padding-right: 6px;
    font-family: "Roboto Condensed", "Arial Narrow", Roboto, Arial, sans-serif;
    font-size: 20px;
    letter-spacing: 1px;
    z-index: 2;
  }

  .draw-top i {
    color: var(--green)
  }

  .big-ball {
    width: 58px;
    height: 58px;
    font-size: 30px;
    margin: 4px auto 2px
  }

  .drawn-row {
    margin-top: 8px;
    gap: 5px;
    min-height: 66px
  }

  .drow {
    gap: 4px;
    justify-items: center
  }

  .ball {
    width: min(100%, 30px);
    font-size: 13px
  }

  .win-text {
    font-size: 18px;
    margin-top: 4px
  }

  /* number board stays visible while drawing, drawn numbers light up */
  .phone .grid.hidden {
    display: grid !important
  }

  .grid {
    flex: none;
    margin-top: 8px;
    padding: 0;
    gap: 4px;
  }

  .cell {
    aspect-ratio: 1.1;
    font-family: "Roboto Condensed", "Arial Narrow", Roboto, Arial, sans-serif;
    font-size: 21px;
    background: #283134;
    color: #8e9ba3;
    border: none;
    border-radius: 3px;
  }

  .cell:hover {
    background: #2b373d
  }

  .cell.sel {
    background: #1f3f2d;
    color: #fff;
    border: none;
    box-shadow: inset 0 0 0 1px var(--green);
  }

  .cell.drawn {
    background: #4a9863;
    color: #fff;
    box-shadow: none
  }

  .cell.hit {
    background: #3ddc84;
    color: #04210f;
    box-shadow: inset 0 0 0 2px #fff
  }

  .dot {
    width: 5px;
    height: 5px;
    top: 4px;
    left: 4px
  }

  .dot.red {
    left: 4px;
    box-shadow: 0 0 4px #ff4d5e
  }

  .dot.blue {
    left: 4px;
    right: auto;
    box-shadow: 0 0 4px #7dd3fc
  }

  /* bet bar on one line, stays in place (dimmed) while drawing */
  .controls {
    flex: none;
    display: flex;
    gap: 8px;
    padding: 8px 0 0;
    align-items: stretch;
  }

  .phone .controls.hidden {
    display: flex !important;
    opacity: .45;
    pointer-events: none
  }

  .amount-row {
    flex: 1;
    margin: 0
  }

  .stepper {
    padding: 4px 6px
  }

  .stepper button {
    width: 34px;
    height: 34px;
    font-size: 22px
  }

  .amount {
    font-size: 20px
  }

  .mult-btn {
    flex: none;
    padding: 0 12px;
    font-size: 14px
  }

  .bet-btn {
    width: 130px;
    padding: 0;
    font-size: 20px
  }

  .payouts {
    flex: none;
    min-height: 0;
    padding: 8px 0 0
  }

  /* ---- right column ---- */
  .kl-side-tabs {
    flex: none;
    display: flex;
    gap: 12px;
    padding: 2px 0 0;
    border-bottom: 1px solid rgba(61, 220, 132, .18);
  }

  .kl-side-tab {
    background: none;
    border: none;
    color: var(--green);
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 0 8px;
    opacity: .7;
    white-space: nowrap;
  }

  .kl-side-tab.active {
    opacity: 1;
    box-shadow: inset 0 -2px 0 var(--green)
  }

  .kl-side-head {
    flex: none;
    display: flex;
    justify-content: space-between;
    color: var(--dim);
    font-size: 11px;
    padding: 8px 4px 6px;
  }

  .kl-side-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 6px;
  }

  .kl-side-row {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 6px;
    align-items: center;
    background: #1d2425;
    border-radius: 6px;
    padding: 5px;
    flex: none;
  }

  .kl-sr-id {
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
  }

  .kl-sr-id small {
    display: block;
    margin-left: 16px;
    color: var(--dim);
    font-size: 10px;
    font-weight: 600
  }

  .kl-ck {
    display: inline-grid;
    place-items: center;
    width: 12px;
    height: 12px;
    margin-right: 4px;
    border-radius: 3px;
    background: var(--green2);
    color: #04210f;
    font-size: 9px;
    vertical-align: -1px;
  }

  .kl-sr-nums {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px
  }

  .kl-sr-nums span {
    background: #2b363a;
    border-radius: 3px;
    text-align: center;
    padding: 2px 0;
    font-size: 10px;
    font-weight: 700;
    color: #dbe5ea;
  }

  .kl-side-row.wait {
    grid-template-columns: 108px 1fr
  }

  .kl-sr-wait {
    background: #2b363a;
    border-radius: 4px;
    text-align: center;
    padding: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #cfd8e0;
  }

  .kl-side-list .stat-group {
    flex: none
  }
}

/* ===== Desktop refinements: betting-phase reference ===== */
@media (min-width: 1024px) {

  /* one rounded panel behind logo + timer + banner + board + bet bar */
  .phone::before {
    content: "";
    grid-column: 2;
    grid-row: 2 / 4;
    background: rgba(29, 34, 35, .92);
    border: 1px solid var(--line);
    border-radius: 12px;
    pointer-events: none;
  }

  .gamebar {
    position: relative;
    z-index: 1;
    padding: 6px 8px 0
  }

  .hamburger {
    right: 8px
  }

  .kl-center {
    padding: 0 8px 8px
  }

  .dropdown {
    right: 8px;
    top: calc(100% + 6px);
    z-index: 60
  }

  /* timer sits right under the logo */
  .timer {
    height: 34px;
    line-height: 34px;
    padding: 0;
    font-size: 24px;
    letter-spacing: 3px;
  }

  /* compact flat banner (116 + 34 timer = same height as the draw stage) */
  .banner {
    min-height: 116px;
    padding: 8px 14px;
    gap: 14px;
    background: #27302f;
    border: none;
    border-radius: 8px;
  }

  .banner::after {
    display: none
  }

  .balls-deco {
    width: 76px;
    height: 62px
  }

  .b80 {
    width: 24px;
    height: 24px;
    font-size: 10px;
    left: 0;
    top: 2px
  }

  .b10 {
    width: 34px;
    height: 34px;
    font-size: 15px;
    left: 28px;
    top: 2px
  }

  .b1 {
    width: 44px;
    height: 44px;
    font-size: 24px;
    left: 4px;
    top: 16px
  }

  .banner-text h2 {
    font-size: 17px
  }

  .banner-text p {
    font-size: 12px;
    margin-top: 2px
  }

  .help-btn {
    width: 22px;
    height: 22px;
    font-size: 13px;
    right: 8px;
    top: 8px
  }

  .cell {
    aspect-ratio: 1.02
  }

  .bet-btn {
    border-radius: 6px
  }

  .bet-btn:not(:disabled) {
    box-shadow: none
  }
}

/* ===== Desktop: board shrinks to the window height, bet bar always visible ===== */
@media (min-width: 1024px) {
  .kl-center {
    overflow: hidden
  }

  .grid {
    flex: 1 1 auto;
    min-height: 180px;
    grid-template-rows: repeat(8, minmax(0, 1fr));
  }

  .cell {
    aspect-ratio: auto;
    height: auto;
    min-height: 0
  }

  .controls {
    flex: none
  }
}

@media (min-width: 1024px) and (max-height: 700px) {
  .cell {
    font-size: 17px
  }

  .gamebar {
    min-height: 38px
  }

  .fast-keno {
    font-size: 26px
  }
}

/* =====================================================================
   MOBILE / TABLET (< 1024px): no banner, no toast, board + bet controls
   fill exactly one screen (tickets start below the fold)
   ===================================================================== */
@media (min-width: 1024px) {
  .kl-screen {
    display: contents
  }
}

@media (max-width: 1023px) {

  html,
  body {
    overflow-x: hidden
  }

  .phone {
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden
  }

  #bannerView,
  .toast {
    display: none !important
  }

  .kl-screen {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
  }

  #money {
    flex: none;
    min-height: 44px;
    padding: 4px 10px
  }

  #money_box {
    padding: 5px 14px;
    font-size: 15px
  }

  .gamebar {
    flex: none;
    padding: 4px 10px
  }

  .timer {
    flex: none;
    font-size: 22px;
    padding: 2px 0
  }

  .kl-center {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .drawstage {
    flex: none;
    margin: 4px 10px;
    min-height: 0
  }

  .grid {
    flex: 1 1 auto;
    min-height: 0;
    gap: 4px;
    padding: 6px 10px 2px;
    grid-template-rows: repeat(8, minmax(0, 1fr));
  }

  .cell {
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
    font-size: clamp(13px, 2.7dvh, 20px);
  }

  .controls {
    flex: none;
    padding: 6px 10px 4px
  }

  .amount-row {
    margin-bottom: 6px
  }

  .stepper button {
    height: 36px;
    width: 46px;
    font-size: 24px
  }

  .amount {
    font-size: 22px
  }

  .mult-btn {
    font-size: 16px
  }

  .bet-btn {
    padding: 11px;
    font-size: 22px
  }

  .payouts {
    flex: none;
    min-height: 0;
    padding: 0 10px 4px
  }

  .pay-pill {
    padding: 3px 6px;
    font-size: 11px
  }
}

/* =====================================================================
   MOBILE reference look (< 1024px): compact banner, square cells,
   flat controls, tabs visible right under the BET button
   ===================================================================== */
@media (max-width: 1023px) {
  .phone {
    --pw: min(100vw, 480px);
    --cellh: min(calc((var(--pw) - 47px) / 10), calc((100dvh - 330px) / 8))
  }

  @media (min-width: 521px) {
    .phone {
      --pw: 400px
    }
  }

  #bannerView {
    display: flex !important
  }

  #bannerView.hidden {
    display: none !important
  }

  .kl-screen {
    height: auto;
    display: block
  }

  .kl-center {
    display: block;
    flex: none
  }

  #money {
    min-height: 36px;
    padding: 2px 10px
  }

  #money_box {
    padding: 4px 14px;
    font-size: 14px
  }

  .gamebar {
    padding: 4px 10px
  }

  .timer {
    font-size: 18px;
    padding: 0 0 4px;
    letter-spacing: 3px
  }

  .banner {
    margin: 0 10px;
    min-height: 0;
    padding: 8px 12px;
    gap: 12px;
    background: #27302f;
    border: none;
    border-radius: 6px;
  }

  .banner::after {
    display: none
  }

  .balls-deco {
    width: 66px;
    height: 56px
  }

  .b80 {
    width: 22px;
    height: 22px;
    font-size: 9px;
    left: 0;
    top: 0
  }

  .b10 {
    width: 32px;
    height: 32px;
    font-size: 14px;
    left: 26px;
    top: 0
  }

  .b1 {
    width: 40px;
    height: 40px;
    font-size: 22px;
    left: 2px;
    top: 14px
  }

  .banner-text h2 {
    font-size: 17px
  }

  .banner-text p {
    font-size: 14px;
    margin-top: 2px
  }

  .help-btn {
    width: 20px;
    height: 20px;
    font-size: 12px;
    right: 8px;
    top: 8px
  }

  .grid {
    flex: none;
    gap: 3px;
    padding: 8px 10px 0;
    grid-template-rows: none;
    grid-auto-rows: var(--cellh);
  }

  .cell {
    aspect-ratio: auto;
    height: var(--cellh);
    font-family: "Roboto Condensed", "Arial Narrow", Roboto, Arial, sans-serif;
    font-size: clamp(12px, calc(var(--cellh) * .5), 19px);
    background: #283134;
    color: #98a5ad;
    border: none;
    border-radius: 3px;
  }

  .cell.sel {
    background: #1f3f2d;
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--green)
  }

  .cell.drawn {
    background: #4a9863;
    color: #fff
  }

  .cell.hit {
    background: #3ddc84;
    color: #04210f
  }

  .dot {
    width: 5px;
    height: 5px;
    top: 3px;
    left: 3px
  }

  .dot.blue {
    left: 3px;
    right: auto
  }

  .controls {
    padding: 10px 10px 6px
  }

  .amount-row {
    gap: 6px;
    margin-bottom: 6px
  }

  .stepper {
    background: #202a2e;
    border-radius: 4px;
    padding: 3px 6px
  }

  .stepper button {
    color: #aab6bd;
    font-size: 30px;
    height: 38px
  }

  .amount {
    font-size: 20px
  }

  .mult-btn {
    background: #202a2e;
    border-radius: 4px;
    font-size: 14px
  }

  .bet-btn {
    border-radius: 4px;
    padding: 12px;
    font-size: 22px;
    background: #2e4e3c;
    box-shadow: none;
    color: #aebdb3;
  }

  .bet-btn:not(:disabled) {
    background: #2e4e3c;
    color: #e6f4ea;
    box-shadow: none
  }

  .tabs {
    margin-top: 0;
    padding-top: 8px
  }
}


/* ===== reference palette + seven-segment counter ===== */
.fast-keno {
  text-shadow: none
}

.fast-keno .fk-a {
  color: #dfe5e5
}

.fast-keno .fk-b {
  color: #52b57b
}

.timer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 30px;
  padding: 0;
  line-height: 1;
  color: #f3f6f6;
  text-shadow: 0 0 18px rgba(61, 220, 132, .8);
  letter-spacing: 3px;
  font-family: Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
}

.timer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190px;
  height: 34px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(38, 96, 86, .75) 0%, rgba(38, 96, 86, .28) 45%, transparent 72%);
  pointer-events: none;
}

.timer svg {
  position: relative;
  fill: currentColor;
  height: 17px;
  width: auto;
  display: block
}

.timer .seg {
  width: 9.5px
}

.timer .seg-colon {
  width: 4px;
  margin: 0 3px
}

.timer.urgent {
  color: var(--yellow);
  text-shadow: none
}

@media (min-width: 1024px) {
  .timer {
    height: 36px
  }

  .timer svg {
    height: 20px
  }

  .timer .seg {
    width: 11px
  }

  .timer::before {
    width: 230px;
    height: 40px
  }
}

.help-btn {
  background: #36423f
}

.banner .help-btn {
  color: var(--green)
}


/* ===== payouts live inside the banner ===== */
.banner-text {
  flex: 1;
  min-width: 0
}

.banner .payouts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 0 0;
  min-height: 0;
}

.banner .payouts:empty {
  display: none
}

.banner .pay-pill {
  background: rgba(0, 0, 0, .28);
  border: none;
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--green);
}

.banner .pay-pill b {
  color: #b9c4c4;
  font-weight: 700;
  margin-right: 1px
}

.banner .pay-pill b::after {
  content: "\2713";
  font-size: 9px;
  margin-left: 1px
}

/* with payouts showing, hide the "From 1 to 80" line to make room */
.banner-text:has(.payouts:not(:empty)) p {
  display: none
}

@media (max-width: 1023px) {

  /* fixed banner height so the board never jumps when payouts appear */
  .banner {
    height: 88px;
    min-height: 88px;
    align-items: center
  }

  .phone {
    --cellh: min(calc((var(--pw) - 47px) / 10), calc((100dvh - 342px) / 8))
  }
}

/* payout pills: "hits=multiplier" (e.g. 2=15x), no check mark */
.banner .pay-pill b::after {
  content: ""
}

.banner .pay-pill b {
  color: #fff;
  margin-right: 0
}

.banner .pay-pill.zero {
  opacity: .5;
  color: #b9c4c4
}

/* ===== picked numbers: flat boxy, same box (no push, no shadow) ===== */
.cell {
  text-shadow: none;
  box-shadow: none;
}

.cell:active {
  transform: none;
}

.cell.sel {
  background: #3aa76d !important;
  color: #fff !important;
  border: none !important;
  border-radius: 3px !important;
  box-shadow: inset 0 0 0 1px #3aa76d !important;
  text-shadow: none !important;
  transform: none !important;
}

/* ===== 0 shadows on all ball things ===== */
.mini-ball,
.b1 {
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}



/* ===== screenshot match: Possible win + Match/Pays + picked strip ===== */
.pw-top {
  color: #cfd8e0;
  font-size: 14px;
  font-weight: 700;
  padding: 2px 0 4px;
}

.pw-top b {
  color: var(--green);
  font-weight: 900;
  margin-left: 4px;
}

.banner .payouts {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.pay-head {
  display: flex;
  gap: 18px;
  color: #8b98a5;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 0;
  white-space: nowrap;
}

.pay-cols {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: none;
}

.pay-cols::-webkit-scrollbar {
  display: none;
}

.pay-col {
  flex: 0 0 auto;
  min-width: 34px;
  text-align: center;
  background: rgba(0, 0, 0, .28);
  border-radius: 5px;
  padding: 3px 2px;
  font-size: 11px;
  color: #b9c4c4;
  font-weight: 800;
  box-shadow: none;
}

.pay-col b {
  display: block;
  color: #fff;
  font-size: 12px;
}

.pay-col span {
  color: var(--green);
}

.picked-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  padding-top: 6px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.picked-row::-webkit-scrollbar {
  display: none;
}

.picked-num {
  flex: 0 0 auto;
  min-width: 34px;
  text-align: center;
  background: #161d1e;
  border: 1px solid rgba(61, 220, 132, .35);
  color: #fff;
  border-radius: 4px;
  padding: 5px 8px;
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  box-shadow: none;
  text-shadow: none;
}

/* banner never pushes the board: fixed box, inner rows scroll */
.banner,
.banner-text {
  overflow: hidden;
}

.banner-text {
  min-width: 0;
  max-width: 100%;
}

/* ===== ball animations back on (spin / grow / fly / land) ===== */
.win-overlay.pop {
  animation: winPop .45s cubic-bezier(.3, 1.4, .5, 1);
}

.win-overlay {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  z-index: 5;
  min-width: 250px;
  max-width: 88%;
  background: rgba(5, 10, 8, .92);
  border: 1px solid rgba(61, 220, 132, .25);
  border-radius: 16px;
  padding: 18px 26px 14px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .7);
}

.win-overlay.pop {
  animation: winPop .45s cubic-bezier(.3, 1.4, .5, 1);
}

@keyframes winPop {
  0% {
    transform: translate(-50%, -50%) scale(.6);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.win-title {
  color: #eafff3;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 3px;
}

.win-amount {
  color: #5fd68f;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1.15;
  text-shadow: 0 0 18px rgba(61, 220, 132, .6);
}

.win-amount small {
  font-size: 17px;
  font-weight: 900;
}

.win-sub {
  color: #9fb3a8;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

/* ===== screenshot match: My Ticket cards ===== */
.ticket.mine .t-user {
  color: #5fd68f;
}

.ticket.mine .t-num.hit {
  background: #3aa76d;
  color: #fff;
}

.t-foot .st.won {
  color: #5fd68f;
  font-weight: 900;
}

.bet-btn small {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .5px;
  opacity: .9;
}

/* ===== betControls stay exactly the same size (click never resizes) ===== */
.controls,
.amount-row {
  flex: none;
}

.bet-btn {
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  line-height: 52px !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: none;
}

.bet-btn.long {
  font-size: 17px !important;
  letter-spacing: 1px;
}

.bet-btn.long small {
  font-size: 12px !important;
}

@media (min-width: 1024px) {
  .bet-btn {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: 44px !important;
    width: 29.5% !important;
  }

  .bet-btn.long {
    font-size: 15px !important;
  }
}

.pw-top {
  font-size: 11px;
  padding: 0 0 2px;
}

.pay-head {
  font-size: 10px;
  padding: 0 0 2px;
  gap: 12px;
}

.banner .payouts {
  gap: 2px;
  padding: 2px 0 0;
}

.pay-cols {
  gap: 3px;
}

.pay-col {
  min-width: 28px;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 9px;
}

.pay-col b {
  font-size: 10px;
}

.picked-row {
  gap: 4px;
  padding-top: 4px;
}

.picked-num {
  min-width: 28px;
  padding: 3px 6px;
  font-size: 11px;
}

/* ===== mobile: banner items extra-small so nothing clips (88px banner) ===== */
@media (max-width: 1023px) {
  .pw-top {
    font-size: 10px;
    padding: 0 0 1px;
  }

  .pay-head {
    font-size: 9px;
    padding: 0 0 1px;
    gap: 10px;
  }

  .banner .payouts {
    gap: 1px;
    padding: 1px 0 0;
  }

  .pay-cols {
    gap: 2px;
  }

  .pay-col {
    min-width: 24px;
    padding: 1px 3px;
    font-size: 8px;
    border-radius: 3px;
  }

  .pay-col b {
    font-size: 9px;
  }

  .picked-row {
    gap: 3px;
    padding-top: 3px;
  }

  .picked-num {
    min-width: 24px;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
  }
}

/* =====================================================================
   Draw stage look matched to the real game's video (output.pdf)
   - dark stage, teal glow under the ball, muted concentric arcs
   - ball fades in small + grey, grows to a bright navy sphere, then
     leaves to the left/down into the row while the next one arrives
   ===================================================================== */
.drawstage {
  background:
    radial-gradient(ellipse 60% 40% at 50% 64%, rgba(36, 140, 126, .55) 0%, rgba(26, 92, 88, .28) 48%, transparent 78%),
    #14181b !important;
  border: none !important;
}

.drawstage::before {
  background: repeating-conic-gradient(rgba(70, 140, 100, .26) 0 10deg, transparent 10deg 42deg) !important;
}

.drawstage::after {
  background: repeating-conic-gradient(transparent 0 24deg, rgba(70, 140, 100, .20) 24deg 30deg) !important;
}

.draw-top {
  color: #eef2f5;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.draw-top i {
  color: #3ddc84;
}

/* arrival: faint grey -> bright, small -> big (with a little overshoot) */
.big-ball.new {
  animation: klArrive .38s cubic-bezier(.3, .7, .3, 1) both !important;
}

.big-ball.new .num {
  animation: klNum .38s ease-out both !important;
}

@keyframes klArrive {
  0% {
    transform: scale(.28);
    opacity: 0;
  }

  40% {
    transform: scale(.86);
    opacity: .65;
  }

  72% {
    transform: scale(1.14);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes klNum {
  0% {
    color: #6f7c88;
    opacity: .5;
    transform: none;
  }

  100% {
    color: #fff;
    opacity: 1;
    transform: none;
  }
}

/* the ball is gone from the middle while its copy flies to the row */
.big-ball.leaving {
  animation: none !important;
  opacity: 0 !important;
}


/* ===== slower, longer: fly takes longer; ball breathes while it waits ===== */
.fly-ball {
  transition: transform .6s cubic-bezier(.3, .7, .3, 1) !important;
}

.big-ball.new {
  animation:
    klArrive .45s cubic-bezier(.3, .7, .3, 1) both,
    klBreath .62s ease-in-out .45s infinite alternate !important;
}

@keyframes klBreath {
  from {
    transform: scale(.9);
  }

  to {
    transform: scale(1.14);
  }
}

/* ===== long background arcs (like the real game) ===== */
.drawstage::before {
  width: 520px !important;
  height: 520px !important;
  background: repeating-conic-gradient(rgba(80, 150, 112, .34) 0 78deg, transparent 78deg 96deg) !important;
  -webkit-mask: radial-gradient(circle, transparent 78px, #000 79px, #000 82px, transparent 83px, transparent 130px, #000 131px, #000 135px, transparent 136px, transparent 186px, #000 187px, #000 192px, transparent 193px) !important;
  mask: radial-gradient(circle, transparent 78px, #000 79px, #000 82px, transparent 83px, transparent 130px, #000 131px, #000 135px, transparent 136px, transparent 186px, #000 187px, #000 192px, transparent 193px) !important;
  animation-duration: 60s !important;
}

.drawstage::after {
  width: 520px !important;
  height: 520px !important;
  background: repeating-conic-gradient(transparent 0 30deg, rgba(80, 150, 112, .26) 30deg 100deg, transparent 100deg 112deg) !important;
  -webkit-mask: radial-gradient(circle, transparent 104px, #000 105px, #000 107px, transparent 108px, transparent 158px, #000 159px, #000 162px, transparent 163px, transparent 214px, #000 215px, #000 218px, transparent 219px) !important;
  mask: radial-gradient(circle, transparent 104px, #000 105px, #000 107px, transparent 108px, transparent 158px, #000 159px, #000 162px, transparent 163px, transparent 214px, #000 215px, #000 218px, transparent 219px) !important;
  animation-duration: 45s !important;
}

/* ===== Fast Keno glass balls (match reference) ===== */
.big-ball,
.ball,
.fly-ball {
  --rim: rgba(150, 190, 220, .55);
  --glow: rgba(120, 200, 255, .18);
  color: #fff;
  background:
    radial-gradient(circle at 50% 118%, rgba(60, 130, 150, .35) 0%, transparent 55%),
    radial-gradient(circle at 50% 38%, #1c2c44 0%, #101c30 55%, #0a1220 100%) !important;
  border: 1.5px solid var(--rim) !important;
  box-shadow:
    0 0 10px var(--glow),
    inset 0 -6px 10px rgba(0, 0, 0, .55),
    inset 0 3px 6px rgba(255, 255, 255, .10) !important;
  filter: none !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8) !important;
}

/* glossy highlight on top */
.big-ball::after,
.ball::after,
.fly-ball::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  left: 16%;
  top: 6%;
  width: 68%;
  height: 38%;
  border-radius: 50% / 60%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, .04)) !important;
  filter: none !important;
  pointer-events: none;
}

.big-ball {
  --rim: rgba(160, 200, 225, .6);
  --glow: rgba(61, 220, 132, .35);
  box-shadow:
    0 0 38px var(--glow),
    inset 0 -14px 24px rgba(0, 0, 0, .55),
    inset 0 6px 12px rgba(255, 255, 255, .10) !important;
}

.ball.latest {
  --rim: rgba(150, 190, 220, .55);
}

/* ---- HIT (a number I bet on): green teal ball, glowing green digits ---- */
.big-ball.hit,
.ball.hit,
.fly-ball.hit {
  --rim: rgba(70, 200, 140, .85);
  --glow: rgba(61, 220, 132, .55);
  color: #7dffb4 !important;
  background:
    radial-gradient(circle at 50% 118%, rgba(61, 220, 132, .45) 0%, transparent 60%),
    radial-gradient(circle at 50% 38%, #145a47 0%, #0c3d33 55%, #072720 100%) !important;
  text-shadow: 0 0 8px rgba(61, 255, 150, .8), 0 1px 2px rgba(0, 0, 0, .7) !important;
}

.big-ball.hit .num {
  color: #7dffb4;
}

.fly-ball {
  color: #fff;
}

.fly-ball.hit {
  color: #7dffb4;
}

/* ===== don't clip the balls: the row box cut off their glow / landing pop ===== */
.drawn-row {
  padding: 8px 8px 10px !important;
  margin-left: -8px !important;
  margin-right: -8px !important;
  margin-top: 4px !important;
  margin-bottom: -6px;
  min-height: 0 !important;
}

.drow {
  padding: 2px 0;
}

.ball {
  /* tone the glow down a little so it fits inside the padding */
  box-shadow:
    0 0 6px var(--glow),
    inset 0 -6px 10px rgba(0, 0, 0, .55),
    inset 0 3px 6px rgba(255, 255, 255, .10) !important;
}

.ball.hit {
  box-shadow:
    0 0 8px var(--glow),
    inset 0 -6px 10px rgba(0, 0, 0, .5),
    inset 0 3px 6px rgba(255, 255, 255, .15) !important;
}

@keyframes landSettle {
  0% {
    transform: scale(1.15)
  }

  100% {
    transform: scale(1)
  }
}
/* ===== Mobile tabs: comfortable tap targets + working panels ===== */
@media (max-width: 1023px) {
  .tabs {
    position: relative;
    z-index: 4;
  }

  .tab {
    padding: 8px 2px 9px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow .15s ease, opacity .15s ease;
  }

  .tab.active {
    opacity: 1;
    box-shadow: inset 0 -3px 0 var(--green);
  }

  .tabpanel {
    margin: 0 10px 16px;
  }
}
