.instellingen { padding: 0 16px 48px; }
.instellingen .titel { margin-top: 9vh; }

.terug {
  position: absolute;
  top: 18px;
  left: 18px;
  color: var(--stil);
  text-decoration: none;
  font-size: 0.85rem;
  z-index: 2;
}
.terug:hover, .terug:focus-visible { color: var(--perkament); outline: none; }

.inleiding {
  max-width: 34rem;
  margin: 0.6rem auto 1.6rem;
  text-align: center;
  color: var(--stil);
  font-size: 0.85rem;
  position: relative;
  z-index: 2;
}

.paneel {
  position: relative;
  z-index: 2;
  width: min(100%, 30rem);
  display: grid;
  gap: 14px;
}

.paneel fieldset {
  margin: 0;
  padding: 14px 16px 12px;
  border: 1px solid var(--hout-rand);
  background: rgba(38, 34, 30, 0.55);
}

.paneel legend {
  padding: 0 6px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.2rem;
}

.paneel input[type="range"] { width: 100%; accent-color: var(--dwaallicht); }

.schaal {
  display: flex;
  justify-content: space-between;
  color: #4a524e;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.waarde { margin: 6px 0 0; font-size: 0.9rem; }
.hint { margin: 6px 0 0; color: var(--stil); font-size: 0.78rem; }

.paneel details { margin-top: 8px; }
.paneel summary { cursor: pointer; color: var(--stil); font-size: 0.8rem; }
.paneel details label { display: inline-flex; gap: 6px; align-items: center; margin: 8px 12px 0 0; font-size: 0.82rem; }
.paneel input[type="number"] {
  width: 5.5rem;
  background: var(--nacht);
  color: var(--perkament);
  border: 1px solid var(--hout-rand);
  padding: 6px 8px;
  font: inherit;
}

.keuzes { display: flex; flex-wrap: wrap; gap: 8px; }
.keuzes label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--hout-rand);
  cursor: pointer;
  font-size: 0.85rem;
}
.keuzes input { accent-color: var(--dwaallicht); }
.keuzes label:has(input:checked) { border-color: var(--dwaallicht); color: var(--perkament); }
.keuzes .uitleg { color: var(--stil); font-size: 0.75rem; }

.onderaan { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.onderaan button {
  min-height: 40px;
  padding: 8px 14px;
  background: transparent;
  color: var(--stil);
  border: 1px solid var(--hout-rand);
  font: inherit;
  cursor: pointer;
}
.onderaan button:hover, .onderaan button:focus-visible { color: var(--perkament); border-color: var(--stil); outline: none; }
.status { color: var(--dwaallicht); font-size: 0.8rem; opacity: 0.8; }

/* Instellingen als inschuifpaneel in een tocht en op het plein: de wereld blijft zichtbaar en loopt door */
.inst-overlay {
  --nacht: #070a09;
  --hout-rand: #3a3530;
  --perkament: #e8e6de;
  --stil: #8a938e;
  --dwaallicht: #8bd8a3;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  background: rgba(7, 10, 9, 0.35);
  touch-action: auto;
  user-select: text;
  -webkit-user-select: text;
}

.inst-kader {
  width: min(100%, 26rem);
  height: 100%;
  overflow-y: auto;
  padding: 1.25rem 1rem 2rem;
  background: rgba(10, 14, 13, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 1px solid var(--hout-rand);
  color: var(--perkament);
  animation: instIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.inst-kop {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inst-kop h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  font-size: 1.6rem;
}

.inst-uitleg {
  margin: 0.3rem 0 1rem;
  color: var(--stil);
  font-size: 0.8rem;
}

.inst-overlay .paneel { width: 100%; }

@keyframes instIn {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

/* Op het plein schuift het paneel in en uit in plaats van te verschijnen */
.inst-plein {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s;
  background: rgba(7, 10, 9, 0.2);
}
.inst-plein.open { opacity: 1; visibility: visible; pointer-events: auto; }
.inst-plein .inst-kader { animation: none; transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1); }
.inst-plein.open .inst-kader { transform: translateX(0); }
.inst-plein .btn-icon { background: transparent; border: 1px solid var(--hout-rand); color: var(--stil); width: 36px; height: 36px; cursor: pointer; display: grid; place-items: center; }
.inst-plein .btn-icon:hover, .inst-plein .btn-icon:focus-visible { color: var(--perkament); border-color: var(--stil); outline: none; }
@media (prefers-reduced-motion: reduce) {
  .inst-plein, .inst-plein .inst-kader { transition: none; }
}
