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

body {
  font-family: 'Georgia', serif;
  background: linear-gradient(135deg, #0f0f23, #1a1a2e, #16213e);
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Welcome Screen */
.welcome-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  animation: fadeIn 1s ease-in;
}

.welcome-screen h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.welcome-screen .subtitle {
  font-size: 1.2rem;
  color: #a0a0a0;
  margin-bottom: 3rem;
  font-style: italic;
}

.character-setup {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 2.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 2rem;
  min-width: 400px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.input-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #ffd93d;
  font-weight: bold;
  font-size: 1.1rem;
}

.input-group input {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 1.1rem;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #ffd93d;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.3);
}

.start-btn {
  background: linear-gradient(45deg, #ff6b6b, #ffd93d);
  color: #1a1a2e;
  border: none;
  padding: 18px 35px;
  border-radius: 30px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(255, 107, 107, 0.4);
}

/* Story Screen */
.story-screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeIn 0.8s ease-in;
}

.story-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 2px solid rgba(255, 217, 61, 0.3);
  margin-bottom: 2rem;
}

.story-title {
  font-size: 1.8rem;
  color: #ffd93d;
  font-weight: bold;
}

.movie-counter {
  color: #6bcf7f;
  font-size: 1rem;
  margin-left: 1rem;
}

.controls {
  display: flex;
  gap: 12px;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #e0e0e0;
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffd93d;
  transform: translateY(-1px);
}

.control-btn.active {
  background: #ffd93d;
  color: #1a1a2e;
  border-color: #ffd93d;
}

/* Chat Container */
.chat-container {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  overflow-y: auto;
  max-height: 65vh;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.scene-description {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 217, 61, 0.15));
  border-left: 4px solid #ff6b6b;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0 15px 15px 0;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
}

.message {
  margin-bottom: 2rem;
  animation: slideUp 0.5s ease-out;
}

.message-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
}

.speaker {
  font-weight: bold;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.speaker.user {
  background: linear-gradient(45deg, #6bcf7f, #4ecdc4);
  color: #1a1a2e;
}

.speaker.friend {
  background: linear-gradient(45deg, #ff6b6b, #ff8e53);
  color: white;
}

.speaker.narrator {
  background: linear-gradient(45deg, #9b59b6, #8e44ad);
  color: white;
}

.message-text {
  background: rgba(255, 255, 255, 0.08);
  padding: 1.2rem 1.8rem;
  border-radius: 18px;
  line-height: 1.7;
  font-size: 1.1rem;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.plot-summary {
  background: linear-gradient(135deg, rgba(107, 207, 127, 0.15), rgba(78, 205, 196, 0.15));
  border-left: 4px solid #6bcf7f;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 0 15px 15px 0;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
}

.plot-summary strong {
  color: #6bcf7f;
  display: block;
  margin-bottom: 0.5rem;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: #ffd93d;
  animation: blink 1s infinite;
  margin-left: 2px;
  vertical-align: text-bottom;
}

/* User Input */
.user-input-container {
  background: rgba(255, 217, 61, 0.1);
  border-radius: 20px;
  padding: 2rem;
  border: 2px solid #ffd93d;
  animation: pulse 2s infinite;
  box-shadow: 0 10px 30px rgba(255, 217, 61, 0.1);
}

.input-prompt {
  color: #ffd93d;
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 1.1rem;
}

.user-input {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 1.1rem;
  resize: vertical;
  min-height: 70px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.user-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffd93d;
  box-shadow: 0 0 20px rgba(255, 217, 61, 0.2);
}

.submit-btn {
  background: linear-gradient(45deg, #6bcf7f, #4ecdc4);
  color: #1a1a2e;
  border: none;
  padding: 12px 25px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(107, 207, 127, 0.3);
}

.ai-indicator {
  background: linear-gradient(45deg, #9b59b6, #8e44ad);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 1rem;
  margin: 1rem 0;
  text-align: center;
  animation: aiPulse 1.5s infinite;
  border: 2px solid rgba(155, 89, 182, 0.3);
  box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
}

@keyframes aiPulse {
  0% { 
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
  }
  50% { 
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.5);
  }
  100% { 
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
  }
}

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

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

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes pulse {
  0% { border-color: #ffd93d; box-shadow: 0 0 0 0 rgba(255, 217, 61, 0.4); }
  50% { border-color: #6bcf7f; box-shadow: 0 0 0 10px rgba(255, 217, 61, 0); }
  100% { border-color: #ffd93d; box-shadow: 0 0 0 0 rgba(255, 217, 61, 0); }
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .welcome-screen h1 {
    font-size: 2.2rem;
  }
  
  .character-setup {
    min-width: auto;
    width: 100%;
    padding: 2rem;
  }
  
  .chat-container {
    max-height: 55vh;
    padding: 1.5rem;
  }

  .controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .control-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}
