/* Tiny Farm Tycoon - base styles copied from Herd Rush (pills, buttons, panels, popups, icons); farm additions at the end. */
@font-face { font-family: "Lilita"; src: url("fonts/LilitaOne-Regular.ttf") format("truetype"); font-display: block; }
:root {
  --u: clamp(11px, min(2.1vw, 3.3vh), 22px);   /* base unit: legible from 640x360 up to desktop */
  --ink: #1d1442;
}
html, body { margin: 0; height: 100%; overflow: hidden; background: #7cc8ff; }
body { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
  font-family: "Lilita", "Arial Black", system-ui, sans-serif; color: #fff; }
canvas#game { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
.hidden { display: none !important; }
.ic { display: inline-block; width: 1.25em; height: 1.25em; background: center/contain no-repeat; vertical-align: middle; flex: none; }
.stroke { paint-order: stroke fill; -webkit-text-stroke: 0.18em var(--ink); }
.ic.coin { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='21' r='17' fill='%23b86a00'/%3E%3Ccircle cx='20' cy='19' r='17' fill='%23ffc928'/%3E%3Ccircle cx='20' cy='19' r='11.5' fill='%23ffe37a' stroke='%23e89a00' stroke-width='3'/%3E%3Cpath d='M16 13h6l-2 6h4l-8 9 2-7h-4z' fill='%23e89a00'/%3E%3C/svg%3E"); }
.ic.bolt { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M23 2 6 23h11l-4 15 19-23H21z' fill='%23ffe14d' stroke='%231d1442' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic.lock { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M12 18v-5a8 8 0 0 1 16 0v5' fill='none' stroke='%231d1442' stroke-width='8'/%3E%3Cpath d='M12 18v-5a8 8 0 0 1 16 0v5' fill='none' stroke='%23cfd6e6' stroke-width='4'/%3E%3Crect x='7' y='17' width='26' height='20' rx='5' fill='%23ffc928' stroke='%231d1442' stroke-width='3'/%3E%3Ccircle cx='20' cy='26' r='3' fill='%231d1442'/%3E%3C/svg%3E"); }
.ic.unlock { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M12 18v-5a8 8 0 0 1 15-4' fill='none' stroke='%231d1442' stroke-width='8'/%3E%3Cpath d='M12 18v-5a8 8 0 0 1 15-4' fill='none' stroke='%23cfd6e6' stroke-width='4'/%3E%3Crect x='7' y='17' width='26' height='20' rx='5' fill='%2349e06a' stroke='%231d1442' stroke-width='3'/%3E%3C/svg%3E"); }
.ic.up { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 4 5 20h9v15h12V20h9z' fill='%23fff' stroke='%231d1442' stroke-width='3.5' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic.snd { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M6 15h7l9-8v26l-9-8H6z' fill='%23fff' stroke='%231d1442' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M27 13q5 7 0 14M31 9q9 11 0 22' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
.ic.mute { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M6 15h7l9-8v26l-9-8H6z' fill='%23fff' stroke='%231d1442' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M27 14l9 12M36 14l-9 12' stroke='%23ff5a6e' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E"); }
.ic.ad { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='4' y='8' width='32' height='24' rx='6' fill='%23fff'/%3E%3Cpath d='M17 14v12l10-6z' fill='%237a3cff'/%3E%3C/svg%3E"); }
.ic.speed { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M4 12h12M2 20h12M5 28h11' stroke='%23fff' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M18 8l16 12-16 12 4-12z' fill='%23ffe14d' stroke='%231d1442' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ic.magnet { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M8 6v14a12 12 0 0 0 24 0V6h-8v14a4 4 0 0 1-8 0V6z' fill='%23ff4d6d' stroke='%231d1442' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M8 6h8v6H8zM24 6h8v6h-8z' fill='%23e6ecf5' stroke='%231d1442' stroke-width='3'/%3E%3C/svg%3E"); }
.ic.herd { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='3' y='16' width='14' height='14' rx='4' fill='%23ffd23f' stroke='%231d1442' stroke-width='3'/%3E%3Crect x='20' y='10' width='17' height='20' rx='5' fill='%2333d1c9' stroke='%231d1442' stroke-width='3'/%3E%3Ccircle cx='9' cy='22' r='1.8' fill='%231d1442'/%3E%3Ccircle cx='27' cy='17' r='2' fill='%231d1442'/%3E%3Ccircle cx='32' cy='17' r='2' fill='%231d1442'/%3E%3C/svg%3E"); }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 0.35em; background: linear-gradient(#3b2a86, #241a5c); border: 0.2em solid #fff; border-radius: 2em;
  padding: 0.15em 0.8em 0.15em 0.35em; font-size: calc(var(--u) * 1.35); box-shadow: 0 0.25em 0 rgba(0,0,0,0.25); text-shadow: 0 0.12em 0 rgba(0,0,0,0.35); }
.pill .ic { width: 1.5em; height: 1.5em; }
.pill.power { font-size: calc(var(--u) * 1.9); background: linear-gradient(#ff8a2b, #e8491d); }

@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
#hud { position: absolute; inset: 0; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
#hud .tl { position: absolute; left: max(10px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); }
#hud .tc { position: absolute; left: 50%; top: max(8px, env(safe-area-inset-top)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.3em; }
#hud .tr { position: absolute; right: max(10px, env(safe-area-inset-right)); top: max(10px, env(safe-area-inset-top)); display: flex; gap: 0.5em; pointer-events: auto; }
#hud .bottom { position: absolute; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.2em; }

/* buttons */
.btn { pointer-events: auto; font-family: inherit; color: #fff; border: 0; cursor: pointer; position: relative; border-radius: 0.8em;
  text-shadow: 0 0.1em 0 rgba(0,0,0,0.35); box-shadow: 0 0.3em 0 rgba(0,0,0,0.28), inset 0 -0.3em 0 rgba(0,0,0,0.18), inset 0 0.18em 0 rgba(255,255,255,0.35);
  border: 0.17em solid #fff; transition: transform 0.08s; display: inline-flex; align-items: center; justify-content: center; gap: 0.35em; }
.btn:active { transform: translateY(0.15em) scale(0.97); }
.btn.round { width: calc(var(--u) * 3.1); height: calc(var(--u) * 3.1); border-radius: 1em; font-size: var(--u); }
.btn.round .ic { width: 1.9em; height: 1.9em; }
.btn.green { background: linear-gradient(#6af06a, #26b14a); }
.btn.blue { background: linear-gradient(#5cc8ff, #2a7cf0); }
.btn.orange { background: linear-gradient(#ffb43a, #f06a1a); }
.btn.purple { background: linear-gradient(#b38bff, #7a3cff); }
.btn.gray { background: linear-gradient(#b9bfd0, #8a90a6); }
.btn.big { font-size: calc(var(--u) * 1.6); padding: 0.4em 1.6em; }
.btn.mid { font-size: calc(var(--u) * 1.15); padding: 0.45em 0.9em; }
.btn .dot { position: absolute; right: -0.3em; top: -0.3em; width: 1em; height: 1em; border-radius: 50%; background: #ff3b5c; border: 0.15em solid #fff; display: none; }
.btn.can .dot { display: block; }
.btn.can { animation: wiggle 1.4s infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-9deg) scale(1.08); } 84% { transform: rotate(9deg) scale(1.08); } 92% { transform: rotate(-4deg); } }

.hand { position: absolute; width: 4.2em; height: 4.2em; left: -1em; top: -0.6em; animation: drag 1.8s ease-in-out infinite;
  background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M22 30V10a4 4 0 0 1 8 0v16l1-4a4 4 0 0 1 8 1v4a4 4 0 0 1 8 1v4a4 4 0 0 1 8 1v12c0 9-7 17-17 17h-3c-6 0-10-3-13-8l-9-14a4 4 0 0 1 6-5z' fill='%23fff' stroke='%231d1442' stroke-width='3.5' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@keyframes drag { 0% { transform: translate(0, 0); } 30% { transform: translate(0, -2.6em); } 55% { transform: translate(2.4em, -1.2em); } 80% { transform: translate(-2.4em, -1.5em); } 100% { transform: translate(0, 0); } }
/* logo shown at the start */
#logo { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) rotate(-4deg); text-align: center; line-height: 0.85; animation: logoIn 0.7s cubic-bezier(.2,1.5,.4,1); transition: opacity 0.6s, transform 0.6s; }
#logo div { paint-order: stroke fill; -webkit-text-stroke: 0.14em var(--ink); text-shadow: 0 0.1em 0 var(--ink); }
#logo .t1 { font-size: calc(var(--u) * 5.2); color: #ffd23f; }
#logo .t2 { font-size: calc(var(--u) * 6.4); color: #ff7a1a; }
#logo.out { opacity: 0; transform: translate(-50%, -90%) rotate(-4deg) scale(0.8); }
@keyframes logoIn { 0% { transform: translate(-50%, -50%) scale(0.3) rotate(-14deg); } 100% { transform: translate(-50%, -50%) scale(1) rotate(-4deg); } }
/* world-space popups */
#pops, #labels { position: absolute; inset: 0; overflow: hidden; }
.pop { position: absolute; left: 0; top: 0; display: none; will-change: transform; }
.pop > span { display: block; transform: translate(-50%, -100%); white-space: nowrap; paint-order: stroke fill; -webkit-text-stroke: 0.16em var(--ink); text-shadow: 0 0.08em 0 var(--ink); }
.pop.plus > span { font-size: calc(var(--u) * 1.5); color: #fff; }
.pop.full > span { font-size: calc(var(--u) * 1.4); color: #ffdd57; }
.pop.coin > span { font-size: calc(var(--u) * 1.3); color: #ffd23f; }
.pop.badge > span { font-size: calc(var(--u) * 1.25); -webkit-text-stroke: 0; text-shadow: none; padding: 0.1em 0.55em; border-radius: 1em; border: 0.16em solid #fff; box-shadow: 0 0.2em 0 rgba(0,0,0,0.3); }
.pop.heart > span { font-size: calc(var(--u) * 1.4); color: #ff6b9a; }
.pop.sad > span { font-size: calc(var(--u) * 1.4); color: #ff5a6e; }
@keyframes popUp { 0% { transform: translate(-50%, -60%) scale(0.3); opacity: 0; } 15% { transform: translate(-50%, -100%) scale(1.25); opacity: 1; } 30% { transform: translate(-50%, -110%) scale(1); } 75% { opacity: 1; } 100% { transform: translate(-50%, -190%) scale(0.95); opacity: 0; } }
/* modals */
.modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(20,12,50,0.55); pointer-events: auto; }
.panel { background: linear-gradient(#5a3fd1, #3a2697); border: 0.25em solid #fff; border-radius: 1.6em; padding: 1em 1.2em 1.2em; text-align: center; box-shadow: 0 0.5em 0 rgba(0,0,0,0.3);
  font-size: var(--u); max-width: 92vw; max-height: 92vh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 0.7em; animation: panelIn 0.35s cubic-bezier(.2,1.4,.4,1); }
@keyframes panelIn { 0% { transform: scale(0.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.ptitle { font-size: 2.6em; line-height: 1; paint-order: stroke fill; -webkit-text-stroke: 0.14em var(--ink); text-shadow: 0 0.1em 0 var(--ink); }
.ptitle.gold { color: #ffd23f; }
.pcoins, .rescoins { display: inline-flex; align-items: center; gap: 0.3em; font-size: 1.7em; background: rgba(0,0,0,0.25); padding: 0.1em 0.8em 0.1em 0.3em; border-radius: 1em; }
.pcoins .ic, .rescoins .ic { width: 1.4em; height: 1.4em; }
.resline { font-size: 1.4em; }
.row { display: flex; gap: 0.7em; }
.teaser { font-size: 0.9em; opacity: 0.85; color: #cfe8ff; }

#loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2em; background: radial-gradient(circle at 50% 40%, #8fe0ff, #2f8fff); pointer-events: auto; font-size: var(--u); transition: opacity 0.4s; }
#loading.out { opacity: 0; pointer-events: none; }
.ltitle { display: flex; flex-direction: column; align-items: center; line-height: 0.85; transform: rotate(-4deg); }
.ltitle span { font-size: 5em; paint-order: stroke fill; -webkit-text-stroke: 0.14em var(--ink); text-shadow: 0 0.1em 0 var(--ink); color: #ffd23f; }
.ltitle span + span { font-size: 6.2em; color: #ff7a1a; }
.lbar { width: 16em; height: 1.2em; border-radius: 1em; background: rgba(29,20,66,0.5); border: 0.18em solid #fff; overflow: hidden; }
#lfill { height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, #49e06a); transition: width 0.15s; }

@media (max-aspect-ratio: 4/5) {  /* phone portrait */
  :root { --u: clamp(11px, 3.6vw, 20px); }
}
@media (max-height: 420px) { /* small landscape */
  .panel { padding: 0.5em 1em 0.7em; gap: 0.45em; }
  .ptitle { font-size: 2em; }
}
.ic.land { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M2 35 15 12l7 10 5-7 11 20z' fill='%237fd0ff' stroke='%231d1442' stroke-width='3' stroke-linejoin='round'/%3E%3Cpath d='M15 12l-5 8 5-2 3 3 2-4z' fill='%23fff'/%3E%3Cpath d='M27 15V4' stroke='%231d1442' stroke-width='2.5'/%3E%3Cpath d='M27 4l9 3.5-9 3.5z' fill='%23ff4d6d' stroke='%231d1442' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E"); }
#fade { position: absolute; inset: 0; background: #eef6ff; opacity: 0; pointer-events: none; transition: opacity 0.7s; }
#fade.on { opacity: 1; pointer-events: auto; }
.teaser { position: relative; width: 7em; height: 4.6em; margin: 0.2em auto 0; opacity: 1; }
.teaser .ic.land.dark { width: 100%; height: 100%; filter: brightness(0) invert(0.18) sepia(0.4) hue-rotate(210deg); opacity: 0.9; }
.teaser .ic.lock { position: absolute; left: 50%; top: 58%; width: 2.2em; height: 2.2em; transform: translate(-50%, -50%); }
.teaser b { position: absolute; right: 0.2em; top: 0; min-width: 1.5em; height: 1.5em; line-height: 1.5em; border-radius: 1em; background: #ffd23f; color: #1d1442; font-weight: normal; font-size: 1.1em; text-align: center; border: 0.12em solid #fff; }
.pop.newtier > span { font-size: calc(var(--u) * 1.3); color: #fff; background: #ff4d8d; padding: 0.05em 0.5em; border-radius: 1em; border: 0.16em solid #fff; -webkit-text-stroke: 0; text-shadow: none; box-shadow: 0 0.2em 0 rgba(0,0,0,0.25); }
.ic.crown { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M5 30 3 11l10 8 7-12 7 12 10-8-2 19z' fill='%23ffd23f' stroke='%231d1442' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='20' cy='22' r='3' fill='%23ff4d8d'/%3E%3Ccircle cx='11' cy='25' r='2' fill='%234d96ff'/%3E%3Ccircle cx='29' cy='25' r='2' fill='%233ddc97'/%3E%3C/svg%3E"); }
.ic.ok { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M7 21l9 9 17-19' fill='none' stroke='%231d1442' stroke-width='9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M7 21l9 9 17-19' fill='none' stroke='%23fff' stroke-width='4.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* ---------- Tiny Farm Tycoon ---------- */
html, body { background: #9fe0ff; }
#hud .tl { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15em; }
.pill.coins { font-size: calc(var(--u) * 1.6); min-width: 4.2em; }
.pill.coins .cv { display: flex; flex-direction: column; line-height: 1; padding: 0.12em 0; }
.rate { font-size: 0.5em; color: #ffe37a; margin-top: 0.1em; }
#hud .tc { position: absolute; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%); }
#ladder { display: flex; gap: 0.25em; align-items: center; background: rgba(29,20,66,0.55); border: 0.16em solid rgba(255,255,255,0.85); border-radius: 1.2em; padding: 0.22em 0.4em; font-size: var(--u); }
#ladder .lc { position: relative; width: 2.3em; height: 2.3em; border-radius: 0.7em; background: rgba(255,255,255,0.14) center/90% no-repeat; }
#ladder .lc.off { filter: brightness(0) invert(1); opacity: 0.28; }
#ladder .lc.on { background-color: rgba(255,255,255,0.3); }
#ladder .lc.goal { width: 2.9em; height: 2.9em; background-color: rgba(255,210,63,0.35); box-shadow: 0 0 0 0.14em #ffd23f; }
#ladder .lc.goal.off { filter: brightness(0) invert(0.95) sepia(1) saturate(4) hue-rotate(5deg); opacity: 0.55; }
#ladder .lc.goal::after { content: ""; position: absolute; left: 50%; top: -0.95em; width: 1.4em; height: 1.1em; transform: translateX(-50%); background: center/contain no-repeat; }
#ladder .lc.pop { animation: chipIn 0.5s cubic-bezier(.2,1.6,.4,1); }
@keyframes chipIn { 0% { transform: scale(0.2); } 100% { transform: scale(1); } }
#ladder .arrow { width: 0; height: 0; border-top: 0.32em solid transparent; border-bottom: 0.32em solid transparent; border-left: 0.42em solid rgba(255,255,255,0.6); }
#hud .bottom { display: flex; flex-direction: row; align-items: flex-end; gap: 0.6em; font-size: var(--u); pointer-events: none; }
.btn.buy, .btn.side { flex-direction: column; gap: 0; line-height: 1; padding: 0.35em 0.6em 0.45em; }
.btn.buy { font-size: calc(var(--u) * 1.35); min-width: 7.4em; padding: 0.3em 0.9em 0.45em; border-radius: 0.9em; }
.btn.side { font-size: calc(var(--u) * 1.0); min-width: 5.6em; }
.btn .lbl { white-space: nowrap; margin-top: 0.05em; }
.btn .price { display: inline-flex; align-items: center; gap: 0.15em; margin-top: 0.2em; background: rgba(0,0,0,0.22); border-radius: 1em; padding: 0.05em 0.5em 0.05em 0.15em; font-size: 0.95em; }
.btn .price .ic { width: 1.15em; height: 1.15em; }
.btn .price b { font-weight: normal; }
.btn.buy > .ic { width: 2.4em; height: 2.4em; margin: -1.1em 0 -0.1em; filter: drop-shadow(0 0.1em 0 rgba(0,0,0,0.25)); }
.btn.side > .ic { width: 1.6em; height: 1.6em; }
.btn.poor { background: linear-gradient(#c3c8dc, #9097b2); }
.btn.poor .price { color: #ffd6d6; }
.btn.poor > .ic { filter: grayscale(0.5); }
.btn.maxed .price { display: none; }
.btn.ready { animation: readyPulse 1.2s infinite; }
@keyframes readyPulse { 0%, 100% { scale: 1; } 50% { scale: 1.07; } }
.btn.nope { animation: nope 0.35s; }
@keyframes nope { 20% { transform: translateX(-0.3em); } 40% { transform: translateX(0.3em); } 60% { transform: translateX(-0.2em); } 80% { transform: translateX(0.15em); } }
#coinPill.bump { animation: bump 0.25s; }

/* lock labels over locked pens */
.lock3d { position: absolute; left: 0; top: 0; will-change: transform; }
.lock3d > span { display: inline-flex; align-items: center; gap: 0.15em; transform: translate(-50%, -50%); font-size: calc(var(--u) * 1.05); padding: 0.1em 0.55em 0.1em 0.2em;
  border-radius: 1em; border: 0.15em solid #fff; background: rgba(29,20,66,0.78); box-shadow: 0 0.2em 0 rgba(0,0,0,0.25); white-space: nowrap; }
.lock3d .ic { width: 1.35em; height: 1.35em; }
.lock3d.can > span { background: #26b14a; animation: readyPulse 1s infinite; }
.lock3d.next > span { pointer-events: none; }

/* coins flying to the counter */
#flyers { position: absolute; inset: 0; overflow: hidden; }
.fly { position: absolute; left: 0; top: 0; width: calc(var(--u) * 1.7); height: calc(var(--u) * 1.7); margin: calc(var(--u) * -0.85) 0 0 calc(var(--u) * -0.85); display: none; }
.pop.coin > span { font-size: calc(var(--u) * 1.15); color: #ffd23f; }
.pop.tap > span { font-size: calc(var(--u) * 1.3); color: #fff; }
.pop.badge > span { color: #fff; }
.pop.nope > span { font-size: calc(var(--u) * 1.25); color: #ff5a6e; }

/* discovery card (non-blocking) */
#discover { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); display: flex; align-items: center; gap: 0.6em; font-size: var(--u);
  background: linear-gradient(#fff, #e9ecff); color: var(--ink); border: 0.22em solid #fff; border-radius: 1.3em; padding: 0.5em 1.2em 0.5em 0.6em; box-shadow: 0 0.35em 0 rgba(0,0,0,0.25), 0 0 1.5em rgba(255,221,87,0.8); pointer-events: auto; }
#discover.in { animation: discIn 0.5s cubic-bezier(.2,1.5,.4,1); }
@keyframes discIn { 0% { transform: translateX(-50%) scale(0.3) rotate(-8deg); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
#discover .dimg { width: 4.6em; height: 4.6em; border-radius: 1em; background: #3a2697 center/88% no-repeat; }
#discover .dtxt { display: flex; flex-direction: column; }
#discover .dtxt b { font-weight: normal; font-size: 2.2em; line-height: 1; }
#discover .dtxt span { font-size: 1.05em; color: #5a4fa0; }
#discover .dnew { position: absolute; left: -0.7em; top: -0.9em; transform: rotate(-10deg); background: #ff4d8d; color: #fff; border: 0.15em solid #fff; border-radius: 1em; padding: 0.05em 0.5em; font-size: 1.2em; box-shadow: 0 0.15em 0 rgba(0,0,0,0.25); }

/* logo + first-play hint */
#logo { position: absolute; left: 50%; top: 14%; transform: translate(-50%, -50%) rotate(-4deg); text-align: center; line-height: 0.88; animation: logoIn 0.7s cubic-bezier(.2,1.5,.4,1); transition: opacity 0.6s, transform 0.6s; pointer-events: none; }
#logo div { paint-order: stroke fill; -webkit-text-stroke: 0.14em var(--ink); text-shadow: 0 0.1em 0 var(--ink); }
#logo .t0 { font-size: calc(var(--u) * 2.6); color: #ffd23f; }
#logo .t1 { font-size: calc(var(--u) * 3.5); color: #ff7a1a; }
body.title #ladder { visibility: hidden; }
#logo.out { opacity: 0; transform: translate(-50%, -90%) rotate(-4deg) scale(0.8); }
#hint { position: absolute; left: 0; top: 0; width: 1px; height: 1px; font-size: var(--u); pointer-events: none; }
#hint .hand { left: -1.2em; top: -0.4em; width: 4em; height: 4em; animation: none; }
.ltitle span { font-size: 3.6em; }
.ltitle span + span { font-size: 4.6em; }
#loading { font-size: var(--u); }

/* panels */
.panel .small { font-size: 0.95em; opacity: 0.8; }
.winimg { width: 8em; height: 8em; background: center/contain no-repeat; filter: drop-shadow(0 0 1em rgba(255,210,63,0.9)); animation: pulse 1.2s infinite; }
.winstats { display: flex; gap: 0.6em; font-size: 1.05em; }
.winstats div { background: rgba(0,0,0,0.22); border-radius: 0.7em; padding: 0.3em 0.7em; }
.winstats b { display: block; font-size: 1.45em; font-weight: normal; color: #ffd23f; }
b.gold { color: #ffd23f; font-weight: normal; }
.soon { display: flex; align-items: center; gap: 0.6em; font-size: 1.1em; color: #cfe8ff; }
.soon .teaser { width: 4.6em; height: 3em; margin: 0; }
.soon .teaser .ic.lock { width: 1.6em; height: 1.6em; }
.rescoins span { min-width: 3em; }

@media (max-aspect-ratio: 4/5) { /* phone portrait */
  #hud .tc { top: calc(max(10px, env(safe-area-inset-top)) + 3.9em); }
  #ladder .lc { width: 2.05em; height: 2.05em; }
  #ladder .lc.goal { width: 2.6em; height: 2.6em; }
  #hud .bottom { gap: 0.4em; }
  .btn.buy { min-width: 6.8em; padding: 0.3em 0.6em 0.45em; }
  .btn.side { min-width: 4.6em; padding: 0.35em 0.4em 0.45em; }
  #discover { top: 21%; }
  #logo { top: 15%; }
  #logo .t0 { font-size: calc(var(--u) * 2.9); } #logo .t1 { font-size: calc(var(--u) * 3.9); }
}
@media (max-height: 420px) { #discover { top: 18%; } .winimg { width: 5em; height: 5em; } }
@media (max-width: 360px) { :root { --u: 11px; } }
