@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
  --cat-color: #1aaaf8;
  --dog-color: #00cbca;
  --bg: #F7F8F9;
  --dark: #254356;
  --card: #FFFDF8;
  --radius: 24px;
}

html, body {
  margin: 0; padding: 0;
  background-color: var(--bg);
  min-height: 100vh;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px;
}

#content-container { width: 100%; max-width: 940px; }
#content-container-center { text-align: center; width: 100%; }

#content-container-center h3 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 40px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  animation: fadeUp 0.8s 0.2s ease both;
}

.cards form { display: contents; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  border: 2px solid transparent;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.card:hover { transform: translateY(-6px); box-shadow: 0 16px 48px rgba(0,0,0,0.12); }
.card.cat:hover { border-color: var(--cat-color); }
.card.dog:hover { border-color: var(--dog-color); }
.card.cat.voted { border-color: var(--cat-color); box-shadow: 0 16px 48px rgba(0,0,0,0.15); }
.card.dog.voted { border-color: var(--dog-color); box-shadow: 0 16px 48px rgba(0,0,0,0.15); }

.card-image {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card.cat .card-image { background: linear-gradient(135deg, #ddf0fd, #b3e2fc); }
.card.dog .card-image { background: linear-gradient(135deg, #ccf7f7, #99eded); }

.pet-emoji {
  font-size: 100px;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.15));
  user-select: none;
}

.card:hover .pet-emoji { transform: scale(1.1) rotate(-5deg); }

.pet-photo {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.card.voted .pet-photo { opacity: 1; }

.card.voted .pet-emoji {
  position: absolute;
  bottom: 16px;
  right: 16px;
  font-size: 40px;
  z-index: 2;
  animation: bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.voted-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: white;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transform: scale(0.8) translateY(-8px);
  transition: all 0.4s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3;
}

.card.cat .voted-badge { color: var(--cat-color); }
.card.dog .voted-badge { color: var(--dog-color); }
.card.voted .voted-badge { opacity: 1; transform: scale(1) translateY(0); }

.card-body { padding: 24px 28px 28px; }

.card-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.card-body .tagline {
  font-size: 13px;
  color: #9A8E82;
  margin-bottom: 20px;
}

.vote-btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.card.cat .vote-btn { background: var(--cat-color); color: white; }
.card.dog .vote-btn { background: var(--dog-color); color: white; }
.vote-btn:hover { filter: brightness(1.1); transform: translateY(-2px); }
.vote-btn:active { transform: translateY(0); }
.vote-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

.tip { margin-top: 16px; font-size: 12px; color: #c0c9ce; text-align: center; }
.hostname { margin-top: 8px; font-size: 18px; color: #8f9ea8; text-align: center; }

.confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.confetti-piece { position: absolute; opacity: 0; animation: confettiFall 1.2s ease-out forwards; }

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

@keyframes bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3) rotate(-10deg); }
  70%  { transform: scale(0.9) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes confettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(300px) rotate(720deg); }
}

@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .card-image { height: 200px; }
  .pet-emoji { font-size: 70px; }
}
