/* Referrals share the SNAKE forest palette, fonts and native safe areas. */
#openReferrals{position:absolute;right:calc(var(--safe-right,0px) + 30px);top:calc(48% + 114px);transform:translateY(-50%);transform-origin:right center;scale:var(--menu-gui-scale,1);z-index:12;display:flex;align-items:center;justify-content:center;gap:8px;min-height:62px;padding:12px 14px;max-width:260px;box-sizing:border-box;border:4px solid #0b1709;border-radius:19px;background:var(--panel-fill);box-shadow:inset 0 0 0 2px #67853b,0 5px 0 #08100766;color:#dcfa9e;font:400 17px/1.15 var(--display);cursor:pointer;touch-action:manipulation}
#openReferrals>svg{width:26px;height:26px;flex:none;stroke:currentColor;fill:none;stroke-width:2.3}#openReferrals>img{width:25px;height:25px;flex:none}#openReferrals:hover{filter:brightness(1.12)}
#openReferrals[hidden],#referralsPanel[hidden],#referralsPanel [hidden],#referralThanks[hidden],#referralThanks [hidden],#referralToast[hidden],body.playing #openReferrals{display:none!important}
#referralsPanel,#referralThanks{position:fixed;inset:0;z-index:9500;display:grid;place-items:center;padding:calc(var(--safe-top,0px) + 16px) calc(var(--safe-right,0px) + 16px) calc(var(--safe-bottom,0px) + 16px) calc(var(--safe-left,0px) + 16px);background:#061006c9;backdrop-filter:blur(7px);color:#f7f6d9;touch-action:pan-y;overscroll-behavior:none}
.referral-card,.referral-thanks-card{position:relative;width:min(860px,100%);max-height:calc(var(--usable-height,100dvh) - 32px);min-width:0;display:flex;flex-direction:column;padding:20px 24px;border:4px solid #0c1b0c;border-radius:30px;background:radial-gradient(ellipse at 50% 10%,#25432988,transparent 65%),linear-gradient(145deg,#1c321f,#112417);box-shadow:inset 0 0 0 2px #a8d94a,0 15px 60px #0008;overflow:hidden;font:700 14px/1.4 var(--ui);box-sizing:border-box}
.referral-heading{display:flex;align-items:center;gap:10px;flex:none;margin-bottom:8px;min-width:0}.referral-heading h2{min-width:0;flex:1;margin:0;color:#fff8d5;font:400 clamp(26px,3vw,36px)/1.1 var(--display);text-shadow:0 3px #081407}.referral-count{display:inline-grid;place-items:center;min-width:42px;height:37px;margin-inline-start:10px;border:1px solid #93bc4f;border-radius:30px;background:#385324;color:#d5fb80;vertical-align:middle;font:700 20px var(--ui)}
#referralsPanel button,#referralThanks button{font-family:var(--ui);cursor:pointer;touch-action:manipulation}#referralsPanel button:focus-visible,#referralThanks button:focus-visible,#openReferrals:focus-visible{outline:3px solid #d6ff94;outline-offset:3px}#referralsPanel button:disabled{cursor:default}
.referral-icon-button{display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0;border:2px solid #0a170b;border-radius:12px;background:var(--panel-fill);box-shadow:inset 0 0 0 2px #789d3e,0 3px #07100666;color:#fff8d5;box-sizing:border-box}.referral-icon-button svg,#referralsPanel svg,#referralThanks svg{width:24px;height:24px;flex-shrink:0;overflow:visible;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.referral-icon-button:last-child{margin-inline-start:auto}
.referral-content{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#84b544 #152418;padding:0 3px 3px}.referral-subtitle{text-align:center;font-size:14px;color:#e3edce;margin:0 0 4px}.referral-hero{display:block;width:min(660px,100%);height:auto;aspect-ratio:976/232;object-fit:contain;margin:8px auto 12px;pointer-events:none}
.referral-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 12px}.referral-stat{display:flex;align-items:center;justify-content:center;gap:10px;padding:8px 10px;border:3px solid #0b190c;border-radius:18px;background:linear-gradient(135deg,#213820,#15281a);box-shadow:inset 0 0 0 1px #6e9143,0 3px #09140855;text-align:center;min-width:0}.referral-stat>span{color:#d4f990}.referral-stat svg,.referral-stat img{width:28px!important;height:28px!important;flex:none}.referral-stat small{display:block;font-size:11px;color:#e2e6d5}.referral-stat strong{font:400 25px/1.1 var(--display);color:#c4f76a;overflow-wrap:anywhere}
.referral-milestones{padding:11px 12px 9px;border:2px solid #789d3e;border-radius:20px;background:#0d201488;margin-bottom:12px}.referral-milestones h3{margin:0 0 10px;color:#f9f4d7;font:400 19px/1.2 var(--display)}.referral-goals{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:9px}.referral-goal{display:flex;flex-direction:column;align-items:center;gap:4px;padding:7px 3px;border:1px solid #466a3b;border-radius:14px;background:linear-gradient(#243b26,#14291c);min-width:0}.referral-goal>strong{font:400 20px var(--display);color:#e9f1c8}.referral-goal>svg{width:25px!important;height:25px!important;color:#8d9c82;opacity:.7}.referral-goal>span{font-size:10px;color:#c9d2bc}.referral-goal>small{font-size:10px;color:#90aa7b}.referral-rule{margin:9px 0 0;text-align:center;color:#acbea2;font-size:12px}
.referral-overview-actions{flex:none;margin-top:6px;display:grid;grid-template-columns:minmax(150px,1.25fr) .8fr .8fr minmax(150px,1.25fr);align-items:stretch;gap:11px}.referral-code-box{display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:0;gap:4px;padding:8px;border:2px solid #527637;border-radius:15px;background:#102516}.referral-code-box small{color:#bfcdaa;font-size:11px}.referral-code-box strong{font:700 13px/1.2 var(--ui);letter-spacing:.5px;color:#edfacb;overflow-wrap:anywhere}
.referral-primary,.referral-secondary{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:7px 10px;border:3px solid #0b190c;border-radius:17px;background:linear-gradient(#d4ff83,#b5ed52);box-shadow:inset 0 0 0 1px #efffbd,0 3px #08150788;color:#162c0b;font:400 18px/1.1 var(--display)!important}.referral-secondary{background:linear-gradient(#344f29,#192f1b);box-shadow:inset 0 0 0 1px #7da53e,0 3px #08150788;color:#f4f6d3;font-size:14px!important}.referral-primary:hover,.referral-secondary:hover{filter:brightness(1.1)}.referral-primary:disabled{filter:grayscale(.8);opacity:.55}.referral-primary>span,.referral-secondary>span{display:contents}.referral-secondary>small{display:grid;place-items:center;min-width:26px;height:26px;padding:0 4px;border-radius:50%;background:#c0f568;color:#1c340f;font:800 13px var(--ui)}
#referralFallback{width:100%;min-height:44px;border:1px solid #809d4f;border-radius:10px;padding:10px;color:#f2f7d7;background:#0d2014;font:700 13px var(--ui);margin-top:12px;box-sizing:border-box}#referralStatus{color:#e4eecc;font-size:13px;line-height:1.4;margin:12px 0 0;flex:none}
.referral-rows{display:flex;flex-direction:column;gap:12px;padding:8px 5px 5px 0}.referral-friend{display:grid;grid-template-columns:66px minmax(90px,1fr) minmax(155px,1.4fr) 91px 130px;align-items:center;gap:15px;border:2px solid #486834;border-radius:20px;background:linear-gradient(120deg,#2b4025,#1c301f);padding:13px 15px;min-width:0}.referral-friend[data-status=ready]{border-color:#b4e660;box-shadow:inset 0 0 20px #b1ed4310}.referral-avatar{display:grid;place-items:center;position:relative;width:64px;height:64px;border:3px solid #09190c;border-radius:50%;background:radial-gradient(ellipse at 40% 20%,#5c912c,#173b1a);box-shadow:inset 0 0 0 1px #a8d84a;overflow:hidden;box-sizing:border-box}.referral-avatar>img{width:100%;height:100%;object-fit:cover}.referral-snake-mark{position:relative;font:400 54px/1 var(--display);color:#d0f577;transform:rotate(-7deg);text-shadow:0 2px #244917}.referral-snake-mark>i{position:absolute;width:5px;height:5px;border:1.5px solid #fcffe7;border-radius:50%;background:#142d16;right:4px;top:10px}.referral-snake-mark>i+i{top:17px}.referral-friend-info{display:flex;flex-direction:column;gap:5px;min-width:0}.referral-friend-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:400 23px/1.1 var(--display);color:#fff8d9}.referral-friend-level{font:800 13px var(--ui);color:#87dce1}.referral-progress{display:grid;grid-template-columns:minmax(60px,1fr) auto;gap:5px 10px;min-width:0}.referral-segments{display:flex;gap:3px;border:2px solid #081609;border-radius:15px;background:#0b1b10;padding:3px;min-width:0;align-self:center}.referral-segments>i{display:block;height:14px;flex:1;border-radius:7px;background:#354c36}.referral-segments>i.filled{background:linear-gradient(#d2ff81,#b4ed58);box-shadow:inset 0 1px #f2ffc8}.referral-progress>strong{font:800 13px var(--ui);align-self:center;white-space:nowrap}.referral-progress>small{grid-column:1/-1;color:#aabe9c;font-size:11px}.referral-friend[data-status=ready] .referral-progress>small{color:#d2ff83}.referral-friend-amount{display:flex;align-items:center;justify-content:center;gap:6px;font:400 24px var(--display);color:#ffda5c;white-space:nowrap}.referral-friend-amount>img{width:34px;height:34px}.referral-friend-action{min-width:0;display:flex;justify-content:center}.referral-claim{display:flex;align-items:center;justify-content:center;gap:7px;width:100%;min-height:49px;padding:8px;border:3px solid #11240a;border-radius:14px;background:linear-gradient(#caff77,#ace649);box-shadow:inset 0 0 0 1px #efffba,0 3px #09190788;color:#132b0b;font:400 22px/1 var(--display)!important}.referral-claim:disabled{background:linear-gradient(#434d45,#303b32);border-color:#1b241b;box-shadow:inset 0 0 0 1px #677466,0 3px #0a150a66;color:#9fa89b}.referral-claim>svg{width:18px!important;height:18px!important}.referral-completed{display:flex;align-items:center;gap:5px;color:#bfe77d;font-size:12px;line-height:1.2;text-align:center}.referral-completed>svg{width:20px!important;height:20px!important;flex:none}
.referral-empty{text-align:center;padding:45px 16px;color:#acbf9e}.referral-empty svg{width:45px!important;height:45px!important;color:#a6cf72}.referral-empty h3{font:400 24px var(--display);color:#f1f2d2;margin:12px 0 6px}.referral-empty p{margin:0;font-size:14px}.referral-list-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:17px;flex:none}.referral-pagination{display:flex;align-items:center;gap:10px}.referral-pagination button{font:700 12px var(--ui)!important;min-height:44px;padding:7px 12px}.referral-pagination button:disabled{opacity:.4}.referral-page{min-width:18px;text-align:center;color:#bfceae}
.referral-thanks-card{width:min(590px,100%);padding:30px 34px;text-align:center;align-items:center}.referral-thanks-card>h2{margin:0 0 12px;color:#fff8d4;font:400 clamp(29px,3.2vw,42px)/1.12 var(--display);text-shadow:0 3px #0c1a0b}.referral-reward-art{position:relative;display:grid;place-items:center;width:174px;height:174px;margin:4px auto;background:radial-gradient(ellipse,#e9e55e33,transparent 69%)}.referral-reward-art>img{width:158px;height:158px;object-fit:contain;filter:drop-shadow(0 6px 12px #0005)}.referral-reward-art>span{position:absolute;right:2px;bottom:3px;display:grid;place-items:center;width:44px;height:44px;border:3px solid #122510;border-radius:50%;background:#baf161;color:#204313}.referral-reward-art>span>svg{width:28px!important;height:28px!important;stroke-width:3!important}.referral-reward-total{display:flex;align-items:center;gap:9px;margin:7px 0 18px;color:#ffdc68;font:400 37px/1.1 var(--display);white-space:nowrap}.referral-reward-total>img{width:38px;height:38px}.referral-thanks-message{width:100%;padding:12px 15px;border:1px solid #658c3b;border-radius:13px;background:#112918;box-sizing:border-box;color:#dfe9bc;font-size:15px;overflow-wrap:anywhere;margin:0 0 13px}.referral-thanks-credited{color:#cef48b;font:800 17px var(--ui);margin:2px 0 7px}.referral-thanks-invite{color:#c1cfac;font-size:13px;line-height:1.5;margin:0 0 21px}.referral-thanks-card>.referral-primary{width:min(300px,100%)}#referralThanksStatus{font-size:12px;color:#ffdfb3;margin:10px 0 0}#referralThanksStatus:empty{display:none}
#referralToast{position:fixed;z-index:22000;left:50%;bottom:calc(var(--safe-bottom,0px) + 28px);transform:translateX(-50%);max-width:calc(100vw - 40px);padding:13px 24px;border:2px solid #9acb4f;border-radius:16px;background:#16331a;box-shadow:0 7px 30px #0007;color:#e5ffac;text-align:center;pointer-events:none;font:800 15px/1.35 var(--ui);box-sizing:border-box}

/* Shared, unclipped icons and the same forest button finish as Play with Friends. */
#openReferralsLabel{min-width:0;white-space:nowrap}
#openReferrals:hover{filter:brightness(1.08)}
#closeReferrals{border-radius:50%}
#closeReferrals>svg{width:20px;height:20px;stroke-width:2.8}
.referral-icon-button:hover{background:linear-gradient(#385128,#20351d);color:#fffde5}
.referral-empty>svg{width:48px!important;height:48px!important;stroke-width:1.8;display:block;margin:0 auto}
.referral-claim:disabled{opacity:1}
@media(max-width:1050px),(max-height:750px){
 .referral-card{width:min(800px,100%);padding:16px 20px}
 .referral-heading h2{font-size:30px}
 .referral-hero{width:min(600px,100%);margin:6px auto 9px}
 .referral-friend{grid-template-columns:55px minmax(80px,1fr) minmax(110px,1.25fr) 76px 110px;gap:10px;padding:11px 12px}
 .referral-avatar{width:54px;height:54px}.referral-friend-name{font-size:21px}
 .referral-friend-amount{font-size:21px}.referral-friend-amount>img{width:29px;height:29px}.referral-claim{font-size:20px!important}
}
@media(orientation:landscape) and (max-height:600px){
 #openReferrals{right:calc(var(--safe-right,0px) + 12px);top:calc(var(--safe-top,0px) + var(--usable-height,100dvh)*.5 + 56px);width:142px;min-height:44px;padding:6px 9px;gap:5px;border-width:3px;border-radius:15px;font-size:12px;scale:var(--mobile-menu-scale,var(--menu-gui-scale,1))}
 #openReferrals>svg{width:20px;height:20px}#openReferrals>img{display:none}#openReferralsLabel{white-space:normal;overflow-wrap:normal;word-break:normal}
 #referralsPanel,#referralThanks{padding:calc(var(--safe-top,0px) + 10px) calc(var(--safe-right,0px) + 12px) calc(var(--safe-bottom,0px) + 10px) calc(var(--safe-left,0px) + 12px)}
 .referral-card{width:min(660px,100%);max-height:calc(var(--usable-height,100dvh) - 20px);padding:10px 14px;border-radius:22px;font-size:12px}
 .referral-heading{margin-bottom:4px;gap:7px}.referral-heading h2{font-size:23px}.referral-count{height:25px;min-width:28px;font-size:14px}
 .referral-icon-button{width:36px;height:36px}.referral-subtitle{font-size:11px;margin:0;line-height:1.35}
 .referral-hero{width:min(520px,100%);max-height:116px;margin:5px auto 7px}
 .referral-stats{gap:7px;margin-bottom:7px}.referral-stat{padding:4px 7px;gap:6px;border-width:2px;border-radius:12px}
 .referral-stat svg,.referral-stat img{width:23px!important;height:23px!important}.referral-stat small{font-size:10px}.referral-stat strong{font-size:20px}
 .referral-milestones{padding:7px 8px 6px;margin-bottom:7px;border-radius:13px}.referral-milestones h3{font-size:15px;margin-bottom:5px}
 .referral-goals{gap:5px}.referral-goal{padding:4px 2px;gap:2px;border-radius:9px}.referral-goal>strong{font-size:16px}
 .referral-goal>svg{width:18px!important;height:18px!important}.referral-goal>span,.referral-goal>small{font-size:9px}.referral-rule{font-size:9px;margin-top:4px}
 .referral-overview-actions{grid-template-columns:minmax(122px,1.25fr) .7fr .7fr minmax(135px,1.3fr);gap:6px}
 .referral-code-box{gap:1px;padding:4px;border-radius:10px}.referral-code-box small{font-size:9px}.referral-code-box strong{font-size:10px;letter-spacing:0}
 .referral-primary,.referral-secondary{min-height:38px;padding:5px 7px;gap:5px;border-width:2px;border-radius:12px;font-size:15px!important}
 .referral-secondary{font-size:12px!important}.referral-primary svg,.referral-secondary svg{width:17px!important;height:17px!important}.referral-secondary>small{min-width:20px;height:20px;font-size:10px}
 .referral-rows{gap:7px;padding-top:3px}.referral-friend{grid-template-columns:42px minmax(72px,1fr) minmax(95px,1.3fr) 65px 84px;gap:8px;padding:7px 9px;border-radius:15px}
 .referral-avatar{width:42px;height:42px}.referral-snake-mark{font-size:37px}.referral-snake-mark>i{width:4px;height:4px;right:2px;top:6px;border-width:1px}.referral-snake-mark>i+i{top:12px}
 .referral-friend-name{font-size:17px}.referral-friend-level{font-size:10px}.referral-friend-info{gap:3px}.referral-progress{gap:3px 6px}.referral-progress>strong{font-size:10px}.referral-progress>small{font-size:9px}
 .referral-segments{padding:2px;gap:2px}.referral-segments>i{height:10px}.referral-friend-amount{font-size:18px;gap:4px}.referral-friend-amount>img{width:26px;height:26px}
 .referral-claim{min-height:38px;font-size:16px!important;border-width:2px;border-radius:10px}.referral-claim>svg{width:15px!important;height:15px!important}.referral-completed{font-size:10px}
 .referral-list-footer{margin-top:8px}.referral-pagination{gap:6px}.referral-pagination button{font-size:10px!important;min-height:36px;padding:5px 8px}
 #referralStatus{font-size:11px;margin-top:7px}.referral-empty{padding:22px 12px}.referral-empty h3{font-size:20px}.referral-empty p{font-size:12px}
 .referral-thanks-card{width:min(530px,100%);max-height:calc(var(--usable-height,100dvh) - 20px);padding:13px 18px;display:grid;grid-template-columns:125px minmax(0,1fr);column-gap:14px;row-gap:4px;align-items:center}
 .referral-thanks-card>h2{grid-column:1/-1;font-size:26px;margin:0 0 3px}.referral-reward-art{grid-column:1;grid-row:2/6;width:125px;height:125px;margin:0}.referral-reward-art>img{width:116px;height:116px}.referral-reward-art>span{width:32px;height:32px}
 .referral-reward-total{grid-column:2;font-size:24px;margin:5px 0 7px;justify-content:center}.referral-reward-total>img{display:none}.referral-thanks-message{grid-column:2;font-size:11px;padding:7px;margin:0 0 5px}
 .referral-thanks-credited{grid-column:2;font-size:12px;margin:0}.referral-thanks-invite{grid-column:2;font-size:11px;margin:0 0 4px}.referral-thanks-card>.referral-primary{grid-column:1/-1;width:min(210px,100%);justify-self:center;margin-top:3px}
 #referralThanksStatus{grid-column:1/-1;margin:0}#referralToast{bottom:calc(var(--safe-bottom,0px) + 12px);padding:10px 18px;font-size:12px}
}
@media(orientation:landscape) and (max-height:420px){
 .referral-card{padding:8px 12px}.referral-heading h2{font-size:21px}.referral-icon-button{width:32px;height:32px}.referral-subtitle{font-size:10px}
 .referral-stat>div{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0}.referral-stat small{font-size:9px;line-height:1.2}.referral-goal>strong{line-height:1.1}.referral-goal>span{line-height:1.2}
 .referral-hero{max-height:82px;margin:4px auto 5px}.referral-stat{padding:3px 6px}.referral-stat strong{font-size:18px}.referral-stats{margin-bottom:5px}
 .referral-milestones{padding:5px 7px;margin-bottom:6px}.referral-milestones h3,.referral-goal>svg,.referral-goal>small,.referral-rule{display:none}.referral-goal{padding:4px 2px}.referral-goal>strong{font-size:15px}
 .referral-thanks-card>h2{font-size:23px}.referral-thanks-card{grid-template-columns:105px minmax(0,1fr)}.referral-reward-art{width:105px;height:105px}.referral-reward-art>img{width:98px;height:98px}
}
@media(orientation:landscape) and (max-height:350px){
 #openReferrals{top:calc(var(--safe-top,0px) + var(--usable-height,100dvh)*.5 + 51px);width:130px;font-size:11px}
 .referral-hero{max-height:76px}.referral-stat{display:flex;padding:2px 4px;gap:4px}.referral-stat>span,.referral-stat>img{display:none}.referral-stat small{display:inline;font-size:9px}.referral-stat strong{font-size:16px;margin-inline-start:5px}
 .referral-code-box small{display:none}.referral-primary,.referral-secondary{font-size:13px!important;min-height:34px}.referral-secondary{font-size:11px!important}.referral-thanks-invite{font-size:10px}.referral-reward-total{font-size:21px}
}
@media(max-width:600px){
 .referral-overview-actions{grid-template-columns:repeat(3,minmax(0,1fr))}.referral-code-box{grid-column:1/-1;flex-direction:row;gap:8px}
 .referral-friend{grid-template-columns:42px minmax(62px,1fr) 62px 76px;gap:6px}.referral-progress{grid-column:2;grid-row:2}.referral-friend-info{grid-column:2}.referral-friend-amount{grid-column:3;grid-row:1/3}.referral-friend-action{grid-column:4;grid-row:1/3}.referral-avatar{grid-row:1/3}
 .referral-goals{gap:4px}.referral-goal>strong{font-size:15px}.referral-goal>span{font-size:9px}.referral-friend-name{font-size:16px}
}
@media(orientation:portrait) and (max-width:600px){
 .referral-card{padding:14px}.referral-heading h2{font-size:25px}.referral-subtitle{font-size:12px}.referral-hero{margin:8px auto 10px}.referral-stats{gap:5px}.referral-stat{padding:7px 3px;gap:4px}.referral-stat svg,.referral-stat img{width:22px!important;height:22px!important}.referral-stat small{font-size:9px}.referral-stat strong{font-size:21px}.referral-goals{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce){#referralsPanel *,#referralThanks *{scroll-behavior:auto}}
