/* ---------- shop & economy UI (title wallet, run boosts, owned tags, HUD gold, revive offer) ---------- */
.goldImg { width: 22px; height: 22px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.wallet { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px 4px 6px; border-radius: 999px; background: rgba(40, 20, 6, .72); border: 2px solid #ffd27a;
  font-size: 18px; font-weight: 900; color: #ffe36a; box-shadow: 0 3px 0 rgba(0,0,0,.35);
  text-shadow: 2px 0 0 var(--ol), -2px 0 0 var(--ol), 0 2px 0 var(--ol), 0 -2px 0 var(--ol); }
.wallet .goldImg { width: 28px; height: 28px; }
.wallet.small { font-size: 16px; padding: 2px 12px 2px 4px; }
.wallet.small .goldImg { width: 22px; height: 22px; }

/* title: the wallet top-left (the title has no pause button); the logo moves down a little to make room */
#walletPill { position: absolute; left: calc(12px + env(safe-area-inset-left)); top: calc(12px + env(safe-area-inset-top)); z-index: 2; animation: popIn .35s cubic-bezier(.34,1.56,.64,1) both; }
#title.has-wallet #titleLogo { top: calc(5% + 40px); max-height: 27%; }
#keysHint { white-space: pre-line; }

#titleBtns { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px 14px; margin-top: 6px; }
#titleBtns .gbtn { min-width: 128px; padding: 4px 12px; }
#shopBtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
#shopBtn .goldImg { width: 26px; height: 26px; }

#ownedTags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 360px; }
.ownedTag { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 5px; border-radius: 999px; background: rgba(40, 20, 6, .62); border: 2px solid #ffd27a;
  font-size: 14px; font-weight: 900; color: #ffe36a; animation: riseIn .4s ease-out both;
  text-shadow: 2px 0 0 var(--ol), -2px 0 0 var(--ol), 0 2px 0 var(--ol), 0 -2px 0 var(--ol); }
.ownedTag img { width: 28px; height: 28px; object-fit: contain; }

/* run boosts: chips that arm a consumable for the next run */
#loadout { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(100%, 380px); }
#loadoutTitle { font-size: 14px; font-weight: 900; color: #fff3d8; text-shadow: 2px 0 0 var(--ol), -2px 0 0 var(--ol), 0 2px 0 var(--ol), 0 -2px 0 var(--ol); }
#boostChips { display: flex; gap: 10px; width: 100%; justify-content: center; }
.boostChip { position: relative; flex: 1 1 0; max-width: 180px; min-height: 58px; display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px 6px; box-sizing: border-box;
  border-radius: 16px; border: 3px solid #8a5a2a; background: linear-gradient(#5a3414, #3a1e08); color: #fff8e8; font-family: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 4px 0 #1e0e02, inset 0 2px 0 rgba(255,255,255,.12); transition: transform .1s ease-out, filter .12s, border-color .12s; -webkit-tap-highlight-color: transparent; }
.boostChip:active { transform: translateY(2px) scale(.96); }
.boostChip.armed { border-color: #ffd23a; background: linear-gradient(#8a5a14, #5a3408); box-shadow: 0 4px 0 #1e0e02, 0 0 12px rgba(255, 210, 60, .85), inset 0 2px 0 rgba(255,255,255,.2); }
.boostChip.empty .bcIcon { filter: grayscale(.6) brightness(.8); }
.boostChip.pop { animation: chipPop .3s cubic-bezier(.34,1.56,.64,1); }
.bcIcon { width: 38px; height: 38px; object-fit: contain; flex: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
.bcText { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bcName { font-size: 14px; font-weight: 900; color: #ffd27a; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 1.5px 0 0 var(--ol), -1.5px 0 0 var(--ol), 0 1.5px 0 var(--ol), 0 -1.5px 0 var(--ol); }
.bcState { font-size: 12px; font-weight: 800; color: #fff3d8; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boostChip.armed .bcState { color: #fff08a; }
.bcCount { position: absolute; top: -9px; right: -6px; min-width: 22px; padding: 0 6px; box-sizing: border-box; border-radius: 10px; border: 2px solid #3a1e08; background: linear-gradient(#fff08a, #ffb02a);
  font-size: 13px; font-weight: 900; line-height: 18px; color: #3a1e08; text-align: center; }
.boostChip.empty .bcCount { background: linear-gradient(#8ad0ff, #3a8ad8); color: #fff; }
.bcKey { position: absolute; top: -9px; left: -6px; width: 20px; height: 20px; border-radius: 6px; border: 2px solid #3a1e08; background: #fff8e8; color: #3a1e08; font-size: 12px; font-weight: 900; line-height: 20px; text-align: center; }

/* HUD gold */
#hudGold { display: inline-flex; align-items: center; gap: 2px; }
#hudGold .goldImg { width: 20px; height: 20px; }
#hudGold .num { font-size: 15px; color: #ffe36a; }
#hudGold.bump { animation: chipPop .3s cubic-bezier(.34,1.56,.64,1); }
#hudBoosts { display: flex; gap: 2px; margin-left: auto; margin-right: 6px; }
#hudBoosts img { width: 22px; height: 22px; }
#hudPanel { width: 232px; }
#dashPill { width: 70px; }
.dmg.coin { color: #ffe36a; font-size: 18px; }

/* the panel after a wipe-out (the floating damage numbers step aside while it is up) */
body:has(#revive:not(.hidden)) #dmgLayer { display: none; }
#revive { position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; padding: 0 16px; box-sizing: border-box;
  background: radial-gradient(ellipse at 50% 50%, rgba(30, 15, 4, .5), rgba(20, 10, 2, .85)); }
#revive.show { animation: fadeIn .25s ease-out; }
/* it drops in with a small bounce (moved, never scaled: its buttons keep their real tap size the whole time) */
#revive.show #rvPanel { animation: panelDrop .42s cubic-bezier(.34,1.56,.64,1) both; }
#rvPanel { width: min(100%, 350px); box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 14px 18px;
  border-style: solid; border-color: transparent; border-width: 16px; border-image: url(../assets/ui-panel.webp) 90 fill / 30px stretch; filter: drop-shadow(0 6px 10px rgba(0,0,0,.5)); }
.ui-trim #rvPanel { border-image: var(--panel-img) var(--panel-slice) fill / 30px stretch; }
#rvIcon { width: 84px; height: 84px; object-fit: contain; margin-top: -48px; filter: drop-shadow(0 0 12px rgba(255, 220, 120, .9)); animation: iconBob 1.4s ease-in-out infinite; }
#rvTitle { font-size: 28px; font-weight: 900; color: #ffe36a; text-align: center; }
#rvDesc { font-size: 15px; font-weight: 800; color: #fff8e8; text-align: center; line-height: 1.35; }
#rvInfo { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; font-size: 14px; font-weight: 800; color: #fff3d8; }
#rvInfo.bump { animation: chipPop .35s cubic-bezier(.34,1.56,.64,1); }
#rvNote { min-height: 18px; font-size: 14px; font-weight: 800; text-align: center; color: #fff3d8; }
#rvNote.warn { color: #ffb08a; }
#rvNote.ok { color: #b8ff7a; font-size: 17px; animation: chipPop .35s cubic-bezier(.34,1.56,.64,1); }
#rvTitle, #rvDesc, #rvInfo, #rvNote, #rvUse .price { text-shadow: 2px 0 0 var(--ol), -2px 0 0 var(--ol), 0 2px 0 var(--ol), 0 -2px 0 var(--ol), 0 3px 0 rgba(0,0,0,.35); }
#rvUse { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 230px; font-size: 19px; margin-top: 14px; }
#rvUse .price { display: inline-flex; align-items: center; gap: 4px; color: #fff08a; }
#rvRow { display: flex; gap: 12px; margin-top: 30px; }
#rvRow .gbtn { min-width: 120px; font-size: 16px; padding: 4px 12px; }
#revive .gbtn.focus { filter: brightness(1.18) drop-shadow(0 0 8px rgba(255, 214, 90, .95)); transform: scale(1.05); }
#revive .gbtn:disabled, #revive .gbtn.off { filter: grayscale(.75) brightness(.8); cursor: default; }

/* "watch an ad" buttons: the same plate turned green (the free choice), a round ▶ in front of the label.
   The triangle's colour is turned by the same filter (orange → green). */
.adIco { position: relative; display: inline-block; width: 28px; height: 28px; flex: none; border-radius: 50%; background: #fff8e8; border: 2px solid #3a1e08; box-sizing: border-box;
  box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.adIco::after { content: ""; position: absolute; left: 9px; top: 5px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #c0601a; }
.adBtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 230px; font-size: 19px; margin-top: 14px;
  filter: hue-rotate(78deg) saturate(1.15); }
.adBtn:hover { filter: hue-rotate(78deg) saturate(1.15) brightness(1.12); }
#revive .adBtn.focus { filter: hue-rotate(78deg) saturate(1.15) brightness(1.18) drop-shadow(0 0 8px rgba(255, 214, 90, .95)); transform: scale(1.05); }
#revive .adBtn:disabled, #revive .adBtn.off { filter: hue-rotate(78deg) grayscale(.75) brightness(.8); }
#revive .adBtn:not(:disabled) .adIco { animation: adPulse 1.2s ease-in-out infinite; }

/* the Debug panel's test ad (never shown to players: the real ads are SOZOPOP's own window) */
#adMock { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: center; justify-content: center; background: rgba(10, 6, 2, .9); animation: fadeIn .2s ease-out; }
.adMockPanel { width: min(86%, 320px); box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 16px 26px;
  border-style: solid; border-color: transparent; border-width: 16px; border-image: url(../assets/ui-panel.webp) 90 fill / 30px stretch; animation: cardEnter2 .3s cubic-bezier(.34,1.56,.64,1) both; }
.ui-trim .adMockPanel { border-image: var(--panel-img) var(--panel-slice) fill / 30px stretch; }
.adMockTitle { font-size: 17px; font-weight: 900; color: #ffe36a; text-align: center; }
.adMockCount { font-size: 64px; font-weight: 900; color: #fff; line-height: 1; }
.adMockTitle, .adMockCount { text-shadow: 2px 0 0 var(--ol), -2px 0 0 var(--ol), 0 2px 0 var(--ol), 0 -2px 0 var(--ol), 0 3px 0 rgba(0,0,0,.35); }
.adMockPanel .gbtn { min-width: 0; font-size: 15px; padding: 4px 14px; margin-top: 18px; }

@keyframes chipPop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes cardEnter2 { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes panelDrop { from { opacity: 0; transform: translateY(-48px); } to { opacity: 1; transform: none; } }
@keyframes adPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
