/* ===== Чат SpinX (js/chat.js) — свой стиль: неон-стекло, пузыри сообщений, «билеты» заносов ===== */
.iconbtn--chat svg { width: 21px; height: 21px; }
@media (max-width: 480px) {
  .iconbtn--chat { width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto; }
}
/* у вошедшего игрока справа кнопка чата, кошелёк и аватарка — на телефонах чуть плотнее */
@media (max-width: 480px) {
  body.is-logged .hdr__right { gap: 6px; }
  body.is-logged .hdr__left { flex-shrink: 0; }
}

.chatp { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; color: #fff; background: transparent; overflow: hidden; }
.chatp::backdrop { background: rgb(4 6 14 / 0.600); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.chatp[open] { animation: chatp-up 0.380s cubic-bezier(0.230, 1, 0.320, 1); }
@keyframes chatp-up { from { transform: translateY(46px) scale(0.980); opacity: 0; } }
.chatp__in { position: relative; display: flex; flex-direction: column; height: 100%; isolation: isolate;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 0 calc(env(safe-area-inset-bottom, 0px) + 10px);
  background:
    radial-gradient(90% 35% at 0% 0%, rgb(46 230 255 / 0.140), transparent 70%),
    radial-gradient(80% 35% at 100% 100%, rgb(155 92 255 / 0.180), transparent 70%),
    linear-gradient(180deg, #0f1226, #0a0c1a); }
/* едва заметная сетка-«голограмма» на фоне */
.chatp__in::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.450;
  background-image: linear-gradient(rgb(120 160 255 / 0.050) 1px, transparent 1px), linear-gradient(90deg, rgb(120 160 255 / 0.050) 1px, transparent 1px);
  background-size: 26px 26px; mask-image: linear-gradient(180deg, #000, transparent 60%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 60%); }

/* шапка: значок, «Чат», зелёная точка онлайна, крестик */
.chatp__head { display: flex; align-items: center; gap: 12px; padding: 8px 14px 10px 16px; }
.chatp__logo { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 15px; color: #fff;
  background: linear-gradient(145deg, #2ee6ff, #6a4dff 70%); box-shadow: inset 0 1px 0 #ffffff70, 0 8px 20px -8px #4aa8ff; }
.chatp__logo svg { width: 24px; height: 24px; }
.chatp__hd { display: grid; gap: 4px; min-width: 0; }
.chatp__title { margin: 0; font: 900 22px/1 var(--font-title); letter-spacing: -0.010em; }
.chatp__on { display: inline-flex; align-items: center; gap: 6px; font: 800 12px/1 var(--font-title); color: #7ff0b4; }
.chatp__on i { width: 7px; height: 7px; border-radius: 50%; background: #3dff9a; box-shadow: 0 0 0 3px rgb(61 255 154 / 0.180), 0 0 10px #3dff9a; animation: chatp-dot 1.800s ease-in-out infinite; }
@keyframes chatp-dot { 50% { box-shadow: 0 0 0 6px rgb(61 255 154 / 0), 0 0 6px #3dff9a; } }
.chatp__on span { color: #8a96b8; font-weight: 700; }
.chatp__close { margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 13px; cursor: pointer;
  color: #b7c2e6; background: rgb(255 255 255 / 0.060); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.080); }
.chatp__close svg { width: 18px; height: 18px; }
.chatp__close:hover { color: #fff; background: rgb(255 255 255 / 0.110); }

/* под шапкой: вкладка «Общий» с подсветкой-полоской и отдельная кнопка «Поддержка» (Telegram) */
.chatp__tabs { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 14px 6px; padding-bottom: 10px;
  border-bottom: 1px solid rgb(255 255 255 / 0.070); }
.chatp__tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px; font: 900 16px/1 var(--font-title); color: #fff; }
.chatp__tab svg { width: 19px; height: 19px; color: #6fe3ff; }
/* светящаяся полоска под активной вкладкой */
.chatp__tab.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -11px; height: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #2ee6ff, #8a5cff); box-shadow: 0 0 12px #4aa8ff; }
.chatp__sup { display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border-radius: 15px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, rgb(42 171 238 / 0.220), rgb(42 171 238 / 0.080)); box-shadow: inset 0 0 0 1px rgb(42 171 238 / 0.450);
  transition: background 0.200s, transform 0.150s; }
.chatp__sup:hover { background: linear-gradient(135deg, rgb(42 171 238 / 0.350), rgb(42 171 238 / 0.140)); }
.chatp__sup:active { transform: scale(0.960); }
.chatp__tg { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px; color: #fff;
  background: linear-gradient(180deg, #37aee2, #1e96c8); box-shadow: inset 0 1px 0 #ffffff60, 0 4px 10px -4px #2aabee; }
.chatp__tg svg { width: 18px; height: 18px; margin-left: -1px; }
.chatp__supt { display: grid; gap: 2px; font: 800 13px/1.100 var(--font-title); }
.chatp__supt small { font: 600 10.500px/1.100 var(--font-text, inherit); color: #8fcff0; }
.chatp__arr { width: 16px; height: 16px; color: #8fcff0; }

/* лента сообщений */
.chatp__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 14px 16px; display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: thin; scrollbar-color: #283158 transparent; }
.chatp__empty { margin: auto; color: #7d88a6; font: 700 14px/1.400 var(--font-title); text-align: center; }

/* сообщение игрока: круглая аватарка с кольцом цвета уровня + «пузырь» */
.chm { position: relative; display: flex; align-items: flex-end; gap: 8px; max-width: 92%; animation: chm-in 0.320s cubic-bezier(0.230, 1, 0.320, 1); }
@keyframes chm-in { from { transform: translateY(10px) scale(0.980); opacity: 0; } }
.chm__ava { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  font: 900 15px/1 var(--font-title); color: #fff; background: linear-gradient(145deg, var(--a1), var(--a2));
  box-shadow: 0 0 0 2px #0d1022, 0 0 0 4px var(--rk), 0 0 14px -2px var(--rk); margin: 0 2px 4px 4px; }
.chm__pic { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.chm__bub { position: relative; display: grid; gap: 3px; min-width: 120px; padding: 9px 13px 8px; border-radius: 18px 18px 18px 6px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.075), rgb(255 255 255 / 0.040)); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.080);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.chm__top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chm__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 13px/1.200 var(--font-title); color: #8fd8ff; }
.chm__tag { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px 3px 5px; border-radius: 99px; font: 900 10px/1 var(--font-title);
  letter-spacing: 0.030em; text-transform: uppercase; color: #fff; background: linear-gradient(90deg, #ff6a2e, #ff2e7a); box-shadow: 0 3px 10px -4px #ff4a50; }
.chm__tag i { font-style: normal; font-size: 11px; }
.chm__tag--vip { color: #3a2400; background: linear-gradient(90deg, #ffe27a, #ffb52e); box-shadow: 0 3px 10px -4px #ffc83d; }
.chm__text { margin: 0; font: 600 15px/1.380 var(--font-text, inherit); color: #f2f4fa; overflow-wrap: anywhere; white-space: pre-wrap; }
.chm__bub time { justify-self: end; margin-top: -1px; font: 600 10.500px/1 var(--font-text, inherit); color: rgb(200 210 240 / 0.450); }

/* свои сообщения — справа, в фирменном градиенте */
.chm--mine { align-self: flex-end; flex-direction: row-reverse; }
.chm--mine .chm__ava { margin: 0 4px 4px 2px; }
.chm--mine .chm__bub { border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, #1fb7ff, #5a4dff 70%, #8a3dff); box-shadow: 0 8px 20px -10px #4a7dff; }
.chm--mine .chm__name { color: #e9f6ff; }
.chm--mine .chm__bub time { color: rgb(255 255 255 / 0.650); }

/* лайк — маленькая «таблетка» на краю пузыря */
.chm__like { position: absolute; left: 10px; bottom: -11px; display: none; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border: 0; border-radius: 99px; cursor: pointer;
  font: 800 11px/1 var(--font-title); color: #e6eaf6; background: #1b2140; box-shadow: 0 0 0 2px #0c0f1f, inset 0 0 0 1px rgb(255 255 255 / 0.080); }
.chm__like svg { width: 12px; height: 12px; color: #8a93b0; transition: color 0.200s; }
.chm__like.has, .chm:hover .chm__like, .chm:focus-within .chm__like { display: inline-flex; }
.chm__like.is-on svg { color: #ff4f7a; }
.chm__like.is-on { background: linear-gradient(90deg, #3a1630, #1b2140); }
.chm__like.is-pop svg { animation: chm-pop 0.420s cubic-bezier(0.230, 1.600, 0.320, 1); }
@keyframes chm-pop { 40% { transform: scale(1.600); } }
@media (hover: none) { .chm__like { display: inline-flex; } .chm__like:not(.has) span { display: none; } .chm__like:not(.has) { padding: 0 6px; opacity: 0.700; } .chm { margin-bottom: 8px; } }
.chm:has(.chm__like.has) { margin-bottom: 8px; }

/* «Крупный занос» — билет джекпота во всю ширину */
.chm--win { max-width: 100%; display: block; margin: 4px 0; }
.chj { position: relative; display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px; padding: 12px 14px 12px 10px; border-radius: 20px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60% 120% at 12% 50%, color-mix(in srgb, var(--rc) 45%, transparent), transparent 70%),
    linear-gradient(120deg, color-mix(in srgb, var(--rc) 22%, #11152a), #10142a 60%);
  box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--rc) 70%, transparent), 0 10px 30px -14px var(--rc); }
/* перфорация «билета» и искры */
.chj::before { content: ""; position: absolute; left: 104px; top: 10px; bottom: 10px; border-left: 2px dashed rgb(255 255 255 / 0.140); }
.chj::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0.600;
  background: radial-gradient(1.500px 1.500px at 20% 20%, #fff, transparent), radial-gradient(1.500px 1.500px at 85% 25%, #fff, transparent),
    radial-gradient(2px 2px at 60% 85%, color-mix(in srgb, var(--rc) 80%, #fff), transparent), radial-gradient(1.500px 1.500px at 35% 75%, #fff, transparent); }
.chj__art { display: grid; place-items: center; height: 70px; }
.chj__img { width: 100%; height: 100%; object-fit: contain; rotate: -8deg;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--rc) 70%, transparent)) drop-shadow(0 6px 6px #000b); }
.chj__info { display: grid; gap: 4px; min-width: 0; padding-right: 44px; }
.chj__label { display: inline-flex; align-items: center; gap: 5px; font: 900 11px/1 var(--font-title); letter-spacing: 0.080em; text-transform: uppercase; color: var(--rc); }
.chj__label i { font-style: normal; }
.chj__who { display: flex; align-items: center; gap: 6px; min-width: 0; font: 700 12.500px/1.200 var(--font-text, inherit); color: #aeb8d8; }
.chj__who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-weight: 800; }
.chj__ava { flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; overflow: hidden;
  font: 900 10px/1 var(--font-title); color: #fff; background: linear-gradient(145deg, var(--a1), var(--a2)); box-shadow: 0 0 0 1.500px var(--rk); }
.chj__item { font: 900 15px/1.250 var(--font-title); color: #fff; overflow-wrap: anywhere; }
.chj__meta { font: 600 12.500px/1.300 var(--font-text, inherit); color: #9aa6c6; }
.chj__meta em { font-style: normal; font-weight: 900; color: #ffd23d; }
.chj__x { position: absolute; top: 10px; right: 12px; padding: 5px 9px; border-radius: 11px; font: 900 16px/1 var(--font-title); color: #fff;
  background: linear-gradient(135deg, var(--rc), color-mix(in srgb, var(--rc) 50%, #000)); box-shadow: 0 6px 14px -6px var(--rc), inset 0 1px 0 #ffffff60; }
.chj time { position: absolute; right: 14px; bottom: 9px; font: 600 10.500px/1 var(--font-text, inherit); color: rgb(200 210 240 / 0.450); }
.chm--win .chm__like { left: 118px; bottom: -11px; }

.chatp__new { position: absolute; left: 50%; bottom: 96px; translate: -50% 0; z-index: 2; padding: 9px 16px; border: 0; border-radius: 99px; cursor: pointer;
  font: 800 13px/1 var(--font-title); color: #fff; background: linear-gradient(90deg, #1fb7ff, #6a4dff); box-shadow: 0 8px 20px -6px #4a7dff; }

/* поле ввода */
.chatp__form { display: flex; align-items: center; gap: 8px; margin: 4px 14px 0; padding: 5px 5px 5px 16px; border-radius: 20px;
  background: rgb(255 255 255 / 0.060); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.100); transition: box-shadow 0.200s; }
.chatp__form:focus-within { box-shadow: inset 0 0 0 1.500px rgb(46 230 255 / 0.600), 0 0 24px -10px #2ee6ff; }
.chatp__input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; background: none; color: #fff; font: 600 16px/1 var(--font-text, inherit); }
.chatp__input::placeholder { color: #6f7a99; }
.chatp__input:disabled { cursor: not-allowed; }
.chatp__send { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 15px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #2ee6ff, #6a4dff); box-shadow: inset 0 1px 0 #ffffff70, 0 6px 16px -6px #4aa8ff; transition: transform 0.150s, filter 0.200s; }
.chatp__send svg { width: 20px; height: 20px; }
.chatp__send:active { transform: scale(0.900) rotate(-8deg); }
.chatp__send:disabled, .chatp__form.is-guest .chatp__send { filter: saturate(0.300) brightness(0.700); }
.chatp__msg { margin: 6px 18px 0; font: 700 13px/1.300 var(--font-title); color: #ff8a9e; }
.chatp__msg:empty { display: none; }

/* компьютер: плавающая панель справа со скруглением */
@media (min-width: 761px) {
  .chatp { width: 410px; height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); margin: 12px 12px 12px auto; border-radius: 26px; }
  .chatp::backdrop { background: rgb(4 6 14 / 0.300); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .chatp[open] { animation: chatp-side 0.380s cubic-bezier(0.230, 1, 0.320, 1); }
  @keyframes chatp-side { from { transform: translateX(46px); opacity: 0; } }
  .chatp__in { border-radius: 26px; box-shadow: inset 0 0 0 1px rgb(140 180 255 / 0.140), 0 30px 70px -20px #000; padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .chatp[open], .chm, .chatp__on i, .chm__like.is-pop svg { animation: none; } }
