* { 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; }

#hint { top: calc(env(safe-area-inset-top) + 128px); }
#area { font-size: 12px; }
#goalCount { font-size: 11px; font-weight: 800; color: #fff; padding: 1px 8px; border-radius: 9px; background: rgba(35,55,30,.3); }
#goal { position: fixed; left: calc(env(safe-area-inset-left) + 12px); top: calc(env(safe-area-inset-top) + 62px); display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center;
  padding: 6px 12px 8px; border-radius: 16px; background: rgba(255,255,255,.92); color: #2d4a1e; box-shadow: 0 3px 0 rgba(0,0,0,.15); pointer-events: none; max-width: 62vw; }
#goal .gl { grid-column: 1 / 3; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: #6d8a5a; }
#goal .gt { font-size: 15px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#goal .gc { font-size: 15px; font-weight: 900; display: flex; align-items: center; gap: 4px; color: #2c8a40; }
#goal .gb { grid-column: 1 / 3; height: 6px; border-radius: 3px; background: #dfe9d6; overflow: hidden; margin-top: 4px; }
#goal .gb i { display: block; height: 100%; background: linear-gradient(90deg, #5fd06a, #2fa84a); border-radius: 3px; transition: width .3s; }
#goal.ready { background: #fff7c2; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; white-space: nowrap; font-weight: 900; color: #fff; border-radius: 12px; padding: 2px 8px; text-shadow: 0 1px 0 rgba(0,0,0,.3); will-change: transform; }
.tag.carry { font-size: 17px; background: rgba(40,40,60,.72); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.tag.carry small { font-size: 12px; opacity: .85; }
.tag.carry.full { background: #ff3b3b; animation: glow .5s infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 0 0 rgba(255,59,59,.6); } to { box-shadow: 0 0 0 6px rgba(255,59,59,0); } }
.tag.cash { font-size: 15px; background: #2c9447; display: flex; align-items: center; gap: 4px; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.tag.emp { font-size: 12px; background: rgba(40,40,60,.6); padding: 1px 6px 1px 2px; }
.tag.emp .lv { display: inline-block; padding: 0 5px; border-radius: 8px; background: #8a97a8; margin-right: 2px; }
.tag.emp .lv.l2 { background: #31a24c; } .tag.emp .lv.l3 { background: #2f80ed; } .tag.emp .lv.l4 { background: #8e44ad; } .tag.emp .lv.l5 { background: linear-gradient(180deg,#ffcf3f,#f29a00); color: #5a3500; text-shadow: none; }
.mini-bill { display: inline-block; width: 18px; height: 11px; border-radius: 2px; background: linear-gradient(180deg,#8ff09a,#4fcf68); box-shadow: inset 0 0 0 1.5px #1f7a36; vertical-align: middle; }
