@font-face { font-family: 'Lilita'; src: url('assets/fonts/LilitaOne.ttf') format('truetype'); font-display: block; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1f8fff; touch-action: none; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body { font-family: 'Lilita', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif; color: #fff; }
#app { position: fixed; inset: 0; overflow: hidden; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- shared bits ---------- */
.coin-ico { display: inline-block; width: 1.05em; height: 1.05em; border-radius: 50%; vertical-align: -0.16em; margin-right: .3em;
  background: radial-gradient(circle at 35% 30%, #fff6b0 0 12%, #ffd84a 30%, #f5a900 70%, #c47a00 100%);
  box-shadow: inset 0 0 0 .09em #b06a00, 0 .08em 0 rgba(0,0,0,.25); position: relative; flex: none; }
.coin-ico::after { content: ''; position: absolute; inset: 24%; border-radius: 50%; border: .13em solid #13294b; border-right-color: transparent; }
.chip { background: rgba(10, 28, 66, .62); border: 3px solid rgba(255,255,255,.85); border-radius: 18px; padding: 4px 14px 2px;
  font-size: 26px; line-height: 1.15; text-shadow: 0 2px 0 rgba(0,0,0,.35); display: flex; align-items: center; justify-content: flex-end;
  box-shadow: 0 4px 0 rgba(0,0,0,.22); letter-spacing: .5px; }
.chip.small { font-size: 18px; padding: 4px 12px 2px; border-width: 2px; border-radius: 14px; gap: 6px; }
.round-btn { position: absolute; width: 54px; height: 54px; border-radius: 50%; border: 3px solid #fff; cursor: pointer;
  background: linear-gradient(#41b8ff, #1468d8); box-shadow: 0 5px 0 #0b3f8a, 0 7px 10px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0; z-index: 30; }
.round-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #0b3f8a; }
.pbar { width: 8px; height: 22px; background: #fff; border-radius: 3px; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
#btnMute { right: max(14px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
#btnMute .cross { display: none; }
#btnMute.muted .cross { display: inline; }
#btnMute.muted .waves { display: none; }
body.playing #btnMute { bottom: auto; top: calc(max(12px, env(safe-area-inset-top)) + 64px); left: max(12px, env(safe-area-inset-left)); right: auto; width: 46px; height: 46px; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#btnPause { pointer-events: auto; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); }
.hud-right { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.chip-score { font-size: 32px; min-width: 150px; }
.chip-coins { font-size: 26px; min-width: 110px; color: #ffe066; }
.chip-mult { font-size: 22px; background: linear-gradient(#ffcf3f, #ff8a00); color: #fff; border-color: #fff; padding: 2px 12px 0; }
.chip-mult.pop { animation: pop .45s ease; }
#powerbars { position: absolute; left: max(12px, env(safe-area-inset-left)); top: calc(max(12px, env(safe-area-inset-top)) + 122px); display: flex; flex-direction: column; gap: 10px; }
.pw { display: flex; align-items: center; gap: 8px; }
.pw .ic { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; background-size: cover; box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.pw .bar { width: 76px; height: 12px; border-radius: 8px; background: rgba(10,28,66,.6); border: 2px solid #fff; overflow: hidden; }
.pw .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7cff6b, #1fd15a); border-radius: 6px; }
#toast { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: 46px; z-index: 12; pointer-events: none;
  color: #ffe14d; -webkit-text-stroke: 2px #13294b; text-shadow: 0 5px 0 #13294b, 0 8px 14px rgba(0,0,0,.3); opacity: 0; }
#toast.show { animation: toast 1.3s ease forwards; }
@keyframes toast { 0% { opacity: 0; transform: scale(.4); } 15% { opacity: 1; transform: scale(1.15); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; }
.screen.dim { background: rgba(6, 20, 50, .55); justify-content: center; }
#title { justify-content: space-between; padding: max(26px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(8,60,140,.55) 0%, rgba(8,60,140,0) 34%, rgba(8,40,100,0) 62%, rgba(6,24,70,.7) 100%); cursor: pointer; }
.title-top { text-align: center; }
.logo { display: flex; flex-direction: column; align-items: center; line-height: .86; transform: rotate(-4deg); margin-top: 4px; }
.logo .word { position: relative; display: block; letter-spacing: 2px; }
.logo .word .s { position: absolute; left: 0; top: 0; color: #13294b; -webkit-text-stroke: 16px #13294b; text-shadow: 0 10px 0 #0a1830, 0 16px 20px rgba(0,0,0,.35); }
.logo .word .f { position: relative; display: block; color: #ffc21a;
  background: linear-gradient(180deg, #fff7c2 0%, #ffd23f 40%, #ff9d00 72%, #ff6a00 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.logo .l1 { font-size: clamp(54px, 15vw, 96px); }
.logo .l2 { font-size: clamp(74px, 22vw, 136px); margin-top: 4px; }
.logo .l2 .f { background: linear-gradient(180deg, #ffffff 0%, #c9f3ff 38%, #49c6ff 72%, #138bff 100%); -webkit-background-clip: text; background-clip: text; }
.tagline { margin-top: 14px; font-size: 19px; background: #ff3d7f; display: inline-block; padding: 5px 16px 3px; border-radius: 14px;
  border: 3px solid #fff; transform: rotate(-2deg); box-shadow: 0 4px 0 #a3134a; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
#titleLion { flex: 1 1 auto; min-height: 0; max-height: 48vh; max-width: 86vw; object-fit: contain; filter: drop-shadow(0 12px 10px rgba(0,0,0,.35));
  animation: lionBob 2.2s ease-in-out infinite; margin: 6px 0; transform-origin: 50% 100%; }
#title.leaving #titleLion { animation: lionGo .5s ease-in forwards; }
#title.leaving .title-top, #title.leaving .title-bottom { transition: opacity .35s; opacity: 0; }
@keyframes lionBob { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-10px) scale(1.02, .985); } }
@keyframes lionGo { to { transform: translateY(40px) scale(.4); opacity: 0; } }
.title-bottom { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tap { font-size: clamp(34px, 10vw, 54px); color: #fff; -webkit-text-stroke: 2px #13294b; text-shadow: 0 5px 0 #13294b, 0 9px 14px rgba(0,0,0,.35);
  animation: tap 1.1s ease-in-out infinite; }
@keyframes tap { 0%,100% { transform: scale(1); } 50% { transform: scale(1.09); } }
.best-row { display: flex; gap: 10px; }
.howto { font-size: 14px; opacity: .95; text-shadow: 0 2px 0 rgba(0,0,0,.45); font-family: system-ui, sans-serif; font-weight: 700; max-width: 320px; }
.credit { font-size: 13px; opacity: .85; letter-spacing: 1px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }

.panel { position: relative; width: min(86vw, 360px); background: linear-gradient(#fffaf0, #ffe9c4); border: 5px solid #fff; border-radius: 30px;
  padding: 48px 22px 22px; box-shadow: 0 10px 0 #b8742a, 0 18px 40px rgba(0,0,0,.45); color: #13294b; display: flex; flex-direction: column; gap: 10px;
  animation: panelIn .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes panelIn { from { transform: scale(.5) translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.ribbon { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 38px; color: #fff; padding: 8px 32px 4px;
  background: linear-gradient(#ff5b5b, #e0263a); border: 4px solid #fff; border-radius: 22px; box-shadow: 0 6px 0 #8c1020; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
#pause .ribbon { background: linear-gradient(#41b8ff, #1468d8); box-shadow: 0 6px 0 #0b3f8a; }
.over-lion { width: 92px; height: 92px; object-fit: contain; object-position: top; align-self: center; margin-top: -10px; filter: drop-shadow(0 4px 2px rgba(0,0,0,.2)); }
.newbest { align-self: center; background: linear-gradient(#ffe259, #ffa751); color: #fff; padding: 4px 18px 2px; border-radius: 14px; font-size: 22px;
  border: 3px solid #fff; box-shadow: 0 4px 0 #c46a00; text-shadow: 0 2px 0 rgba(0,0,0,.3); animation: pop .8s ease infinite; }
.stat { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 16px; padding: 8px 16px 6px;
  font-size: 20px; box-shadow: inset 0 -3px 0 rgba(19,41,75,.12); }
.stat span { color: #6a7a96; }
.stat b { font-weight: normal; color: #13294b; display: flex; align-items: center; }
.stat.big { font-size: 26px; background: #13294b; }
.stat.big span { color: #9fc2ff; }
.stat.big b { color: #ffd23f; font-size: 34px; }
.btn { font-family: inherit; font-size: 28px; color: #fff; border: 4px solid #fff; border-radius: 22px; padding: 12px 10px 8px; cursor: pointer;
  text-shadow: 0 3px 0 rgba(0,0,0,.28); letter-spacing: 1px; }
.btn:active { transform: translateY(4px); }
.btn-green { background: linear-gradient(#7fe34a, #2fb52a); box-shadow: 0 7px 0 #1d7a1a, 0 10px 14px rgba(0,0,0,.2); margin-top: 6px; }
.btn-green:active { box-shadow: 0 3px 0 #1d7a1a; }
.btn-blue { background: linear-gradient(#41b8ff, #1468d8); box-shadow: 0 6px 0 #0b3f8a; font-size: 22px; padding: 9px 10px 6px; }
.btn-blue:active { box-shadow: 0 2px 0 #0b3f8a; }
#fps { position: absolute; left: 6px; bottom: 6px; font: 12px monospace; color: #fff; text-shadow: 0 1px 0 #000; z-index: 40; pointer-events: none; }

@media (min-aspect-ratio: 1/1) {
  #titleLion { max-height: 44vh; }
  .logo .l1 { font-size: min(13vh, 96px); } .logo .l2 { font-size: min(17vh, 136px); }
  .tagline { margin-top: 8px; }
}
@media (max-height: 560px) { .howto, .credit { display: none; } .panel { padding-top: 40px; gap: 6px; } .over-lion { display: none; } }
