#clickCanvas {
  cursor: crosshair;
}

#feedback {
  font-size: 1.2rem;
}

#imageWrapper {
  height: 78vh;
  overflow: hidden;
  position: relative;
}

#compartmentLabelOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(7.2rem, 12vw, 12rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 2;
  padding: 0 1rem;
}

#imageWrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

#imageWrapper.answer-correct::after {
  animation: flash-correct calc(var(--flash-correct-duration, 2400ms) * 3) ease-out forwards;
}

#imageWrapper.answer-wrong::after {
  animation: flash-wrong calc(var(--flash-wrong-duration, 2400ms) * 3) ease-out forwards;
}
/* sanfte Hintergrund-Transition */
.transition-bg {
  transition: background-color 0.4s ease;
}

@keyframes flash-correct {
  0% {
    background-color: #22c55e;
    opacity: 1;
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0.75), 0 0 48px rgba(34, 197, 94, 0.85);
  }
  65% {
    background-color: rgba(34, 197, 94, 0.25);
    opacity: 0.6;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.35), 0 0 20px rgba(34, 197, 94, 0.45);
  }
  100% {
    background-color: #ffffff;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    opacity: 0;
  }
}

@keyframes flash-wrong {
  0% {
    background-color: #ef4444;
    opacity: 1;
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.75), 0 0 48px rgba(239, 68, 68, 0.85);
  }
  65% {
    background-color: rgba(239, 68, 68, 0.25);
    opacity: 0.6;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35), 0 0 20px rgba(239, 68, 68, 0.45);
  }
  100% {
    background-color: #ffffff;
    opacity: 0;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

#compartmentImage {
    max-height: 100%;
    width: auto;
    object-fit: contain;          /* GANZES Bild sichtbar */
  position: relative;
  z-index: 1;
}

#clickCanvas {
    pointer-events: auto;
  position: relative;
  z-index: 1;
}

#compartmentViews canvas {
  cursor: crosshair;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

#compartmentViews img {
  pointer-events: none;
}

#compartmentButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}


#statsBar {
  margin-top: 0.5rem;
  z-index: 2;
}

.quiz-header {
  min-height: 7vh;
}

#questionModal .modal-dialog,
#questionModal .modal-content {
  max-height: 72vh;
}

#questionModal .modal-dialog {
  max-width: min(92vw, 34rem);
}

#questionModal .modal-content,
#resultModal .modal-content {
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#questionModal .modal-header,
#questionModal .modal-body,
#questionModal .modal-footer,
#resultModal .modal-header,
#resultModal .modal-body,
#resultModal .modal-footer {
  background: transparent;
}

#questionModal .modal-title,
#resultModal .modal-title,
#questionModal .modal-body,
#resultModal .modal-body,
#questionModal .modal-footer,
#resultModal .modal-footer {
  color: #0f172a;
}

#questionModal .modal-header {
  position: relative;
  justify-content: center;
  padding: 0.5rem 0.75rem;
}

#questionModal #deviceName {
  display: block;
  font-size: clamp(1.45rem, 4.6vw, 1.9rem);
  line-height: 1.3;
  padding-right: 2rem;
  text-align: center;
}

#questionModal #quitSessionBtn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}

#questionModal .btn,
#resultModal .btn {
  color: #111111 !important;
  background-color: rgba(220, 38, 38, 0.52) !important;
  border-color: rgba(127, 29, 29, 0.72) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#questionModal .btn:hover,
#questionModal .btn:focus,
#resultModal .btn:hover,
#resultModal .btn:focus {
  color: #0b0b0b !important;
  background-color: rgba(220, 38, 38, 0.68) !important;
  border-color: rgba(127, 29, 29, 0.9) !important;
}

#questionModal .btn:disabled,
#resultModal .btn:disabled {
  color: rgba(17, 17, 17, 0.7) !important;
  background-color: rgba(220, 38, 38, 0.35) !important;
  border-color: rgba(127, 29, 29, 0.45) !important;
}

#questionModal .modal-body {
  overflow: hidden;
  padding: 0.5rem 0.75rem;
}

.modal-draggable {
  position: fixed;
  margin: 0;
}

@media (max-width: 576px) {
  #questionModal .modal-dialog,
  #questionModal .modal-content {
    max-height: 68vh;
  }

  #questionModal .modal-body {
    padding: 0.5rem;
  }

  #questionModal #deviceName {
    display: block;
    font-size: 1.35rem;
  }

  #compartmentViews img {
    max-height: 26vh;
  }

  #compartmentViews canvas {
    max-height: 26vh;
  }

  #viewHeckBtn,
  #viewDachBtn {
    font-size: 0.95rem;
    padding: 0.45rem 0.9rem;
  }
}

:root {
  --at-navbar-height: 56px;
}

@media (max-width: 576px) {
  .quiz-header {
    display: none;
  }

  #imageWrapper {
    height: calc(100dvh - var(--at-navbar-height) - 10vh);
    padding: 0.25rem !important;
  }
}

#questionModal.modal-vertical-bottom .modal-dialog.modal-dialog-centered {
  align-items: flex-end;
}