/*
 * Character-select inline avatar row — shared across all 4 games.
 * Renders a horizontally scrollable row of 8 painted Persian avatars.
 * The avatar at the visual center of the row is the "active" pick:
 * scaled up, fully clear, and accent-bordered. Side avatars are at
 * default size but blurred and faded, so the user's eye stays on the
 * one in the middle. Native scroll-snap handles the swipe; the JS
 * watches scroll position to flip the .cs-active class as items pass
 * through the centre.
 *
 * Inherits site colors from CSS variables (--card, --border, --accent,
 * --accent-glow, --text-dim) so it blends with whichever game page
 * loads it.
 */

.cs-inline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cs-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 22px;
  /* Padding lets the first / last item be scrolled all the way to the
     row's center. 30px = half of the 60px item width. */
  padding-inline: calc(50% - 30px);
  padding-block: 18px 12px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  /* Make the scaled-up centre item visible above neighbouring items. */
  isolation: isolate;
}
.cs-row::-webkit-scrollbar { display: none; }

.cs-pick {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--border, rgba(255,255,255,.18));
  background: var(--card, #1f1f2e);
  padding: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  scroll-snap-align: center;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  /* Default state: blurred and faded (the side avatars). */
  opacity: .4;
  filter: blur(2px) saturate(.7);
  transform: scale(1);
  transition:
    transform .28s cubic-bezier(.4, 1.4, .5, 1),
    opacity   .25s ease,
    filter    .25s ease,
    border-color .25s ease,
    box-shadow   .25s ease;
}
.cs-pick img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

/* The avatar at the visual centre of the row. */
.cs-pick.cs-active {
  opacity: 1;
  filter: none;
  transform: scale(1.4);
  border-color: var(--accent, #a855f7);
  box-shadow:
    0 0 0 3px var(--accent-glow, rgba(168, 85, 247, 0.35)),
    0 6px 16px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

