.pump-body {
  min-height: 100vh;
  background: #0b202c;
}

.pump-body [hidden] {
  display: none !important;
}

.pump-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 0.75rem max(1rem, calc((100vw - 1280px) / 2));
  background: #142d3a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pump-topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pump-topbar h1,
.pump-topbar p {
  margin: 0;
}

.pump-topbar h1 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.pump-topbar p {
  color: var(--muted);
  font-size: 0.82rem;
}

.pump-topbar .status-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pump-topbar .status-strip > div {
  padding: 0.45rem 0.8rem;
  border-radius: 0.45rem;
  background: #0f2633;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.pump-topbar .button {
  min-height: 2.75rem;
  border-radius: 0.45rem;
}

.pump-layout {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  gap: 0;
  max-width: 1280px;
  min-height: calc(100vh - 4.25rem);
  margin: 0 auto;
  padding: 1.25rem 0;
}

.pump-layout.stats-open {
  grid-template-columns: 18rem 18rem minmax(0, 1fr);
}

.pump-body .live-stats-drawer {
  display: none;
  min-height: 100%;
  min-width: 18rem;
  padding: 1rem;
  background: #203946;
  border-radius: 0.35rem 0 0 0.35rem;
}

.pump-layout.stats-open .live-stats-drawer {
  display: block;
}

.pump-body .live-stats-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.pump-body .live-stats-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
}

.pump-body .live-stats-header h2 span,
.pump-body .credit-dot {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.3rem;
  background: #28d59f;
  color: #03150f;
  font-size: 0.58rem;
  font-weight: 950;
}

.pump-body .credit-dot {
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  font-size: 0.42rem;
  vertical-align: 0.12rem;
}

.pump-body .live-stats-header .icon-button,
.pump-body .stats-filter-row .icon-button {
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1rem;
}

.pump-body .stats-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.pump-body .stats-filter-row select {
  width: 100%;
  min-width: 0;
}

.pump-body .live-stats-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 0.45rem;
  background: #18303d;
}

.pump-body .live-stats-metrics > div {
  min-width: 0;
  min-height: 3.5rem;
  padding: 0.2rem 0.7rem;
}

.pump-body .live-stats-metrics > div:nth-child(odd) {
  border-right: 1px solid #3d5b6e;
}

.pump-body .live-stats-metrics strong {
  display: inline-block;
  max-width: 100%;
  margin-top: 0.05rem;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.pump-body .stats-chart {
  height: 13.75rem;
  padding: 0.8rem;
  border-radius: 0.45rem;
  background: #102532;
  overflow: hidden;
}

.pump-body .stats-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pump-body .chart-fill {
  fill: rgba(20, 244, 106, 0.22);
}

.pump-body .chart-loss-fill {
  fill: rgba(255, 40, 84, 0.24);
}

.pump-body .chart-line {
  fill: none;
  stroke: #14f46a;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pump-body .chart-loss-line {
  fill: none;
  stroke: #ff2854;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pump-body .chart-zero {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2;
}

.pump-controls {
  display: flex;
  flex-direction: column;
  background: #203946;
  border-radius: 0.35rem 0 0 0.35rem;
}

.pump-bet-panel {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pump-bet-panel .segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.25rem;
  border-radius: 999px;
  background: #0d2330;
}

.pump-bet-panel .segmented button {
  min-height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c8dce8;
  font-weight: 800;
  cursor: pointer;
}

.pump-bet-panel .segmented button.active {
  background: #6f8fa1;
  color: #061924;
}

.pump-bet-panel input,
.pump-bet-panel select,
.verifier-panel input,
.stats-filter-row select {
  width: 100%;
  min-height: 2.6rem;
  border: 1px solid #335368;
  border-radius: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: #0d202b;
  color: #f3fbff;
}

.mode-panel {
  display: grid;
  gap: 0.7rem;
}

.bet-action {
  width: 100%;
  min-height: 2.75rem;
  border-radius: 0.45rem;
  font-weight: 900;
}

.profit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.45rem;
  background: #18303d;
  color: #c6d8e2;
  font-size: 0.85rem;
}

.profit-card strong {
  color: #ffffff;
}

.auto-panel,
.auto-advanced {
  gap: 0.75rem;
}

.auto-advanced {
  display: grid;
}

.auto-rule {
  margin: 0;
  padding: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.45rem;
}

.auto-rule legend {
  padding: 0 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.auto-rule-row {
  display: grid;
  grid-template-columns: 4.4rem minmax(6.5rem, 1fr);
  gap: 0.35rem;
  align-items: center;
}

.auto-rule-row button,
.auto-rule-row label {
  min-width: 0;
  min-height: 2.35rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0f2532;
  color: #dcecf4;
  font-weight: 800;
}

.auto-rule-row button {
  cursor: pointer;
}

.auto-rule-row button.active {
  background: #6f8fa1;
  color: #061924;
}

.auto-rule-row label {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.4rem;
}

.auto-rule-row input {
  width: 100%;
  min-width: 0;
  min-height: 2rem;
  padding: 0.35rem 0.2rem;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-weight: 900;
}

.auto-pacing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.custom-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.6rem;
}

.custom-switch-row input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-control {
  position: relative;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 1.35rem;
  border-radius: 999px;
  background: #39566a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.switch-control::after {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #9eb5c3;
  transition: transform 0.16s ease, background 0.16s ease;
}

.custom-switch-row input:checked + .switch-control {
  background: #2778d8;
}

.custom-switch-row input:checked + .switch-control::after {
  transform: translateX(1.12rem);
  background: #ffffff;
}

.pump-note {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border-radius: 0.45rem;
  background: #14303e;
  color: #bfd3df;
  font-size: 0.8rem;
  line-height: 1.45;
}

.pump-note strong {
  color: #dff5ff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.text-button {
  min-height: 2.1rem;
  padding: 0.4rem 0.65rem;
  border: 0;
  border-radius: 0.35rem;
  background: #314d60;
  color: #e3f2f8;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.text-button[aria-pressed="true"] {
  background: #1a8fff;
  color: #ffffff;
}

.pump-stage {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 1rem;
  padding: 0 1.25rem;
}

.pump-stage > * {
  min-width: 0;
}

.balloon-panel {
  min-width: 0;
  padding: 0;
  border-radius: 0.45rem;
  overflow: hidden;
  background: #071c27;
}

.pump-machine {
  --balloon-scale: 1;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 31rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(103, 50, 255, 0.18), transparent 16rem),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 5rem 100%,
    #0a2030;
}

.spark-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.spark-layer.pop {
  opacity: 1;
  background:
    radial-gradient(circle at 44% 31%, #ff2d59 0 0.18rem, transparent 0.2rem),
    radial-gradient(circle at 57% 28%, #8d5cff 0 0.16rem, transparent 0.18rem),
    radial-gradient(circle at 49% 38%, #ffffff 0 0.13rem, transparent 0.15rem),
    radial-gradient(circle at 54% 45%, #ff2d59 0 0.14rem, transparent 0.16rem);
  animation: spark-pop 0.7s ease both;
}

.balloon-wrap {
  position: absolute;
  left: 50%;
  bottom: 8.2rem;
  width: 15rem;
  height: 18rem;
  transform: translateX(-50%) scale(var(--balloon-scale));
  transform-origin: 50% 100%;
  transition: transform 0.22s ease;
  z-index: 2;
}

.balloon {
  position: absolute;
  inset: 0.2rem 0.6rem 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 73% 18%, rgba(255, 255, 255, 0.78) 0 1.05rem, transparent 1.15rem),
    radial-gradient(circle at 48% 45%, #7d2cff, #4e11dd);
  color: #ffffff;
  font-size: 2.35rem;
  font-weight: 950;
  text-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.35);
  box-shadow:
    inset -1.1rem -1.5rem 2rem rgba(24, 6, 89, 0.32),
    0 1rem 2.5rem rgba(0, 0, 0, 0.28);
}

.balloon.safe {
  background:
    radial-gradient(circle at 73% 18%, rgba(255, 255, 255, 0.82) 0 1.05rem, transparent 1.15rem),
    radial-gradient(circle at 48% 45%, #45da2a, #23a71d);
}

.balloon.loss {
  opacity: 0.34;
  background:
    radial-gradient(circle at 73% 18%, rgba(255, 255, 255, 0.4) 0 1.05rem, transparent 1.15rem),
    radial-gradient(circle at 48% 45%, #ff2d59, #a90436);
  transform: scale(0.82);
}

.balloon-neck {
  position: absolute;
  left: 50%;
  bottom: 1.35rem;
  width: 2rem;
  height: 1.9rem;
  transform: translateX(-50%);
  border-radius: 0 0 0.25rem 0.25rem;
  background: #5f25d8;
}

.balloon-tube {
  position: absolute;
  left: 50%;
  bottom: -2rem;
  width: 0.65rem;
  height: 3.7rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #273f4c;
}

.pump-base {
  position: absolute;
  left: 50%;
  bottom: 3.45rem;
  width: min(44rem, calc(100% - 2rem));
  height: 5rem;
  transform: translateX(-50%);
  z-index: 1;
}

.pump-base::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.35rem;
  width: 19rem;
  height: 3.6rem;
  border-radius: 999px 999px 0 0;
  background: #18313e;
}

.pump-cylinder {
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  width: 5.5rem;
  height: 4.4rem;
  transform: translateX(-50%);
  border-radius: 1rem 1rem 0 0;
  background: #1f3a48;
}

.pump-hose {
  position: absolute;
  left: 55%;
  right: 1rem;
  bottom: 0.35rem;
  height: 1.1rem;
  border-radius: 999px 999px 0 0;
  background: #18313e;
}

.pressure-lights {
  position: absolute;
  left: 4.8rem;
  bottom: 2.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: min(30rem, calc(100% - 6rem));
  z-index: 2;
}

.pressure-light {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #081a25;
}

.pressure-light.active {
  background: #16e06f;
  box-shadow: 0 0 0.5rem rgba(22, 224, 111, 0.7);
}

.pressure-light.loss {
  background: #ff2d59;
  box-shadow: 0 0 0.5rem rgba(255, 45, 89, 0.75);
}

.round-banner {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  min-width: 18rem;
  max-width: calc(100% - 2rem);
  transform: translateX(-50%);
  padding: 0.7rem 1rem;
  border-radius: 0.45rem;
  background: rgba(19, 45, 59, 0.95);
  color: #d8edf6;
  text-align: center;
  font-weight: 850;
  box-shadow: 0 0.6rem 1rem rgba(0, 0, 0, 0.24);
}

.round-banner.win {
  background: #0e6f55;
  color: #ffffff;
}

.round-banner.loss {
  background: #95233d;
  color: #ffffff;
}

.multiplier-rail {
  display: grid;
  grid-template-columns: repeat(24, 5.8rem);
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.65rem 0.75rem 1rem;
  background: #071c27;
  scrollbar-color: #496c7d #0a202b;
}

.multiplier-chip {
  display: grid;
  place-items: center;
  min-height: 2.35rem;
  border-radius: 0.45rem;
  background: #263f4f;
  color: #e7f3f8;
  font-size: 0.78rem;
  font-weight: 950;
  white-space: nowrap;
}

.multiplier-chip.passed,
.multiplier-chip.current {
  background: #16a51f;
  color: #ffffff;
}

.multiplier-chip.loss {
  background: #c9043c;
  color: #ffffff;
}

.multiplier-chip.locked {
  opacity: 0.42;
}

.pump-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.pump-result-grid > div,
.history-panel,
.verifier-panel {
  padding: 1rem;
  border-radius: 0.45rem;
  background: #132d3a;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pump-result-grid strong {
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

.verifier-panel {
  color: #d7eaf2;
}

.verifier-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.verifier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.verifier-grid code {
  display: block;
  min-height: 2.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  background: #0d202b;
  border: 1px solid #335368;
  color: #e6f4fb;
  overflow-wrap: anywhere;
}

.verifier-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0;
}

#resultOutput {
  min-height: 12rem;
  max-height: 31rem;
  overflow: auto;
  padding: 1rem;
  border-radius: 0.45rem;
  background: #091c27;
  color: #e5f7ff;
  font-size: 0.78rem;
  line-height: 1.45;
}

.history-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-panel table {
  width: 100%;
  border-collapse: collapse;
}

.history-panel th,
.history-panel td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  text-align: left;
  white-space: nowrap;
}

.profit-positive {
  color: #14f46a;
}

.profit-negative {
  color: #ff5776;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(4, 13, 18, 0.72);
}

.info-dialog {
  width: min(36rem, 100%);
  border-radius: 0.55rem;
  background: #19313e;
  color: #dbeef7;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
}

.info-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.25rem;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.info-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.info-tabs {
  display: flex;
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0 auto 0.75rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: #0d2330;
}

.info-tabs button {
  min-width: 8rem;
  min-height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #d6e7ef;
  font-weight: 900;
  cursor: pointer;
}

.info-tabs button.active {
  background: #6f8fa1;
  color: #061924;
}

.info-panel {
  padding: 0 1.25rem 1.25rem;
  line-height: 1.6;
}

.info-panel ol {
  margin: 0;
  padding-left: 1.2rem;
}

.max-list {
  display: grid;
  gap: 0.55rem;
}

.max-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.45rem;
  background: #102734;
}

@keyframes spark-pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

@media (max-width: 1080px) {
  .pump-topbar,
  .pump-topbar .status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .pump-topbar .status-strip {
    width: 100%;
  }

  .pump-layout,
  .pump-layout.stats-open {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .pump-body .live-stats-drawer,
  .pump-controls {
    border-radius: 0;
  }

  .pump-bet-panel {
    position: static;
  }

  .pump-stage {
    padding: 1rem;
  }

  .pump-result-grid,
  .verifier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .pump-topbar {
    padding: 0.75rem;
  }

  .pump-topbar .status-strip > div,
  .pump-topbar .button {
    width: 100%;
  }

  .pump-result-grid,
  .verifier-grid,
  .auto-rule-row,
  .auto-pacing {
    grid-template-columns: 1fr;
  }

  .pump-machine {
    min-height: 25rem;
  }

  .balloon-wrap {
    width: 11rem;
    height: 13rem;
  }

  .balloon {
    font-size: 1.75rem;
  }

  .pump-base {
    width: calc(100% - 1.5rem);
  }

  .pump-base::before {
    width: 12rem;
  }

  .round-banner {
    min-width: 0;
    width: calc(100% - 1.5rem);
  }

  .info-tabs {
    width: calc(100% - 2rem);
  }

  .info-tabs button {
    min-width: 0;
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .balloon-wrap,
  .spark-layer.pop {
    animation: none;
    transition: none;
  }
}
