/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red: #e8001d;
  --gold: #ffd700;
  --blue: #002868;
  --dark-blue: #001a45;
  --white: #ffffff;
  --bg: #0a0a1a;
  --card-bg: rgba(255,255,255,0.07);
  --card-border: rgba(255,255,255,0.12);
  --radius: 20px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Arial Rounded MT Bold', Arial, sans-serif;
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(232,0,29,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(0,40,104,0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(255,215,0,0.08) 0%, transparent 60%);
}

/* ===== PARTICLE CANVAS ===== */
#particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ===== HEADER ===== */
header {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  position: relative;
}

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.logo-emoji {
  font-size: clamp(2.5rem, 8vw, 4rem);
  animation: logoWiggle 3s ease-in-out infinite;
  display: inline-block;
}

@keyframes logoWiggle {
  0%, 100% { transform: rotate(-5deg) scale(1); }
  25% { transform: rotate(8deg) scale(1.1); }
  50% { transform: rotate(-3deg) scale(0.95); }
  75% { transform: rotate(6deg) scale(1.05); }
}

h1 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2.2rem, 8vw, 4.5rem);
  background: linear-gradient(135deg, var(--red) 0%, var(--gold) 50%, var(--red) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(255,215,0,0.3));
}

h1 .dot { color: var(--gold); -webkit-text-fill-color: var(--gold); }

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.tagline {
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  color: rgba(255,255,255,0.6);
  font-style: italic;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

/* ===== FART COUNTER ===== */
.fart-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(232,0,29,0.3), rgba(0,40,104,0.3));
  border: 2px solid var(--gold);
  border-radius: 50px;
  padding: 0.4rem 1.2rem;
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  font-weight: 900;
}

.counter-num {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  color: var(--gold);
  min-width: 3ch;
  text-align: center;
  transition: transform 0.15s;
}

.counter-num.bump { transform: scale(1.5); }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1rem 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: center;
  flex-wrap: wrap;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(0.75rem, 2.5vw, 0.95rem);
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--card-border);
  border-radius: 50px;
  background: var(--card-bg);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tab:hover, .tab:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.tab.active {
  background: linear-gradient(135deg, var(--red), #c00018);
  border-color: var(--red);
  color: white;
  box-shadow: 0 4px 20px rgba(232,0,29,0.4);
}

/* ===== SOUND GRID ===== */
.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .sound-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.75rem;
  }
}

@media (min-width: 768px) {
  .sound-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ===== SOUND BUTTONS ===== */
.sound-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.2rem 0.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  position: relative;
  overflow: hidden;
  min-height: 130px;
}

.sound-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.sound-btn:hover::before, .sound-btn:focus-visible::before { opacity: 1; }

.sound-btn:hover, .sound-btn:focus-visible {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.sound-btn:active, .sound-btn.playing {
  transform: scale(0.94);
}

/* Category color themes */
.sound-btn.cat-famous {
  border-color: rgba(232,0,29,0.5);
  background: linear-gradient(135deg, rgba(232,0,29,0.15), rgba(0,40,104,0.15));
}
.sound-btn.cat-famous:hover { border-color: var(--red); box-shadow: 0 12px 40px rgba(232,0,29,0.3); }

.sound-btn.cat-classic {
  border-color: rgba(139,90,43,0.5);
  background: linear-gradient(135deg, rgba(139,90,43,0.2), rgba(80,50,20,0.2));
}
.sound-btn.cat-classic:hover { border-color: #c8852a; box-shadow: 0 12px 40px rgba(200,133,42,0.3); }

.sound-btn.cat-epic {
  border-color: rgba(255,80,0,0.5);
  background: linear-gradient(135deg, rgba(255,80,0,0.15), rgba(120,0,80,0.15));
}
.sound-btn.cat-epic:hover { border-color: #ff5000; box-shadow: 0 12px 40px rgba(255,80,0,0.3); }

.sound-btn.cat-sneaky {
  border-color: rgba(0,180,100,0.4);
  background: linear-gradient(135deg, rgba(0,100,50,0.2), rgba(0,50,30,0.2));
}
.sound-btn.cat-sneaky:hover { border-color: #00b464; box-shadow: 0 12px 40px rgba(0,180,100,0.25); }

.sound-btn.hidden { display: none; }

.btn-emoji {
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1;
  transition: transform 0.1s;
  display: block;
}

.sound-btn.playing .btn-emoji {
  animation: emojiPop 0.4s ease-out;
}

@keyframes emojiPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.5) rotate(15deg); }
  70% { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.btn-label {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  text-align: center;
  line-height: 1.2;
  color: rgba(255,255,255,0.9);
}

/* Ripple effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnim 0.5s linear;
  background: rgba(255,255,255,0.25);
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* Playing glow pulse */
.sound-btn.playing {
  animation: playingGlow 0.5s ease-out;
}
@keyframes playingGlow {
  0% { box-shadow: 0 0 0 0 rgba(255,215,0,0.8); }
  100% { box-shadow: 0 0 0 30px rgba(255,215,0,0); }
}

/* ===== BIG RANDOM BUTTON ===== */
.big-button-section {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.big-random-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: clamp(200px, 60vw, 320px);
  height: clamp(200px, 60vw, 320px);
  border-radius: 50%;
  border: 6px solid var(--gold);
  background: radial-gradient(circle at 35% 35%, #ff2244, #9b0000);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 40px rgba(232,0,29,0.5), 0 0 0 8px rgba(255,215,0,0.15), inset 0 -8px 0 rgba(0,0,0,0.3);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  animation: bigBtnPulse 2s ease-in-out infinite;
}

@keyframes bigBtnPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(232,0,29,0.5), 0 0 0 8px rgba(255,215,0,0.15), inset 0 -8px 0 rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 70px rgba(232,0,29,0.8), 0 0 0 16px rgba(255,215,0,0.25), inset 0 -8px 0 rgba(0,0,0,0.3); }
}

.big-random-btn:hover { transform: scale(1.05); }
.big-random-btn:active { transform: scale(0.93); animation: none; box-shadow: 0 0 20px rgba(232,0,29,0.3), inset 0 4px 0 rgba(0,0,0,0.3); }

.big-btn-emoji { font-size: clamp(3.5rem, 12vw, 6rem); }

.big-btn-text {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  color: white;
  text-align: center;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.big-btn-sub {
  margin-top: 0.8rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
}

/* ===== SHARE SECTION ===== */
.share-section {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.share-section h2 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.share-section p {
  color: rgba(255,255,255,0.6);
  margin-bottom: 1.2rem;
}

.share-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  padding: 0.7rem 1.3rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.share-btn:hover { transform: translateY(-2px); }
.share-btn:active { transform: scale(0.95); }

.share-twitter { background: #000; color: white; }
.share-whatsapp { background: #25d366; color: white; }
.share-copy { background: var(--gold); color: #000; }

.copy-confirm {
  margin-top: 0.75rem;
  color: #00e676;
  font-weight: 700;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

/* ===== SEO SECTION ===== */
.seo-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--card-border);
}

.seo-section h2 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.seo-section h3 {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  margin: 1.2rem 0 0.5rem;
}

.seo-section p {
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
}

.seo-section ul {
  list-style: none;
  padding: 0;
}

.seo-section li {
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
  border-top: 1px solid var(--card-border);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.footer-nav a {
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--gold); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--gold);
  color: #000;
  font-weight: 900;
  font-family: 'Fredoka One', cursive;
  padding: 0.75rem 1.8rem;
  border-radius: 50px;
  font-size: 1rem;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== ACCESSIBILITY ===== */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
