/* =========================
   Global variables
========================= */
:root {
  --primary: #212631;
  --accent: #2b3646;
  --hover-accent: rgb(100, 129, 166, 0.8);
  --text-main: #e6e6eb;
  --glass-bg: rgba(255, 255, 255, 0.12);
  --text-shadow-outline:
    -1px -1px 0 var(--accent),
     1px -1px 0 var(--accent),
    -1px  1px 0 var(--accent),
     1px  1px 0 var(--accent);
}

/* =========================
   Base
========================= */
body {
  margin: 0;
  padding: 16px;
  color: var(--text-main);
  font-family: "Fredoka One", system-ui, sans-serif;

  background:
    url("/static/res/pet-background.webp") repeat;

  background-color: var(--primary);
  background-blend-mode: overlay;
}

/* =========================
   Headings
========================= */
h1 {
  text-align: center;
  font-size: 2.8rem;
  margin-bottom: 16px;
  color: white;
  letter-spacing: 0.4px;

  text-shadow: var(--text-shadow-outline);
  -webkit-text-stroke: 1px var(--accent);
}

/* =========================
   Feed container
========================= */
#hatch-feed {
  max-width: 720px;
  margin: auto;
}

/* =========================
   Hatch cards
========================= */
.hatch-card {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;

  color: white;
  border: 3px solid var(--accent);

  background: var(--glass-bg);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);

  text-shadow: var(--text-shadow-outline);
  -webkit-text-stroke: 1px var(--accent);

  transition: transform 120ms ease, box-shadow 120ms ease;
  will-change: transform;

  contain: layout paint; /* 🔥 FIX */
}

.hatch-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(var(--hatch-rgb), 0.45);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 1;
  border-radius: inherit;
}

.hatch-card > * {
  position: relative;
  z-index: 2;
}

.hatch-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(var(--hatch-rgb), 0.45),
    0 14px 30px rgba(0, 0, 0, 0.4);
}

/* =========================
   Hatch content
========================= */
.hatch-content {
  flex: 1;
  min-width: 0;
}

.hatch-title {
  font-size: 1.5rem;
  margin-bottom: 6px;
  color: white;

  text-shadow: var(--text-shadow-outline);
  -webkit-text-stroke: 1px var(--accent);
}

.hatch-meta {
  margin-top: 4px;
}

.hatch-time {
  margin-top: 8px;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* =========================
   Animations
========================= */
@keyframes hatch-pop {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  60% {
    opacity: 1;
    transform: translateY(0) scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.hatch-card.live {
  animation: hatch-pop 280ms cubic-bezier(.2,.8,.2,1);
}

@keyframes xl-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 12px rgba(255,255,255,0.35); }
}

.hatch-card.xl {
  animation: xl-pulse 2.5s ease-in-out infinite;
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

.hatch-card.live::after {
  content: "";
  position: absolute;
  inset: -25%;

  background:
    linear-gradient(
      120deg,
      transparent 28%,
      rgba(var(--hatch-rgb), 0.55),
      transparent 72%
    );

  mix-blend-mode: screen;
  opacity: 0.9;

  animation: shimmer 750ms cubic-bezier(.2,.9,.2,1);
  pointer-events: none;
  z-index: 0;
}

/* =========================
   Pet image
========================= */
.hatch-image {
  width: 140px;
  height: 140px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 8px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35));
}

/* =========================
   Navigation
========================= */
.nav-fixed {
  position: fixed;
  top: 16px;
  z-index: 1000;
  font-family: "Fredoka One", sans-serif;
  user-select: none;
  text-decoration: none;
}

.nav-left {
  left: 18px;
  font-size: 18px;
  color: white;
  transition: transform 0.15s ease, text-shadow 0.15s ease;
}

.nav-left:hover {
  transform: scale(1.05);
  text-shadow: 0 0 8px var(--hover-accent);
}

.nav-right {
  right: 18px;
  display: flex;
  align-items: center;
}

.discord-icon {
  width: clamp(36px, 4vw, 48px);
  height: clamp(36px, 4vw, 48px);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.discord-icon:hover {
  transform: scale(1.15);
  filter: drop-shadow(0 0 8px var(--hover-accent));
}
