/* VolleyTel teamkiezer v1.4.0: één paneel voor club, plaats, team of eigen naam.
   Stap 1 zoekt (zoekveld bovenaan, lijst eronder), stap 2 toont de teams van een club als nummerknoppen per categorie.
   Kleuren komen uit de app-tokens (--v-*) met terugvalwaarden; het donkere thema zet dezelfde tokens anders.
   Alle regels hangen onder #teamZoeker, zodat oudere #teamZoek*-regels uit volleytel.css hier niets overschrijven. */

#teamZoeker.tk {
  --tk-tekst: var(--v-text, #15162b);
  --tk-sub: var(--v-muted, #2c2d44);
  --tk-zacht: var(--v-subtle, #5c5d70);
  --tk-vlak: var(--v-surface, #ffffff);
  --tk-vlak-2: var(--v-surface-2, #f0f0ed);
  --tk-lijn: var(--v-line, #e3e3df);
  --tk-rand: var(--v-rand, #84848e);
  --tk-oranje: var(--v-orange, #ff7e00);
  --tk-oranje-tekst: var(--v-orange-tekst, #b84700);
  --tk-oranje-zacht: var(--v-orange-soft, #fff1e3);
  --tk-actie: var(--v-actie, #ff7e00);
  --tk-actie-tekst: var(--v-actie-tekst, #15162b);
  --tk-actie-rand: var(--v-actie-rand, #b84700);
  --tk-focus: var(--v-focus, #b84700);
  --tk-gloed: rgba(255, 126, 0, .22);
  --tk-ease: cubic-bezier(.22, 1, .36, 1);
  /* Telefoon: het hele scherm, en de hoogte volgt de zichtbare viewport (iOS-toetsenbord) via --vv-h/--vv-top. */
  position: fixed; inset: auto 0; top: var(--vv-top, 0px); left: 0; right: 0;
  width: 100%; max-width: none; height: var(--vv-h, 100dvh); max-height: none;
  margin: 0; padding: env(safe-area-inset-top) 0 0; border: 0; border-radius: 0;
  color: var(--v-text, #15162b); background: var(--v-surface, #ffffff); /* expliciet: de UA-stijl van dialog is canvastext */
  font: 500 15px/1.3 Manrope, system-ui, sans-serif;
  overflow: hidden; overscroll-behavior: contain;
}
#teamZoeker.tk[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); animation: tk-in 200ms var(--tk-ease); }
#teamZoeker.tk::backdrop { background: rgba(21, 22, 43, .55); }
#teamZoeker [hidden] { display: none !important; }
html:has(#teamZoeker[open]), html:has(#teamZoeker[open]) body { overflow: hidden; }

/* Kop. Zoekstap: contextregel boven [× | zoekveld]. Clubstap: [‹ | logo | context, clubnaam, plaats · aantal]. */
#teamZoeker .tk-kop {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: ". kant" "knop zoek";
  column-gap: 4px; align-items: center; padding: 6px 12px 8px 6px; min-width: 0;
}
#teamZoeker .tk-kant {
  grid-area: kant; display: flex; justify-content: space-between; gap: 12px; min-width: 0; margin: 0; padding: 0 2px 4px;
  font-size: 12px; font-weight: 800; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  color: var(--tk-oranje-tekst);
}
#teamZoeker .tk-kant span { overflow: hidden; text-overflow: ellipsis; }
#teamZoeker .tk-vorm { flex: none; color: var(--tk-sub); letter-spacing: .06em; }
#teamZoeker .tk-knop {
  grid-area: knop; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--tk-tekst); transition: background-color 120ms, transform 90ms;
}
#teamZoeker .tk-knop:active { background: var(--tk-vlak-2); transform: scale(.97); }
#teamZoeker .tk-knop svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
#teamZoeker .tk-titel { grid-area: titel; min-width: 0; }
#teamZoeker .tk-titel h2 {
  /* Lange clubnamen op twee regels in plaats van afgekapt. */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; margin: 0; overflow: hidden; overflow-wrap: anywhere;
  font: 700 24px/1.05 'Barlow Condensed', sans-serif; letter-spacing: .01em; text-transform: uppercase; color: var(--tk-tekst);
}
#teamZoeker .tk-sub { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; line-height: 16px; color: var(--tk-sub); }
#teamZoeker .tk-kop-logo { grid-area: logo; }
#teamZoeker[data-stap="zoek"] .tk-titel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#teamZoeker[data-stap="zoek"] .tk-ic-terug, #teamZoeker[data-stap="club"] .tk-ic-sluit { display: none; }
#teamZoeker[data-stap="club"] .tk-kop {
  grid-template-columns: 44px auto minmax(0, 1fr); grid-template-areas: "knop logo kant" "knop logo titel";
  column-gap: 10px; padding-bottom: 10px;
}
#teamZoeker[data-stap="club"] .tk-kant { padding: 0 0 2px; }
#teamZoeker[data-stap="club"] .tk-zoek { display: none; }

/* Zoekveld: het enige omlijnde element. 16 px tekst, zodat iOS niet inzoomt. */
#teamZoeker .tk-zoek {
  grid-area: zoek; position: relative; display: flex; align-items: center; min-width: 0; height: 48px; margin: 0;
  border: 1.5px solid var(--tk-rand); border-radius: 8px; background: var(--tk-vlak); transition: border-color 120ms, box-shadow 120ms;
}
#teamZoeker .tk-zoek:focus-within { border-color: var(--tk-focus); box-shadow: 0 0 0 3px var(--tk-gloed); }
#teamZoeker .tk-loep { width: 20px; height: 20px; margin: 0 8px 0 11px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; }
#teamZoeker .tk-zoek input {
  flex: 1; width: auto; min-width: 0; height: 100%; min-height: 0; margin: 0; padding: 0 4px 0 0; border: 0; border-radius: 0;
  background: transparent; color: var(--tk-tekst); font: 700 16px/1.2 Manrope, system-ui, sans-serif; outline: 0; box-shadow: none;
  -webkit-appearance: none; appearance: none;
}
#teamZoeker .tk-zoek input::placeholder { color: var(--tk-zacht); font-weight: 500; opacity: 1; }
#teamZoeker .tk-zoek input::-webkit-search-cancel-button, #teamZoeker .tk-zoek input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
#teamZoeker .tk-wis { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--tk-tekst); }
#teamZoeker .tk-wis svg { width: 24px; height: 24px; padding: 3px; border-radius: 50%; background: var(--tk-tekst); fill: none; stroke: var(--tk-vlak); stroke-width: 2.6; stroke-linecap: round; transition: transform 90ms; }
#teamZoeker .tk-wis:active svg { transform: scale(.9); }
#teamZoeker .tk-laad {
  position: absolute; left: 6px; right: 6px; bottom: -1.5px; height: 3px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(90deg, transparent, var(--tk-oranje), transparent) no-repeat; background-size: 40% 100%;
  animation: tk-laad 900ms linear infinite;
}

/* Springchips (meer dan 7 categorieën): 44 px tikdoel, een gevuld vlak van 32 px. */
#teamZoeker .tk-sprong { display: flex; gap: 2px; overflow-x: auto; padding: 0 10px 4px; scrollbar-width: none; overscroll-behavior-x: contain; }
#teamZoeker .tk-sprong::-webkit-scrollbar { display: none; }
#teamZoeker .tk-chip { flex: none; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 2px; border: 0; background: transparent; color: var(--tk-tekst); }
#teamZoeker .tk-chip span {
  display: block; min-width: 40px; height: 32px; padding: 0 10px; border-radius: 8px; background: var(--tk-vlak-2);
  font: 700 17px/32px 'Barlow Condensed', sans-serif; letter-spacing: .03em; text-align: center; transition: background-color 140ms, color 140ms, transform 90ms;
}
#teamZoeker .tk-chip:active span { transform: scale(.97); }
#teamZoeker .tk-chip[aria-current="true"] span { background: var(--tk-tekst); color: var(--tk-vlak); }

/* Lijst: alleen deze scrolt. */
#teamZoeker .tk-lijst {
  min-height: 0; margin: 0; padding: 0 0 calc(16px + env(safe-area-inset-bottom)); list-style: none;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  border-top: 1px solid transparent; transition: border-color 120ms;
}
#teamZoeker.is-gescrold .tk-lijst { border-top-color: var(--tk-lijn); }
#teamZoeker .tk-lijst button:focus-visible { outline: 3px solid var(--tk-focus); outline-offset: -3px; }
#teamZoeker .tk-groep {
  display: flex; align-items: baseline; gap: 8px; padding: 14px 16px 4px;
  font-size: 12px; font-weight: 800; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--tk-oranje-tekst);
}
#teamZoeker .tk-groep::before { content: ''; flex: none; align-self: center; width: 4px; height: 12px; background: var(--tk-oranje); transform: skewX(-16deg); }
#teamZoeker .tk-groep small { margin-left: auto; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--tk-sub); }

#teamZoeker .tk-rij {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 0; padding: 6px 12px 6px 16px;
  border: 0; border-radius: 0; background: transparent; color: var(--tk-tekst); text-align: left; font: inherit; transition: background-color 120ms;
}
#teamZoeker .tk-rij::after { content: ''; position: absolute; left: 64px; right: 0; bottom: 0; border-bottom: 1px solid var(--tk-lijn); }
#teamZoeker .tk-rij:active { background: var(--tk-oranje-zacht); }
#teamZoeker .tk-rij:active .tk-logo { transform: scale(.97); }
#teamZoeker .tk-rij:disabled { opacity: .45; }
#teamZoeker .tk-rij-tekst { display: grid; gap: 1px; flex: 1; min-width: 0; }
#teamZoeker .tk-rij strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 700; line-height: 20px; }
#teamZoeker .tk-rij small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; line-height: 16px; color: var(--tk-sub); }
#teamZoeker .tk-rij mark { background: transparent; color: var(--tk-oranje-tekst); font-weight: 800; }
#teamZoeker .tk-pijl { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { #teamZoeker .tk-rij:hover:not(:disabled) { background: var(--tk-vlak-2); } #teamZoeker .tk-nr:hover:not(:disabled):not(.is-gekozen) { background: var(--tk-oranje-zacht); } }

/* Logotegel: wit vlak (logo's zijn op wit gemaakt), initialen eronder tot het logo geladen is of als het ontbreekt. */
#teamZoeker .tk-logo {
  position: relative; display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 8px; overflow: hidden;
  background: #ffffff; box-shadow: inset 0 0 0 1px var(--tk-lijn); color: #15162b; font: 800 12px/1 Manrope, system-ui, sans-serif; letter-spacing: -.01em;
  transition: transform 90ms;
}
#teamZoeker .tk-logo img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); padding: 0; border-radius: 0; object-fit: contain; background: #ffffff; opacity: 0; transition: opacity 160ms; }
#teamZoeker .tk-logo img.is-geladen { opacity: 1; }
#teamZoeker .tk-kop-logo { width: 44px; height: 44px; font-size: 14px; }
#teamZoeker .tk-eigen .tk-logo { background: var(--tk-oranje-zacht); box-shadow: none; color: var(--tk-oranje-tekst); }
#teamZoeker .tk-eigen .tk-logo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

#teamZoeker .tk-tip { padding: 16px 16px 4px; font-size: 14px; line-height: 1.45; color: var(--tk-sub); }
#teamZoeker .tk-tip b { font-weight: 800; color: var(--tk-tekst); }
#teamZoeker .tk-bron { padding: 14px 16px 4px; font-size: 12px; line-height: 1.4; color: var(--tk-sub); }
#teamZoeker .tk-melding {
  display: grid; gap: 2px; margin: 10px 16px 6px; padding: 12px 14px; border-radius: 8px; background: var(--tk-vlak-2);
  font-size: 14px; line-height: 1.45; color: var(--tk-tekst);
}
#teamZoeker .tk-melding b { font-weight: 800; }
#teamZoeker .tk-melding.is-fout { box-shadow: inset 4px 0 0 var(--tk-oranje); }
#teamZoeker .tk-opnieuw {
  justify-self: start; display: block; width: auto; min-height: 44px; margin: 2px 0 -10px -2px; padding: 0 2px; border: 0; background: transparent;
  color: var(--tk-oranje-tekst); font: 800 15px/1 Manrope, system-ui, sans-serif;
}
#teamZoeker .tk-opnieuw:active { transform: scale(.97); }

/* Clubstap: per categorie één regel met nummerknoppen (gevuld, geen rand). */
#teamZoeker .tk-cat { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 0 10px; align-items: start; padding: 6px 12px 6px 16px; scroll-margin-top: 2px; }
#teamZoeker .tk-cat:first-child { padding-top: 8px; }
#teamZoeker .tk-cat-naam { padding-top: 6px; font-size: 14px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
#teamZoeker .tk-cat-naam small { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--tk-sub); }
#teamZoeker .tk-nummers { display: flex; flex-wrap: wrap; gap: 6px; }
#teamZoeker .tk-nr {
  position: relative; display: grid; place-items: center; width: auto; min-width: 44px; height: 44px; min-height: 44px; margin: 0; padding: 0 8px;
  border: 0; border-radius: 8px; background: var(--tk-vlak-2); color: var(--tk-tekst);
  font: 700 22px/1 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums; text-align: center;
  transition: transform 90ms, background-color 120ms;
}
#teamZoeker .tk-nr:active:not(:disabled) { transform: scale(.97); background: var(--tk-oranje-zacht); }
#teamZoeker .tk-nr.is-gekozen { background: var(--tk-actie); color: var(--tk-actie-tekst); box-shadow: inset 0 -3px 0 var(--tk-actie-rand); }
#teamZoeker .tk-nr.is-sponsor::after { content: ''; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--tk-oranje); }
#teamZoeker .tk-nr:disabled { opacity: .35; text-decoration: line-through; text-decoration-thickness: 2px; }
#teamZoeker .tk-legenda { display: flex; align-items: center; gap: 8px; padding: 8px 16px 0; font-size: 12px; line-height: 1.4; color: var(--tk-sub); }
#teamZoeker .tk-legenda::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--tk-oranje); }
#teamZoeker .tk-skelet {
  height: 44px; margin: 10px 16px; border-radius: 8px;
  background: linear-gradient(90deg, var(--tk-vlak-2) 0 35%, var(--tk-lijn) 50%, var(--tk-vlak-2) 65% 100%); background-size: 260% 100%;
  animation: tk-skelet 1.1s linear infinite;
}
#teamZoeker .tk-skelet:first-child { margin-top: 12px; }

/* Beach: de bron heeft geen beachteams; club kiezen voor het logo en zelf een naam geven. */
#teamZoeker .tk-duo { display: grid; gap: 8px; margin: 6px 16px 0; }
#teamZoeker .tk-label { font-size: 12px; font-weight: 800; line-height: 16px; letter-spacing: .08em; text-transform: uppercase; color: var(--tk-oranje-tekst); }
#teamZoeker .tk-duo input {
  width: 100%; min-width: 0; height: 48px; min-height: 0; margin: 0; padding: 0 12px; border: 1.5px solid var(--tk-rand); border-radius: 8px;
  background: var(--tk-vlak); color: var(--tk-tekst); font: 700 16px/1.2 Manrope, system-ui, sans-serif; box-shadow: none;
}
#teamZoeker .tk-duo input:focus { outline: 0; border-color: var(--tk-focus); box-shadow: 0 0 0 3px var(--tk-gloed); }
#teamZoeker .tk-actie {
  display: block; width: 100%; min-height: 52px; margin: 0; padding: 0 16px; border: 0; border-radius: 8px; background: var(--tk-actie); color: var(--tk-actie-tekst); text-align: center;
  box-shadow: inset 0 -3px 0 var(--tk-actie-rand); font: 800 15px/1.2 Manrope, system-ui, sans-serif; transition: transform 90ms;
}
#teamZoeker .tk-actie:active { transform: scale(.97); }

/* Beweging: openen fade + 12 px, clubstap 180 ms van rechts (terug van links). */
#teamZoeker .tk-van-rechts { animation: tk-van-rechts 180ms var(--tk-ease); }
#teamZoeker .tk-van-links { animation: tk-van-links 180ms var(--tk-ease); }
@keyframes tk-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes tk-van-rechts { from { opacity: 0; transform: translateX(28px); } }
@keyframes tk-van-links { from { opacity: 0; transform: translateX(-28px); } }
@keyframes tk-laad { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@keyframes tk-skelet { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Tablet en desktop: een gecentreerd paneel in plaats van het hele scherm. */
@media (min-width: 600px) and (min-height: 560px) {
  #teamZoeker.tk { inset: 0; margin: auto; width: min(480px, calc(100% - 32px)); height: min(720px, calc(100dvh - 48px)); padding-top: 4px; border-radius: 12px; box-shadow: 0 24px 64px rgba(21, 22, 43, .28); }
}
@media (prefers-reduced-motion: reduce) {
  #teamZoeker, #teamZoeker *, #teamZoeker::backdrop { animation: none !important; transition: none !important; }
}

/* Ster is een eigen tikdoel naast kiezen, nooit een knop in een knop. */
#teamZoeker .tk-met-favoriet{display:flex;align-items:center;gap:4px}
#teamZoeker .tk-met-favoriet .tk-rij{flex:1;min-width:0}
#teamZoeker .tk-favoriet{display:grid;place-items:center;flex:0 0 44px;width:44px;min-height:44px;padding:8px;border:0;border-radius:8px;background:transparent;color:var(--tk-sub);cursor:pointer}
#teamZoeker .tk-favoriet svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
#teamZoeker .tk-favoriet[aria-pressed=true]{color:var(--tk-oranje-tekst)}
#teamZoeker .tk-favoriet[aria-pressed=true] svg{fill:var(--tk-oranje);stroke:var(--tk-oranje-tekst)}
#teamZoeker .tk-team-paar{display:inline-flex;align-items:center;border-radius:8px;background:var(--tk-vlak-2)}
