/* Gsm van de speler: vier tegels, één duim, drukke zaal. */
html, body { height: 100%; overscroll-behavior: none; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  font-size: 17px;
  line-height: 1.35;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  transition: background-color .2s;
}
body[data-sfeer="juist"] { background: var(--juist); }
body[data-sfeer="fout"] { background: var(--fout); }

.achtergrond { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.achtergrond .bol { position: absolute; right: -90px; top: -90px; width: 300px; height: 300px; border-radius: 50%; background: var(--paars-licht); opacity: .55; }
.achtergrond .blok { position: absolute; left: -130px; bottom: 20px; width: 280px; height: 280px; background: var(--paars-diep); opacity: .55; transform: rotate(45deg); }
body[data-sfeer="juist"] .achtergrond, body[data-sfeer="fout"] .achtergrond { display: none; }

button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; cursor: pointer; }

.scherm { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px; outline: none; }

.inhoud { flex: 1; min-height: 0; display: flex; flex-direction: column; animation: scene .3s var(--ease); }
@keyframes scene { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.balk { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--wit); color: var(--inkt); }
.balk-shirt .shirt { display: block; width: 30px; height: 30px; }
.balk-naam { flex: 1; min-width: 0; font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.balk-punten { padding: 2px 10px; background: var(--inkt); color: var(--wit); border-radius: 5px; font-weight: 800; font-size: 18px; }

h1 { font-weight: 900; line-height: 1.1; font-size: 32px; letter-spacing: -.01em; text-wrap: balance; }

.midden { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.midden p { max-width: 30ch; font-weight: 600; font-size: 18px; }
.midden .shirt { width: 120px; height: 120px; animation: staan .45s var(--ease); }
@keyframes staan { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }

.logo { font-weight: 900; font-size: 52px; line-height: 1; letter-spacing: -.02em; text-align: center; margin: 12vh 0 18px; }

/* ---- Formulieren: witte kaart op paars ---- */

form { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: var(--wit); color: var(--inkt); border-radius: 8px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); }

form :focus-visible { outline-color: var(--paars); }

label, .veldlabel { display: block; font-weight: 700; font-size: 15px; margin-bottom: 5px; }

input[type="text"], input[inputmode="numeric"] {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 2px solid #857d9a;
  border-radius: 6px;
  background: var(--wit);
  color: var(--inkt);
  font-size: 20px;
  font-weight: 700;
}
input.groot { font-weight: 900; font-size: 30px; letter-spacing: .1em; text-align: center; }
input::placeholder { color: var(--grijs-tekst); }

.fout { color: #fff; background: #b3122e; padding: 10px 12px; border-radius: 6px; font-weight: 600; font-size: 15px; }

.hoofdknop {
  min-height: 56px;
  border: 0;
  border-radius: 6px;
  background: var(--inkt);
  color: var(--wit);
  font-weight: 800;
  font-size: 20px;
  transition: transform .12s var(--ease);
}
.hoofdknop:active { transform: scale(.97); }
.hoofdknop:disabled { opacity: .55; }

.keuzerij { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; }
.keuzerij legend { padding: 0; font-weight: 700; font-size: 15px; margin-bottom: 5px; }

.keuze { position: relative; }
.keuze input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.keuze .vak { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 6px; border: 2px solid transparent; background: var(--grijs); font-weight: 700; font-size: 14px; }
.keuze input:checked + .vak { border-color: var(--paars); background: #ece4f8; color: var(--paars); }
.keuze input:focus-visible + .vak { outline: 3px solid var(--goud); outline-offset: 2px; }
.keuze .stip { width: 26px; height: 26px; padding: 0; min-width: 0; min-height: 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .25); background: var(--kleur); }
.keuze .kleurvak { padding: 0; }

.aanmeldkop { display: flex; align-items: center; gap: 12px; }
.aanmeldkop .shirt { flex: none; width: 84px; height: 84px; }
.aanmeldkop h1 { font-size: 26px; }

.nummer { width: 92px !important; text-align: center; }

.ploegkeuze { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; width: 100%; }
.ploegkeuze .keuze .vak { width: 100%; min-height: 52px; background: var(--kleur); color: var(--kleur-op); font-weight: 800; font-size: 17px; border-color: transparent; opacity: .86; }
.ploegkeuze .keuze input:checked + .vak { opacity: 1; border-color: var(--inkt); color: var(--kleur-op); background: var(--kleur); box-shadow: 0 0 0 2px var(--wit), 0 0 0 4px var(--inkt); }
.midden .ploegkeuze .keuze input:checked + .vak { border-color: var(--wit); box-shadow: 0 0 0 2px var(--wit); }

/* ---- Antwoordtegels ---- */

.knoppen { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; }

.knop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 6px;
  border: 0;
  border-radius: 6px;
  color: var(--wit);
  text-align: center;
  font-weight: 800;
  font-size: clamp(19px, 5.06vw, 22px);
  line-height: 1.15;
  overflow-wrap: break-word;
  -webkit-hyphens: auto;
  hyphens: auto;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
  transition: transform .1s var(--ease), opacity .2s, box-shadow .1s;
}
.knop:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.knop .vorm { width: 52px; height: 52px; }
.knop.a { background: var(--a); }
.knop.b { background: var(--b); }
.knop.c { background: var(--c); }
.knop.d { background: var(--d); }
.knop:disabled { cursor: default; }

.gekozen { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(240px, 100%); padding: 18px 14px; border-radius: 6px; color: var(--wit); font-weight: 800; font-size: 19px; line-height: 1.15; }
.gekozen .vorm { width: 52px; height: 52px; }
.gekozen.a { background: var(--a); }
.gekozen.b { background: var(--b); }
.gekozen.c { background: var(--c); }
.gekozen.d { background: var(--d); }

/* ---- Schatten ---- */

.schat { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.schatvak { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-height: 80px; padding: 12px; background: var(--wit); color: var(--inkt); border-radius: 6px; }
.schatvak .getal { font-weight: 900; font-size: 46px; line-height: 1; }
.schatvak .eenheid { font-weight: 700; font-size: 17px; }
.bereiklabel { text-align: center; font-size: 15px; font-weight: 600; }
.toetsen { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 6px; min-height: 0; }
.toets { border: 0; min-height: 50px; border-radius: 6px; background: var(--paars-diep); color: var(--wit); font-weight: 800; font-size: 26px; transition: transform .1s; }
.toets:active { transform: scale(.95); }
.toets.ok { background: var(--juist); font-size: 22px; }
.toets:disabled { background: #3a2a5e; color: #cfc6e4; }

/* ---- Uitslag van de vraag ---- */

.uitkomst { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.uitkomst h1 { font-size: 44px; }
.uitkomst .vorm { width: 92px; height: 92px; padding: 16px; background: rgba(255, 255, 255, .22); border-radius: 50%; }
.uitkomst .punten { padding: 6px 18px; background: rgba(0, 0, 0, .28); border-radius: 6px; font-weight: 900; font-size: 34px; line-height: 1.1; }
.uitkomst .detail { font-size: 17px; font-weight: 600; }
.uitkomst .juiste { font-weight: 800; font-size: 24px; line-height: 1.15; }

.duelkaart { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; width: 100%; padding: 12px; background: var(--wit); color: var(--inkt); border-radius: 6px; font-weight: 800; font-size: 17px; }
.duelkaart span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duelkaart span:last-child { text-align: right; }
.duelkaart b { font-weight: 900; font-size: 28px; color: var(--paars); }

.groot-rang { font-weight: 900; font-size: 92px; line-height: 1; }

.storing { position: fixed; left: 12px; right: 12px; bottom: calc(60px + env(safe-area-inset-bottom)); padding: 12px; border-radius: 6px; background: #b3122e; color: #fff; font-weight: 700; text-align: center; z-index: 10; }

@media (min-width: 620px) {
  .scherm { width: 100%; max-width: 560px; margin: 0 auto; }
}

@media (max-height: 620px) {
  .knop { gap: 6px; }
  .knop .vorm { width: 34px; height: 34px; }
}
