* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #17120f;
  color: #f3e9dc;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  overflow: hidden;
}

#stage {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* portrait duck, letterboxed on desktop */
#duckframe {
  position: relative;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: 100vw;
  overflow: hidden;
  background: #17120f;
}

#duckframe video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

#duckframe video.on { opacity: 1; }

/* the nod: a quick bob applied on top of whatever clip is playing */
#duckframe.bob video.on { animation: bob 0.55s ease-in-out 2; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40%      { transform: translateY(2.2%) rotate(-1.2deg); }
  70%      { transform: translateY(0.6%) rotate(0.4deg); }
}

/* what the duck heard (your words, faint, bottom) */
#captions {
  position: absolute;
  bottom: 132px;
  left: 50%;
  transform: translateX(-50%);
  width: min(80vw, 480px);
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(243, 233, 220, 0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  pointer-events: none;
}

/* what the duck said */
#duckline {
  position: absolute;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(80vw, 480px);
  text-align: center;
  font-size: 17px;
  color: #ffd66e;
  text-shadow: 0 1px 6px rgba(0,0,0,.9);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
#duckline.on { opacity: 1; }

#status {
  display: none;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(243,233,220,.18);
  color: rgba(243,233,220,.75);
  white-space: nowrap;
}
.pill.ready { color: #a8e6a1; border-color: rgba(168,230,161,.35); }
.pill.hot   { color: #ffd66e; border-color: rgba(255,214,110,.4); }

/* wake overlay */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 10, 8, 0.55);
  backdrop-filter: blur(3px);
  transition: opacity .5s;
  z-index: 10;
}
#overlay.gone { opacity: 0; pointer-events: none; }

#overlay-card { text-align: center; max-width: 420px; padding: 24px; }
#overlay-duck { font-size: 64px; animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
#overlay-card h1 { font-size: 22px; margin: 12px 0 6px; font-weight: 600; letter-spacing: .04em; }
#overlay-card p { font-size: 14px; color: rgba(243,233,220,.7); }

#wake {
  margin: 22px 0 18px;
  font: inherit;
  font-size: 16px;
  padding: 12px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #ffd66e;
  color: #17120f;
  font-weight: 700;
}
#wake:hover:not(:disabled) { transform: scale(1.04); }

#wake:disabled {
  cursor: default;
  background: rgba(243, 233, 220, 0.16);
  color: rgba(243, 233, 220, 0.55);
  font-weight: 400;
}

.fine { font-size: 11px !important; color: rgba(243,233,220,.4) !important; line-height: 1.6; }

#log {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: 420px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(168,230,161,.8);
  background: rgba(0,0,0,.6);
  padding: 10px;
  border-radius: 8px;
  z-index: 20;
}
