* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #07070F; color: #fff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.hidden { display: none !important; }
button, .btn { font: inherit; color: #fff; background: #16182e; border: 2px solid #2f3566; border-radius: 12px; padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center; }
button, .btn { transition: transform .18s cubic-bezier(.34,1.8,.64,1), box-shadow .2s; }
button:hover, .btn:hover { transform: translateY(-2px) scale(1.03); }
button:active, .btn:active { transform: scale(.9); transition-duration: .06s; }
button:disabled { opacity: .5; cursor: default; }
button.big { font-size: 26px; font-weight: 900; padding: 14px 40px; background: linear-gradient(135deg, #38BDF8, #7C3AED 60%, #E8197A); border-color: #9be7ff; box-shadow: 0 0 24px #38bdf888; letter-spacing: 2px; }
button.icon { background: none; border: none; font-size: 22px; padding: 4px 8px; }
button.tiny { font-size: 11px; padding: 3px 7px; border-radius: 8px; border-width: 1px; background: #20244a; }

#hud { height: 52px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; background: #0B0B16; border-bottom: 1px solid #2f3566; }
.hudmid { text-align: center; line-height: 1.05; }
#lvl { font-size: 12px; opacity: .7; letter-spacing: 1px; }
#timer { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
#timer.low { color: #ff3b3b; animation: pulse .5s infinite; }
.hudright { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
#bucks { font-size: 13px; font-weight: 700; }
@keyframes pulse { 50% { transform: scale(1.15); } }

#cv { flex: 1; width: 100%; min-height: 0; touch-action: none; display: block; }
#hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: 62px; background: #000c; border: 1px solid #38BDF8; border-radius: 999px; padding: 6px 14px; white-space: nowrap; z-index: 2; text-align: center; font-weight: 800; pointer-events: none; text-shadow: 0 2px 6px #000; font-size: 15px; }

#banner { height: 50px; flex: none; display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(45deg, #1c1c1c 0 10px, #222 10px 20px); border-top: 1px dashed #666; font-size: 13px; cursor: pointer; text-align: center; padding: 0 8px; }
#banner b { color: #ffcc33; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; z-index: 5; }
#title { background: radial-gradient(circle at 50% 30%, #1E1F3B, #07070F 70%); }
.logo { position: relative; }
.logo h1 { margin: 0; font-size: 52px; line-height: .9; font-weight: 1000; font-style: italic; background: linear-gradient(#ffffff, #67E8F9 45%, #A855F7); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(56,189,248,.6)); }
.applogo { width: 116px; height: 116px; display: block; margin: 0 auto 14px; filter: drop-shadow(0 0 18px rgba(56,189,248,.45)); animation: floaty 2.4s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
.flame { font-size: 60px; display: block; animation: flick .15s infinite alternate; }
@keyframes flick { to { transform: scale(1.06) rotate(-3deg); } }
.withads { display: inline-block; margin-top: 6px; background: #ffcc00; color: #000; padding: 2px 10px; transform: rotate(-4deg); font-weight: 700; font-size: 18px; border-radius: 4px; }
.sub { opacity: .8; font-size: 14px; margin: 0; }
.row { display: flex; gap: 10px; }
.row > * { min-width: 150px; }
.stats { font-size: 12px; opacity: .6; }

#clear { background: #07070Fee; }
#clear h2 { font-size: 34px; margin: 0; color: #ffcc33; }
#clearBody { font-size: 16px; line-height: 1.6; }
#clearBody .newitem { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #1d1010; }

#ad { background: #000; z-index: 20; }
.adtag { position: absolute; top: 12px; left: 12px; font-size: 12px; background: #ffcc00; color: #000; padding: 2px 8px; border-radius: 4px; font-weight: 700; max-width: 80%; text-align: left; }
.adcard { width: 100%; max-width: 380px; border-radius: 18px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 3px solid; animation: adin .35s ease-out; }
@keyframes adin { from { transform: scale(.6) rotate(-6deg); opacity: 0; } }
.adlogo { font-size: 84px; line-height: 1; }
.adlogo img { max-width: 220px; max-height: 120px; }
.adname { font-size: 28px; font-weight: 1000; }
.adtagline { font-size: 16px; opacity: .9; }
.adcta { margin-top: 6px; padding: 10px 22px; border-radius: 999px; font-weight: 800; color: #000; text-decoration: none; }
.adjoke { font-size: 13px; opacity: .7; max-width: 340px; }
#skipBtn { min-width: 140px; }
.adfoot { position: absolute; bottom: 14px; font-size: 12px; opacity: .6; }

#modal { background: #000c; z-index: 15; padding: 12px; }
.modalbox { background: #170c0c; border: 2px solid #5a2a20; border-radius: 16px; width: 100%; max-height: 92%; display: flex; flex-direction: column; overflow: hidden; }
.modalhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid #3a1a14; }
.modalhead h2 { margin: 0; font-size: 20px; }
#modalBody { overflow-y: auto; padding: 12px; text-align: left; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.card { background: #221212; border: 2px solid #333; border-radius: 12px; padding: 8px 6px; text-align: center; font-size: 11px; min-height: 104px; }
.card .em { font-size: 34px; }
.card .nm { font-weight: 700; font-size: 12px; margin: 2px 0; }
.card .fx { color: #8fd; font-size: 10px; }
.card.locked { opacity: .35; }
.r-common { border-color: #777; } .r-rare { border-color: #3fa9ff; } .r-epic { border-color: #b46cff; } .r-legendary { border-color: #ffcc33; box-shadow: 0 0 10px #ffcc3366; }
.ach { display: flex; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid #2a1515; }
.ach .em { font-size: 28px; width: 36px; text-align: center; }
.ach.locked { opacity: .4; }
.ach small { opacity: .7; display: block; }
.lootbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px; background: #2a1010; border-radius: 12px; }

#toasts { position: absolute; top: 60px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 30; }
.toast { background: #ffcc33; color: #000; font-weight: 800; padding: 8px 14px; border-radius: 12px; box-shadow: 0 4px 14px #0008; animation: tin 3.2s forwards; font-size: 14px; }
.toast small { display: block; font-weight: 500; }
@keyframes tin { 0% { transform: translateY(-20px); opacity: 0; } 8%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
.shake { animation: shake .4s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.advid { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.advid video { width: 100%; display: block; max-height: 42vh; }
.advid #unmute { position: absolute; right: 8px; bottom: 8px; }
.bonus { width: 100%; max-width: 380px; }
.bonusbar { height: 10px; background: #222; border-radius: 99px; overflow: hidden; border: 1px solid #444; }
#bonusFill { height: 100%; width: 0; background: linear-gradient(90deg, #ffcc33, #ff5a1a); transition: width .1s linear; }
#bonusText { font-size: 14px; margin-top: 6px; }
#bonusText.got { color: #ffcc33; font-weight: 900; }
#skipBtn.go { background: linear-gradient(#ffcc33, #ff7a1a); color: #000; font-weight: 900; border-color: #ffe08a; }
#mult { background: #ffcc33; color: #000; font-weight: 900; padding: 1px 6px; border-radius: 6px; font-size: 12px; animation: pulse 1s infinite; }
/* polish */
body { background: radial-gradient(circle at 50% 0%, #1E1F3B, #050509 70%); }
#hud { background: linear-gradient(#1a1c36, #0B0B16); border-bottom: 1px solid #38bdf844; box-shadow: 0 2px 12px #0008; }
#timer { background: #000a; border: 1px solid #ff7a1a66; border-radius: 10px; padding: 0 10px; min-width: 76px; }
#bucks { background: #000a; border-radius: 999px; padding: 2px 8px; border: 1px solid #ffcc3344; }
#banner { background: linear-gradient(90deg, #1a1208, #2a1a08, #1a1208); border-top: 1px solid #ffcc3355; }

/* phones with notches / home bars */
#app { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
html, body { -webkit-touch-callout: none; }

/* ---- juice ---- */
#playBtn { animation: playpulse 1.6s ease-in-out infinite; }
@keyframes playpulse { 0%,100% { transform: scale(1); box-shadow: 0 0 24px #38bdf888; } 50% { transform: scale(1.07) rotate(-1.5deg); box-shadow: 0 0 40px #a855f7cc; } }
#playBtn:active { animation: none; transform: scale(.9); }
.screen:not(.hidden) > * { animation: popin .45s cubic-bezier(.34,1.7,.64,1) both; }
.screen:not(.hidden) > *:nth-child(2) { animation-delay: .06s; } .screen:not(.hidden) > *:nth-child(3) { animation-delay: .12s; }
.screen:not(.hidden) > *:nth-child(4) { animation-delay: .18s; } .screen:not(.hidden) > *:nth-child(5) { animation-delay: .24s; } .screen:not(.hidden) > *:nth-child(6) { animation-delay: .3s; }
@keyframes popin { from { opacity: 0; transform: translateY(18px) scale(.85); } }
.logo h1 { animation: wobble 3.2s ease-in-out infinite; }
@keyframes wobble { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-2deg) scale(1.02) } 75% { transform: rotate(2deg) scale(1.02) } }
.withads { animation: tagbob 2s ease-in-out infinite; }
@keyframes tagbob { 0%,100% { transform: rotate(-4deg) } 50% { transform: rotate(-1deg) translateY(-3px) } }
.bump { display: inline-block; animation: bump .35s cubic-bezier(.34,1.8,.64,1); }
@keyframes bump { 40% { transform: scale(1.45); color: #FFC21A; } }
#hint:not(.hidden) { animation: hintpop .4s cubic-bezier(.34,1.8,.64,1); }
@keyframes hintpop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
#clear h2 { animation: cleartitle .7s cubic-bezier(.34,1.8,.64,1) both, wobble 2.4s 0.7s ease-in-out infinite; }
@keyframes cleartitle { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* coins this round -> doubled */
.coinx { display: flex; align-items: center; gap: 14px; font-size: 30px; font-weight: 1000; font-variant-numeric: tabular-nums; }
.coinx .cnow { color: #fff; transition: opacity .3s, transform .3s; }
.coinx .carrow { color: #67E8F9; animation: nudge .7s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(7px); } }
.coinx .cx2 { color: #FFC21A; text-shadow: 0 0 16px #ffc21a99; opacity: .55; transform: scale(.9); transition: opacity .2s, transform .2s; }
.coinx.got .cnow { opacity: .4; text-decoration: line-through; transform: scale(.85); }
.coinx.got .cx2 { opacity: 1; animation: cashpop .6s cubic-bezier(.34,1.8,.64,1) both, wobble 1.6s .6s ease-in-out infinite; }
@keyframes cashpop { from { transform: scale(.6); } 60% { transform: scale(1.35); } to { transform: scale(1.15); } }
.gc { display: inline-block; width: .85em; height: .85em; margin-right: .18em; vertical-align: -.08em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c2, #ffd23a 45%, #c98a00); box-shadow: inset 0 0 0 .08em #b07800, 0 0 .3em #ffc21a66; }
