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

:root {
  --cp-blue: #0099CC;
  --cp-blue-dark: #006699;
  --cp-blue-light: #87CEEB;
  --cp-ice: #E8F4F8;
  --cp-orange: #FF9933;
  --cp-purple: #9966CC;
  --cp-white: #FFFFFF;
  --cp-snow: #F0F8FF;
}

body {
  font-family: 'Fredoka', sans-serif;
  background: linear-gradient(180deg, var(--cp-blue-dark) 0%, var(--cp-blue) 50%, var(--cp-blue-light) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  position: relative;
  min-height: 100vh;
}

/* Snowfall Animation */
.snowfall-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -20px;
  color: rgba(255, 255, 255, 0.8);
  animation: snowfall linear infinite;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

@keyframes snowfall {
  0% {
    transform: translateY(-20px) rotate(0deg);
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
  }
}

/* Main Content */
.main-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  padding-bottom: 100px;
}

/* Header */
.header {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 30px;
}

.header-content {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  padding: 30px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.penguin-icon {
  font-size: 64px;
  animation: waddle 1s ease-in-out infinite;
  display: inline-block;
}

@keyframes waddle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--cp-white);
  text-shadow: 3px 3px 0 var(--cp-blue-dark), 0 0 20px rgba(0, 0, 0, 0.3);
  margin: 15px 0;
}

.title-blank {
  color: var(--cp-orange);
  text-decoration: underline;
  text-decoration-style: wavy;
}

.subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

/* Input Section */
.input-section {
  margin-bottom: 30px;
}

.input-container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.main-input {
  flex: 1;
  min-width: 280px;
  padding: 18px 24px;
  font-size: 1.1rem;
  font-family: 'Fredoka', sans-serif;
  border: none;
  border-radius: 50px;
  background: var(--cp-white);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.05);
  outline: none;
  transition: all 0.3s ease;
}

.main-input:focus {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.05), 0 0 0 4px rgba(255, 153, 51, 0.4);
}

.main-input::placeholder {
  color: #999;
}

.generate-btn {
  padding: 18px 36px;
  font-size: 1.1rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  color: var(--cp-white);
  background: linear-gradient(180deg, var(--cp-orange) 0%, #E67300 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 153, 51, 0.4), 0 6px 0 #CC6600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 153, 51, 0.5), 0 8px 0 #CC6600;
}

.generate-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 10px rgba(255, 153, 51, 0.4), 0 2px 0 #CC6600;
}

.generate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.generate-btn.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.chip {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  color: var(--cp-blue-dark);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid transparent;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--cp-white);
  border-color: var(--cp-orange);
  transform: scale(1.05);
}

/* Loading Animation */
.waddle-container {
  text-align: center;
  padding: 60px 20px;
}

.penguin-loading {
  display: inline-block;
  animation: waddle-walk 0.6s ease-in-out infinite;
}

@keyframes waddle-walk {
  0%, 100% { transform: translateX(-10px) rotate(-5deg); }
  50% { transform: translateX(10px) rotate(5deg); }
}

.penguin-body {
  width: 80px;
  height: 100px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 40px 40px 35px 35px;
  position: relative;
  margin: 0 auto;
}

.penguin-face {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 50%;
}

.penguin-eyes {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 12px;
}

.penguin-eye {
  width: 10px;
  height: 10px;
  background: #1a1a2e;
  border-radius: 50%;
}

.penguin-beak {
  width: 16px;
  height: 10px;
  background: var(--cp-orange);
  border-radius: 50%;
  margin: 8px auto 0;
}

.penguin-feet {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 5px;
}

.foot {
  width: 25px;
  height: 12px;
  background: var(--cp-orange);
  border-radius: 50%;
}

.loading-text {
  margin-top: 30px;
  color: var(--cp-white);
  font-size: 1.2rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Result Card */
.result-card {
  background: var(--cp-white);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.result-header {
  background: linear-gradient(135deg, var(--cp-blue-dark) 0%, var(--cp-purple) 100%);
  padding: 25px;
  text-align: center;
}

.result-title {
  color: var(--cp-white);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modifier-name {
  color: var(--cp-orange);
}

.section-tabs {
  display: flex;
  overflow-x: auto;
  background: var(--cp-ice);
  border-bottom: 2px solid #E0E0E0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.section-tabs::-webkit-scrollbar {
  display: none;
}

.section-tab {
  flex: 1;
  min-width: 120px;
  padding: 15px 10px;
  font-family: 'Fredoka', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--cp-blue-dark);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.section-tab:hover {
  background: rgba(0, 153, 204, 0.1);
}

.section-tab.active {
  background: var(--cp-white);
  color: var(--cp-blue);
  border-bottom: 3px solid var(--cp-orange);
}

.section-content {
  padding: 25px;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
}

.content-scroll {
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Share Section */
.share-section {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
}

.share-btn {
  padding: 14px 28px;
  font-family: 'Fredoka', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cp-white);
  background: var(--cp-purple);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-btn:hover {
  background: #8855BB;
  transform: translateY(-2px);
}

.share-btn.copied {
  background: #4CAF50;
}

.reaction-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reaction-label {
  color: var(--cp-white);
  font-weight: 500;
}

.reaction-btn {
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.reaction-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.2);
}

.reaction-btn.selected {
  background: var(--cp-white);
  border-color: var(--cp-orange);
  transform: scale(1.1);
}

/* History Sidebar */
.history-sidebar {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  align-items: flex-start;
}

.history-toggle {
  width: 40px;
  height: 60px;
  background: var(--cp-blue-dark);
  color: var(--cp-white);
  border: none;
  border-radius: 0 12px 12px 0;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
}

.history-toggle:hover {
  background: var(--cp-purple);
}

.history-content {
  background: var(--cp-white);
  width: 260px;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 0 16px 16px 0;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  padding: 20px;
}

.history-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cp-blue-dark);
  margin-bottom: 15px;
}

.history-empty {
  color: #999;
  font-size: 0.9rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--cp-ice);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-family: 'Fredoka', sans-serif;
  transition: all 0.2s ease;
}

.history-item:hover {
  background: var(--cp-blue-light);
}

.history-modifier {
  font-weight: 600;
  color: var(--cp-blue-dark);
}

.history-date {
  font-size: 0.75rem;
  color: #666;
}

/* Footer */
.footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--cp-white);
}

.remix-link {
  display: inline-block;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.2);
  color: var(--cp-white);
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  margin-bottom: 15px;
  transition: all 0.2s ease;
}

.remix-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.disclaimer {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-bottom: 10px;
}

.tagline {
  font-size: 1.2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Puffle Party */
.puffle-party {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.party-title {
  font-size: 3rem;
  color: var(--cp-white);
  margin-bottom: 30px;
  animation: rainbow 2s linear infinite;
}

@keyframes rainbow {
  0% { color: #ff6b6b; }
  16% { color: #feca57; }
  33% { color: #48dbfb; }
  50% { color: #ff9ff3; }
  66% { color: #54a0ff; }
  83% { color: #5f27cd; }
  100% { color: #ff6b6b; }
}

.puffle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  max-width: 400px;
}

.puffle {
  font-size: 3rem;
  animation: bounce 0.5s ease-in-out infinite alternate;
}

@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-20px); }
}

.party-text {
  margin-top: 30px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .main-content {
    padding: 15px;
  }
  
  .header {
    padding: 20px 10px;
  }
  
  .header-content {
    padding: 20px;
  }
  
  .penguin-icon {
    font-size: 48px;
  }
  
  .input-container {
    flex-direction: column;
  }
  
  .main-input {
    min-width: 100%;
    padding: 15px 20px;
  }
  
  .generate-btn {
    width: 100%;
    padding: 15px;
  }
  
  .section-tab {
    padding: 12px 8px;
    font-size: 0.75rem;
    min-width: 80px;
  }
  
  .section-content {
    padding: 20px 15px;
  }
  
  .history-sidebar {
    top: auto;
    bottom: 20px;
    transform: none;
  }
  
  .history-content {
    width: 220px;
    max-height: 300px;
  }
  
  .share-section {
    flex-direction: column;
  }
  
  .party-title {
    font-size: 2rem;
  }
  
  .puffle {
    font-size: 2rem;
  }
}