/* V37 wallet connect: independent from the native 600 × 800 C2 game scene. */
#ansem-wallet-v37, #ansem-wallet-v37 *{box-sizing:border-box}
#ansem-wallet-v37{font-family:system-ui,-apple-system,'Segoe UI',sans-serif;color:#f3e8ff;font-size:13px;line-height:1.35}
#ansem-wallet-v37 .wallet-trigger{position:fixed;right:max(8px,env(safe-area-inset-right));top:max(7px,env(safe-area-inset-top));z-index:2147483647;appearance:none;border:1px solid #9575b8;border-radius:10px;background:linear-gradient(145deg,#251535,#160e25);color:#f0ddff;box-shadow:0 8px 18px #0007;padding:10px 13px;min-width:126px;min-height:40px;cursor:pointer;letter-spacing:.06em;font-size:10px;font-weight:700;touch-action:manipulation}
#ansem-wallet-v37 .wallet-trigger:disabled{opacity:.55;cursor:wait}
#ansem-wallet-v37 .wallet-overlay[hidden],#ansem-wallet-v37 [hidden]{display:none!important}
#ansem-wallet-v37 .wallet-overlay{position:fixed;inset:0;z-index:2147483647;background:rgba(6,4,11,.88);display:flex;align-items:center;justify-content:center;padding:max(14px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));touch-action:auto;overflow:auto}
#ansem-wallet-v37 .wallet-dialog{width:min(100%,420px);max-height:calc(100dvh - 26px);overflow-y:auto;border:1px solid #644683;border-radius:19px;padding:23px;background:linear-gradient(155deg,#261735,#120c1d);box-shadow:0 28px 72px #000b;overscroll-behavior:contain}
#ansem-wallet-v37 .wallet-heading{display:flex;align-items:start;justify-content:space-between;gap:16px}
#ansem-wallet-v37 .wallet-kicker{display:block;color:#b69bd3;font-size:10px;letter-spacing:.13em;margin-bottom:7px}
#ansem-wallet-v37 h2{margin:0;color:#f8f0ff;font-size:24px;font-weight:700;letter-spacing:-.04em}
#ansem-wallet-v37 .wallet-close{appearance:none;cursor:pointer;background:#30203f;color:#fff;border:1px solid #614c75;border-radius:9px;font-size:23px;width:38px;height:38px;flex:none;touch-action:manipulation}
#ansem-wallet-v37 .wallet-description{color:#c5b4d8;font-size:12px;margin:14px 0 17px;line-height:1.6}
#ansem-wallet-v37 .wallet-choices{display:flex;flex-direction:column;gap:9px}
#ansem-wallet-v37 .wallet-option{appearance:none;display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;min-height:53px;padding:13px 15px;background:#23182f;border:1px solid #614875;border-radius:12px;color:#f5eaff;text-align:left;touch-action:manipulation}
#ansem-wallet-v37 .wallet-option:hover{border-color:#d3afff;background:#362046}
#ansem-wallet-v37 .wallet-name{font-size:14px;font-weight:600}
#ansem-wallet-v37 .wallet-availability{font-size:9px;letter-spacing:.1em;color:#b9a4cb;white-space:nowrap}
#ansem-wallet-v37 .wallet-connected{border:1px solid #745b91;background:#1b1427;padding:13px;border-radius:12px;display:flex;flex-direction:column;gap:10px}
#ansem-wallet-v37 .wallet-connected>span{font-size:12px;color:#a3e6c1}
#ansem-wallet-v37 .wallet-connected code{font:12px/1.6 ui-monospace,monospace;word-break:break-all;user-select:text;color:#ebdbff}
#ansem-wallet-v37 .wallet-actions{display:flex;gap:9px}
#ansem-wallet-v37 .wallet-actions button{appearance:none;border:1px solid #80649b;background:#352347;color:#eedcff;border-radius:9px;padding:10px 7px;flex:1;cursor:pointer;font-size:10px;letter-spacing:.04em;touch-action:manipulation;min-height:40px}
#ansem-wallet-v37 .wallet-actions button:last-child{border-color:#88616e;background:#36202c}
#ansem-wallet-v37 .wallet-message{color:#ffc6bc;font-size:12px;min-height:16px;margin:12px 0 2px}
#ansem-wallet-v37 .wallet-safety{color:#a99bb8;font-size:11px;line-height:1.6;border-top:1px solid #40344d;margin-top:13px;padding-top:12px}
#ansem-wallet-v37 button:focus-visible{outline:2px solid #f8ecff;outline-offset:2px}
@media(max-width:380px){#ansem-wallet-v37 .wallet-dialog{padding:16px}#ansem-wallet-v37 h2{font-size:20px}#ansem-wallet-v37 .wallet-trigger{min-width:109px;font-size:9px;padding:9px}}
@media(max-height:480px){#ansem-wallet-v37 .wallet-overlay{align-items:flex-start}#ansem-wallet-v37 .wallet-dialog{max-height:none}}
@media(prefers-reduced-motion:reduce){#ansem-wallet-v37 *{transition:none!important}}

/* The original SFX control owns the game HUD during play: never overlap it. */
body:has(#ansem-hud-v33.is-active) #ansem-wallet-v37 .wallet-trigger{display:none}


/* V40 UI cleanup: avoid overlap with gameplay HUD/SFX. */
#ansem-wallet-v37 .wallet-trigger{top:max(10px,calc(env(safe-area-inset-top) + 10px));right:max(10px,env(safe-area-inset-right));min-width:132px;min-height:42px;}
body.ansem-profile-playing #ansem-wallet-v37 .wallet-trigger{display:none!important}
body.ansem-profile-playing #v39-open{top:max(70px,calc(env(safe-area-inset-top) + 70px))!important}

/* V40.2: wallet is visible in its own HUD slot during gameplay. */
body:has(#ansem-hud-v33.is-active) #ansem-wallet-v37 .wallet-trigger{display:none}
#ansem-wallet-v37 .wallet-trigger{max-width:150px}
