/* VALBLOX games panel (layout-v2 preview). Loads after styles.css; behaviour in assets/js/vb-games.js.
   The header's Games button: the gamepad icon, GAMES, and the chevron in its own small carved well (it turns over
   while the panel is open). The panel: a compact popover 8px under the header, inset 20px from the column's edges
   (never over the chat): a raised plate a step lighter than the page, a subtle rim and a soft shadow, holding one row
   of the eight game cards, the home carousel's own components (.game: the 3D banner in its forged rim, the band of
   light and the hover clip from site.js), with the name in caps under each. Where the eight fit they share the row
   (no scrolling); only where they cannot (.is-over: a narrow window, phones) does the row scroll, its edges fading
   where cards continue. The current game: gold name and a gold glow round its card. While one card is under the
   pointer the others darken, exactly as on the home row (styles.css). */

/* ---------------------------------------------------------------- the button */
.gpick { display: flex; flex: none; }   /* not positioned: the panel hangs from the header bar itself */
.gpick__btn { gap: 10px; padding: 0 7px 4px 16px; }
.gpick__btn .gpick__ic { width: 22px; height: 22px; color: var(--lilac); }
.gpick__t { margin-right: 4px; }
.gpick__chev {
  width: 30px; height: 30px; display: grid; place-items: center; flex: none; color: var(--muted);
  background: linear-gradient(180deg, #1A212C 0%, #1E2632 100%);
  box-shadow: inset 0 2px 0 rgba(var(--lo), .7), inset 0 -1px 0 rgba(var(--hi), .38), inset 0 0 0 1px rgba(16, 21, 29, .8);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.gpick__chev .ic { width: 18px; height: 18px; }
.gpick.is-open > .gpick__btn { --rim: rgba(var(--lilac-rgb), .55); color: var(--lilac-light); }
.gpick.is-open .gpick__chev { color: var(--lilac-light); }
.gpick.is-open .gpick__chev .ic { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) { .gpick__chev .ic { transition: transform .24s cubic-bezier(.3, .7, .3, 1); } }

/* ---------------------------------------------------------------- the panel */
.gpick__panel {
  position: absolute; z-index: 7; left: 20px; right: 20px; top: calc(100% + 8px); isolation: isolate; overflow: hidden;
  /* the shadow is a box-shadow tucked under the chamfer (negative spread), not a drop-shadow filter: a filter over the
     whole panel, with the cards' own filters nested in it, was redrawn by the GPU every frame while it was open */
  box-shadow: 0 20px 30px -8px rgba(4, 7, 12, .5);
  contain: layout paint;
}
.gpick__panel[hidden] { display: none; }
.gpick__panel > .plate {
  --c: 12px; --n: 4px; --rim: #34405A; --bt: rgba(var(--hi), .55); --bb: rgba(var(--lo), .45);
  --face: linear-gradient(180deg, #2A3346 0%, #252D3E 100%);
}
.gpick__track {
  --gap: 14px; --fade: 48px;
  display: flex; justify-content: center; gap: var(--gap); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 20px 20px 18px;
}
/* the edge fade only while cards continue past an edge (a mask is one more offscreen pass per frame) */
.gpick__track:is(.has-l, .has-r) {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl, 0px), #000 calc(100% - var(--fr, 0px)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl, 0px), #000 calc(100% - var(--fr, 0px)), transparent 100%);
}
.gpick__track::-webkit-scrollbar { display: none; }
.gpick__track.is-over { justify-content: flex-start; cursor: grab; }
.gpick__track.has-l { --fl: var(--fade); }
.gpick__track.has-r { --fr: var(--fade); }
.gpick__track.is-drag { cursor: grabbing; user-select: none; }
.gpick__track.is-drag .game, .gpick__track.is-drag .game * { pointer-events: none; }
@media (pointer: coarse) { .gpick__track.is-over { scroll-snap-type: x mandatory; scroll-padding-inline: 20px; cursor: auto; } .gpick__card { scroll-snap-align: start; } }

/* the cards share the row between a floor and a ceiling: under the floor the row scrolls instead of squeezing them.
   The name sizes with its card (a container query unit), so the longest (CASE OPENING) still fits on one line */
/* in the panel the cards are painted with it, not each on its own GPU layer with its own filter pass */
.gpick__card .game__card { will-change: auto; }
/* ...except while the panel shrinks shut (vb-games.js hide): its height eases, and with the cards painted into it every
   frame re-rastered all eight banners, rims and shadows (23-40ms frames on a fast PC); on their own layers only the
   plate redraws (fps pass, 27 Nov 2026) */
.gpick__panel.is-closing .gpick__card .game__card { will-change: transform; }
.gpick__card { flex: 1 1 0; min-width: var(--gcard-min, 90px); max-width: var(--gcard-max, 168px); gap: 12px; container-type: inline-size; }
.gpick__card .game__label { max-width: none; overflow: visible; font-size: clamp(11px, 11.2cqw, 17px); line-height: 1.35; letter-spacing: .07em; }
.gpick__card[aria-current="page"] .game__label { color: var(--gold); }
.gpick__card[aria-current="page"] .game__card {
  filter: drop-shadow(0 8px 10px rgba(4, 7, 12, .38)) drop-shadow(0 0 7px rgba(var(--gold-rgb), .5)) brightness(1);
}
/* the home row's hover: the others darken while one card is under the pointer (styles.css, .games__track) */
@media (hover: hover) {
  .gpick__track:has(.game:hover) .game:not(:hover) .game__card {
    filter: drop-shadow(0 8px 10px rgba(4, 7, 12, .38)) drop-shadow(0 0 7px rgba(var(--lilac-rgb), 0)) brightness(.55) saturate(.85);
  }
  .gpick__track:has(.game:hover) .game:not(:hover) .game__label { opacity: .55; }
}

/* phones: icon and chevron; the panel is a near-full-width sheet, two and a half cards in view (the third cut by the
   fade, so the row reads as more) */
@media (max-width: 600px) {
  .gpick__btn { gap: 4px; padding: 0 5px 4px 10px; }
  .gpick__t { display: none; }
  .gpick__chev { width: 24px; height: 24px; }
  .gpick__chev .ic { width: 16px; height: 16px; }
  .gpick__panel { left: 8px; right: 8px; }
  .gpick__track { --gap: 12px; --fade: 36px; padding: 16px 16px 14px; }
  .gpick__card { flex: none; width: var(--gcard-m, 124px); min-width: 0; max-width: none; gap: 10px; }
}
@media (max-width: 380px) {
  .gpick__btn { padding: 0 4px 4px 8px; gap: 2px; }
  .gpick__chev { width: 20px; background: none; box-shadow: none; }
  .gpick__track { --gcard-m: 116px; }
}
