/* ==========================================================================
   Mietrechner auf /mieten/
   Zeitstrahl über sechs Monate: die gezahlte Miete wird zum Gutschein,
   der auf das Preisschild der eigenen Harmonika rutscht.
   Nutzt nur die Werte aus site.css (Farben, Schriften, Kurven).
   ========================================================================== */

.mr { display: grid; gap: clamp(30px, 3.6vw, 52px); }

/* ---------- Kopf: nutzt .s-kopf aus bausteine.css ---------- */
.mr .mr-kopf { margin-bottom: 0; }

/* ---------- Bühne: das Brett aus Holz ---------- */
.mr-buehne {
  --papier-schild: #f6e6bf;
  --papier-schild-2: #ead197;
  --tinte-schild: #3a2818;
  --tinte-schild-2: #6a4b2c;
  position: relative; isolation: isolate;
  padding: clamp(22px, 3.4vw, 52px);
  border-radius: 24px;
  color: var(--hell);
  background: var(--holz-tief) url("../img/holz-bahn-klein.webp") center top / max(100%, 1100px) auto repeat-y;
  box-shadow: 0 2px 4px rgba(23,17,13,.12), 0 40px 80px -46px rgba(10,6,4,.85);
}
.mr-buehne::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(130% 90% at 18% 0%, rgba(23,17,13,.42), rgba(14,9,6,.82) 70%); box-shadow: inset 0 0 0 1px rgba(246,239,226,.06); }

/* Kleine Überschriften auf dem Brett und auf dem Schild */
.mr-marke, .mr-frage { display: block; font-family: var(--display); font-weight: 800; font-size: 16px; line-height: 1.1; letter-spacing: .12em; text-transform: uppercase; }

/* Ohne JavaScript: Hinweis, dass hier ein Beispiel steht */
.mr-beispiel { display: inline-block; margin: 0 0 clamp(22px, 2.6vw, 34px); padding: .5em .9em .44em; border-radius: 6px; background: rgba(246,239,226,.1); box-shadow: inset 0 0 0 1px rgba(246,239,226,.2); font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; color: var(--hell); }
.mr-beispiel[hidden], .mr-steuer[hidden] { display: none; }

/* ---------- Eingaben ---------- */
.mr-steuer { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; padding-bottom: clamp(26px, 3vw, 40px); margin-bottom: clamp(26px, 3vw, 40px); border-bottom: 1px solid rgba(246,239,226,.16); }
@media (min-width: 900px) { .mr-steuer { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 4vw, 64px); align-items: start; } }
.mr-dauer { margin: 0; padding: 0; border: 0; min-width: 0; }
.mr-frage { margin: 0 0 14px; padding: 0; color: var(--hell); }

.mr-wahl { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mr-wahl input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.mr-wahl label { position: relative; display: grid; align-content: center; gap: 4px; min-height: 84px; padding: 14px 44px 14px 18px; border-radius: 14px; background: rgba(246,239,226,.05); box-shadow: inset 0 0 0 2px rgba(246,239,226,.3); cursor: pointer; transition: background-color .25s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease); -webkit-tap-highlight-color: transparent; }
.mr-wahl label b { font-family: var(--display); font-weight: 900; font-size: clamp(26px, 2.2vw, 32px); line-height: .95; text-transform: uppercase; }
.mr-wahl label span { font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--hell-2); }
/* Häkchen in der Ecke */
.mr-wahl label::after { content: ""; position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(246,239,226,.36); transition: background-color .25s var(--ease), box-shadow .25s var(--ease); }
.mr-wahl input:checked + label { background: linear-gradient(180deg, var(--gruen), var(--gruen-tief)); box-shadow: inset 0 0 0 2px var(--gruen-licht), 0 14px 26px -16px rgba(0,0,0,.8); }
.mr-wahl input:checked + label span { color: var(--weiss); }
.mr-wahl input:checked + label::after { background: var(--weiss) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%234E6A17' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: none; }
.mr-wahl input:focus-visible + label { outline: 3px solid var(--hell); outline-offset: 3px; }
.mr-wahl label:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .mr-wahl input:not(:checked) + label:hover { background: rgba(246,239,226,.1); box-shadow: inset 0 0 0 2px rgba(246,239,226,.6); } }

/* Schieberegler für den Preis */
.mr-regler-kopf { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0 16px; }
.mr-wunsch { margin-top: -.18em; font-family: var(--display); font-weight: 900; font-size: clamp(36px, 3.4vw, 48px); line-height: 1; color: var(--weiss); font-variant-numeric: tabular-nums; }
.mr-schieber { --p: .3194; display: block; width: 100%; height: 48px; margin: 6px 0 0; padding: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.mr-schieber:focus { outline: none; }
.mr-schieber:focus-visible { outline: 3px solid var(--hell); outline-offset: 4px; border-radius: 10px; }
.mr-schieber::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--gruen-licht), var(--gruen)) 0 0 / calc(17px + (100% - 34px) * var(--p)) 100% no-repeat, rgba(246,239,226,.2); }
.mr-schieber::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 34px; height: 34px; margin-top: -12px; border: 0; border-radius: 50%; background: var(--hell); box-shadow: 0 0 0 5px var(--gruen), 0 8px 16px rgba(0,0,0,.5); transition: transform .2s var(--ease); }
.mr-schieber:active::-webkit-slider-thumb { transform: scale(1.1); }
.mr-schieber::-moz-range-track { height: 10px; border-radius: 5px; background: rgba(246,239,226,.2); }
.mr-schieber::-moz-range-progress { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--gruen-licht), var(--gruen)); }
.mr-schieber::-moz-range-thumb { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--hell); box-shadow: 0 0 0 5px var(--gruen), 0 8px 16px rgba(0,0,0,.5); }
.mr-skala { display: flex; justify-content: space-between; margin-top: 2px; font-size: 15px; font-weight: 700; color: var(--hell-2); font-variant-numeric: tabular-nums; }
.mr-hilfe { margin: 10px 0 0; font-size: 15px; line-height: 1.45; color: var(--hell-2); }

/* ---------- Geschichte: Zeitstrahl, halbe Miete, Preisschild ---------- */
.mr-geschichte { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: stretch; gap: 18px; }
@media (min-width: 1080px) {
  .mr-geschichte { grid-template-columns: minmax(0, 1.1fr) auto minmax(330px, .9fr); align-items: center; gap: clamp(18px, 2vw, 32px); }
}

/* Zeitstrahl */
.mr-summe { margin: 0 0 16px; }
.mr-summe .mr-marke { color: var(--gruen-licht); margin-bottom: 6px; }
.mr-summe b { display: block; font-family: var(--display); font-weight: 900; font-size: clamp(52px, 5.4vw, 80px); line-height: .9; font-variant-numeric: tabular-nums; }
.mr-strahl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
.mr-monate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(5px, .6vw, 8px); }
.mr-monat { --d: 0ms; position: relative; isolation: isolate; overflow: hidden; display: grid; place-content: center; justify-items: center; gap: 2px; height: clamp(66px, 6.2vw, 92px); border-radius: 10px; color: rgba(246,239,226,.62); transition: color .3s var(--ease) var(--d); }
.mr-monat::after { content: ""; position: absolute; inset: 0; border: 2px dashed rgba(246,239,226,.34); border-radius: inherit; transition: opacity .3s var(--ease) var(--d); }
.mr-monat::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #74992A, var(--gruen-tief)); box-shadow: inset 0 1px 0 rgba(255,255,255,.22); transform: scaleX(0); transform-origin: left center; transition: transform .34s var(--ease) var(--d); }
.mr-monat.ist-voll { color: var(--weiss); }
.mr-monat.ist-voll::before { transform: none; }
.mr-monat.ist-voll::after { opacity: 0; }
.mr-monat b { font-family: var(--display); font-weight: 900; font-size: clamp(26px, 2.4vw, 34px); line-height: 1; }
.mr-monat small { font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap; }
.mr-block-text { margin: 12px 0 0; padding-top: 10px; border-top: 2px solid var(--gruen-licht); line-height: 1.2; transition: border-color .3s var(--ease); }
.mr-block-text b { display: block; font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; }
.mr-block-text span { display: block; margin-top: 3px; font-size: 15px; color: var(--hell-2); }
.mr-block--extra:not(.ist-aktiv) .mr-block-text { border-top-style: dashed; border-top-color: rgba(246,239,226,.34); }

/* Die halbe Miete: Stempel mit Pfeil */
.mr-halbe { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gruen-licht); }
.mr-stempel { display: grid; place-content: center; justify-items: center; width: 92px; height: 92px; border-radius: 50%; border: 2px dashed currentColor; text-align: center; transform: rotate(-8deg); }
.mr-stempel b { font-family: var(--display); font-weight: 900; font-size: 30px; line-height: .9; }
.mr-stempel small { font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.mr-halbe .pfeil { width: 30px; height: 30px; }
@media (max-width: 1079px) {
  .mr-halbe { flex-direction: column; gap: 4px; margin-top: 4px; }
  .mr-halbe .pfeil { transform: rotate(90deg); }
}

/* ---------- Preisschild: Papier-Anhänger am Nagel ---------- */
.mr-ziel { position: relative; display: grid; justify-items: center; padding-top: 46px; }
.mr-schild { --nagel: 46px; --rand-schild: clamp(20px, 2.2vw, 28px); position: relative; display: grid; justify-items: center; width: min(100%, 340px); padding: 66px var(--rand-schild) 30px; color: var(--tinte-schild); text-align: center; rotate: -2deg; transform-origin: 50% calc(var(--nagel) * -1); }
/* Faden zum Nagel */
.mr-schild::before { content: ""; position: absolute; left: 50%; top: calc(var(--nagel) * -1); width: 2px; height: calc(var(--nagel) + 30px); margin-left: -1px; background: linear-gradient(180deg, #d9c39a, #b89d6c); border-radius: 1px; z-index: 1; }
/* Nagelkopf */
.mr-schild::after { content: ""; position: absolute; left: 50%; top: calc(var(--nagel) * -1 - 7px); width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f2ede4, #9b948a 45%, #4a443d 100%); box-shadow: 0 3px 4px rgba(0,0,0,.55); z-index: 2; }
.mr-schild-papier { position: absolute; inset: 0; z-index: -1; filter: drop-shadow(0 22px 22px rgba(0,0,0,.5)) drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.mr-schild-papier::before { content: ""; position: absolute; inset: 0; border-radius: 4px 4px 12px 12px; background: var(--koerner, none) 0 0 / 180px 180px, linear-gradient(180deg, var(--papier-schild), var(--papier-schild-2)); background-blend-mode: soft-light, normal; clip-path: polygon(34px 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%, 0 34px); }
/* gestanztes Loch mit Verstärkungsring */
.mr-schild-papier::after { content: ""; position: absolute; left: 50%; top: 22px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #2a1d14; box-shadow: 0 0 0 5px rgba(58,40,24,.12), inset 0 2px 3px rgba(0,0,0,.6); }
.mr-schild .mr-marke { color: var(--tinte-schild-2); font-size: 15px; }
.mr-alt { margin: 0; }
.mr-alt s { position: relative; display: inline-block; margin-top: 4px; font-family: var(--display); font-weight: 900; font-size: clamp(32px, 2.8vw, 40px); line-height: 1; text-decoration: none; color: rgba(58,40,24,.62); font-variant-numeric: tabular-nums; }
/* Strich wie mit dem Stift */
.mr-alt s::after { content: ""; position: absolute; left: -8%; right: -8%; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--tinte-schild); transform: rotate(-9deg); transform-origin: left center; transition: transform .32s var(--ease); }
.mr-neu { margin: 0; }
.mr-neu b { display: block; margin-top: 6px; font-family: var(--display); font-weight: 900; font-size: clamp(64px, 6.4vw, 92px); line-height: .86; letter-spacing: -.005em; color: var(--tinte-schild); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Gutschein zum Abreißen ---------- */
/* Im Ruhezustand klebt er quer über dem Schild, zwischen altem und neuem Preis. */
.mr-gutschein { position: relative; z-index: 3; justify-self: stretch; margin: 18px calc(-1 * (var(--rand-schild) + 18px)) 22px; rotate: -4deg; filter: drop-shadow(0 12px 14px rgba(0,0,0,.42)); }
.mr-gutschein-papier { margin: 0; }
.mr-gutschein-papier {
  --stub: 46px;
  display: grid; grid-template-columns: var(--stub) minmax(0, 1fr); align-items: stretch;
  min-height: 104px; color: var(--weiss); text-align: left;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,.16), rgba(255,255,255,0) 55%), linear-gradient(135deg, var(--gruen-tief), var(--gruen-dunkel));
  border-radius: 8px;
  /* Kerben oben und unten an der Perforation */
  -webkit-mask: radial-gradient(circle 9px at var(--stub) 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle 9px at var(--stub) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle 9px at var(--stub) 0, #0000 97%, #000) top / 100% 51% no-repeat, radial-gradient(circle 9px at var(--stub) 100%, #0000 97%, #000) bottom / 100% 51% no-repeat;
  /* Abrisskante links */
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 6px 93.75%, 0 87.5%, 6px 81.25%, 0 75%, 6px 68.75%, 0 62.5%, 6px 56.25%, 0 50%, 6px 43.75%, 0 37.5%, 6px 31.25%, 0 25%, 6px 18.75%, 0 12.5%, 6px 6.25%);
}
.mr-gutschein-stub { display: grid; place-items: center; writing-mode: vertical-rl; transform: rotate(180deg); padding-left: 4px; font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.92); }
.mr-gutschein-text { display: grid; align-content: center; gap: 2px; padding: 12px 18px 12px 18px; border-left: 2px dashed rgba(255,255,255,.5); }
.mr-gutschein-text .mr-marke { font-size: 14px; color: rgba(255,255,255,.94); }
.mr-gutschein-text b { font-family: var(--display); font-weight: 900; font-size: clamp(40px, 3.6vw, 50px); line-height: .92; font-variant-numeric: tabular-nums; }
.mr-gutschein-text small { font-size: 15px; font-weight: 600; line-height: 1.2; color: rgba(255,255,255,.94); }

/* ---------- Fuß: Kleingedrucktes und Knopf ---------- */
.mr-fuss { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.mr-klein { margin: 0; max-width: 72ch; font-size: 16px; color: var(--tinte-2); }

/* ---------- Zustände für die Einblendung (nur mit JavaScript) ---------- */
.mr--vor .mr-gutschein { opacity: 0; }
.mr--ohne-ergebnis .mr-alt s::after { transform: rotate(-9deg) scaleX(0); }
.mr-neu { transition: opacity .4s var(--ease), transform .5s var(--ease); }
.mr--ohne-ergebnis .mr-neu { opacity: 0; transform: translateY(10px); }
.mr-stempel { transition: opacity .3s var(--ease), transform .45s var(--ease-feder); }
.mr--vor .mr-stempel { opacity: .4; }
.mr-stempel.ist-dran { transform: rotate(-8deg) scale(1.12); }

@media (prefers-reduced-motion: reduce) {
  .mr-monat, .mr-monat::before, .mr-monat::after, .mr-neu, .mr-stempel, .mr-alt s::after, .mr-wahl label, .mr-block-text { transition: none; }
}
.ruhig .mr-monat, .ruhig .mr-monat::before, .ruhig .mr-monat::after { transition: none; }

/* ---------- Handy ---------- */
@media (max-width: 560px) {
  .mr-buehne { border-radius: 18px; margin-inline: calc(var(--rand) * -.4); }
  .mr-wahl label { min-height: 78px; padding: 12px 34px 12px 14px; }
  .mr-wahl label::after { top: 10px; right: 10px; width: 20px; height: 20px; }
  .mr-wahl label span { font-size: 14px; }
  .mr-block-text b { font-size: 15px; letter-spacing: .04em; }
  .mr-block-text span { font-size: 14px; }
  .mr-monat small { font-size: 13px !important; font-size: 12px; }
  .mr-schild { width: min(100%, 290px); }
  .mr-geschichte { gap: 12px; }
  .mr-stempel { width: 80px; height: 80px; }
  .mr-stempel b { font-size: 26px; }
  .mr-ziel { padding-top: 58px; }
  .mr-fuss .knopf { width: 100%; }
}
/* „Gutschein“ genau mittig im Abriss: Zacken links und Sperrung am Wortende ausgleichen */
.mr-gutschein-stub { padding: 0 6px 0 0; padding-inline-start: .22em; }
