/* Fill the whole screen and stop the browser from scrolling, zooming,
   pull-to-refresh, text selection, and long-press menus. */
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #14141a;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  touch-action: none;
}

/* First-time hint, just above the cash stack; fades out after the first throw */
#hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(27vmin + 24px + env(safe-area-inset-bottom));
  text-align: center;
  font: 700 18px/1.3 system-ui, sans-serif;
  color: #ffffffd9;
  text-shadow: 0 2px 8px #000c;
  pointer-events: none;
  transition: opacity 0.6s;
}
#hint .arrow {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 4px;
  animation: bob 1.1s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(6px); opacity: 0.5; }
  50%      { transform: translateY(-8px); opacity: 1; }
}

/* "$ thrown" counter, kept below the iPhone notch */
#counter {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(10px + env(safe-area-inset-top));
  padding: 8px 22px 9px;
  border-radius: 20px;
  background: rgba(14, 10, 8, 0.62);     /* dark backing so it stays readable over a pile of cash */
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  text-shadow: 0 2px 0 #0008, 0 0 18px #0009;
}
#amount {
  font: 400 clamp(40px, 13vw, 72px)/1 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
  letter-spacing: 1px;
  color: #b8f5a0;
}
#counter .label {
  font: 700 13px/1 system-ui, sans-serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ffffffb3;
  margin-top: 4px;
}
#amount.pop { animation: pop 0.25s ease-out; }
@keyframes pop {
  0%   { transform: scale(1.18); color: #f4ffb0; }
  100% { transform: scale(1); }
}

/* Invisible helper: lets the code read how big the notch / home-bar areas are */
#safe {
  position: fixed;
  visibility: hidden;
  pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Test readout (fps and bill counts). Only shown when the link ends in ?debug */
#debug {
  position: fixed;
  bottom: calc(6px + env(safe-area-inset-bottom));
  left: calc(6px + env(safe-area-inset-left));
  right: calc(6px + env(safe-area-inset-right));
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  white-space: pre-wrap;
  font: 12px/1.35 ui-monospace, Menlo, monospace;
  color: #7CFC9A;
  pointer-events: none;
}

/* Title screen: one tap starts the game (and switches sound on; iPhones require a tap) */
#start {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at center, rgba(20, 14, 10, 0.55), rgba(8, 5, 4, 0.92));
  cursor: pointer;
  transition: opacity 0.35s;
}
#start.gone { opacity: 0; pointer-events: none; }
#start .title {
  font: 400 clamp(56px, 19vw, 120px)/0.95 'Anton', Impact, 'Arial Narrow Bold', sans-serif;
  letter-spacing: 2px;
  color: #b8f5a0;
  text-shadow: 0 4px 0 #0009, 0 0 30px #000c;
}
#start .emoji { font-size: 0.7em; vertical-align: 0.1em; }
#start .tap {
  font: 700 22px/1 system-ui, sans-serif;
  color: #fff;
  padding: 14px 28px;
  border-radius: 999px;
  background: rgba(184, 245, 160, 0.16);
  border: 2px solid rgba(184, 245, 160, 0.6);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
#start .sub {
  font: 500 14px/1.4 system-ui, sans-serif;
  color: #ffffffa6;
}
