/* Nesting-box collect screen and the wobble egg. Scoped so the rest of the coop is unchanged. */
#eggLabel.egg-wobble{
  width:48px;height:52px;padding:0;min-height:0;max-width:none;
  background:transparent;border:0;box-shadow:none;
  font-size:0;line-height:0;color:transparent;
  overflow:visible;z-index:4;
}
/* The graphic wobbles; the button's hit box stays still so taps (and tests) can catch it. */
#eggLabel.egg-wobble::before{
  content:"";position:absolute;inset:0;pointer-events:none;
  border-radius:50% 50% 50% 50% / 60% 60% 40% 40%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.9) 0 10px, transparent 18px),
    radial-gradient(circle at 50% 55%, #fbf8f1 0 42%, #e8d39a 78%, #c9a45c 100%);
  box-shadow:0 3px 8px rgba(40,24,8,.28), inset 0 -4px 6px rgba(140,96,30,.18), inset 0 0 0 1.5px rgba(90,60,20,.18);
  animation:egg-wobble 1.15s ease-in-out infinite;
}
@keyframes egg-wobble{
  0%,100%{transform:rotate(-9deg) translateX(-3px)}
  50%{transform:rotate(9deg) translateX(3px)}
}
@media (prefers-reduced-motion: reduce){
  #eggLabel.egg-wobble::before{animation:none;box-shadow:0 0 0 5px rgba(255,236,170,.8),0 3px 10px rgba(40,24,8,.3)}
}
body.reduce-motion #eggLabel.egg-wobble::before{animation:none;box-shadow:0 0 0 5px rgba(255,236,170,.8),0 3px 10px rgba(40,24,8,.3)}
body.farm #eggLabel.egg-wobble,body.inside #eggLabel.egg-wobble{display:none !important}

#mEggs .eggs-card{
  width:min(560px,100%);
  max-height:calc(100dvh - 24px);
  padding:16px 16px 14px;
  background:
    linear-gradient(180deg, rgba(255,248,236,.96), rgba(245,230,200,.96)),
    var(--paper);
  overflow:auto;
}
#mEggs h3{font:700 22px Fredoka,sans-serif;padding-right:28px}
#mEggs .note{min-height:1.2em}
#mEggs .eggs-basket{
  display:flex;align-items:center;gap:10px;
  background:#fff4d8;border:1.5px solid var(--line);border-radius:14px;
  padding:8px 12px;margin:0 0 12px;font:800 13px Nunito,sans-serif;color:var(--ink);
}
#mEggs .eggs-basket-art{
  position:relative;width:54px;height:36px;flex:0 0 54px;
  background:
    radial-gradient(ellipse at 50% 0%, #c9843a 0 40%, transparent 42%),
    linear-gradient(180deg, #e2a85a 0%, #b36b28 70%, #8a4e18 100%);
  border-radius:6px 6px 16px 16px;
  box-shadow:inset 0 6px 0 #7a4314, 0 2px 0 rgba(80,40,10,.25);
}
#mEggs .eggs-basket-art::before{
  content:"";position:absolute;left:6px;right:6px;top:2px;height:8px;
  border:2px solid #7a4314;border-bottom:0;border-radius:10px 10px 0 0;
}
#mEggs .basket-egg{
  position:absolute;width:12px;height:15px;border-radius:50% 50% 50% 50% / 60% 60% 40% 40%;
  background:radial-gradient(circle at 32% 28%, var(--egg-shine), var(--egg-fill) 40%, var(--egg-shade));
  bottom:8px;
}
#mEggs .basket-egg:nth-child(1){left:14px}
#mEggs .basket-egg:nth-child(2){left:22px;bottom:10px}
#mEggs .basket-egg:nth-child(3){left:8px;bottom:7px}
#mEggs .basket-egg:nth-child(4){left:28px;bottom:7px}
#mEggs .basket-egg:nth-child(n+5){left:16px;bottom:12px;opacity:.9}

.eggs-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(96px, 1fr));
  gap:10px 8px;
  margin:0 0 12px;
}
.nest-box{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.nest-name{
  font:800 11px Nunito,sans-serif;color:var(--ink);
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;
}
.nest-stall{
  appearance:none;border:0;padding:0;width:100%;aspect-ratio:1.05;
  position:relative;cursor:pointer;
  background:linear-gradient(180deg, #8a5a2b 0 18%, #6b4120 18% 22%, #c48a48 22% 100%);
  border-radius:8px 8px 10px 10px;
  box-shadow:inset 0 0 0 2px #4a2c14, 0 4px 0 #3d2410;
  overflow:hidden;
}
.nest-stall::before{
  content:"";position:absolute;left:7%;right:7%;top:20%;bottom:18%;
  background:linear-gradient(180deg, #3a2414, #2a180c);
  border-radius:0 0 8px 8px;
  box-shadow:inset 0 0 0 1px rgba(255,220,160,.15);
}
.nest-straw{
  position:absolute;left:8%;right:8%;bottom:16%;height:28%;
  background:
    repeating-linear-gradient(95deg, #c9a04a 0 3px, #e6c36a 3px 6px, #b88932 6px 8px);
  border-radius:40% 40% 30% 30%;
  z-index:1;pointer-events:none;
}
.nest-clutch{
  position:absolute;left:10%;right:10%;bottom:22%;top:36%;
  z-index:2;display:flex;align-items:flex-end;justify-content:center;gap:2px;
  pointer-events:none;
}
.nest-egg{
  appearance:none;border:0;padding:0;pointer-events:auto;
  width:18px;height:23px;flex:0 0 18px;
  border-radius:50% 50% 50% 50% / 62% 62% 40% 40%;
  background:
    radial-gradient(circle at 32% 28%, var(--egg-shine, rgba(255,255,255,.8)) 0 3px, transparent 8px),
    radial-gradient(circle at 50% 60%, var(--egg-fill, #fbf8f1) 0 55%, var(--egg-shade, #e2d8c4) 100%);
  box-shadow:0 1px 0 rgba(40,20,8,.25);
  cursor:pointer;position:relative;
  transition:transform .22s ease, opacity .22s ease;
}
.nest-egg.speckled::after{
  content:"";position:absolute;inset:15% 18% 20%;
  background-image:radial-gradient(#5c3a22 0.7px, transparent 1.1px);
  background-size:4px 4px;border-radius:inherit;pointer-events:none;opacity:.85;
}
.nest-egg:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.nest-egg.is-lifting{
  transform:translateY(-28px) scale(1.08);opacity:.2;pointer-events:none;
}
.nest-egg.is-taken{opacity:0;transform:translateY(-36px) scale(.6);pointer-events:none}

.eggs-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.eggs-actions .btn{min-height:36px}

.eggs-empty{text-align:center;padding:8px 6px 14px}
.eggs-empty p{margin:0 0 12px;font:800 15px Nunito,sans-serif;color:var(--ink)}
.eggs-sleepy{display:flex;justify-content:center;align-items:flex-end;gap:14px;height:72px}
.sleepy-hen{
  width:42px;height:48px;position:relative;
  background:radial-gradient(circle at 50% 60%, #e2b340 0 62%, #c9922a 100%);
  border-radius:50% 50% 45% 45%;
}
.sleepy-hen::before{
  content:"";position:absolute;top:-7px;left:12px;width:16px;height:12px;
  background:#d4534a;border-radius:8px 8px 2px 2px;
}
.sleepy-hen::after{
  content:"‿ ‿";position:absolute;left:0;right:0;top:18px;
  text-align:center;font-size:11px;color:#3b2a1a;letter-spacing:-1px;
}
.sleepy-hen.late{background:radial-gradient(circle at 50% 60%, #8aa4b5 0 62%, #6e8b9e 100%);transform:scale(.9);height:44px}

@media (max-width:360px){
  #mEggs{padding:8px}
  #mEggs .eggs-card{padding:12px 10px 12px;border-radius:14px;max-height:calc(100dvh - 16px)}
  #mEggs h3{font-size:19px}
  .eggs-grid{grid-template-columns:repeat(3, minmax(0, 1fr));gap:8px 6px}
  .nest-egg{width:16px;height:20px;flex-basis:16px}
  .nest-name{font-size:10px}
}

@media (prefers-reduced-motion: reduce){
  .nest-egg{transition:none}
  .nest-egg.is-lifting,.nest-egg.is-taken{transform:none;opacity:0}
}
body.reduce-motion .nest-egg{transition:none}
body.reduce-motion .nest-egg.is-lifting,
body.reduce-motion .nest-egg.is-taken{transform:none;opacity:0}

body.eggs-open #eggLabel{display:none !important}

.eggs-grid[hidden], .eggs-empty[hidden], #eggsCollectAll[hidden] { display: none !important; }
body.eggs-open #toast { display: none !important; }
