/* 3D-рендеры игроков в очереди (js/q3d.js). Подключается и в админке, и на публичной /queue — ПОСЛЕДНИМ. */
html body .q3d {
  --q3d-tint: var(--g2, #f5c518);
  position: relative; flex: none; display: grid; place-items: end center; overflow: hidden; isolation: isolate;
  border-radius: 12px; background:
    radial-gradient(80% 60% at 50% 105%, color-mix(in srgb, var(--q3d-tint) 30%, transparent), transparent 75%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  transition: box-shadow .18s ease, transform .18s ease;
}
html body .q3d-sm { width: 44px; height: 54px; border-radius: 12px; }
html body .q3d-md { width: 60px; height: 75px; }
html body .q3d-lg { width: 90px; height: 115px; border-radius: 16px; }

/* плоская голова — запасной вариант, пока 3D-кадр не готов (или его не из чего строить) */
html body .q3d:not(.has-3d) { place-items: center; }
html body .q3d:not(.has-3d) .avatar-head {
  width: 66%; height: auto; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 0; outline: 0;
  box-shadow: 0 4px 10px -4px rgba(0,0,0,.7);
}

html body .q3d-img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); user-select: none; pointer-events: none;
}
/* плавное появление — только когда кадр отрисован впервые; при перерисовке списка (кадр из кэша) анимации нет, ничего не мигает */
html body .q3d-img.fresh { animation: q3d-in .28s ease-out both; }
@keyframes q3d-in { from { opacity: 0; } to { opacity: 1; } }

/* лёгкий «подъём» рендера при наведении на строку/карточку */
.q-row:hover .q3d, .tk:hover .q3d, .qd-row:hover .q3d, .qb-row:hover .q3d { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--q3d-tint) 55%, transparent); }
.q-row:hover .q3d-img, .tk:hover .q3d-img { transform: translateY(-1px) scale(1.04); transition: transform .2s ease; }

/* тон по режиму: класс tone-* ставится на контейнер очереди */
.tone-gold   { --g2: #e8b400; }
.tone-cyan   { --g2: #14b6c9; }
.tone-ember  { --g2: #ff5a2a; }
.tone-violet { --g2: #8b5cf6; }

@media (prefers-reduced-motion: reduce) {
  html body .q3d-img.fresh { animation: none; }
  .q-row:hover .q3d-img, .tk:hover .q3d-img { transform: none; }
}

/* Строки очереди (публичная /queue): плитка с рендером не «зажата» — больше воздуха вокруг, ровные отступы, мягкая подсветка при наведении.
   Админка (.qa-detail) имеет свои правила и сюда не попадает. */
html body .q-rows .q-row { gap: 14px; padding: 9px 12px; min-height: 66px; border-radius: 14px; align-items: center; transition: background .15s; }
html body .q-rows .q-row .nick { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Пока кадр не готов — тихий скелет (без картинки и без рамки из магазина), чтобы не мелькала сломанная иконка. */
html body .q3d.is-loading { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); }
html body .q3d.is-loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.07) 50%, transparent 70%);
  background-size: 220% 100%; animation: q3d-shimmer 1.4s ease-in-out infinite;
}
@keyframes q3d-shimmer { from { background-position: 160% 0; } to { background-position: -60% 0; } }
/* В плитке очереди рамки из магазина не рисуем (они «съедали» кадр): запасная голова — просто голова. */
html body .q3d .avatar-head[data-frame]::before, html body .q3d .avatar-head[data-frame]::after { display: none !important; }
html body .q3d .avatar-head[data-frame] { box-shadow: none !important; outline: 0 !important; }
@media (prefers-reduced-motion: reduce) { html body .q3d.is-loading::after { animation: none; } }

/* Без рамки: плитка — просто прозрачная область, в ней только рендер (голова и плечи). Ни фона, ни обводки, ни подсветки при наведении. */
html body .q3d,
html body .q-row:hover .q3d, html body .tk:hover .q3d, html body .qd-row:hover .q3d, html body .qb-row:hover .q3d {
  background: none !important; box-shadow: none !important; border: 0 !important; outline: 0 !important;
}
html body .q3d.is-loading { background: none !important; }
html body .q3d.is-loading::after { border-radius: 12px; opacity: .6; }
/* низ кадра мягко растворяется, чтобы без рамки не было жёсткого среза по плечам */
html body .q3d-img {
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
