/* ---------- General Theme ---------- */


body {
  font-family: "Poppins", Arial, sans-serif;
  color: #2d2d2d;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;

  background-image:
    url("bee-bg.png"),
    linear-gradient(180deg, #fff8d6 0%, #ffec80 100%);
  background-repeat: repeat, no-repeat;
  background-size: 150px, cover;
  background-position: top left, center;
  background-attachment: fixed;
   padding-bottom: 120px; /* prevents content from hiding behind bottom ad */
}

/* ---------- Header ---------- */
header {
  width: 100%;
  background: linear-gradient(90deg, #ffd500, #ffcc00);
  padding: 18px 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 {
  font-size: 2em;
  color: #222;
  text-shadow: 1px 1px 2px #fff6a1;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

header h1::before {
  content: "🐝";
  font-size: 1.4em;
}

/* ---------- Buttons ---------- */
button {
  background: #ffce00;
  border: 2px solid #e0b000;
  border-radius: 12px;
  color: #222;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: #ffe96a;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* ---------- Main Layout ---------- */
main {
  background: #fffef3;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 30px 40px;
  margin: 30px auto;
  width: 90%;
  max-width: 750px;
  position: relative;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}

.timer {
  text-align: center;
  font-weight: bold;
  font-size: 1.3em;
  color: #ff9000;
  margin-bottom: 10px;
}

.word-area {
  text-align: center;
  margin: 10px 0;
}

.word-area input {
  font-size: 20px;
  padding: 8px 12px;
  border: 2px solid #ffce00;
  border-radius: 10px;
  outline: none;
  width: 60%;
  text-align: center;
}

.word-area input:focus {
  box-shadow: 0 0 8px #ffdb4d;
}

/* ---------- Definition ---------- */
#definition {
  margin-top: 12px;
  background: #fffde6;
  border: 2px solid #ffce00;
  border-radius: 10px;
  padding: 10px 14px;
  width: 80%;
  text-align: center;
  font-weight: 500;
  font-size: 1.1em;
  color: #333;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.definition {
  background: #fff4b8;
  border-left: 5px solid #ffce00;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 14px;
  font-size: 1em;
}

/* ---------- Stats ---------- */
.stats {
  display: flex;
  justify-content: space-around;
  margin-top: 18px;
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.stats div {
  background: #fff6b0;
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid #ffce00;
}

/* ---------- Incorrect List ---------- */
.incorrect-words {
  margin-top: 25px;
  text-align: center;
}

.incorrect-words h3 {
  color: #2d2d2d;
  margin-bottom: 8px;
}

textarea {
  resize: none;
  font-size: 15px;
  font-family: "Courier New", monospace;
  background: #fffad2;
  border: 2px solid #ffce00;
  border-radius: 10px;
  width: 90%;
  padding: 8px;
  color: #222;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ---------- Decorative Bees ---------- */
body::before, body::after {
  content: "🐝";
  position: fixed;
  font-size: 2em;
  opacity: 0.7;
  animation: floatBees 8s infinite ease-in-out;
}

body::before {
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}
body::after {
  bottom: 15%;
  right: 8%;
  animation-delay: 3s;
}

@keyframes floatBees {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(10deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}


/* 🐝 Flying Bees Animation Layer */
.bee {
  position: fixed;
  font-size: 2.2em;
  pointer-events: none; /* so bees don't block clicks */
  z-index: 1;
  opacity: 0.8;
  animation-timing-function: ease-in-out;
}

/* Define multiple flight paths */
@keyframes beeFloat1 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(60px, 30px) rotate(10deg); }
  50%  { transform: translate(0, 60px) rotate(-10deg); }
  75%  { transform: translate(-40px, 20px) rotate(5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes beeFloat2 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-70px, 50px) rotate(-15deg); }
  50%  { transform: translate(20px, 80px) rotate(10deg); }
  75%  { transform: translate(50px, -20px) rotate(-5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes beeFloat3 {
  0%   { transform: translate(0, 0) rotate(0deg); }
  33%  { transform: translate(80px, 20px) rotate(20deg); }
  66%  { transform: translate(-40px, 60px) rotate(-10deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Slightly different timings for realism */
.bee:nth-child(1) {
  top: 15%;
  left: 10%;
  animation: beeFloat1 9s infinite;
}
.bee:nth-child(2) {
  top: 40%;
  right: 15%;
  animation: beeFloat2 11s infinite;
}
.bee:nth-child(3) {
  bottom: 25%;
  left: 20%;
  animation: beeFloat3 8s infinite;
}
.bee:nth-child(4) {
  bottom: 10%;
  right: 25%;
  animation: beeFloat1 10s infinite reverse;
}
.bee:nth-child(5) {
  top: 60%;
  left: 45%;
  animation: beeFloat2 12s infinite alternate;
}

.word-lists {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}
/* 🐝 Mobile-friendly vertical layout for word lists */
@media (max-width: 768px) {
  .word-lists {
    flex-direction: column-reverse; /* shows Incorrect above Correct */
    align-items: center;
  }

  .word-lists textarea {
    width: 90%;
    height: 140px;
  }

  .word-lists > div {
    width: 100%;
    text-align: center;
  }

  .word-lists > div + div {
    margin-top: 15px;
  }
}

.word-lists h3 {
  margin-bottom: 8px;
  text-align: center;
}


.word-lists textarea {
  width: 250px;
  height: 150px;
  border: 2px solid #ffce00;
  border-radius: 10px;
  padding: 8px;
  background: #fffef3;
}

/* 🐝 Floating 160x600 side banners */
.side-ad {
  position: fixed;
  top: 120px;           /* move down to clear header if needed */
  width: 160px;
  height: 600px;
  z-index: 1000;
  text-align: center;
  overflow: hidden;
}

/* Left banner */
#leftAd {
  left: 10px;
}

/* Right banner */
#rightAd {
  right: 10px;
}

/* Hide on tablets and phones */
@media (max-width: 992px) {
  #leftAd, #rightAd {
    display: none !important;
  }
}

/* Optional: soft fade-in */
.side-ad {
  opacity: 0;
  animation: fadeInAds 1s ease-in-out forwards;
  animation-delay: 0.8s;
}
@keyframes fadeInAds {
  to { opacity: 1; }
}

/* new updates */
/* 🐝 Fixed Bottom Banner (max size, perfectly centered) */
#bottomAd {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);  /* keeps true center */
  z-index: 1000;
  background: transparent;
  text-align: center;
  height: 90px;                 /* actual ad height */
  width: 728px;                 /* default leaderboard width */
}

/* Let it shrink only when viewport is smaller */
@media (max-width: 768px) {
  #bottomAd {
    width: 95vw;                /* occupy up to 95% of viewport width */
    max-width: 728px;
    height: auto;
    transform: translateX(-50%);
  }
}

/* iPhone safe-area support (prevents clipping near home bar) */
@supports (padding: env(safe-area-inset-bottom)) {
  #bottomAd {
    padding-bottom: env(safe-area-inset-bottom);
  }
}


@media (max-width: 768px) {
  header h1 {
    font-size: 1.5em;              /* slightly smaller for mobile */
    text-align: center;            /* ensures centered text */
    justify-content: center;       /* centers flex children */
  }

  header {
    padding: 14px 0;
  }
}
