/* Game night picker. Separate from the catalog page so other pages can land
   without editing these rules. Selected chips match the New look: blue pill,
   white label, no checkmark. */

.gn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.gn-lead,
.gn-note,
.gn-meta,
.gn-why,
.gn-kicker {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}
.gn-lead,
.gn-note,
.gn-meta,
.gn-why { color: var(--muted); }
.gn-kicker {
  font-weight: 700;
  color: var(--accent);
}
.gn h3 {
  margin: 0 0 8px;
  font-size: 1.12rem;
}
.gn-card {
  background: var(--card);
  border: 1px solid var(--hig-sep, var(--border));
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.gn-facet {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.gn-facet-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
}
.gn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.gn-chip,
.gn-btn,
.gn-primary,
.gn-link,
.gn-row button,
.gn-choice {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.gn-chip {
  position: relative;
  z-index: 0;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-weight: 500;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 999px;
}
.gn-chip::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: 50%;
  height: 32px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--hig-fill, rgba(118, 118, 128, 0.12));
}
.gn-chip[aria-pressed="true"] {
  color: #fff;
}
.gn-chip[aria-pressed="true"]::before {
  content: "";
  background: var(--accent, #007aff);
}
.gn-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 8px;
  font-weight: 700;
  font-size: 16px;
}
.gn-field input,
.gn-share-url,
.gn-poll {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.35;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--hig-sep, var(--border));
  border-radius: 12px;
}
.gn-field input {
  min-height: 48px;
  padding: 12px 14px;
  font-weight: 400;
}
.gn-actions,
.gn-result-links,
.gn-modes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gn-actions { margin-top: 8px; }
.gn-btn,
.gn-primary,
.gn-choice,
.gn-row button,
.gn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  text-align: center;
}
.gn-btn,
.gn-choice,
.gn-row button {
  appearance: none;
  border: 1px solid var(--hig-sep, var(--border));
  background: var(--hig-fill, rgba(118, 118, 128, 0.12));
  color: inherit;
}
.gn-btn[aria-pressed="true"] {
  background: var(--accent, #007aff);
  border-color: transparent;
  color: #fff;
}
.gn-primary {
  appearance: none;
  border: 0;
  background: var(--accent, #007aff);
  color: #fff;
}
.gn-link {
  background: color-mix(in srgb, var(--accent) 16%, var(--card));
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--hig-sep, var(--border)));
  color: var(--fg);
  font-weight: 700;
}
.gn-btn:disabled,
.gn-primary:disabled,
.gn-choice:disabled {
  opacity: 0.4;
  cursor: default;
}
.gn-list,
.gn-results,
.gn-tally,
#gn-picks-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Full filter matches scroll inside the page. Rows must not shrink to fit a
   max-height, or the extra games get squeezed away with nothing to scroll.
   Momentum scrolling is the native touch scroll; scroll-behavior stays auto
   so a fling is not animated out from under a tap. */
#gn-results.gn-fit-scroll {
  box-sizing: border-box;
  flex: 0 1 auto;
  min-height: 0;
  max-height: 70vh;
  max-height: min(72dvh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding-bottom: 16px;
  scroll-padding-top: 4px;
  scroll-padding-bottom: 16px;
  scrollbar-width: thin;
  overflow-anchor: none;
}
#gn-results.gn-fit-scroll > li {
  flex: 0 0 auto;
}
.gn-card:has(#gn-results.gn-fit-scroll) {
  overflow: visible;
}
.gn-row,
.gn-tally li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.gn-row span,
.gn-choice {
  min-width: 0;
}
.gn-name {
  font-weight: 650;
  overflow-wrap: anywhere;
}
.gn-pick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}
.gn-pick .gn-name,
.gn-pick .gn-sub {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gn-packed {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.gn-sub,
.gn-outside {
  display: block;
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}
.gn-row button {
  flex: 0 0 auto;
  scroll-margin-top: calc(var(--header-h, 72px) + 12px);
  scroll-margin-bottom: 12px;
}
.gn-choice { width: 100%; }
.gn-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gn-stepper strong {
  min-width: 2ch;
  text-align: center;
  font-size: 1.25rem;
}
.gn-status:empty { display: none; }
.gn-status { min-height: 1.4em; }
.gn-share-url,
.gn-poll {
  margin: 8px 0 0;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 400;
}
.gn-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
}
.gn-winner {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}
.gn-cover-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--hig-fill, rgba(118, 118, 128, 0.12));
}
.gn-wheel-wrap {
  position: relative;
  width: min(100%, 320px);
  margin: 4px auto 8px;
}
.gn-wheel-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}
.gn-pointer {
  position: absolute;
  left: 50%;
  top: -2px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 18px solid var(--fg);
  z-index: 1;
}
.gn-match {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--hig-sep, var(--border));
  border-radius: 12px;
}
.gn-match .gn-facet-label { margin: 0; }
.gn-or {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}
.gn-cover {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: var(--bg);
  text-align: center;
  box-sizing: border-box;
}
.gn-cover h3 { font-size: 1.6rem; }
.gn-cover .gn-primary { width: min(100%, 320px); }
.gn-pick-sheet {
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  overflow: auto;
  gap: 10px;
}
.gn-pick-sheet h3,
.gn-pick-sheet > p { text-align: center; }
.gn-name-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.gn-name-row .gn-field { flex: 1; margin: 0; }
.gn-name-row .gn-btn { flex: 0 0 auto; }
.gn-ranked { margin: 0 0 8px; padding-left: 1.2rem; }
.gn-ranked li { margin: 4px 0; }
.gn-slot { margin-top: 10px; }
.gn [hidden] { display: none !important; }
.gn-chip:focus-visible,
.gn-btn:focus-visible,
.gn-primary:focus-visible,
.gn-link:focus-visible,
.gn-choice:focus-visible,
.gn-field input:focus-visible,
.gn-row button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
@media (max-width: 600px) {
  /* The phone column clips stray horizontal overflow. That must not turn the
     fit list into a box the page cannot scroll through. */
  main:has(#gn-results.gn-fit-scroll) {
    overflow: visible;
  }
  #gn-results.gn-fit-scroll {
    max-height: min(68dvh, 640px);
  }
}
@media (min-width: 720px) {
  .gn-modes,
  .gn-result-links { flex-direction: row; flex-wrap: wrap; }
  .gn-modes .gn-btn,
  .gn-result-links .gn-link { flex: 1 1 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .gn-wheel-wrap canvas { transition: none !important; }
}
