:root {
  --primary: #ff7e5f;
  --secondary: #feb47b;
  --accent: #ff4d4d;
  --light: #fff9f5;
  --dark: #333;
  --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, var(--light) 0%, #f8e8d8 100%);
  font-family: 'Poppins', sans-serif;
  color: var(--dark);
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 20px 0;
}

header h1 {
  margin: 0;
  color: var(--accent);
  font-size: 2.1rem;
}

header p {
  margin: 5px 0 0;
  color: var(--dark);
  opacity: 0.8;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

#card-stack {
  position: relative;
  width: 100%;
  height: 60vh;
  margin: 20px 0;
}

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

.card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feedback-icon {
  position: absolute;
  font-size: 60px;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.like-icon {
  color: #4CAF50; /* Green color for like */
}

.dislike-icon {
  color: #F44336; /* Red color for dislike */
}

.hidden {
  display: none;
}

.sub-heading {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 0.0rem 0 0.8rem;
  position: relative;
  display: inline-block;
}

.sub-heading:after {
  content: " 🐾";
  position: absolute;
  right: -25px;
  top: 50%;
  transform: translateY(-50%);
}

#summary {
  text-align: center;
  padding: 20px;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-top: 20px;
  /* Initial position (hidden) */
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  opacity: 0;
  /* Animation settings */
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 10;
}

#summary.visible {
  /* Final position */
  position: relative;
  top: 0;
  opacity: 1;
}

#liked-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

#liked-cats img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.replay-btn {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(255, 126, 95, 0.3);
  font-family: 'Poppins', sans-serif;
}

.result-message {
  font-size: 1.2rem;
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  font-weight: 600;
  animation: fadeIn 0.5s ease-in-out;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 126, 95, 0.4);
}

.btn:active {
  transform: translateY(0);
}

footer {
  text-align: center;
  padding: 15px;
  color: var(--dark);
  opacity: 0.7;
  font-size: 0.9rem;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 480px) {
  .app-container {
    padding: 15px;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  #card-stack {
    height: 65vh;
  }
}

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

#summary p[style*="color: red"] {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}