* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  background: linear-gradient(135deg, #ff8a00, #e52e71, #2fcbe0, #8a2be2);
  background-size: 400% 400%;
  animation: gradient 15s ease infinite;
  color: #333;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  direction: rtl;
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  max-width: 800px;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 25px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  margin: 0 auto;
  border: 3px dotted #ff00ff;
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80' width='80' height='80'%3E%3Cpath fill='%23ff9e80' d='M14 16H9v-2h5V9.87a4 4 0 1 1 2 0V14h5v2h-5v15.95A10 10 0 0 0 23.66 27l-3.46-2 8.2-2.2-2.9 5a12 12 0 0 1-21 0l-2.89-5 8.2 2.2-3.47 2A10 10 0 0 0 14 31.95V16zm40 40h-5v-2h5v-4.13a4 4 0 1 1 2 0V54h5v2h-5v15.95A10 10 0 0 0 63.66 67l-3.47-2 8.2-2.2-2.88 5a12 12 0 0 1-21.02 0l-2.88-5 8.2 2.2-3.47 2A10 10 0 0 0 54 71.95V56zm-39 6a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm40-40a2 2 0 1 1 0-4 2 2 0 0 1 0 4zM15 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm40 40a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'%3E%3C/path%3E%3C/svg%3E");
  opacity: 0.15;
  z-index: -1;
}

h1 {
  color: #ff00aa;
  margin-bottom: 20px;
  font-size: 3rem;
  text-shadow: 3px 3px 0 #ffcc00, -1px -1px 0 #00ccff;
  letter-spacing: 1px;
}

h2 {
  color: #8a2be2;
  margin-bottom: 15px;
  font-size: 2rem;
  text-shadow: 2px 2px 0 #ffcc00;
}

p {
  margin-bottom: 20px;
  font-size: 1.2rem;
  line-height: 1.5;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

button {
  background: linear-gradient(45deg, #ff00cc, #3333ff, #00ffcc);
  background-size: 200% 200%;
  animation: buttonGradient 3s ease infinite;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

@keyframes buttonGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(30deg);
  z-index: -1;
  transition: all 0.5s ease;
}

button:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
}

button:hover::after {
  transform: rotate(0deg);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.option {
  background: linear-gradient(135deg, #ffefba, #ffffff);
  padding: 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: right;
  display: flex;
  align-items: center;
  box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
  border: 2px solid transparent;
}

.option input[type="checkbox"] {
  margin-left: 15px;
  width: 24px;
  height: 24px;
  accent-color: #ff00aa;
}

.option:hover {
  background: linear-gradient(135deg, #ffd1ff, #ffefba);
  transform: translateX(-8px) scale(1.02);
  border: 2px solid #ff00aa;
}

.selected {
  background: linear-gradient(135deg, #ffd1ff, #d0c0ff);
  border-left: 5px solid #ff00aa;
  transform: translateX(-5px);
}

.other-option {
  display: flex;
  align-items: center;
  margin-top: 15px;
  background: linear-gradient(135deg, #ffefba, #ffffff);
  padding: 15px;
  border-radius: 15px;
  box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
}

.other-input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid #ffcc00;
  margin-right: 10px;
  font-size: 1rem;
  direction: rtl;
  background-color: rgba(255, 255, 255, 0.8);
}

.other-input:focus {
  outline: none;
  border-color: #ff00aa;
  box-shadow: 0 0 10px rgba(255,0,170,0.3);
}

.submit-button {
  margin-top: 25px;
  align-self: center;
}

.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  padding: 20px;
}

.character-info {
  background: linear-gradient(135deg, #e0f7fa, #b3e5fc);
  padding: 25px;
  border-radius: 20px;
  width: 100%;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  border: 3px solid #00ccff;
}

.costume-suggestion {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #fff9c4, #ffccbc);
  padding: 25px;
  border-radius: 20px;
  width: 100%;
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  border: 3px solid #ffaa00;
}

.costume-suggestion::after {
  content: '👑';
  position: absolute;
  top: -15px;
  right: -15px;
  font-size: 2rem;
  animation: rotate 5s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.progress-bar {
  width: 100%;
  height: 15px;
  background-color: #fce4ec;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
  overflow: hidden;
}

.progress {
  height: 100%;
  background: linear-gradient(45deg, #ff00cc, #3333ff, #00ffcc);
  background-size: 200% 200%;
  animation: buttonGradient 3s ease infinite;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.loading-animation svg {
  width: 80px;
  height: 80px;
}

.loading-animation circle {
  stroke: #ff00cc;
  stroke-dasharray: 150;
  stroke-dashoffset: 0;
  animation: loadingCircle 2s linear infinite;
}

@keyframes loadingCircle {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 360; }
}

.traits-container {
  margin-top: 20px;
}

#personality-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.trait {
  background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: bold;
  color: #333;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  border: 2px solid #6a11cb;
}

.hide {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
  40% {transform: translateY(-20px);}
  60% {transform: translateY(-10px);}
}

h1, h2 {
  animation: bounce 2s ease infinite;
}

.visual-elements {
  margin-top: 20px;
  background: linear-gradient(135deg, #e0f7fa, #bbdefb);
  padding: 15px;
  border-radius: 15px;
  border: 2px dashed #00ccff;
}

.elements-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.visual-element {
  background: linear-gradient(135deg, #b3e5fc, #81d4fa);
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
  color: #333;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  border: 2px solid #0288d1;
}

.character-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
}

.character-option {
  background: linear-gradient(135deg, #ffefba, #ffffff);
  padding: 25px;
  border-radius: 15px;
  width: 200px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: center;
  box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
  border: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.character-option:hover {
  transform: translateY(-15px) rotate(3deg) scale(1.1);
  box-shadow: 0 20px 30px rgba(0,0,0,0.2);
  z-index: 10;
}

.character-emoji {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: bounce 2s ease infinite;
}

.character-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: #8a2be2;
  text-shadow: 1px 1px 0 #ffcc00;
}

.character-emoji-result {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: bounce 3s ease infinite;
}

.characters-panel {
  background: linear-gradient(135deg, #ffd1ff, #d0c0ff);
  padding: 15px;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  overflow-x: auto;
  border: 3px dotted #ff00ff;
  direction: rtl;
  max-height: 300px;
  width: 100%;
}

.characters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  padding: 10px;
}

.character-bubble {
  font-size: 2rem;
  background: linear-gradient(135deg, #ffefba, #ffffff);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  border: 2px solid transparent;
  transition: all 0.3s;
  position: relative;
  cursor: help;
}

.character-tooltip {
  visibility: hidden;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  border-radius: 10px;
  padding: 8px 12px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  width: 220px;
  font-size: 1rem;
  pointer-events: none;
}

.creator-credit {
  color: #8a2be2;
  font-weight: bold;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffd1ff, #d0c0ff);
  padding: 10px;
  border-radius: 10px;
  border: 2px dashed #ff00ff;
  font-size: 1.1rem;
  line-height: 1.4;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}