:root {
  color-scheme: light;
  --design-width: 750;
  --design-height: 1334;
  --ink: #1f241f;
  --muted: #5f665d;
  --green: #299b35;
  --green-dark: #1b7d28;
  --red: #d2392f;
  --cream: rgba(255, 253, 245, 0.92);
  --shadow: 0 18px 46px rgba(39, 27, 18, 0.24);
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #241913;
  overflow: hidden;
  user-select: none;
}

button {
  font: inherit;
}

.game-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 233, 190, 0.18), transparent 34%),
    #241913;
}

.game-canvas {
  position: relative;
  width: min(100vw, calc(100svh * 750 / 1334));
  height: min(100svh, calc(100vw * 1334 / 750));
  aspect-ratio: 750 / 1334;
  overflow: hidden;
  background: #f6d6a4;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), var(--shadow);
}

.scene-layer,
.asset-button,
.customer-stage,
.receipt-display,
.price-card,
.change-tray,
.tray-actions,
.complaint-stage,
.action-row,
.hud-panel {
  position: absolute;
}

.scene-layer {
  left: 0;
  width: 100%;
  pointer-events: none;
  transform: translateZ(0);
}

.scene-backdrop {
  top: 0;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.scene-counter {
  left: 0;
  bottom: 0;
  z-index: 4;
}

.hud-panel {
  left: 3.2%;
  right: 3.2%;
  top: 1.8%;
  z-index: 9;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.4%;
}

.hud-item {
  min-height: 56px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 6px 4px;
  border: 2px solid rgba(91, 59, 30, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 235, 0.84);
  box-shadow: 0 5px 12px rgba(89, 55, 22, 0.13);
}

.hud-item span {
  color: var(--muted);
  font-size: clamp(10px, 2.6vw, 15px);
  font-weight: 800;
}

.hud-item strong {
  margin-top: 1px;
  color: #141b14;
  font-size: clamp(16px, 4.4vw, 25px);
  line-height: 1;
}

.complaint-hud strong {
  color: var(--red);
}

.exit-button {
  width: 100%;
  border-color: rgba(145, 34, 27, 0.42);
  color: white;
  background: var(--red);
  font: inherit;
  cursor: pointer;
  letter-spacing: 0;
}

.exit-button span,
.exit-button strong {
  color: white;
}

.exit-button:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}

.game-copyright {
  position: fixed;
  left: 50%;
  bottom: 6px;
  z-index: 30;
  margin: 0;
  color: rgba(255, 253, 245, 0.68);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.customer-stage {
  left: calc(560 / 750 * 100%);
  top: calc(1020 / 1334 * 100%);
  z-index: 2;
  width: calc(var(--customer-design-width, 250) / 750 * 100%);
  transform: translate(-50%, -100%);
  transform-origin: center bottom;
  backface-visibility: hidden;
  will-change: transform, opacity;
}

.customer-stage.entering {
  animation: customer-entry-bob 560ms cubic-bezier(0.2, 0.8, 0.22, 1.05);
}

.customer-stage.leaving {
  animation: customer-leave 760ms ease-in forwards;
}

.customer-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  transform: translateZ(0);
}

.patience-wrap {
  position: absolute;
  left: 50%;
  top: -3.8%;
  width: 62%;
  height: 14px;
  padding: 2px;
  border: 2px solid rgba(86, 54, 25, 0.4);
  border-radius: 999px;
  background: rgba(255, 251, 235, 0.9);
  transform: translateX(-50%);
  z-index: 2;
}

.patience-bar {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #35b64a, #f2ba2e);
  transform-origin: left center;
  transition: transform 180ms linear, background 160ms linear;
}

.patience-bar.warning {
  background: linear-gradient(90deg, #f2ba2e, #e67c2f);
}

.patience-bar.low {
  background: linear-gradient(90deg, #f2ba2e, #d43b30);
}

.receipt-display {
  left: calc(181 / 750 * 100%);
  top: calc(643 / 1334 * 100%);
  z-index: 6;
  width: calc(176 / 750 * 100%);
  height: calc(200 / 1334 * 100%);
  padding: calc(9 / 1334 * 100%) calc(9 / 750 * 100%);
  transform: translate(-50%, -100%);
  border-radius: 6px;
  color: #21313a;
  background: rgba(214, 244, 252, 0.76);
  box-shadow: inset 0 0 0 2px rgba(90, 126, 143, 0.2);
  overflow: hidden;
}

.receipt-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(76, 103, 117, 0.28);
  font-size: clamp(8px, 2.25vw, 12px);
  font-weight: 900;
}

.items-list {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: clamp(8px, 2.15vw, 11px);
  font-weight: 800;
}

.items-list li {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  padding: 0 2px;
  border-radius: 4px;
  background: transparent;
  line-height: 1.22;
  white-space: nowrap;
}

.items-list li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-card {
  z-index: 6;
  width: calc(var(--price-card-w, 108) / 750 * 100%);
  height: calc(var(--price-card-h, 80) / 1334 * 100%);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 4px 3px;
  transform: translate(-50%, -100%);
  border-radius: 8px;
  color: #273032;
  background: rgba(244, 252, 255, 0.82);
  overflow: hidden;
}

.price-card span {
  font-size: clamp(8px, 2.25vw, 12px);
  font-weight: 1000;
  line-height: 1.05;
  white-space: nowrap;
}

.price-card strong {
  font-size: clamp(12px, 3.1vw, 17px);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.receipt-total {
  --price-card-w: 118;
  --price-card-h: 98;
  left: calc(332 / 750 * 100%);
  top: calc(541 / 1334 * 100%);
}

.paid-line {
  --price-card-w: 118;
  --price-card-h: 98;
  left: calc(332 / 750 * 100%);
  top: calc(643 / 1334 * 100%);
}

.paid-line strong {
  font-size: clamp(12px, 3.1vw, 17px);
}

.change-tray {
  left: 50%;
  top: calc(896 / 1334 * 100%);
  z-index: 7;
  width: 86.6667%;
  transform: translate(-50%, -100%);
  color: #111;
}

.change-tray > img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.8;
  pointer-events: none;
}

.tray-actions {
  position: absolute;
  inset: 0;
  z-index: 16;
  pointer-events: none;
}

.tray-image-button {
  position: absolute;
  width: calc(120 / 750 * 100%);
  height: calc(76 / 1334 * 100%);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -100%);
  transform-origin: center bottom;
}

.tray-image-button img {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: block;
  width: 80%;
  height: 73.6842%;
  object-fit: contain;
  pointer-events: none;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 6px rgba(80, 47, 22, 0.22));
}

.tray-image-button:active img {
  transform: translateX(-50%) translateY(2px) scale(0.97);
  filter: drop-shadow(0 2px 3px rgba(80, 47, 22, 0.18)) brightness(0.98);
}

.undo-action {
  left: calc(642 / 750 * 100%);
  top: calc(800 / 1334 * 100%);
}

.clear-action {
  left: calc(642 / 750 * 100%);
  top: calc(880 / 1334 * 100%);
}

.selected-list {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.selected-money {
  position: absolute;
  left: calc(var(--selected-x) / 750 * 100%);
  top: calc(840 / 1334 * 100%);
  width: calc(var(--selected-w) / 750 * 100%);
  height: auto;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 3px 3px rgba(61, 39, 22, 0.22));
  backface-visibility: hidden;
}

.feedback {
  position: absolute;
  left: 10%;
  right: 17%;
  bottom: 7.5%;
  margin: 0;
  color: #2e352e;
  font-size: clamp(10px, calc(min(100vw, calc(100svh * 750 / 1334)) * 22 / 750), 17px);
  font-weight: 900;
  line-height: 1.12;
  text-align: center;
  text-wrap: balance;
}

.feedback.good {
  color: var(--green-dark);
}

.feedback.bad {
  color: var(--red);
}

.money-layer {
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: transparent;
}

.asset-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -100%);
  transform-origin: center bottom;
  z-index: 1;
}

.asset-button img {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(58, 37, 20, 0.16));
  transform: translateX(-50%);
  transform-origin: center bottom;
  backface-visibility: hidden;
}

.asset-button.is-hit {
  z-index: 5;
  animation: money-hit-thump 340ms cubic-bezier(0.2, 0.8, 0.22, 1.1);
}

.asset-button.is-hit img {
  animation: money-pop-hit 340ms cubic-bezier(0.2, 0.8, 0.22, 1.1);
}

.complaint-stage {
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.complaint-stack {
  display: none;
}

.complaint-icon {
  width: clamp(42px, 12vw, 66px);
  height: auto;
  filter: drop-shadow(0 5px 9px rgba(80, 35, 23, 0.32));
}

.complaint-pop {
  position: absolute;
  left: 50%;
  top: 46%;
  width: clamp(88px, 26vw, 140px);
  height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 8px 13px rgba(80, 35, 23, 0.38));
}

.complaint-pop.hidden {
  display: none;
}

.complaint-pop.popping {
  display: block;
  animation: complaint-fly-away 1760ms cubic-bezier(0.22, 0.72, 0.26, 1) forwards;
}

.action-row {
  left: 0;
  right: 0;
  bottom: 3.8%;
  z-index: 14;
  display: flex;
  justify-content: center;
  gap: 5%;
  padding: 0 6%;
}

.primary-button,
.secondary-button {
  flex: 0 0 42%;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: clamp(18px, 4.6vw, 26px);
  font-weight: 1000;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(59, 38, 20, 0.22);
}

.primary-button {
  color: white;
  background: var(--green);
}

.secondary-button {
  color: var(--green);
  background: white;
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(30, 24, 18, 0.48);
}

.overlay.hidden {
  display: none;
}

.start-overlay {
  padding: 0;
  place-items: stretch;
  background:
    linear-gradient(180deg, rgba(255, 247, 218, 0.18), rgba(38, 24, 15, 0.24)),
    rgba(30, 24, 18, 0.16);
}

.start-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.start-panel {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transform: translateZ(0);
}

.start-image-button {
  position: absolute;
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -100%);
  transform-origin: center bottom;
}

.start-image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 7px 10px rgba(74, 43, 18, 0.22));
}

.start-image-button:active {
  transform: translate(-50%, calc(-100% + 2px)) scale(0.985);
}

.start-game-button {
  left: calc(375 / 750 * 100%);
  top: calc(1030 / 1334 * 100%);
  width: calc(300 / 750 * 100%);
  height: calc(120 / 1334 * 100%);
}

.game-rules-button {
  left: calc(375 / 750 * 100%);
  top: calc(1186 / 1334 * 100%);
  width: calc(300 / 750 * 100%);
  height: calc(120 / 1334 * 100%);
}

.leaderboard-button {
  left: calc(663 / 750 * 100%);
  top: calc(1260 / 1334 * 100%);
  width: calc(138 / 750 * 100%);
  height: calc(120 / 1334 * 100%);
}

.leaderboard-button img {
  filter: drop-shadow(0 7px 10px rgba(74, 43, 18, 0.24));
}

.start-leaderboard-modal {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 7.4%;
  background: rgba(38, 25, 17, 0.42);
  backdrop-filter: blur(2px);
}

.start-leaderboard-modal.is-hidden {
  display: none;
}

.start-leaderboard-panel {
  position: relative;
  width: min(100%, 520px);
  padding: 22px 20px 18px;
  overflow: hidden;
  border: 3px solid rgba(132, 80, 34, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 252, 243, 0.98) 0%, rgba(255, 241, 207, 0.96) 100%);
  box-shadow: 0 22px 48px rgba(59, 34, 16, 0.28);
}

.start-leaderboard-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 218, 115, 0.38), transparent 25%),
    radial-gradient(circle at 92% 4%, rgba(255, 146, 66, 0.2), transparent 28%);
  pointer-events: none;
}

.start-leaderboard-close {
  position: absolute;
  right: 14px;
  top: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(120, 73, 34, 0.18);
  border-radius: 999px;
  color: #6f4220;
  background: rgba(255, 255, 255, 0.74);
  font-size: 24px;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
}

.start-leaderboard-title {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  margin-bottom: 8px;
  text-align: center;
}

.start-leaderboard-title span {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  color: #a64f1e;
  background: rgba(255, 225, 165, 0.76);
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 1000;
}

.start-leaderboard-title h3 {
  margin: 0;
  color: #2c2118;
  font-size: clamp(28px, 7.2vw, 40px);
  line-height: 1.05;
}

#startLeaderboardCount {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 12px;
  color: #6b604f;
  font-size: clamp(12px, 3.3vw, 16px);
  font-weight: 900;
  text-align: center;
}

.start-leaderboard-list {
  position: relative;
  z-index: 1;
  gap: 8px;
}

.start-leaderboard-list .leaderboard-item {
  grid-template-columns: 34px minmax(0, 1fr) minmax(58px, auto);
  min-height: 46px;
  padding: 8px 10px;
  border: 2px solid rgba(122, 77, 38, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 12px rgba(95, 58, 25, 0.08);
  font-size: clamp(13px, 3.6vw, 17px);
}

.start-leaderboard-list .leaderboard-rank {
  width: 30px;
  height: 30px;
  box-shadow: inset 0 -2px 0 rgba(63, 35, 14, 0.16);
  background: #9d7047;
}

.start-leaderboard-list .leaderboard-meta {
  display: none;
}

.start-leaderboard-list .leaderboard-score {
  color: #a64f1e;
  font-size: clamp(16px, 4.4vw, 22px);
  font-weight: 1000;
}

.start-leaderboard-list .leaderboard-item:nth-child(1) {
  border-color: rgba(229, 168, 50, 0.42);
  background: linear-gradient(135deg, rgba(255, 247, 212, 0.96), rgba(255, 226, 143, 0.82));
}

.start-leaderboard-list .leaderboard-item:nth-child(2) {
  border-color: rgba(160, 163, 170, 0.34);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(224, 229, 232, 0.78));
}

.start-leaderboard-list .leaderboard-item:nth-child(3) {
  border-color: rgba(184, 110, 58, 0.34);
  background: linear-gradient(135deg, rgba(255, 242, 225, 0.94), rgba(232, 173, 116, 0.76));
}

.start-leaderboard-list .leaderboard-item:nth-child(1) .leaderboard-rank {
  background: #d8a524;
}

.start-leaderboard-list .leaderboard-item:nth-child(2) .leaderboard-rank {
  background: #9098a3;
}

.start-leaderboard-list .leaderboard-item:nth-child(3) .leaderboard-rank {
  background: #ba7138;
}

.dialog {
  width: min(86%, 430px);
  padding: 24px;
  border: 2px solid rgba(88, 53, 24, 0.18);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
  text-align: center;
}

#resultOverlay .dialog {
  max-height: min(92svh, 820px);
  overflow-y: auto;
}

.rules-overlay {
  background: rgba(30, 24, 18, 0.58);
}

.rules-dialog {
  width: min(90%, 470px);
  padding: 20px;
}

.dialog h1,
.dialog h2,
.dialog p,
.dialog dl {
  margin: 0;
}

.dialog h1,
.dialog h2 {
  font-size: clamp(28px, 8vw, 42px);
  line-height: 1.1;
}

.rules-dialog h2 {
  font-size: clamp(25px, 6.4vw, 36px);
}

.dialog p {
  margin: 14px 0 18px;
  color: #414940;
  font-size: clamp(15px, 4vw, 20px);
  font-weight: 800;
  line-height: 1.55;
}

.rules-demo {
  position: relative;
  height: min(38svh, 280px);
  margin: 16px 0 14px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(159, 223, 239, 0.62), rgba(255, 238, 184, 0.7)),
    #f7e1a9;
  box-shadow: inset 0 0 0 2px rgba(92, 62, 31, 0.14);
}

.rules-receipt,
.rules-paid {
  position: absolute;
  top: 8%;
  width: 34%;
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 7px 13px rgba(76, 48, 24, 0.16);
}

.rules-receipt {
  left: 8%;
}

.rules-paid {
  right: 8%;
}

.rules-receipt span,
.rules-paid span,
.rules-tray span {
  color: #415046;
  font-size: clamp(11px, 3vw, 15px);
  font-weight: 900;
}

.rules-receipt strong,
.rules-paid strong {
  color: #1a251e;
  font-size: clamp(18px, 5vw, 26px);
  line-height: 1;
}

.rules-money {
  position: absolute;
  z-index: 2;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 7px 8px rgba(61, 39, 22, 0.22));
}

.rules-money-one {
  left: 18%;
  top: 52%;
  width: 31%;
  animation: rules-money-one 2600ms ease-in-out infinite;
}

.rules-money-five {
  left: 55%;
  top: 56%;
  width: 13%;
  animation: rules-money-five 2600ms ease-in-out infinite;
}

.rules-tray {
  position: absolute;
  left: 50%;
  bottom: 5%;
  width: 78%;
  transform: translateX(-50%);
}

.rules-tray img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.86;
  pointer-events: none;
}

.rules-tray span {
  position: absolute;
  left: 50%;
  top: 49%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.rules-list {
  display: grid;
  gap: 7px;
  margin: 0 0 16px;
  padding: 0 0 0 1.35em;
  color: #374039;
  text-align: left;
  font-size: clamp(14px, 3.6vw, 18px);
  font-weight: 850;
  line-height: 1.34;
}

.dialog-actions {
  display: flex;
  gap: 12px;
}

.dialog-button {
  flex: 1 1 0;
  min-height: 50px;
  font-size: clamp(16px, 4.1vw, 22px);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.result-grid div {
  padding: 10px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.result-grid dt {
  color: #5b625a;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 800;
}

.result-grid dd {
  margin: 4px 0 0;
  font-size: clamp(24px, 7vw, 36px);
  font-weight: 1000;
}

.leaderboard-form {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  text-align: left;
}

.leaderboard-form label {
  color: #4b554c;
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 900;
}

.nickname-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(82px, 30%);
  gap: 8px;
}

.nickname-row input {
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 2px solid rgba(88, 53, 24, 0.2);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  font: inherit;
  font-size: clamp(16px, 4.2vw, 20px);
  font-weight: 900;
  outline: none;
}

.nickname-row input:focus {
  border-color: rgba(41, 155, 53, 0.72);
  box-shadow: 0 0 0 3px rgba(41, 155, 53, 0.14);
}

.nickname-button {
  flex: none;
  min-height: 48px;
  padding: 0 10px;
  font-size: clamp(15px, 4vw, 19px);
}

.dialog .leaderboard-note {
  min-height: 1.25em;
  margin: 0;
  color: #5c665d;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 800;
  line-height: 1.25;
}

.leaderboard-panel {
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 0 0 2px rgba(88, 53, 24, 0.1);
}

.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.leaderboard-head h3 {
  margin: 0;
  font-size: clamp(19px, 5vw, 25px);
  line-height: 1;
}

.leaderboard-head span {
  color: #617062;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 900;
  white-space: nowrap;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 42px;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 253, 245, 0.72);
  color: #253026;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 850;
}

.leaderboard-rank {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: white;
  background: var(--green);
  font-weight: 1000;
}

.leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.leaderboard-meta {
  color: #687268;
  font-size: clamp(10px, 2.8vw, 13px);
  white-space: nowrap;
}

.leaderboard-score {
  color: var(--green-dark);
  font-size: clamp(14px, 3.8vw, 18px);
  text-align: right;
}

.leaderboard-empty {
  display: grid;
  gap: 3px;
  padding: 14px 12px;
  border-radius: 8px;
  color: #667066;
  background: rgba(255, 253, 245, 0.72);
  text-align: left;
}

.leaderboard-empty strong {
  color: #293128;
  font-size: clamp(14px, 3.7vw, 17px);
  font-weight: 1000;
}

.leaderboard-empty span {
  color: #687268;
  font-size: clamp(12px, 3.2vw, 15px);
  font-weight: 850;
  line-height: 1.35;
}

.start-leaderboard-list .leaderboard-empty {
  padding: 16px 14px;
  border: 2px dashed rgba(151, 100, 52, 0.28);
  background: rgba(255, 255, 255, 0.64);
  text-align: center;
}

.leaderboard-more {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  font-size: clamp(14px, 3.8vw, 18px);
}

.leaderboard-more.hidden {
  display: none;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: default;
  opacity: 0.58;
}

@keyframes customer-entry-bob {
  0% {
    transform: translate(-50%, -96%) scale(0.98);
  }

  42% {
    transform: translate(-50%, -104%) scale(1.02);
  }

  72% {
    transform: translate(-50%, -99%) scale(1);
  }

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

@keyframes customer-leave {
  0% {
    transform: translate(-50%, -100%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-35%, -100%) scale(0.98);
    opacity: 0;
  }
}

@keyframes money-pop-hit {
  0% {
    filter: drop-shadow(0 2px 2px rgba(58, 37, 20, 0.16));
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
  }

  42% {
    filter: drop-shadow(0 13px 8px rgba(58, 37, 20, 0.36)) brightness(1.16);
    transform: translateX(-50%) translateY(-20px) scale(1.14) rotate(-2deg);
  }

  68% {
    filter: drop-shadow(0 7px 5px rgba(58, 37, 20, 0.28)) brightness(1.08);
    transform: translateX(-50%) translateY(4px) scale(0.98) rotate(1deg);
  }

  100% {
    filter: drop-shadow(0 2px 2px rgba(58, 37, 20, 0.16));
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
  }
}

.is-safari .game-canvas {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 28px rgba(39, 27, 18, 0.2);
}

.is-safari .asset-button img,
.is-safari .selected-money,
.is-safari .tray-image-button img,
.is-safari .start-image-button img,
.is-safari .rules-money,
.is-safari .complaint-pop {
  filter: none;
}

.is-safari .asset-button.is-hit {
  animation: money-hit-thump 220ms ease-out;
}

.is-safari .asset-button.is-hit img {
  animation: safari-money-pop-hit 220ms ease-out;
}

@keyframes safari-money-pop-hit {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
  }

  55% {
    transform: translateX(-50%) translateY(-12px) scale(1.06);
  }

  100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes money-hit-thump {
  0% {
    transform: translate(-50%, -100%);
  }

  50% {
    transform: translate(-50%, calc(-100% - 4px));
  }

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

@keyframes complaint-fly-away {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }

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

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

  100% {
    transform: translate(210%, -250%) scale(0.46) rotate(10deg);
    opacity: 0;
  }
}

@keyframes rules-money-one {
  0%,
  18% {
    transform: translate(-40%, -10%) rotate(-3deg) scale(0.92);
    opacity: 0;
  }

  38%,
  74% {
    transform: translate(82%, -42%) rotate(2deg) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(82%, -42%) rotate(2deg) scale(1);
    opacity: 0;
  }
}

@keyframes rules-money-five {
  0%,
  34% {
    transform: translate(-210%, -6%) scale(0.88);
    opacity: 0;
  }

  54%,
  74% {
    transform: translate(-58%, -35%) scale(1.08);
    opacity: 1;
  }

  100% {
    transform: translate(-58%, -35%) scale(1.08);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
