* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe9fb; touch-action: none; overscroll-behavior: none; }
body { font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; font-variant-numeric: tabular-nums; color: #1d2733; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#stage { position: fixed; inset: 0; overflow: hidden; font-size: clamp(14px, 2.4vmin, 22px); }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.hide { display: none !important; }

#title { position: absolute; left: 0; right: 0; top: max(.9em, env(safe-area-inset-top)); margin: 0; text-align: center; font-size: clamp(20px, 5.2vmin, 44px); font-weight: 900; color: #fff; text-shadow: 0 .06em 0 #1d2733, 0 0 .4em rgba(29,39,51,.55); pointer-events: none; transition: opacity .4s, transform .4s; }
#title.gone { opacity: 0; transform: translateY(-.6em); }
#hud { position: absolute; left: 0; right: 0; top: max(.5em, env(safe-area-inset-top)); text-align: center; color: #fff; font-weight: 900; text-shadow: 0 .05em 0 #1d2733, 0 0 .35em rgba(29,39,51,.6); pointer-events: none; white-space: nowrap; }
#hm { font-size: 3.4em; line-height: 1; display: inline-block; }
#hm.up { animation: up .3s ease-out; }
@keyframes up { 40% { transform: scale(1.25); color: #ffcf3a; } }
#hud .u { font-size: 1.7em; margin-left: .08em; }
#cnt { font-size: 1.5em; margin-left: .7em; }

button { font: inherit; font-weight: 900; color: #1d2733; background: #fff; border: 0; border-radius: 999px; padding: .65em 1.2em; box-shadow: 0 .18em 0 #9aa7b6; cursor: pointer; touch-action: manipulation; }
button:active { transform: translateY(.1em); box-shadow: 0 .08em 0 #9aa7b6; }
button.big { background: #ffcf3a; box-shadow: 0 .18em 0 #c99a10; font-size: 1.25em; padding: .6em 1.6em; }
.round { position: absolute; right: max(1em, env(safe-area-inset-right)); bottom: max(1.2em, env(safe-area-inset-bottom)); width: 4.2em; height: 4.2em; padding: 0; display: grid; place-items: center; }
.round svg { width: 2.2em; height: 2.2em; }
.round.small { top: max(.8em, env(safe-area-inset-top)); bottom: auto; width: 2.6em; height: 2.6em; opacity: .85; }
.round.small svg { width: 1.4em; height: 1.4em; }

#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#flash.on { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }

#result { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8em; padding: max(.8em, env(safe-area-inset-top)) .8em max(.8em, env(safe-area-inset-bottom)); background: rgba(29,39,51,.55); animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; } }
#card { display: block; aspect-ratio: 1; width: auto; height: auto; max-width: min(94vw, 640px); max-height: calc(100% - 9.5em); min-height: 0; flex: 0 1 auto; border-radius: .6em; box-shadow: 0 .4em 1.6em rgba(0,0,0,.4); animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.8) rotate(-3deg); } }
.btns { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; align-items: center; }
#toTruck { color: #fff; font-weight: 700; font-size: .95em; text-decoration: none; padding: .4em .8em; opacity: .92; }
#toTruck:hover { text-decoration: underline; }
#toPrivacy { color: #fff; font-size: .72em; opacity: .6; text-decoration: none; margin-top: .2em; }
#toPrivacy:hover { text-decoration: underline; }
#stage.res #hud, #stage.res #btTurn, #stage.res #btMute { display: none; }
