* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #ffe1ad; overscroll-behavior: none;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #fff;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#c, #glass { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#c { touch-action: none; cursor: grab; }
#glass { pointer-events: none; opacity: .5; }
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 2px 0 rgba(40, 30, 50, .35); }
#hud button { pointer-events: auto; }
[hidden] { display: none !important; }
.mouse-only { display: none; }
body:not(.touch) .mouse-only { display: inline; }
body:not(.touch) .touch-only { display: none; }

#tl { position: absolute; left: max(12px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; }
#pile { display: flex; padding-left: 16px; min-height: 44px; align-items: center; }
#pile img { width: 40px; height: 40px; margin-left: -18px; animation: slap .28s cubic-bezier(.2, 1.9, .4, 1); }
#pile img:nth-child(odd) { transform: rotate(-9deg); }
#pile img:nth-child(even) { transform: rotate(8deg); }
@keyframes slap { from { scale: 2; } to { scale: 1; } }
.nums { display: flex; flex-direction: column; line-height: 1; }
#frogs { font-size: 30px; font-weight: 900; }
#frogs.bump { animation: bump .2s; }
@keyframes bump { 50% { scale: 1.35; } }
#km { font-size: 14px; font-weight: 700; opacity: .95; }
#tr { position: absolute; right: max(10px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; }
#cracks { display: flex; gap: 5px; }
#cracks i { width: 26px; height: 18px; border-radius: 7px 7px 4px 4px; background: #bfe6f7; border: 2.5px solid #fff; box-shadow: 0 2px 0 rgba(40, 30, 50, .3); position: relative; overflow: hidden; }
#cracks i.x { background: #ff4d6d; animation: bump .3s; }
#cracks i.x::after { content: ""; position: absolute; inset: -4px; background:
  linear-gradient(52deg, transparent 46%, #fff 46% 54%, transparent 54%),
  linear-gradient(-58deg, transparent 46%, #fff 46% 54%, transparent 54%); }
#mute { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(40, 30, 50, .28); color: #fff; display: grid; place-items: center; cursor: pointer; }
#mute #slash { display: none; }
#mute.off #waves { display: none; }
#mute.off #slash { display: inline; }

#combo { position: absolute; left: 0; right: 0; top: 27%; text-align: center; font-size: 44px; font-weight: 900; font-style: italic; color: #ffd23f;
  -webkit-text-stroke: 2px #3b2a55; paint-order: stroke fill; opacity: 0; transition: opacity .25s; }
#combo.on { opacity: 1; }
#combo.pop { animation: pop .22s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes pop { from { scale: 1.6; } to { scale: 1; } }
#toast { position: absolute; left: 50%; top: max(62px, calc(env(safe-area-inset-top) + 58px)); translate: -50% 0; width: max-content; max-width: min(88vw, 420px); display: flex; align-items: center; gap: 10px;
  background: rgba(40, 30, 55, .88); border-radius: 16px; padding: 8px 16px 8px 10px; font-size: 15px; line-height: 1.25; text-shadow: none;
  opacity: 0; scale: .8; transition: opacity .25s, scale .25s cubic-bezier(.2, 1.6, .4, 1); }
#toast.on { opacity: 1; scale: 1; }
#toast img { width: 52px; height: 52px; flex: none; }
#toast b { display: block; font-size: 17px; color: #ffd23f; }
#toast.big { background: none; font-size: 34px; font-weight: 900; font-style: italic; color: #ff4d6d; -webkit-text-stroke: 2px #fff; paint-order: stroke fill; }
#gauge { position: absolute; right: max(14px, env(safe-area-inset-right)); top: 50%; width: 12px; height: 130px; translate: 0 -50%; border-radius: 8px; background: rgba(40, 30, 50, .3); border: 2px solid #fff; overflow: hidden; }
#gfill { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; background: linear-gradient(#ff4d6d, #ffd23f); }
#kmh { position: absolute; right: max(8px, env(safe-area-inset-right)); top: calc(50% + 72px); font-size: 12px; font-weight: 800; text-align: right; }
#hint { position: absolute; left: 0; right: 0; bottom: max(26px, env(safe-area-inset-bottom)); text-align: center; font-size: 17px; font-weight: 800; line-height: 1.35; padding: 0 20px; transition: opacity .6s; }
#hint.off { opacity: 0; }
#mark { display: block; width: fit-content; margin: 0 auto 10px; filter: drop-shadow(0 1px 1px rgba(40, 30, 50, .7)); }
#fx { position: absolute; inset: 0; overflow: hidden; }
#fx .pts { position: absolute; font-weight: 900; font-size: 22px; color: #fff; -webkit-text-stroke: 1.5px #3b2a55; paint-order: stroke fill; translate: -50% -50%; animation: rise .8s ease-out forwards; }
#fx .pts.gold { color: #ffd23f; font-size: 30px; }
@keyframes rise { from { transform: translateY(0) scale(.6); opacity: 1; } 25% { transform: translateY(-20px) scale(1.25); } to { transform: translateY(-70px) scale(1); opacity: 0; } }
#fx img.fly { position: absolute; left: 0; top: 0; width: 72px; height: 72px; margin: -36px 0 0 -36px; will-change: transform; }
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#flash.on { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }
#paused { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: rgba(40, 30, 55, .55); font-size: 34px; font-weight: 900; }
#paused small { display: block; font-size: 15px; font-weight: 600; margin-top: 6px; }

#sheet { position: fixed; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; background: rgba(40, 30, 55, .72);
  padding: max(14px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom)); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.card { max-width: 420px; margin: 0 auto; text-align: center; }
#shot { width: min(100%, 46vh); height: auto; border-radius: 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); display: block; margin: 0 auto; animation: drop .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes drop { from { transform: translateY(40px) rotate(-3deg) scale(.9); opacity: 0; } }
#line { font-size: 18px; font-weight: 800; margin: 12px 0 2px; }
#bestline { font-size: 14px; margin: 0 0 12px; opacity: .85; }
.btns { display: flex; gap: 10px; }
.big { flex: 1; min-height: 52px; border: 0; border-radius: 14px; font: inherit; font-size: 19px; font-weight: 900; color: #3b2a55; background: #ffd23f; cursor: pointer; box-shadow: 0 4px 0 #c9930a; }
.big.alt { background: #fff; box-shadow: 0 4px 0 #b9b3c9; }
.big:active { translate: 0 3px; box-shadow: none; }
h3 { font-size: 15px; margin: 20px 0 8px; }
#albumcount { opacity: .7; font-weight: 600; }
#album { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
#album div { font-size: 10.5px; line-height: 1.15; opacity: .9; }
#album img { width: 100%; display: block; }
#album .new img { animation: slap .4s cubic-bezier(.2, 1.9, .4, 1); }
#album b { display: block; color: #ffd23f; }
.opts { display: grid; gap: 8px; }
.opts button, #door { min-height: 46px; width: 100%; border: 2px solid rgba(255, 255, 255, .55); border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; padding: 6px 12px; }
.opts button:hover, #door:hover { background: rgba(255, 255, 255, .22); }
#door { margin-top: 16px; border-style: dashed; }
.lock { display: inline-block; width: 13px; height: 10px; border-radius: 2px; background: #ffd23f; margin-right: 9px; position: relative; top: 1px; }
.lock::before { content: ""; position: absolute; left: 2px; top: -7px; width: 9px; height: 9px; border: 2px solid #ffd23f; border-bottom: 0; border-radius: 5px 5px 0 0; box-sizing: border-box; }
#doornote { font-size: 14px; }
.more { font-size: 13px; margin: 16px 0 0; }
#row { font-size: 13px; margin: 20px 0 0; text-align: left; }
#row > a { display: block; text-align: center; }
.more.credit { opacity: .6; margin-top: 6px; }
a { color: #ffd23f; }
@media (min-width: 900px) {
  #frogs { font-size: 38px; } #km { font-size: 17px; }
  #pile img { width: 52px; height: 52px; }
  #combo { font-size: 60px; } #hint { font-size: 20px; }
  #gauge { height: 180px; } #kmh { top: calc(50% + 98px); font-size: 14px; }
}

#mapbtn { height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: rgba(40, 30, 50, .28); color: #fff; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; }
#trip { position: absolute; left: 50%; translate: -50% 0; top: max(60px, calc(env(safe-area-inset-top) + 56px)); display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; }
#job { font-size: 12px; opacity: .92; }
#trip .row { display: flex; align-items: baseline; gap: 8px; }
#clock { font-size: 24px; font-variant-numeric: tabular-nums; }
#due { font-size: 13px; opacity: .9; }
#trip.late #clock, #trip.late #due { color: #ff4d6d; -webkit-text-stroke: 1px #fff; paint-order: stroke fill; }
#prog { width: 150px; height: 7px; border-radius: 4px; background: rgba(40, 30, 50, .3); border: 1.5px solid #fff; overflow: hidden; margin-top: 3px; }
#pfill { display: block; height: 100%; width: 0; background: #ffd23f; }
#toast { top: max(132px, calc(env(safe-area-inset-top) + 128px)); }
#stars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 4px; }
#stars div { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 6px 4px; font-size: 13px; line-height: 1.2; }
#stars i { display: block; font-style: normal; font-size: 30px; color: rgba(255, 255, 255, .25); }
#stars .got i { color: #ffd23f; animation: slap .45s cubic-bezier(.2, 1.9, .4, 1) both; }
#stars .got:nth-child(n+2) i { animation-delay: .2s; } #stars .got:nth-child(n+3) i { animation-delay: .4s; }
#stars .kept i { color: rgba(255, 210, 63, .5); }
#stars b { display: block; } #stars small { opacity: .8; }
#stars .miss { grid-column: 1 / -1; margin: 0 0 4px; font-size: 14px; }
#unlocked { background: #ffd23f; color: #3b2a55; border-radius: 12px; padding: 8px 12px; font-size: 15px; margin: 8px 0; text-shadow: none; animation: pop .3s cubic-bezier(.2, 1.8, .4, 1); }
.btns .big { min-width: 0; font-size: 17px; }
#map { position: fixed; inset: 0; overflow-y: auto; touch-action: pan-y; background: rgba(40, 30, 55, .8);
  padding: max(14px, env(safe-area-inset-top)) 14px max(20px, env(safe-area-inset-bottom)); animation: fade .3s; }
#map h2 { margin: 6px 0 12px; font-size: 24px; font-weight: 900; }
#map h3 { margin: 16px 0 8px; }
#stops { display: grid; gap: 10px; position: relative; }
#stops::before { content: ""; position: absolute; left: 27px; top: 24px; bottom: 24px; border-left: 4px dashed rgba(255, 255, 255, .45); }
.stop, .veh { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; border: 2px solid rgba(255, 255, 255, .35); border-radius: 14px;
  background: rgba(255, 255, 255, .1); color: #fff; font: inherit; text-align: left; padding: 6px 12px 6px 8px; cursor: pointer; }
.stop.on, .veh.on { border-color: #ffd23f; background: rgba(255, 210, 63, .2); box-shadow: 0 0 0 2px #ffd23f; }
.stop:disabled, .veh:disabled { opacity: .5; cursor: default; }
.pin { flex: none; width: 38px; height: 38px; border-radius: 50%; background: #ffd23f; color: #3b2a55; display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.stop:disabled .pin { background: #6f6585; }
.pin .lock { margin: 0; }
.tx { flex: 1; display: flex; flex-direction: column; } .tx b { font-size: 16px; } .tx small, .veh small { font-size: 12.5px; opacity: .85; }
.st { color: #ffd23f; font-size: 18px; letter-spacing: 1px; white-space: nowrap; } .st s { text-decoration: none; color: rgba(255, 255, 255, .3); }
#garage { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.veh { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; }
.veh b { font-size: 15px; }
#drive { width: 100%; margin-top: 16px; }
body[data-look="town"] #hud { text-shadow: 0 2px 2px rgba(0, 0, 0, .5); }
@media (min-width: 900px) { #clock { font-size: 30px; } #job { font-size: 14px; } #prog { width: 200px; } }
