:root {
  color-scheme: light;
  font-family: "Nunito", "Aptos", "Segoe UI", ui-rounded, system-ui, sans-serif;
  --cream: #fff8e8;
  --paper: #fffdf8;
  --ink: #3e352d;
  --muted: #796e63;
  --green: #4f8058;
  --green-dark: #315b3a;
  --green-soft: #e5f0dc;
  --yellow: #f4c84f;
  --yellow-soft: #fff0ad;
  --coral: #e9785f;
  --coral-soft: #ffe0d4;
  --blue: #75aeb5;
  --red: #c94d49;
  --line: #e7d7ba;
  --shadow: 0 1.4rem 3.5rem rgba(102, 78, 41, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 8% 11%, rgba(244, 200, 79, 0.28) 0 0.45rem, transparent 0.5rem),
    radial-gradient(circle at 90% 15%, rgba(79, 128, 88, 0.18) 0 0.55rem, transparent 0.6rem),
    radial-gradient(circle at 4% 62%, rgba(233, 120, 95, 0.15) 0 0.35rem, transparent 0.4rem),
    linear-gradient(180deg, #fffaf0 0%, var(--cream) 52%, #f7f0dc 100%);
  color: var(--ink);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  content: "";
  filter: blur(0.5px);
  opacity: 0.5;
}

body::before {
  top: -6rem;
  right: -4rem;
  background: var(--green-soft);
}

body::after {
  bottom: -8rem;
  left: -5rem;
  background: var(--coral-soft);
}

button,
input {
  font: inherit;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  text-wrap: balance;
}

h1 {
  margin-bottom: 0.55rem;
  color: var(--green-dark);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.eyebrow,
.card-kicker {
  margin-bottom: 0.45rem;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.2rem;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.button:hover {
  transform: translateY(-2px) rotate(-0.5deg);
}

.button:active {
  transform: translateY(0);
}

.button:focus-visible,
input:focus-visible {
  outline: 4px solid rgba(244, 200, 79, 0.55);
  outline-offset: 3px;
}

.button-primary {
  width: 100%;
  background: var(--green);
  box-shadow: 0 0.45rem 0 #315b3a;
  color: white;
}

.button-primary:hover {
  background: #5b9165;
}

.button-primary:active {
  box-shadow: 0 0.2rem 0 #315b3a;
}

.button-secondary {
  flex: 0 0 auto;
  border-color: var(--line);
  background: rgba(255, 253, 248, 0.78);
  color: var(--green-dark);
  box-shadow: 0 0.35rem 1rem rgba(92, 68, 35, 0.08);
  backdrop-filter: blur(10px);
}

.button-secondary:hover {
  border-color: var(--yellow);
  background: white;
}

.camera-page {
  width: min(100%, 86rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1.25rem, 3.5vw, 3rem);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.75rem);
}

.brand-lockup {
  display: flex;
  max-width: 58rem;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.6rem);
}

.brand-avatar {
  width: clamp(5.2rem, 10vw, 7rem);
  aspect-ratio: 1;
  flex: 0 0 auto;
  border: 0.35rem solid white;
  border-radius: 38% 62% 55% 45% / 52% 42% 58% 48%;
  background-image: url("../images/wuschel-wg.jpg");
  background-position: 12% 69%;
  background-size: 290%;
  box-shadow: 0 0.65rem 0 var(--yellow), 0 1rem 2rem rgba(104, 74, 35, 0.17);
  transform: rotate(-4deg);
}

.welcome-copy {
  max-width: 42rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  font-weight: 650;
  line-height: 1.55;
}

.video-card {
  overflow: hidden;
  border: 0.3rem solid white;
  border-radius: clamp(1.35rem, 3vw, 2.2rem);
  background: var(--paper);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.card-topline,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.card-topline {
  padding: clamp(1.15rem, 3vw, 1.7rem) clamp(1.2rem, 3vw, 2rem);
}

.card-kicker {
  margin-bottom: 0.3rem;
  color: var(--green);
}

.residents {
  display: flex;
  align-items: center;
  padding-left: 0.8rem;
}

.resident-avatar {
  width: 2.75rem;
  aspect-ratio: 1;
  margin-left: -0.75rem;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background-image: url("../images/wuschel-wg.jpg");
  background-repeat: no-repeat;
  background-size: 510%;
  box-shadow: 0 0.2rem 0.55rem rgba(79, 58, 33, 0.15);
}

.resident-one { background-position: 7% 76%; }
.resident-two { background-position: 28% 83%; }
.resident-three { background-position: 51% 73%; }
.resident-four { background-position: 72% 81%; }
.resident-five { background-position: 94% 76%; }

.resident-label {
  margin-left: 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.video-frame {
  position: relative;
  display: grid;
  width: 100%;
  min-height: min(65vh, 48rem);
  overflow: hidden;
  background: #23241f;
  place-items: center;
}

#camera {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 15rem);
  object-fit: contain;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  overflow: hidden;
  background: #f6e4ad;
  place-items: stretch;
}

.video-placeholder::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(43, 48, 35, 0.5) 100%);
  content: "";
}

.video-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease;
}

.video-placeholder.is-send-break::after {
  background: linear-gradient(180deg, rgba(43, 48, 35, 0.02) 35%, rgba(43, 48, 35, 0.62) 100%);
}

.video-placeholder.is-send-break .placeholder-dot {
  display: none;
}

.placeholder-copy {
  position: absolute;
  z-index: 1;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 1.5rem);
  left: clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: white;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 850;
  text-shadow: 0 2px 10px rgba(40, 30, 18, 0.45);
}

.placeholder-dot {
  width: 0.7rem;
  height: 0.7rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgba(244, 200, 79, 0.72);
  animation: pulse 1.8s infinite;
}

.video-frame.has-video .video-placeholder {
  display: none;
}

.fullscreen-button {
  position: absolute;
  z-index: 3;
  right: clamp(0.75rem, 2vw, 1.2rem);
  bottom: clamp(0.75rem, 2vw, 1.2rem);
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(25, 28, 23, 0.72);
  box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.2);
  color: white;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 850;
  backdrop-filter: blur(8px);
  transition: background-color 140ms ease, transform 140ms ease;
}

.fullscreen-button[hidden] {
  display: none;
}

.fullscreen-button:hover {
  background: rgba(25, 28, 23, 0.9);
  transform: translateY(-1px);
}

.fullscreen-button:focus-visible {
  outline: 4px solid rgba(244, 200, 79, 0.72);
  outline-offset: 3px;
}

.fullscreen-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.video-frame:fullscreen,
.video-frame:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  background: black;
}

.video-frame:fullscreen #camera,
.video-frame:-webkit-full-screen #camera {
  width: 100%;
  height: 100%;
  max-height: none;
}

.card-footer {
  min-height: 4rem;
  padding: 0.8rem clamp(1.2rem, 3vw, 2rem);
  background: var(--paper);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 800;
}

.stream-statuses {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.viewer-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.viewer-status[hidden] {
  display: none;
}

.status-indicator {
  width: 0.72rem;
  height: 0.72rem;
  flex: 0 0 auto;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1px rgba(63, 52, 42, 0.14);
}

.status-connecting {
  background: var(--yellow);
  box-shadow: 0 0 0 0 rgba(244, 200, 79, 0.55);
  animation: pulse 1.8s infinite;
}

.status-online {
  background: #62a96f;
  box-shadow: 0 0 0.8rem rgba(98, 169, 111, 0.55);
}

.status-offline,
.status-lost {
  background: var(--red);
}

.status-disabled {
  background: var(--muted);
}

.quiet-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.camera-message {
  margin: -0.2rem 2rem 1.15rem 3.4rem;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 700;
}

.message-disabled {
  color: var(--green-dark);
}

.snack-strip {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  padding: 1.5rem 1rem 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.snack-strip b {
  color: var(--coral);
  font-weight: 900;
}

.login-page {
  display: grid;
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 2rem);
  place-items: center;
}

.login-card {
  display: grid;
  width: min(100%, 62rem);
  min-height: 34rem;
  overflow: hidden;
  border: 0.35rem solid white;
  border-radius: clamp(1.5rem, 4vw, 2.6rem);
  background: var(--paper);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  grid-template-columns: 1.12fr 0.88fr;
}

.login-illustration {
  min-height: 28rem;
  background-color: #f6e4ad;
  background-image:
    linear-gradient(180deg, rgba(255, 248, 232, 0.03), rgba(71, 78, 50, 0.08)),
    url("../images/wuschel-wg.jpg");
  background-position: center;
  background-size: cover;
}

.login-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.6rem, 5vw, 3.5rem);
}

.login-content h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.15rem, 5vw, 3.4rem);
}

.login-intro {
  margin-bottom: 2rem;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.15rem;
}

.field label {
  color: var(--green-dark);
  font-size: 0.92rem;
  font-weight: 850;
}

.field input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--line);
  border-radius: 1rem;
  background: #fffdf8;
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field input:hover,
.field input:focus {
  border-color: var(--yellow);
}

.form-error {
  margin: -0.3rem 0 1rem;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 750;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 0.5rem rgba(244, 200, 79, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(244, 200, 79, 0);
  }
}

@media (max-width: 48rem) {
  .camera-page {
    padding: 1rem;
  }

  .page-header {
    align-items: center;
    gap: 0.9rem;
  }

  .brand-avatar {
    width: 4.4rem;
  }

  .welcome-copy {
    display: none;
  }

  .button-secondary {
    min-height: 2.65rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
  }

  .card-topline {
    align-items: flex-end;
  }

  .resident-avatar {
    width: 2.2rem;
  }

  .resident-four,
  .resident-five,
  .resident-label {
    display: none;
  }

  .video-frame {
    min-height: 58vw;
  }

  .quiet-note {
    display: none;
  }

  .stream-statuses {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .snack-strip {
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    justify-content: flex-start;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-illustration {
    min-height: 14rem;
    background-position: center 64%;
  }

  .login-content {
    padding: 1.75rem 1.4rem 2rem;
  }
}

@media (max-width: 31rem) {
  .brand-avatar {
    display: none;
  }

  h1 {
    font-size: 2.15rem;
  }

  .page-header {
    align-items: flex-start;
  }

  .card-topline {
    align-items: flex-start;
  }

  .residents {
    padding-top: 0.1rem;
  }

  .resident-three {
    display: none;
  }

  .fullscreen-button {
    width: 2.75rem;
    justify-content: center;
    padding: 0.55rem;
  }

  #fullscreen-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
