/* ===== Body + Background ===== */

body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  color: #f0f0f0;
  text-align: center;
  min-height: 100vh;
  background: linear-gradient(270deg, #0d0c1d, #1f1b2e, #121019, #1a1525);
  background-size: 600% 600%;
  animation: bgFlow 20s ease infinite;
  overflow-x: hidden;
}

@keyframes bgFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Canvas */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== Header ===== */
header, footer {
  width: 100%;
  text-align: center;
  padding: 15px 0;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px); /* blur effect */
  background: rgba(20, 18, 30, 0.6); /* dark transparent background */
  box-shadow: 0 0 15px rgba(120, 90, 255, 0.3);
}
.footer {
  background: rgba(15, 15, 15, 0.9);
  color: #ccc;
  text-align: center;
  padding: 20px 10px;
  font-family: 'Poppins', sans-serif;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links {
  margin-bottom: 10px;
  font-size: 15px;
}

.footer-links a {
  color: #00ff88; /* neon green to match Wordle vibe */
  text-decoration: none;
  margin: 0 6px;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #fff;
  text-shadow: 0 0 8px #00ff88;
}

.footer-copy {
  font-size: 14px;
  color: #aaa;
}

.footer-copy .brand {
  color: #00ff88;
  font-weight: 600;
}

@media (max-width: 600px) {
  .footer-links {
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
}

header::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  border-top: 2px solid;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #8a2be2, #00ffff, #8a2be2) 1;
  animation: borderFlow 6s linear infinite;
  pointer-events: none;
  opacity: 0.8;
}

@keyframes borderFlow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

header h1 {
  font-size: 2.5rem;
  margin: 20px 0;
  background: linear-gradient(90deg, #ff5f6d, #ffc371);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block; /* ✅ important for webkit text clip to work */
}


header nav {
  margin-top: 8px;
}
header nav a {
  color: #d1cfff;
  text-decoration: none;
  margin: 0 10px;
  font-weight: 500;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
header nav a:hover {
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

/* ===== Footer ===== */
footer {
  width: 100%;
  text-align: center;
  padding: 15px 0;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  background: rgba(20, 18, 30, 0.4);
  box-shadow: 0 0 15px rgba(120, 90, 255, 0.3);
}

footer::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  border-top: 2px solid;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #8a2be2, #00ffff, #8a2be2) 1;
  animation: borderFlow 6s linear infinite;
  pointer-events: none;
  opacity: 0.8;
}

footer p {
  color: #bfb8ff;
  font-size: 0.9rem;
  margin: 5px 0;
}

/* ===== Main Game Container ===== */
main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px);
  padding: 20px;
}
.modal {
  display: flex;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #111;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 450px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  max-height: 80%;
  overflow-y: auto;
  font-size: 16px; /* Default for desktop */
}

/* ✅ MOBILE view: below 480px */
@media (max-width: 480px) {
  .modal-content {
    width: 85%;
    max-width: 300px;      /* Smaller box */
    padding: 14px;
    font-size: 14px;        /* Smaller text */
  }

  .tile {
    width: 28px;
    height: 28px;
    font-size: 13px;
    margin: 1px;
  }

  .tile-row {
    margin-bottom: 6px;
  }
}

/* ✅ NEW */
.tile-row {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.tile {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  margin: 2px;
  border: 2px solid #555;
  font-weight: bold;
  text-transform: uppercase;
  font-family: sans-serif;
  font-size: 16px;
  color: white;
  border-radius: 4px;
}
/* Optional: color classes */
.correct {
  background-color: #00c853; /* green */
}

.present {
  background-color: #ffd600; /* yellow */
}

.absent {
  background-color: #333; /* dark gray */
}


.tile.correct { background-color: green; color: #fff; }
.tile.present { background-color: gold; color: #000; }
.tile.absent  { background-color: #555; color: #fff; }

.example p { margin: 5px 0 15px 0; }

#about-section {
  display: none;
  margin-top: 20px;
  color: #f0f0f0;
  max-width: 600px;
  text-align: center;
}

#about-section h2 {
  font-size: 2rem;
  margin-bottom: 15px;
  background: linear-gradient(90deg, #ff5f6d, #ffc371);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

#about-section p {
  font-size: 1.1rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

#back-home-about {
  margin-top: 15px;
  padding: 8px 12px;
  background: #8a2be2;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#back-home-about:hover {
  box-shadow: 0 0 15px #00ffff;
  background: #00d4ff;
}

/* ===== Game Board ===== */
#game-board {
  display: grid;
  grid-template-rows: repeat(6, 70px);
  gap: 10px;
  justify-content: center;
  margin: 20px auto;
}

.row {
  display: grid;
  grid-template-columns: repeat(5, 70px);
  gap: 10px;
}

/* ===== Game Board Tiles ===== */
.tile {
  width: 70px;
  height: 70px;
  background-color: rgba(58, 58, 60, 0.8); /* slightly transparent */
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  text-transform: uppercase;
  border: 2px solid #555;
  transition: transform 0.5s ease, background-color 0.5s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 5px rgba(0, 255, 255, 0.2), 0 0 10px rgba(255, 0, 255, 0.1);
}

/* Flip animation */
.tile.flip {
  transform: rotateX(180deg);
  transition: transform 0.6s ease, background-color 0.5s ease, box-shadow 0.5s ease;
}


/* Color feedback */
.tile.correct {
  background-color: #00ff99;  /* green neon */
  border-color: #00ff99;
  color: #000;
  box-shadow: 0 0 12px #00ff99, 0 0 24px #00ff99;
}
.tile.present {
  background-color: #ffdd00; /* yellow neon */
  border-color: #ffdd00;
  color: #000;
  box-shadow: 0 0 12px #ffdd00, 0 0 24px #ffdd00;
}
.tile.absent {
  background-color: #555; /* dark gray */
  border-color: #555;
  color: #fff;
  box-shadow: 0 0 6px rgba(255,255,255,0.1);
}

/* Hover glow for tiles (optional) */
.tile:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px #00ffff, 0 0 25px #ff00ff;
}

/* ===== Responsive Tiles ===== */
@media (max-width: 600px) {
  .tile {
    width: 55px;
    height: 55px;
    font-size: 1.6rem;
  }
}


/* ===== Keyboard (larger keys) ===== */
#keyboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 500px; /* slightly bigger */
  margin: 30px auto;
}

.key {
  background: #1b1a2f;
  border: 1px solid #555;
  border-radius: 10px;
  margin: 4px;
  padding: 16px 14px;  /* bigger keys */
  font-size: 1.1rem;   /* larger text */
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 0 6px #8a2be2, 0 0 12px #00ffff;
  transition: all 0.3s ease;
}

.key:hover {
  box-shadow: 0 0 18px #00ffff, 0 0 28px #ff00ff;
  transform: scale(1.1);
  color: #00ffff;
}
/* ===== Responsive Keyboard ===== */
@media (max-width: 600px) {
  #keyboard {
    max-width: 320px;
  }
  .key {
    padding: 14px 12px;
    font-size: 1rem;
  }
}


/* ===== Leaderboard ===== */
#leaderboard-section {
  display: none;
  margin-top: 20px;
}

#leaderboard-list {
  list-style: none;
  padding: 0;
}

#leaderboard-list li {
  background: rgba(50, 40, 70, 0.6);
  margin: 6px auto;
  padding: 10px 15px;
  width: 250px;
  border-radius: 8px;
  color: #fff;
  font-weight: bold;
  box-shadow: 0 0 12px rgba(80, 50, 200, 0.6);
  transition: 0.3s;
}
#leaderboard-list li:hover {
  box-shadow: 0 0 18px #00ffff, 0 0 30px #8a2be2;
  transform: scale(1.05);
}

#back-home {
  margin-top: 15px;
  padding: 8px 12px;
  background: #8a2be2;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#back-home:hover {
  box-shadow: 0 0 15px #00ffff;
  background: #00d4ff;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  header h1 { font-size: 1.6rem; }
  header nav a { margin: 6px; font-size: 0.9rem; }
  #game-board { grid-template-rows: repeat(6, 55px); }
  .row { grid-template-columns: repeat(5, 55px); gap: 6px; }
  .tile { width: 55px; height: 55px; font-size: 1.6rem; }
  #keyboard { max-width: 300px; }
}
#instructions {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #d1cfff;
}
#toast {
  visibility: hidden;
  min-width: 220px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px 16px;
  position: fixed;
  z-index: 1001;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: sans-serif;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.4s ease, bottom 0.4s ease;
}

#toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
.row.shake {
  animation: shake 0.3s;
}
.wordle-info {
  max-width: 900px;
  margin: 40px auto;
  padding: 20px;
  background: rgba(20, 20, 20, 0.8);
  border-radius: 12px;
  color: #fff;
  line-height: 1.6;
  font-family: 'Poppins', sans-serif;
  text-align: center;
}

.wordle-info h1, .wordle-info h2, .wordle-info h3 {
  color: #00ff88;
  text-align: center;
  margin-bottom: 10px;
}

.wordle-info p, .wordle-info ul {
  font-size: 16px;
  margin-bottom: 15px;
}

.wordle-info ul {
  list-style-type: disc;
  margin-left: 25px;
}

.wordle-info a {
  color: #00bfff;
  text-decoration: none;
}
.wordle-info a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .wordle-info {
    padding: 15px;
    font-size: 15px;
  }
}
