/* =========================================================
   Jekpoti — the balloon (crash game)
   ========================================================= */
body[data-theme="crash"] {
  background:
    radial-gradient(1.5px 1.5px at 14% 20%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 64% 10%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 38% 36%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 86% 30%, #fff 50%, transparent 51%),
    radial-gradient(ellipse 90% 35% at 50% 110%, rgba(255,77,141,.55), transparent 70%),
    linear-gradient(180deg, #0b0620 0%, #24104f 60%, #4a1452 100%);
}
/* fixed height: a longer message must never push the cash-out button away from under your finger */
#crMsg {
  height: 76px;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  align-items: center;
}
.cr-tag {
  margin: 6px 0 0;
  display: inline-block;
  background: rgba(8,4,20,.7);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  color: #f1e9ff;
}
.cr-history {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin: 0 auto 6px;
  width: 100%;
  max-width: 1100px;
  scrollbar-width: thin;
}
.cr-history span {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-size: 13px;
  background: rgba(8,4,20,.8);
  border: 1px solid var(--line);
  color: #9fc3ff;
}
.cr-history span.mid {
  color: #d59bff;
  border-color: #a259ff66;
}
.cr-history span.hi {
  color: var(--gold);
  border-color: #ffd16688;
  box-shadow: 0 0 10px rgba(255,209,102,.3);
}
.cr-history span.new {
  animation: tin .4s ease;
}
.cr-stage {
  display: grid;
  grid-template-columns: minmax(0,1fr) 260px;
  gap: 12px;
  align-items: stretch;
}
.cr-sky {
  position: relative;
  height: clamp(260px, 46vh, 440px);
  border-radius: 16px;
  overflow: hidden;
  border: 4px solid transparent;
  background: linear-gradient(180deg,#140b2e,#05020a) padding-box,
    linear-gradient(180deg,#fff4b8,#d4a017 28%,#7a4e00 55%,#ffd75e 80%,#a06a00) border-box;
  box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 34px rgba(255,190,60,.25);
}
.cr-sky canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.cr-sky.shake {
  animation: crshake .45s;
}
@keyframes crshake {
  20% {
    transform: translate(-6px,3px);
  }
  40% {
    transform: translate(5px,-4px);
  }
  60% {
    transform: translate(-4px,-2px);
  }
  80% {
    transform: translate(3px,3px);
  }
}
.cr-big {
  position: absolute;
  left: 0;
  right: 0;
  top: 28%;
  text-align: center;
  pointer-events: none;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-size: clamp(44px,10vw,96px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 0 rgba(0,0,0,.45), 0 0 30px rgba(255,209,102,.45);
}
.cr-big.crashed {
  color: var(--red);
  text-shadow: 0 4px 0 rgba(0,0,0,.5), 0 0 34px rgba(255,90,95,.7);
}
.cr-big.count {
  color: var(--gold);
  animation: zoom .5s cubic-bezier(.2,1.6,.4,1);
}
.cr-big.wait {
  font-size: clamp(20px,4vw,34px);
}
.cr-sub {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(28% + clamp(52px,11vw,104px));
  text-align: center;
  font-weight: 900;
  color: #ece4ff;
  text-shadow: 0 2px 6px #000;
  pointer-events: none;
}
.cr-bar {
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: 14%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  overflow: hidden;
}
.cr-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg,var(--pink),var(--gold));
  border-radius: inherit;
}
.cr-bots {
  background: rgba(8,4,20,.82);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  min-height: 0;
  max-height: clamp(260px, 46vh, 440px);
  overflow: auto;
}
.cr-bots h4 {
  margin: 0;
  font-size: 14px;
  color: var(--gold);
}
.cr-bots > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin: 2px 0 8px;
}
.cr-bot {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}
.cr-bot:nth-child(odd) {
  background: rgba(255,255,255,.04);
}
.cr-bot .n {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-bot .x {
  min-width: 52px;
  text-align: right;
  color: var(--muted);
}
.cr-bot.won {
  background: rgba(91,227,125,.15);
}
.cr-bot.won .x {
  color: var(--green);
}
.cr-bot.lost {
  opacity: .5;
}
.cr-bot.lost .x {
  color: var(--red);
}
.cr-bot.me {
  background: rgba(255,209,102,.16);
  border: 1px solid #ffd16688;
  color: var(--gold);
}
.cr-bot.me small {
  color: var(--muted);
}
.cr-empty {
  padding: 14px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
#crFair {
  font-size: 13px;
  line-height: 1.55;
}
#crFair code {
  font-family: ui-monospace,Consolas,monospace;
  font-size: 11.5px;
  color: #cfe3ff;
  word-break: break-all;
}
.fair-now {
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.fair-meta {
  color: var(--muted);
  margin: 6px 0 10px;
}
.fair-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow: auto;
}
.fair-row {
  display: grid;
  grid-template-columns: auto 64px minmax(0,1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
}
.fair-row > span:nth-child(2) {
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  color: #9fc3ff;
}
.fair-row .mid {
  color: #d59bff !important;
}
.fair-row .hi {
  color: var(--gold) !important;
}
.fair-row .res {
  grid-column: 1 / -1;
  font-size: 12.5px;
  font-weight: 800;
}
.fair-row .res:empty {
  display: none;
}
.fair-row button {
  padding: 4px 10px;
  font-size: 12px;
}
.cr-bets {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
  margin-top: 12px;
}
.cr-bet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  min-width: 0;
  background: linear-gradient(180deg,rgba(24,14,46,.95),rgba(4,2,10,.96));
  border: 1px solid rgba(255,215,94,.4);
  box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.cr-bet.live {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 12px 30px rgba(0,0,0,.5);
}
.cr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.cr-row > b {
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: var(--gold);
}
.cr-bet .chips {
  margin-top: 0;
  justify-content: flex-start;
}
.cr-auto {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 13px;
  color: #e9e0ff;
}
.cr-auto input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
}
.cr-auto input[type=number] {
  width: 74px;
  padding: 5px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0f0820;
  color: #fff;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  text-align: center;
}
.cr-auto input:disabled {
  opacity: .5;
}
.cr-act {
  width: 100%;
  padding: 14px 10px;
  border-radius: 14px;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-size: clamp(15px,2.4vw,19px);
  line-height: 1.15;
  color: #06240f;
  background: linear-gradient(180deg,#7df59a,#2fbf5a);
  border: 0;
  box-shadow: 0 6px 0 #146b2c;
  transition: transform .08s;
}
.cr-act * {
  pointer-events: none;
} /* presses always land on the button itself, even while its text updates */
.cr-act {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.cr-act small {
  display: block;
  font-family: 'Nunito','Noto Sans Georgian',sans-serif;
  font-weight: 900;
  font-size: 12px;
  opacity: .85;
}
.cr-act:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #146b2c;
}
.dg {
  display: inline-block;
  width: .74em;
  text-align: center;
  font-style: normal;
} /* one digit = one box as wide as Bungee's widest digit */
.cr-act .cr-amt {
  display: block;
  margin-top: 4px;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-weight: 400;
  font-size: clamp(26px,4.4vw,38px);
  line-height: 1.05;
  letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.cr-act.cash .cr-amt {
  color: #fff;
  -webkit-text-stroke: 1.5px #7a3b00;
  text-shadow: 0 3px 0 #a35c00, 0 0 18px rgba(255,255,255,.65);
}
.cr-act.won .cr-amt {
  color: #7df59a;
  text-shadow: 0 0 14px rgba(125,245,154,.55);
}
.cr-x2 {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  font-family: 'Bungee','Noto Sans Georgian',sans-serif;
  font-size: 16px;
  color: #2b1500;
  background: linear-gradient(180deg,#ffe08a,#ffb703);
  border: 0;
  box-shadow: 0 4px 0 #a35c00;
}
.cr-x2:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #a35c00;
}
.cr-x2:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.cr-mul {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.cr-act.cancel {
  background: linear-gradient(180deg,#ff8a95,#c9303f);
  color: #fff;
  box-shadow: 0 6px 0 #7a1020;
}
.cr-act.cash {
  background: linear-gradient(180deg,#ffe08a,#ff9f1c);
  color: #2b1500;
  box-shadow: 0 6px 0 #a35c00;
  animation: crpulse 1s ease-in-out infinite;
}
@keyframes crpulse {
  50% {
    filter: brightness(1.12);
  }
}
.cr-act.won {
  background: linear-gradient(180deg,#3a7d4a,#1d4a29);
  color: #c8ffd6;
  box-shadow: none;
}
.cr-act.lost {
  background: #3a1622;
  color: #ff9aa6;
  box-shadow: none;
}
.cr-act:disabled {
  cursor: not-allowed;
}
.cr-act.idle:disabled {
  background: #2e1c5c;
  color: var(--muted);
  box-shadow: none;
}
@media (max-width: 900px) {
  /* phones/tablets: graph → message → bets, the bots go below the bets */
  #crash:not([hidden]) {
    display: flex;
    flex-direction: column;
  }
  .cr-stage {
    display: contents;
  }
  #crash .mhead {
    order: 0;
  }
  .cr-history {
    order: 1;
  }
  .cr-sky {
    order: 2;
  }
  #crMsg {
    order: 3;
  }
  .cr-bets {
    order: 4;
  }
  .cr-bots {
    order: 5;
    max-height: 240px;
    margin-top: 12px;
  }
  #crash .paytable {
    order: 6;
  }
}
@media (max-width: 520px) {
  .cr-auto .lg {
    display: none;
  }
}
@media (max-width: 700px), (max-height: 500px) and (orientation: landscape) {
  body[data-theme="crash"] {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .cr-tag {
    display: none;
  }
  #crMsg {
    height: 68px;
    font-size: 13px;
  }
  .cr-sky {
    height: clamp(200px, 38svh, 340px);
    border-width: 3px;
  }
  .cr-bets {
    gap: 8px;
    margin-top: 8px;
  }
  .cr-bet {
    padding: 8px;
    gap: 6px;
    border-radius: 14px;
  }
  .cr-bet .bet .val {
    width: 56px;
  }
  .cr-act {
    padding: 11px 6px;
  }
  .cr-act .cr-amt {
    font-size: clamp(22px,6.6vw,30px);
  }
  .cr-x2 {
    height: 38px;
    padding: 0 10px;
    font-size: 14px;
  }
  .cr-auto input[type=number] {
    width: 62px;
  }
}
@media (max-width: 360px) {
  .cr-bets {
    grid-template-columns: 1fr;
  }
} /* two panels don't fit side by side */
@media (max-width: 420px) {
  .cr-bet .chips button {
    min-width: 40px;
    font-size: 12px;
  }
  .cr-row > b {
    font-size: 12px;
  }
  .cr-mul {
    flex: 1 1 100%;
  }
  .cr-x2 {
    flex: 1 1 0;
    height: 30px;
    font-size: 13px;
  } /* no room beside the stepper: their own slim full-width strip */
}
