:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  overflow: hidden;
  background: #19182b;
  display: grid;
  place-items: center;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  font-weight: 900;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
  filter: grayscale(0.6);
  opacity: 0.65;
}
#app {
  position: relative;
  width: min(100vw, 56.25dvh, 480px);
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: #ebcc96;
  touch-action: none;
}
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
[hidden] {
  display: none !important;
}
.screen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.screen button {
  pointer-events: auto;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(15px, env(safe-area-inset-top)) 15px 0;
}
.round {
  background: #81cbe8;
  border: 2px solid #48536c;
  border-radius: 50%;
  width: 39px;
  height: 39px;
  font-size: 23px;
  text-shadow: 0 2px #48536c;
  box-shadow: inset 0 -3px #0002;
}
.wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 99px;
  min-width: 100px;
  padding: 5px 11px;
  color: #46485c;
  font-size: 15px;
  font-weight: 1000;
  box-shadow: 0 3px #0001;
}
.cash-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 19px;
  border: 2px solid #fbffd2;
  background: #8cc843;
  border-radius: 3px;
  transform: rotate(-13deg);
  color: #fff8c5;
  font-size: 15px;
  font-style: normal;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 7px;
}
.small-round {
  width: 29px;
  height: 29px;
  font-size: 18px;
  background: #88d958;
  border: 2px solid #52774a;
}
.menu-middle {
  position: absolute;
  top: 46%;
  width: 100%;
  text-align: center;
}
.play {
  padding: 11px 30px;
  background: #f16961;
  border: 2px solid #75525d;
  border-radius: 15px;
  color: #fff;
  font-size: 23px;
  text-shadow: 0 2px #7d454b;
  box-shadow:
    inset 0 -5px #d34d50,
    0 4px #0003;
}
.play:active,
.action:active {
  transform: translateY(2px);
}
.home-title {
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 3px;
  text-shadow: 0 2px #725f79;
  margin-bottom: 12px;
}
.home-title small {
  display: block;
  letter-spacing: 1px;
  font-size: 10px;
  margin-top: 5px;
}
.upgrades {
  position: absolute;
  top: 65%;
  left: 6%;
  right: 6%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.card {
  background: linear-gradient(#b4e7f6, #79c4e9);
  border: 2px solid #58607c;
  border-radius: 12px;
  box-shadow:
    inset 0 1px #fff9,
    0 3px #0002;
  text-align: center;
  padding: 7px 4px;
  color: #fff;
  font-weight: 900;
}
.card label {
  font-size: 12px;
  display: block;
  text-shadow: 0 1px #546a82;
}
.card b {
  display: block;
  font-size: 17px;
  color: #b3ed53;
  text-shadow: 0 1px #4f762b;
  margin: 4px;
}
.card .symbol {
  font-size: 27px;
  height: 39px;
  display: grid;
  place-items: center;
  color: #ffe279;
  text-shadow: 0 2px #58607c;
}
.buy {
  width: 100%;
  padding: 6px 0;
  background: #ffc85b;
  border: 1px solid #697181;
  border-radius: 8px;
  text-shadow: 0 1px #667165;
  box-shadow: inset 0 -3px #de9b3f;
  font-size: 13px;
}
.side {
  position: absolute;
  right: 12px;
  top: 17%;
  display: grid;
  gap: 10px;
}
.instruction {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 100%;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px #4b3e5a;
}
.game-title {
  text-align: center;
  margin: 8px;
  font-size: 17px;
  font-weight: 1000;
  text-shadow: 0 2px #73617a;
}
.healthline {
  margin: 0 15px;
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 10px;
  font-weight: 900;
  text-shadow: 0 1px #665675;
}
.bar {
  height: 6px;
  flex: 1;
  border-radius: 99px;
  background: #423b5166;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: #ff8174;
  transition: width 0.15s;
}
.run-stats {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 7px;
  font-weight: 900;
  font-size: 10px;
  text-shadow: 0 1px #596276;
}
.run-stats span {
  padding: 4px 7px;
  border-radius: 99px;
  background: #665d7b99;
}
.pause-btn {
  font-size: 18px;
}
.controls {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 14px;
}
.controls button {
  width: 45px;
  height: 37px;
  background: #53495e77;
  border: 1px solid #fff9;
  border-radius: 10px;
  font-size: 20px;
  backdrop-filter: blur(4px);
}
.modal {
  position: absolute;
  z-index: 5;
  inset: 0;
  background: #30234dcc;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: auto;
}
.box {
  width: 100%;
  max-height: 92%;
  overflow: auto;
  border: 2px solid #41415b;
  border-radius: 22px;
  padding: 22px 16px;
  background: linear-gradient(140deg, #6957b9, #637dcc);
  box-shadow:
    inset 0 2px #ffffff55,
    0 15px 35px #0003;
  text-align: center;
}
.box h2 {
  margin: 0 0 16px;
  font-size: 25px;
  text-shadow: 0 2px #3b3b68;
}
.box p {
  font-size: 12px;
  line-height: 1.8;
  margin: 8px 0;
}
.action {
  background: #ffcc57;
  border: 2px solid #68543b;
  border-radius: 13px;
  box-shadow: inset 0 -4px #d8a13a;
  color: #59484d;
  padding: 12px 14px;
  font-size: 16px;
  width: 100%;
  margin-top: 10px;
}
.secondary {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 12px;
  font-size: 13px;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 17px 3px;
  font-size: 17px;
  font-weight: 900;
}
.setting input {
  accent-color: #8dd76e;
  width: 27px;
  height: 23px;
}
.reward {
  font-size: 28px;
  font-weight: 1000;
  margin: 20px 0;
  color: #e4ff9d;
}
.fine {
  font-size: 10px !important;
  color: #e0e2f7;
}
.store-row {
  border: 1px solid #fff8;
  border-radius: 12px;
  background: #ffffff1c;
  padding: 12px;
  margin-top: 10px;
}
.toast {
  position: absolute;
  z-index: 8;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  background: #32294be6;
  color: #e8ffa8;
  border: 1px solid #b7ed75;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 900;
  padding: 9px 14px;
  white-space: nowrap;
  pointer-events: none;
}
.badge {
  position: absolute;
  left: 12px;
  bottom: 13%;
  font-size: 9px;
  color: #fff9;
  text-shadow: 0 1px #525062;
  pointer-events: none;
}
.level-track {
  position: absolute;
  top: 16%;
  left: 17px;
  right: 17px;
  height: 3px;
  background: #fff4;
  border-radius: 99px;
}
.level-track i {
  display: block;
  background: #fff0a7;
  height: 100%;
  width: 0;
}
.result-label {
  font-size: 12px;
  letter-spacing: 2px;
  color: #edffa8;
}
.directions {
  text-align: left;
  font-size: 12px;
  line-height: 1.9;
  padding-left: 18px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-height: 640px) {
  .top {
    padding-top: 9px;
  }
  .round {
    width: 33px;
    height: 33px;
    font-size: 18px;
  }
  .card .symbol {
    height: 29px;
    font-size: 22px;
  }
  .upgrades {
    top: 65%;
  }
  .card {
    padding: 4px;
  }
  .menu-middle {
    top: 46%;
  }
  .play {
    font-size: 19px;
    padding: 9px 25px;
  }
  .home-title {
    font-size: 12px;
  }
  .game-title {
    font-size: 14px;
    margin: 5px;
  }
  .buy {
    padding: 5px;
  }
  .instruction {
    bottom: 8px;
  }
}

/* All controls use the same icon box; no font fallback or baseline drift. */
.round,
.controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.icon {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
  pointer-events: none;
}
.round .icon {
  width: 23px;
  height: 23px;
}
.small-round .icon {
  width: 18px;
  height: 18px;
}
.symbol .icon {
  width: 32px;
  height: 32px;
}
.card {
  display: grid;
  grid-template-rows: 18px 23px 40px 34px;
  align-items: center;
  justify-items: center;
}
.card label,
.card b {
  margin: 0;
  line-height: 1;
}
.card .symbol {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.buy {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
  padding: 0;
}
.buy .icon {
  width: 18px;
  height: 18px;
}
.wallet {
  height: 36px;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cash-icon {
  background: none;
  border: 0;
  transform: none;
  width: 28px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cash-icon .icon {
  width: 28px;
  height: 24px;
}
.run-stats {
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 8px;
}
.run-stats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 23px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.healthline {
  min-height: 17px;
  align-items: center;
}
.level-track {
  top: calc(max(15px, env(safe-area-inset-top)) + 130px);
}
.game-title {
  line-height: 1.2;
  min-height: 21px;
}
.controls {
  pointer-events: none;
}
.controls button {
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.controls button:active,
.controls button.pressed {
  background: #7da5d3cc;
  transform: translateY(1px);
}
.controls .icon {
  width: 22px;
  height: 22px;
}
.screen:has(~ .modal:not([hidden])) {
  pointer-events: none;
}
.top-right {
  align-items: center;
}
.setting {
  min-height: 32px;
}
.setting input {
  margin: 0;
}
.play {
  line-height: 1.1;
}
.buy:disabled {
  opacity: 0.8;
}
.buy:disabled .icon {
  opacity: 0.7;
}
@media (max-height: 640px) {
  .card {
    grid-template-rows: 16px 20px 28px 29px;
  }
  .symbol .icon {
    width: 25px;
    height: 25px;
  }
  .buy {
    height: 27px;
  }
  .level-track {
    top: 136px;
  }
}
