* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
  background: linear-gradient(135deg, #2c3e50 0%, #e63b28 50%, #f5f5f0 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-attachment: fixed;
}

html {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #2c3e50 0%, #e63b28 50%, #f5f5f0 100%);
  background-attachment: fixed;
}

.form-container {
  position: relative;
  overflow: visible;
}

.back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 12px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-button:hover {
  background: white;
  transform: translateX(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.back-button i {
  font-size: 16px;
}

@media (max-width: 768px) {
  .back-button {
    padding: 10px 16px;
    font-size: 13px;
    top: 15px;
    left: 15px;
  }
}

.curran-guide {
  position: absolute;
  width: fit-content;
  bottom: -90px;
  right: -100px;
  z-index: 5;
  transform: rotate(-25deg);
}

.coach-image {
  width: 350px;
  height: auto;
  display: block;
}

.speech-bubble-container {
  position: absolute;
  top: -165px;
  left: -90px;
  opacity: 100;
  animation: fadeIn 0.5s ease-in 2.8s forwards;
  border-radius: 15px;
  padding: 20px;
  max-width: 400px;

  transform-origin: bottom right;

  animation: speakOut 0.5s ease-out 2.2s forwards;
  opacity: 0;
}

.speech-bubble-image {
  transform: scaleX(-1);
  width: 250px;
  height: auto;
  display: block;
}

#coach-text {
  position: absolute; /* Layer text ON TOP of bubble image */
  top: 47%; /* Center vertically in bubble */
  left: 50%; /* Center horizontally in bubble */
  transform: translate(-50%, -50%); /* Perfect centering */
  width: 80%; /* Keeps text inside bubble */
  text-align: center;
  padding: 1rem;
  margin: 0;
  font-size: 14px;
  color: black;
  font-weight: 500;
  white-space: pre-line;
}

@keyframes textPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.pop-animation {
  animation: textPop 0.4s ease-in-out;
}

@keyframes textPopMobile {
  0% {
    transform: scaleX(-1);
  }
  50% {
    transform: scaleX(-1.1);
  }
  100% {
    transform: scaleX(-1);
  }
}

.pop-animation-mobile {
  animation: textPopMobile 0.4s ease-in-out;
}

.cloud-bubble {
  transform: rotate(-15deg), scaleY(-1);
  position: absolute;
  top: 250px;
  right: 10px;
}

.cloud {
  width: 300px;
  height: auto;
  display: block;
  background: transparent;
}

.container {
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 100%;
  z-index: 10;
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  color: #555;
  font-weight: bold;
}

input,
select {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

input:focus,
select:focus {
  outline: none;
  border-color: #667eea;
}

button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #ff050d 0%, #000000 100%);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

#results {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

#results h2 {
  margin-bottom: 20px;
  color: #f03b3b;
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #ddd;
}

.result-item:last-child {
  border-bottom: none;
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  body {
    justify-content: flex-end;
    align-items: center;
  }
  .container {
    max-width: 200px;
    padding: 25px 15px;
  }

  input,
  select {
    padding: 8px 10px;
    font-size: 15px;
  }
  .form-group {
    margin-bottom: 12px;
  }
  h1 {
    font-size: 26px;
    margin-bottom: 15px;
  }
  label {
    font-size: 14px;
    margin-bottom: 4px;
  }
  button {
    padding: 12px;
    font-size: 16px;
    margin-top: 8px;
  }
  .speech-bubble-container {
    top: -220px;
    left: -160px;
  }
}
