/* RTW Mitte: Bühne und Bedienelemente des 3D-Modells */
.r3 {
  position: relative; overflow: hidden; isolation: isolate;
  height: min(100svh - 4px, 1100px); min-height: 560px;
  background: linear-gradient(180deg, #cfdfec 0%, #eef1f2 46%, #e9e6df 100%);
  color: #15181c;
}
.r3-leinwand { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s ease; cursor: grab; }
.r3-bereit .r3-leinwand { opacity: 1; }
.r3-frei-modus .r3-leinwand:active { cursor: grabbing; }
.r3-hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.r3-hud > * { pointer-events: auto; }
.r3-marken { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* Glasflächen */
.r3-glas, .r3-titel, .r3-info, .r3-kapitel {
  /* bewusst ohne Unschärfe: ein Weichzeichner über dem laufenden 3D-Bild kostet in jedem Bild Rechenzeit */
  background: linear-gradient(180deg, rgba(255, 255, 255, .93), rgba(250, 250, 249, .88));
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 18px 50px -18px rgba(21, 24, 28, .35), 0 2px 8px rgba(21, 24, 28, .06);
}

/* Titel oben links */
.r3-titel { position: absolute; z-index: 3; left: clamp(16px, 3vw, 44px); top: clamp(16px, 3vw, 40px); max-width: calc(100% - 32px); padding: clamp(18px, 2vw, 28px) clamp(20px, 2.4vw, 34px); border-radius: 22px; }
.r3-titel .ueber { margin: 0 0 12px; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6b727b; }
.r3-titel h1 { margin: 0; font-size: clamp(32px, 3.5vw, 54px); line-height: 1; font-weight: 900; letter-spacing: -0.035em; }
.r3-titel h1 span { display: block; white-space: nowrap; }
.r3-titel h1 em { font-style: normal; color: #e30613; }
.r3-titel .unter { margin: 14px 0 0; font-size: clamp(14px, 1.35vw, 18px); color: #5b6168; letter-spacing: .01em; }

/* Karte zum aktuellen Bereich */
.r3-info { position: absolute; left: clamp(16px, 3vw, 44px); bottom: 104px; width: min(390px, calc(100% - 32px)); padding: 20px 22px 18px; border-radius: 20px; opacity: 0; transform: translateY(10px); }
.r3-info.an { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
.r3-frei-modus .r3-info { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.r3-info .r3-zeile { margin: 0 0 8px; display: flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: #6b727b; }
.r3-info .r3-zeile em { font-style: normal; letter-spacing: .06em; color: #fff; background: #15181c; border-radius: 999px; padding: 3px 9px; font-size: 10.5px; }
.r3-info h2 { margin: 0 0 8px; font-size: 25px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.r3-info p { margin: 0; font-size: 14.5px; line-height: 1.45; color: #3c4249; }
.r3-info .r3-klein { margin-top: 10px; font-size: 12.5px; color: #6b727b; }
.r3-info ul { margin: 12px 0 0; padding: 12px 0 0; list-style: none; border-top: 1px solid rgba(21, 24, 28, .1); display: grid; gap: 7px; }
.r3-info li { position: relative; padding-left: 16px; font-size: 13.5px; line-height: 1.35; color: #3c4249; }
.r3-info li::before { content: ""; position: absolute; left: 0; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: #e30613; }

/* Leiste mit den Bereichen */
.r3-kapitel { position: absolute; left: clamp(16px, 3vw, 44px); right: clamp(16px, 3vw, 44px); bottom: 34px; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 18px; }
.r3-kapitel ol { flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.r3-kapitel ol button { position: relative; overflow: hidden; width: 100%; height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 12px 0 8px; border: 0; border-radius: 12px; background: rgba(21, 24, 28, .055); color: #15181c; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; transition: background .2s; }
.r3-kapitel ol button:hover { background: rgba(21, 24, 28, .1); }
.r3-kapitel ol b { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 12.5px; font-weight: 800; box-shadow: 0 1px 2px rgba(21, 24, 28, .15); transition: background .2s, color .2s; }
.r3-kapitel ol span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.r3-kapitel ol i { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #e30613; transform: scaleX(0); transform-origin: left; }
.r3-kapitel ol button.aktiv { background: #15181c; color: #fff; }
.r3-kapitel ol button.aktiv b { background: #e30613; color: #fff; box-shadow: none; }
.r3-knopf { flex: none; height: 44px; border: 0; border-radius: 12px; padding: 0 16px; background: #15181c; color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s; white-space: nowrap; }
.r3-knopf:hover { background: #e30613; }
.r3-knopf.r3-spiel { width: 44px; padding: 0; }
.r3-knopf svg { width: 16px; height: 16px; fill: currentColor; }
.r3-kapitel button:focus-visible, .r3-knopf:focus-visible { outline: 2px solid #e30613; outline-offset: 2px; }

.r3-quelle { position: absolute; right: clamp(16px, 3vw, 44px); bottom: 9px; font-size: 11px; color: #5b6168; text-shadow: 0 0 6px #fff, 0 0 2px #fff; }
.r3-quelle a { color: inherit; }

/* Beschriftungen im Modell */
.r3-marke { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s .35s; will-change: transform; white-space: nowrap; font-size: 12.5px; line-height: 1; }
.r3-marke.an { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.r3-marke > * { display: inline-block; }
.r3-bereich { margin: -17px 0 0 -17px; display: flex; align-items: center; gap: 8px; }
.r3-bereich b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #e30613; color: #fff; font-size: 15px; font-weight: 800; box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 6px 16px rgba(21, 24, 28, .3); }
.r3-bereich span { padding: 7px 12px; border-radius: 999px; background: #15181c; color: #fff; font-weight: 700; font-size: 13px; box-shadow: 0 6px 16px rgba(21, 24, 28, .25); }
.r3-station { transform-origin: 0 0; padding: 6px 11px 6px 8px; margin: -13px 0 0 -13px; border-radius: 999px; background: rgba(255, 255, 255, .94); font-weight: 700; color: #15181c; box-shadow: 0 4px 14px rgba(21, 24, 28, .2); display: flex; align-items: center; gap: 7px; }
.r3-station i { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid #15181c; }
.r3-station.neu i { border-color: #e30613; }
.r3-bauwerk { margin-left: -1px; }
.r3-bauwerk span { position: relative; transform: translate(-50%, -100%); padding: 5px 9px; border-radius: 7px; background: rgba(21, 24, 28, .86); color: #fff; font-weight: 600; font-size: 12px; }
.r3-bauwerk::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 26px; background: rgba(21, 24, 28, .55); }
.r3-ort { transform-origin: 0 0; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: rgba(21, 24, 28, .5); text-shadow: 0 0 8px rgba(255, 255, 255, .95), 0 0 2px #fff; margin: -6px 0 0 0; }
.r3-ort.klein { font-size: 10.5px; letter-spacing: .12em; color: rgba(21, 24, 28, .42); }
.r3-richtung { padding: 5px 10px; margin: -12px 0 0 -8px; border-radius: 7px; background: rgba(255, 255, 255, .9); border: 1px solid rgba(21, 24, 28, .18); color: #3c4249; font-weight: 600; font-size: 12px; }
.r3-ort.wasser { color: #3f7193; font-style: italic; letter-spacing: .3em; }

.r3-pause { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); padding: 7px 13px; border-radius: 999px; background: rgba(21, 24, 28, .82); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; pointer-events: none; }
.r3-ruht .r3-pause { opacity: 1; visibility: visible; transition: opacity .3s ease; }

/* Ladeanzeige */
.r3-laden { position: absolute; z-index: 4; left: 50%; top: 56%; transform: translate(-50%, -50%); width: min(320px, 76%); text-align: center; font-size: 13px; font-weight: 600; color: #5b6168; transition: opacity .6s ease; }
.r3-laden .balken { height: 3px; border-radius: 3px; background: rgba(21, 24, 28, .12); overflow: hidden; margin-bottom: 12px; }
.r3-laden .balken i { display: block; height: 100%; width: 100%; background: #e30613; transform: scaleX(.04); transform-origin: left; transition: transform .5s ease; }
.r3-bereit .r3-laden { opacity: 0; pointer-events: none; }
.r3:not(.r3-bereit) .r3-hud { opacity: 0; }
.r3-hud { transition: opacity .8s ease .3s; }
.r3-ohne .r3-laden .balken { display: none; }

@media (max-width: 1180px) {
  .r3-kapitel ol button { padding: 0 8px; justify-content: center; }
  .r3-kapitel ol span { display: none; }
}
@media (max-width: 760px) {
  .r3 { height: calc(100svh - 4px); min-height: 520px; }
  .r3-titel { left: 12px; right: 12px; top: 12px; max-width: none; padding: 14px 16px; border-radius: 16px; }
  .r3-titel .ueber { font-size: 10px; margin-bottom: 8px; }
  .r3-titel h1 { font-size: clamp(24px, 7.6vw, 34px); }
  .r3-titel .unter { margin-top: 8px; font-size: 13px; }
  .r3-kapitel { left: 12px; right: 12px; bottom: 30px; gap: 6px; padding: 6px; border-radius: 16px; flex-wrap: wrap; }
  .r3-kapitel ol { order: 3; flex-basis: 100%; gap: 4px; }
  .r3-kapitel ol button { height: 40px; padding: 0; }
  .r3-knopf { height: 40px; font-size: 13px; }
  .r3-knopf.r3-spiel { width: 40px; }
  .r3-knopf.r3-frei { flex: 1; }
  .r3-info { left: 12px; right: 12px; width: auto; bottom: 138px; padding: 13px 15px; border-radius: 16px; }
  .r3-info h2 { font-size: 19px; margin-bottom: 4px; }
  .r3-info p { font-size: 13px; }
  .r3-info ul, .r3-info .r3-klein { display: none; }
  .r3-info[data-kap="-1"] { display: none; }
  .r3-quelle { left: 12px; right: 12px; text-align: center; font-size: 10px; bottom: 8px; }
  .r3-bereich span { display: none; }
  .r3-ort { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .r3-leinwand, .r3-info, .r3-marke { transition: none; } }
