:root {
  --ink: #123a26;
  --ink2: #24513a;
  --cream: #fffaf0;
  --cream2: #f4ecd8;
  --yellow: #ffd93b;
  --yellow2: #f2b90c;
  --green: #00a651;
  --green2: #0b7d43;
  --lime: #9be15d;
  --blue: #2356c7;
  --red: #ff5a4f;
  --pink: #ff7ab0;
  --hard: 0 4px 0 rgba(18, 58, 38, .9);
  --hard2: 0 3px 0 rgba(18, 58, 38, .9);
  --head: 'Lilita One', 'Trebuchet MS', 'Arial Black', system-ui, sans-serif;
  --body: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  --safeb: env(safe-area-inset-bottom, 0px);
  --safet: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2f7d3c; font-family: var(--body); color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; font-weight: 700; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
svg { display: block; width: 100%; height: 100%; }
.ico { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -0.28em; flex: none; }
.ico.inl { width: 1.1em; height: 1.1em; }
.hidden { display: none !important; }
small { font-weight: 700; }

.sticker { background: var(--cream); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--hard); pointer-events: auto; }
.sticker.small { border-width: 2px; border-radius: 10px; box-shadow: var(--hard2); }

/* ------------------------------------------------ top left */
#tl { position: absolute; left: 12px; top: calc(10px + var(--safet)); display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
#wallet { display: flex; gap: 8px; align-items: center; padding: 5px 16px 6px 9px; min-width: 150px; }
#wallet .ico { width: 34px; height: 34px; }
#wallet b { display: block; font: 400 28px/1 var(--head); letter-spacing: .3px; color: var(--ink); font-variant-numeric: tabular-nums; }
#wallet small { display: block; font-size: 11px; font-weight: 800; color: #5c7a65; line-height: 1.15; white-space: nowrap; }
#wallet.bump { animation: bump .22s ease; }
@keyframes bump { 40% { transform: scale(1.07) rotate(-1deg); } }
#lvlbox { display: flex; align-items: center; gap: 7px; padding: 3px 9px 3px 4px; border-radius: 999px; }
#lvlnum { background: var(--green); color: #fff; border-radius: 999px; min-width: 25px; height: 25px; padding: 0 5px; display: flex; align-items: center; justify-content: center; font: 400 15px var(--head); border: 2px solid var(--ink); }
.xp { width: 80px; height: 9px; border-radius: 9px; background: #d9d2bf; overflow: hidden; border: 2px solid var(--ink); }
.xp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #4cd964, #b4f05d); transform-origin: left; transform: scaleX(0); transition: transform .3s; }
#bootsbox { display: flex; align-items: center; gap: 2px; font: 400 16px var(--head); }
#bootsbox .ico { width: 19px; height: 19px; }

/* ------------------------------------------------ top centre */
#tc { position: absolute; left: 50%; top: calc(8px + var(--safet)); transform: translateX(-50%); width: min(44vw, 480px); text-align: center; }
#hname { font: 400 19px/1.15 var(--head); color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 6px rgba(18, 58, 38, .55); display: flex; gap: 8px; justify-content: center; align-items: center; margin-bottom: 4px; white-space: nowrap; }
.stars { display: inline-flex; gap: 1px; align-items: center; }
.stars i { display: inline-block; width: 15px; height: 15px; color: rgba(255, 255, 255, .28); }
.stars i.on { color: var(--yellow); filter: drop-shadow(0 1px 0 rgba(18, 58, 38, .8)); }
#pbar { position: relative; height: 24px; background: rgba(18, 58, 38, .92); border-radius: 12px; overflow: hidden; border: 3px solid var(--ink); box-shadow: var(--hard); }
#pfill { position: absolute; inset: 0; background: linear-gradient(90deg, #2fc760, #a7ee5a); transform-origin: left; transform: scaleX(0); }
#pbar em { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .22); }
#pbar em:nth-of-type(1) { left: 25%; } #pbar em:nth-of-type(2) { left: 50%; } #pbar em:nth-of-type(3) { left: 75%; }
#ptext { position: absolute; inset: 0; font: 400 15px/18px var(--head); color: #fff; text-shadow: 0 1.5px 0 var(--ink), 0 0 4px var(--ink); }
#nextgoal { margin-top: 6px; padding: 3px 11px 5px; display: inline-flex; flex-direction: column; font-size: 12.5px; font-weight: 800; color: var(--ink); gap: 2px; min-width: 170px; }
#nextgoal b { font-weight: 900; }
.gbar { display: block; height: 5px; background: #d9d2bf; border-radius: 5px; overflow: hidden; }
.gbar i { display: block; height: 100%; width: 100%; background: var(--green); transform-origin: left; transform: scaleX(0); transition: transform .2s; }
#nextgoal.ready { background: var(--yellow); animation: wig 1.1s infinite; }
#nextgoal.ready .gbar i { background: var(--ink); }
@keyframes wig { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-1.8deg) scale(1.03); } 88% { transform: rotate(1.8deg) scale(1.03); } }

/* ------------------------------------------------ top right */
#tr { position: absolute; right: 12px; top: calc(10px + var(--safet)); display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
#miniwrap { padding: 0; overflow: hidden; background: rgba(18, 58, 38, .82); pointer-events: none; }
#mini { display: block; width: 170px; height: 130px; }
#menu { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mbtn { position: relative; display: flex; align-items: center; gap: 7px; padding: 4px 11px 4px 6px; border-radius: 12px; font: 400 14px var(--head); transition: transform .12s; }
.mbtn .ico { width: 27px; height: 27px; }
.mbtn:hover { transform: translateX(-3px); }
.mbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(18, 58, 38, .9); }
.mbtn.active { background: var(--yellow); }
.mbtn.alert { background: #fff3b5; animation: wig 1.6s infinite; }
.dot { position: absolute; left: -5px; top: -5px; width: 15px; height: 15px; border-radius: 50%; background: var(--red); border: 2.5px solid var(--ink); opacity: 0; transform: scale(.3); transition: .15s; }
.dot.on { opacity: 1; transform: scale(1); }

/* ------------------------------------------------ left: contracts */
#contracts { position: absolute; left: 12px; top: calc(112px + var(--safet)); display: flex; flex-direction: column; gap: 5px; width: 214px; }
.con { display: flex; gap: 6px; align-items: center; padding: 4px 7px; font-size: 11.5px; line-height: 1.12; font-weight: 800; pointer-events: none; animation: slidein .3s; }
@keyframes slidein { from { transform: translateX(-26px); opacity: 0; } }
.con > .ico { width: 21px; height: 21px; }
.ctext { flex: 1; min-width: 0; }
.cbar { display: block; height: 5px; margin-top: 3px; background: #d9d2bf; border-radius: 5px; overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--green); transform-origin: left; }
.crew { font: 400 12px var(--head); color: var(--green2); white-space: nowrap; }
.crew .ico { width: 13px; height: 13px; }

/* ------------------------------------------------ Neymar */
#ney { position: absolute; left: 12px; bottom: calc(14px + var(--safeb)); display: flex; align-items: flex-end; gap: 0; transform: translateX(-120%); opacity: 0; transition: transform .28s cubic-bezier(.3, 1.4, .5, 1), opacity .2s; width: calc(50vw - min(25vw, 330px) - 22px); min-width: 200px; max-width: 400px; z-index: 3; }
#ney.on { transform: none; opacity: 1; }
#neyface { width: 74px; height: 74px; flex: none; filter: drop-shadow(0 3px 0 rgba(18, 58, 38, .85)); z-index: 2; }
#neytext { background: var(--cream); border: 3px solid var(--ink); border-radius: 14px 14px 14px 2px; padding: 7px 11px; font-size: 13.5px; line-height: 1.22; font-weight: 800; box-shadow: var(--hard); margin: 0 0 6px -9px; }

/* ------------------------------------------------ bottom */
#bottom { position: absolute; left: 50%; bottom: calc(10px + var(--safeb)); transform: translateX(-50%); width: min(50vw, 660px); min-width: 460px; display: flex; flex-direction: column; gap: 7px; align-items: stretch; }
#flowrow { display: flex; gap: 7px; align-items: center; }
#flow { position: relative; flex: 1; height: 21px; border-radius: 12px; background: rgba(18, 58, 38, .92); border: 3px solid var(--ink); overflow: hidden; box-shadow: var(--hard2); }
#flowfill { position: absolute; inset: 0; background: linear-gradient(90deg, #ff9d3d, #ffd93b); transform-origin: left; transform: scaleX(0); transition: transform .12s linear; }
#flowtxt { position: absolute; inset: 0; text-align: center; font: 400 13px/15px var(--head); color: #fff; text-shadow: 0 1.5px 0 var(--ink), 0 0 4px var(--ink); white-space: nowrap; overflow: hidden; }
#flow em { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .22); }
#flow.fever { animation: feverpulse .36s infinite; border-color: #a85f00; }
#flow.fever #flowfill { background: linear-gradient(90deg, #ffe680, #fff6c8, #ffc83a); }
#flow.fever #flowtxt { color: var(--ink); text-shadow: none; }
@keyframes feverpulse { 50% { transform: scale(1.015); box-shadow: 0 0 18px #ffd93b; } }

#cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.ucard { position: relative; display: grid; grid-template-columns: 34px 1fr; grid-template-areas: 'i n' 'i f' 'p p' 'c c'; gap: 0 6px; text-align: left; padding: 5px 7px 6px; background: var(--cream2); border: 3px solid var(--ink); border-radius: 14px; box-shadow: var(--hard); pointer-events: auto; transition: transform .1s, background .15s; overflow: hidden; }
.ucard:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(18, 58, 38, .9); }
.uico { grid-area: i; width: 34px; height: 34px; align-self: center; }
.uname { grid-area: n; font: 400 15px/1 var(--head); display: flex; justify-content: space-between; }
kbd { font: 800 9.5px var(--body); background: rgba(18, 58, 38, .13); padding: 1px 4px; border-radius: 4px; color: var(--ink2); }
.ufx { grid-area: f; font-size: 10.5px; line-height: 1.12; font-weight: 800; color: #4a6653; min-height: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upips { grid-area: p; display: flex; gap: 2.5px; margin: 3px 0 3px; font-size: 10.5px; font-weight: 900; color: var(--ink2); min-height: 8px; }
.upips i { flex: 1; height: 7px; border-radius: 3px; background: rgba(18, 58, 38, .16); }
.upips i.on { background: var(--green); }
.ucost { grid-area: c; text-align: center; font: 400 15px/1 var(--head); padding: 3px 0 4px; border-radius: 7px; background: rgba(18, 58, 38, .1); color: #6b7a6f; }
.ucard.can { background: #fff7cd; animation: canbounce 1.7s infinite; }
.ucard.can .ucost { background: var(--yellow); color: var(--ink); box-shadow: inset 0 -2px 0 var(--yellow2); }
.ucard.maxed .ucost { background: transparent; color: var(--green2); font-size: 12px; }
@keyframes canbounce { 0%, 88%, 100% { transform: translateY(0); } 94% { transform: translateY(-4px); } }

#hint { position: absolute; left: 50%; bottom: calc(174px + var(--safeb)); transform: translateX(-50%); padding: 9px 18px; background: rgba(18, 58, 38, .9); color: #fff; border-radius: 14px; font: 400 19px/1.2 var(--head); text-align: center; animation: hintb 1.4s infinite; white-space: nowrap; }
@keyframes hintb { 50% { transform: translateX(-50%) translateY(-6px); } }

/* ------------------------------------------------ banners, pops */
#banner { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -30%) scale(.6); opacity: 0; text-align: center; transition: .22s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; white-space: nowrap; z-index: 4; }
#banner.on { opacity: 1; transform: translate(-50%, -30%) scale(1); }
#banner b { display: block; font: 400 clamp(38px, 7.4vw, 86px)/.98 var(--head); color: var(--yellow); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); letter-spacing: 1px; }
#banner small { display: block; font: 400 clamp(15px, 2.3vw, 24px)/1.2 var(--head); color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 6px var(--ink); margin-top: 4px; }
#banner.foul b { color: #ff5a4f; }
#banner.var b { color: #fff; font-size: clamp(30px, 5vw, 56px); }
#banner.goal b { color: #fff; }
#banner.level b { color: #9be15d; font-size: clamp(30px, 5vw, 58px); }
#banner.gold b { color: #ffd93b; }
#vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s; box-shadow: inset 0 0 120px 30px rgba(255, 196, 40, .65); }
#vignette.on { opacity: 1; animation: vig .36s infinite alternate; }
@keyframes vig { to { box-shadow: inset 0 0 150px 46px rgba(255, 210, 60, .78); } }
#pops { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.pop { position: absolute; transform: translate(-50%, -50%); font: 400 20px var(--head); color: #fff; -webkit-text-stroke: 2.4px var(--ink); paint-order: stroke fill; animation: popup .85s cubic-bezier(.2, .7, .3, 1) forwards; white-space: nowrap; will-change: transform, opacity; }
.pop.big { font-size: 30px; color: var(--yellow); }
.pop.gold { font-size: 25px; color: var(--yellow); }
.pop.joga { color: var(--yellow); font-size: 24px; }
.pop.star { font-size: 34px; color: #fff; animation-duration: 1.3s; }
@keyframes popup { 0% { transform: translate(-50%, -30%) scale(.5); opacity: 0; } 15% { transform: translate(-50%, -60%) scale(1.14); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -190%) scale(.98); opacity: 0; } }
.coinfly { position: absolute; width: 22px; height: 22px; margin: -11px; animation: coinfly .62s cubic-bezier(.45, -.2, .6, 1) forwards; will-change: transform; }
@keyframes coinfly { to { transform: translate(var(--dx), var(--dy)) scale(.8); } }
#toasts { position: absolute; left: 12px; top: calc(246px + var(--safet)); display: flex; flex-direction: column; gap: 5px; align-items: flex-start; pointer-events: none; z-index: 5; width: min(300px, 80vw); }
.toast { padding: 7px 13px; font-size: 14px; font-weight: 800; animation: toast .32s cubic-bezier(.3, 1.5, .5, 1); transition: .3s; display: flex; gap: 10px; align-items: center; pointer-events: none; max-width: min(92vw, 430px); }
.toast.out { transform: translateY(-14px); opacity: 0; }
.toast .ico { width: 20px; height: 20px; }
.toast.item { background: #fff7cd; padding: 8px 14px 8px 8px; }
.toast.item img { width: 66px; height: 66px; border-radius: 10px; background: #ffe89a; flex: none; }
.toast.item small { color: #b86f00; font: 400 11px var(--head); letter-spacing: .6px; }
.toast.item b { display: block; font: 400 18px/1.05 var(--head); }
.toast.item p { margin: 2px 0; font-size: 12px; line-height: 1.15; font-weight: 700; color: #4a6653; }
.toast.item em { font: 400 14px var(--head); font-style: normal; color: var(--green2); }
.toast.contract { background: #e6ffd9; }
@keyframes toast { from { transform: translateY(-16px) scale(.85); opacity: 0; } }

/* ------------------------------------------------ panel */
#panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(460px, 100vw); background: var(--cream); border-left: 4px solid var(--ink); transform: translateX(104%); transition: transform .24s cubic-bezier(.25, 1, .4, 1); pointer-events: auto; display: flex; flex-direction: column; z-index: 8; box-shadow: -8px 0 28px rgba(0, 0, 0, .22); touch-action: pan-y; user-select: none; }
#panel.on { transform: none; }
#panel header { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safet)) 14px 10px; background: var(--green); border-bottom: 4px solid var(--ink); color: #fff; }
#panel h2 { margin: 0; font: 400 24px/1.05 var(--head); text-shadow: 0 2px 0 var(--ink); flex: 1; }
#pextra { font: 400 16px var(--head); }
#pextra small { font-weight: 800; }
.bootpill { display: inline-flex; gap: 4px; align-items: center; background: var(--cream); color: var(--ink); padding: 2px 10px 2px 5px; border-radius: 999px; border: 2px solid var(--ink); }
.bootpill .ico { width: 21px; height: 21px; }
#pclose { width: 36px; height: 36px; padding: 7px; background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: 10px; box-shadow: var(--hard2); }
#pbody { flex: 1; overflow-y: auto; padding: 10px 12px calc(24px + var(--safeb)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.ptip { margin: 0 2px 10px; font-size: 13px; font-weight: 700; line-height: 1.28; color: #4a6653; }
.ptip.small { font-size: 11px; margin-top: 12px; }
.ptip.keys { background: var(--cream2); padding: 8px 10px; border-radius: 10px; }
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; padding: 7px 12px; font: 400 15px/1.05 var(--head); background: #fff; border: 3px solid var(--ink); border-radius: 11px; box-shadow: var(--hard2); text-align: center; min-width: 66px; pointer-events: auto; color: var(--ink); transition: transform .08s; }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(18, 58, 38, .9); }
.btn b { font-weight: 400; }
.btn .ico { width: 21px; height: 21px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.buy { background: var(--cream2); flex: none; }
.btn.buy.can { background: var(--yellow); }
.btn.ghost { background: transparent; }
.btn.go { background: var(--green); color: #fff; text-shadow: 0 1.5px 0 var(--ink); }
.btn.go.can { background: var(--yellow); color: var(--ink); text-shadow: none; animation: wig 1.3s infinite; }
.btn.big { font-size: 18px; padding: 11px 16px; border-radius: 14px; box-shadow: var(--hard); }
.btn.big small { font: 800 12px var(--body); opacity: .85; }
.btn.danger { background: #ffe0dc; margin-top: 14px; width: 100%; }
.btn.big.danger { background: var(--red); color: #fff; width: auto; margin-top: 0; }
.btn.gold { background: var(--yellow); width: 100%; margin-top: 12px; }
.tag { font: 400 13px var(--head); background: var(--green); color: #fff; padding: 4px 9px; border-radius: 8px; border: 2px solid var(--ink); flex: none; }
.tog { margin-top: 4px; padding: 2px 9px; font: 800 11.5px var(--body); background: #e4dcc7; border: 2px solid var(--ink); border-radius: 8px; pointer-events: auto; }
.tog.on { background: #c9f3a8; }

.house, .mcard, .ccard, .gcard { display: flex; gap: 10px; padding: 8px; margin-bottom: 8px; border: 3px solid var(--ink); border-radius: 14px; background: #fff; box-shadow: var(--hard2); align-items: center; }
.house.current, .mcard.current { background: #e8ffd9; }
.nextup { background: #fff9dc !important; }
.hiddencard { background: #e8e2d0 !important; color: #5e6f63; box-shadow: none; border-style: dashed; }
.hthumb { position: relative; width: 104px; height: 78px; border-radius: 9px; background-size: cover; background-position: center; flex: none; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hthumb > svg { width: 34px; height: 34px; }
.badge { position: absolute; left: 0; right: 0; bottom: 0; background: var(--green); color: #fff; font: 400 9.5px/1.5 var(--head); text-align: center; letter-spacing: .4px; }
.hinfo, .minfo { flex: 1; min-width: 0; }
.hinfo h3, .minfo h3 { margin: 0; font: 400 16.5px/1.08 var(--head); }
.minfo h3 small { font: 800 11px var(--body); color: var(--green2); }
.place { margin: 1px 0 2px; font-size: 11.5px; font-weight: 800; color: #6b7a6f; }
.blurb { margin: 2px 0; font-size: 12px; line-height: 1.17; font-weight: 700; color: #4a6653; }
.meta { margin: 2px 0 0; font-size: 11.5px; font-weight: 800; color: var(--ink2); line-height: 1.2; }
.meta .next { color: var(--green2); }
.house .stars i { color: #d9d2bf; width: 16px; height: 16px; }
.house .stars i.on { color: var(--yellow2); filter: none; }
.house .stars small { margin-left: 5px; font-size: 11px; color: #6b7a6f; }
.house .stars small.items { color: var(--green2); }
.mthumb, .cthumb { width: 96px; height: 76px; flex: none; border-radius: 9px; background: linear-gradient(180deg, #d9f2c8, #a8dc8a); border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mthumb img, .cthumb img { width: 100%; height: 100%; object-fit: contain; }
.hiddencard .mthumb, .hiddencard .cthumb { background: #c8c2b0; }
.hiddencard .mthumb svg, .hiddencard .cthumb svg { width: 32px; height: 32px; }
.gico { width: 54px; height: 54px; padding: 7px; border-radius: 11px; background: #fff2c0; border: 2px solid var(--ink); flex: none; }

.apage { margin-bottom: 12px; }
.apage h3 { margin: 0 0 5px; font: 400 16px var(--head); }
.apage h3 em { font: 800 11px var(--body); color: var(--green2); font-style: normal; }
.agrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.acell { background: #ece6d4; border: 2px dashed #a29c88; border-radius: 10px; padding: 5px; min-height: 106px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.acell.got { background: #fff7cd; border: 2px solid var(--ink); }
.acell img { width: 58px; height: 58px; }
.acell b { font: 400 12px/1.05 var(--head); }
.acell small { font-size: 9.5px; line-height: 1.1; font-weight: 700; color: #5e6f63; }
.qm { font: 400 34px/1.5 var(--head); color: #a29c88; }

.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 2px dashed #e0d9c5; }
.setrow label { font: 400 15px var(--head); }
.setrow input[type=range] { width: 200px; accent-color: var(--green); pointer-events: auto; touch-action: none; }
.seg { display: flex; border: 2px solid var(--ink); border-radius: 9px; overflow: hidden; }
.seg button { padding: 3px 9px; font: 800 12px var(--body); background: #fff; pointer-events: auto; text-transform: capitalize; }
.seg button.on { background: var(--yellow); }
.stats { margin-top: 10px; background: var(--cream2); padding: 8px 12px; border-radius: 12px; }
.stats h3 { margin: 0 0 4px; font: 400 16px var(--head); }
.stats p { margin: 1px 0; display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.stats b { font-weight: 900; }

/* ------------------------------------------------ complete + modal */
#complete { position: absolute; left: 50%; bottom: calc(12px + var(--safeb)); transform: translateX(-50%); z-index: 6; width: min(96vw, 900px); pointer-events: auto; animation: rise .4s cubic-bezier(.3, 1.4, .5, 1); }
body.completing #bottom, body.completing #contracts { display: none; }
.ribbon { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 9px 14px; }
.rleft { text-align: center; }
.rleft h2 { margin: 0; font: 400 25px/1 var(--head); color: var(--green2); white-space: nowrap; }
.rleft .bigstars { display: flex; justify-content: center; gap: 2px; margin: 3px 0 0; }
.rleft .bigstars i { width: 25px; height: 25px; color: #e0d9c5; }
.rleft .bigstars i.on { color: var(--yellow2); }
.rleft .next { margin: 1px 0 0; font-size: 11.5px; font-weight: 700; color: #4a6653; line-height: 1.15; }
.rmid { min-width: 150px; }
.rbtns { display: flex; gap: 8px; }
.rbtns .btn { padding: 8px 12px; font-size: 16px; min-width: 124px; min-height: 58px; }
@keyframes rise { from { transform: translateX(-50%) translateY(50px); opacity: 0; } }
#modal { position: absolute; inset: 0; background: rgba(18, 58, 38, .55); display: flex; align-items: center; justify-content: center; z-index: 9; pointer-events: auto; padding: 16px; }
.cbox { padding: 12px 16px 14px; text-align: center; }
.cbox h2 { margin: 0; font: 400 32px/1 var(--head); color: var(--green2); }
.bigstars { display: flex; justify-content: center; gap: 4px; margin: 6px 0 1px; }
.bigstars i { width: 32px; height: 32px; color: #e0d9c5; }
.bigstars i.on { color: var(--yellow2); }
.bigstars i.fresh { animation: starpop .8s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes starpop { 0% { transform: scale(0) rotate(-90deg); } 100% { transform: scale(1) rotate(0); } }
.cbox .next { margin: 3px 0 8px; font-size: 13px; font-weight: 700; color: #4a6653; line-height: 1.25; }
.crow { display: flex; justify-content: space-between; font-size: 14px; font-weight: 800; padding: 3px 4px; border-bottom: 2px dashed #e0d9c5; gap: 12px; }
.crow b { font: 400 16px var(--head); color: var(--green2); white-space: nowrap; }
.crow em { font: 400 11px var(--head); font-style: normal; color: #fff; background: var(--red); padding: 1px 5px; border-radius: 5px; }
.cbtns { display: flex; gap: 8px; margin-top: 11px; }
.cbtns .btn { flex: 1; }
.welcome { max-width: 430px; }
.wface { width: 92px; height: 92px; margin: -2px auto 3px; }

/* ------------------------------------------------ fade + title */
#fade { position: absolute; inset: 0; background: #1d6b3d; opacity: 1; display: flex; align-items: center; justify-content: center; text-align: center; pointer-events: none; transition: opacity .32s; z-index: 20; opacity: 0; color: #fff; }
#fade.on { opacity: 1; pointer-events: auto; }
#fadecard small { font: 800 16px var(--body); opacity: .85; }
#fadecard h2 { margin: 2px 0 0; font: 400 clamp(32px, 6vw, 60px)/1 var(--head); color: var(--yellow); text-shadow: 0 4px 0 var(--ink); padding: 0 16px; }
#title { position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: auto; background: radial-gradient(ellipse at center, rgba(10, 40, 24, .12) 30%, rgba(10, 40, 24, .55) 100%); padding: 16px; }
.logo { display: flex; flex-direction: column; align-items: center; line-height: .9; transform: rotate(-3deg); animation: logoin .7s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes logoin { from { transform: rotate(-12deg) scale(.5); opacity: 0; } }
.logo span { display: block; font-family: var(--head); -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 0 9px 0 var(--ink); letter-spacing: 1.5px; }
.l1 { font-size: clamp(38px, 7.5vw, 76px); color: #fff; }
.l2 { font-size: clamp(66px, 14vw, 148px); color: var(--yellow); margin-top: .02em; }
.l3 { font-size: clamp(66px, 14vw, 148px); color: #7fe04f; margin-top: -.02em; }
.tag { margin: 18px 0 16px; font: 400 clamp(16px, 2.3vw, 24px) var(--head); color: #fff; text-shadow: 0 2px 0 var(--ink), 0 0 10px rgba(0, 0, 0, .45); }
.btn.play { font-size: clamp(22px, 3vw, 30px); padding: 13px 34px; background: var(--yellow); animation: wig 1.5s infinite; }
.how { margin: 16px 0 0; font-size: 14px; font-weight: 800; color: #fff; text-shadow: 0 1px 0 var(--ink), 0 0 6px rgba(0, 0, 0, .6); }

/* floating thumbstick */
#stick { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; pointer-events: none; transition: opacity .12s; }
#stick.on { opacity: 1; }
#stick::before { content: ''; position: absolute; width: 108px; height: 108px; left: -54px; top: -54px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .7); background: rgba(18, 58, 38, .22); }
#stick i { position: absolute; width: 50px; height: 50px; left: -25px; top: -25px; border-radius: 50%; background: rgba(255, 255, 255, .9); border: 3px solid var(--ink); }
body.nohud #hud { display: none; }

/* ------------------------------------------------ narrow / phones */
@media (max-width: 900px), (max-height: 560px) {
  #contracts { display: none; }
  #toasts { top: calc(96px + var(--safet)); }
  #bottom { width: min(96vw, 560px); min-width: 0; }
  .uname { font-size: 13px; }
  kbd { display: none; }
  .ufx { display: none; }
  .ucard { grid-template-columns: 26px 1fr; grid-template-areas: 'i n' 'i p' 'c c'; padding: 4px 5px 5px; }
  .uico { width: 26px; height: 26px; }
  .ucost { font-size: 13px; }
  #ney { width: auto; max-width: 72vw; bottom: calc(140px + var(--safeb)); }
  #neyface { width: 56px; height: 56px; }
  #neytext { font-size: 12px; }
  #mini { width: 112px; height: 86px; }
  .mlabel { display: none; }
  .mbtn { padding: 4px; }
  #tc { width: min(38vw, 340px); }
  #hname { font-size: 13px; }
  #hname .stars { display: none; }
  #nextgoal { font-size: 10.5px; min-width: 0; padding: 2px 7px 4px; }
  #wallet { min-width: 0; padding: 3px 10px 4px 5px; }
  #wallet b { font-size: 20px; }
  #wallet .ico { width: 25px; height: 25px; }
  #wallet small { font-size: 9.5px; }
  .xp { width: 48px; }
  #hint { font-size: 15px; bottom: calc(232px + var(--safeb)); white-space: normal; width: 80vw; }
}
@media (max-width: 760px) {
  .ribbon { grid-template-columns: 1fr; gap: 6px; padding: 8px 10px; }
  .rbtns .btn { flex: 1; min-width: 0; }
}
@media (max-width: 560px) {
  #tc { top: calc(102px + var(--safet)); left: 12px; right: 88px; transform: none; width: auto; }
  #hname { justify-content: flex-start; }
  #nextgoal { margin-top: 4px; }
  #toasts { top: calc(178px + var(--safet)); left: 50%; transform: translateX(-50%); align-items: center; }
  #banner { top: 32%; }
  #banner b { -webkit-text-stroke: 2px var(--ink); }
  .setrow input[type=range] { width: 150px; }
  .logo span { -webkit-text-stroke: 5px var(--ink); text-shadow: 0 6px 0 var(--ink); }
}
@media (max-height: 560px) {
  #tr { flex-direction: row-reverse; align-items: flex-start; }
  #menu { flex-direction: column; gap: 3px; }
  .mbtn .ico { width: 22px; height: 22px; }
  #mini { width: 96px; height: 72px; }
  .ucard { grid-template-areas: 'i n' 'i c'; padding: 3px 5px; }
  .upips { display: none; }
  #ney { bottom: calc(92px + var(--safeb)); }
  #hint { bottom: calc(100px + var(--safeb)); }
  #complete { bottom: 4px; }
  .cbox h2 { font-size: 22px; }
  .crow { font-size: 12px; padding: 1px 4px; }
}
