* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
h2 {
  font-size: 60px;
}
body {
  min-height: 100vh;
  background: #23d9f5;
  background: linear-gradient(170deg, #ffe066 0%, #f5a623 35%, #e8912d 65%, #d97706 100%);
  font-family: 'Segoe UI', 'Comic Sans MS', system-ui, sans-serif;
  padding: 30px 20px;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
}

/* ===== ЗАГОЛОВОК ===== */
.title {
  text-align: center;
  font-size: 3rem;
  color: #fff;
  text-shadow: 3px 3px 0 #c05621, 6px 6px 0 rgba(0,0,0,0.1);
  margin-bottom: 6px;
  animation: bounce 2s ease infinite;
}

.subtitle {
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  margin-bottom: 35px;
  font-style: italic;
}

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

/* ===== СЕТКА МЕМОВ ===== */
.memes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(700px, 1fr));
  gap: 28px;
  margin-bottom: 40px;
}

/* ===== КАРТОЧКА ===== */
.meme-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 8px 30px rgba(0,0,0,0.15),
    0 0 0 3px rgba(255,255,255,0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.meme-card:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow:
    0 14px 40px rgba(0,0,0,0.22),
    0 0 0 3px rgba(255,255,255,0.7);
}

/* ===== КАРТИНКА ===== */
.meme-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.emoji-face {
  font-size: 6rem;
  animation: wobble 2.5s ease infinite;
  position: relative;
  z-index: 1;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-4deg) scale(1); }
  25% { transform: rotate(4deg) scale(1.05); }
  50% { transform: rotate(-2deg) scale(1); }
  75% { transform: rotate(3deg) scale(1.03); }
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  font-size: 1.4rem;
  animation: twinkle 1.2s ease infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

/* ===== ПОДПИСЬ ===== */
.meme-caption {
  padding: 16px 20px 12px;
}

.main-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1.3;
  margin-bottom: 4px;
}

.sub-text {
  font-size: 0.95rem;
  color: #888;
  font-style: italic;
}

/* ===== РЕАКЦИИ ===== */
.reactions {
  display: flex;
  gap: 8px;
  padding: 8px 16px 16px;
  flex-wrap: wrap;
}

.react-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border: 2px solid #f0f0f0;
  border-radius: 50px;
  background: #fafafa;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.react-btn .count {
  font-size: 0.85rem;
  font-weight: 700;
  color: #666;
  min-width: 14px;
  text-align: center;
}

.react-btn:hover {
  background: #fff3cd;
  border-color: #f5a623;
  transform: scale(1.1);
}

.react-btn:active {
  transform: scale(0.95);
}

.react-btn.pop {
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ===== ЛЕТЯЩИЙ ЭМОДЗИ ===== */
.flying-emoji {
  position: fixed;
  font-size: 2rem;
  pointer-events: none;
  z-index: 9999;
  animation: flyUp 1s ease-out forwards;
}

@keyframes flyUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-250px) scale(1.5) rotate(25deg);
  }
}

/* ===== ФУТЕР ===== */
.footer {
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.15);
}

.highlight {
  background: rgba(255,255,255,0.35);
  padding: 3px 14px;
  border-radius: 20px;
  font-weight: 700;
  color: #fff;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 480px) {
  .title { font-size: 2rem; }
  .emoji-face { font-size: 4.5rem; }
  .meme-image { height: 160px; }
  .react-btn { padding: 6px 10px; font-size: 1rem; }
}
