/* Vertel me wat nieuws: een gesprek op papier. Inkt, room en een rood stempel.
   De lettertypen staan in lettertypen.css en komen van de eigen server. */

:root {
  --papier: #f2eadb;
  --wit: #fffaf0;
  --inkt: #17130e;
  --dof: #6b6255;
  --lijn: rgba(23, 19, 14, 0.16);
  --stempel: #e2351b;
  /* Hoe minder mensen het zeiden, hoe feller. */
  --t0: #c9c1b3;
  --t1: #d8cfbe;
  --t2: #ecd592;
  --t3: #f3b254;
  --t4: #f08a3a;
  --t5: #ea5f2b;
  --t6: var(--stempel);
  --schrijf: "Fraunces", "Iowan Old Style", Georgia, serif;
  --lees: "Schibsted Grotesk", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  color: var(--inkt);
  font: 400 17px/1.45 var(--lees);
  background-color: var(--papier);
  background-image: radial-gradient(rgba(23, 19, 14, 0.07) 1px, transparent 1.4px);
  background-size: 18px 18px;
  overflow-x: hidden;
}

.aanhaling {
  position: fixed;
  bottom: -0.44em;
  left: -0.03em;
  z-index: 0;
  font: 900 italic min(78vw, 560px)/1 var(--schrijf);
  color: var(--inkt);
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
}

.kop, main, .voet, .uitleg-vast { position: relative; z-index: 1; width: 100%; max-width: 560px; }

.kop {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 22px 0 14px;
  border-bottom: 2px solid var(--inkt);
}

.merk {
  font: 800 clamp(21px, 6vw, 26px)/1 var(--schrijf);
  white-space: nowrap;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.02em;
  color: var(--inkt);
  text-decoration: none;
}

.merk em { font-style: italic; color: var(--stempel); }

.dag {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dof);
  font-variant-numeric: tabular-nums;
}

main { flex: 1; padding: 26px 0 40px; }

.voet {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 22px;
  border-top: 1px solid var(--lijn);
  font-size: 13px;
  color: var(--dof);
}

/* ------------------------------------------------------------ bouwstenen */

.groot {
  margin: 6px 0 14px;
  font: 800 clamp(38px, 11vw, 58px)/0.98 var(--schrijf);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.03em;
}

.groot em { font-style: italic; color: var(--stempel); }

.uitleg { margin: 0 0 22px; max-width: 30em; color: #3a332a; }

.label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dof);
}

.knop {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 2px solid var(--inkt);
  border-radius: 999px;
  background: var(--inkt);
  color: var(--wit);
  font: 700 17px/1 var(--lees);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--stempel);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.knop:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--stempel); }
.knop:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--stempel); }
.knop:focus-visible, .invoer:focus-visible { outline: 3px solid var(--stempel); outline-offset: 3px; }
.knop[disabled] { opacity: 0.45; cursor: default; transform: none; box-shadow: 4px 4px 0 var(--lijn); }

.knop.licht { background: var(--wit); color: var(--inkt); box-shadow: 4px 4px 0 var(--inkt); }

.wolk {
  position: relative;
  padding: 18px 20px;
  border: 2px solid var(--inkt);
  border-radius: 24px;
  background: var(--wit);
  box-shadow: 6px 6px 0 var(--inkt);
  animation: plop 0.32s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.wolk::after {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 30px;
  width: 18px;
  height: 18px;
  background: inherit;
  border-right: 2px solid var(--inkt);
  border-bottom: 2px solid var(--inkt);
  transform: rotate(45deg);
}

.wolk.jij {
  margin-left: auto;
  width: fit-content;
  max-width: 90%;
  background: var(--inkt);
  color: var(--wit);
  box-shadow: 6px 6px 0 var(--stempel);
}

.wolk.jij::after { left: auto; right: 30px; }

@keyframes plop {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------ opdracht */

.voortgang { display: flex; gap: 8px; margin-bottom: 18px; }

.stip {
  flex: 1;
  height: 12px;
  border: 2px solid var(--inkt);
  border-radius: 999px;
  background: var(--wit);
}

.stip.nu { background: var(--inkt); }
.stip.t0 { background: var(--t0); }
.stip.t1 { background: var(--t1); }
.stip.t2 { background: var(--t2); }
.stip.t3 { background: var(--t3); }
.stip.t4 { background: var(--t4); }
.stip.t5 { background: var(--t5); }
.stip.t6 { background: var(--t6); }

.vraag {
  margin: 0;
  font: 650 clamp(27px, 7.4vw, 38px)/1.08 var(--schrijf);
  font-variation-settings: "SOFT" 60, "WONK" 0;
  letter-spacing: -0.02em;
}

.klok { display: flex; align-items: center; gap: 12px; margin: 26px 0 12px; }

.klok .baan {
  flex: 1;
  height: 10px;
  border: 2px solid var(--inkt);
  border-radius: 999px;
  background: var(--wit);
  overflow: hidden;
}

.klok .vulling { height: 100%; width: 100%; background: var(--inkt); transform-origin: left; }
.klok.krap .vulling { background: var(--stempel); }

.klok .tel {
  display: inline-block;
  min-width: 2.2em;
  text-align: right;
  font: 800 22px/1 var(--schrijf);
  font-variant-numeric: tabular-nums;
}

.zeg { display: flex; gap: 10px; }

.invoer {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 18px;
  border: 2px solid var(--inkt);
  border-radius: 999px;
  background: var(--wit);
  color: var(--inkt);
  font: 600 19px/1 var(--lees);
}

.invoer::placeholder { color: #a39a8b; font-weight: 400; }

.melding {
  min-height: 1.5em;
  margin: 12px 4px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--stempel);
}

.melding.denkt { color: var(--dof); font-style: italic; }

.melding.schud { animation: schud 0.3s ease; }

@keyframes schud {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ------------------------------------------------------------ oordeel */

.oordeel { margin-top: 26px; display: grid; gap: 22px; }

.wolk.jij .gezegd {
  font: 700 clamp(24px, 6.4vw, 32px)/1.1 var(--schrijf);
  letter-spacing: -0.01em;
}

.kaart {
  position: relative;
  padding: 22px 20px 20px;
  border: 2px solid var(--inkt);
  border-radius: 20px;
  background: var(--wit);
  animation: plop 0.32s 0.12s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.kaart .weetje { margin: 0 0 14px; font: 500 italic 19px/1.3 var(--schrijf); }
.kaart .telling { margin: 0; color: #3a332a; }
.kaart .telling b { font-weight: 800; }

.stempel {
  display: inline-block;
  margin: 0 0 16px;
  padding: 7px 14px 8px;
  border: 3px solid var(--inkt);
  border-radius: 10px;
  background: var(--t1);
  font: 900 20px/1 var(--schrijf);
  font-variation-settings: "SOFT" 0, "WONK" 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  transform: rotate(-3deg);
  animation: stempel 0.42s 0.15s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.stempel.t0 { background: var(--t0); }
.stempel.t2 { background: var(--t2); }
.stempel.t3 { background: var(--t3); }
.stempel.t4 { background: var(--t4); }
.stempel.t5 { background: var(--t5); color: var(--wit); }
.stempel.t6 {
  background: var(--stempel);
  color: var(--wit);
  font-size: 26px;
  margin: 8px 0 26px 6px;
  box-shadow: 0 0 0 3px var(--wit), 0 0 0 6px var(--stempel);
  transform: rotate(-5deg);
}

@keyframes stempel {
  from { opacity: 0; transform: rotate(-16deg) scale(2.3); }
  to { opacity: 1; }
}

.punten {
  white-space: nowrap;
  font: 900 40px/1 var(--schrijf);
  font-variant-numeric: tabular-nums;
}

.punten small { font: 700 12px/1 var(--lees); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dof); }

.verder { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ------------------------------------------------------------ einde */

.totaal { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; }

.totaal .som {
  font: 900 clamp(64px, 19vw, 104px)/0.9 var(--schrijf);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.totaal .van { font: 600 20px/1 var(--schrijf); color: var(--dof); }

.lijst { list-style: none; margin: 22px 0; padding: 0; border-top: 2px solid var(--inkt); }

.lijst li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 4px 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--lijn);
  animation: plop 0.3s both;
}

.lijst li:nth-child(2) { animation-delay: 0.06s; }
.lijst li:nth-child(3) { animation-delay: 0.12s; }
.lijst li:nth-child(4) { animation-delay: 0.18s; }
.lijst li:nth-child(5) { animation-delay: 0.24s; }

.lijst .blok { width: 14px; height: 14px; border: 2px solid var(--inkt); border-radius: 4px; background: var(--t0); }
.lijst .blok.t1 { background: var(--t1); }
.lijst .blok.t2 { background: var(--t2); }
.lijst .blok.t3 { background: var(--t3); }
.lijst .blok.t4 { background: var(--t4); }
.lijst .blok.t5 { background: var(--t5); }
.lijst .blok.t6 { background: var(--t6); }

.lijst .wat { min-width: 0; }
.lijst .wat b { display: block; font: 700 20px/1.15 var(--schrijf); overflow-wrap: anywhere; }
.lijst .wat span { font-size: 13.5px; color: var(--dof); }
.lijst .pt { font: 800 22px/1 var(--schrijf); font-variant-numeric: tabular-nums; }
.lijst .top { grid-column: 2 / -1; font-size: 13.5px; color: var(--dof); }

.acties { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 8px; }
.acties .hint { font-size: 14px; color: var(--dof); }

.gisteren {
  margin: 0 0 26px;
  padding: 14px 16px;
  border: 2px dashed var(--inkt);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.7);
}

.gisteren p { margin: 0; }
.gisteren b { font: 800 22px/1 var(--schrijf); }

/* ------------------------------------------------------------ vaste uitleg */

/* De uitleg staat dichtgeklapt onderaan het startscherm: te vinden voor wie hem
   zoekt en voor zoekmachines, maar niet in de weg. Tijdens het spelen is hij weg. */
.uitleg-vast { padding: 4px 0 18px; }
.uitleg-vast summary {
  display: inline-block;
  padding: 10px 0;
  font-size: 14px;
  color: var(--dof);
  text-decoration: underline;
  cursor: pointer;
  list-style: none;
}
.uitleg-vast summary::-webkit-details-marker { display: none; }
.uitleg-vast summary:focus-visible { outline: 3px solid var(--stempel); outline-offset: 2px; }
.uitleg-vast h2 { margin: 10px 0 8px; font: 800 20px/1.15 var(--schrijf); }
.uitleg-vast h3 { margin: 16px 0 4px; font: 700 15.5px/1.3 var(--lees); }
.uitleg-vast p { margin: 0 0 8px; font-size: 15px; color: #3a332a; }
body[data-scherm]:not([data-scherm="start"]) .uitleg-vast { display: none; }

/* Tijdens een opdracht staan vraag, melding en invoerveld dicht op elkaar. */
body[data-scherm="opdracht"] .voortgang { margin-bottom: 12px; }
body[data-scherm="opdracht"] .klok { margin: 0 0 14px; }
body[data-scherm="opdracht"] .melding { min-height: 1.45em; margin: 18px 4px 8px; }

/* Op een telefoon telt dan alleen de opdracht: kop en voet verdwijnen, zodat alles
   boven het toetsenbord past. */
@media (max-width: 640px) {
  body[data-scherm="opdracht"] .kop,
  body[data-scherm="opdracht"] .voet,
  body[data-scherm="opdracht"] .aanhaling { display: none; }
  body[data-scherm="opdracht"] main { padding-top: 14px; }
  body[data-scherm="opdracht"] .wolk { padding: 14px 18px; }
  body[data-scherm="opdracht"] .vraag { font-size: clamp(22px, 6.2vw, 30px); }
}

/* ------------------------------------------------------------ toevoegingen */

.klein { margin: -12px 0 22px; max-width: 32em; font-size: 14px; color: var(--dof); }

.reeks {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 13px;
  border: 2px solid var(--inkt);
  border-radius: 999px;
  background: var(--t2);
  font-size: 14px;
  font-weight: 700;
}

.gisteren .regel { margin-top: 4px; font-size: 14px; color: var(--dof); }

.stil {
  appearance: none;
  /* Ruim raakvlak voor een vinger, zonder dat de regel hoger wordt. */
  padding: 13px 6px;
  margin: -13px -6px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.telling.echt { margin-top: 8px; font-size: 15px; color: var(--dof); }

/* Wat je miste: een zeldzaam antwoord dat ook goed was geweest. */
.ook {
  padding: 14px 18px;
  border: 2px dashed var(--inkt);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.75);
  animation: plop 0.32s 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.ook .label { display: block; margin: 0 0 4px; }
.ook-antwoord { margin: 0; font-size: 15px; color: #3a332a; }
.ook-antwoord b { font: 700 22px/1.2 var(--schrijf); color: var(--inkt); }

/* De kaart die je deelt: de haak in het groot, geen antwoorden. */
.deelkaart {
  margin: 8px 0 22px;
  padding: 22px 20px 18px;
  border: 2px solid var(--inkt);
  border-radius: 20px;
  background: var(--inkt);
  color: var(--wit);
  box-shadow: 6px 6px 0 var(--stempel);
  transform: rotate(-1deg);
  animation: plop 0.34s 0.3s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.deelkaart .haak { margin: 0 0 8px; font: 500 20px/1.25 var(--schrijf); }

.deelkaart .uitdaging {
  margin: 0 0 18px;
  font: 900 italic clamp(28px, 8vw, 36px)/1 var(--schrijf);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  color: var(--t3);
}

.deelscore {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 250, 240, 0.25);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vakjes { display: inline-flex; gap: 5px; }

.vak { width: 16px; height: 16px; border: 2px solid var(--wit); border-radius: 4px; background: var(--t0); }
.vak.t1 { background: var(--t1); }
.vak.t2 { background: var(--t2); }
.vak.t3 { background: var(--t3); }
.vak.t4 { background: var(--t4); }
.vak.t5 { background: var(--t5); }
.vak.t6 { background: var(--t6); }

/* De klap van het stempel: het hele speelveld schudt, harder bij een zeldzamer antwoord. */
@keyframes tril {
  20% { transform: translate(calc(var(--kracht) * -1), var(--kracht)); }
  40% { transform: translate(var(--kracht), calc(var(--kracht) * -0.6)); }
  60% { transform: translate(calc(var(--kracht) * -0.6), calc(var(--kracht) * 0.4)); }
  80% { transform: translate(calc(var(--kracht) * 0.4), 0); }
}

.tril-licht { --kracht: 2px; animation: tril 0.2s; }
.tril-flink { --kracht: 5px; animation: tril 0.28s; }
.tril-hard { --kracht: 9px; animation: tril 0.38s; }

.spat {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  animation: spat 0.7s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes spat {
  to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

.klok .tel.puls { animation: puls 0.3s ease; }

@keyframes puls {
  50% { transform: scale(1.4); color: var(--stempel); }
}

@media (prefers-reduced-motion: reduce) {
  .wolk, .kaart, .stempel, .lijst li, .melding.schud, .ook, .deelkaart, .klok .tel.puls { animation: none; }
  .knop { transition: none; }
}
