/* ---- chat-layout-v3 ---- */
/* «Капли» theme */
.theme-preview[data-theme="drops"] .theme-thumb{background-image:url("../chat-drops.svg")}
.theme-live-preview[data-theme-preview="drops"],.theme-full-scene[data-theme-preview="drops"]{background-image:url("../chat-drops.svg")}
.chat-card[data-chat-theme="drops"]{background-image:url("../chat-drops.svg")}
/* crafted chat scenes of the «Хронос» series: shown in the picker for everyone, applied only when crafted in the workshop */
.theme-preview[data-theme="chronos-workshop"] .theme-thumb{background-image:url("../chat-chronos-workshop.svg")}
.theme-live-preview[data-theme-preview="chronos-workshop"],.theme-full-scene[data-theme-preview="chronos-workshop"]{background-image:url("../chat-chronos-workshop.svg")}
.chat-card[data-chat-theme="chronos-workshop"]{background-image:url("../chat-chronos-workshop.svg")}
.theme-preview[data-theme="chronos-city"] .theme-thumb{background-image:url("../chat-chronos-city.svg")}
.theme-live-preview[data-theme-preview="chronos-city"],.theme-full-scene[data-theme-preview="chronos-city"]{background-image:url("../chat-chronos-city.svg")}
.chat-card[data-chat-theme="chronos-city"]{background-image:url("../chat-chronos-city.svg")}
.theme-preview[data-theme="chronos-heart"] .theme-thumb{background-image:url("../chat-chronos-heart.svg")}
.theme-live-preview[data-theme-preview="chronos-heart"],.theme-full-scene[data-theme-preview="chronos-heart"]{background-image:url("../chat-chronos-heart.svg")}
.chat-card[data-chat-theme="chronos-heart"]{background-image:url("../chat-chronos-heart.svg")}
.theme-preview[data-craft]{border-color:rgba(255,210,122,.45)}
.theme-preview[data-theme="duo-border"] .theme-thumb{background-image:url("../chat-duo-border.svg")}
.theme-live-preview[data-theme-preview="duo-border"],.theme-full-scene[data-theme-preview="duo-border"]{background-image:url("../chat-duo-border.svg")}
.chat-card[data-chat-theme="duo-border"]{background-image:url("../chat-duo-border.svg")}
.theme-preview[data-theme="duo-backtoback"] .theme-thumb{background-image:url("../chat-duo-backtoback.svg")}
.theme-live-preview[data-theme-preview="duo-backtoback"],.theme-full-scene[data-theme-preview="duo-backtoback"]{background-image:url("../chat-duo-backtoback.svg")}
.chat-card[data-chat-theme="duo-backtoback"]{background-image:url("../chat-duo-backtoback.svg")}
.theme-preview[data-duo]{border-color:rgba(34,230,255,.45)}
.theme-preview.locked .theme-thumb{filter:saturate(.55) brightness(.75)}
.theme-preview.locked>span:last-child::before{content:"🔒 "}
/* Theme picker: four thumbnails in one row, the eye sits on the thumbnail's corner (no separate column) */
.theme-preview-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px}
.theme-option{position:relative;display:block!important}
.theme-option .theme-preview{width:100%;height:auto}
.theme-option .theme-eye{position:absolute;top:9px;right:9px;z-index:2;width:30px;min-height:0;height:30px;padding:0;border-radius:50%;border:1px solid rgba(255,255,255,.4);background:rgba(6,5,22,.66);backdrop-filter:blur(4px);font-size:.95rem;line-height:1;box-shadow:0 2px 8px rgba(0,0,0,.35)}
.theme-panel{padding:8px 10px;gap:7px}
.theme-panel-head{gap:6px}
.theme-panel-head b{margin-right:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.theme-panel-head .theme-panel-actions{display:flex;gap:6px;flex:none}
.theme-panel-head .theme-panel-actions button{flex:none;padding:6px 12px;font-size:.78rem;min-height:32px}
.theme-panel-head #chatThemeClose,.theme-panel-head #dmThemeClose{min-height:32px}
.theme-thumb{height:64px}
@media(max-width:520px){.theme-preview-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.theme-panel-head b{display:none}}
/* Full preview: flip themes with arrows, like the arena preview */
.theme-full-actions .theme-full-nav{width:42px;height:42px;flex:none;font-size:1.5rem;line-height:1;padding:0;display:grid;place-items:center}
.theme-full-n{font-size:.78rem;color:#d2c8f7;min-width:38px;text-align:center}
.theme-full-actions #themeFullNext{margin-right:auto}
/* Chat title row: title, tabs and gear share one line in landscape */
#chatCard .chat-topline{flex-wrap:wrap!important;flex:0 0 auto!important;min-height:0!important;row-gap:8px;box-sizing:border-box}
#chatCard .chat-topline h1{flex:1 0 100%;min-height:40px;display:flex!important;align-items:center;justify-content:center}
#chatCard .chat-topline .chat-tabs{order:2;flex:1 0 100%}
#chatCard #chatThemeGear{top:2px!important;transform:none!important}
@media(orientation:landscape){
  #chatCard{padding-top:8px!important;gap:8px!important}
  #chatCard > .card-back{top:8px}
  #chatCard .chat-topline{flex-wrap:nowrap!important;gap:12px;min-height:38px!important;padding-left:28px;padding-right:0}
  #chatCard .chat-topline h1{flex:none;width:auto;min-height:0;padding:0 0 0 6px!important;font-size:1.25rem!important}
  #chatCard .chat-topline .chat-tabs{order:0;flex:1 1 auto;width:auto!important;max-width:520px;margin:0 auto!important}
  #chatCard .chat-topline .chat-tabs .tab{min-height:34px;padding:5px 10px;font-size:.84rem}
  #chatCard #chatThemeGear{position:static!important;transform:none!important;flex:none;width:38px;height:38px}
  #chatCard #chatNote{display:none}
  #chatCard .chat-form{padding:4px}
  #chatCard .theme-thumb{height:54px}
  #chatCard #chatThemePanel{max-height:none}
}

/* ---- chat-emotes-v2 ---- */
/* «Капли 3D» chat emotes — every part animates once when shown (.emo-play) and again on tap; still otherwise */
.emo{display:block;width:100%;height:100%;overflow:visible}
.emo *{transform-box:fill-box;transform-origin:50% 50%}
.emo .e-body{transform-origin:50% 100%}
.emo-play .emo .e-body{animation:emoSquish .7s cubic-bezier(.3,1.6,.5,1) both}
.emo-play .emo .e-eyes{animation:emoBlink .32s ease-in-out .9s both}
/* per-emote moves */
.emo-play[data-emote=":smile:"] .emo .e-body{animation:emoSquish .7s cubic-bezier(.3,1.6,.5,1) both,emoHop .55s ease-out .7s both}
.emo-play[data-emote=":sad:"] .emo .e-body{animation:emoSag 1.3s ease-in-out both}
.emo-play[data-emote=":sad:"] .emo .e-tear{animation:emoTear 1.3s ease-in .25s both}
.emo-play[data-emote=":angry:"] .emo .e-body{animation:emoSquish .5s cubic-bezier(.3,1.6,.5,1) both,emoShake .5s linear .45s 2 both}
.emo-play[data-emote=":angry:"] .emo path[fill="url(#emoangryG)"]{animation:emoRed 1.4s ease-in-out both}
.emo-play[data-emote=":laugh:"] .emo .e-body{animation:emoLaugh 1.2s ease-in-out both}
.emo-play[data-emote=":laugh:"] .emo .e-tears{animation:emoJoyTears 1.2s ease-out .2s both}
.emo-play[data-emote=":love:"] .emo .e-hp{animation:emoBeat .5s ease-in-out .2s 3 both}
.emo-play[data-emote=":love:"] .emo .e-body{animation:emoSquish .7s cubic-bezier(.3,1.6,.5,1) both,emoSway 1.4s ease-in-out .3s both}
.emo-play[data-emote=":wow:"] .emo .e-body{animation:emoJump .8s cubic-bezier(.2,.9,.3,1.2) both}
.emo-play[data-emote=":wow:"] .emo .e-eyes{animation:emoBig .8s ease-out both}
.emo-play[data-emote=":wow:"] .emo .e-mouth{animation:emoO .8s ease-out both}
.emo-play[data-emote=":cool:"] .emo .e-glasses{animation:emoShades .9s cubic-bezier(.3,1.4,.5,1) both}
.emo-play[data-emote=":wink:"] .emo .e-eyes{animation:none}
.emo-play[data-emote=":wink:"] .emo .e-wink{animation:emoWink .7s ease-in-out .25s both}
.emo-play[data-emote=":wink:"] .emo .e-star{animation:emoStar .9s ease-out .5s both}
.emo-play[data-emote=":king:"] .emo .e-crown{animation:emoCrown .9s cubic-bezier(.3,1.5,.5,1) both}
.emo-play[data-emote=":king:"] .emo .e-eyes{animation:none}
.emo-play[data-emote=":yum:"] .emo .e-food{animation:emoEat 1.1s ease-in both}
.emo-play[data-emote=":yum:"] .emo .e-mouth{animation:emoChomp .34s ease-in-out .75s 2 both}
.emo-play[data-emote=":yum:"] .emo .e-tongue{animation:emoLick 1s ease-in-out 1.2s both}
.emo-play[data-emote=":splat:"] .emo .e-body{animation:emoSplat .8s cubic-bezier(.3,1.5,.5,1) both}
.emo-play[data-emote=":splat:"] .emo .e-drips{animation:emoDrips .8s ease-out .1s both}
.emo-play[data-emote=":splat:"] .emo .e-eyes{animation:emoSpin .7s ease-out .3s both}
.emo-play[data-emote=":gg:"] .emo .e-cup{animation:emoCup .9s cubic-bezier(.3,1.5,.5,1) both}
.emo-play[data-emote=":gg:"] .emo .e-confetti{animation:emoConf 1.3s ease-out .3s both}
.emo-play[data-emote=":gg:"] .emo .e-eyes{animation:none}
@keyframes emoSquish{0%{transform:scale(.4,.4);opacity:.3}45%{transform:scale(1.14,.86);opacity:1}70%{transform:scale(.94,1.07)}100%{transform:none}}
@keyframes emoBlink{0%,100%{transform:none}50%{transform:scaleY(.1)}}
@keyframes emoHop{0%,100%{transform:none}40%{transform:translateY(-12%) scale(.96,1.05)}75%{transform:scale(1.06,.94)}}
@keyframes emoSag{0%{transform:scale(.5);opacity:.3}25%{transform:none;opacity:1}55%{transform:scale(1.07,.9)}100%{transform:scale(1.03,.96)}}
@keyframes emoTear{0%{opacity:0;transform:translateY(-70%) scale(.4)}30%{opacity:1;transform:translateY(-50%) scale(1)}100%{opacity:1;transform:none}}
@keyframes emoShake{0%,100%{transform:none}25%{transform:translateX(-6%) rotate(-4deg)}75%{transform:translateX(6%) rotate(4deg)}}
@keyframes emoRed{0%,100%{filter:none}50%{filter:brightness(1.25) saturate(1.4)}}
@keyframes emoLaugh{0%{transform:scale(.4);opacity:.3}20%{transform:none;opacity:1}35%{transform:rotate(-8deg) translateY(-6%)}50%{transform:rotate(7deg)}65%{transform:rotate(-6deg) translateY(-4%)}80%{transform:rotate(4deg)}100%{transform:none}}
@keyframes emoJoyTears{0%{opacity:0;transform:scale(.4)}30%{opacity:1;transform:scale(1.15)}100%{opacity:1;transform:none}}
@keyframes emoBeat{0%,100%{transform:none}50%{transform:scale(1.35)}}
@keyframes emoSway{0%,100%{transform:none}30%{transform:rotate(-6deg)}70%{transform:rotate(6deg)}}
@keyframes emoJump{0%{transform:scale(.4);opacity:.3}35%{transform:translateY(-16%) scale(.9,1.15);opacity:1}65%{transform:scale(1.1,.9)}100%{transform:none}}
@keyframes emoBig{0%{transform:scale(.6)}40%{transform:scale(1.25)}100%{transform:none}}
@keyframes emoO{0%{transform:scale(.2)}45%{transform:scale(1.3,1.4)}100%{transform:none}}
@keyframes emoShades{0%{transform:translateY(-120%) rotate(-12deg);opacity:0}60%{transform:translateY(8%);opacity:1}80%{transform:translateY(-4%)}100%{transform:none}}
@keyframes emoWink{0%,100%{transform:none}50%{transform:scaleY(.35)}}
@keyframes emoStar{0%{opacity:0;transform:scale(.2) rotate(0)}40%{opacity:1;transform:scale(1.3) rotate(90deg)}100%{opacity:1;transform:rotate(180deg)}}
@keyframes emoCrown{0%{transform:translateY(-140%) rotate(-20deg);opacity:0}55%{transform:translateY(6%) rotate(4deg);opacity:1}78%{transform:translateY(-6%) rotate(-2deg)}100%{transform:none}}
@keyframes emoEat{0%{transform:translate(60%,-40%) scale(1.2);opacity:0}25%{opacity:1}70%{transform:none;opacity:1}100%{transform:translate(-210%,0) scale(.3);opacity:0}}
@keyframes emoChomp{0%,100%{transform:none}50%{transform:scaleY(.25)}}
@keyframes emoLick{0%,100%{opacity:1;transform:none}50%{transform:translateX(-14%) rotate(-10deg)}}
@keyframes emoSplat{0%{transform:translateY(-60%) scale(.5,1.4);opacity:.4}40%{transform:scale(1.35,.55);opacity:1}65%{transform:scale(.92,1.1)}100%{transform:none}}
@keyframes emoDrips{0%{opacity:0;transform:scale(.2)}35%{opacity:1;transform:scale(1.4)}100%{opacity:1;transform:none}}
@keyframes emoSpin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}
@keyframes emoCup{0%{transform:translateY(60%) scale(.3);opacity:0}55%{transform:translateY(-14%) rotate(-8deg) scale(1.1);opacity:1}100%{transform:none}}
@keyframes emoConf{0%{opacity:0;transform:translateY(20%) scale(.4)}35%{opacity:1;transform:translateY(-10%) scale(1.15)}100%{opacity:1;transform:none}}
.emo-play[data-emote=":cake:"] .emo .e-body{animation:emoSquish .7s cubic-bezier(.3,1.6,.5,1) both,emoSway 1.4s ease-in-out .5s both}
.emo-play[data-emote=":cake:"] .emo .e-flame{animation:emoFlame .35s ease-in-out .3s 5 alternate both}
.emo-play[data-emote=":cake:"] .emo .e-candles{animation:emoCandles .8s cubic-bezier(.3,1.5,.5,1) both}
.emo-play[data-emote=":cake:"] .emo .e-eyes{animation:none}
@keyframes emoFlame{0%{transform:scale(1,1) rotate(-6deg)}100%{transform:scale(.8,1.25) rotate(6deg)}}
@keyframes emoCandles{0%{transform:translateY(60%);opacity:0}60%{transform:translateY(-8%);opacity:1}100%{transform:none}}
@media(prefers-reduced-motion:reduce){.emo-play .emo *{animation:none!important}}

.chat-emoji-option .emo-w{display:block;width:46px;height:46px;pointer-events:none}
.chat-emoji-picker{gap:6px}
.chat-inline-emoji{cursor:pointer}
.chat-list li p .chat-inline-emoji,.dm-list li p .chat-inline-emoji{display:inline-block;width:2.2em;height:2.2em;vertical-align:-.6em;margin:0 .05em}
.chat-list li.emo-only,.dm-list li.emo-only{background:transparent!important;border-color:transparent!important;box-shadow:none!important}
.chat-list li.emo-only p .chat-inline-emoji,.dm-list li.emo-only p .chat-inline-emoji{width:3.8em;height:3.8em;vertical-align:middle}
.chat-emoji-option .emo-w .emo{filter:drop-shadow(0 2px 3px rgba(0,0,0,.45))}
/* «Хронос» emotes */
.emo-play[data-emote=":tick:"] .emo .e-body{transform-origin:50% 0%;animation:emoPend 1.7s ease-in-out both}
.emo-play[data-emote=":tick:"] .emo .e-look{animation:emoLookLR 1.7s ease-in-out both}
.emo-play[data-emote=":tick:"] .emo .e-eyes{animation:none}
.emo-play[data-emote=":wait:"] .emo .e-body{animation:emoSquish .7s cubic-bezier(.3,1.6,.5,1) both,emoTap .32s ease-in-out .8s 3 both}
.emo-play[data-emote=":wait:"] .emo .e-glass{animation:emoFlip 1.1s cubic-bezier(.5,0,.3,1.3) .5s both}
.emo-play[data-emote=":wait:"] .emo .e-sandA{animation:emoSand 1.2s linear 1.5s both}
.emo-play[data-emote=":wait:"] .emo .e-eyes{animation:none}
.emo-play[data-emote=":late:"] .emo .e-body{animation:emoRun 1.3s ease-in-out both}
.emo-play[data-emote=":late:"] .emo .e-alarm{animation:emoRing .14s linear .2s 8 alternate both}
.emo-play[data-emote=":late:"] .emo .e-sweat{animation:emoFly .9s ease-out .2s both}
.emo-play[data-emote=":late:"] .emo .e-speed{animation:emoSpeed .45s ease-out .1s 3 both}
.emo-play[data-emote=":late:"] .emo .e-eyes{animation:none}
.emo-play[data-emote=":windup:"] .emo .e-body{animation:emoSquish .6s cubic-bezier(.3,1.6,.5,1) both,emoHop .4s ease-out .6s 3 both}
.emo-play[data-emote=":windup:"] .emo .e-key{transform-origin:50% 100%;animation:emoKey .45s linear .1s 4 both}
.emo-play[data-emote=":windup:"] .emo .e-zap{animation:emoConf .9s ease-out .5s both}
.emo-play[data-emote=":windup:"] .emo .e-eyes{animation:none}
.emo-play[data-emote=":freeze:"] .emo .e-body{animation:emoFreeze 1.3s steps(1,end) both}
.emo-play[data-emote=":freeze:"] .emo path[fill="url(#emofreezeG)"]{animation:emoDrain 1.3s ease-out both}
.emo-play[data-emote=":freeze:"] .emo .e-crack{stroke-dasharray:1;animation:emoCrack .5s ease-out .75s both}
.emo-play[data-emote=":freeze:"] .emo .e-pause{animation:emoStar .5s ease-out .6s both}
.emo-play[data-emote=":freeze:"] .emo .e-eyes{animation:none}
.emo-play[data-emote=":cuckoo:"] .emo .e-bird{animation:emoPop 1.5s cubic-bezier(.3,1.5,.5,1) .3s both}
.emo-play[data-emote=":cuckoo:"] .emo .e-notes{animation:emoNotes 1.5s ease-out .45s both}
.emo-play[data-emote=":cuckoo:"] .emo .e-mouth{animation:emoO .5s ease-out .4s 2 both}
.emo-play[data-emote=":cuckoo:"] .emo .e-eyes{animation:none}
@keyframes emoPend{0%{transform:scale(.4);opacity:.3}15%{transform:none;opacity:1}32%{transform:rotate(15deg)}52%{transform:rotate(-15deg)}70%{transform:rotate(10deg)}86%{transform:rotate(-6deg)}100%{transform:none}}
@keyframes emoLookLR{0%,15%,100%{transform:none}32%{transform:translateX(-9%)}52%{transform:translateX(9%)}70%{transform:translateX(-6%)}86%{transform:translateX(4%)}}
@keyframes emoTap{0%,100%{transform:none}50%{transform:scale(1.05,.93)}}
@keyframes emoFlip{0%{transform:none}100%{transform:rotate(180deg)}}
@keyframes emoSand{0%{transform:none}100%{transform:scaleY(.25)}}
@keyframes emoRun{0%{transform:translateX(-50%) skewX(0);opacity:0}25%{transform:translateX(-8%) skewX(-14deg);opacity:1}45%{transform:translateX(6%) skewX(-12deg) translateY(-5%)}65%{transform:translateX(-4%) skewX(-12deg)}82%{transform:translateX(4%) skewX(-8deg) translateY(-3%)}100%{transform:skewX(-6deg)}}
@keyframes emoRing{0%{transform:rotate(-14deg)}100%{transform:rotate(14deg)}}
@keyframes emoFly{0%{opacity:0;transform:translateX(120%)}30%{opacity:1}100%{opacity:1;transform:none}}
@keyframes emoSpeed{0%{opacity:0;transform:translateX(70%)}50%{opacity:.9}100%{opacity:0;transform:translateX(-60%)}}
@keyframes emoKey{0%{transform:scaleX(1)}50%{transform:scaleX(.12)}100%{transform:scaleX(1)}}
@keyframes emoFreeze{0%{transform:translateY(0) scale(.9,1.1)}20%{transform:translateY(-10%) scale(.95,1.08)}40%,100%{transform:translateY(-14%) rotate(-7deg)}}
@keyframes emoDrain{0%,35%{filter:sepia(1) saturate(6) hue-rotate(150deg) brightness(1.1)}70%,100%{filter:none}}
@keyframes emoCrack{0%{stroke-dashoffset:1}100%{stroke-dashoffset:0}}
@keyframes emoPop{0%,100%{transform:translateY(55%) scale(.6);opacity:0}18%,38%{transform:translateY(-70%);opacity:1}48%{transform:translateY(40%) scale(.7);opacity:0}62%,84%{transform:translateY(-70%);opacity:1}}
@keyframes emoNotes{0%{opacity:0;transform:translateY(40%) scale(.5)}25%{opacity:1;transform:translateY(-10%) scale(1.1)}55%{opacity:.4;transform:none}75%{opacity:1;transform:translateY(-14%) scale(1.1)}100%{opacity:1;transform:none}}
