/* ==========================================================================
   MWW Datadrift - vrolijke Lego-look voor digibord en tablet
   ========================================================================== */

:root {
  --rood: #e3000f;
  --blauw: #0057b8;
  --geel: #ffd400;
  --groen: #00a94f;
  --oranje: #ff7a00;
  --paars: #7b2ff7;
  --donker: #1b2a41;
  --licht: #f6f9ff;
  --grijs: #c8d2e0;
  --radius: 18px;
  --schaduw: 0 6px 0 rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Trebuchet MS", "Comic Sans MS", Verdana, sans-serif;
  font-size: 20px;
  line-height: 1.45;
  color: var(--donker);
  background: var(--licht)
    radial-gradient(circle at 12% 8%, rgba(255, 212, 0, 0.35), transparent 40%),
    radial-gradient(circle at 88% 12%, rgba(0, 87, 184, 0.25), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

h1,
h2,
h3 {
  margin: 0 0 12px;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

h2 {
  font-size: clamp(1.4rem, 2.6vw, 2.2rem);
}

p {
  margin: 0 0 14px;
}

.center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* --- Kop met logo ------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 12px 6px;
  flex-wrap: wrap;
}

.logo {
  font-weight: bold;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  color: var(--blauw);
}

.logo span {
  color: var(--rood);
}

/* --- Kaarten ------------------------------------------------------------ */
.card {
  background: #fff;
  border: 4px solid var(--donker);
  border-radius: var(--radius);
  box-shadow: var(--schaduw);
  padding: 22px;
  margin: 0 0 22px;
}

.card--geel {
  background: #fff9d9;
}

.card--blauw {
  background: #e6f0ff;
}

/* --- Knoppen ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 26px;
  font: inherit;
  font-weight: bold;
  font-size: 1.1em;
  color: #fff;
  background: var(--blauw);
  border: 3px solid var(--donker);
  border-radius: 14px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.btn:focus-visible {
  outline: 4px solid var(--paars);
  outline-offset: 3px;
}

.btn--groot {
  min-height: 92px;
  font-size: 1.4em;
  padding: 18px 34px;
}

.btn--groen {
  background: var(--groen);
}

.btn--rood {
  background: var(--rood);
}

.btn--geel {
  background: var(--geel);
  color: var(--donker);
}

.btn--grijs {
  background: #6b7a90;
}

.btn[disabled] {
  background: var(--grijs);
  color: #5a6678;
  cursor: not-allowed;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.12);
}

.keuzes {
  display: flex;
  flex-wrap: wrap;
  gap: 26px;
  justify-content: center;
  margin-top: 28px;
}

.keuze {
  flex: 1 1 320px;
  max-width: 440px;
  text-align: center;
}

.keuze .emoji {
  font-size: 4rem;
  display: block;
}

/* --- Formulieren -------------------------------------------------------- */
label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
}

textarea,
input[type="text"],
input[type="tel"] {
  width: 100%;
  font: inherit;
  padding: 14px;
  border: 3px solid var(--donker);
  border-radius: 12px;
  background: #fff;
}

textarea {
  min-height: 240px;
  resize: vertical;
}

.pin-input {
  font-size: clamp(2rem, 8vw, 3.4rem);
  text-align: center;
  letter-spacing: 0.3em;
  font-weight: bold;
}

.hint-tekst {
  font-size: 0.85em;
  background: #fff4c2;
  border-left: 8px solid var(--geel);
  padding: 10px 14px;
  border-radius: 8px;
}

/* --- Meldingen ---------------------------------------------------------- */
.melding {
  margin: 12px 0;
  padding: 14px 18px;
  border-radius: 12px;
  border: 3px solid var(--donker);
  font-weight: bold;
}

.melding--fout {
  background: #ffe0e0;
  color: #8a0011;
}

.melding--ok {
  background: #dcf8e4;
  color: #10562c;
}

/* --- Pincode groot op het digibord -------------------------------------- */
.pincode {
  font-size: clamp(4rem, 16vw, 11rem);
  font-weight: bold;
  letter-spacing: 0.12em;
  color: var(--blauw);
  background: #fff;
  border: 6px dashed var(--blauw);
  border-radius: 24px;
  padding: 10px 24px;
  display: inline-block;
}

/* --- Lijst met groepjes ------------------------------------------------- */
.teamlijst {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.teamlijst li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 3px solid var(--donker);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

.teamlijst .team-emoji {
  font-size: 2rem;
}

.teamlijst .team-naam {
  font-weight: bold;
  flex: 1;
}

.teamlijst .team-status {
  font-size: 0.8em;
  white-space: nowrap;
}

.teller {
  font-size: 1.2em;
  font-weight: bold;
}

/* --- Lego-blokjes ------------------------------------------------------- */
.blokjes {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
  min-height: 120px;
  padding: 10px;
}

.blokje {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: min(560px, 90vw);
  padding: 16px 22px;
  margin-top: 16px;
  color: #fff;
  font-weight: bold;
  font-size: clamp(1rem, 2vw, 1.5rem);
  border: 4px solid rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.18);
}

/* De "noppen" bovenop elk blokje. */
.blokje::before,
.blokje::after {
  content: "";
  position: absolute;
  top: -16px;
  width: 42px;
  height: 16px;
  background: inherit;
  border: 4px solid rgba(0, 0, 0, 0.35);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.blokje::before {
  left: 26px;
}

.blokje::after {
  right: 26px;
}

.blokje .blok-emoji {
  font-size: 1.8em;
}

.blokje .blok-label {
  opacity: 0.9;
  font-size: 0.8em;
  display: block;
}

.blokje .blok-waarde {
  font-size: 1.15em;
}

/* Level 1 en level 2 zijn visueel verschillend. */
.blokje--l1 {
  background: var(--blauw);
}

.blokje--l1:nth-child(even) {
  background: var(--groen);
}

.blokje--l2 {
  background: var(--rood);
  border-style: double;
}

.blokje--l2:nth-child(even) {
  background: var(--paars);
}

.blokje--nieuw {
  animation: vallen 0.8s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes vallen {
  0% {
    transform: translateY(-70vh) rotate(-6deg);
    opacity: 0;
  }
  70% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  85% {
    transform: translateY(-14px);
  }
  100% {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blokje--nieuw {
    animation: none;
  }
}

/* --- Het geheime personage ---------------------------------------------- */
.personage {
  text-align: center;
  padding: 10px;
}

.personage .figuur {
  font-size: clamp(5rem, 14vw, 10rem);
  filter: grayscale(1) contrast(0.4);
  transition: filter 0.6s ease;
}

.personage--onthuld .figuur {
  filter: none;
  animation: wiebel 0.7s ease 2;
}

.personage .naam {
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  font-weight: bold;
  color: var(--rood);
}

@keyframes wiebel {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-7deg);
  }
  75% {
    transform: rotate(7deg);
  }
}

.speelveld {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 380px);
  gap: 20px;
  align-items: start;
}

@media (max-width: 860px) {
  .speelveld {
    grid-template-columns: 1fr;
  }
}

/* --- Leerlingenlijst met antwoordknoppen -------------------------------- */
.leerlingen {
  display: grid;
  gap: 16px;
}

.leerling {
  background: #fff;
  border: 3px solid var(--donker);
  border-radius: 14px;
  padding: 14px;
}

.leerling h3 {
  margin: 0 0 10px;
  font-size: 1.2em;
}

.opties {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.optie {
  min-height: 56px;
  padding: 10px 18px;
  font: inherit;
  font-weight: bold;
  background: #fff;
  border: 3px solid var(--blauw);
  border-radius: 12px;
  color: var(--blauw);
  cursor: pointer;
}

.optie[aria-pressed="true"] {
  background: var(--blauw);
  color: #fff;
  box-shadow: 0 0 0 4px var(--geel);
}

.optie[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.voortgang {
  font-weight: bold;
  font-size: 1.1em;
  margin: 12px 0;
}

.knoppenrij {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

/* --- Raadscherm op de tablet -------------------------------------------- */
.kansen {
  font-size: 1.4em;
  font-weight: bold;
  color: var(--rood);
}

.winnaars {
  list-style: none;
  margin: 0;
  padding: 0;
}

.winnaars li {
  font-weight: bold;
  padding: 6px 0;
}

/* --- Confetti ----------------------------------------------------------- */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.confetti i {
  position: absolute;
  top: -20px;
  width: 14px;
  height: 22px;
  border-radius: 3px;
  animation: confetti-val linear forwards;
}

@keyframes confetti-val {
  to {
    transform: translateY(105vh) rotate(720deg);
  }
}

.succes {
  font-size: clamp(1.4rem, 5vw, 2.6rem);
  font-weight: bold;
  color: var(--groen);
}

footer {
  text-align: center;
  font-size: 0.8em;
  color: #5a6678;
  padding: 20px;
}
