/* Khooke Koochooloo — night-carnival look.
   Palette: night #1a0f3c · tent #2d1a66 · piggy pink #ff7eb0 · bulb yellow #ffd84a · mint #35e0c2 · cream #fff4de */
@font-face { font-family: Lalezar; src: url(../fonts/lalezar.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/vazirmatn.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --night: #1a0f3c; --tent: #2d1a66; --plum: #3f2590; --line: #5a3cc0;
  --pink: #ff7eb0; --pink-d: #d9477f; --bulb: #ffd84a; --bulb-d: #d99a12;
  --mint: #35e0c2; --mint-d: #12a88f; --cream: #fff4de; --tomato: #ff5a4d; --ink: #170b33;
  --p0: var(--pink); --p1: var(--mint);
  --display: Lalezar, Vazirmatn, system-ui, sans-serif;
  --body: Vazirmatn, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --pop: cubic-bezier(.2, 1.5, .4, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--night); overscroll-behavior: none; }
body { font-family: var(--body); color: var(--cream); font-size: 16px; line-height: 1.6; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--bulb); outline-offset: 3px; }
h1, h2, h3, h4, p { margin: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; }
text { font-family: 'Apple Color Emoji', 'Noto Color Emoji', 'Segoe UI Emoji', sans-serif; }

/* ---------- backdrop ---------- */
#bg { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #4a2aa8 0%, var(--tent) 38%, var(--night) 78%); }
#bg .beam { position: absolute; top: -12vh; left: 50%; width: 46vmax; height: 130vh; transform-origin: 50% 0; opacity: .5;
  background: linear-gradient(180deg, rgba(255, 216, 74, .34), rgba(255, 216, 74, 0) 72%); clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); mix-blend-mode: screen; }
#bg .b1 { margin-left: -38vmax; animation: sweep 9s ease-in-out infinite alternate; }
#bg .b2 { margin-left: -8vmax; background: linear-gradient(180deg, rgba(255, 126, 176, .32), rgba(255, 126, 176, 0) 72%); animation: sweep 11s ease-in-out -4s infinite alternate-reverse; }
#bg .b3 { margin-left: -23vmax; background: linear-gradient(180deg, rgba(53, 224, 194, .26), rgba(53, 224, 194, 0) 72%); animation: sweep 13s ease-in-out -7s infinite alternate; }
@keyframes sweep { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
#bg .bokeh { position: absolute; inset: 0; opacity: .8;
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 216, 74, .5) 0 5px, transparent 6px),
    radial-gradient(circle at 84% 14%, rgba(255, 126, 176, .5) 0 4px, transparent 5px),
    radial-gradient(circle at 68% 34%, rgba(53, 224, 194, .45) 0 3px, transparent 4px),
    radial-gradient(circle at 28% 48%, rgba(255, 255, 255, .4) 0 2px, transparent 3px),
    radial-gradient(circle at 92% 58%, rgba(255, 216, 74, .4) 0 3px, transparent 4px),
    radial-gradient(circle at 6% 70%, rgba(255, 126, 176, .4) 0 4px, transparent 5px),
    radial-gradient(circle at 48% 9%, rgba(255, 255, 255, .5) 0 2px, transparent 3px),
    radial-gradient(circle at 38% 82%, rgba(53, 224, 194, .3) 0 3px, transparent 4px);
  animation: twinkle 4s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .45; transform: translateY(0); } to { opacity: .95; transform: translateY(-8px); } }
#bg .ground { position: absolute; left: -10%; right: -10%; bottom: -8vh; height: 30vh; border-radius: 50% 50% 0 0; background: radial-gradient(60% 100% at 50% 100%, #12092c, rgba(18, 9, 44, 0)); }
body[data-scr="game"] #bg .beam { opacity: .18; }

/* ---------- screens ---------- */
#app { position: fixed; inset: 0; }
.scr { position: absolute; inset: 0; display: none; flex-direction: column; padding: calc(var(--sat) + 10px) 16px calc(var(--sab) + 10px); max-width: 520px; margin: 0 auto; }
.scr.on { display: flex; }
#s-home.on, #s-map.on, #s-friends.on, #s-top.on, #s-me.on { padding-bottom: calc(var(--sab) + 84px); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 2px 20px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroll::-webkit-scrollbar { display: none; }
.pagehead { padding: 6px 4px 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pagehead h2 { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1.2; color: var(--cream); text-shadow: 0 3px 0 var(--pink-d), 0 6px 0 rgba(0, 0, 0, .25); }
.pagehead .sub { font-size: 13px; color: #cbbcf5; }
.pagehead.with-back { align-items: center; }
.back { width: 44px; height: 44px; border-radius: 14px; background: var(--plum); box-shadow: 0 4px 0 #24135c; font-size: 28px; line-height: 1; display: grid; place-items: center; }
.back:active { transform: translateY(3px); box-shadow: 0 1px 0 #24135c; }

/* ---------- buttons ---------- */
.btn { --f: var(--plum); --d: #24135c; position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 20px;
  border-radius: 18px; background: var(--f); color: #fff; font-family: var(--display); font-size: 21px; line-height: 1.2; letter-spacing: .2px;
  box-shadow: 0 6px 0 var(--d), 0 12px 22px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .35); transition: transform .08s, box-shadow .08s, filter .2s; overflow: hidden; }
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--d), 0 3px 8px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .35); }
.btn:disabled { filter: saturate(.25) brightness(.75); cursor: default; }
.btn.pink { --f: linear-gradient(180deg, #ff9cc4, var(--pink) 55%, #f25f9b); --d: #b8336a; color: #3b0a24; }
.btn.mint { --f: linear-gradient(180deg, #7cf3df, var(--mint) 55%, #1cc6aa); --d: #0c8672; color: #06342c; }
.btn.bulbbtn { --f: linear-gradient(180deg, #ffe98a, var(--bulb) 55%, #f5bf2a); --d: #b17a08; color: #4a3000; }
.btn.ticket { --f: var(--cream); --d: #c9b58a; color: var(--ink);
  -webkit-mask: radial-gradient(circle 9px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 9px at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat; box-shadow: none; border-bottom: 6px solid var(--d); }
.btn.ticket:active { transform: translateY(4px); border-bottom-width: 2px; }
.btn.ghost { --f: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28); color: #e6dcff; font-family: var(--body); font-weight: 700; font-size: 16px; min-height: 46px; }
.btn.ghost:active:not(:disabled) { transform: scale(.97); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); }
.btn.big { min-height: 66px; font-size: 27px; border-radius: 22px; width: 100%; }
.btn.sm { min-height: 40px; font-size: 16px; padding: 4px 14px; border-radius: 13px; box-shadow: 0 4px 0 var(--d), inset 0 2px 0 rgba(255, 255, 255, .35); }
.btn.sm:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--d); }
.btn .ico { font-size: .9em; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
.btn.big.pink::after { content: ''; position: absolute; top: 0; bottom: 0; width: 34%; inset-inline-start: -40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-18deg); animation: shine 3.4s ease-in-out infinite; }
@keyframes shine { 0%, 62% { inset-inline-start: -40%; } 100% { inset-inline-start: 130%; } }

.coin { display: inline-block; width: 1.05em; height: 1.05em; border-radius: 50%; vertical-align: -.16em; background: radial-gradient(circle at 35% 30%, #fff3a8, var(--bulb) 45%, var(--bulb-d)); box-shadow: inset 0 0 0 2px #b17a08, 0 2px 0 rgba(0, 0, 0, .25); }
.av { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--cream); font-size: 26px; line-height: 1; box-shadow: 0 0 0 3px var(--plum), 0 4px 0 rgba(0, 0, 0, .25); flex: none; position: relative; }

/* ---------- boot ---------- */
#s-boot { align-items: center; justify-content: center; gap: 12px; }
.boot-pig { width: 170px; animation: bob 1.6s ease-in-out infinite; }
.boot-title { font-family: var(--display); font-size: 44px; text-shadow: 0 4px 0 var(--pink-d); }
.boot-dots { display: flex; gap: 8px; direction: ltr; }
.boot-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--bulb); animation: chase .9s infinite; }
.boot-dots i:nth-child(2) { animation-delay: .15s; } .boot-dots i:nth-child(3) { animation-delay: .3s; }

/* ---------- home ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chip-me { display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 16px; border-radius: 30px; background: rgba(23, 11, 51, .6); box-shadow: inset 0 0 0 2px var(--line); text-align: start; }
.chip-me .nm { display: grid; line-height: 1.25; } .chip-me b { font-weight: 800; font-size: 15px; } .chip-me small { font-size: 12px; color: var(--bulb); }
.coins { display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 30px; background: rgba(23, 11, 51, .6); box-shadow: inset 0 0 0 2px var(--line); font-weight: 800; font-size: 17px; }

.marquee { position: relative; margin: 20px 12px 0; padding: 7px; border-radius: 26px; background: linear-gradient(180deg, #ff6aa5, #c9357a); box-shadow: 0 8px 0 #7f1c4b, 0 22px 40px rgba(0, 0, 0, .45); transform: rotate(-1.5deg); animation: signin .9s var(--pop) both; }
@keyframes signin { from { transform: translateY(-140%) rotate(-9deg); } to { transform: rotate(-1.5deg); } }
.marquee-in { border-radius: 20px; background: radial-gradient(120% 140% at 50% 0%, #4b2aa9, #23114f); padding: 12px 10px 10px; text-align: center; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .25); }
.logo { font-family: var(--display); font-weight: 400; font-size: clamp(46px, 15.5vw, 78px); line-height: 1.02; color: var(--cream); text-shadow: 0 2px 0 #ffb7d3, 0 4px 0 var(--pink), 0 6px 0 var(--pink-d), 0 8px 0 #a02a5f, 0 14px 18px rgba(0, 0, 0, .5); }
.logo span { display: inline-block; animation: letter .8s var(--pop) both; } .logo span:nth-child(1) { animation-delay: .35s; } .logo span:nth-child(2) { animation-delay: .5s; }
@keyframes letter { from { transform: scale(0) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tagline { font-weight: 800; font-size: 15px; color: var(--bulb); letter-spacing: .3px; margin-top: 2px; }
.bulb { position: absolute; width: 11px; height: 11px; margin: -5.5px; border-radius: 50%; background: #fff7c9; box-shadow: 0 0 0 2px #b8336a, 0 0 12px 3px rgba(255, 216, 74, .9); animation: chase .6s steps(1) infinite; }
@keyframes chase { 0%, 100% { opacity: 1; filter: none; } 34% { opacity: .28; filter: saturate(.3); } }

.stage { flex: 1; min-height: 120px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.pig-wrap { width: min(46vw, 34vh, 220px); position: relative; z-index: 1; margin-bottom: -18px; animation: bob 2.6s ease-in-out infinite; cursor: pointer; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.podium { width: 68%; height: 34px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 216, 74, .55), rgba(255, 216, 74, 0)); }
.bubble { position: relative; max-width: 86%; margin-bottom: 12px; padding: 8px 16px; border-radius: 18px; background: var(--cream); color: var(--ink); font-weight: 700; font-size: 14.5px; text-align: center; opacity: 0; transform: translateY(8px) scale(.9); transition: .3s var(--pop); box-shadow: 0 5px 0 rgba(0, 0, 0, .25); }
.bubble.show { opacity: 1; transform: none; }
.bubble::after { content: ''; position: absolute; bottom: -9px; left: 50%; margin-left: -9px; border: 9px solid transparent; border-top-color: var(--cream); border-bottom: 0; }
.home-actions { display: grid; gap: 14px; padding: 10px 4px 6px; }
.home-actions .btn { animation: rise .6s var(--pop) both; animation-delay: .6s; }
.row2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; } .row2 .btn { animation-delay: .72s; font-size: 19px; padding-inline: 10px; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }

/* pig */
.pig { display: block; width: 100%; height: auto; overflow: visible; }
.pig .ear { transform-box: fill-box; transform-origin: 50% 100%; animation: ear 3.2s ease-in-out infinite; } .pig .ear.r { animation-delay: -1.2s; }
@keyframes ear { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(-12deg); } 95% { transform: rotate(8deg); } }
.pig .eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: blink 4.2s infinite; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }
.pig .pupils { transition: transform .12s; }
.pig .eyes-joy, .pig .tears { display: none; }
.pig.joy .eyes, .pig.sad .eyes .pupils { display: none; } .pig.joy .eyes-joy { display: block; }
.pig.sad .eyes { animation: none; } .pig.sad .tears { display: block; animation: tear 1s ease-in infinite; }
@keyframes tear { from { transform: translateY(0); opacity: 1; } to { transform: translateY(26px); opacity: 0; } }
.pig.sad .mouth { transform-box: fill-box; transform-origin: 50% 50%; transform: scaleY(-1) translateY(-6px); }
.pig.jump { animation: jump .8s var(--pop); }
@keyframes jump { 0%, 100% { transform: none; } 40% { transform: translateY(-34px) rotate(-8deg) scale(1.06); } 70% { transform: translateY(0) scale(1.06, .92); } }
.pig .hat { transform-box: fill-box; transform-origin: 50% 100%; animation: hat 5s ease-in-out infinite; }
@keyframes hat { 0%, 80%, 100% { transform: none; } 88% { transform: translateY(-9px) rotate(-7deg); } }

/* ---------- nav ---------- */
#nav { position: fixed; z-index: 5; bottom: calc(var(--sab) + 10px); left: 50%; width: min(calc(100% - 24px), 496px); transform: translate(-50%, 150%); display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 24px;
  background: rgba(23, 11, 51, .92); box-shadow: inset 0 0 0 2px var(--line), 0 10px 30px rgba(0, 0, 0, .5); transition: transform .45s var(--pop); }
#nav.show { transform: translate(-50%, 0); }
#nav button { position: relative; display: grid; justify-items: center; gap: 1px; padding: 7px 0 5px; border-radius: 18px; font-size: 11.5px; white-space: nowrap; font-weight: 700; color: #a999dc; transition: .2s; }
#nav svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--pop); }
#nav button.on { color: var(--ink); background: var(--bulb); box-shadow: 0 4px 0 var(--bulb-d); } #nav button.on svg { transform: translateY(-2px) scale(1.12); }
#nav .dot { position: absolute; top: 5px; inset-inline-end: 22%; width: 10px; height: 10px; border-radius: 50%; background: var(--tomato); display: none; box-shadow: 0 0 0 2px var(--ink); } #nav .dot.on { display: block; }

/* ---------- cards / forms ---------- */
.card, .opts, .codebox { background: rgba(23, 11, 51, .72); border-radius: 22px; padding: 16px; box-shadow: inset 0 0 0 2px var(--line); margin-bottom: 14px; }
.card.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; } .card.row small { display: block; color: #b9a8ea; font-size: 12.5px; }
.inp { width: 100%; min-height: 50px; border-radius: 15px; border: 0; padding: 8px 16px; background: var(--cream); color: var(--ink); font: 700 17px var(--body); box-shadow: inset 0 3px 0 rgba(0, 0, 0, .14); user-select: text; -webkit-user-select: text; }
.inp::placeholder { color: #a391b8; font-weight: 500; } .inp.ltr { text-align: left; }
.inp.code { text-align: center; font-size: 34px; letter-spacing: 12px; font-family: var(--display); }
.dim { font-size: 13px; color: #b9a8ea; } h4 { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 16px 4px 8px; color: var(--bulb); }
.empty { text-align: center; padding: 34px 20px; display: grid; gap: 14px; justify-items: center; color: #d9cef8; } .empty .big { font-size: 60px; line-height: 1; } .empty.small { padding: 16px; }
.linkbtn { display: block; width: 100%; text-align: start; padding: 12px 2px; color: #d9cef8; font-weight: 700; border-top: 1px solid rgba(255, 255, 255, .1); }
.tog { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 12px; font-weight: 700; }
.tog input { position: absolute; opacity: 0; } .tog i { width: 56px; height: 32px; border-radius: 20px; background: #4a3a80; position: relative; transition: .2s; box-shadow: inset 0 3px 0 rgba(0, 0, 0, .25); }
.tog i::after { content: ''; position: absolute; top: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--cream); transition: .25s var(--pop); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.tog input:checked + i { background: var(--mint); } .tog input:checked + i::after { inset-inline-start: 28px; }
.tog input:focus-visible + i { outline: 3px solid var(--bulb); outline-offset: 2px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #24135c; border-radius: 14px; padding: 4px; margin-bottom: 10px; }
.tabs button { padding: 9px; border-radius: 11px; font-weight: 800; color: #b9a8ea; } .tabs button.on { background: var(--cream); color: var(--ink); }
#accForm, .addf { display: grid; gap: 10px; margin-top: 10px; } .addf { grid-template-columns: 1fr auto; margin: 0 0 8px; }

/* profile */
.mecard { display: grid; justify-items: center; gap: 12px; }
.av.huge { width: 104px; height: 104px; font-size: 62px; box-shadow: 0 0 0 5px var(--pink), 0 8px 0 rgba(0, 0, 0, .3); }
.av.huge i { position: absolute; bottom: -8px; font: 800 12px var(--body); background: var(--bulb); color: var(--ink); padding: 1px 10px; border-radius: 10px; }
#nameForm { display: grid; grid-template-columns: 1fr auto; gap: 8px; width: 100%; align-items: center; } #nameForm .inp { text-align: center; }
.xp { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; width: 100%; font-size: 13px; font-weight: 700; }
.xp .bar { height: 14px; border-radius: 8px; background: #24135c; overflow: hidden; direction: ltr; } .xp .bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--mint), var(--bulb)); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; text-align: center; font-size: 12.5px; color: #cbbcf5; }
.stats div { background: #24135c; border-radius: 14px; padding: 8px 2px; } .stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.2; color: var(--cream); }
.avgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avgrid button { aspect-ratio: 1; border-radius: 18px; background: #2d1a66; font-size: 34px; } .avgrid button.on { background: var(--bulb); box-shadow: 0 4px 0 var(--bulb-d); }

/* friends + leaderboard rows */
.frow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; border-radius: 18px; background: rgba(23, 11, 51, .72); box-shadow: inset 0 0 0 2px var(--line); }
.frow > div { flex: 1; min-width: 0; display: grid; line-height: 1.3; } .frow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .frow small { color: #b9a8ea; font-size: 12.5px; text-align: start; }
.frow em { font-style: normal; font-size: 13px; color: #b9a8ea; font-weight: 700; }
.frow .av i { position: absolute; bottom: 0; inset-inline-end: 0; width: 13px; height: 13px; border-radius: 50%; background: #7a6aa8; box-shadow: 0 0 0 3px var(--ink); } .frow .av i.on { background: #4be36f; }
.frow .x { width: 34px; height: 34px; border-radius: 50%; color: #8f7fc4; } .frow .rk { width: 26px; text-align: center; font-family: var(--display); font-size: 20px; color: var(--bulb); }
.frow.me { box-shadow: inset 0 0 0 2px var(--bulb); }
.podium3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; margin: 6px 0 18px; direction: ltr; }
.pd { display: grid; justify-items: center; gap: 2px; text-align: center; direction: rtl; } .pd b { font-size: 13.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pd small { font-size: 12px; color: #cbbcf5; }
.pd .av { width: 56px; height: 56px; font-size: 34px; }
.pd .step { width: 100%; margin-top: 6px; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, var(--plum), #24135c); font-family: var(--display); font-size: 30px; display: grid; place-items: center; animation: grow .7s var(--pop) both; transform-origin: bottom; }
.pd.r1 .step { height: 92px; background: linear-gradient(180deg, var(--bulb), #c98a0c); color: var(--ink); } .pd.r2 .step { height: 66px; animation-delay: .1s; } .pd.r3 .step { height: 48px; animation-delay: .2s; }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }

/* ---------- map ---------- */
.world { --wc: #6ed06a; --wd: #2b7d3a; border-radius: 26px; padding: 14px 14px 18px; margin-bottom: 16px; background: linear-gradient(160deg, var(--wc), var(--wd)); box-shadow: 0 7px 0 rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .35); position: relative; overflow: hidden; }
.world::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 12% 0%, rgba(255, 255, 255, .35), transparent 42%); pointer-events: none; }
.world header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; position: relative; }
.world .wi { font-size: 40px; line-height: 1; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .25)); } .world h3 { font-family: var(--display); font-weight: 400; font-size: 27px; line-height: 1.15; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .28); } .world small { font-weight: 700; font-size: 12.5px; color: rgba(255, 255, 255, .88); }
.w-beach { --wc: #5cc4f0; --wd: #1d7fb8; } .w-forest { --wc: #4caf6c; --wd: #1e6b41; } .w-city { --wc: #8f8cf2; --wd: #4a3fb0; } .w-underwater { --wc: #3aa8e0; --wd: #0b4f8a; }
.w-toys { --wc: #ffad5c; --wd: #d9601c; } .w-winter { --wc: #a9d9f5; --wd: #4d8fc0; } .w-space { --wc: #7a4fd6; --wd: #1f1150; } .w-picnic { --wc: #ff8d85; --wd: #c9382f; }
.world.locked { filter: saturate(.35) brightness(.72); }
.nodes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px 8px; position: relative; }
.node { position: relative; aspect-ratio: 1; border-radius: 50%; background: var(--cream); color: var(--ink); display: grid; place-items: center; box-shadow: 0 5px 0 rgba(0, 0, 0, .32), inset 0 -4px 0 rgba(0, 0, 0, .1); animation: nodein .5s var(--pop) both; animation-delay: calc(var(--i) * 35ms); }
.node b { font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1; }
@keyframes nodein { from { transform: scale(0); } to { transform: none; } }
.node:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .32); }
.node.lock { background: rgba(23, 11, 51, .45); box-shadow: none; } .node.lock b { font-size: 16px; }
.node.cur { background: var(--bulb); box-shadow: 0 5px 0 var(--bulb-d), 0 0 0 0 rgba(255, 216, 74, .8); animation: nodein .5s var(--pop) both, pulse 1.4s .6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 5px 0 var(--bulb-d), 0 0 0 0 rgba(255, 244, 222, .85); } 100% { box-shadow: 0 5px 0 var(--bulb-d), 0 0 0 16px rgba(255, 244, 222, 0); } }
.node .st { position: absolute; bottom: -9px; display: flex; gap: 1px; direction: ltr; } .node.lock .st { display: none; }
.node .st i, .res-stars i { width: 13px; height: 13px; background: #4a3a80; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
.node .st i.on { background: var(--bulb); filter: drop-shadow(0 1px 0 #7a5200); }

/* ---------- lobby ---------- */
.codebox { text-align: center; display: grid; gap: 10px; justify-items: center; } .codebox small { font-weight: 700; color: #cbbcf5; }
.digits { display: flex; gap: 8px; direction: ltr; }
.digits i { font: 400 40px/1 var(--display); font-style: normal; width: 48px; height: 62px; display: grid; place-items: center; border-radius: 12px; color: var(--bulb); background: linear-gradient(180deg, #130830 49%, #000 50%, #1b0d42 52%); box-shadow: inset 0 0 0 2px #40268f, 0 5px 0 rgba(0, 0, 0, .35); animation: flip .5s var(--pop) both; text-shadow: 0 0 14px rgba(255, 216, 74, .7); }
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; margin: 6px 0 16px; }
.vp { display: grid; justify-items: center; gap: 3px; padding: 16px 6px 12px; border-radius: 22px; background: rgba(23, 11, 51, .72); box-shadow: inset 0 0 0 3px var(--c, var(--line)); text-align: center; animation: slidein .5s var(--pop) both; min-width: 0; }
.vp.p0 { --c: var(--p0); --x: 60px; } .vp.p1 { --c: var(--p1); --x: -60px; }
@keyframes slidein { from { transform: translateX(var(--x, 0)) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.vp .av { width: 68px; height: 68px; font-size: 42px; box-shadow: 0 0 0 4px var(--c, var(--line)), 0 5px 0 rgba(0, 0, 0, .3); }
.vp b { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 6px; } .vp small { font-size: 12px; color: #cbbcf5; }
.vp .tag { margin-top: 5px; font: 800 12px var(--body); padding: 2px 12px; border-radius: 10px; background: #3a2a70; color: #cbbcf5; }
.vp.ready .tag { background: var(--c); color: var(--ink); animation: tagpop .4s var(--pop); } .vp.ready .av { animation: bob 1s ease-in-out infinite; }
@keyframes tagpop { from { transform: scale(0); } to { transform: none; } }
.vp.off { opacity: .55; } .vp.empty { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .16); } .vp.empty .av { background: transparent; color: #8f7fc4; box-shadow: inset 0 0 0 3px #5a4a94; font-family: var(--display); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.1); opacity: .6; } }
.vs { font: 400 38px/1 var(--display); color: var(--bulb); text-shadow: 0 4px 0 var(--bulb-d), 0 0 22px rgba(255, 216, 74, .7); transform: rotate(-8deg); direction: ltr; animation: vs 1.2s ease-in-out infinite alternate; }
@keyframes vs { to { transform: rotate(-8deg) scale(1.14); } }
.opt + .opt { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.opt label { display: block; font-weight: 800; font-size: 13.5px; color: var(--bulb); margin-bottom: 8px; } .opt p { font-size: 13px; color: #cbbcf5; margin-top: 8px; line-height: 1.7; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #24135c; border-radius: 15px; padding: 4px; gap: 2px; }
.seg button { padding: 9px 4px; border-radius: 12px; font-weight: 800; font-size: 15px; color: #b9a8ea; transition: .18s; } .seg button.on { background: var(--cream); color: var(--ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.stepper { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; text-align: center; background: #24135c; border-radius: 15px; padding: 4px; }
.stepper button { height: 46px; border-radius: 12px; background: var(--plum); font: 400 28px/1 var(--display); box-shadow: 0 3px 0 rgba(0, 0, 0, .3); } .stepper button:disabled { opacity: .3; } .stepper button:active:not(:disabled) { transform: translateY(2px); }
.stepper b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; line-height: 1.2; } .stepper small { font-size: 12.5px; color: #cbbcf5; }
.opts.locked .seg, .opts.locked .stepper { pointer-events: none; opacity: .7; } .opts.locked .stepper button { visibility: hidden; } .lock-note { font-size: 12.5px; color: #b9a8ea; margin-top: 12px; text-align: center; }
.inv { display: flex; flex-wrap: wrap; gap: 8px; } .inv button { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border-radius: 22px; background: #24135c; font-weight: 700; font-size: 14px; } .inv em { font-style: normal; background: var(--pink); color: var(--ink); border-radius: 12px; padding: 1px 10px; font-size: 12.5px; }
.lobby-foot { padding: 10px 2px 4px; }

/* ---------- game ---------- */
#s-game { padding: calc(var(--sat) + 6px) 8px calc(var(--sab) + 6px); max-width: none; align-items: center; --chrome: 176px; }
.hud { width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; height: 62px; flex: none; }
.pchip { --c: var(--p0); display: flex; align-items: center; gap: 7px; min-width: 0; padding: 4px; border-radius: 30px; background: rgba(23, 11, 51, .8); box-shadow: inset 0 0 0 2.5px var(--c); position: relative; transition: opacity .3s; }
.pchip.p1 { --c: var(--p1); } .pchip:last-child { flex-direction: row-reverse; }
.pchip .av { width: 40px; height: 40px; font-size: 25px; box-shadow: 0 0 0 2.5px var(--c); }
.pchip .info { flex: 1; min-width: 0; display: grid; gap: 3px; } .pchip:last-child .info { justify-items: end; }
.pchip b { font-size: 12px; font-weight: 800; line-height: 1.25; overflow: hidden; white-space: nowrap; max-width: 100%; display: flex; align-items: center; } .pchip em { font-style: normal; font-size: 10px; background: var(--c); color: var(--ink); border-radius: 6px; padding: 0 5px; margin-inline-start: 4px; flex: none; }
.pips { display: flex; gap: 3px; direction: ltr; } .pips i { width: 9px; height: 9px; border-radius: 50%; background: #3a2a70; transition: .3s var(--pop); } .pips i.on { background: var(--c); transform: scale(1.25); box-shadow: 0 0 8px var(--c); }
.pchip .sc { font: 400 28px/1 var(--display); color: var(--c); min-width: 26px; text-align: center; padding-inline: 4px; }
.pchip.bump { animation: bump .45s var(--pop); } @keyframes bump { 40% { transform: scale(1.16); } }
.pchip.off { opacity: .45; } .pchip.scored::after { content: 'یکی پیدا کرد!'; position: absolute; top: 100%; inset-inline: 0; margin-top: 4px; text-align: center; font: 800 12px var(--body); color: var(--c); animation: fadeup .9s both; }
.pchip.iced { box-shadow: inset 0 0 0 2.5px #9fe3ff, 0 0 18px #6cd0ff; } .pchip.iced .av::after { content: '❄️'; position: absolute; font-size: 20px; top: -8px; inset-inline-end: -8px; animation: tagpop .3s var(--pop); }
.pchip.inked .av::after { content: '🦑'; position: absolute; font-size: 20px; top: -8px; inset-inline-end: -8px; }
@keyframes fadeup { from { opacity: 0; transform: translateY(-6px); } 30% { opacity: 1; transform: none; } to { opacity: 0; } }
.clock { position: relative; width: 58px; height: 58px; display: grid; place-items: center; }
.clock svg { position: absolute; inset: 0; transform: rotate(-90deg); } .clock circle { fill: none; stroke-width: 6; } .clock .trk { stroke: #24135c; fill: rgba(23, 11, 51, .8); } .clock .arc { stroke: var(--bulb); stroke-linecap: round; stroke-dasharray: 170; transition: stroke-dashoffset .12s linear; }
.clock b { position: relative; font: 400 23px/1 var(--display); } .clock.hot .arc { stroke: var(--tomato); } .clock.hot { animation: thump .5s infinite; } .clock.hot b { color: var(--tomato); }
@keyframes thump { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.18); } }

.board { position: relative; flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.pic { position: relative; height: min(calc((100dvh - var(--chrome) - var(--sat) - var(--sab)) / 2), calc((100vw - 16px) * .75)); aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #24135c; box-shadow: 0 0 0 3px var(--cream), 0 6px 0 3px rgba(0, 0, 0, .35); touch-action: none; cursor: crosshair; }
.pic .scene, .pic .marks, .pic .fxl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; } .pic .marks, .pic .fxl { pointer-events: none; overflow: hidden; }
.pic .loading { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: #b9a8ea; font-size: 14px; }
.midbar { height: 30px; flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 560px; position: relative; font-size: 12.5px; font-weight: 700; color: #cbbcf5; }
.quit { position: absolute; inset-inline-end: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(23, 11, 51, .8); color: #a999dc; font-size: 13px; }
@media (orientation: landscape) and (min-width: 700px) {
  .board { flex-direction: row; gap: 10px; } .midbar { position: absolute; top: -4px; width: auto; }
  .pic { height: min(calc(100dvh - var(--chrome)), calc((100vw - 40px) / 2 * .75)); }
}
.mark .ring { fill: none; stroke: var(--c, #fff); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw .45s ease-out forwards; }
.mark .under { fill: none; stroke: #fff; stroke-width: 10; opacity: 0; animation: appear .3s .35s forwards; }
.mark .glow { fill: var(--c, #fff); opacity: 0; animation: flash .6s ease-out; }
.mark.p0 { --c: var(--p0); } .mark.p1 { --c: var(--p1); } .mark.missed { --c: #fff; } .mark.missed .ring { stroke-dasharray: 5 5; stroke-width: 4; animation: none; stroke-dashoffset: 0; } .mark.missed .under { display: none; }
.mark.still .ring { animation: none; stroke-dashoffset: 0; } .mark.still .under { animation: none; opacity: .9; } .mark.still .glow { animation: none; }
@keyframes draw { to { stroke-dashoffset: 0; } } @keyframes appear { to { opacity: .9; } } @keyframes flash { 0% { opacity: .75; } 100% { opacity: 0; } }
.fxl i { position: absolute; font-style: normal; }
.rip { width: 12%; aspect-ratio: 1; margin: -6% 0 0 -6%; border-radius: 50%; border: 3px solid #fff; animation: rip .45s ease-out forwards; } @keyframes rip { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.miss { transform: translate(-50%, -50%); font: 900 44px/1 var(--body); color: var(--tomato); text-shadow: 0 0 0 #fff, 0 3px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff; animation: missx .9s var(--pop) forwards; } @keyframes missx { 0% { transform: translate(-50%, -50%) scale(0) rotate(-40deg); } 30% { transform: translate(-50%, -50%) scale(1.2); } 80% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
.hintring { aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 4px dashed var(--bulb); box-shadow: 0 0 0 3px rgba(23, 11, 51, .5), inset 0 0 30px rgba(255, 216, 74, .35); animation: hint 3.6s ease-in-out forwards; } @keyframes hint { 0% { transform: translate(-50%, -50%) scale(2.4) rotate(0); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1) rotate(40deg); opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1) rotate(200deg); opacity: 0; } }
.inkblob { aspect-ratio: 1; transform: translate(-50%, -50%) scale(0); background: radial-gradient(circle at 35% 30%, #3a3350, #0b0717 60%); animation: ink var(--life, 4s) cubic-bezier(.2, 1.4, .4, 1) forwards; filter: drop-shadow(0 6px 0 rgba(11, 7, 23, .9)); }
@keyframes ink { 0% { transform: translate(-50%, -50%) scale(0); } 6% { transform: translate(-50%, -50%) scale(1.1); } 10%, 80% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -30%) scale(.9, 1.2); opacity: 0; } }
.board.shake { animation: shake .4s; } @keyframes shake { 20% { transform: translate(-9px, 3px) rotate(-.6deg); } 40% { transform: translate(8px, -3px) rotate(.6deg); } 60% { transform: translate(-6px, 2px); } 80% { transform: translate(4px, -1px); } }
.board.frozen .pic { filter: saturate(.45) brightness(.8); cursor: not-allowed; }
.board.frozen .pic::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 5px var(--tomato), inset 0 0 40px rgba(255, 90, 77, .55); border-radius: inherit; }
.board.iced .pic { filter: saturate(.3) brightness(1.05) hue-rotate(170deg); }
.board.iced .pic::after { content: '❄️'; display: grid; place-items: center; font-size: 60px; box-shadow: inset 0 0 0 5px #9fe3ff, inset 0 0 70px rgba(160, 228, 255, .9); background: linear-gradient(135deg, rgba(200, 240, 255, .5), rgba(120, 200, 255, .25) 40%, rgba(220, 245, 255, .5)); animation: icein .35s var(--pop); }
@keyframes icein { from { opacity: 0; transform: scale(1.3); } }

.veil { position: absolute; inset: -4px; z-index: 3; display: none; place-items: center; border-radius: 20px; background: repeating-linear-gradient(-45deg, #2d1a66 0 22px, #3a2386 22px 44px); box-shadow: 0 0 0 3px var(--cream); text-align: center; }
.veil.on { display: grid; align-items: start; } .veil.open { animation: veilout .55s cubic-bezier(.7, 0, .3, 1) forwards; } @keyframes veilout { to { clip-path: circle(0 at 50% 50%); opacity: .6; } }
.veil-in { display: grid; gap: 2px; justify-items: center; padding: 20px; margin-top: 5vh; animation: rise .5s var(--pop) both; } .veil .wi { font-size: 74px; line-height: 1.1; animation: bob 1.4s ease-in-out infinite; }
.veil b { font: 400 46px/1.2 var(--display); text-shadow: 0 4px 0 var(--pink-d); } .veil em { font-style: normal; font-weight: 800; color: var(--bulb); font-size: 19px; } .veil p { font-size: 14px; color: #d9cef8; margin-top: 10px; max-width: 250px; }
.count { position: fixed; z-index: 6; left: 50%; top: 68%; width: 176px; height: 176px; margin: -88px 0 0 -88px; border-radius: 50%; display: none; place-items: center; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, #5a33c9, #170b33 74%); box-shadow: 0 0 0 6px var(--cc, var(--bulb)), 0 10px 0 6px rgba(0, 0, 0, .4), 0 0 70px 10px color-mix(in srgb, var(--cc, var(--bulb)) 55%, transparent); }
.count.on { display: grid; } .count.go { --cc: var(--mint); }
.count i { position: absolute; inset: -20px; border-radius: 50%; border: 5px dotted var(--cc, var(--bulb)); opacity: .85; animation: spin 5s linear infinite; }
.count b { font: 400 118px/1 var(--display); color: var(--cc, var(--bulb)); text-shadow: 0 6px 0 rgba(0, 0, 0, .45), 0 0 34px var(--cc, var(--bulb)); padding-top: 10px; }
.count.go b { font-size: 62px; padding-top: 0; }
.count.pop { animation: discpop .95s var(--pop) both; } .count.pop b { animation: numpop .95s var(--pop) both; }
@keyframes discpop { 0% { transform: scale(.3); opacity: 0; } 22% { transform: scale(1.08); opacity: 1; } 34%, 80% { transform: scale(1); opacity: 1; } 100% { transform: scale(.92); opacity: 1; } }
@keyframes numpop { 0% { transform: scale(2.6) rotate(-18deg); opacity: 0; } 30% { transform: none; opacity: 1; } 80% { transform: none; opacity: 1; } 100% { transform: scale(.5); opacity: 0; } }
.banner { position: fixed; z-index: 6; top: 46%; left: 0; right: 0; text-align: center; pointer-events: none; font: 400 54px/1.2 var(--display); color: #fff; opacity: 0; text-shadow: 0 5px 0 var(--pink-d), 0 0 40px rgba(255, 126, 176, .9); }
.banner.on { animation: banner 1.3s var(--pop) both; } .banner.combo { color: var(--bulb); text-shadow: 0 5px 0 #d9601c, 0 0 40px rgba(255, 140, 66, .9); } .banner.bad { color: #bfeaff; text-shadow: 0 5px 0 #2a7fb0, 0 0 40px rgba(108, 208, 255, .9); } .banner.rushb { color: var(--tomato); text-shadow: 0 5px 0 #8a1a12, 0 0 44px rgba(255, 90, 77, .9); } .banner.sent { font-size: 38px; color: var(--mint); text-shadow: 0 4px 0 var(--mint-d); }
@keyframes banner { 0% { transform: translateX(60%) skewX(-16deg) scale(.6); opacity: 0; } 22% { transform: none; opacity: 1; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: translateX(-60%) skewX(16deg) scale(.7); opacity: 0; } }
.rushfx { position: fixed; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 60px 8px rgba(255, 90, 77, .7); z-index: 2; } .rush .rushfx { animation: rushp .55s ease-in-out infinite alternate; } @keyframes rushp { from { opacity: .15; } to { opacity: .8; } }
.rush .pic { box-shadow: 0 0 0 3px var(--bulb), 0 6px 0 3px rgba(0, 0, 0, .35), 0 0 26px rgba(255, 216, 74, .8); }

.dock { position: relative; width: 100%; max-width: 560px; height: 70px; flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: end; padding-top: 8px; }
.pw { position: relative; height: 56px; border-radius: 17px; background: linear-gradient(180deg, #4b2fa8, #34208a); box-shadow: 0 5px 0 #1d0f4c, inset 0 2px 0 rgba(255, 255, 255, .22); display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; column-gap: 6px; line-height: 1.15; }
.pw:active { transform: translateY(4px); box-shadow: 0 1px 0 #1d0f4c; } .pw span { font-size: 24px; grid-row: span 2; } .pw b { font-size: 13px; font-weight: 800; text-align: start; align-self: end; } .pw i { font-style: normal; font-size: 10.5px; color: var(--mint); font-weight: 700; text-align: start; align-self: start; } .pw.paid i { color: var(--bulb); }
.pw.emo b { grid-row: span 2; align-self: center; } .board.frozen ~ .dock .pw[data-k] { filter: saturate(.2) brightness(.7); }
.emofan { position: absolute; bottom: 74px; inset-inline-end: 0; display: none; gap: 6px; padding: 8px; border-radius: 22px; background: rgba(23, 11, 51, .95); box-shadow: inset 0 0 0 2px var(--line), 0 10px 30px rgba(0, 0, 0, .5); z-index: 4; } .emofan.on { display: flex; animation: rise .3s var(--pop); }
.emofan button { width: 44px; height: 44px; font-size: 28px; border-radius: 50%; } .emofan button:active { transform: scale(1.3); }
.emote { position: fixed; z-index: 7; font-size: 64px; line-height: 1; pointer-events: none; transform: translate(-50%, 0); animation: emote 2s var(--pop) forwards; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .3)); } @keyframes emote { 0% { transform: translate(-50%, 0) scale(0) rotate(-30deg); } 15% { transform: translate(-50%, 10px) scale(1.2) rotate(8deg); } 30%, 75% { transform: translate(-50%, 14px) scale(1); opacity: 1; } 100% { transform: translate(-50%, 60px) scale(.7); opacity: 0; } }
.fly { position: fixed; z-index: 7; pointer-events: none; font: 400 44px/1 var(--display); color: var(--p0); text-shadow: 0 3px 0 rgba(0, 0, 0, .4), 0 0 16px currentColor; } .fly.p1 { color: var(--p1); }

/* ---------- result ---------- */
.result { position: fixed; inset: 0; z-index: 8; display: none; place-items: center; padding: 20px; background: rgba(18, 9, 44, .82); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.result.on { display: grid; animation: fadein .3s; } @keyframes fadein { from { opacity: 0; } }
.res-card { --rc: var(--bulb); position: relative; width: min(100%, 380px); padding: 86px 20px 20px; border-radius: 30px; text-align: center; background: linear-gradient(180deg, #4b2aa9, #24125a); box-shadow: 0 0 0 4px var(--rc), 0 10px 0 4px rgba(0, 0, 0, .4), 0 30px 60px rgba(0, 0, 0, .6); animation: cardin .6s var(--pop) both; }
@keyframes cardin { from { transform: translateY(80px) scale(.6) rotate(6deg); opacity: 0; } }
.res-card.lose { --rc: #8f7fc4; } .res-card.draw { --rc: var(--mint); }
.res-rays { position: absolute; top: -150px; left: 50%; width: 420px; height: 420px; margin-left: -210px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(255, 216, 74, .32) 0 10deg, transparent 10deg 20deg); -webkit-mask: radial-gradient(circle, #000 20%, transparent 68%); mask: radial-gradient(circle, #000 20%, transparent 68%); animation: spin 14s linear infinite; pointer-events: none; z-index: -1; } @keyframes spin { to { transform: rotate(360deg); } }
.res-card.lose .res-rays { display: none; }
.res-pig { position: absolute; top: -78px; left: 50%; width: 150px; margin-left: -75px; animation: bob 1.4s ease-in-out infinite; } .res-card.win .res-pig { animation: dance .7s ease-in-out infinite alternate; } @keyframes dance { from { transform: rotate(-9deg) translateY(0); } to { transform: rotate(9deg) translateY(-12px); } }
.res-card h2 { font: 400 62px/1.15 var(--display); color: var(--rc); text-shadow: 0 5px 0 rgba(0, 0, 0, .35), 0 0 34px color-mix(in srgb, var(--rc) 60%, transparent); animation: letter .6s .2s var(--pop) both; }
.res-sub { font-size: 14.5px; color: #d9cef8; font-weight: 700; }
.res-stars { display: flex; justify-content: center; gap: 10px; margin: 14px 0 12px; direction: ltr; } .res-stars i { width: 52px; height: 52px; background: #3a2a70; } .res-stars i:nth-child(2) { transform: translateY(-9px) scale(1.18); }
.res-stars i.got { background: linear-gradient(180deg, #fff3a8, var(--bulb) 50%, #f0a80c); animation: starin .5s var(--pop) var(--d) both; filter: drop-shadow(0 0 12px rgba(255, 216, 74, .9)); } @keyframes starin { from { scale: 0; rotate: -160deg; } to { scale: 1; rotate: 0deg; } }
.res-score { display: flex; align-items: center; justify-content: center; gap: 14px; font: 400 46px/1 var(--display); margin-bottom: 12px; } .res-score span { display: flex; align-items: center; gap: 8px; color: var(--p0); min-width: 0; } .res-score span.p1 { color: var(--p1); } .res-score em { font: 800 12.5px var(--body); color: #d9cef8; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .res-score i { font-style: normal; color: #7a6aa8; }
.res-reward { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; } .res-reward > span { background: #1d0f4c; border-radius: 14px; padding: 5px 12px; font-weight: 800; font-size: 14px; animation: rise .5s 1.3s var(--pop) both; }
.res-actions { display: grid; gap: 10px; } .res-wait { min-height: 22px; margin-top: 8px; font-size: 13.5px; font-weight: 700; color: var(--mint); }

/* ---------- sheets, toasts, overlays ---------- */
.sheet { position: fixed; inset: 0; z-index: 9; display: none; align-items: flex-end; justify-content: center; } .sheet.on { display: flex; }
.sheet-bg { position: absolute; inset: 0; background: rgba(18, 9, 44, .7); animation: fadein .25s; }
.sheet-card { position: relative; width: min(100%, 520px); max-height: 86dvh; overflow-y: auto; padding: 26px 20px calc(var(--sab) + 22px); border-radius: 30px 30px 0 0; background: linear-gradient(180deg, #432798, #24125a); box-shadow: 0 -4px 0 var(--pink), 0 -20px 50px rgba(0, 0, 0, .5); display: grid; gap: 12px; text-align: center; animation: sheetin .4s var(--pop); }
@keyframes sheetin { from { transform: translateY(100%); } }
.sheet-card h3 { font: 400 27px/1.3 var(--display); } .sheet-card p { color: #d9cef8; font-size: 14.5px; } .sheet-card h4 { text-align: start; margin: 8px 0 0; }
.inv-pop { display: grid; justify-items: center; gap: 10px; } .av.big { width: 84px; height: 84px; font-size: 52px; box-shadow: 0 0 0 4px var(--pink); animation: jump .8s var(--pop); }
.credits { text-align: start; font-size: 13px; display: grid; gap: 4px; } .credits p { font-size: 13px; } .credits a { color: var(--bulb); }
#toasts { position: fixed; z-index: 10; top: calc(var(--sat) + 12px); left: 0; right: 0; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: var(--cream); color: var(--ink); font-weight: 800; font-size: 14.5px; padding: 9px 18px; border-radius: 18px; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); animation: toastin .4s var(--pop); transition: .3s; max-width: 100%; text-align: center; }
.toast.bad { background: var(--tomato); color: #fff; } .toast.out { opacity: 0; transform: translateY(-14px); } @keyframes toastin { from { transform: translateY(-40px) scale(.7); opacity: 0; } }
.offline { position: fixed; z-index: 10; bottom: calc(var(--sab) + 96px); left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bulb); font-weight: 800; font-size: 13.5px; padding: 8px 18px; border-radius: 18px; box-shadow: inset 0 0 0 2px var(--bulb); transition: .3s; white-space: nowrap; } .offline.on { opacity: 1; transform: translate(-50%, 0); }
#curtain { position: fixed; inset: 0; z-index: 11; pointer-events: none; background: radial-gradient(circle, #ff9cc4, var(--pink) 40%, #c9357a); clip-path: circle(0 at 50% 50%); }
#curtain.in { animation: cin .28s cubic-bezier(.7, 0, .8, 1) forwards; } #curtain.out { animation: cout .36s cubic-bezier(.2, 0, .3, 1) forwards; }
@keyframes cin { from { clip-path: circle(0 at 50% 62%); } to { clip-path: circle(120% at 50% 62%); } } @keyframes cout { from { clip-path: circle(120% at 50% 38%); } to { clip-path: circle(0 at 50% 38%); } }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 12; pointer-events: none; }

@media (max-height: 640px) { .marquee { margin-top: 8px; } .logo { font-size: 44px; } .btn.big { min-height: 56px; font-size: 23px; } .bubble { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .mark .ring { stroke-dashoffset: 0; } .mark .under { opacity: .9; }
}

/* ---------- level twists ---------- */
.pic .scene { z-index: 0; } .pic .marks { z-index: 2; } .pic .fxl { z-index: 3; } .pic::after { z-index: 4; }
.pic::before { content: none; position: absolute; z-index: 1; pointer-events: none; }
[data-tw="mirror"] #picB .scene, [data-tw="mirror"] #picB .marks, [data-tw="mirror"] #picB .fxl { transform: scaleX(-1); }
[data-tw="flip"] #picB .scene, [data-tw="flip"] #picB .marks, [data-tw="flip"] #picB .fxl { transform: rotate(180deg); }
[data-tw="noir"] .pic .scene { filter: grayscale(1) contrast(1.08); }
[data-tw="fog"] .pic::before { content: ''; inset: -10% -60%; opacity: .92;
  background: radial-gradient(ellipse 22% 34% at 18% 30%, #fff 0, #fffc 40%, #fff0 70%), radial-gradient(ellipse 26% 30% at 46% 72%, #fff 0, #fffc 40%, #fff0 70%), radial-gradient(ellipse 20% 38% at 70% 26%, #fff 0, #fffb 40%, #fff0 70%), radial-gradient(ellipse 24% 30% at 92% 68%, #fff 0, #fffc 40%, #fff0 70%);
  animation: fog 11s ease-in-out infinite alternate; }
@keyframes fog { from { transform: translateX(-22%); } to { transform: translateX(22%); } }
[data-tw="spot"] .pic::before { content: ''; inset: -100%; background: radial-gradient(circle closest-side, #0000 0 15%, rgba(8, 4, 24, .55) 19%, rgba(8, 4, 24, .96) 25%); animation: spotx 5.3s ease-in-out infinite alternate, spoty 3.7s ease-in-out infinite alternate; }
@keyframes spotx { from { translate: -13% 0; } to { translate: 13% 0; } }
@keyframes spoty { from { transform: translateY(-11%); } to { transform: translateY(11%); } }
[data-tw="quake"] .pic { animation: quake 3.6s linear infinite; } [data-tw="quake"] #picB { animation-delay: -.12s; }
@keyframes quake { 0%, 58%, 100% { transform: none; } 62% { transform: translate(-7px, 4px) rotate(-1.2deg); } 68% { transform: translate(8px, -5px) rotate(1.4deg); } 74% { transform: translate(-6px, -3px) rotate(-.9deg); } 80% { transform: translate(7px, 5px) rotate(1deg); } 86% { transform: translate(-4px, 2px) rotate(-.6deg); } 92% { transform: translate(3px, -2px); } }
[data-tw="blitz"] .clock .arc { stroke: var(--tomato); } [data-tw="blitz"] .clock { animation: thump 1s infinite; }
.twbig { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 4px 18px 4px 14px; border-radius: 22px; background: var(--bulb); color: var(--ink); font: 400 24px/1.3 var(--display); box-shadow: 0 5px 0 var(--bulb-d); animation: tagpop .5s .25s var(--pop) both; } .twbig i { font-style: normal; font-size: 22px; }
.twtag { display: inline-block; margin-top: 4px; padding: 0 10px; border-radius: 10px; background: var(--bulb); color: var(--ink); font: 800 12px/1.7 var(--body); }
.node .tw { position: absolute; top: -7px; inset-inline-start: -5px; font-style: normal; font-size: 15px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .3)); } .node.lock .tw { opacity: .6; }

/* ---------- shop ---------- */
button.coins { color: inherit; font: inherit; font-weight: 800; font-size: 17px; cursor: pointer; } button.coins:active { transform: scale(.94); }
button.coins::after { content: '+'; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--mint); color: var(--ink); font: 900 16px/1 var(--body); }
#shopSub { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--cream); font-size: 14px; }
.trial { background: var(--bulb); color: var(--ink); font-weight: 800; font-size: 13.5px; line-height: 1.7; padding: 10px 14px; border-radius: 16px; box-shadow: 0 4px 0 var(--bulb-d); }
.sgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .sgrid.g-power, .sgrid.g-avatar { grid-template-columns: repeat(4, 1fr); }
.sitem { display: grid; justify-items: center; gap: 2px; padding: 12px 4px 8px; border-radius: 20px; background: linear-gradient(180deg, #4b2fa8, #2d1a66); box-shadow: 0 5px 0 #1d0f4c, inset 0 2px 0 rgba(255, 255, 255, .2); animation: nodein .4s var(--pop) both; }
.sitem:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #1d0f4c; }
.sitem .ic { font-size: 38px; line-height: 1.1; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .25)); } .sitem b { font-size: 13px; font-weight: 800; } .sitem small { font-size: 11.5px; color: #cbbcf5; }
.sitem em { font-style: normal; margin-top: 4px; padding: 1px 10px; border-radius: 11px; background: var(--cream); color: var(--ink); font-weight: 800; font-size: 12.5px; white-space: nowrap; }
.sitem.k-coins { background: linear-gradient(180deg, #ffe98a, #f5bf2a); color: var(--ink); box-shadow: 0 5px 0 #b17a08, inset 0 2px 0 rgba(255, 255, 255, .5); } .sitem.k-coins small { color: #6b4a00; font-weight: 700; } .sitem.k-coins em { background: var(--ink); color: var(--bulb); }
.sitem.own { opacity: .55; } .sitem.own em { background: var(--mint); }
