/* Игра в браузере (PWA): экран входа, окно «Устройства», своя кнопка «назад». Пара к web_session.js */
.wsx-login {
    position: fixed; inset: 0; z-index: 1999998000; display: flex; align-items: center; justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
    background: radial-gradient(120% 70% at 50% 0%, rgba(255, 196, 64, .10), transparent 60%), #0b0d14;
    color: #f1ece2; font-family: 'Outfit', system-ui, sans-serif; overflow-y: auto;
}
html.wsx-login-on, html.wsx-login-on body { overflow: hidden !important; }
.wsx-panel {
    width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
    animation: wsx-in .35s ease both;
}
.wsx-logo { width: 112px; height: 112px; border-radius: 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 207, 138, .18); }
.wsx-title { font-size: 26px; font-weight: 800; letter-spacing: .5px; color: #ffcf8a; margin-top: 4px; }
.wsx-h { font-size: 19px; font-weight: 800; color: #ffcf8a; margin: 2px 0 4px; }
.wsx-p { margin: 0; font-size: 14px; line-height: 1.5; color: rgba(241, 236, 226, .78); }
.wsx-p b { color: #fff; }
.wsx-muted { font-size: 12px; color: rgba(241, 236, 226, .5); line-height: 1.4; }
.wsx-err { font-size: 13px; color: #ff9a9a; min-height: 18px; }

.wsx-btn {
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px;
    padding: 0 18px; border: 0; border-radius: 14px; cursor: pointer; text-decoration: none;
    font: inherit; font-size: 15px; font-weight: 800; color: #1a1205;
    background: linear-gradient(180deg, #ffd98f, #f4a93a); box-shadow: 0 6px 18px rgba(244, 169, 58, .25);
    -webkit-tap-highlight-color: transparent; transition: transform .12s, opacity .2s;
}
.wsx-btn:active { transform: scale(.98); }
.wsx-btn:disabled { opacity: .55; }
.wsx-btn[hidden] { display: none; }
.wsx-tg { color: #fff; background: linear-gradient(180deg, #2fa6e6, #1c86c7); box-shadow: 0 6px 18px rgba(34, 158, 217, .3); }
.wsx-ghost { color: #f1ece2; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); font-weight: 700; }
.wsx-danger { color: #ffd6d6; background: rgba(255, 80, 80, .12); box-shadow: inset 0 0 0 1px rgba(255, 90, 90, .3); font-weight: 700; }

.wsx-number {
    font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: 4px; color: #fff;
    padding: 14px 28px; border-radius: 20px; background: rgba(255, 207, 138, .08); box-shadow: inset 0 0 0 1px rgba(255, 207, 138, .3);
    font-variant-numeric: tabular-nums;
}
.wsx-qr { width: 168px; height: 168px; padding: 8px; border-radius: 14px; background: #fff; }
.wsx-qr svg { width: 100%; height: 100%; display: block; }
.wsx-input {
    width: 100%; height: 58px; border-radius: 14px; border: 1px solid rgba(255, 207, 138, .3); background: rgba(255, 255, 255, .05);
    color: #fff; font: inherit; font-size: 28px; font-weight: 800; letter-spacing: 6px; text-align: center; text-transform: uppercase; outline: none;
}
.wsx-input:focus { border-color: #ffcf8a; box-shadow: 0 0 0 3px rgba(255, 207, 138, .15); }
.wsx-ok {
    width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; font-weight: 900;
    color: #0b0d14; background: #7ee2a0; animation: wsx-pop .35s ease both;
}

/* окно «Устройства» и оплата */
.wsx-modal {
    position: fixed; inset: 0; z-index: 1999999000; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(0, 0, 0, .65); font-family: 'Outfit', system-ui, sans-serif; animation: wsx-fade .2s ease both;
}
.wsx-card {
    position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 12px; padding: 22px 16px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0; background: #11131c; color: #f1ece2; border-top: 1px solid rgba(255, 207, 138, .2);
    animation: wsx-up .25s ease both;
}
@media (min-width: 560px) { .wsx-modal { align-items: center; } .wsx-card { border-radius: 22px; border: 1px solid rgba(255, 207, 138, .2); } }
.wsx-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .07); color: #fff; cursor: pointer; }
.wsx-codebox { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .04); text-align: center; }
.wsx-code { font-size: 38px; font-weight: 900; letter-spacing: 6px; color: #ffcf8a; font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.wsx-sub { font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: rgba(241, 236, 226, .45); margin-top: 4px; }
.wsx-list { display: flex; flex-direction: column; gap: 8px; }
.wsx-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.wsx-item > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wsx-item b { font-size: 14px; }
.wsx-item small { font-size: 12px; color: rgba(241, 236, 226, .5); }
.wsx-tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(126, 226, 160, .15); color: #7ee2a0; vertical-align: middle; }
.wsx-mini { border: 0; border-radius: 9px; padding: 7px 11px; font: inherit; font-size: 12px; font-weight: 700; color: #ffd6d6; background: rgba(255, 80, 80, .12); cursor: pointer; }
.wsx-row { display: flex; flex-direction: column; gap: 8px; }
.wsx-ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.4; text-align: left; }
.wsx-ios { display: inline-block; transform: rotate(-90deg); }

/* своя кнопка «назад» вместо телеграмовской */
.wsx-back {
    position: fixed; z-index: 1999990000; left: 10px; top: calc(10px + env(safe-area-inset-top));
    width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
    color: #fff; background: rgba(15, 17, 26, .78); box-shadow: 0 4px 14px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0; pointer-events: none; transform: translateX(-6px); transition: opacity .18s, transform .18s;
}
.wsx-back.show { opacity: 1; pointer-events: auto; transform: none; }

.wsx-toast {
    position: fixed; z-index: 2000000001; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 10px);
    max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 12px; font: 600 13px 'Outfit', system-ui, sans-serif;
    background: #1f3a2a; color: #d6ffe4; opacity: 0; transition: opacity .2s, transform .2s;
}
.wsx-toast.err { background: #3a1f22; color: #ffd8dc; }
.wsx-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* подсказка про «Версию для ПК» на телефоне */
.wsx-dm {
    position: fixed; z-index: 1999999500; left: 50%; top: 12px; transform: translateX(-50%); width: min(92%, 760px);
    display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-radius: 18px;
    font: 600 28px/1.35 'Outfit', system-ui, sans-serif; color: #1a1205; background: #ffd98f; box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.wsx-dm span { flex: 1; }
.wsx-dm button { border: 0; background: rgba(0, 0, 0, .12); color: #1a1205; width: 52px; height: 52px; border-radius: 50%; font-size: 24px; cursor: pointer; }

@keyframes wsx-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wsx-up { from { transform: translateY(24px); } to { transform: none; } }
@keyframes wsx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wsx-pop { from { transform: scale(.6); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .wsx-panel, .wsx-card, .wsx-modal, .wsx-ok { animation: none; } }
