* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; position: fixed; inset: 0;
  background: #7cc25a; touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
canvas { position: fixed; inset: 0; display: block; touch-action: none; width: 100%; height: 100%; }
#hud { position: fixed; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 12px) 0 calc(env(safe-area-inset-left) + 12px); pointer-events: none; }
#btns { display: flex; gap: 8px; pointer-events: auto; }
#btns button { width: 44px; height: 44px; border-radius: 22px; border: 0; padding: 10px; background: rgba(35,55,30,.5); color: #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,.18); touch-action: manipulation; }
#btns button svg { width: 24px; height: 24px; display: block; }
#btns button svg[hidden] { display: none; }
#btns button:active { transform: scale(.92); }
#right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#money { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 8px; border-radius: 23px;
  background: rgba(35,55,30,.55); color: #fff; font-weight: 900; font-size: 26px; box-shadow: 0 3px 0 rgba(0,0,0,.18);
  text-shadow: 0 2px 0 rgba(0,0,0,.25); transition: transform .08s; min-width: 92px; justify-content: flex-end; }
#money.bump { transform: scale(1.12); }
.bill { width: 38px; height: 24px; border-radius: 4px; flex: none; position: relative;
  background: linear-gradient(180deg, #7fe38a, #3fbf5a); box-shadow: inset 0 0 0 2.5px #2c9447, 0 2px 0 rgba(0,0,0,.2); }
.bill::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%;
  background: #2c9447; box-shadow: 0 0 0 2px #a6f0ad; }
#area { font-size: 13px; font-weight: 800; color: #fff; padding: 2px 10px; border-radius: 10px; background: rgba(35,55,30,.35); }
#hint { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 72px); transform: translateX(-50%); max-width: 84vw;
  padding: 10px 18px; border-radius: 18px; text-align: center; background: rgba(255,255,255,.93); color: #2d4a1e; font-weight: 800;
  font-size: 17px; box-shadow: 0 4px 0 rgba(0,0,0,.15); pointer-events: none; transition: opacity .25s; }
#hint:empty { opacity: 0; }
#banner { position: fixed; left: 50%; top: 30%; transform: translate(-50%,-50%) scale(.6); opacity: 0; padding: 12px 24px; border-radius: 22px;
  white-space: nowrap; font-weight: 900; font-size: 25px; color: #fff; pointer-events: none; text-shadow: 0 2px 0 rgba(0,0,0,.25);
  box-shadow: 0 5px 0 rgba(0,0,0,.2); transition: transform .18s cubic-bezier(.3,1.6,.5,1), opacity .18s; }
#banner.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
#banner.bad { background: #e5484d; } #banner.good { background: #31a24c; } #banner.gold { background: linear-gradient(180deg,#ffcf3f,#f29a00); }
#banner.shake { animation: shake .35s; }
@keyframes shake { 0%,100% { margin-left: 0 } 20% { margin-left: -10px } 40% { margin-left: 10px } 60% { margin-left: -7px } 80% { margin-left: 6px } }
#modal { position: fixed; inset: 0; background: rgba(15,30,10,.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
#modal.hidden { display: none; }
#modal .card { width: 100%; max-width: 340px; background: #fffaf0; border-radius: 26px; padding: 22px 20px 18px; text-align: center; box-shadow: 0 8px 0 rgba(0,0,0,.2); color: #3b2a1a; }
#modal h2 { margin: 0 0 8px; font-size: 24px; font-weight: 900; color: #2f7d32; }
#modal p { margin: 0 0 16px; font-size: 17px; line-height: 1.35; font-weight: 600; }
#modal .row { display: flex; flex-direction: column; gap: 10px; }
#modal button { border: 0; border-radius: 16px; padding: 14px; font-size: 18px; font-weight: 900; font-family: inherit; background: #3fb950; color: #fff; box-shadow: 0 4px 0 #2a8a39; touch-action: manipulation; }
#modal button.sec { background: #ece3d0; color: #5a4630; box-shadow: 0 4px 0 #cfc2a8; }
#modal button.danger { background: #e5484d; box-shadow: 0 4px 0 #b3343a; }
#rotate { display: none; position: fixed; inset: 0; background: #7cc25a; color: #fff; font-weight: 900; font-size: 26px; align-items: center; justify-content: center; text-align: center; z-index: 9; }
#rotate small { font-size: 16px; font-weight: 700; }
@media (orientation: landscape) and (max-height: 500px) { #rotate { display: flex; } }
#err { position: fixed; left: 10px; right: 10px; bottom: 10px; color: #fff; background: #b3343a; border-radius: 12px; padding: 10px; font-size: 14px; display: none; }
