/* Base Reset & Body Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: linear-gradient(135deg, #ffccdd, #ff99aa);
  font-family: 'Segoe UI', sans-serif;
  position: relative;
  min-height: 100vh;
}

/* Decorations Container (SVG icons are placed here) */
#decorations {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.decor {
  position: absolute;
}
.decor svg {
  opacity: 0.8;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}

/* Main Container for FLAMES Game */
.container {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 15px;
  padding: 30px 40px;
  width: 90%;
  max-width: 600px;
  margin: 100px auto;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  text-align: center;
}
.container h1 {
  font-size: 2.5em;
  color: #e91e63;
  margin-bottom: 10px;
}
.container p {
  font-size: 1.2em;
  color: #333;
  margin-bottom: 20px;
}
.container input[type="text"] {
  padding: 12px;
  border: 2px solid #ff99aa;
  border-radius: 8px;
  font-size: 1em;
  width: 40%;
  margin: 10px;
}
.container button {
  padding: 12px 24px;
  background: #e91e63;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 10px;
}
.container button:hover {
  background: #d81b60;
}

/* Common Letters Process Display */
#common-process {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  background: #ffeef8;
  padding: 10px;
  border-radius: 8px;
}
.name-box {
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  margin: 10px;
  width: 45%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.name-box strong {
  display: block;
  margin-bottom: 8px;
  color: #e91e63;
}
.name-letter {
  display: inline-block;
  margin: 3px;
  padding: 6px 8px;
  border: 1px solid #ff99aa;
  border-radius: 4px;
  font-size: 1.2em;
  transition: all 0.3s ease;
  color: #e91e63;
}
.name-letter.highlight {
  background: #ffe0f0;
  border-color: #e91e63;
}
.name-letter.struck {
  text-decoration: line-through;
  color: #aaa;
  border-color: #aaa;
}
#remaining-count {
  width: 100%;
  text-align: center;
  margin-top: 10px;
  font-size: 1.2em;
  color: #e91e63;
}

/* FLAMES Letters Display */
#animation {
  margin-top: 30px;
  font-size: 1.8em;
}
.flame-letter {
  display: inline-block;
  margin: 5px;
  padding: 12px;
  border: 3px solid transparent;
  border-radius: 8px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  font-size: 1.5em;
  min-width: 40px;
  color: #e91e63;
}
.flame-letter.highlight {
  border-color: #e91e63;
  background-color: #ffe0f0;
}
.flame-letter.struck-out {
  text-decoration: line-through;
  color: #bbb;
  border-color: #bbb;
}
.result {
  font-size: 1.8em;
  margin-top: 20px;
  color: #e91e63;
}

/* Final Result Animation (SVG icons burst upward) */
#final-animation {
  margin-top: 20px;
  position: relative;
  height: 150px;
}
.final-icon-container {
  position: absolute;
  bottom: 0;
  animation: floatUp 3s ease-out forwards;
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.5); opacity: 1; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}
.final-icon {
  width: 40px;
  height: 40px;
}
/* Final icon specific colors */
.final-heart path {
  fill: #FF69B4;
}
/* Teddy Bear will be brown and more complete */
.final-teddy path,
.final-teddy ellipse,
.final-teddy circle {
  fill: #8B4513;
}
.final-teddy path.smile,
.final-teddy circle.eye,
.final-teddy circle.nose {
  fill: #fff;
}

/* ------------------------- */
/* Mobile Responsive Styles  */
/* ------------------------- */
@media (max-width: 600px) {
  .container {
    margin: 50px auto;
    padding: 20px;
    max-height: 100%;
  }
  .container h1 {
    font-size: 2em;
  }
  .container p {
    font-size: 1em;
  }
  .container input[type="text"] {
    width: 80%;
    padding: 10px;
    margin: 8px 0;
  }
  .container button {
    padding: 10px 20px;
    font-size: 0.9em;
  }
  #common-process {
    flex-direction: column;
    align-items: center;
  }
  .name-box {
    width: 90%;
    margin: 5px 0;
  }
  .name-letter {
    font-size: 1em;
    margin: 2px;
    padding: 5px 6px;
  }
  .flame-letter {
    font-size: 1.2em;
    padding: 10px;
    min-width: 35px;
    margin: 3px;
  }
}
