:root {
  --bg: #101318;
  --card: #ffffff;
  --ink: #14171c;
  --yellow: #ffd43b;
  --muted: #9aa2b1;
  --dim: #5b6472;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: #eef1f6;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Taśma ostrzegawcza ─────────────────────────── */
.tape {
  flex: 0 0 14px;
  background: repeating-linear-gradient(45deg, var(--yellow) 0 26px, #16181d 26px 52px);
  background-size: 73.54px 100%;
  animation: tapeSlide 1.4s linear infinite;
}
.tape-bottom { transform: rotate(180deg); }
@keyframes tapeSlide { to { background-position: 73.54px 0; } }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 16px 20px;
  text-align: center;
}

/* ── Lampka budowlana ───────────────────────────── */
.lamp {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff6b6b;
  box-shadow: 0 0 18px 5px rgba(255, 107, 107, 0.5);
  animation: blink 1.7s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

/* ── Nagłówek ───────────────────────────────────── */
.title {
  font-family: 'Arial Black', 'Segoe UI', sans-serif;
  font-size: clamp(1.9rem, 6vw, 3.9rem);
  letter-spacing: 0.04em;
  color: var(--yellow);
  text-shadow: 0 0 26px rgba(255, 212, 59, 0.35);
  transform: rotate(-1.5deg);
}

.subtitle {
  max-width: 580px;
  color: #c7cdd8;
  font-size: 1.05rem;
  line-height: 1.55;
}
.subtitle strong { color: var(--yellow); }

/* ── Karta mema ─────────────────────────────────── */
.meme-card {
  position: relative;
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 20px 18px 14px;
  max-width: 660px;
  width: 100%;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.5);
  transform: rotate(1.2deg);
}
.meme-card::before,
.meme-card::after {
  content: "";
  position: absolute;
  top: -15px;
  width: 120px;
  height: 30px;
  background: rgba(255, 212, 59, 0.85);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}
.meme-card::before { left: 26px; transform: rotate(-4deg); }
.meme-card::after  { right: 26px; transform: rotate(4deg); }

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.badge {
  background: #14171c;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 11px;
  border-radius: 999px;
  text-transform: uppercase;
}

figure img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
  display: block;
}
.fallback {
  padding: 60px 20px;
  color: var(--dim);
  font-size: 1.1rem;
  background: #f1f3f5;
  border-radius: 6px;
}
.hidden { display: none !important; }

.meme-title {
  margin-top: 12px;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.35;
}
.meme-meta { margin-top: 4px; color: var(--dim); font-size: 0.85rem; }

/* ── Przyciski ──────────────────────────────────── */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.btn {
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 12px 24px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: var(--yellow);
  color: #14171c;
  box-shadow: 0 6px 0 #b08a00;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #b08a00; }
.btn-ghost {
  background: transparent;
  color: #c7cdd8;
  border: 2px solid #2a2f3a;
  box-shadow: none;
}
.btn-ghost:active { transform: translateY(2px); }

.status { color: var(--muted); font-size: 0.95rem; min-height: 1.4em; }
.hint { color: var(--dim); font-size: 0.85rem; margin-top: -8px; }
.footer-note { color: #3d434f; font-size: 0.75rem; margin-top: 4px; }

canvas#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}

@media (max-width: 520px) {
  .meme-card { padding: 16px 12px 12px; }
  .meme-card::before, .meme-card::after { width: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .tape, .lamp { animation: none; }
}
