                                                                                

* {
  box-sizing: border-box;
}

html, body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #140d0a;
  touch-action: none;
  user-select: none;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  font-family: system-ui, sans-serif;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #140d0a;
}

.hidden {
  display: none !important;
}

                 

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

#hud-top {
  display: flex;
  justify-content: flex-end;
  padding-top: calc(env(safe-area-inset-top) + 10px);
  padding-right: calc(env(safe-area-inset-right) + 14px);
}

#money {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(160deg, rgba(40, 26, 18, 0.85), rgba(20, 13, 10, 0.7));
  border: 1px solid rgba(255, 200, 36, 0.35);
  border-radius: clamp(12px, 3vmin, 20px);
  padding: clamp(6px, 1.6vmin, 12px) clamp(12px, 2.6vmin, 18px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease-out;
}

                                                                                     
#money.bump {
  transform: scale(1.08);
}

                                                                        
.coin-icon {
  width: clamp(16px, 3.6vmin, 22px);
  height: clamp(16px, 3.6vmin, 22px);
  border-radius: 50%;
  flex: none;
  background: radial-gradient(circle at 35% 30%, #fff3c8, #ffc824 55%, #b8720e 100%);
  border: 2px solid #7a4a08;
  box-shadow: inset 0 0 0 2px rgba(255, 243, 200, 0.55);
}

#money-amount {
  font-size: clamp(18px, 4.6vmin, 28px);
  font-weight: 800;
  color: #ffc824;
  text-shadow: 0 0 10px rgba(255, 140, 26, 0.6), 0 2px 2px rgba(0, 0, 0, 0.6);
}

                                                                                      
                                                                
#pile-value {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: clamp(12px, 2.6vmin, 15px);
  font-weight: 700;
  color: #ffe9b8;
  background: rgba(20, 13, 10, 0.6);
  border: 1px solid rgba(255, 200, 36, 0.3);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

                           
                                                                               
                                                                                  
                                                                                
                                                                                    
#joystick {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 233, 184, 0.08);
  border: 2px solid rgba(255, 200, 36, 0.4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s linear;
  z-index: 15;
}

#joystick.is-visible {
  opacity: 1;
}

#joystick-knob {
  position: absolute;
  left: 34px;
  top: 34px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 200, 36, 0.85), rgba(184, 114, 14, 0.85));
  border: 1px solid rgba(255, 243, 200, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

                

#fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: #ffc824;
  z-index: 30;
}

                         

#title-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: radial-gradient(120% 90% at 50% 20%, #2a1a10 0%, #140d0a 60%, #0c0705 100%);
}

#title-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2.6vmin, 18px);
  width: min(88vmin, 92%);
  padding: clamp(20px, 5vmin, 36px);
  border-radius: clamp(20px, 5vmin, 32px);
  background: linear-gradient(165deg, rgba(56, 34, 20, 0.9), rgba(20, 13, 10, 0.92));
  border: 1px solid rgba(255, 200, 36, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#title-heading {
  margin: 0;
  font-size: clamp(38px, 12vmin, 68px);
  font-weight: 900;
  letter-spacing: 0.03em;
  text-align: center;
  color: #ffc824;
  background: linear-gradient(180deg, #fff3c8, #ffc824 45%, #ff8c1a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 0 rgba(120, 40, 10, 0.4), 0 10px 24px rgba(255, 140, 26, 0.35);
}

#title-sub {
  margin: 0;
  text-align: center;
  font-size: clamp(13px, 2.8vmin, 17px);
  color: rgba(255, 233, 184, 0.65);
}

#title-money {
  display: flex;
  align-items: center;
  gap: 8px;
}

#title-money-amount {
  font-size: clamp(18px, 4.4vmin, 26px);
  font-weight: 800;
  color: #ffc824;
  text-shadow: 0 0 10px rgba(255, 140, 26, 0.5);
}

#btn-play {
  width: 100%;
  min-height: 72px;
  border: none;
  border-radius: clamp(18px, 4.4vmin, 28px);
  font-size: clamp(20px, 5vmin, 28px);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #2a1206;
  background: linear-gradient(160deg, #ffe07a, #ffc824 40%, #ff8c1a 100%);
  box-shadow: 0 10px 0 #b85c0e, 0 16px 30px rgba(255, 140, 26, 0.45);
  animation: btn-pulse 1.8s ease-in-out infinite;
}

#btn-play:active {
  transform: translateY(4px) scale(0.98);
  box-shadow: 0 6px 0 #b85c0e, 0 10px 20px rgba(255, 140, 26, 0.4);
}

@keyframes btn-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}
