/* Der 3D-Betrachter fürs Tablet (28.09.2026, js/seiten/ansicht3d.js).
   Anders als der Zeichnungsbetrachter folgt er der hellen und dunklen Ansicht:
   Ein Schrank in Weiss liest sich auf hellem Grund besser, und die Knöpfe
   sollen aussehen wie überall in Emma. */

.dreid {
  position: fixed;
  inset: 0;
  /* Über dem Streifen "Kein Netz" (70): Der Betrachter nimmt den ganzen
     Schirm, und im Kopf steht ohnehin, von wann das Modell ist. */
  z-index: 75;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--ink);
  color: var(--smoke);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

body.dreid-offen {
  overflow: hidden;
}

.dreid__kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 16px;
  border-bottom: 1px solid var(--linie-zart);
}

.dreid__text {
  flex: 1 1 auto;
  min-width: 0;
}

.dreid__name {
  display: block;
  color: var(--bone);
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dreid__klein {
  display: block;
  font-size: 0.85rem;
  color: var(--smoke-dim);
  line-height: 1.3;
}

.dreid__zu {
  width: 56px;
  height: 56px;
  border: 1px solid var(--linie);
  border-radius: var(--r-klein);
  background: var(--ink-2);
  color: var(--bone);
  font-size: 1.9rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.dreid__hilfeknopf {
  width: 44px;
  height: 44px;
  border: 1px solid var(--linie);
  border-radius: var(--r-klein);
  background: var(--ink-2);
  color: var(--bone);
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.dreid__buehne {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  /* Immer hell, wie der Szenen-Hintergrund in ansicht3d.js. */
  background: #f4f3ef;
}

.dreid__buehne canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.dreid__meldung {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 30em;
  padding: 16px 20px;
  border: 1px solid var(--linie);
  border-radius: var(--r);
  background: var(--ink-3);
  color: var(--bone);
  text-align: center;
}

.dreid__meldung:empty {
  display: none;
}

.dreid__hilfe {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.95rem;
  padding: 10px 16px;
  pointer-events: none;
  transition: opacity 0.4s;
  border-radius: 999px;
  max-width: calc(100% - 32px);
  text-align: center;
}

.dreid__hilfe--weg {
  opacity: 0;
}

.dreid__leiste {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--linie-zart);
  background: var(--ink-2);
}

.dreid__schalter {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-klein);
  border: 1px solid var(--linie);
  background: var(--ink-3);
  color: var(--smoke);
  font-size: 1rem;
  flex: 0 0 auto;
  width: auto;
  cursor: pointer;
}

.dreid__schalter[aria-pressed="true"] {
  background: rgba(var(--sand-rgb), 0.22);
  border-color: var(--sand);
  color: var(--bone);
}

.dreid__schalter[aria-pressed="true"]::before {
  content: '✓ ';
}

.dreid__schalter:disabled {
  opacity: 0.5;
  cursor: default;
}

.dreid__schalter--tat {
  margin-left: auto;
}

.dreid .bauteil-info {
  top: auto !important;
  right: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  margin: 0 auto !important;
  max-width: 640px !important;
  max-height: 55% !important;
  border-radius: 14px 14px 0 0 !important;
  font-size: 16px !important;
  padding: 14px 18px 18px !important;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35) !important;
}

/* Der Titel ist das einzige div im Infofeld (davor steht der Knopf), und er
   trägt 15 px als Inline-Stil, deshalb auch hier mit !important. */
.dreid .bauteil-info > div {
  font-size: 18px !important;
}

.dreid .bauteil-info > button {
  width: 44px !important;
  height: 44px !important;
  font-size: 28px !important;
  top: 6px !important;
  right: 8px !important;
}

.dreid .bauteil-info td {
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

@media (max-width: 699px) {
  .dreid__schalter {
    font-size: 0.95rem;
    padding: 0 12px;
  }
}
