#member-dialog{color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:28px;width:min(480px,calc(100vw - 32px));max-height:85vh;overflow:auto}
#member-dialog::backdrop{background:rgba(0,0,0,.4)}
#member-close{float:right;font-size:30px;min-width:44px;min-height:44px;color:var(--text);background:var(--panel2);border:1px solid var(--line);border-radius:9px;cursor:pointer}
#member-form label{display:grid;gap:8px;margin:18px 0;color:var(--muted)}
#member-form input{width:100%;padding:12px;background:var(--panel2);border:1px solid var(--line);border-radius:8px;color:var(--text)}
#member-form .password-field{position:relative;display:block}
#member-form .password-field input{padding-right:48px}
#member-form .password-toggle{position:absolute;top:50%;right:8px;display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--muted);cursor:pointer;transform:translateY(-50%)}
#member-form .password-toggle:hover,#member-form .password-toggle:focus-visible{background:var(--line);color:var(--text)}
#member-form .password-toggle svg{width:20px;height:20px}
#member-form .primary{width:100%;margin-top:8px}
.google-login-wrap[hidden]{display:none}.login-divider{display:flex;align-items:center;gap:12px;margin:18px 0;color:var(--muted);font-size:12px}.login-divider:before,.login-divider:after{content:"";height:1px;flex:1;background:var(--line)}.google-login{display:flex;justify-content:center;min-height:44px}
#member-fields{display:grid;grid-template-columns:1fr 1.5fr;gap:14px;font-size:14px}
#member-fields dt{color:var(--muted)}#member-fields dd{margin:0;overflow-wrap:anywhere}
#member-message{color:var(--orange)}#member-dialog p{line-height:1.5}
.change-password{margin:22px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.change-password summary{padding:16px 0;color:var(--text);font-weight:850;cursor:pointer}.change-password form{display:grid;gap:12px;padding:0 0 18px}.change-password label{display:grid;gap:6px;color:var(--muted);font-size:12px;font-weight:750}.change-password input{width:100%;box-sizing:border-box;padding:12px 46px 12px 12px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--text);font:inherit}.change-password label:last-of-type input{padding-right:12px}.change-password small{color:var(--muted)}.change-password .primary{width:100%}#change-password-message{min-height:18px;margin:0;color:var(--orange);font-size:12px}
.account-actions #member-login:not([hidden]){display:block}
.account-actions #member-profile:not([hidden]){display:inline-flex;align-items:center;gap:10px;min-width:0}
#member-display-name{min-width:0;max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.member-settings-icon{width:20px;height:20px;flex-shrink:0}
@media(max-width:760px){#member-display-name{max-width:100px}.account-actions #member-profile:not([hidden]){gap:6px}.member-settings-icon{width:18px;height:18px}}
.account-actions [hidden],#member-dialog [hidden]{display:none!important}
.game-result{position:relative;isolation:isolate;display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:center;margin:12px 0 22px;padding:17px;border:1px solid var(--line);border-radius:14px;background:var(--panel2);overflow:hidden}.game-result.winner{border-color:#39dca866;background:linear-gradient(135deg,#39dca81b,var(--panel2))}.result-trophy{display:grid;place-items:center;width:54px;height:54px;border-radius:50%;background:#ffcf3322;font-size:29px}.game-result small{color:var(--muted);font-size:9px;font-weight:900;letter-spacing:.12em}.game-result h3{margin:3px 0 4px;font-size:20px}.game-result p{margin:0;color:var(--muted);font-size:11px}.game-result.celebrate{animation:result-arrive .7s cubic-bezier(.2,.9,.25,1)}.game-result.celebrate .result-trophy{animation:trophy-pop .8s .15s cubic-bezier(.2,1.45,.3,1) both}.win-confetti{position:absolute;inset:0;z-index:-1;pointer-events:none}.win-confetti i{position:absolute;left:50%;top:45%;width:7px;height:12px;border-radius:2px;background:hsl(calc(var(--i)*47) 85% 58%);opacity:0}.celebrate .win-confetti i{animation:confetti-burst 1.35s calc(var(--i)*.025s) ease-out forwards;transform:rotate(calc(var(--i)*31deg)) translateY(-8px)}@keyframes result-arrive{0%{opacity:0;transform:translateY(18px) scale(.96)}100%{opacity:1;transform:none}}@keyframes trophy-pop{0%{transform:scale(0) rotate(-18deg)}70%{transform:scale(1.18) rotate(5deg)}100%{transform:scale(1)}}@keyframes confetti-burst{0%{opacity:1;transform:rotate(calc(var(--i)*31deg)) translateY(-8px)}70%{opacity:1}100%{opacity:0;transform:rotate(calc(var(--i)*31deg)) translateY(-105px) translateX(calc((var(--i) - 9)*7px))}}
@media(prefers-reduced-motion:reduce){.game-result.celebrate,.game-result.celebrate .result-trophy,.celebrate .win-confetti i{animation:none}}
.win-lottie{display:none;width:92px;height:92px;margin:-14px -10px}.win-lottie.ready{display:block}.win-lottie.ready+.result-trophy{display:none}.win-lottie svg{display:block;width:100%!important;height:100%!important}
@media(prefers-reduced-motion:reduce){.win-lottie{display:none!important}.win-lottie+.result-trophy{display:grid!important}}
.member-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:10px}.member-dialog-head h2{margin:0}.member-dialog-actions{display:flex;align-items:center;gap:9px}.member-dialog-actions #member-close{float:none}.member-dialog-actions .theme-toggle{min-height:44px;padding:9px 14px;color:var(--text);white-space:nowrap}.profile-host-controls{display:grid;grid-template-columns:auto minmax(120px,1fr) auto;gap:9px;align-items:center;margin:8px 0 20px;padding:13px 14px;border:1px solid var(--line);border-radius:12px;background:var(--panel2)}.profile-host-controls label{color:var(--muted);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}.profile-host-controls select{width:100%;min-height:38px}.profile-host-controls .ai-host-sound{min-height:38px}@media(max-width:520px){.member-dialog-head{align-items:flex-start}.member-dialog-actions .theme-toggle{font-size:12px;padding:8px 10px}.profile-host-controls{grid-template-columns:1fr auto}.profile-host-controls label{grid-column:1/-1}}
.member-dialog-actions #member-logout{white-space:nowrap;color:var(--text)}
@media(max-width:520px){.member-dialog-head{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px}.member-dialog-head h2{font-size:24px}.member-dialog-actions{display:contents}.member-dialog-actions #member-logout{grid-row:1;grid-column:2;padding:9px;font-size:12px}.member-dialog-actions #member-close{grid-row:1;grid-column:3}.member-dialog-actions .theme-toggle{grid-row:2;grid-column:2 / 4;justify-self:end}}

#points-dialog {width:min(520px,calc(100vw - 32px));max-height:85vh;overflow:auto;border-radius:18px;padding:24px;background:var(--panel,#142135);color:var(--text,#f3f6fc);border:1px solid #607080}
#points-dialog::backdrop {background:#0009}
#points-close {float:right}
#points-form label {display:grid;gap:8px}
#points-form input {max-width:180px;padding:10px}
#points-checkout {display:block;margin:16px 0;color:#5ae0d0}
#points-checkout[hidden] {display:none}
#points-orders p {padding:10px 0;border-bottom:1px solid #607080}
.topbar .header-balances:not([hidden]){display:flex}
.header-balances>.header-balance-summary{flex-direction:row;align-items:center;gap:5px;min-width:0;padding:3px 4px 3px 10px}
.header-balance-summary>span{display:grid;gap:2px;min-width:max-content}
.header-balance-summary strong{white-space:nowrap}
.balance-add{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;padding:10px;border:0;border-radius:9px;background:transparent;color:var(--green);cursor:pointer}
.balance-add svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round}
.balance-add:hover{background:var(--panel2)}
.balance-add:focus-visible,#points-dialog button:focus-visible,#points-checkout:focus-visible{outline:3px solid var(--orange);outline-offset:-3px}
.profile-balance-card{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--panel2)}
.profile-balance-card>div{display:grid;gap:6px;min-width:0}
.profile-balance-card small{color:var(--muted);font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.profile-balance-card strong{color:var(--green);font-size:30px;line-height:1.2;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.profile-balance-card span{color:var(--muted);font-size:12px}.profile-balance-card span b{color:var(--text);margin-left:5px}
.profile-balance-card .balance-add{width:48px;height:48px;flex-basis:48px;border:1px solid var(--line);background:var(--panel)}
#points-dialog {border-color:var(--line);box-shadow:0 24px 80px #0008}
#points-dialog h2 {font-size:26px;letter-spacing:-.03em;margin:8px 0 16px}
#points-dialog p {line-height:1.5}
#points-dialog #points-mode {font-size:12px;color:var(--muted)}
#points-dialog button {padding:11px 16px;border:1px solid var(--line);border-radius:9px;background:var(--panel2);color:var(--text);font-weight:700;cursor:pointer}
#points-dialog button:disabled {opacity:.65;cursor:not-allowed}
#points-dialog #points-submit {width:100%;background:var(--green);color:#08251c;border-color:var(--green)}
#points-dialog #points-close {padding:3px 10px;font-size:26px;min-width:44px;min-height:44px}
#points-dialog input {background:var(--panel2);border:1px solid var(--line);border-radius:9px;color:var(--text);font:inherit}
#points-total {font-weight:800}
#points-message {font-size:13px;color:var(--green)}
#points-orders {font-size:13px;color:var(--muted)}
#points-orders p {border-color:var(--line)}
#points-dialog [hidden]{display:none!important}
#points-dialog{box-sizing:border-box;overscroll-behavior:contain}
#points-description,.payment-method-note{color:var(--muted);font-size:13px}
.payment-current-balance{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;padding:14px 0;border-block:1px solid var(--line);color:var(--muted);font-size:13px}
.payment-current-balance strong{color:var(--green);font-size:18px;overflow-wrap:anywhere}
#points-dialog .payment-method-option{display:flex;align-items:center;gap:12px;width:100%;min-height:84px;padding:16px;text-align:left;background:var(--panel2)}
.payment-method-option>span:nth-child(2){display:grid;gap:5px;min-width:0;flex:1}
.payment-method-option strong{font-size:17px}.payment-method-option small{font-size:12px;color:var(--muted);font-weight:500;overflow-wrap:anywhere}
.payment-method-icon{display:grid;place-items:center;flex:0 0 42px;height:42px;border-radius:10px;background:var(--green);color:var(--bg);font-size:25px;font-weight:900}
.payment-method-arrow{font-size:28px;color:var(--muted)}
#points-dialog .payment-method-option:not(:disabled):hover{border-color:var(--green)}
#points-dialog #points-back{margin:0 0 10px;padding:8px 0;border:0;background:transparent;min-height:44px;color:var(--muted)}
@media(max-width:400px){.header-balances>.header-balance-summary{padding-left:6px;gap:0}.account-actions #member-display-name{max-width:70px}.header-pending-button span{min-width:48px}.header-pending-button{gap:4px;padding-inline:5px}#points-dialog{padding:18px}.profile-balance-card{padding:14px}}
@media(min-width:1281px) and (max-width:1440px){.topbar nav{margin-left:24px}.topbar .nav-link{padding-inline:12px}.account-actions .demo-pill{display:none}}

.header-balance-summary>span{display:flex;align-items:center;gap:6px}

.profile-balance-card #profile-add-points{width:90px;height:auto;min-height:74px;flex-basis:90px;display:flex;flex-direction:column;gap:6px;padding:10px 5px;border:0;background:transparent;border-radius:10px}
.profile-balance-card #profile-add-points[hidden]{display:none}
.profile-balance-card .profile-add-label{font-size:11px;font-weight:750;color:var(--green);white-space:nowrap}

.payment-method-icon{width:42px;min-width:42px;overflow:hidden;background:transparent}
.payment-method-icon img{display:block;width:100%;height:100%;object-fit:contain;border-radius:inherit}
#points-tierlock-option>span>strong{font-size:14px;line-height:1.3}

/* Keep the signed-in profile beside the account controls. */
#member-dialog:has(#member-details:not([hidden])){margin-left:auto;margin-right:16px}
#member-dialog .member-dialog-head{position:sticky;top:-28px;z-index:2;background:var(--panel);margin:-28px -28px 10px;padding:28px 28px 12px;border-bottom:1px solid var(--line)}
@media(max-width:520px){#member-dialog:has(#member-details:not([hidden])){margin-inline:auto}}
.profile-linked-logins,#profile-email-editor{border-top:1px solid var(--line);padding-block:16px;margin-top:12px}.profile-linked-logins input,#profile-email-form input{display:block;width:100%;box-sizing:border-box;margin:8px 0 12px}.profile-email-edit{font-size:12px;padding:3px 8px;margin-left:6px}#profile-google-link{margin:12px 0;max-width:100%;overflow:hidden}#member-fields dd{overflow-wrap:anywhere}

#profile-link-message[data-status="success"]{color:var(--green)}
#profile-link-message[data-status="error"]{color:#ff8080}
:root[data-theme="light"] #profile-link-message[data-status="error"]{color:#b42318}

.member-header-identity{display:flex;flex-direction:column;align-items:flex-start;min-width:0;gap:3px}#member-player-id{font-size:9px;line-height:1.2;font-weight:800;letter-spacing:.08em;color:var(--muted);white-space:nowrap}
