/* Pro Run, stijl voor schermen en knoppen.
   Volgt het Pro Carwash Epe design system (kleur, Montserrat, pilknoppen, zachte schaduwen).
   Het speelveld zelf wordt getekend in game.js. */

:root {
  /* Merk */
  --rood: #d5163e;
  --rood-licht: #e84662;
  --roze: #e0607a;
  --antraciet: #373b48;
  --antraciet-diep: #2a2d38;
  /* Neutralen */
  --wit: #ffffff;
  --lichtgrijs: #f5f6f8;
  --lijngrijs: #e4e6ea;
  --grijs-300: #b9bdc7;
  --grijs-400: #9aa0ac;
  /* Signaal in het spel (waarschuwingsborden) */
  --geel: #f6b81f;
  /* Programmakleuren */
  --pro-plus: #1ba3d8;
  --vip: #c9a96a;

  --font: "Montserrat", "Proxima Nova", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --schaduw-klein: 0 4px 16px rgba(55, 59, 72, 0.1);
  --schaduw-groot: 0 16px 40px -16px rgba(42, 45, 56, 0.35);
  --schaduw-rood: 0 10px 22px -8px rgba(213, 22, 62, 0.55);
  --veilig-l: env(safe-area-inset-left, 0px);
  --veilig-r: env(safe-area-inset-right, 0px);
  --veilig-t: env(safe-area-inset-top, 0px);
  --veilig-b: env(safe-area-inset-bottom, 0px);
  /* 1% van de ECHT zichtbare hoogte. game.js meet die en overschrijft dit; tot dan de kleine
     viewport (svh: met Safari-balken in beeld). Gewone vh is in iPhone Safari te groot. */
  --vh1: 1vh;
  color-scheme: dark;
}
@supports (height: 1svh) {
  :root { --vh1: 1svh; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--antraciet-diep);
  color: var(--wit);
  font-family: var(--font);
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

#spel {
  position: fixed;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

#achter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #2a2d38;
}
#doek {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

[hidden] { display: none !important; }

.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rood);
}

/* ---------- Knoppen: altijd pillen, gewicht 800 ---------- */
.knop {
  font-family: var(--font);
  font-weight: 800;
  font-size: 16px;
  border: 2px solid transparent;
  border-radius: 50px;
  min-height: 50px;
  padding: 0 26px;
  cursor: pointer;
  color: var(--wit);
  background: var(--rood);
  box-shadow: var(--schaduw-rood);
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}
.knop:hover { transform: translateY(-3px); }
.knop:active { transform: translateY(0); }
.knop:focus-visible { outline: none; border-color: var(--rood); box-shadow: 0 0 0 3px rgba(213, 22, 62, 0.1), var(--schaduw-rood); }
.knop-groot { font-size: 18px; min-height: 56px; padding: 0 34px; }
.knop-outline { background: transparent; border-color: rgba(255, 255, 255, 0.85); box-shadow: none; }
.knop-licht { background: var(--wit); color: var(--antraciet); border-color: var(--lijngrijs); box-shadow: none; }
.knop-licht:focus-visible { border-color: var(--rood); box-shadow: 0 0 0 3px rgba(213, 22, 62, 0.1); }

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: calc(10px + var(--veilig-t));
  left: calc(12px + var(--veilig-l));
  right: calc(12px + var(--veilig-r));
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
}
.rondknop {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50px;
  border: 2px solid var(--lijngrijs);
  background: var(--wit);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: var(--schaduw-klein);
  touch-action: manipulation;
}
.rondknop:focus-visible { outline: none; border-color: var(--rood); box-shadow: 0 0 0 3px rgba(213, 22, 62, 0.1); }
.pauze-streep { width: 6px; height: 18px; border-radius: 3px; background: var(--antraciet); }

.hud-scores { display: flex; gap: 8px; margin-left: auto; }
.hud-vak {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--antraciet-diep);
  border-radius: 50px;
  padding: 0 18px;
  min-height: 48px;
  box-shadow: var(--schaduw-klein);
}
.hud-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; color: var(--grijs-300); }
.hud-getal { font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.druppel-icoon {
  width: 15px;
  height: 15px;
  margin: 4px 2px 0;
  background: var(--pro-plus);
  border-radius: 0 50% 50% 50%;
  transform: rotate(45deg);
}

/* ---------- Pijlknoppen ---------- */
#bediening { position: absolute; inset: 0; pointer-events: none; }
/* Grote raakvlakken: de hele linker- en rechterhelft van het scherm (onder de pauzeknop) */
.zone {
  position: absolute;
  top: calc(64px + var(--veilig-t));
  bottom: 0;
  width: 50%;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.zone-links { left: 0; }
.zone-rechts { right: 0; }
.pijl {
  --pijl: clamp(64px, calc(var(--vh1) * 20), 86px);
  position: absolute;
  bottom: 0;
  /* De knop is groter dan wat je ziet, zodat je hem makkelijk raakt */
  width: calc(var(--pijl) + 44px);
  height: calc(var(--pijl) + 24px + var(--veilig-b));
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;   /* de zone eronder vangt de aanraking op */
  touch-action: none;
  display: flex;
  align-items: flex-end;
}
.pijl-links { left: var(--veilig-l); justify-content: flex-start; padding: 0 0 calc(8px + var(--veilig-b)) 14px; }
.pijl-rechts { right: var(--veilig-r); justify-content: flex-end; padding: 0 14px calc(8px + var(--veilig-b)) 0; }
.pijl:focus-visible { outline: none; }
.pijl:focus-visible .pijl-vlak { border-color: var(--rood); }
.pijl-vlak {
  width: var(--pijl);
  height: var(--pijl);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wit);
  border: 3px solid var(--lijngrijs);
  border-radius: 24px;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.45);
  transition: transform 0.06s linear, background-color 0.06s linear;
}
.pijl-vlak svg { width: 52%; height: 52%; fill: var(--antraciet); }
.pijl.ingedrukt .pijl-vlak { transform: translateY(3px) scale(0.97); background: var(--rood); border-color: var(--rood); }
.pijl.ingedrukt .pijl-vlak svg { fill: var(--wit); }
.pijl-vlak { position: relative; }
.pijl.hint .pijl-vlak { border-color: var(--rood); }
.pijl.hint .pijl-vlak::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 4px solid rgba(213, 22, 62, 0.6);
  border-radius: 28px;
  animation: hint 0.9s ease-out infinite;
  pointer-events: none;
}
@keyframes hint {
  0% { transform: scale(0.92); opacity: 1; }
  100% { transform: scale(1.12); opacity: 0; }
}

/* Uitleg tijdens het oefenstuk */
#tip {
  position: absolute;
  top: calc(72px + var(--veilig-t));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 160px);
  background: var(--wit);
  color: var(--antraciet);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  text-align: center;
  padding: 12px 22px;
  border-radius: 16px;
  box-shadow: var(--schaduw-groot);
  pointer-events: none;
}
#tip b { color: var(--rood); font-weight: 900; }

/* ---------- Wereldbord en aftellen ---------- */
#wereldBord {
  position: absolute;
  top: calc(72px + var(--veilig-t));
  left: 50%;
  transform: translateX(-50%);
  background: var(--antraciet-diep);
  color: var(--wit);
  font-weight: 900;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 10px 24px;
  border-radius: 50px;
  box-shadow: var(--schaduw-groot);
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
#wereldBord::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rood);
}
#aftellen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  font-weight: 900;
  letter-spacing: -0.032em;
  text-transform: uppercase;
  color: var(--wit);
  text-shadow: 0 8px 30px rgba(42, 45, 56, 0.55);
  pointer-events: none;
}

/* ---------- Schermen ---------- */
.scherm {
  position: absolute;
  inset: 0;
  padding: calc(16px + var(--veilig-t)) calc(20px + var(--veilig-r)) calc(16px + var(--veilig-b)) calc(24px + var(--veilig-l));
}

/* Startscherm: donkere hero met rode en roze gloed, rechts rent de Pro Pop */
.scherm-start {
  display: flex;
  align-items: center;
  background:
    radial-gradient(420px 300px at 0% 100%, rgba(213, 22, 62, 0.35), transparent 70%),
    radial-gradient(360px 260px at 30% 0%, rgba(224, 96, 122, 0.22), transparent 70%),
    linear-gradient(90deg, #2a2d38 0%, #2f323e 36%, rgba(47, 50, 62, 0.9) 46%, rgba(42, 45, 56, 0) 70%);
}
.start-links { max-width: 430px; display: flex; flex-direction: column; gap: 12px; }
.start-merk {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--roze);
}
.start-titel {
  margin: 0;
  font-weight: 900;
  font-size: clamp(40px, calc(var(--vh1) * 12.5), 64px);
  line-height: 1.04;
  letter-spacing: -0.032em;
  text-transform: uppercase;
  color: var(--wit);
  text-wrap: balance;
}
.titel-run { color: var(--rood); }
.start-logo {
  display: block;
  width: min(380px, 100%);
  height: auto;
  margin-left: -6px; /* de witte rand van het logo zit al om de letters heen */
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}
.start-uitleg { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 400; line-height: 1.5; color: #e7e9ef; max-width: 40ch; }
.start-uitleg li { display: flex; gap: 10px; align-items: flex-start; }
.start-uitleg b { font-weight: 700; color: var(--wit); }
.mini-pijl {
  flex: none;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: var(--wit); color: var(--antraciet);
  border-radius: 9px;
  font-weight: 900; font-size: 15px; line-height: 1;
}
.start-knoppen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.start-record { margin: 0; font-size: 14px; font-weight: 700; color: #e7e9ef; display: flex; gap: 6px; align-items: center; }
.start-record .vink { color: var(--rood-licht); font-weight: 900; }
.start-record b { color: var(--wit); font-weight: 900; font-variant-numeric: tabular-nums; }

/* Pauze en einde: witte kaart op een verduisterd speelveld */
.scherm-midden {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(42, 45, 56, 0.72);
}
.paneel {
  width: min(390px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--wit);
  color: var(--antraciet);
  border-radius: 24px;
  box-shadow: var(--schaduw-groot);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.paneel-titel {
  margin: 0 0 4px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.032em;
  text-transform: uppercase;
  color: var(--antraciet);
  text-wrap: balance;
}
.knop-rij { display: flex; gap: 10px; }
.knop-rij .knop { flex: 1; padding: 0 12px; }

/* Badge in de stijl van "Meest gekozen!" */
.eind-record {
  margin: 0 auto;
  background: var(--rood);
  color: var(--wit);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 50px;
}
.eind-cijfers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.eind-cijfers > div {
  background: var(--lichtgrijs);
  border: 1px solid var(--lijngrijs);
  border-radius: 16px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.eind-cijfers .eind-totaal { background: var(--antraciet); border-color: var(--antraciet); color: var(--wit); }
.eind-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; }
.eind-getal { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.eind-best { margin: 0; font-size: 14px; font-weight: 700; color: var(--antraciet); }
.eind-best b { font-weight: 900; color: var(--rood); }

.scherm-draai {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(160deg, #3f4350, #2a2d38);
  text-align: center;
  z-index: 10;
}
.draai-telefoon {
  width: 54px;
  height: 90px;
  border: 5px solid var(--wit);
  border-radius: 14px;
  margin-bottom: 14px;
  animation: draai 2.2s ease-in-out infinite;
}
.draai-tekst { margin: 0; font-size: 24px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em; }
.draai-sub { margin: 0; font-size: 16px; font-weight: 400; color: #dfe1e8; }
@keyframes draai {
  0%, 25% { transform: rotate(0deg); }
  55%, 100% { transform: rotate(-90deg); }
}

/* Lage schermen (liggende telefoon) */
@media (max-height: 420px) {
  .start-logo { width: min(300px, 100%); }
  .start-links { gap: 9px; }
  .start-uitleg { font-size: 13px; gap: 6px; }
  .paneel { padding: 14px 18px; gap: 8px; }
  .paneel-titel { font-size: 24px; }
  .eind-getal { font-size: 20px; }
  .knop-groot { min-height: 50px; font-size: 17px; }
  .knop { min-height: 46px; }
}

/* Smal scherm (bijv. voorbeeld op computer in een smal venster) */
@media (max-width: 560px) {
  .scherm-start { background: rgba(42, 45, 56, 0.9); align-items: flex-end; }
  .hud-label { display: none; }
  #tip { max-width: calc(100% - 32px); top: calc(66px + var(--veilig-t)); }
}

@media (prefers-reduced-motion: reduce) {
  .draai-telefoon { animation: none; transform: rotate(-90deg); }
  .knop, .rondknop, .pijl-vlak { transition: none; }
  .knop:hover { transform: none; }
  .pijl.hint .pijl-vlak::after { animation: none; opacity: 1; transform: none; }
  .scherm, #aftellen.tel { animation: none !important; }
}


/* =====================================================================
   Overgangen
   ===================================================================== */
.scherm:not([hidden]) { animation: verschijn 0.22s ease-out; }
@keyframes verschijn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.scherm-midden:not([hidden]) .paneel { animation: omhoog 0.26s ease-out; }
@keyframes omhoog {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
#aftellen.tel { animation: tel 0.5s ease-out; }
@keyframes tel {
  from { transform: scale(1.35); opacity: 0.2; }
  to { transform: scale(1); opacity: 1; }
}
.knop:disabled { opacity: 1; background: var(--grijs-400); box-shadow: none; cursor: default; transform: none; }

/* =====================================================================
   Startscherm met ranglijst
   ===================================================================== */
.scherm-start {
  align-items: stretch;
  background:
    radial-gradient(420px 300px at 0% 100%, rgba(213, 22, 62, 0.32), transparent 70%),
    radial-gradient(360px 260px at 30% 0%, rgba(224, 96, 122, 0.2), transparent 70%),
    linear-gradient(90deg, #2a2d38 0%, rgba(47, 50, 62, 0.94) 34%, rgba(42, 45, 56, 0.25) 52%, rgba(42, 45, 56, 0.25) 64%, rgba(42, 45, 56, 0.75) 100%);
}
.start-raster {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.start-links { flex: 0 1 390px; min-width: 0; }

.rl-kaart {
  flex: 0 0 min(300px, 42%);
  align-self: center;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--wit);
  color: var(--antraciet);
  border-radius: 24px;
  box-shadow: var(--schaduw-groot);
  padding: 14px 16px 12px;
  overflow: hidden;
}
.rl-kop { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rl-titel {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--antraciet);
}
.rl-kop .kicker { order: 2; font-size: 11px; }

.rl-lijst {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.rl-lijst li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rl-lijst li:nth-child(odd) { background: var(--lichtgrijs); }
.rl-plek { color: var(--grijs-400); font-weight: 800; }
.rl-lijst li:nth-child(1) .rl-plek { color: var(--rood); }
.rl-naam-tekst { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-score { font-weight: 900; }
.rl-lijst li.ik { background: var(--rood); color: var(--wit); }
.rl-lijst li.ik .rl-plek { color: var(--wit); }

.rl-status { margin: 0; font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--antraciet); }
.rl-status:empty { display: none; }

.rl-jij {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--lijngrijs);
  padding-top: 8px;
  font-size: 13px;
  font-weight: 400;
}
.rl-jij b { font-weight: 800; }
.rl-jij-tekst { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-link {
  flex: none;
  border: 0;
  background: none;
  padding: 8px 4px;
  margin: -8px -4px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  color: var(--rood);
  cursor: pointer;
  touch-action: manipulation;
}

.rl-naam { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--lijngrijs); padding-top: 8px; }
.rl-naam-label { font-size: 12px; font-weight: 700; color: var(--antraciet); }
.rl-naam-rij { display: flex; gap: 6px; }
.rl-invoer {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  font-family: var(--font);
  font-size: 16px; /* 16px voorkomt dat iPhone inzoomt bij het typen */
  font-weight: 700;
  color: var(--antraciet);
  background: var(--lichtgrijs);
  border: 2px solid var(--lijngrijs);
  border-radius: 12px;
  -webkit-user-select: text;
  user-select: text;
}
.rl-invoer:focus { outline: none; border-color: var(--rood); box-shadow: 0 0 0 3px rgba(213, 22, 62, 0.1); }
.knop-klein { min-height: 44px; padding: 0 16px; font-size: 14px; box-shadow: none; }
.rl-melding { margin: 0; font-size: 12px; font-weight: 700; color: var(--rood); }
.rl-melding:empty { display: none; }

/* =====================================================================
   Eindscherm met ranglijst
   ===================================================================== */
.paneel-breed {
  width: min(720px, 100%);
  flex-direction: row;
  align-items: stretch;
  gap: 18px;
  text-align: left;
  padding: 16px 18px;
}
.eind-links { flex: 1 1 55%; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.eind-rechts {
  flex: 1 1 45%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 1px solid var(--lijngrijs);
  padding-left: 16px;
}
.paneel-breed .eind-record { margin: 0; align-self: flex-start; }
.eind-online { margin: 0; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--antraciet); }
.eind-online:empty { display: none; }
.eind-online b { color: var(--rood); font-weight: 900; }
.paneel-breed .knop-rij { margin-top: auto; }
.paneel-breed .knop-rij .knop-groot { flex: 1.6; }

@media (max-height: 420px) {
  .rl-kaart { padding: 10px 14px; gap: 4px; }
  .rl-lijst li { min-height: 20px; font-size: 12px; }
  .rl-titel { font-size: 17px; }
  .paneel-breed { padding: 12px 16px; gap: 14px; }
  .paneel-breed .paneel-titel { font-size: 22px; }
  .eind-links { gap: 6px; }
}
@media (max-width: 640px) {
  .start-raster { flex-direction: column; align-items: stretch; overflow-y: auto; }
  .rl-kaart { flex: none; width: 100%; }
  .paneel-breed { flex-direction: column; overflow-y: auto; }
  .eind-rechts { border-left: 0; padding-left: 0; border-top: 1px solid var(--lijngrijs); padding-top: 10px; }
}

/* =====================================================================
   Laadscherm (zoals een echte game)
   ===================================================================== */
.scherm-laden {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 20;
  background:
    radial-gradient(520px 340px at 12% 110%, rgba(213, 22, 62, 0.45), transparent 70%),
    radial-gradient(420px 300px at 90% -10%, rgba(224, 96, 122, 0.3), transparent 70%),
    linear-gradient(160deg, #3f4350, #2a2d38);
  transition: opacity 0.35s ease;
}
.scherm-laden.weg { opacity: 0; pointer-events: none; }
.laad-logo {
  width: min(62vw, calc(calc(var(--vh1) * 38) * 3.69), 560px);
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}
.laad-balk {
  width: min(300px, 46vw);
  height: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.laad-balk span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--wit);
  border-radius: 6px;
  transition: width 0.2s ease;
}
.laad-tekst {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--wit);
}
.laad-voet {
  position: absolute;
  bottom: calc(12px + var(--veilig-b));
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--roze);
}

/* =====================================================================
   Startscherm in game-stijl
   ===================================================================== */
.scherm-start {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 4px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(42, 45, 56, 0.5) 0%, rgba(42, 45, 56, 0.08) 38%, rgba(42, 45, 56, 0) 60%, rgba(42, 45, 56, 0.25) 100%);
  padding-top: calc(10px + var(--veilig-t));
  padding-bottom: calc(10px + var(--veilig-b));
}
.start-boven {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 48%;
  padding: 0 16px 0 12px;
  border: 0;
  border-radius: 50px;
  background: rgba(42, 45, 56, 0.88);
  color: var(--wit);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: var(--schaduw-klein);
  cursor: pointer;
  touch-action: manipulation;
}
.chip svg { flex: none; width: 18px; height: 18px; fill: currentColor; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip-zacht { color: var(--grijs-300); font-weight: 700; }
.chip-knop:focus-visible { outline: 3px solid var(--rood); outline-offset: 2px; }
.chip-leider { margin-left: auto; background: var(--wit); color: var(--antraciet); }
.chip-leider svg { fill: var(--vip); }

.start-midden {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  pointer-events: none; /* tikken gaat naar het hele scherm */
}
.start-midden .start-titel { margin: 0; line-height: 0; }
.start-midden .start-logo {
  pointer-events: auto;   /* 5x tikken = testmodus */
  -webkit-tap-highlight-color: transparent;
  width: min(64vw, calc(calc(var(--vh1) * 36) * 3.69), 580px);
  max-width: none;
  margin: 0;
}
.start-tik {
  pointer-events: auto;
  margin-top: 2px;
  padding: 6px 18px;
  border: 0;
  background: none;
  font-family: var(--font);
  font-size: clamp(24px, calc(var(--vh1) * 8), 38px);
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--wit);
  text-shadow:
    0 3px 0 var(--antraciet-diep),
    2px 0 0 var(--antraciet-diep), -2px 0 0 var(--antraciet-diep),
    0 -2px 0 var(--antraciet-diep), 0 2px 0 var(--antraciet-diep),
    0 8px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  animation: tik 1.6s ease-in-out infinite;
  will-change: transform, opacity; /* eigen laag: de tekst hoeft niet elk beeld opnieuw getekend */
  touch-action: manipulation;
}
.start-tik:focus-visible { outline: 3px solid var(--rood); outline-offset: 4px; border-radius: 12px; }
@keyframes tik {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}
.start-hulp {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 6px;
  border-radius: 50px;
  background: rgba(42, 45, 56, 0.75);
  font-size: 13px;
  font-weight: 700;
  color: var(--wit);
}
.start-hulp .mini-pijl { width: 24px; height: 24px; font-size: 14px; border-radius: 50%; }
.start-hulp-tus { width: 8px; }

.start-onder {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.rondje {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font);
  cursor: pointer;
  touch-action: manipulation;
}
.rondje-vlak {
  position: relative;
  width: clamp(54px, calc(var(--vh1) * 16), 66px);
  height: clamp(54px, calc(var(--vh1) * 16), 66px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wit);
  border: 3px solid var(--lijngrijs);
  border-radius: 22px;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease;
}
.rondje-vlak svg { width: 54%; height: 54%; fill: var(--antraciet); }
.rondje:active .rondje-vlak { transform: translateY(3px) scale(0.97); }
.rondje:focus-visible .rondje-vlak { border-color: var(--rood); }
.rondje-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wit);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.rondje-streep {
  position: absolute;
  width: 62%;
  height: 4px;
  border-radius: 4px;
  background: var(--rood);
  transform: rotate(-45deg);
  box-shadow: 0 0 0 2px var(--wit);
  display: none;
}
#knopGeluid.uit .rondje-streep { display: block; }
#knopGeluid.uit .rondje-vlak svg { fill: var(--grijs-400); }

/* Naam invullen */
.scherm-naam { align-items: flex-start; padding-top: calc(18px + var(--veilig-t)); }
.paneel-naam { width: min(420px, 100%); gap: 8px; }
.naam-uitleg { margin: 0; font-size: 14px; line-height: 1.45; color: var(--antraciet); }
.paneel-naam .rl-naam-rij { margin-top: 4px; }
.paneel-naam .knop { min-height: 44px; padding: 0 22px; font-size: 16px; }
.naam-terug { align-self: center; margin: 0; padding: 10px; }

/* Ranglijst-overlay */
.paneel-rl { width: min(440px, 100%); gap: 8px; text-align: left; }
.rl-titel-groot { font-size: 24px; }
.paneel-rl .rl-lijst li { min-height: 24px; font-size: 14px; }
.rl-jij-regel {
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--lichtgrijs);
  font-size: 13px;
  font-weight: 400;
  color: var(--antraciet);
}
.rl-jij-regel b { font-weight: 800; }
.paneel-rl .knop-rij .knop:first-child { flex: 1.3; }

@media (max-height: 420px) {
  .paneel-rl { padding: 12px 16px; gap: 6px; }
  .paneel-rl .rl-lijst li { min-height: 21px; font-size: 13px; }
  .rl-titel-groot { font-size: 20px; }
  .paneel-naam { padding: 14px 18px; }
  .paneel-naam .paneel-titel { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .start-tik { animation: none; }
  .scherm-laden { transition: none; }
}

/* Naam invullen moet overal werken (ook in Safari op de Mac): typen en selecteren expliciet toestaan */
#schermNaam, #schermNaam * {
  -webkit-user-select: auto;
  user-select: auto;
  -webkit-touch-callout: default;
}
#schermNaam .rl-invoer {
  -webkit-user-select: text;
  user-select: text;
  touch-action: auto;
  pointer-events: auto;
  cursor: text;
}

/* ---------- Tweede kans ---------- */
.paneel-herstel { width: min(340px, 100%); }
.herstel-uitleg { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--antraciet); }
.knop-herstel { display: flex; align-items: center; justify-content: center; gap: 14px; }
.herstel-prijs {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--wit); color: var(--antraciet);
  border-radius: 50px; padding: 4px 12px 4px 10px; font-size: 16px;
}
.herstel-prijs .druppel-icoon { margin: 2px 0 0; width: 12px; height: 12px; }
.herstel-balk { height: 6px; border-radius: 6px; background: var(--lijngrijs); overflow: hidden; }
.herstel-balk span { display: block; height: 100%; width: 100%; background: var(--rood); border-radius: 6px; }
#knopHerstelNee { margin: 2px auto 0; font-size: 14px; color: var(--antraciet); }

/* ---------- Shop (schermvullend) ---------- */
.start-onder-links { display: flex; gap: 14px; align-items: flex-end; }
.start-onder-rechts { display: flex; gap: 14px; align-items: flex-end; }
.laag .start-onder-rechts { gap: 10px; }

/* Uitleg "op beginscherm zetten" */
.paneel-app { width: min(400px, 100%); gap: 8px; text-align: left; }
.app-stappen { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.45; color: var(--antraciet); }
.app-stappen b { font-weight: 800; }
.app-deel { width: 18px; height: 18px; vertical-align: -3px; fill: #1a7cf2; }
.app-uitleg { margin: 0; font-size: 13px; line-height: 1.4; color: var(--grijs-400, #6b7080); }
.laag .app-stappen { font-size: 13px; gap: 3px; line-height: 1.35; }
.laag .paneel-app .kicker { display: none; }
/* ---------- Lage schermen (iPhone liggend met Safari-balken in beeld) ----------
   game.js zet "laag" (< 400 px echt zichtbaar) en "heel-laag" (< 310 px) op <html>.
   De chips (boven) en de ronde knoppen (onder) gaan dan vast in de hoeken; het midden
   (logo, "Tik om te spelen", uitleg) staat daartussen en wordt kleiner met de hoogte.
   Hoek-knoppen en midden staan naast elkaar, dus ze bedekken elkaar niet. */
.laag .scherm-start { justify-content: center; }
.laag .start-boven {
  position: absolute;
  top: calc(6px + var(--veilig-t));
  left: calc(24px + var(--veilig-l));
  right: calc(20px + var(--veilig-r));
  min-height: 36px;
}
.laag .chip { min-height: 36px; font-size: 13px; padding: 0 12px 0 10px; }
.laag .start-onder {
  position: absolute;
  bottom: calc(6px + var(--veilig-b));
  left: calc(24px + var(--veilig-l));
  right: calc(20px + var(--veilig-r));
}
.laag .start-onder-links { gap: 10px; }
.laag .rondje { gap: 2px; }
.laag .rondje-vlak { width: 44px; height: 44px; border-radius: 16px; border-width: 2px; }
.laag .rondje-label { font-size: 10px; }
.laag .start-midden { gap: 2px; margin-top: 36px; }
.laag .start-midden .start-logo { width: min(56vw, calc(var(--vh1) * 30 * 3.69), 580px); }
.laag .start-tik { font-size: clamp(18px, calc(var(--vh1) * 8), 26px); padding: 2px 14px; margin-top: 0; }
.laag .start-hulp { font-size: 12px; padding: 3px 12px 3px 4px; }
.laag .start-hulp .mini-pijl { width: 20px; height: 20px; font-size: 12px; }
.laag .start-dato { bottom: calc(4px + var(--veilig-b)); font-size: 9px; }
.heel-laag .start-midden { margin-top: 30px; }
.heel-laag .start-midden .start-logo { width: min(52vw, calc(var(--vh1) * 26 * 3.69), 580px); }
.heel-laag .chip { min-height: 32px; }
.heel-laag .rondje-vlak { width: 40px; height: 40px; }

/* Panelen (eind, tweede kans, pauze, naam, ranglijst) op lage schermen: compacter,
   zodat de knoppen altijd in beeld blijven. De ranglijst op het eindscherm scrolt zelf. */
.laag .scherm-midden { padding-top: calc(8px + var(--veilig-t)); padding-bottom: calc(8px + var(--veilig-b)); }
.laag .paneel { padding: 12px 16px; gap: 6px; border-radius: 18px; }
.laag .paneel-titel { font-size: 20px; }
.laag .knop-groot { min-height: 44px; font-size: 16px; }
.laag .paneel-breed { gap: 12px; }
.laag .eind-links { gap: 5px; }
.laag .eind-links > .kicker { display: none; }
.laag .eind-cijfers > div { padding-top: 4px; padding-bottom: 4px; }
.laag .eind-getal { font-size: 19px; }
.laag .eind-spaar, .laag .eind-online { font-size: 12px; line-height: 1.3; }
.laag .eind-rechts { min-height: 0; overflow-y: auto; }
.laag .herstel-uitleg { font-size: 13px; line-height: 1.3; }
.laag .paneel-herstel .kicker { display: none; }
.laag .rl-link { padding-top: 4px; padding-bottom: 4px; }
.heel-laag .paneel-titel { font-size: 18px; }
.heel-laag .eind-record { display: none; }

/* Klein en subtiel onderaan het startscherm */
.start-dato {
  position: absolute;
  left: 50%;
  bottom: calc(10px + var(--veilig-b));
  transform: translateX(-50%);
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.38);
  pointer-events: none;
  user-select: none;
}

.scherm-shop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(12px + var(--veilig-t)) calc(16px + var(--veilig-r)) calc(12px + var(--veilig-b)) calc(16px + var(--veilig-l));
  background-color: var(--antraciet-diep);
  background-image: repeating-linear-gradient(-60deg, rgba(255, 255, 255, 0.025) 0 60px, rgba(255, 255, 255, 0) 60px 150px);
  color: var(--wit);
}
.shop-boven { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.shop-saldo {
  justify-self: start; margin: 0;
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(0, 0, 0, 0.35); border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px; padding: 5px 18px 5px 8px;
  font-weight: 900; font-size: clamp(20px, calc(var(--vh1) * 6), 28px); letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.shop-druppel {
  width: clamp(28px, calc(var(--vh1) * 8.5), 38px); height: clamp(28px, calc(var(--vh1) * 8.5), 38px);
  display: grid; place-items: center; border-radius: 50%; background: var(--wit);
}
.shop-druppel::after {
  content: ""; width: 42%; height: 42%; margin-top: 12%;
  background: var(--pro-plus); border-radius: 0 50% 50% 50%; transform: rotate(45deg);
}
.shop-titel {
  margin: 0; font-size: clamp(18px, calc(var(--vh1) * 5.4), 26px); font-weight: 900; text-transform: uppercase; letter-spacing: -0.02em;
  color: var(--wit);
}
.shop-sluit {
  justify-self: end;
  width: clamp(46px, calc(var(--vh1) * 13), 58px); height: clamp(46px, calc(var(--vh1) * 13), 58px);
  border: 0; border-radius: 18px; background: var(--rood); cursor: pointer; touch-action: manipulation;
  display: grid; place-items: center; box-shadow: 0 6px 0 #a50f2f, 0 10px 20px -6px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.shop-sluit svg { width: 46%; height: 46%; stroke: var(--wit); stroke-width: 3.4; stroke-linecap: round; fill: none; }
.shop-sluit:active { transform: translateY(4px); box-shadow: 0 2px 0 #a50f2f, 0 4px 10px -4px rgba(0, 0, 0, 0.5); }

.shop-lijst {
  list-style: none; margin: 0; padding: 0;
  flex: 1; min-height: 0; max-height: 440px;
  width: min(820px, 100%);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 2.4vw, 26px);
  align-items: stretch;
}
.shop-kaart { display: flex; flex-direction: column; align-items: stretch; gap: 6px; min-height: 0; }
.shop-naam {
  margin: 0; text-align: center; color: var(--wit);
  font-weight: 900; font-size: clamp(16px, calc(var(--vh1) * 5.2), 26px); text-transform: uppercase; letter-spacing: -0.01em; line-height: 1.05;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.shop-vak {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 10px 10px 12px;
  background: linear-gradient(#f4f5f7, #e3e6eb);
  border: 4px solid #c9ced6; border-radius: 22px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.28);
  cursor: pointer; touch-action: manipulation;
}
.shop-kaart.gekozen .shop-vak { background: linear-gradient(#fff4f6, #fbd9e0); border-color: var(--rood); }
.shop-beeld { position: relative; flex: 1; min-height: 0; width: 100%; padding: 0 5%; display: flex; align-items: flex-end; justify-content: center; }
.shop-beeld::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -2px; height: 10px;
  background: rgba(0, 0, 0, 0.14); border-radius: 50%;
}
.shop-beeld img {
  position: relative; z-index: 1;
  height: var(--h, 80%); width: auto; max-width: 100%; object-fit: contain; object-position: bottom;
}
.shop-kaart.gekozen .shop-beeld img { animation: shopHuppel 1.4s ease-in-out infinite; }
@keyframes shopHuppel { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.shop-kaart.binnenkort .shop-beeld img { filter: brightness(0); opacity: 0.16; }
.shop-vraag {
  position: absolute; z-index: 2; left: 50%; top: 44%; transform: translate(-50%, -50%);
  width: clamp(44px, calc(var(--vh1) * 13), 64px); height: clamp(44px, calc(var(--vh1) * 13), 64px); border-radius: 50%;
  display: grid; place-items: center; background: var(--antraciet); color: var(--wit);
  font-weight: 900; font-size: clamp(24px, calc(var(--vh1) * 7), 36px);
}
.shop-knop {
  margin-top: 8px; width: min(100%, 190px); min-height: clamp(40px, calc(var(--vh1) * 11.5), 50px);
  border: 0; border-radius: 50px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 900; font-size: clamp(15px, calc(var(--vh1) * 4.6), 20px); font-variant-numeric: tabular-nums;
  cursor: pointer; touch-action: manipulation;
  color: var(--wit); background: var(--rood); box-shadow: 0 5px 0 #a50f2f;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.shop-knop:active { transform: translateY(3px); box-shadow: 0 2px 0 #a50f2f; }
.shop-knop .mini-druppel { width: 14px; height: 14px; background: var(--wit); border-radius: 0 50% 50% 50%; transform: rotate(45deg); margin-top: 3px; }
.shop-knop svg { width: 16px; height: 16px; fill: currentColor; }
.shop-knop.st-gekozen { background: var(--antraciet); box-shadow: 0 5px 0 #1d1f27; cursor: default; }
.shop-knop.st-kies { background: var(--wit); color: var(--antraciet); box-shadow: 0 5px 0 #b9bec7; border: 2px solid #c9ced6; }
.shop-knop.st-te-duur { background: #cfd3da; color: var(--antraciet); box-shadow: 0 5px 0 #a9aeb8; }
.shop-knop.st-te-duur .mini-druppel { background: var(--pro-plus); }
.shop-knop.st-zeker { background: var(--antraciet); box-shadow: 0 5px 0 #1d1f27; }
.shop-knop.st-binnenkort { background: transparent; color: var(--antraciet); box-shadow: none; border: 2px dashed #a9aeb8; cursor: default; font-size: clamp(13px, calc(var(--vh1) * 4), 16px); text-transform: uppercase; letter-spacing: 0.06em; }

.shop-onder { width: min(820px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-midden { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.shop-spelen { min-width: min(260px, 42vw); min-height: clamp(48px, calc(var(--vh1) * 13), 58px); font-size: clamp(18px, calc(var(--vh1) * 5.4), 22px); box-shadow: 0 6px 0 #a50f2f; }
.shop-spelen:hover { transform: none; }
.shop-spelen:active { transform: translateY(4px); box-shadow: 0 2px 0 #a50f2f; }
.shop-stipjes { display: flex; gap: 6px; }
.shop-stipjes span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); }
.shop-stipjes span.aan { background: var(--wit); }
.shop-pijl {
  width: clamp(50px, calc(var(--vh1) * 14), 62px); height: clamp(50px, calc(var(--vh1) * 14), 62px);
  border: 0; border-radius: 18px; background: var(--wit); cursor: pointer; touch-action: manipulation;
  display: grid; place-items: center; box-shadow: 0 6px 0 #b9bec7;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.shop-pijl svg { width: 50%; height: 50%; fill: var(--antraciet); }
.shop-pijl:active { transform: translateY(4px); box-shadow: 0 2px 0 #b9bec7; }
.shop-pijl:disabled { background: #4a4e5c; box-shadow: 0 6px 0 #22242d; cursor: default; }
.shop-pijl:disabled svg { fill: #7c8190; }
.shop-melding {
  position: absolute; z-index: 5; left: 50%; top: calc(12px + var(--veilig-t)); transform: translateX(-50%);
  margin: 0; background: var(--wit); color: var(--antraciet); font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 50px; box-shadow: var(--schaduw-groot); white-space: nowrap;
}
.shop-lijst.schuif-links { animation: shopLinks 0.22s ease-out; }
.shop-lijst.schuif-rechts { animation: shopRechts 0.22s ease-out; }
@keyframes shopLinks { from { transform: translateX(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes shopRechts { from { transform: translateX(-40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@media (max-height: 420px) {
  .shop-vak { padding: 6px 8px 10px; border-width: 3px; border-radius: 18px; }
  .shop-kaart { gap: 3px; }
  .scherm-shop { gap: 6px; }
}
@media (max-width: 560px) and (orientation: portrait) {
  .shop-lijst { grid-template-columns: 1fr; overflow-y: auto; }
  .shop-vak { min-height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-kaart.gekozen .shop-beeld img, .shop-lijst.schuif-links, .shop-lijst.schuif-rechts { animation: none; }
}

.eind-spaar { margin: 0; font-size: 13px; font-weight: 700; color: var(--antraciet); display: flex; align-items: center; gap: 6px; }
.eind-spaar:empty { display: none; }
.eind-spaar .druppel-icoon { margin: 0 2px 0 0; width: 11px; height: 11px; }

/* Gouden druppels: teller naar het schuimschild */
.druppel-goud { background: #e0c98a; box-shadow: inset 0 0 0 2px #c9a96a; }
.hud-getal-klein { font-size: 17px; min-width: 0; }
.hud-goud { padding: 0 14px; }

/* Overgang bij opnieuw beginnen: even donker, dan zacht weer licht */
#overgang { position: absolute; inset: 0; background: var(--antraciet-diep); opacity: 1; pointer-events: none; z-index: 5; }
#overgang.uit { opacity: 0; transition: opacity 0.4s ease-out; }

/* Heel smal én laag (iPhone SE liggend met balken): hoekknoppen iets kleiner, zodat ze naast het midden passen */
@media (max-width: 620px) {
  .laag .rondje-vlak { width: 38px; height: 38px; border-radius: 13px; }
  .laag .start-onder-links, .laag .start-onder-rechts { gap: 6px; }
  .laag .rondje-label { font-size: 9px; letter-spacing: 0.04em; }
  .laag .scherm-start { justify-content: flex-start; }
  .laag .start-midden { margin-top: 34px; }
  .laag .start-midden .start-logo { width: min(50vw, calc(var(--vh1) * 24 * 3.69), 580px); }
  .laag .start-tik { font-size: clamp(17px, calc(var(--vh1) * 7), 24px); }
  .laag .start-hulp { font-size: 11px; padding: 2px 10px 2px 3px; }
  .laag .start-hulp .mini-pijl { width: 18px; height: 18px; font-size: 11px; }
}

/* Specialiteit van een runner (rustig, onder in de kaart) en de DATO-kaart */
.shop-perk {
  margin: 0 0 2px; order: 2; text-align: center; color: #5b6272;
  font-weight: 800; font-size: clamp(11px, calc(var(--vh1) * 3.3), 14px); line-height: 1.15;
}
.shop-vak .shop-beeld { order: 1; }
.shop-vak .shop-knop { order: 3; }
.shop-naam .shop-logo { height: 0.95em; width: auto; vertical-align: middle; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); background: #fbefe2; border-radius: 6px; padding: 2px 6px; }
.shop-knop.st-dato { background: #c4502a; box-shadow: 0 5px 0 #8f3a1f; font-size: clamp(12px, calc(var(--vh1) * 3.6), 15px); line-height: 1.1; text-align: center; }
.rl-held { height: 1.25em; width: auto; vertical-align: -0.28em; margin-right: 6px; }

/* iPhone in Safari: de knop naar "volledig scherm" (via het beginscherm) valt rustig op */
#knopApp.app-tip .rondje-vlak { animation: appTip 2.4s ease-in-out infinite; }
@keyframes appTip { 0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(213, 22, 62, 0); } 80% { box-shadow: 0 0 0 7px rgba(213, 22, 62, 0.35); } 90% { box-shadow: 0 0 0 12px rgba(213, 22, 62, 0); } }
@media (prefers-reduced-motion: reduce) { #knopApp.app-tip .rondje-vlak { animation: none; } }
.shop-beeld canvas.shop-anim { position: relative; z-index: 1; height: var(--h, 80%); width: auto; max-width: 100%; object-fit: contain; }
.shop-kaart.gekozen .shop-beeld canvas.shop-anim { animation: none; }

/* Profiel: pincode (4 cijfers) naast de naam, en de links eronder */
.pin-invoer { flex: 0 0 6.2em; letter-spacing: 0.25em; text-align: center; }
.pin-invoer::placeholder { letter-spacing: 0; }
.naam-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.naam-links .rl-link { margin: 0; padding: 6px 4px; }
@media (max-width: 460px) { .paneel-naam .rl-naam-rij { flex-wrap: wrap; } .paneel-naam .rl-naam-rij .knop { flex: 1 0 100%; } }
.rl-held-leeg { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--lijngrijs, #d9dce2); vertical-align: -0.28em; }
.rl-held-leeg svg { width: 70%; height: 70%; fill: #8a909c; }
.rl-skin { margin-left: 6px; font-size: 0.72em; font-weight: 700; color: var(--grijs-400, #8a909c); }

/* Record-vlag: hoeveel meter nog tot je record (onder de scores) */
.hud-record {
  position: absolute; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 3px 10px; border-radius: 999px; background: rgba(20, 24, 34, 0.72); color: #fff;
  font: 700 12px/1.3 Montserrat, Arial, sans-serif; white-space: nowrap; pointer-events: none;
}

/* Dagrace en missies op het startscherm: klein label met de beloning die nog te halen is */
.rondje-badge {
  position: absolute; top: -8px; right: -10px; min-width: 22px; padding: 2px 6px; border-radius: 999px;
  background: #f7931e; color: #231300; border: 2px solid var(--wit);
  font: 900 11px/1.2 var(--font); letter-spacing: 0; box-shadow: 0 3px 8px -2px rgba(0, 0, 0, 0.45);
}
.rondje-badge-zacht { background: var(--antraciet); color: var(--wit); }

/* Ranglijst: altijd / dagrace vandaag */
.rl-tabs { display: flex; gap: 6px; }
.rl-tab {
  flex: 1; border: 2px solid var(--lijngrijs); background: var(--wit); color: var(--antraciet); border-radius: 999px;
  padding: 6px 10px; font: 800 13px var(--font); cursor: pointer; touch-action: manipulation;
}
.rl-tab[aria-selected="true"] { background: var(--antraciet); border-color: var(--antraciet); color: var(--wit); }
.rl-tab:focus-visible { outline: 3px solid var(--rood); outline-offset: 1px; }

/* Wereldmissies */
.paneel-missies { width: min(520px, 100%); gap: 8px; text-align: left; }
.missie-stand { margin: 0; font-size: 13px; color: var(--antraciet); }
.missie-scroll { overflow-y: auto; min-height: 0; flex: 1 1 auto; display: grid; gap: 8px; padding-right: 4px; }
.missie-kop { margin: 4px 0 0; font: 900 15px var(--font); color: var(--antraciet); }
.missie-kop span { color: #6b7080; font-weight: 700; }
.missie-lijst { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plakboek { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.plak { display: grid; justify-items: center; gap: 2px; padding: 4px 2px 6px; border-radius: 12px; background: #f1f2f6; border: 2px dashed #d3d6de; }
.plak canvas { width: 100%; max-width: 70px; height: auto; }
.plak-naam { font-size: 10px; font-weight: 700; text-align: center; line-height: 1.2; color: #6b7080; }
.plak-klaar { background: #fff8e1; border: 2px solid #f6c343; }
.plak-klaar .plak-naam { color: var(--antraciet); }
.beloningen { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.beloning { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 10px; background: #f1f2f6; font-size: 13px; }
.beloning-naam { font-weight: 800; }
.beloning-eis { color: #6b7080; font-variant-numeric: tabular-nums; text-align: right; }
.beloning-klaar { background: #e7f7ee; }
.beloning-klaar .beloning-eis { color: #1f9d55; font-weight: 800; }
.spoor-knop { justify-self: start; margin: 0; padding: 4px 0; }
.missie-groep { display: grid; gap: 3px; }
.missie-wereld { margin: 0; font: 900 12px var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--rood); }
.missie { margin: 0; display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.missie-vink { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--lijngrijs); display: grid; place-items: center; font-weight: 900; font-size: 13px; color: var(--wit); }
.missie-klaar .missie-vink { background: #1f9d55; border-color: #1f9d55; }
.missie-klaar .missie-tekst { color: #6b7080; text-decoration: line-through; }
.missie-beloning { font-weight: 800; font-variant-numeric: tabular-nums; color: #0d6e8c; }
@media (max-height: 420px) {
  .paneel-missies { padding: 12px 16px; gap: 6px; }
}

/* Recordkaart */

.paneel-kaart { width: auto; max-width: 100%; align-items: center; }
.kaart-beeld { display: block; height: min(62vh, 520px); width: auto; max-width: 100%; border-radius: 14px; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.5); }
.paneel-kaart .knop { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* Dagrace-kaart */
.paneel-dag { width: min(560px, 100%); text-align: left; gap: 10px; }
.dag-kop { display: grid; grid-template-columns: minmax(0, 46%) 1fr; gap: 14px; align-items: center; }
.dag-wereld { width: 100%; height: auto; aspect-ratio: 320 / 150; border-radius: 14px; background: #2a2d38; box-shadow: inset 0 0 0 2px var(--lijngrijs); }
.dag-tekst { display: grid; gap: 2px; }
.dag-label { margin: 0; font: 800 11px var(--font); text-transform: uppercase; letter-spacing: 0.1em; color: #6b7080; }
.dag-wereld-naam { margin: 0 0 6px; font: 900 20px/1.1 var(--font); }
.dag-twist { margin: 0; font: 900 22px/1.1 var(--font); color: #e0780f; }
.dag-uitleg { margin: 2px 0 0; font-size: 13px; line-height: 1.35; }
.dag-reeks { margin: 0; padding: 8px 12px; border-radius: 12px; background: #fff4e6; color: #5a3200; font-size: 13px; font-weight: 700; }
@media (max-height: 420px) {
  .paneel-dag { padding: 12px 16px; gap: 6px; }
  .dag-wereld-naam { font-size: 17px; margin-bottom: 2px; }
  .dag-twist { font-size: 18px; }
}

/* Ranglijst: vlammetje (dagreeks) en gouden naam (veel missies) */
.rl-naam-echt { overflow: hidden; text-overflow: ellipsis; }
.rl-goud { color: #b8860b; font-weight: 900; text-shadow: 0 0 6px rgba(255, 200, 40, 0.45); }
.rl-lijst-licht .rl-goud { color: #ffd24a; }
.rl-vlam { display: inline-flex; align-items: center; gap: 1px; margin-left: 4px; font: 900 11px var(--font); color: #e0620f; }
.rl-vlam svg { width: 13px; height: 13px; fill: #f7931e; }

/* Eindscherm: bovenaan score, verdiend en spaarpot; samenvatting; details achter een knop.
   Alleen het bovenste deel scrolt: de knoppen blijven altijd in beeld (ook op een iPhone). */
.paneel-breed { overflow: hidden; }
.eind-links { min-height: 0; gap: 0; }
.eind-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.eind-kop { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.eind-kop .paneel-titel { margin: 0; }
.paneel-breed .eind-kop .eind-record { margin: 0; flex: none; }
.eind-cijfers > div { padding: 6px 4px; }
.eind-samen { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.eind-samen li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: #f1f2f6; font-size: 13px; font-weight: 700; color: var(--antraciet); }
.eind-samen li b { margin-left: auto; color: #0d6e8c; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.eind-samen .samen-dag { background: #fff4e6; }
.eind-details-knop { align-self: flex-start; margin: 0; padding: 2px 0; }
.eind-details-knop:empty, .eind-details-knop[hidden] { display: none; }
.eind-details { list-style: none; margin: 0; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--lijngrijs); display: grid; gap: 3px; font-size: 12px; }
.eind-details li { display: flex; gap: 8px; justify-content: space-between; }
.eind-details li b { font-variant-numeric: tabular-nums; white-space: nowrap; color: #0d6e8c; }
.eind-details .detail-kop { font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; color: #6b7080; margin-top: 4px; }
.eind-details .detail-totaal { border-top: 1px solid var(--lijngrijs); padding-top: 4px; margin-top: 2px; font-weight: 900; }
.eind-knoppen { flex: none; margin-top: 0 !important; padding-top: 8px; background: var(--wit); }
.eind-knoppen .knop-icoon { flex: none; width: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.eind-knoppen .knop-icoon svg { width: 20px; height: 20px; fill: currentColor; }
.laag .eind-scroll { gap: 5px; }
.laag .eind-samen li { padding: 4px 8px; font-size: 12px; }
@media (max-width: 640px) {
  .paneel-breed { overflow: hidden; }
  .eind-rechts { display: none; }   /* smal scherm: de ranglijst staat in het menu */
}

/* Eindscherm: compacte top 5 en je eigen regel eronder (andere kleur) */
.rl-lijst-kort li { min-height: 26px; }
.rl-eigen {
  margin: 4px 0 0; display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 12px; background: #fff0d9; border: 2px solid #f7931e; color: #3a2400;
  font-size: 14px; font-weight: 800;
}
.rl-eigen .rl-plek { color: #c25e00; font-weight: 900; }
.rl-eigen .rl-score { font-weight: 900; font-variant-numeric: tabular-nums; }
.rl-eigen .rl-naam-tekst { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rl-eigen .rl-held { width: 22px; height: 22px; object-fit: contain; flex: none; }
.rl-eigen .rl-skin { font-size: 10px; font-weight: 700; color: #8a5a1a; }
.rl-lijst-kort li.ik { background: #fff0d9; box-shadow: inset 0 0 0 2px #f7931e; border-radius: 10px; }
.rl-lijst-kort li.ik, .rl-lijst-kort li.ik .rl-plek, .rl-lijst-kort li.ik .rl-score { color: #3a2400; }
.rl-lijst-kort li.ik .rl-skin { color: #8a5a1a; }
/* gouden naam: donker goud, goed leesbaar op de lichte lijsten */
.rl-goud, .rl-lijst-licht .rl-goud { color: #a86b00; text-shadow: none; }
.rl-lijst li.ik .rl-goud { color: #ffe08a; }
.rl-lijst-kort li.ik .rl-goud { color: #a86b00; }
/* knoppen op het eindscherm: altijd op één regel */
.eind-knoppen .knop { white-space: nowrap; }
@media (max-width: 720px) { .eind-knoppen .knop-groot { font-size: 16px; padding-left: 12px; padding-right: 12px; } }

/* Korte melding tijdens het spelen: één regel in de bovenbalk (tussen pauzeknop en scores) */
.hud-melding {
  flex: 0 1 auto; min-width: 0; margin: 0 0 0 4px; align-self: center;
  height: 34px; padding: 0 14px; border-radius: 999px; display: flex; align-items: center; gap: 6px;
  background: rgba(24, 27, 38, 0.86); color: #fff; font: 800 13px/1 var(--font);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
  opacity: 0; transform: translateY(-6px); transition: opacity 0.2s ease, transform 0.2s ease;
}
.hud-melding.zicht { opacity: 1; transform: none; }
.hud-melding:empty { visibility: hidden; }
.hud-melding .druppel-icoon { width: 11px; height: 13px; margin: 0; flex: none; }
@media (prefers-reduced-motion: reduce) { .hud-melding { transition: none; } }
/* het oude bordje alleen nog in het menu, en kleiner */
#wereldBord { font-size: 14px; padding: 7px 16px; }

/* ===================== Schuimjacht ===================== */
.race-hud { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); display: flex; gap: 6px; align-items: center; pointer-events: none; }
.race-hud-vak { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--antraciet-diep); box-shadow: var(--schaduw-klein); }
.race-hud-vak .hud-getal { font-size: 16px; min-width: 0; }
.race-hud-vak .hud-getal { white-space: nowrap; }
.race-auto-icoon { font-size: 15px; line-height: 1; }
@media (max-width: 400px) { .race-druk-balk { width: 50px; } .race-hud-vak, .race-druk { padding: 0 10px; } }
.race-hud-vak.dichtbij { background: #d5163e; animation: auto-puls 0.6s ease-in-out infinite; }
@keyframes auto-puls { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .race-hud-vak.dichtbij { animation: none; } }
.race-druk { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--antraciet-diep); box-shadow: var(--schaduw-klein); }
.race-druk-icoon { width: 14px; height: 14px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #1ba3d8; }
.race-druk-balk { width: 70px; height: 8px; border-radius: 4px; background: rgba(255,255,255,0.18); overflow: hidden; }
.race-druk-balk span { display: block; height: 100%; width: 0; background: #7fd3f5; transition: width 0.2s linear; }
.race-druk.vol .race-druk-balk span { background: #3ce0ff; box-shadow: 0 0 8px #3ce0ff; }
.knop-spuit {
  position: absolute; left: 50%; bottom: calc(18px + var(--veilig-b)); transform: translateX(-50%); z-index: 6;
  min-height: 52px; padding: 0 26px; border: 3px solid #fff; border-radius: 999px; background: #1ba3d8; color: #fff;
  font: 900 17px var(--font); box-shadow: 0 8px 22px -6px rgba(0,0,0,0.5); touch-action: manipulation; animation: spuit-puls 0.9s ease-in-out infinite;
}
@keyframes spuit-puls { 50% { transform: translateX(-50%) scale(1.05); } }
@media (prefers-reduced-motion: reduce) { .knop-spuit { animation: none; } }
.race-wacht { position: absolute; left: 50%; top: 45%; transform: translateX(-50%); margin: 0; padding: 10px 18px; border-radius: 999px; background: rgba(24,27,38,0.86); color: #fff; font: 800 15px var(--font); }
.paneel-race { width: min(460px, 100%); gap: 8px; }
.race-uitleg { margin: 0; font-size: 13px; line-height: 1.35; }
.race-spelers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.race-slot { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 10px; border-radius: 12px; border: 2px dashed var(--lijngrijs); font-weight: 800; font-size: 14px; text-align: left; }
.race-slot-vol { border-style: solid; background: #f1f2f6; }
.race-slot-ik { border-color: #f7931e; background: #fff0d9; }
.race-slot-held { width: 34px; height: 34px; object-fit: contain; flex: none; }
.race-slot-leeg { color: #9aa0ae; font-weight: 700; }
.race-status { margin: 0; font-size: 13px; font-weight: 700; min-height: 2.6em; }
.race-beloning { margin: 0; font-weight: 800; color: #0d6e8c; }
.race-uitslag { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.race-uit { display: grid; grid-template-columns: 2em 30px minmax(0, 1fr) auto 3em; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; background: #f1f2f6; font-size: 14px; }
.race-uit-ik { background: #fff0d9; box-shadow: inset 0 0 0 2px #f7931e; }
.race-uit-plek { font-weight: 900; }
.race-uit-held { width: 30px; height: 30px; object-fit: contain; }
.race-uit-naam { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-uit-wat { color: #6b7080; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.race-uit b { color: #0d6e8c; text-align: right; font-variant-numeric: tabular-nums; }
.eind-koppel { display: flex; margin-top: 6px; min-height: 40px; font-size: 14px; }

/* Shop: tabbladen (runners, upgrades, power-ups, sporen, looks) en getekende plaatjes op de kaarten */
/* titel en tabbladen samen in het midden van de bovenste balk (op een laag scherm alleen de tabbladen) */
.shop-kop { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.shop-tabs { max-width: 100%; display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.shop-tabs::-webkit-scrollbar { display: none; }
.shop-tab {
  flex: none; min-height: 36px; padding: 0 14px; border: 2px solid rgba(255, 255, 255, 0.18); border-radius: 50px;
  background: rgba(0, 0, 0, 0.3); color: var(--wit); font-family: var(--font); font-weight: 800; font-size: clamp(12px, calc(var(--vh1) * 3.6), 15px);
  cursor: pointer; touch-action: manipulation; white-space: nowrap;
}
.shop-tab.aan { background: var(--wit); color: var(--antraciet); border-color: var(--wit); }
.shop-beeld canvas.shop-icoon { position: relative; z-index: 1; height: 82%; width: auto; max-width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }
.shop-knop:disabled { cursor: default; }
@media (max-width: 400px) { .shop-tabs { justify-content: flex-start; } .shop-tab { padding: 0 10px; } }
/* Lage schermen (telefoon liggend): geen titel, tabbladen in de bovenste balk, alles compacter,
   zodat de runner op de kaart zo groot mogelijk blijft */
@media (max-height: 520px) {
  .shop-titel { display: none; }
  .shop-tab { min-height: 32px; padding: 0 11px; font-size: 13px; }
  .scherm-shop { gap: 4px; padding-top: calc(8px + var(--veilig-t)); padding-bottom: calc(6px + var(--veilig-b)); }
  .shop-saldo { padding: 3px 14px 3px 5px; font-size: 20px; gap: 7px; }
  .shop-druppel { width: 28px; height: 28px; }
  .shop-sluit { width: 44px; height: 44px; border-radius: 14px; }
  .shop-naam { font-size: 16px; }
  .shop-kaart { gap: 2px; }
  .shop-vak { padding: 4px 8px 8px; border-width: 3px; border-radius: 16px; }
  .shop-perk { font-size: 11px; margin: 0; }
  .shop-knop { margin-top: 4px; min-height: 36px; font-size: 15px; }
  .shop-beeld img, .shop-beeld canvas.shop-anim { height: min(100%, calc(var(--h, 80%) * 1.15)); }
  .shop-beeld canvas.shop-icoon { height: 100%; }
  .shop-spelen { min-height: 42px; font-size: 17px; }
  .shop-pijl { width: 44px; height: 44px; border-radius: 14px; }
}
