body,
html {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  height: 100%;
  overflow: hidden;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  left: auto;
  top: auto;
  overflow: visible;
  outline: 3px solid #f90;
  z-index: 1000;
}

/* Focus styles for door and windows */
.door:focus,
.window:focus {
  outline: 3px solid #f90;
  outline-offset: 2px;
}

.sky {
  height: 100vh;
  width: 100%;
  transition: background 0.3s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: relative;
  color: #bacfe0;
  overflow: hidden;
}

/* Sun */
.sun {
  position: absolute;
  left: 10%;
  top: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd700 50%, #ffa500 100%);
  box-shadow: 0 0 60px 20px #ffd700;
  opacity: 0;
  z-index: 5;
  transition: top 2s ease-in-out, opacity 2s ease;
}

/* Moon */
.moon {
  position: absolute;
  right: 10%;
  top: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #ccc;
  box-shadow: 0 0 20px #fff;
  opacity: 0;
  z-index: 5;
  transition: top 1s ease-in-out, opacity 2s ease;
}

/* Grass */
.grass {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(90deg, #4caf50 0%, #388e3c 100%);
  box-shadow: inset 0 10px 10px rgba(0, 100, 0, 0.5);
  z-index: 2;
  transition: opacity 0.5s ease-in-out;
}

/* Stars */
#stars {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
  background: 
    radial-gradient(white 1.5px, transparent 1.5px), 
    radial-gradient(white 1.5px, transparent 1.5px), 
    radial-gradient(white 1.5px, transparent 1.5px);
  background-position: 20px 30px, 100px 60px, 180px 80px;
  background-repeat: repeat;
  background-size: 50px 50px;
  animation: twinkle 2s infinite alternate;
  z-index: 0;
}

#stars.active {
  display: block;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
}

/* Clouds */
.cloud-image {
  position: absolute;
  width: 200px;
  opacity: 0.9;
  animation: floatClouds 30s linear infinite;
  z-index: 1;
}

.cloud:hover {
  transform: scale(1.05);
}

.cloud1 {
  top: 19%;
  left: -100px;
  animation-name: cloudMove1;
  animation-duration: 30s;
  animation-delay: 0s;
}

.cloud2 {
  top: 25%;
  left: -180px;
  animation-name: cloudMove2;
  animation-duration: 50s;
  animation-delay: 3s;
}

@keyframes cloudMove1 {
  0% {
    left: -250px;
  }
  100% {
    left: 110vw;
  }
}

@keyframes cloudMove2 {
  0% {
    left: -300px;
  }
  100% {
    left: 130vw;
  }
}

@keyframes floatClouds {
  0% {
    transform: translateX(0);
    opacity: 0.9;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(2000px);
    opacity: 0.9;
  }
}

/* Home */
.home {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Roof */
.roof {
  width: 190px;
  height: 0;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-bottom: 60px solid #8b0000;
  position: relative;
  padding-top: 10px;
}

/* Chimney */
.chimney {
  position: absolute;
  width: 20px;
  height: 40px;
  background: #5c1e1e;
  left: 100px;
  top: -30px;
  border-radius: 2px;
  z-index: 5;
  cursor: pointer;
}

/* House Body */
.house-body {
  width: 200px;
  height: 150px;
  background: #ffe4b5;
  border: 2px solid #333;
  position: relative;
  box-shadow: inset 0 0 0 2px #d8a15f, 0 6px 10px rgba(0, 0, 0, 0.2);
  background-image: repeating-linear-gradient(
    to bottom,
    #ffe4b5 0px,
    #ffe4b5 19px,
    #dcb67b 20px
  );
}

/* Door */
.door {
  width: 50px;
  height: 90px;
  background: #5a3c1c;
  border: 2px solid #333;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 4px;
  box-shadow: inset 0 0 5px #2c1c0c;
  cursor: pointer;
}

.door::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 30px;
  width: 6px;
  height: 6px;
  background: gold;
  border-radius: 50%;
}

/* Windows */
.window {
  width: 35px;
  height: 35px;
  background: #add8e6;
  border: 2px solid #444;
  position: absolute;
  background-image: linear-gradient(to right, #dff6ff 50%, #a6d3e0 50%);
  background-size: 100% 100%;
  cursor: pointer;
}

.window1 {
  top: 20px;
  left: 15px;
}

.window2 {
  top: 20px;
  right: 15px;
}

/* Window glow for night */
.night-glow {
  background: #ffd966;
  background-image: radial-gradient(circle at center, #fff9c4 20%, #ffd966 100%);
  box-shadow: 0 0 15px 5px rgba(255, 217, 102, 0.7);
  transition: all 0.3s ease-in-out;
}

/* Sun and Moon Rise/Set */
@keyframes sunRise {
  from {
    top: 50%;
    opacity: 0;
  }
  to {
    top: 10%;
    opacity: 1;
  }
}

@keyframes sunSet {
  from {
    top: 10%;
    opacity: 1;
  }
  to {
    top: 50%;
    opacity: 0;
  }
}

@keyframes moonRise {
  from {
    top: 50%;
    opacity: 0;
  }
  to {
    top: 10%;
    opacity: 1;
  }
}

@keyframes moonSet {
  from {
    top: 10%;
    opacity: 1;
  }
  to {
    top: 50%;
    opacity: 0;
  }
}

/* Smoke puffs */
.smoke {
  position: absolute;
  width: 30px;
  height: 30px;
  background: radial-gradient(
    circle,
    rgba(177, 175, 175, 0.9) 0%,
    rgba(197, 197, 197, 0.849) 40%
  );
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 12px 4px rgba(176, 175, 175, 0.945);
}

/* Smoke only when chimney hovered */
.chimney:hover ~ .puff1 {
  animation: smokeRise1 3s ease-in-out infinite;
  opacity: 1;
  left: 105px;
  top: -40px;
}

.chimney:hover ~ .puff2 {
  animation: smokeRise2 3s ease-in-out infinite;
  opacity: 1;
  left: 115px;
  top: -45px;
}

.chimney:hover ~ .puff3 {
  animation: smokeRise3 3s ease-in-out infinite;
  opacity: 1;
  left: 110px;
  top: -35px;
}

/* Smoke animations */
@keyframes smokeRise1 {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0.9;
  }
  50% {
    transform: translateY(-40px) scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: translateY(-80px) scale(1);
    opacity: 0;
  }
}

@keyframes smokeRise2 {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-35px) scale(0.7);
    opacity: 0.5;
  }
  100% {
    transform: translateY(-75px) scale(0.9);
    opacity: 0;
  }
}

@keyframes smokeRise3 {
  0% {
    transform: translateY(0) scale(0.7);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-45px) scale(0.9);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-85px) scale(1.1);
    opacity: 0;
  }
}

/* Animals */
.animal {
  position: absolute;
  bottom: 80px;
  width: 80px;
  height: auto;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

/* Rooster */
#rooster {
  bottom: 74px;
  left: 50px;
  width: 80px;
  height: auto;
  z-index: 3;
  opacity: 1;
  animation: rooster-walk 15s linear infinite;
  animation-play-state: running;
  transform-origin: 50% 80%;
}

@keyframes rooster-walk {
  0% {
    left: -150px;
  }
  100% {
    left: 110vw;
  }
}

/* Fox */
#fox {
  bottom: 20px;
  right: -100px;
  width: 150px;
  height: auto;
  z-index: 2;
  opacity: 0;
  animation: foxPeekaboo 6s ease-in-out infinite;
  animation-play-state: paused;
  pointer-events: none;
  overflow: hidden;
}

@keyframes foxPeekaboo {
  0% {
    right: -120px;
    opacity: 0;
  }
  30% {
    right: -90px;
    opacity: 1;
  }
  70% {
    right: -90px;
    opacity: 1;
  }
  100% {
    right: -120px;
    opacity: 0;
  }
}

/* Info panel */
.info {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 20px;
  border-radius: 10px;
  text-align: center;
  z-index: 10;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.info h1 {
  margin: 0;
  font-size: 1.5rem;
}

.info p {
  margin: 5px 0 0 0;
  font-size: 0.95rem;
}
