/* R6 名冊（點一下開視窗）: R2's small cards, all 16 in ONE list in the json order - no section titles, no left column; the cards use the
   whole content width (3 columns from 1024px, 2 from 768px, 1 below). The WHOLE small card is the button (a <summary>): a click, a tap,
   Enter or Space opens the kit's shared coach dialog (coaches-rkit.js; Esc, the x button and a click outside close it, focus goes back to the
   card, the page behind keeps still), dressed here as R4's coupon ticket: a photo gallery (one big photo, thumbnails below), name and
   boards, three icon rows, the whole introduction, and a torn-off stub with No.xx (right on a desktop, below on a phone). coaches-r6.js fills
   the ticket when it opens (the gallery photos are only fetched then). Without JS a card is a plain <details>: the whole introduction opens in place.
   Focus: no frame of any colour on click, touch or keyboard; the keyboard only turns the ground pale cyan (owner 11/06).
   Built on coaches-rkit.css; scoped to .cv-r6, classes cr6-. */

/* ---------------------------------------------------------------- the card list (cards in one row are equally tall) */
.cv-r6 .cr6-list { display: grid; gap: 14px; }
.cv-r6 .cr6-li { display: flex; min-width: 0; }
.cv-r6 .cr6-card { display: flex; flex: 1 1 auto; flex-direction: column; padding: 0; transition: transform .3s var(--cr-ease), box-shadow .3s ease, border-color .3s ease; }
.cv-r6 .cr6-more { display: flex; flex: 1 1 auto; flex-direction: column; }
/* the summary IS the small card: the face (photo, name, boards, chips) and the card's padding, so a click anywhere on the card opens the
   dialog and a keyboard focus tints the whole card */
.cv-r6 .cr6-sum { display: block; flex: 1 1 auto; padding: 16px; border-radius: 18px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* a mouse pointer lifts the card a little (the li stays still, so a pointer at the card's bottom edge never makes it flicker) */
@media (hover: hover) {
  .cv-r6 .cr6-li:hover > .cr6-card { transform: translateY(-3px); border-color: var(--cr-line-2); box-shadow: 0 22px 34px -22px rgba(23, 55, 90, .62); }
}
.cv-r6 .cr6-face { display: block; }
.cv-r6 .cr6-top { display: flex; align-items: center; gap: 14px; }
/* round photo: the img is larger than the circle and moved so the head sits in the middle (never leaves a gap) */
.cv-r6 .cr6-ph {
  position: relative; display: block; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: var(--cr-ice); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--cr-line-2);
}
.cv-r6 .cr6-ph img {
  position: absolute; display: block; max-width: none; height: auto; width: calc(var(--z) * 100%);
  left: clamp(calc((1 - var(--z)) * 100%), calc(50% - var(--fx) * var(--z) * 100%), 0%);
  top: clamp(calc((1 - var(--z) * var(--ar)) * 100%), calc(50% - var(--fy) * var(--z) * var(--ar) * 100%), 0%);
}
.cv-r6 .cr6-id { display: block; min-width: 0; }
.cv-r6 .cr6-name { font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.cv-r6 .cr6-disc { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 2px; font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--cr-text); }
.cv-r6 .cr6-disc > span { display: inline-flex; align-items: center; gap: 4px; }
.cv-r6 .cr6-disc svg { width: 24px; height: 24px; fill: none; stroke: var(--cr-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cv-r6 .cr6-rows { display: grid; gap: 8px; margin-top: 14px; }
.cv-r6 .cr6-row { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.cv-r6 .cr6-row > .cr-ic { margin-top: -2px; }
.cv-r6 .cr6-row .cr-tags { flex: 1 1 auto; min-width: 0; }
.cv-r6 .cr-tag svg { width: 18px; height: 18px; fill: none; stroke: var(--cr-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* without JS (or when the dialog cannot open) the card is a <details>: the whole introduction opens under the face */
.cv-r6 .cr6-fallback { margin: 0 16px; padding-bottom: 18px; }

/* ---------------------------------------------------------------- focus: never a frame (owner 11/06). A click or a tap shows nothing; the
   keyboard (:focus-visible) tints the ground pale cyan instead. The site's own *:focus-visible rule is !important, so these are too. */
.cv-r6 .cr6-sum:focus, .cv-r6 .cr6-sum:focus-visible,
.cv-r6 .cr6-th:focus, .cv-r6 .cr6-th:focus-visible,
.cv-r6 .cr6-stage:focus, .cv-r6 .cr6-stage:focus-visible,
.cv-r6 .cr-dialog__close:focus, .cv-r6 .cr-dialog__close:focus-visible { outline: none !important; }
.cv-r6 .cr6-sum:focus-visible { box-shadow: inset 0 0 0 999px rgba(78, 220, 233, .16); }
.cv-r6 .cr6-th:focus-visible { box-shadow: inset 0 0 0 1.5px var(--cr-line-2), inset 0 0 0 999px rgba(78, 220, 233, .3); }
.cv-r6 .cr6-th[aria-pressed="true"]:focus-visible { box-shadow: inset 0 0 0 2.5px var(--cr-cyan), inset 0 0 0 999px rgba(78, 220, 233, .3); }
.cv-r6 .cr6-stage:focus-visible { box-shadow: 0 0 0 5px rgba(78, 220, 233, .32); }
.cv-r6 .cr-dialog__close:focus-visible { background: var(--cr-cyan-soft); box-shadow: inset 0 0 0 1.5px var(--cr-line-2), inset 0 0 0 999px rgba(78, 220, 233, .3), 0 6px 14px -8px rgba(23, 55, 90, .5); }
.cv-r6 .cr6-th, .cv-r6 .cr6-stage, .cv-r6 .cr-dialog__close { -webkit-tap-highlight-color: transparent; }

/* ---------------------------------------------------------------- the dialog: the kit's shared <dialog>, dressed as the ticket.
   The kit's x button floats top right (sticky); the ticket scrolls inside the dialog when it is taller than the window. */
.cv-r6 .cr6-dlg { width: min(920px, calc(100% - 48px)); max-height: 85vh; border-radius: 22px; scrollbar-width: thin; scrollbar-color: var(--cr-line-2) transparent; }
.cv-r6 .cr6-dlg[open] { animation: cv-r6-in .28s var(--cr-ease); }
.cv-r6 .cr6-dlg[open]::backdrop { animation: cv-r6-fade .28s ease-out; }
@keyframes cv-r6-in { from { opacity: 0; scale: .96; } }
@keyframes cv-r6-fade { from { opacity: 0; } }
/* overflow hidden: the stub's two notches stick out of the ticket by 12px; clipped, they add no scrolling (no scroll bar on a ticket that fits) */
.cv-r6 .cr6-dlg__in { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.cv-r6 .cr6-main { display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr); min-width: 0; padding: 14px 14px 16px; }
.cv-r6 .cr6-photo { min-width: 0; }
.cv-r6 .cr6-thead { display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; margin-top: 14px; }
.cv-r6 .cr6-tname { min-width: 0; font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.cv-r6 .cr6-points { margin-top: 12px; }
.cv-r6 .cr6-sep { color: var(--cr-line-2); }
.cv-r6 .cr-kv__k { min-width: 0; }
.cv-r6 .cr6-bio-box { padding-top: 16px; border-top: 1.5px solid var(--cr-line); }
.cv-r6 .cr6-main > .cr6-bio-box { margin-top: 18px; }
.cv-r6 .cr6-bio-title { font-size: 18px; line-height: 1.5; }
.cv-r6 .cr6-bio { max-width: 40em; margin-top: 8px; }
.cv-r6 .cr6-bio p + p { margin-top: .75em; }
.cv-r6 .cr6-stub { display: flex; align-items: center; justify-content: center; padding: 14px 16px 16px; }
.cv-r6 .cr6-no { font-size: 28px; line-height: 1; white-space: nowrap; }

/* photo gallery: the stage is a strip of 4:5 photos that snaps one by one (swipe on a phone, arrow keys when focused); the thumbnails
   (made by the script when there are 2 or more photos) fade to the chosen photo; the chosen thumbnail has a cyan frame on a pale cyan ground */
.cv-r6 .cr6-stage {
  display: flex; width: 100%; aspect-ratio: 4 / 5; overflow-x: auto; overflow-y: hidden; border-radius: 14px; background: var(--cr-ice);
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.cv-r6 .cr6-stage::-webkit-scrollbar { display: none; }
.cv-r6 .cr6-stage > img {
  display: block; flex: 0 0 100%; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% var(--oy, 35%);
  scroll-snap-align: start; scroll-snap-stop: always;
}
.cv-r6 .cr6-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cv-r6 .cr6-th {
  display: block; width: 56px; height: 56px; margin: 0; padding: 3px; border: 0; border-radius: 14px; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--cr-line-2); cursor: pointer; transition: background-color .3s, box-shadow .3s;
}
.cv-r6 .cr6-th:hover { background: var(--cr-ice); }
.cv-r6 .cr6-th img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% var(--oy, 35%); border-radius: 11px; }
.cv-r6 .cr6-th[aria-pressed="true"] { background: var(--cr-cyan-soft); box-shadow: inset 0 0 0 2.5px var(--cr-cyan); }

/* ---------------------------------------------------------------- sizes */
@media (max-width: 359px) {
  .cv-r6 .cr6-sum { padding: 14px; }
  .cv-r6 .cr6-fallback { margin-inline: 14px; }
  .cv-r6 .cr6-top { gap: 12px; }
  .cv-r6 .cr6-name { font-size: 21px; }
}
/* phones: the dialog is the window minus 12px each side, at most 90% of its height; the photo is on top and the stub (No.xx) at the bottom */
@media (max-width: 767px) {
  .cv-r6 .cr6-dlg { width: calc(100% - 24px); max-height: 90vh; max-height: 90dvh; border-radius: 20px; }
}
/* 600+: the photo sits beside the name and the icon rows, the introduction runs full width underneath, the stub stays at the bottom
   (the x button floats over the name row's right end, so it keeps 44px clear) */
@media (min-width: 600px) {
  .cv-r6 .cr6-main { grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: 22px; padding: 18px 18px 20px; }
  .cv-r6 .cr6-photo { grid-column: 1; grid-row: 1 / 3; }
  .cv-r6 .cr6-thead { grid-column: 2; grid-row: 1; margin-top: 2px; padding-right: 44px; }
  .cv-r6 .cr6-points { grid-column: 2; grid-row: 2; align-self: start; margin-top: 14px; }
  .cv-r6 .cr6-main > .cr6-bio-box { grid-column: 1 / -1; grid-row: 3; margin-top: 22px; }
  .cv-r6 .cr6-stub { padding: 12px 18px 16px; }
}
@media (min-width: 768px) {
  .cv-r6 .cr6-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .cv-r6 .cr6-sum { padding: 18px; }
  .cv-r6 .cr6-fallback { margin-inline: 18px; }
  .cv-r6 .cr6-name { font-size: 24px; }
  /* a landscape ticket: the torn-off stub stands on the right behind a vertical tear line, under the x button; No.xx sits just below it */
  .cv-r6 .cr6-dlg__in { flex-direction: row; }
  .cv-r6 .cr6-main { grid-template-columns: 224px minmax(0, 1fr); column-gap: 26px; padding: 20px 22px 22px 20px; }
  .cv-r6 .cr6-thead { padding-right: 0; }
  .cv-r6 .cr6-tname { font-size: 26px; }
  .cv-r6 .cr6-stub { flex: 0 0 156px; flex-direction: column; justify-content: flex-start; gap: 16px; padding: 84px 10px 28px; text-align: center; border-top: 0; border-left: 2px dashed var(--cr-perf); }
  .cv-r6 .cr6-stub::before { top: -12px; left: -13px; right: auto; }
  .cv-r6 .cr6-stub::after { top: auto; bottom: -12px; left: -13px; right: auto; }
  .cv-r6 .cr6-no { font-size: 34px; }
}
@media (min-width: 1024px) {
  .cv-r6 .cr6-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cv-r6 .cr6-main { grid-template-columns: 280px minmax(0, 1fr); column-gap: 32px; padding: 24px 28px 26px 24px; }
  .cv-r6 .cr6-stub { flex-basis: 176px; }
  .cv-r6 .cr6-tname { font-size: 28px; }
  .cv-r6 .cr6-bio { max-width: 48em; }
}
/* reduced motion: the kit already stops every transition and animation under .cr; the backdrop is outside that rule, and the lift is a move */
@media (prefers-reduced-motion: reduce) {
  .cv-r6 .cr6-dlg[open]::backdrop { animation: none; }
  .cv-r6 .cr6-li:hover > .cr6-card { transform: none; }
}
