:root{
  --tg-bg:#0e1621;--tg-panel:#17212b;--tg-panel-2:#242f3d;--tg-panel-3:#2c3746;
  --tg-line:#101921;--tg-text:#ffffff;--tg-muted:#7d8b99;--tg-time:#6c7883;
  --tg-time-out:#a7d3ff;--tg-in-bg:#182533;--tg-out-bg:#2b5278;
  --tg-accent:#4a9eff;--tg-accent-2:#64b5f6;--tg-green:#38d66a;--tg-red:#ff4d5e;
  --tg-warn:#f5a623;--accent:#f5a623;--accent-2:#ffd400;--accent-dark:#a86a00;
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{height:100%;overscroll-behavior:none}
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Rajdhani',sans-serif;
  background:var(--tg-bg);color:var(--tg-text);overflow:hidden;-webkit-font-smoothing:antialiased;
  position:fixed;inset:0;width:100%}
button,input,textarea,select{font-family:inherit;color:inherit;font-size:inherit}
button{cursor:pointer;background:none;border:none}
input,textarea{outline:none}
img{max-width:100%;display:block}
svg{display:block}
.screen{position:fixed;inset:0;display:none;flex-direction:column;opacity:0;
  transition:opacity .3s ease;width:100%;height:100%;overflow:hidden}
.screen.active{display:flex;opacity:1}
#loader{align-items:center;justify-content:space-between;
  padding:calc(24px + env(safe-area-inset-top,0px)) 20px calc(24px + env(safe-area-inset-bottom,0px));
  background:radial-gradient(ellipse at 50% 40%,#3a2a08 0%,transparent 55%),
    radial-gradient(ellipse at 50% 100%,#1a2a45 0%,transparent 60%),
    linear-gradient(180deg,#0a0d12,#05070a);
  overflow:hidden;z-index:100}
.loader-top{flex:0 0 auto;width:100%;display:flex;flex-direction:column;
  align-items:center;gap:6px;padding-top:6vh}
.loader-bg-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-4deg);
  font-family:'Oswald',Impact,sans-serif;font-weight:900;font-size:clamp(96px,32vw,440px);
  line-height:.82;letter-spacing:-10px;text-align:center;text-transform:uppercase;
  font-style:italic;user-select:none;pointer-events:none;width:120vw;max-width:120vw;
  color:#fff;-webkit-text-stroke:3px #f5a623;paint-order:stroke fill;
  text-shadow:0 0 40px rgba(245,166,35,.9),0 0 120px rgba(245,166,35,.6),0 10px 0 rgba(0,0,0,.65);
  opacity:.22;z-index:0;animation:loaderBgPulse 4s ease-in-out infinite}
.loader-bg-text b{display:block;background:linear-gradient(180deg,#ffe66b 0%,#f5a623 55%,#a86a00 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-stroke:0;
  filter:drop-shadow(0 0 30px rgba(245,166,35,.9))}
@keyframes loaderBgPulse{0%,100%{opacity:.20;transform:translate(-50%,-50%) rotate(-4deg) scale(1)}
  50%{opacity:.36;transform:translate(-50%,-50%) rotate(-4deg) scale(1.04)}}
.loader-logo-wrap{position:relative;z-index:2;text-align:center;margin-bottom:14px}
.loader-logo{font-family:'Oswald',Impact,sans-serif;font-weight:900;
  font-size:clamp(48px,13vw,96px);letter-spacing:clamp(8px,2.2vw,18px);line-height:1;
  background:linear-gradient(180deg,#fff 0%,#ffe66b 40%,#f5a623 70%,#a86a00 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;
  filter:drop-shadow(0 0 30px rgba(245,166,35,.6));text-transform:uppercase;
  animation:logoPulse 2s ease-in-out infinite;padding-left:clamp(8px,2.2vw,18px)}
@keyframes logoPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.03)}}
.loader-sub{margin-top:6px;font-size:clamp(10px,2.6vw,12px);letter-spacing:6px;
  color:rgba(245,166,35,.7);text-transform:uppercase;font-weight:600}
.loader-bottom{flex:0 0 auto;width:100%;display:flex;flex-direction:column;
  align-items:center;gap:14px;z-index:2;padding-bottom:4vh}
.loader-scene{position:relative;width:min(92vw,640px);height:60px;
  display:flex;align-items:center;gap:10px}
.loader-rifle{width:clamp(90px,22vw,150px);flex-shrink:0;color:#b0b8c2;
  filter:drop-shadow(0 0 14px rgba(245,166,35,.55)) drop-shadow(0 0 28px rgba(245,166,35,.3))}
.loader-rifle svg{width:100%;height:auto}
.loader-track{position:relative;flex:1;height:5px;
  background:linear-gradient(to right,rgba(245,166,35,.3),rgba(245,166,35,.08));
  border-radius:3px;overflow:visible}
.loader-bullet{position:absolute;top:50%;left:0;transform:translateY(-50%);
  width:18px;height:8px;background:radial-gradient(ellipse at 30% 50%,#fff 0%,#ffe66b 35%,#f5a623 75%,#c47a00 100%);
  border-radius:60% 100% 100% 60%;
  box-shadow:0 0 18px 4px rgba(255,212,0,.95),0 0 40px 10px rgba(245,166,35,.55),0 0 80px 16px rgba(245,166,35,.25);
  animation:shoot 7s linear forwards}
.loader-bullet::before{content:'';position:absolute;top:50%;right:100%;transform:translateY(-50%);
  width:240px;height:3px;
  background:linear-gradient(to left,rgba(255,212,0,.95) 0%,rgba(245,166,35,.55) 35%,rgba(245,166,35,.15) 70%,transparent 100%);
  border-radius:2px;filter:blur(1px);pointer-events:none}
@keyframes shoot{0%{left:0;opacity:0}1%{opacity:1}96%{opacity:1}100%{left:calc(100% - 18px);opacity:0}}
.loader-status{font-size:clamp(11px,2.8vw,13.5px);letter-spacing:4px;color:#c8d2dc;
  text-transform:uppercase;font-weight:500;text-shadow:0 0 12px rgba(74,158,255,.4);
  display:flex;align-items:center;gap:8px}
.loader-status::before{content:'';width:8px;height:8px;border-radius:50%;
  background:var(--tg-green);box-shadow:0 0 12px var(--tg-green);
  animation:statusDot 1.4s ease-in-out infinite}
@keyframes statusDot{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.6)}}
.loader-continue{margin-top:8px;padding:15px 44px;font-size:16px;font-weight:700;
  letter-spacing:4px;text-transform:uppercase;color:#0d0d0d;border:none;border-radius:12px;
  background:linear-gradient(135deg,#f5a623,#e08a00);box-shadow:0 8px 30px rgba(245,166,35,.5);
  opacity:0;pointer-events:none;transform:translateY(12px);
  transition:opacity .5s ease,transform .5s ease}
.loader-continue.show{opacity:1;pointer-events:auto;transform:translateY(0);
  animation:btnPulse 1.8s ease-in-out infinite}
.loader-continue:active{transform:scale(.96)}
@keyframes btnPulse{0%,100%{box-shadow:0 8px 30px rgba(245,166,35,.5)}
  50%{box-shadow:0 8px 46px rgba(245,166,35,.9)}}
.loader-footer{position:absolute;bottom:calc(14px + env(safe-area-inset-bottom,0px));
  left:0;right:0;text-align:center;z-index:3;pointer-events:none;user-select:none}
.loader-version{font-family:'Rajdhani',sans-serif;font-size:12px;font-weight:600;
  letter-spacing:5px;color:#5a6675;text-transform:uppercase;margin-bottom:4px}
.loader-author{font-family:'Rajdhani',sans-serif;font-size:10px;font-weight:500;
  letter-spacing:3.5px;color:#3a4452;text-transform:uppercase}
#welcome{align-items:center;justify-content:center;overflow:hidden;padding:16px;position:relative;
  background:radial-gradient(ellipse at 50% 30%,#2a1f0a 0%,transparent 55%),
    radial-gradient(ellipse at 50% 100%,#0f1a2a 0%,transparent 60%),
    linear-gradient(180deg,#0a0d12,#0d1117)}
.welcome-lines{position:absolute;inset:0;pointer-events:none;
  background-image:linear-gradient(rgba(245,166,35,.05) 1px,transparent 1px),
    linear-gradient(90deg,rgba(245,166,35,.05) 1px,transparent 1px);
  background-size:60px 60px;
  mask-image:radial-gradient(circle at 50% 50%,#000 20%,transparent 75%);
  -webkit-mask-image:radial-gradient(circle at 50% 50%,#000 20%,transparent 75%)}
.welcome-bg-text{position:absolute;top:2vh;left:50%;transform:translateX(-50%) rotate(-3deg);
  font-family:'Oswald',Impact,sans-serif;font-weight:900;font-size:clamp(60px,20vw,220px);
  line-height:.88;letter-spacing:-5px;text-align:center;user-select:none;pointer-events:none;
  text-transform:uppercase;font-style:italic;color:#fff;-webkit-text-stroke:2px #f5a623;
  paint-order:stroke fill;text-shadow:0 0 24px rgba(245,166,35,.7),0 0 60px rgba(245,166,35,.45),0 4px 0 rgba(0,0,0,.55);
  opacity:.42;z-index:1;max-width:100vw}
.welcome-bg-text b{display:block;background:linear-gradient(180deg,#ffe66b 0%,#f5a623 55%,#a86a00 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-stroke:0;
  filter:drop-shadow(0 0 20px rgba(245,166,35,.7))}
.welcome-card{position:relative;z-index:2;text-align:center;padding:30px 22px;
  max-width:520px;width:100%;margin-top:18vh;background:rgba(17,21,28,.78);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border:1px solid rgba(245,166,35,.3);border-radius:20px;
  box-shadow:0 20px 80px rgba(0,0,0,.7),0 0 60px rgba(245,166,35,.1) inset;animation:fadeUp .8s ease}
@keyframes fadeUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
.clan-tag{display:inline-block;font-size:12px;letter-spacing:5px;color:var(--accent);
  border:1px solid rgba(245,166,35,.4);padding:5px 14px;border-radius:100px;
  margin-bottom:14px;text-transform:uppercase;font-weight:600}
.clan-title{font-family:'Oswald',sans-serif;font-size:clamp(20px,5vw,34px);font-weight:700;
  letter-spacing:3px;line-height:1.2;margin-bottom:8px;text-transform:uppercase}
.clan-title .olimp{background:linear-gradient(180deg,#fff,var(--accent));
  -webkit-background-clip:text;background-clip:text;color:transparent;
  text-shadow:0 0 30px rgba(245,166,35,.35)}
.welcome-sub{color:var(--tg-muted);font-size:13.5px;letter-spacing:1px;margin-bottom:20px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:13px 28px;border:none;border-radius:12px;font-size:15px;font-weight:600;
  letter-spacing:1.5px;text-transform:uppercase;
  background:linear-gradient(135deg,var(--accent),#e08a00);color:#0d0d0d;
  transition:transform .15s,box-shadow .2s;box-shadow:0 8px 24px rgba(245,166,35,.3);
  width:100%;max-width:280px}
.btn:active{transform:scale(.98)}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn.ghost{background:transparent;color:var(--tg-text);border:1px solid var(--tg-panel-2);
  box-shadow:none;font-weight:500}
.btn.ghost:active{background:var(--tg-panel-2)}
.btn.danger{background:linear-gradient(135deg,#ff4d5e,#c72637);color:#fff;
  box-shadow:0 8px 24px rgba(255,77,94,.3)}
.btn.small{padding:9px 16px;font-size:13px;letter-spacing:1px;width:auto;max-width:none}
.btn.block{max-width:none;width:100%}
#auth{align-items:center;justify-content:center;padding:16px;overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  background:radial-gradient(ellipse at 50% 20%,#2a1f0a 0%,transparent 55%),
    linear-gradient(180deg,#0a0d12,#0d1117)}
.auth-bg{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);
  font-family:'Oswald',Impact,sans-serif;font-weight:900;font-size:clamp(60px,16vw,220px);
  color:transparent;-webkit-text-stroke:2px rgba(245,166,35,.06);letter-spacing:-2px;
  white-space:nowrap;pointer-events:none;user-select:none;z-index:0}
.auth-card{position:relative;z-index:2;width:100%;max-width:420px;
  background:rgba(17,21,28,.9);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border:1px solid #232a35;border-radius:18px;padding:24px 20px;
  box-shadow:0 20px 60px rgba(0,0,0,.6);animation:fadeUp .5s ease;margin:auto}
.auth-logo{text-align:center;font-family:'Oswald',sans-serif;font-size:22px;font-weight:900;
  letter-spacing:7px;margin-bottom:4px;background:linear-gradient(180deg,#fff,var(--accent));
  -webkit-background-clip:text;background-clip:text;color:transparent}
.auth-tag{text-align:center;color:var(--tg-muted);font-size:11px;letter-spacing:2px;
  margin-bottom:18px;text-transform:uppercase}
.auth-step{display:none;animation:fadeUp .3s ease}
.auth-step.active{display:block}
.steps-dots{display:flex;justify-content:center;gap:8px;margin-bottom:18px}
.steps-dots span{width:32px;height:3px;border-radius:2px;background:#232a35;
  transition:background .3s}
.steps-dots span.on{background:linear-gradient(90deg,var(--accent),var(--accent-2))}
.field{margin-bottom:11px}
.field label{display:block;font-size:11px;letter-spacing:2px;text-transform:uppercase;
  color:var(--tg-muted);margin-bottom:6px}
.field input{width:100%;padding:13px 14px;border-radius:11px;background:#0a0e14;
  border:1px solid #232a35;color:var(--tg-text);font-size:16px;
  transition:border-color .2s,box-shadow .2s}
.field input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(245,166,35,.15)}
.field-row{display:flex;gap:10px}
.field-row .field{flex:1}
.field-with-btn{display:flex;gap:8px}
.field-with-btn input{flex:1}
.field-with-btn button{flex-shrink:0;padding:0 12px;font-size:12px;letter-spacing:1px;
  border-radius:10px;background:rgba(245,166,35,.12);border:1px solid rgba(245,166,35,.4);
  color:var(--accent);text-transform:uppercase;font-weight:600}
.auth-hint{font-size:12px;color:var(--tg-muted);line-height:1.5;padding:10px 12px;
  border-left:2px solid var(--accent);background:rgba(245,166,35,.06);
  border-radius:0 8px 8px 0;margin:6px 0 14px}
.auth-hint b{color:var(--accent)}
.auth-error{color:var(--tg-red);font-size:13px;min-height:18px;margin-bottom:6px;
  text-align:center}
.auth-actions{display:flex;gap:10px;margin-top:6px}
.auth-actions .btn{flex:1;padding:13px 10px;font-size:14px;max-width:none}
.link-btn{background:none;border:none;color:var(--tg-muted);font-size:13px;
  cursor:pointer;display:block;margin:14px auto 0;padding:8px}
.link-btn:active{color:var(--accent)}
.avatar-pick{display:flex;flex-direction:column;align-items:center;gap:14px;padding:14px 0 6px}
.avatar-preview{width:120px;height:120px;border-radius:50%;background:rgba(26,32,41,.8);
  border:2px dashed rgba(245,166,35,.35);display:flex;align-items:center;justify-content:center;
  overflow:hidden;color:var(--tg-muted);font-size:12px;text-align:center;
  transition:border-color .2s,transform .2s}
.avatar-preview.has{border-style:solid;border-color:var(--accent);
  box-shadow:0 0 30px rgba(245,166,35,.35)}
.avatar-preview img{width:100%;height:100%;object-fit:cover}
.avatar-preview .placeholder{padding:0 12px;line-height:1.4}
.avatar-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
#chat{display:none;flex-direction:column;height:100vh;height:100dvh;background:var(--tg-bg)}
#chat.active{display:flex}
.tg-header{display:flex;align-items:center;gap:4px;padding:6px 8px;
  padding-top:calc(6px + env(safe-area-inset-top,0px));background:var(--tg-panel);
  border-bottom:1px solid var(--tg-line);flex-shrink:0;z-index:10;min-height:56px}
.tg-icon-btn{width:42px;height:42px;border-radius:50%;border:none;background:transparent;
  color:#8a9aa8;display:flex;align-items:center;justify-content:center;
  transition:background .15s,color .15s;flex-shrink:0;position:relative}
.tg-icon-btn:active{background:rgba(255,255,255,.06);color:#fff}
.tg-icon-btn svg{width:22px;height:22px}
.tg-icon-btn[disabled]{opacity:.35;cursor:not-allowed}
.tg-icon-btn .badge{position:absolute;top:2px;right:2px;min-width:18px;height:18px;
  padding:0 5px;border-radius:9px;background:var(--tg-red);color:#fff;font-size:11px;
  font-weight:700;display:flex;align-items:center;justify-content:center;
  box-shadow:0 2px 8px rgba(255,77,94,.5)}
.tg-header-user{display:flex;align-items:center;gap:10px;flex:1;min-width:0;
  padding:4px 4px;cursor:pointer}
.tg-avatar{width:40px;height:40px;border-radius:50%;flex-shrink:0;display:flex;
  align-items:center;justify-content:center;font-weight:700;font-size:15px;color:#fff;
  background:linear-gradient(135deg,#5a6675,#3a4452);user-select:none;overflow:hidden;position:relative}
.tg-avatar img{width:100%;height:100%;object-fit:cover}
.tg-avatar.gold{background:linear-gradient(135deg,#f5a623,#e08a00);color:#12100a}
.tg-avatar.blue{background:linear-gradient(135deg,#4a9eff,#2c6dc9)}
.tg-avatar.elite{background:linear-gradient(135deg,#e0b34a,#a87d1a);color:#12100a}
.tg-avatar.gray{background:linear-gradient(135deg,#5a6675,#3a4452)}
.tg-header-text{flex:1;min-width:0}
.tg-header-name{font-size:15px;font-weight:600;color:#fff;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:6px}
.tg-header-name .tag-mini{font-size:9px;letter-spacing:1.5px;color:var(--accent);
  border:1px solid rgba(245,166,35,.35);padding:1px 6px;border-radius:100px;font-weight:700}
.tg-header-status{font-size:12.5px;color:var(--tg-muted);white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;margin-top:1px;display:flex;align-items:center;gap:5px}
.online-dot{width:8px;height:8px;border-radius:50%;background:var(--tg-green);
  display:inline-block;flex-shrink:0}
.tg-select-bar{display:none;align-items:center;gap:2px;padding:6px 8px;
  padding-top:calc(6px + env(safe-area-inset-top,0px));background:var(--tg-panel-2);
  border-bottom:1px solid var(--tg-line);flex-shrink:0;z-index:11;min-height:56px}
.tg-select-bar.show{display:flex}
.tg-select-bar .count{flex:1;font-size:15px;font-weight:600;padding:0 8px;color:#fff;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tg-pinned-bar{display:flex;align-items:center;gap:8px;padding:8px 12px;
  background:var(--tg-panel);border-bottom:1px solid var(--tg-line);font-size:13px;
  color:#a8b8c8;cursor:pointer;flex-shrink:0;overflow:hidden;position:relative}
.tg-pinned-bar::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;
  background:linear-gradient(180deg,var(--accent),var(--accent-2))}
.tg-pinned-bar .pin-icon{flex-shrink:0;color:var(--accent);display:flex;align-items:center}
.tg-pinned-bar .pin-icon svg{width:16px;height:16px}
.tg-pinned-bar .pin-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis}
.tg-pinned-bar b{color:var(--tg-accent);margin-right:4px}
.tg-pinned-bar .pin-close{width:28px;height:28px;border-radius:50%;border:none;
  background:transparent;color:#8a9aa8;display:flex;align-items:center;
  justify-content:center;flex-shrink:0}
.tg-pinned-bar .pin-close:active{background:rgba(255,255,255,.06);color:#fff}
.tg-pinned-bar .pin-close svg{width:16px;height:16px}
.tg-messages{flex:1;overflow-y:auto;overflow-x:hidden;padding:12px 6px;
  -webkit-overflow-scrolling:touch;background-color:var(--tg-bg);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'><g fill='none' stroke='%23ffffff' stroke-opacity='0.035' stroke-width='1.4'><circle cx='60' cy='70' r='26'/><circle cx='240' cy='110' r='34'/><circle cx='150' cy='250' r='22'/><path d='M0 160 Q80 120 160 160 T320 160'/><path d='M0 220 Q80 180 160 220 T320 220'/><path d='M0 90 Q80 50 160 90 T320 90'/></g></svg>");
  background-size:320px 320px;scroll-behavior:smooth}
.tg-messages::-webkit-scrollbar{width:5px}
.tg-messages::-webkit-scrollbar-thumb{background:rgba(255,255,255,.08);border-radius:3px}
.tg-date{display:flex;justify-content:center;margin:14px 0 6px}
.tg-date span{display:inline-block;font-size:12px;font-weight:500;color:#a8b8c8;
  background:rgba(14,22,33,.75);padding:5px 12px;border-radius:14px;
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
.tg-sys{text-align:center;font-size:12.5px;color:#a8b8c8;padding:5px 12px;
  margin:6px auto;max-width:80%;background:rgba(24,37,51,.7);border-radius:14px;
  backdrop-filter:blur(8px);word-break:break-word}
.tg-sys b{color:var(--accent)}
.tg-sys.warn{background:rgba(245,166,35,.14);color:var(--accent)}
.tg-sys.danger{background:rgba(255,77,94,.14);color:#ff8a96}
.tg-unread-sep{display:flex;align-items:center;gap:10px;margin:14px 8px;padding:0 4px}
.tg-unread-sep::before,.tg-unread-sep::after{content:'';flex:1;height:1px;
  background:linear-gradient(90deg,transparent,rgba(74,158,255,.7),transparent)}
.tg-unread-sep span{font-size:12px;color:#a7d3ff;letter-spacing:.6px;padding:5px 12px;
  border-radius:12px;background:rgba(74,158,255,.14);border:1px solid rgba(74,158,255,.35);
  white-space:nowrap}
.tg-msg{display:flex;gap:8px;margin:2px 0;position:relative;animation:tgMsgIn .18s ease;
  padding:0 4px;align-items:flex-end}
@keyframes tgMsgIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.tg-msg.out{flex-direction:row-reverse}
.tg-msg-avatar{width:34px;height:34px;border-radius:50%;flex-shrink:0;display:flex;
  align-items:center;justify-content:center;font-weight:700;font-size:13px;color:#fff;
  overflow:hidden;background:linear-gradient(135deg,#5a6675,#3a4452);user-select:none}
.tg-msg-avatar img{width:100%;height:100%;object-fit:cover}
.tg-msg-avatar.gold{background:linear-gradient(135deg,#f5a623,#e08a00);color:#12100a}
.tg-msg-avatar.blue{background:linear-gradient(135deg,#4a9eff,#2c6dc9)}
.tg-msg-avatar.elite{background:linear-gradient(135deg,#e0b34a,#a87d1a);color:#12100a}
.tg-msg-body{max-width:min(80%,520px);display:flex;flex-direction:column;min-width:0}
.tg-msg.out .tg-msg-body{align-items:flex-end}
.tg-msg-author{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:600;
  margin-bottom:2px;padding:0 10px}
.tg-msg-author .name{color:#64b5f6}
.tg-msg-author .name.gold{color:var(--accent)}
.tg-msg-author .name.blue{color:#64b5f6}
.tg-msg-author .name.gray{color:#a8b8c8}
.role-mini{font-size:9px;letter-spacing:1.2px;font-weight:700;text-transform:uppercase;
  padding:1px 6px;border-radius:4px;line-height:1.3}
.role-mini.leader{color:#f5a623;background:rgba(245,166,35,.15)}
.role-mini.senior_deputy{color:#4a9eff;background:rgba(74,158,255,.15)}
.role-mini.deputy{color:#64b5f6;background:rgba(100,181,246,.13)}
.role-mini.elite{color:#e0b34a;background:rgba(224,179,74,.13)}
.role-mini.member{color:#a8b8c8;background:rgba(168,184,200,.12)}
.tg-bubble{position:relative;padding:7px 11px;border-radius:14px;font-size:16px;
  line-height:1.4;word-wrap:break-word;word-break:break-word;background:var(--tg-in-bg);
  box-shadow:0 1px 0 rgba(0,0,0,.15);cursor:pointer;min-width:80px}
.tg-msg.out .tg-bubble{background:var(--tg-out-bg);color:#fff;border-bottom-right-radius:5px}
.tg-msg:not(.out) .tg-bubble{border-bottom-left-radius:5px}
.tg-msg.selected .tg-bubble{background:rgba(74,158,255,.35) !important;
  box-shadow:0 0 0 2px rgba(74,158,255,.7) inset}
.tg-msg.selected .tg-msg-avatar{box-shadow:0 0 0 2px rgba(74,158,255,.7)}
.tg-text{padding-right:52px;white-space:pre-wrap;padding-bottom:2px}
.tg-meta{position:absolute;right:8px;bottom:4px;display:flex;align-items:center;gap:3px;
  font-size:11px;color:var(--tg-time);user-select:none;pointer-events:none}
.tg-msg.out .tg-meta{color:var(--tg-time-out)}
.tg-meta .check{width:16px;height:10px;display:inline-block}
.tg-meta .check svg{width:16px;height:10px}
.tg-media{border-radius:12px;overflow:hidden;margin:-2px -6px 4px;position:relative;
  background:#000;max-width:320px}
.tg-media img,.tg-media video{display:block;width:100%;height:auto;max-height:340px;
  object-fit:cover;cursor:pointer}
.tg-media video{background:#000}
.tg-media .play-overlay{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:56px;height:56px;border-radius:50%;background:rgba(0,0,0,.55);
  backdrop-filter:blur(6px);display:flex;align-items:center;justify-content:center;
  pointer-events:none}
.tg-media .play-overlay svg{width:26px;height:26px;color:#fff;fill:#fff;margin-left:3px}
.tg-media .dl-btn{position:absolute;top:6px;right:6px;width:34px;height:34px;
  border-radius:50%;background:rgba(0,0,0,.55);backdrop-filter:blur(6px);border:none;
  color:#fff;display:flex;align-items:center;justify-content:center;opacity:.9}
.tg-media .dl-btn:active{background:rgba(0,0,0,.8);opacity:1}
.tg-media .dl-btn svg{width:18px;height:18px}
.tg-gallery{display:grid;gap:3px;margin:-2px -6px 4px;border-radius:12px;
  overflow:hidden;max-width:340px}
.tg-gallery.g2{grid-template-columns:1fr 1fr}
.tg-gallery.g3{grid-template-columns:1fr 1fr 1fr}
.tg-gallery .cell{position:relative;overflow:hidden;background:#000;aspect-ratio:1/1;cursor:pointer}
.tg-gallery .cell img,.tg-gallery .cell video{width:100%;height:100%;object-fit:cover}
.tg-gallery .cell.more::after{content:attr(data-more);position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.6);
  color:#fff;font-size:26px;font-weight:700}
.tg-gallery .cell .play-mini{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:38px;height:38px;border-radius:50%;background:rgba(0,0,0,.55);display:flex;
  align-items:center;justify-content:center}
.tg-gallery .cell .play-mini svg{width:18px;height:18px;fill:#fff;margin-left:2px}
.tg-voice{display:flex;align-items:center;gap:10px;padding:4px 4px;min-width:170px}
.tg-voice-play{width:38px;height:38px;border-radius:50%;border:none;
  background:rgba(255,255,255,.12);color:#fff;display:flex;align-items:center;
  justify-content:center;flex-shrink:0;transition:background .15s}
.tg-msg.out .tg-voice-play{background:rgba(255,255,255,.22)}
.tg-voice-play:active{background:rgba(255,255,255,.3)}
.tg-voice-play svg{width:16px;height:16px;fill:#fff;margin-left:2px}
.tg-voice-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.tg-voice-wave{height:16px;display:flex;align-items:center;gap:2px}
.tg-voice-wave i{display:block;width:2px;background:#64b5f6;border-radius:2px;opacity:.6}
.tg-msg.out .tg-voice-wave i{background:#a7d3ff}
.tg-voice-duration{font-size:12px;color:var(--tg-time);padding-right:48px}
.tg-msg.out .tg-voice-duration{color:var(--tg-time-out)}
.tg-circle{width:220px;height:220px;border-radius:50%;overflow:hidden;position:relative;
  background:#000;margin:0 auto;box-shadow:0 0 0 2px rgba(255,255,255,.06) inset}
.tg-circle video{width:100%;height:100%;object-fit:cover;cursor:pointer}
.tg-circle .circle-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:52px;height:52px;border-radius:50%;background:rgba(0,0,0,.5);
  backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;
  pointer-events:none}
.tg-circle .circle-play svg{width:22px;height:22px;fill:#fff;margin-left:3px}
.tg-circle .circle-mute{position:absolute;bottom:8px;right:8px;width:30px;height:30px;
  border-radius:50%;background:rgba(0,0,0,.6);backdrop-filter:blur(4px);display:flex;
  align-items:center;justify-content:center;color:#fff}
.tg-circle .circle-mute svg{width:14px;height:14px}
.tg-circle.playing .circle-play{display:none}
.tg-file{display:flex;align-items:center;gap:10px;padding:8px 4px;min-width:180px}
.tg-file-icon{width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.1);
  display:flex;align-items:center;justify-content:center;flex-shrink:0}
.tg-msg.out .tg-file-icon{background:rgba(255,255,255,.18)}
.tg-file-icon svg{width:20px;height:20px}
.tg-file-info{flex:1;min-width:0;padding-right:48px}
.tg-file-name{font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis}
.tg-file-size{font-size:12px;color:var(--tg-time);margin-top:2px}
.tg-msg.out .tg-file-size{color:var(--tg-time-out)}
.tg-sticker{width:clamp(130px,44vw,190px);height:clamp(130px,44vw,190px);display:flex;
  align-items:center;justify-content:center;margin:-2px -6px 0;position:relative}
.tg-sticker svg{width:100%;height:100%;filter:drop-shadow(0 6px 18px rgba(0,0,0,.55))}
.tg-msg .tg-bubble.sticker-bubble{background:transparent !important;
  box-shadow:none !important;padding:0 !important;min-width:0}
.tg-msg .tg-bubble.sticker-bubble .tg-meta{color:rgba(255,255,255,.85);
  background:rgba(0,0,0,.5);padding:2px 8px;border-radius:10px;right:6px;bottom:6px}
.tg-reactions{display:flex;gap:4px;margin-top:3px;flex-wrap:wrap;align-items:center;padding:0 2px}
.tg-react{display:flex;align-items:center;gap:3px;padding:2px 8px;border-radius:100px;
  font-size:12px;background:rgba(24,37,51,.9);border:1px solid rgba(255,255,255,.06);
  cursor:pointer;color:#fff;user-select:none;transition:transform .1s,border-color .15s}
.tg-react:active{transform:scale(.94)}
.tg-react.mine{background:rgba(74,158,255,.25);border-color:rgba(74,158,255,.5);color:#a7d3ff}
.tg-react-add{opacity:0;padding:2px 8px;font-size:13px;line-height:1.4;border-radius:100px;
  background:rgba(24,37,51,.9);border:1px dashed rgba(255,255,255,.15);color:#7d8b99;
  transition:opacity .15s}
.tg-msg:hover .tg-react-add{opacity:1}
@media (hover:none){.tg-react-add{opacity:.5}}
.tg-react-picker{position:fixed;display:none;gap:2px;padding:5px;
  background:rgba(23,33,43,.98);border:1px solid rgba(255,255,255,.08);border-radius:100px;
  box-shadow:0 8px 24px rgba(0,0,0,.6);z-index:250;backdrop-filter:blur(12px)}
.tg-react-picker.show{display:flex}
.tg-react-picker button{background:none;border:none;font-size:19px;width:36px;height:36px;
  border-radius:50%;transition:transform .12s,background .15s}
.tg-react-picker button:active{transform:scale(1.2);background:rgba(255,255,255,.08)}
.tg-composer-wrap{background:var(--tg-panel);border-top:1px solid var(--tg-line);
  padding-bottom:env(safe-area-inset-bottom,0px);flex-shrink:0;position:relative;z-index:5}
.tg-reply-bar{display:none;align-items:center;gap:10px;padding:8px 12px;
  border-bottom:1px solid var(--tg-line);background:var(--tg-panel)}
.tg-reply-bar.show{display:flex}
.tg-reply-bar-text{flex:1;min-width:0;font-size:13px;color:var(--tg-muted);
  border-left:2px solid var(--tg-accent);padding-left:10px}
.tg-reply-bar-text b{color:var(--tg-accent);display:block;font-size:12px}
.tg-reply-bar-text span{display:block;white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis;color:#fff}
.tg-reply-bar .tg-icon-btn{width:34px;height:34px}
.tg-composer{display:flex;align-items:flex-end;gap:4px;padding:6px 6px}
.tg-composer > .tg-icon-btn{width:42px;height:42px}
.tg-input-wrap{flex:1;min-width:0;position:relative;background:var(--tg-panel-2);
  border-radius:21px;display:flex;align-items:flex-end}
.tg-input-wrap textarea{flex:1;background:none;border:none;resize:none;color:#fff;
  font-size:16px;line-height:1.35;padding:11px 42px 11px 14px;max-height:120px;
  min-height:42px;overflow-y:auto}
.tg-input-wrap textarea::placeholder{color:#6c7883}
.tg-input-wrap .tg-emoji-inline{position:absolute;right:4px;bottom:4px;width:34px;
  height:34px;border-radius:50%;border:none;background:transparent;color:#8a9aa8;
  display:flex;align-items:center;justify-content:center}
.tg-input-wrap .tg-emoji-inline:active{background:rgba(255,255,255,.06)}
.tg-input-wrap .tg-emoji-inline svg{width:22px;height:22px}
.tg-send-btn{width:42px;height:42px;border-radius:50%;border:none;background:transparent;
  color:#8a9aa8;display:flex;align-items:center;justify-content:center;
  transition:transform .15s,color .15s,opacity .2s;flex-shrink:0}
.tg-send-btn:active{transform:scale(.9)}
.tg-send-btn svg{width:24px;height:24px}
.tg-send-btn.has-text{color:var(--tg-accent)}
.tg-mic-btn{width:42px;height:42px;border-radius:50%;border:none;background:transparent;
  color:#8a9aa8;display:flex;align-items:center;justify-content:center;
  transition:transform .15s,color .15s,background .15s,box-shadow .2s;flex-shrink:0;
  touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.tg-mic-btn svg{width:24px;height:24px;pointer-events:none}
.tg-mic-btn.circle-mode{color:#4a9eff}
.tg-mic-btn.recording{background:rgba(255,77,94,.18);color:#ff4d5e;transform:scale(1.08);
  animation:micRecPulse 1s ease-in-out infinite}
@keyframes micRecPulse{0%,100%{box-shadow:0 0 0 0 rgba(255,77,94,.65)}
  50%{box-shadow:0 0 0 12px rgba(255,77,94,0)}}
.tg-emoji-panel{display:none;flex-direction:column;border-top:1px solid var(--tg-line);
  max-height:280px;overflow-y:auto;background:var(--tg-panel)}
.tg-emoji-panel.show{display:flex}
.tg-emoji-panel::-webkit-scrollbar{width:5px}
.tg-emoji-panel::-webkit-scrollbar-thumb{background:rgba(255,255,255,.08);border-radius:3px}
.tg-emoji-tabs{display:flex;gap:4px;padding:6px 8px;border-bottom:1px solid var(--tg-line);
  background:var(--tg-panel);flex-shrink:0;position:sticky;top:0;z-index:2}
.tg-emoji-tab{flex:1;padding:9px 6px;border:none;background:transparent;
  color:var(--tg-muted);border-radius:8px;font-size:13px;font-weight:600;
  letter-spacing:.5px;transition:background .15s,color .15s}
.tg-emoji-tab.active{background:var(--tg-panel-2);color:#fff}
.tg-emoji-tab:active{background:var(--tg-panel-3)}
.emoji-group-wrap{display:flex;flex-direction:column;gap:8px;padding:10px 8px}
.emoji-group{display:flex;flex-direction:column;gap:4px}
.emoji-group-title{font-size:10px;letter-spacing:2px;text-transform:uppercase;
  color:var(--tg-muted);padding:4px 6px 2px;font-weight:700}
.emoji-group-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(40px,1fr));gap:2px}
.emoji-group-grid button{background:none;border:none;font-size:24px;aspect-ratio:1/1;
  border-radius:8px;transition:background .12s,transform .12s;display:flex;
  align-items:center;justify-content:center}
.emoji-group-grid button:active{background:rgba(255,255,255,.08);transform:scale(1.1)}
.tg-sticker-pack{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));
  gap:8px;padding:10px 8px 12px}
.tg-sticker-pack button{background:radial-gradient(circle at 30% 20%,rgba(245,166,35,.10),transparent 60%),
  rgba(0,0,0,.28);border:1px solid rgba(255,255,255,.06);border-radius:12px;
  aspect-ratio:1/1;padding:6px;display:flex;align-items:center;justify-content:center;
  transition:background .15s,transform .12s,border-color .15s,box-shadow .2s}
.tg-sticker-pack button:hover{border-color:rgba(245,166,35,.4);
  box-shadow:0 4px 16px rgba(245,166,35,.15)}
.tg-sticker-pack button:active{transform:scale(.94);background:rgba(245,166,35,.15);
  border-color:rgba(245,166,35,.5)}
.tg-sticker-pack button svg{width:100%;height:100%}
.tg-bottom-bar{position:absolute;right:14px;
  bottom:calc(78px + env(safe-area-inset-bottom,0px));display:flex;
  flex-direction:column;align-items:flex-end;gap:8px;z-index:9;pointer-events:none}
.tg-bottom-bar > *{pointer-events:auto}
.tg-scroll-down{width:46px;height:46px;border-radius:50%;border:none;
  background:var(--tg-panel-2);color:#fff;display:flex;align-items:center;
  justify-content:center;box-shadow:0 6px 24px rgba(0,0,0,.5);
  transform:translateY(10px) scale(.85);opacity:0;
  transition:opacity .2s,transform .2s;position:relative}
.tg-scroll-down.show{opacity:1;transform:none}
.tg-scroll-down svg{width:22px;height:22px}
.tg-scroll-down .badge{position:absolute;top:-4px;right:-4px;min-width:22px;height:22px;
  padding:0 6px;border-radius:11px;background:var(--tg-accent);color:#fff;font-size:12px;
  font-weight:700;align-items:center;justify-content:center;
  box-shadow:0 2px 10px rgba(74,158,255,.6);display:none}
.tg-scroll-down.has-unread .badge{display:flex}
.tg-sheet-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.55);z-index:300;
  display:none;animation:fadeIn .2s ease}
.tg-sheet-backdrop.show{display:block}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.tg-sheet{position:fixed;left:0;right:0;bottom:0;background:var(--tg-panel);
  border-radius:18px 18px 0 0;z-index:301;
  padding:12px 12px calc(12px + env(safe-area-inset-bottom,0px));
  transform:translateY(100%);transition:transform .25s cubic-bezier(.32,.72,0,1);
  max-width:520px;margin:0 auto;box-shadow:0 -8px 40px rgba(0,0,0,.5);
  max-height:80vh;overflow-y:auto}
.tg-sheet.show{transform:translateY(0)}
.tg-sheet-grab{width:36px;height:4px;border-radius:2px;background:#3a4655;margin:0 auto 14px}
.tg-sheet-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:4px 0}
.tg-sheet-item{display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:12px 4px;border-radius:12px;background:transparent;border:none;color:#fff;
  transition:background .15s}
.tg-sheet-item:active{background:rgba(255,255,255,.06)}
.tg-sheet-icon{width:52px;height:52px;border-radius:50%;display:flex;
  align-items:center;justify-content:center;
  background:linear-gradient(135deg,#4a9eff,#2c6dc9);color:#fff;flex-shrink:0}
.tg-sheet-icon svg{width:24px;height:24px}
.tg-sheet-icon.green{background:linear-gradient(135deg,#38d66a,#20a94e)}
.tg-sheet-icon.purple{background:linear-gradient(135deg,#9b6cff,#6a3ee0)}
.tg-sheet-icon.red{background:linear-gradient(135deg,#ff4d5e,#c72637)}
.tg-sheet-icon.gold{background:linear-gradient(135deg,#f5a623,#e08a00);color:#12100a}
.tg-sheet-label{font-size:11.5px;color:#a8b8c8;text-align:center;line-height:1.2}
.tg-calllist{display:flex;flex-direction:column}
.tg-calllist-section{padding:12px 6px 6px;font-size:11px;letter-spacing:2.5px;
  text-transform:uppercase;color:var(--tg-muted);font-weight:600}
.tg-calllist-row{display:flex;align-items:center;gap:12px;padding:10px 8px;
  border-radius:12px;transition:background .15s;color:#fff;text-align:left;width:100%}
.tg-calllist-row:active{background:rgba(255,255,255,.06)}
.tg-calllist-row .tg-avatar{width:46px;height:46px;font-size:16px}
.tg-calllist-info{flex:1;min-width:0}
.tg-calllist-name{font-size:15px;font-weight:600;display:flex;align-items:center;
  gap:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tg-calllist-status{font-size:12.5px;color:var(--tg-muted);margin-top:1px}
.tg-calllist-status.on{color:var(--tg-green)}
.tg-calllist-action{width:40px;height:40px;border-radius:50%;
  background:linear-gradient(135deg,#38d66a,#20a94e);color:#fff;display:flex;
  align-items:center;justify-content:center;flex-shrink:0}
.tg-calllist-action svg{width:20px;height:20px}
.tg-calllist-clan .tg-calllist-action{background:linear-gradient(135deg,#4a9eff,#2c6dc9)}
.tg-call-type{display:flex;gap:12px;padding:8px 4px 4px}
.tg-call-type-btn{flex:1;padding:22px 12px;border-radius:16px;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);color:#fff;
  display:flex;flex-direction:column;align-items:center;gap:10px;
  transition:background .15s,transform .12s,border-color .15s}
.tg-call-type-btn:active{transform:scale(.97);background:rgba(74,158,255,.12);
  border-color:rgba(74,158,255,.4)}
.tg-call-type-btn svg{width:36px;height:36px}
.tg-call-type-btn .lbl{font-size:14px;font-weight:600}
.tg-call-type-btn .sub{font-size:11px;color:var(--tg-muted)}
.tg-modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:400;
  display:none;align-items:center;justify-content:center;padding:20px;
  animation:fadeIn .2s ease;backdrop-filter:blur(4px)}
.tg-modal-backdrop.show{display:flex}
.tg-modal{background:var(--tg-panel);border-radius:16px;width:100%;max-width:400px;
  padding:20px 18px;box-shadow:0 20px 60px rgba(0,0,0,.7);animation:tgModalIn .22s ease;
  max-height:85vh;overflow-y:auto}
@keyframes tgModalIn{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)}}
.tg-modal h3{font-size:17px;font-weight:600;margin-bottom:14px;text-align:center;
  color:#fff;letter-spacing:.3px}
.tg-modal-sub{text-align:center;font-size:13px;color:var(--tg-muted);margin:-8px 0 16px;
  line-height:1.4}
.tg-modal-actions{display:flex;gap:8px;margin-top:14px}
.tg-modal-actions .tg-btn{flex:1;padding:12px;border-radius:11px;border:none;
  font-size:14px;font-weight:600;letter-spacing:.5px;transition:transform .12s,background .15s}
.tg-modal-actions .tg-btn:active{transform:scale(.97)}
.tg-btn-primary{background:var(--tg-accent);color:#fff}
.tg-btn-ghost{background:var(--tg-panel-2);color:#fff}
.tg-btn-ghost:active{background:var(--tg-panel-3)}
.tg-btn-danger{background:var(--tg-red);color:#fff}
.tg-btn-warn{background:var(--tg-warn);color:#12100a}
.tg-quality-list{display:flex;flex-direction:column;gap:4px}
.tg-quality-item{display:flex;align-items:center;justify-content:space-between;
  padding:13px 14px;border-radius:11px;background:var(--tg-panel-2);border:none;
  color:#fff;font-size:15px;text-align:left;transition:background .15s}
.tg-quality-item:active{background:var(--tg-panel-3)}
.tg-quality-item small{color:var(--tg-muted);font-size:12px}
.tg-quality-item.sel{border:1px solid var(--tg-accent)}
.tg-quality-item[disabled]{opacity:.4;cursor:not-allowed}
.tg-profile{position:fixed;inset:0;z-index:450;background:rgba(0,0,0,.7);
  backdrop-filter:blur(6px);display:none;align-items:flex-start;justify-content:center;
  padding:calc(60px + env(safe-area-inset-top,0px)) 16px calc(20px + env(safe-area-inset-bottom,0px));
  overflow-y:auto}
.tg-profile.show{display:flex}
.tg-profile-card{background:var(--tg-panel);border-radius:20px;width:100%;max-width:420px;
  overflow:hidden;box-shadow:0 30px 80px rgba(0,0,0,.8);animation:tgModalIn .25s ease;
  margin:auto;position:relative}
.tg-profile-cover{height:110px;position:relative;
  background:linear-gradient(135deg,#1a2535,#0f1724);overflow:hidden}
.tg-profile-cover::before{content:'';position:absolute;inset:0;
  background-image:linear-gradient(rgba(245,166,35,.06) 1px,transparent 1px),
    linear-gradient(90deg,rgba(245,166,35,.06) 1px,transparent 1px);
  background-size:34px 34px;
  mask-image:radial-gradient(circle at 30% 50%,#000,transparent 75%);
  -webkit-mask-image:radial-gradient(circle at 30% 50%,#000,transparent 75%)}
.tg-profile-cover .tag-watermark{position:absolute;right:14px;bottom:6px;
  font-family:'Oswald',sans-serif;font-weight:900;font-style:italic;font-size:34px;
  letter-spacing:-1px;color:transparent;-webkit-text-stroke:1.5px rgba(245,166,35,.45);
  user-select:none}
.tg-profile-avatar-wrap{position:relative;padding:0 20px;margin-top:-52px;
  display:flex;justify-content:center}
.tg-profile-avatar{width:104px;height:104px;border-radius:50%;overflow:hidden;
  display:flex;align-items:center;justify-content:center;font-size:34px;font-weight:700;
  color:#fff;background:linear-gradient(135deg,#5a6675,#3a4452);
  box-shadow:0 0 0 4px var(--tg-panel);position:relative}
.tg-profile-avatar.gold{background:linear-gradient(135deg,#f5a623,#e08a00);color:#12100a}
.tg-profile-avatar.blue{background:linear-gradient(135deg,#4a9eff,#2c6dc9)}
.tg-profile-avatar.elite{background:linear-gradient(135deg,#e0b34a,#a87d1a);color:#12100a}
.tg-profile-avatar img{width:100%;height:100%;object-fit:cover}
.tg-profile-avatar .presence{position:absolute;right:6px;bottom:6px;width:18px;height:18px;
  border-radius:50%;background:#4a5460;box-shadow:0 0 0 3px var(--tg-panel)}
.tg-profile-avatar .presence.on{background:var(--tg-green)}
.tg-profile-info{text-align:center;padding:12px 20px 4px}
.tg-profile-nick{font-size:21px;font-weight:600;letter-spacing:.3px;display:flex;
  align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}
.tg-profile-name{font-size:14px;color:var(--tg-muted);margin-top:2px}
.tg-profile-status{font-size:13px;color:#a8b8c8;margin-top:8px;display:inline-flex;
  align-items:center;gap:6px;padding:4px 12px;border-radius:100px;background:rgba(255,255,255,.04)}
.tg-profile-status.on{color:var(--tg-green)}
.tg-profile-rows{margin:16px 20px 4px;background:rgba(0,0,0,.18);border-radius:14px;overflow:hidden}
.tg-profile-row{display:flex;align-items:center;gap:12px;padding:11px 14px;font-size:14px;
  border-bottom:1px solid rgba(255,255,255,.04)}
.tg-profile-row:last-child{border-bottom:none}
.tg-profile-row .lbl{color:var(--tg-muted);min-width:90px;font-size:13px}
.tg-profile-row .val{flex:1;text-align:right;color:#fff;word-break:break-word}
.tg-profile-actions{padding:14px 16px calc(16px + env(safe-area-inset-bottom,0px));
  display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.tg-profile-actions.cols-3{grid-template-columns:repeat(3,1fr)}
.tg-profile-action{display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:12px 6px;border-radius:12px;background:var(--tg-panel-2);border:none;color:#fff;
  font-size:12px;font-weight:500;transition:background .15s,transform .12s}
.tg-profile-action:active{transform:scale(.95);background:var(--tg-panel-3)}
.tg-profile-action svg{width:22px;height:22px}
.tg-profile-action.primary{background:linear-gradient(135deg,#4a9eff,#2c6dc9);color:#fff}
.tg-profile-action.green{background:linear-gradient(135deg,#38d66a,#20a94e);color:#fff}
.tg-profile-action.warn{background:linear-gradient(135deg,#f5a623,#e08a00);color:#12100a}
.tg-profile-action.danger{background:linear-gradient(135deg,#ff4d5e,#c72637);color:#fff}
.tg-profile-action[disabled]{opacity:.4;cursor:not-allowed}
.tg-profile-close{position:absolute;top:12px;right:12px;width:38px;height:38px;
  border-radius:50%;background:rgba(0,0,0,.55);border:none;color:#fff;display:flex;
  align-items:center;justify-content:center;backdrop-filter:blur(8px);z-index:2}
.tg-profile-close svg{width:18px;height:18px}
.tg-callscreen{position:fixed;inset:0;z-index:500;display:none;flex-direction:column;
  background:radial-gradient(ellipse at 50% 20%,#1e2c44 0%,transparent 60%),
    radial-gradient(ellipse at 50% 100%,#0a1424 0%,transparent 70%),
    linear-gradient(180deg,#0a1018,#05080d);
  color:#fff;overflow:hidden}
.tg-callscreen.show{display:flex}
.tg-callscreen.video-mode{background:#000}
.tg-callscreen.video-mode .tg-callscreen-avatar-wrap{position:absolute;inset:0;padding:0;
  align-items:stretch;justify-content:stretch}
.tg-callscreen.video-mode .tg-callscreen-avatar{width:100%;height:100%;border-radius:0;
  box-shadow:none;animation:none;background:#000;position:relative}
.tg-callscreen.video-mode .tg-callscreen-avatar video{width:100%;height:100%;
  object-fit:cover;display:block}
.tg-callscreen.video-mode .tg-callscreen-head{position:relative;z-index:5;
  padding-top:calc(14px + env(safe-area-inset-top,0px));
  background:linear-gradient(180deg,rgba(0,0,0,.6),transparent);padding-bottom:14px}
.tg-callscreen.video-mode .tg-callscreen-controls{position:relative;z-index:5;
  background:linear-gradient(0deg,rgba(0,0,0,.7),transparent);padding-top:24px}
.tg-callscreen.video-mode .tg-callscreen-timer{color:#fff;text-shadow:0 2px 8px rgba(0,0,0,.8)}
.tg-callscreen-head{padding:calc(20px + env(safe-area-inset-top,0px)) 20px 0;
  text-align:center;flex-shrink:0}
.tg-callscreen-sub{font-size:13px;color:#8fa1b5;letter-spacing:1.5px;text-transform:uppercase}
.tg-callscreen-name{font-size:26px;font-weight:600;margin-top:6px;letter-spacing:.3px}
.tg-callscreen-status{font-size:14px;color:#a8b8c8;margin-top:8px;display:inline-flex;
  align-items:center;gap:6px;padding:6px 14px;border-radius:100px;background:rgba(255,255,255,.05)}
.tg-callscreen-status .online-dot{animation:dotPulse 1.4s ease-in-out infinite}
@keyframes dotPulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.7);opacity:.5}}
.tg-callscreen-avatar-wrap{flex:1;display:flex;align-items:center;justify-content:center;
  padding:20px;min-height:0}
.tg-callscreen-avatar{width:clamp(140px,42vw,220px);height:clamp(140px,42vw,220px);
  border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;
  font-size:clamp(52px,16vw,84px);font-weight:700;
  background:linear-gradient(135deg,#5a6675,#3a4452);
  box-shadow:0 0 0 6px rgba(74,158,255,.15),0 20px 80px rgba(0,0,0,.7);
  animation:callAvatarPulse 2.4s ease-in-out infinite;position:relative}
.tg-callscreen-avatar.gold{background:linear-gradient(135deg,#f5a623,#e08a00);color:#12100a}
.tg-callscreen-avatar.blue{background:linear-gradient(135deg,#4a9eff,#2c6dc9)}
.tg-callscreen-avatar.elite{background:linear-gradient(135deg,#e0b34a,#a87d1a);color:#12100a}
.tg-callscreen-avatar img{width:100%;height:100%;object-fit:cover}
@keyframes callAvatarPulse{0%,100%{box-shadow:0 0 0 6px rgba(74,158,255,.15),0 20px 80px rgba(0,0,0,.7)}
  50%{box-shadow:0 0 0 18px rgba(74,158,255,.05),0 20px 80px rgba(0,0,0,.7)}}
.tg-call-self-preview{position:absolute;top:calc(80px + env(safe-area-inset-top,0px));
  right:14px;width:110px;height:150px;border-radius:14px;overflow:hidden;background:#000;
  box-shadow:0 8px 24px rgba(0,0,0,.6),0 0 0 2px rgba(255,255,255,.08);z-index:6;display:none}
.tg-call-self-preview.show{display:block}
.tg-call-self-preview video{width:100%;height:100%;object-fit:cover;transform:scaleX(-1)}
.tg-call-self-preview .lbl{position:absolute;bottom:4px;left:6px;font-size:10px;
  color:#fff;text-shadow:0 1px 3px rgba(0,0,0,.8);font-weight:600;letter-spacing:1px}
.tg-call-net{position:absolute;top:calc(14px + env(safe-area-inset-top,0px));left:14px;
  display:flex;align-items:flex-end;gap:2px;z-index:6;padding:6px 10px;border-radius:100px;
  background:rgba(0,0,0,.55);backdrop-filter:blur(6px)}
.tg-call-net i{width:3px;background:#8fa1b5;border-radius:1px;transition:background .3s}
.tg-call-net i:nth-child(1){height:6px}
.tg-call-net i:nth-child(2){height:10px}
.tg-call-net i:nth-child(3){height:14px}
.tg-call-net i:nth-child(4){height:18px}
.tg-call-net.l1 i:nth-child(1){background:var(--tg-green)}
.tg-call-net.l2 i:nth-child(-n+2){background:var(--tg-green)}
.tg-call-net.l3 i:nth-child(-n+3){background:var(--tg-green)}
.tg-call-net.l4 i{background:var(--tg-green)}
.tg-call-net .qual{font-size:10px;color:#c8d2dc;margin-left:6px;letter-spacing:1px;
  text-transform:uppercase;font-weight:600}
.tg-callscreen-controls{padding:20px 24px calc(40px + env(safe-area-inset-bottom,0px));
  flex-shrink:0;display:flex;flex-direction:column;align-items:center;gap:22px}
.tg-callscreen-timer{font-family:'Rajdhani',sans-serif;font-size:20px;font-weight:500;
  letter-spacing:2px;color:#a8b8c8;min-height:24px}
.tg-callscreen-buttons{display:flex;justify-content:center;gap:18px}
.tg-callbtn{width:64px;height:64px;border-radius:50%;border:none;color:#fff;display:flex;
  align-items:center;justify-content:center;transition:transform .15s,background .15s;
  background:rgba(255,255,255,.1);backdrop-filter:blur(8px)}
.tg-callbtn:active{transform:scale(.93);background:rgba(255,255,255,.2)}
.tg-callbtn svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.9;
  stroke-linecap:round;stroke-linejoin:round}
.tg-callbtn.active{background:#fff;color:#0e1621}
.tg-callbtn-end{background:linear-gradient(135deg,#ff4d5e,#c72637);width:72px;height:72px}
.tg-callbtn-end svg{width:30px;height:30px}
.tg-callbtn-end:active{background:linear-gradient(135deg,#ff3344,#b01e2e)}
.tg-callin{position:fixed;inset:0;z-index:520;display:none;flex-direction:column;
  align-items:center;
  background:radial-gradient(ellipse at 50% 0%,#1e2c44 0%,transparent 55%),
    radial-gradient(ellipse at 50% 100%,#1a0a10 0%,transparent 65%),
    linear-gradient(180deg,#0a1018,#05080d);
  color:#fff;overflow:hidden;
  padding:calc(40px + env(safe-area-inset-top,0px)) 20px calc(40px + env(safe-area-inset-bottom,0px))}
.tg-callin.show{display:flex}
.tg-callin-shake{animation:callInShake 2.2s ease-in-out infinite}
@keyframes callInShake{0%,100%{transform:translateX(0)}
  25%{transform:translateX(-2px)}75%{transform:translateX(2px)}}
.tg-callin-top{text-align:center;flex-shrink:0}
.tg-callin-label{font-size:12px;letter-spacing:3px;text-transform:uppercase;
  color:#8fa1b5;margin-bottom:6px}
.tg-callin-kind{display:inline-flex;align-items:center;gap:6px;padding:5px 14px;
  border-radius:100px;background:rgba(74,158,255,.15);border:1px solid rgba(74,158,255,.4);
  font-size:12px;font-weight:600;letter-spacing:1px;color:#a7d3ff;margin-top:10px}
.tg-callin-kind svg{width:14px;height:14px}
.tg-callin-avatar-wrap{flex:1;display:flex;align-items:center;justify-content:center;
  padding:20px;min-height:0}
.tg-callin-avatar{width:clamp(150px,46vw,240px);height:clamp(150px,46vw,240px);
  border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;
  font-size:clamp(56px,18vw,96px);font-weight:700;
  background:linear-gradient(135deg,#5a6675,#3a4452);
  box-shadow:0 0 0 8px rgba(56,214,106,.15),0 0 0 24px rgba(56,214,106,.05),0 30px 80px rgba(0,0,0,.8);
  position:relative;animation:callInPulse 1.8s ease-in-out infinite}
.tg-callin-avatar.gold{background:linear-gradient(135deg,#f5a623,#e08a00);color:#12100a}
.tg-callin-avatar.blue{background:linear-gradient(135deg,#4a9eff,#2c6dc9)}
.tg-callin-avatar.elite{background:linear-gradient(135deg,#e0b34a,#a87d1a);color:#12100a}
.tg-callin-avatar img{width:100%;height:100%;object-fit:cover}
@keyframes callInPulse{
  0%,100%{box-shadow:0 0 0 8px rgba(56,214,106,.15),0 0 0 24px rgba(56,214,106,.05),0 30px 80px rgba(0,0,0,.8)}
  50%{box-shadow:0 0 0 16px rgba(56,214,106,.10),0 0 0 40px rgba(56,214,106,.02),0 30px 80px rgba(0,0,0,.8)}}
.tg-callin-info{text-align:center;flex-shrink:0;padding:0 12px 20px}
.tg-callin-name{font-size:26px;font-weight:600;letter-spacing:.3px;margin-bottom:6px}
.tg-callin-sub{font-size:14px;color:#a8b8c8}
.tg-callin-from{font-size:12px;color:#7d8b99;margin-top:4px;letter-spacing:1px}
.tg-callin-buttons{display:flex;gap:26px;align-items:flex-end;justify-content:center;
  flex-shrink:0;width:100%;max-width:420px;margin-top:auto}
.tg-callin-btn{display:flex;flex-direction:column;align-items:center;gap:8px;
  background:none;border:none;color:#fff}
.tg-callin-btn-circle{width:66px;height:66px;border-radius:50%;display:flex;
  align-items:center;justify-content:center;color:#fff;
  transition:transform .15s,box-shadow .2s;position:relative}
.tg-callin-btn-circle svg{width:28px;height:28px}
.tg-callin-btn-circle.reject{background:linear-gradient(135deg,#ff4d5e,#c72637);
  box-shadow:0 8px 30px rgba(255,77,94,.5)}
.tg-callin-btn-circle.audio{background:linear-gradient(135deg,#38d66a,#20a94e);
  box-shadow:0 8px 30px rgba(56,214,106,.5);animation:acceptPulse 1.6s ease-in-out infinite}
.tg-callin-btn-circle.video{background:linear-gradient(135deg,#4a9eff,#2c6dc9);
  box-shadow:0 8px 30px rgba(74,158,255,.5)}
.tg-callin-btn-circle:active{transform:scale(.92)}
@keyframes acceptPulse{
  0%,100%{box-shadow:0 8px 30px rgba(56,214,106,.5),0 0 0 0 rgba(56,214,106,.6)}
  50%{box-shadow:0 8px 30px rgba(56,214,106,.5),0 0 0 14px rgba(56,214,106,0)}}
.tg-callin-btn-label{font-size:12px;font-weight:600;letter-spacing:1px;text-transform:uppercase;
  color:#a8b8c8}
.tg-members-panel{position:fixed;top:0;right:0;bottom:0;width:min(92vw,420px);
  background:var(--tg-bg);z-index:250;transform:translateX(100%);
  transition:transform .28s cubic-bezier(.32,.72,0,1);display:flex;flex-direction:column;
  box-shadow:-16px 0 60px rgba(0,0,0,.6);padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px)}
.tg-members-panel.show{transform:none}
.tg-members-header{display:flex;align-items:center;gap:6px;padding:10px 8px;
  background:var(--tg-panel);border-bottom:1px solid var(--tg-line);flex-shrink:0}
.tg-members-title{flex:1;text-align:center;font-size:16px;font-weight:600;color:#fff}
.tg-members-count{padding:4px 12px;border-radius:100px;background:rgba(245,166,35,.15);
  color:var(--accent);font-size:12px;font-weight:700;letter-spacing:1px;margin-right:8px}
.tg-members-body{flex:1;overflow-y:auto;padding:6px 0 20px;-webkit-overflow-scrolling:touch}
.tg-members-body::-webkit-scrollbar{width:5px}
.tg-members-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.08);border-radius:3px}
.tg-members-section{padding:16px 18px 6px;font-size:12px;letter-spacing:2.5px;
  text-transform:uppercase;color:var(--tg-muted);font-weight:600}
.tg-member-row{display:flex;align-items:center;gap:12px;padding:10px 16px;
  transition:background .15s;cursor:pointer}
.tg-member-row:active{background:rgba(255,255,255,.04)}
.tg-member-info{flex:1;min-width:0}
.tg-member-name{font-size:15px;font-weight:600;color:#fff;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:6px}
.tg-member-status{font-size:12.5px;color:var(--tg-muted);margin-top:1px}
.tg-member-status.on{color:var(--tg-green)}
.tg-member-role-badge{padding:5px 10px;border-radius:100px;font-size:10.5px;font-weight:700;
  letter-spacing:1.2px;border:1px solid transparent;white-space:nowrap;flex-shrink:0;
  transition:transform .12s,filter .15s}
.tg-member-role-badge.leader{color:#f5a623;background:rgba(245,166,35,.15);
  border-color:rgba(245,166,35,.4)}
.tg-member-role-badge.senior_deputy{color:#4a9eff;background:rgba(74,158,255,.15);
  border-color:rgba(74,158,255,.4)}
.tg-member-role-badge.deputy{color:#64b5f6;background:rgba(100,181,246,.13);
  border-color:rgba(100,181,246,.35)}
.tg-member-role-badge.elite{color:#e0b34a;background:rgba(224,179,74,.13);
  border-color:rgba(224,179,74,.35)}
.tg-member-role-badge.member{color:#a8b8c8;background:rgba(168,184,200,.12);
  border-color:rgba(168,184,200,.3)}
.tg-member-role-badge.clickable{cursor:pointer}
.tg-member-role-badge.clickable::after{content:' ▾';font-size:9px;opacity:.7}
.tg-member-role-badge.clickable:active{transform:scale(.94);filter:brightness(1.3)}
.tg-members-footer{padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));
  border-top:1px solid var(--tg-line);flex-shrink:0;display:flex;flex-direction:column;gap:8px}
.tg-storage-info{display:flex;align-items:center;gap:8px;padding:10px 12px;
  background:rgba(74,158,255,.06);border:1px solid rgba(74,158,255,.18);border-radius:10px;
  font-size:12.5px;color:#a7d3ff}
.tg-storage-info svg{width:16px;height:16px;flex-shrink:0}
.tg-storage-bar{flex:1;height:6px;background:rgba(255,255,255,.08);border-radius:3px;
  overflow:hidden;margin-left:6px}
.tg-storage-bar i{display:block;height:100%;background:linear-gradient(90deg,#4a9eff,#38d66a);
  border-radius:3px;transition:width .3s}
.tg-viewer{position:fixed;inset:0;background:#000;z-index:550;display:none;
  align-items:center;justify-content:center;animation:fadeIn .2s ease}
.tg-viewer.show{display:flex}
.tg-viewer img,.tg-viewer video{max-width:100%;max-height:100%;object-fit:contain}
.tg-viewer-close{position:absolute;top:calc(12px + env(safe-area-inset-top,0px));right:12px;
  width:44px;height:44px;border-radius:50%;border:none;background:rgba(0,0,0,.5);color:#fff;
  display:flex;align-items:center;justify-content:center;z-index:2;backdrop-filter:blur(8px)}
.tg-viewer-close svg{width:22px;height:22px}
.tg-viewer-dl{position:absolute;top:calc(12px + env(safe-area-inset-top,0px));right:64px;
  width:44px;height:44px;border-radius:50%;border:none;background:rgba(0,0,0,.5);color:#fff;
  display:flex;align-items:center;justify-content:center;z-index:2;backdrop-filter:blur(8px)}
.tg-viewer-dl svg{width:22px;height:22px}
.tg-gallery-picker{position:fixed;inset:0;z-index:480;background:rgba(8,12,18,.97);
  backdrop-filter:blur(10px);display:none;flex-direction:column;
  padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
.tg-gallery-picker.show{display:flex}
.tg-gallery-header{display:flex;align-items:center;gap:8px;padding:12px 14px;
  border-bottom:1px solid var(--tg-line);flex-shrink:0}
.tg-gallery-header .title{flex:1;font-size:16px;font-weight:600;color:#fff}
.tg-gallery-header .sel-count{font-size:13px;color:var(--tg-muted);padding:4px 12px;
  border-radius:100px;background:rgba(255,255,255,.05)}
.tg-gallery-header .sel-count.full{color:var(--accent);background:rgba(245,166,35,.15)}
.tg-gallery-body{flex:1;overflow-y:auto;padding:8px;display:grid;
  grid-template-columns:repeat(3,1fr);gap:3px;align-content:start}
.tg-gallery-body::-webkit-scrollbar{width:6px}
.tg-gallery-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);border-radius:3px}
.tg-gallery-item{position:relative;aspect-ratio:1/1;overflow:hidden;background:#000;
  cursor:pointer;border-radius:6px;transition:transform .12s}
.tg-gallery-item:active{transform:scale(.96)}
.tg-gallery-item img,.tg-gallery-item video{width:100%;height:100%;object-fit:cover;display:block}
.tg-gallery-item.video-item::before{content:'';position:absolute;top:6px;left:6px;
  width:22px;height:22px;border-radius:50%;background:rgba(0,0,0,.65);
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M8 5v14l11-7z'/></svg>");
  background-size:14px;background-position:center;background-repeat:no-repeat;z-index:2}
.tg-gallery-item .check{position:absolute;top:6px;right:6px;width:26px;height:26px;
  border-radius:50%;border:2px solid rgba(255,255,255,.85);background:rgba(0,0,0,.35);
  display:flex;align-items:center;justify-content:center;z-index:3;
  transition:background .15s,border-color .15s}
.tg-gallery-item .check::after{content:'';width:12px;height:7px;
  border-left:2px solid #fff;border-bottom:2px solid #fff;
  transform:rotate(-45deg) translate(1px,-1px);opacity:0;transition:opacity .15s}
.tg-gallery-item.selected .check{background:var(--accent);border-color:var(--accent)}
.tg-gallery-item.selected .check::after{opacity:1}
.tg-gallery-item.selected{outline:3px solid var(--accent);outline-offset:-3px}
.tg-gallery-item .ord{position:absolute;bottom:6px;right:6px;min-width:22px;height:22px;
  padding:0 6px;border-radius:11px;background:var(--accent);color:#12100a;font-size:12px;
  font-weight:700;display:none;align-items:center;justify-content:center;z-index:3}
.tg-gallery-item.selected .ord{display:flex}
.tg-gallery-footer{padding:12px 14px;border-top:1px solid var(--tg-line);display:flex;
  gap:10px;flex-shrink:0}
.tg-gallery-footer .btn{flex:1;max-width:none}
.tg-gallery-progress{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);
  z-index:490;background:rgba(17,21,28,.95);border:1px solid var(--tg-line);
  border-radius:16px;padding:24px 32px;min-width:260px;text-align:center;display:none}
.tg-gallery-progress.show{display:block}
.tg-gallery-progress .lbl{font-size:14px;color:#a8b8c8;margin-bottom:12px}
.tg-gallery-progress .bar{height:6px;background:rgba(255,255,255,.08);border-radius:3px;
  overflow:hidden}
.tg-gallery-progress .bar i{display:block;height:100%;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));width:0%;
  border-radius:3px;transition:width .25s}
.tg-gallery-progress .pct{margin-top:8px;font-size:12px;color:var(--tg-muted)}
.tg-vote-screen{position:fixed;inset:0;z-index:250;background:var(--tg-bg);
  transform:translateX(100%);transition:transform .28s cubic-bezier(.32,.72,0,1);
  display:flex;flex-direction:column;padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px)}
.tg-vote-screen.show{transform:none}
.tg-vote-header{display:flex;align-items:center;gap:6px;padding:10px 8px;
  background:var(--tg-panel);border-bottom:1px solid var(--tg-line);flex-shrink:0}
.tg-vote-title{flex:1;text-align:center;font-size:16px;font-weight:600;color:#fff}
.tg-vote-body{flex:1;overflow-y:auto;padding:12px}
.tg-vote-card{background:var(--tg-panel);border-radius:14px;padding:14px;
  margin-bottom:10px;border:1px solid rgba(245,166,35,.2);
  box-shadow:0 4px 16px rgba(0,0,0,.25)}
.tg-vote-card-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.tg-vote-card-head .tg-avatar{width:44px;height:44px;font-size:16px}
.tg-vote-card-info{flex:1;min-width:0}
.tg-vote-card-title{font-size:15px;font-weight:600;color:#fff;line-height:1.3}
.tg-vote-card-title b{color:var(--accent)}
.tg-vote-card-title .victim{color:#ff8a96}
.tg-vote-card-meta{font-size:12px;color:var(--tg-muted);margin-top:2px}
.tg-vote-reason{padding:10px 12px;background:rgba(0,0,0,.22);border-radius:9px;
  font-size:13px;color:#c8d2dc;font-style:italic;margin-bottom:10px;
  border-left:2px solid var(--tg-warn);line-height:1.4}
.tg-vote-progress{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.tg-vote-bar{flex:1;height:10px;background:rgba(255,255,255,.06);border-radius:5px;
  overflow:hidden;position:relative}
.tg-vote-bar i{display:block;height:100%;background:linear-gradient(90deg,#ff4d5e,#c72637);
  border-radius:5px;transition:width .3s}
.tg-vote-bar i.leave{background:linear-gradient(90deg,#38d66a,#20a94e)}
.tg-vote-counts{display:flex;gap:10px;font-size:12px;font-weight:700;flex-shrink:0}
.tg-vote-counts .kick{color:#ff8a96}
.tg-vote-counts .keep{color:#8ce8aa}
.tg-vote-timer{display:flex;align-items:center;gap:6px;font-size:12px;
  color:var(--tg-muted);margin-bottom:10px}
.tg-vote-timer svg{width:14px;height:14px}
.tg-vote-timer.urgent{color:var(--tg-danger)}
.tg-vote-actions{display:flex;gap:8px}
.tg-vote-actions button{flex:1;padding:11px;border-radius:10px;border:none;font-size:13px;
  font-weight:700;letter-spacing:.5px;text-transform:uppercase;
  transition:transform .12s,opacity .15s}
.tg-vote-actions button:active{transform:scale(.97)}
.tg-vote-actions .btn-kick{background:linear-gradient(135deg,#ff4d5e,#c72637);color:#fff}
.tg-vote-actions .btn-keep{background:linear-gradient(135deg,#38d66a,#20a94e);color:#fff}
.tg-vote-actions .btn-cancel{background:var(--tg-panel-2);color:#fff}
.tg-vote-actions button[disabled]{opacity:.45;cursor:not-allowed}
.tg-vote-status{padding:8px 12px;border-radius:9px;font-size:12.5px;text-align:center;
  margin-top:8px;font-weight:600}
.tg-vote-status.kick{background:rgba(255,77,94,.14);color:#ff8a96}
.tg-vote-status.keep{background:rgba(56,214,106,.14);color:#8ce8aa}
.tg-vote-status.expired{background:rgba(125,139,153,.14);color:#a8b8c8}
.tg-vote-empty{text-align:center;padding:60px 20px;color:var(--tg-muted);font-size:14px}
.tg-vote-empty svg{width:64px;height:64px;margin:0 auto 14px;opacity:.4}
.tg-reason-input{width:100%;padding:12px 14px;border-radius:11px;background:#0a0e14;
  border:1px solid #232a35;color:#fff;font-size:15px;resize:none;min-height:80px;
  max-height:160px;font-family:inherit;line-height:1.4}
.tg-reason-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(245,166,35,.15)}
.tg-recording-overlay{position:fixed;inset:0;z-index:460;background:rgba(0,0,0,.78);
  backdrop-filter:blur(8px);display:none;align-items:center;justify-content:center;
  flex-direction:column;color:#fff;gap:14px;padding:20px}
.tg-recording-overlay.show{display:flex}
.tg-recording-dot{width:18px;height:18px;border-radius:50%;background:#ff4d5e;
  box-shadow:0 0 24px #ff4d5e;animation:recDot 1s ease-in-out infinite}
@keyframes recDot{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(.8)}}
.tg-recording-time{font-size:42px;font-weight:300;font-family:'Rajdhani',sans-serif;
  letter-spacing:2px}
.tg-recording-hint{font-size:13px;color:#a8b8c8;letter-spacing:1px;text-align:center}
.tg-recording-hint b{color:#ff4d5e}
.tg-circle-modal{position:fixed;inset:0;z-index:460;background:rgba(0,0,0,.92);
  backdrop-filter:blur(10px);display:none;flex-direction:column;align-items:center;
  justify-content:center;padding:20px;gap:20px}
.tg-circle-modal.show{display:flex}
.tg-circle-container{position:relative;width:min(72vw,300px);aspect-ratio:1/1;
  border-radius:50%;overflow:hidden;background:#000;
  box-shadow:0 0 0 3px rgba(255,255,255,.1),0 0 60px rgba(255,77,94,.4)}
.tg-circle-container video{width:100%;height:100%;object-fit:cover;display:block;
  transform:scaleX(-1)}
.tg-circle-timer{font-size:22px;font-weight:600;color:#fff;letter-spacing:2px;
  font-family:'Rajdhani',sans-serif}
.tg-circle-actions{display:flex;gap:14px;width:100%;max-width:340px}
.tg-circle-actions button{flex:1;padding:14px;border-radius:12px;border:none;font-size:15px;
  font-weight:600;letter-spacing:1px;text-transform:uppercase}
.tg-circle-cancel{background:var(--tg-panel-2);color:#fff}
.tg-circle-send{background:var(--tg-accent);color:#fff}
.tg-circle-hint{font-size:13px;color:#a8b8c8;text-align:center;max-width:320px;line-height:1.5}
.tg-sticker-preview{position:fixed;inset:0;z-index:470;background:rgba(0,0,0,.85);
  backdrop-filter:blur(10px);display:none;align-items:center;justify-content:center;
  flex-direction:column;padding:20px;gap:20px}
.tg-sticker-preview.show{display:flex}
.tg-sticker-preview .big{width:min(72vw,320px);height:min(72vw,320px);display:flex;
  align-items:center;justify-content:center;
  animation:stickerIn .3s cubic-bezier(.34,1.56,.64,1)}
.tg-sticker-preview .big svg{width:100%;height:100%;
  filter:drop-shadow(0 20px 40px rgba(245,166,35,.35))}
@keyframes stickerIn{from{transform:scale(.7);opacity:0}to{transform:scale(1);opacity:1}}
.tg-sticker-preview .actions{display:flex;gap:12px;width:100%;max-width:340px}
.tg-sticker-preview .actions button{flex:1;padding:13px;border-radius:12px;border:none;
  font-size:15px;font-weight:700;letter-spacing:1px;text-transform:uppercase}
.tg-sticker-preview .send{background:linear-gradient(135deg,#f5a623,#e08a00);color:#12100a}
.tg-sticker-preview .cancel{background:var(--tg-panel-2);color:#fff}
.tg-toast{position:fixed;bottom:calc(24px + env(safe-area-inset-bottom,0px));left:50%;
  transform:translateX(-50%) translateY(120%);background:rgba(23,33,43,.98);
  border:1px solid rgba(255,255,255,.1);color:#fff;padding:12px 22px;border-radius:22px;
  font-size:14px;z-index:600;box-shadow:0 12px 40px rgba(0,0,0,.6);
  transition:transform .3s ease;pointer-events:none;max-width:90vw;text-align:center;
  backdrop-filter:blur(12px)}
.tg-toast.show{transform:translateX(-50%) translateY(0)}
.tg-toast.err{border-color:var(--tg-danger);color:#ffb0b8}
.tg-toast.ok{border-color:var(--tg-green);color:#a8f0bd}
@media (max-width:360px){
  .tg-msg-body{max-width:78%}
  .tg-header-name{font-size:14px}
  .tg-composer > .tg-icon-btn{width:38px;height:38px}
  .tg-send-btn{width:38px;height:38px}
  .tg-mic-btn{width:38px;height:38px}
  .tg-input-wrap textarea{font-size:15px;padding:10px 40px 10px 12px}
  .tg-circle{width:190px;height:190px}
  .tg-callscreen-buttons{gap:12px}
  .tg-callbtn{width:58px;height:58px}
  .tg-callbtn-end{width:66px;height:66px}
  .tg-callin-buttons{gap:16px}
  .tg-callin-btn-circle{width:56px;height:56px}
  .tg-sticker-pack{grid-template-columns:repeat(auto-fill,minmax(72px,1fr))}
  .tg-gallery-body{grid-template-columns:repeat(3,1fr)}
  .tg-gallery-footer{flex-direction:column}
}
@media (min-width:700px){
  .tg-messages{padding:16px 20px}
  .tg-msg-body{max-width:min(70%,560px)}
}
@media (min-width:900px){
  .tg-sheet{max-width:600px}
  .tg-modal{max-width:440px}
}
