body {
  font-family: Arial, sans-serif;
  background: #f7f7f7;
  margin: 0;
  padding: 0;
  color: #222;
}

header {
  background: #4caf50;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

main {
  max-width: 700px;
  margin: 2rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#lupeContainer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5rem;
  width: 100%;
}

.floating-controls {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(34, 34, 34, 0.95);
  padding: 0.5rem 0.5rem 0.2rem 0.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.22), 0 2px 8px 0 rgba(34,34,34,0.13);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: calc(100vw - 16px);
  max-width: 600px;
  margin: 0 auto;
  pointer-events: auto;
}
.floating-controls .button-row {
  pointer-events: auto;
  width: 100%;
  justify-content: flex-start;
  margin-bottom: 0.05rem;
  overflow-x: auto;
  flex-wrap: nowrap;
  display: flex;
  gap: 0.08rem;
  scrollbar-width: thin;
}
.floating-controls .button-row::-webkit-scrollbar {
  height: 6px;
  background: transparent;
}
.floating-controls .button-row::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 3px;
}
.floating-controls button, .button-row button {
  font-size: 1.12rem;
  padding: 0.56rem 1.25rem;
  border-radius: 13px;
  background: linear-gradient(90deg, #43a047 0%, #66bb6a 50%, #1b5e20 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.18);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.22s, transform 0.13s, box-shadow 0.22s;
  outline: none;
  display: flex;
  align-items: center;
  gap: 0.48em;
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  letter-spacing: 0.01em;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.floating-controls button::after, .button-row button::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48%;
  border-radius: 13px 13px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 100%);
  pointer-events: none;
  z-index: 1;
}
.floating-controls button:active,
.floating-controls button:focus {
  background: linear-gradient(90deg, #1b5e20 0%, #43a047 100%);
  outline: 2.5px solid #fff;
  box-shadow:
    0 8px 32px 0 rgba(76,175,80,0.28),
    0 2px 12px 0 rgba(34,34,34,0.18);
  transform: scale(0.96);
  animation: buttonFocusPulse 0.35s;
}
@keyframes buttonFocusPulse {
  0% { box-shadow: 0 0 0 0 rgba(76,175,80,0.18);}
  60% { box-shadow: 0 0 0 8px rgba(76,175,80,0.18);}
  100% { box-shadow: 0 8px 32px 0 rgba(76,175,80,0.28), 0 2px 12px 0 rgba(34,34,34,0.18);}
}
.floating-controls button:hover, .button-row button:hover {
  background: linear-gradient(90deg, #388e3c 0%, #66bb6a 50%, #2e7d32 100%);
  box-shadow:
    0 10px 32px 0 rgba(76,175,80,0.28),
    0 3px 12px 0 rgba(34,34,34,0.16);
  transform: translateY(-2px) scale(1.06);
  opacity: 1;
}
.floating-controls .btn-icon {
  font-size: 1.35em;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(34,34,34,0.10));
}
.btn-label {
  display: inline-block;
  font-size: 1.09em;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 2px rgba(34,34,34,0.13);
  z-index: 2;
}
.floating-controls .button-row {
  gap: 0.18rem;
  margin-bottom: 0.11rem;
  justify-content: center;
}
@media (max-width: 700px) {
  .floating-controls {
    width: 99vw;
    max-width: 99vw;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.08rem 0.01rem 0.01rem 0.01rem;
    border-radius: 10px;
  }
  #lupeContainer {
    margin-top: 70px;
  }
  #hundVideo, #snapshotCanvas {
    margin-top: 0.5rem;
  }
}

/* Video immer sichtbar, Controls schweben oben */
#hundVideo, #snapshotCanvas {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  display: block;
  margin-top: 70px; /* Abstand zu den Buttons oben */
  -webkit-user-select: none;
  user-select: none;
}
.markierung {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,0,0,0.85);
  border: 3.5px solid #fff;
  box-shadow: 0 0 16px 4px rgba(255,0,0,0.7), 0 0 0 3px #fff8;
  z-index: 20;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  -webkit-user-select: none;
  user-select: none;
  animation: mark-pulse 0.5s;
  transition: box-shadow 0.18s, border 0.18s, background 0.18s, transform 0.12s;
}
@keyframes mark-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255,255,255,0.7), 0 0 16px 4px rgba(255,0,0,0.7);
    transform: scale(1.4);
  }
  60% {
    box-shadow: 0 0 0 12px rgba(255,255,255,0.18), 0 0 16px 4px rgba(255,0,0,0.7);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 16px 4px rgba(255,0,0,0.7), 0 0 0 3px #fff8;
    transform: scale(1);
  }
}
.markierung:focus {
  outline: 3px solid #1976d2;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(25,118,210,0.25), 0 0 16px 4px rgba(255,0,0,0.7);
}
#downloadSnapshot:hover {
  background: #1565c0;
}

#lupe {
  display: none;
  position: absolute;
  border: 3.5px solid #fff;
  border-radius: 50%;
  width: 140px;
  height: 140px;
  pointer-events: none;
  box-shadow: 0 0 24px 6px #4caf50cc, 0 0 0 4px #fff;
  overflow: hidden;
  z-index: 10;
  background-repeat: no-repeat;
  background-size: 200% 200%;
  transition: box-shadow 0.18s, border 0.18s;
}

.invertiert #hundBild,
.invertiert #hundVideo {
  filter: invert(1) hue-rotate(180deg) contrast(1.2) brightness(1.1);
}

.invertiert .markierung {
  background: #ffe600 !important;
  border: 3.5px solid #222 !important;
  box-shadow: 0 0 18px 6px #ffe600cc, 0 0 0 3px #222a !important;
  color: #222 !important;
}

.markierung {
  position: absolute;
  width: 22px;
  height: 22px;
  background: rgba(255, 0, 0, 0.7);
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 8px rgba(255,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s;
  z-index: 20;
}
.markierung:hover {
  transform: scale(1.22);
  background: rgba(255, 80, 80, 0.95);
  box-shadow: 0 0 24px 8px rgba(255,0,0,0.85), 0 0 0 4px #fff;
}

.markierung span {
  color: #fff;
  font-size: 1.1em;
  font-weight: bold;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  text-shadow: 0 0 4px #000, 0 0 2px #fff;
}

#takeSnapshot {
  font-size: 1.32rem;
  padding: 0.82rem 1.7rem;
  min-width: 68px;
  min-height: 52px;
  border-radius: 13px;
  background: linear-gradient(90deg, #43a047 0%, #81c784 60%, #1b5e20 100%);
  box-shadow:
    0 10px 36px 0 rgba(76,175,80,0.28),
    0 3px 12px 0 rgba(34,34,34,0.16);
  color: #fff;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: background 0.22s, transform 0.13s, box-shadow 0.22s;
  outline: none;
  margin: 0.6rem 0 0.6rem 0;
  position: relative;
  overflow: hidden;
}
#takeSnapshot::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48%;
  border-radius: 13px 13px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.06) 100%);
  pointer-events: none;
  z-index: 1;
}
#takeSnapshot:active, #takeSnapshot:focus {
  background: linear-gradient(90deg, #1b5e20 0%, #81c784 60%, #43a047 100%);
  outline: 2.5px solid #fff;
  box-shadow:
    0 14px 44px 0 rgba(76,175,80,0.32),
    0 4px 16px 0 rgba(34,34,34,0.19);
  transform: scale(0.96);
  animation: buttonFocusPulse 0.35s;
}

/* Button "Foto speichern" unterhalb des Videos/Snapshot-Bereichs */
#savePhoto {
  font-size: 1.16rem;
  padding: 0.66rem 1.4rem;
  min-width: 54px;
  min-height: 44px;
  border-radius: 11px;
  background: linear-gradient(90deg, #43a047 0%, #66bb6a 60%, #1b5e20 100%);
  box-shadow:
    0 7px 28px 0 rgba(76,175,80,0.22),
    0 2px 8px 0 rgba(34,34,34,0.13);
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  margin-top: 0.7rem;
  transition: background 0.22s, transform 0.13s, box-shadow 0.22s;
  outline: none;
  display: flex;
  align-items: center;
  gap: 0.32em;
  position: relative;
  overflow: hidden;
}
#savePhoto::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48%;
  border-radius: 11px 11px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 100%);
  pointer-events: none;
  z-index: 1;
}
#savePhoto:active, #savePhoto:focus {
  background: linear-gradient(90deg, #1b5e20 0%, #66bb6a 60%, #43a047 100%);
  outline: 2.5px solid #fff;
  box-shadow:
    0 10px 36px 0 rgba(76,175,80,0.28),
    0 3px 12px 0 rgba(34,34,34,0.16);
  transform: scale(0.96);
  animation: buttonFocusPulse 0.35s;
}

@media (max-width: 600px) {
  main {
    padding: 1rem;
  }
  #lupe {
    width: 90px;
    height: 90px;
  }
  .markierung {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 400px) {
  #lupe {
    width: 60px;
    height: 60px;
  }
  .markierung {
    width: 10px;
    height: 10px;
  }
}
