/* ===== BRAINROT SIGMA SKELETON STYLES ===== */
/* deep-fried · cursed · maximalist · acid */

:root {
  --bg-black: #050505;
  --bg-deeper: #000;
  --acid-green: #39ff14;
  --acid-green-glow: #00ff66;
  --blood-red: #ff003c;
  --blood-deep: #b80020;
  --neon-purple: #b026ff;
  --neon-magenta: #ff00ea;
  --bone-white: #f4f1e8;
  --bone-cream: #d8d3c2;
  --skull-yellow: #ffd60a;
  --grim-blue: #00d4ff;
}

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

html, body {
  background: var(--bg-black);
  color: var(--bone-white);
  font-family: 'VT323', monospace;
  overflow-x: hidden;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(176, 38, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 0, 60, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(57, 255, 20, 0.1) 0%, transparent 50%),
    var(--bg-black);
  background-attachment: fixed;
}

/* ===== NOISE OVERLAY ===== */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' /%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.4;
}

/* ===== HEADER ===== */
.header {
  position: relative;
  z-index: 10;
  padding: 16px 24px;
  border-bottom: 3px solid var(--acid-green);
  background: linear-gradient(180deg, rgba(0,0,0,0.8), transparent);
  box-shadow: 0 0 40px rgba(57, 255, 20, 0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  max-width: 1400px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Creepster', cursive;
  font-size: 32px;
  color: var(--acid-green);
  text-shadow:
    0 0 10px var(--acid-green-glow),
    2px 2px 0 var(--blood-red),
    -2px -2px 0 var(--neon-purple);
  letter-spacing: 2px;
}

.brand-skull {
  font-size: 28px;
  animation: spin-skull 8s linear infinite;
  display: inline-block;
}

@keyframes spin-skull {
  0%, 70% { transform: rotate(0deg); }
  80% { transform: rotate(-15deg); }
  90% { transform: rotate(15deg); }
  100% { transform: rotate(0deg); }
}

.ca-block {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.6);
  border: 2px dashed var(--neon-magenta);
  padding: 6px 12px;
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: var(--bone-cream);
  max-width: 100%;
  overflow: hidden;
}

.ca-label {
  color: var(--neon-magenta);
  font-weight: bold;
  text-shadow: 0 0 8px var(--neon-magenta);
}

.ca-value {
  font-family: 'VT323', monospace;
  font-size: 16px;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  color: var(--acid-green);
}

.ca-copy {
  background: var(--acid-green);
  color: var(--bg-black);
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.1s;
}

.ca-copy:hover { transform: scale(1.1); }
.ca-copy:active { transform: scale(0.9); }
.ca-copy.copied {
  background: var(--skull-yellow);
}

.links {
  display: flex;
  gap: 10px;
}

.link {
  font-family: 'Bungee', sans-serif;
  font-size: 16px;
  padding: 10px 18px;
  text-decoration: none;
  border: 3px solid;
  position: relative;
  transition: transform 0.15s;
  letter-spacing: 1px;
  display: inline-block;
}

.link:hover { transform: translate(-3px, -3px); }
.link:active { transform: translate(2px, 2px); }

.link-pump {
  background: var(--skull-yellow);
  color: var(--bg-black);
  border-color: var(--bg-black);
  box-shadow: 6px 6px 0 var(--bg-black), 6px 6px 0 4px var(--blood-red);
}
.link-pump:hover {
  box-shadow: 9px 9px 0 var(--bg-black), 9px 9px 0 4px var(--blood-red);
}

.link-x {
  background: var(--bg-black);
  color: var(--bone-white);
  border-color: var(--bone-white);
  box-shadow: 6px 6px 0 var(--neon-magenta);
}
.link-x:hover {
  box-shadow: 9px 9px 0 var(--neon-magenta);
}

/* ===== HERO with side stats ===== */
.hero {
  padding: 70px 30px 40px;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.hero-stats {
  display: flex;
  align-items: center;
}

.hero-stats-left { justify-content: flex-end; }
.hero-stats-right { justify-content: flex-start; }

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(0,0,0,0.55);
  border: 3px solid var(--neon-purple);
  padding: 14px 22px;
  box-shadow:
    0 0 24px rgba(176, 38, 255, 0.5),
    inset 0 0 20px rgba(176, 38, 255, 0.15),
    6px 6px 0 var(--blood-red);
  min-width: 180px;
  position: relative;
  animation: stat-glow 3s ease-in-out infinite;
}

@keyframes stat-glow {
  0%, 100% { box-shadow: 0 0 24px rgba(176, 38, 255, 0.5), inset 0 0 20px rgba(176, 38, 255, 0.15), 6px 6px 0 var(--blood-red); }
  50% { box-shadow: 0 0 36px rgba(57, 255, 20, 0.5), inset 0 0 20px rgba(176, 38, 255, 0.2), 6px 6px 0 var(--blood-red); }
}

.hero-stat-label {
  font-family: 'Bungee', sans-serif;
  font-size: 13px;
  color: var(--neon-magenta);
  letter-spacing: 3px;
  text-shadow: 0 0 8px var(--neon-magenta);
  margin-bottom: 4px;
}

.hero-stat-value {
  font-family: 'VT323', monospace;
  font-size: 36px;
  color: var(--acid-green);
  text-shadow:
    0 0 12px var(--acid-green-glow),
    2px 2px 0 var(--bg-black);
  letter-spacing: 1px;
  line-height: 1;
}

.hero-stat-value.flash {
  animation: stat-flash 0.6s ease-out;
}

@keyframes stat-flash {
  0% { color: var(--skull-yellow); transform: scale(1.15); text-shadow: 0 0 24px var(--skull-yellow); }
  100% { color: var(--acid-green); transform: scale(1); text-shadow: 0 0 12px var(--acid-green-glow), 2px 2px 0 var(--bg-black); }
}

.hero-title {
  font-family: 'Metal Mania', cursive;
  font-size: clamp(44px, 9vw, 130px);
  line-height: 0.92;
  letter-spacing: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.title-line {
  display: inline-block;
  position: relative;
  text-shadow:
    4px 4px 0 var(--bg-black),
    -4px -4px 0 var(--bg-black),
    4px -4px 0 var(--bg-black),
    -4px 4px 0 var(--bg-black);
  -webkit-text-stroke: 2px var(--bg-black);
}

.title-line-1 {
  color: var(--blood-red);
  text-shadow:
    4px 4px 0 var(--bg-black),
    8px 8px 0 var(--neon-purple);
  transform: rotate(-2deg);
  animation: wobble-1 6s ease-in-out infinite;
}

.title-line-2 {
  color: var(--acid-green);
  text-shadow:
    4px 4px 0 var(--bg-black),
    8px 8px 0 var(--blood-red);
  transform: rotate(1deg) translateX(-20px);
  animation: wobble-2 7s ease-in-out infinite;
}

.title-line-3 {
  color: var(--neon-magenta);
  text-shadow:
    4px 4px 0 var(--bg-black),
    8px 8px 0 var(--acid-green);
  transform: rotate(-1deg) translateX(15px);
  animation: wobble-3 5s ease-in-out infinite;
}

@keyframes wobble-1 {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(-3deg) translateY(-4px); }
}
@keyframes wobble-2 {
  0%, 100% { transform: rotate(1deg) translateX(-20px); }
  50% { transform: rotate(2deg) translateX(-18px) translateY(-4px); }
}
@keyframes wobble-3 {
  0%, 100% { transform: rotate(-1deg) translateX(15px); }
  50% { transform: rotate(-2deg) translateX(13px) translateY(-4px); }
}

/* ===== GENERATOR ===== */
.generator {
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 5;
}

.generator-card {
  background: linear-gradient(135deg, rgba(20,0,30,0.95), rgba(0,0,0,0.95));
  border: 4px solid var(--acid-green);
  box-shadow:
    0 0 60px rgba(57, 255, 20, 0.4),
    inset 0 0 40px rgba(176, 38, 255, 0.15),
    12px 12px 0 var(--blood-red),
    24px 24px 0 var(--neon-purple);
  padding: 32px 28px 28px;
  max-width: 560px;
  width: 100%;
  position: relative;
}

.card-corner {
  position: absolute;
  font-size: 22px;
  filter: drop-shadow(0 0 6px var(--acid-green-glow));
}
.card-corner-tl { top: -14px; left: -14px; }
.card-corner-tr { top: -14px; right: -14px; }
.card-corner-bl { bottom: -14px; left: -14px; }
.card-corner-br { bottom: -14px; right: -14px; }

.gen-title {
  font-family: 'Creepster', cursive;
  font-size: 44px;
  color: var(--skull-yellow);
  text-align: center;
  letter-spacing: 3px;
  text-shadow:
    3px 3px 0 var(--blood-red),
    -3px -3px 0 var(--neon-purple),
    0 0 20px var(--skull-yellow);
}

.gen-sub {
  text-align: center;
  font-family: 'VT323', monospace;
  font-size: 18px;
  color: var(--bone-cream);
  margin-top: 4px;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

.gen-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background:
    repeating-linear-gradient(45deg, rgba(176,38,255,0.08) 0 10px, transparent 10px 20px),
    var(--bg-deeper);
  border: 3px dashed var(--neon-magenta);
  margin-bottom: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.preview-placeholder {
  text-align: center;
  color: var(--bone-cream);
  cursor: default;
}

.placeholder-skull {
  font-size: 100px;
  filter: drop-shadow(0 0 20px var(--neon-purple));
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 1; }
}

.placeholder-text {
  font-family: 'Bungee', sans-serif;
  font-size: 16px;
  margin-top: 12px;
  letter-spacing: 2px;
  color: var(--acid-green);
}

.preview-img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-deeper);
}

.preview-img.visible {
  display: block;
  animation: slam-in 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes slam-in {
  0% { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.preview-loader {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.preview-loader.visible { display: flex; }

.loader-skull {
  font-size: 90px;
  animation: shake 0.4s infinite;
  filter: drop-shadow(0 0 20px var(--blood-red));
}

@keyframes shake {
  0%, 100% { transform: translate(0,0) rotate(0); }
  25% { transform: translate(-4px, 2px) rotate(-3deg); }
  50% { transform: translate(4px, -2px) rotate(3deg); }
  75% { transform: translate(-2px, 4px) rotate(-2deg); }
}

.loader-text {
  font-family: 'Creepster', cursive;
  font-size: 24px;
  color: var(--acid-green);
  letter-spacing: 3px;
  text-shadow: 0 0 12px var(--acid-green-glow);
}

/* ===== GENERATE BUTTON ===== */
.gen-button {
  width: 100%;
  padding: 22px 16px;
  font-family: 'Bungee', sans-serif;
  border: 4px solid var(--bg-black);
  background: linear-gradient(135deg, var(--blood-red) 0%, var(--neon-magenta) 50%, var(--neon-purple) 100%);
  color: var(--bone-white);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s;
  letter-spacing: 3px;
  box-shadow:
    6px 6px 0 var(--bg-black),
    6px 6px 0 4px var(--acid-green);
  text-shadow: 3px 3px 0 var(--bg-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gen-button:hover:not(:disabled) {
  transform: translate(-3px, -3px);
  box-shadow:
    9px 9px 0 var(--bg-black),
    9px 9px 0 4px var(--acid-green);
}
.gen-button:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow:
    3px 3px 0 var(--bg-black),
    3px 3px 0 4px var(--acid-green);
}

.gen-button:disabled {
  cursor: not-allowed;
  background: linear-gradient(135deg, #333 0%, #222 100%);
  border-color: #555;
}

.gen-button-label {
  font-size: 32px;
}

.gen-button-sub {
  font-size: 12px;
  opacity: 0.85;
  letter-spacing: 2px;
}

.gen-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  justify-content: center;
  min-height: 28px;
}

.meta-pill {
  font-family: 'VT323', monospace;
  background: var(--bg-deeper);
  color: var(--acid-green);
  padding: 4px 12px;
  border: 1px solid var(--acid-green);
  font-size: 16px;
  letter-spacing: 1px;
  text-shadow: 0 0 6px var(--acid-green-glow);
}
.meta-pill:empty { display: none; }

.gen-actions {
  display: none;
  gap: 10px;
  margin-top: 14px;
}
.gen-actions.visible { display: flex; }

.action-btn {
  flex: 1;
  padding: 12px;
  font-family: 'Bungee', sans-serif;
  font-size: 14px;
  border: 3px solid var(--bg-black);
  background: var(--acid-green);
  color: var(--bg-black);
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.1s;
  text-decoration: none;
  text-align: center;
  box-shadow: 4px 4px 0 var(--blood-red);
}

.action-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--blood-red);
}

#share-btn {
  background: var(--neon-magenta);
  box-shadow: 4px 4px 0 var(--bg-black);
}
#share-btn:hover { box-shadow: 6px 6px 0 var(--bg-black); }

/* ===== GALLERY ===== */
.gallery-section {
  padding: 50px 20px 80px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.gallery-header {
  text-align: center;
  margin-bottom: 32px;
}

.gallery-title {
  font-family: 'Creepster', cursive;
  font-size: clamp(40px, 7vw, 80px);
  color: var(--bone-white);
  letter-spacing: 4px;
  text-shadow:
    3px 3px 0 var(--blood-red),
    -3px -3px 0 var(--acid-green),
    0 0 30px var(--neon-purple);
}

.gallery-sub {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: var(--bone-cream);
  margin-top: 8px;
  letter-spacing: 2px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.meme-card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 3px solid var(--bone-white);
  cursor: zoom-in;
  transition: transform 0.15s;
  background: var(--bg-deeper);
}

.meme-card:nth-child(3n) { border-color: var(--acid-green); }
.meme-card:nth-child(3n+1) { border-color: var(--blood-red); }
.meme-card:nth-child(3n+2) { border-color: var(--neon-magenta); }

.meme-card:hover {
  transform: scale(1.04) rotate(-1deg);
  z-index: 2;
  box-shadow: 0 0 30px rgba(57, 255, 20, 0.5);
}

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

.meme-card.new-arrival {
  animation: new-arrival 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes new-arrival {
  0% { transform: scale(0.3) rotate(-15deg); opacity: 0; box-shadow: 0 0 60px var(--acid-green-glow); }
  60% { transform: scale(1.08) rotate(2deg); box-shadow: 0 0 60px var(--acid-green-glow); }
  100% { transform: scale(1) rotate(0); opacity: 1; box-shadow: 0 0 30px rgba(57, 255, 20, 0.3); }
}

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--bone-cream);
  font-family: 'Bungee', sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
}

.empty-skull {
  font-size: 80px;
  filter: drop-shadow(0 0 20px var(--neon-purple));
  margin-bottom: 16px;
}

.load-more {
  display: block;
  margin: 30px auto 0;
  padding: 14px 36px;
  font-family: 'Bungee', sans-serif;
  background: var(--bg-black);
  color: var(--acid-green);
  border: 3px solid var(--acid-green);
  cursor: pointer;
  letter-spacing: 2px;
  font-size: 16px;
  transition: all 0.15s;
  box-shadow: 5px 5px 0 var(--blood-red);
}

.load-more:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--blood-red);
  background: var(--acid-green);
  color: var(--bg-black);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  cursor: zoom-out;
  backdrop-filter: blur(8px);
}

.lightbox.visible {
  display: flex;
  animation: lightbox-in 0.25s ease-out;
}

@keyframes lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-inner {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  border: 4px solid var(--acid-green);
  box-shadow:
    0 0 80px var(--acid-green-glow),
    0 0 40px var(--neon-magenta);
  cursor: zoom-out;
  animation: lightbox-img-in 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes lightbox-img-in {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 44px;
  height: 44px;
  background: var(--blood-red);
  color: var(--bone-white);
  border: 3px solid var(--bg-black);
  font-family: 'Bungee', sans-serif;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--bg-black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.lightbox-close:hover {
  background: var(--neon-magenta);
  transform: scale(1.08);
}

.lightbox-actions {
  position: absolute;
  bottom: -60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
}

.lightbox-btn {
  padding: 10px 22px;
  background: var(--acid-green);
  color: var(--bg-black);
  border: 3px solid var(--bg-black);
  font-family: 'Bungee', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--blood-red);
  transition: transform 0.1s;
}

.lightbox-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--blood-red);
}

/* ===== FOOTER ===== */
.footer {
  border-top: 3px solid var(--neon-purple);
  padding: 24px 20px;
  text-align: center;
  background: rgba(0,0,0,0.6);
}

.footer-text {
  font-family: 'Bungee', sans-serif;
  font-size: 12px;
  color: var(--bone-cream);
  letter-spacing: 2px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding: 40px 16px 30px;
  }
  .hero-stats-left,
  .hero-stats-right {
    justify-content: center;
  }
  .hero-stats-left { order: 2; }
  .hero-title { order: 1; }
  .hero-stats-right { order: 3; }

  /* on mobile show both stats side-by-side under the title to save space */
  .hero-stats-left,
  .hero-stats-right {
    display: flex;
    width: 100%;
  }
  .hero-stat { min-width: 140px; flex: 1; max-width: 240px; }
}

@media (max-width: 768px) {
  .header-inner { justify-content: center; }
  .ca-value { max-width: 180px; }
  .gen-title { font-size: 34px; }
  .gen-button-label { font-size: 24px; }
  .generator-card {
    padding: 24px 18px 22px;
    box-shadow:
      0 0 40px rgba(57, 255, 20, 0.4),
      inset 0 0 40px rgba(176, 38, 255, 0.15),
      6px 6px 0 var(--blood-red),
      12px 12px 0 var(--neon-purple);
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .hero-stat-value { font-size: 28px; }
  .hero-stat { padding: 10px 16px; }
}

@media (max-width: 420px) {
  .hero { padding: 30px 12px 20px; }
  .gen-title { font-size: 28px; }
  .links { flex-direction: column; width: 100%; }
  .link { text-align: center; }
  .hero-stats-left,
  .hero-stats-right {
    flex-direction: column;
    align-items: center;
  }
}
