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

:root {
  --pink:   #FF3D8B;
  --yellow: #FFD600;
  --lime:   #00E676;
  --orange: #FF6D00;
  --purple: #AA00FF;
  --blue:   #00B0FF;
  --teal:   #00E5FF;
}

body {
  font-family: 'Inter', sans-serif;
  background: #FFFDE7;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ========================
   AGE GATE
======================== */

#age-gate {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0D47A1 0%, #1976D2 45%, #FF6D00 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.age-gate-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 0;
  max-width: 780px;
  width: 100%;
}

.kermit-popup {
  width: 280px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-right: -20px;
  margin-bottom: -24px;
  filter: drop-shadow(6px 0 20px rgba(0,0,0,0.35));
  animation: kermitBob 2.2s ease-in-out infinite;
  position: relative;
  z-index: 10;
}

@keyframes kermitBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-14px) rotate(3deg); }
}

.age-gate-box {
  background: white;
  border-radius: 28px;
  padding: 40px 40px;
  flex: 1;
  text-align: left;
  box-shadow: 0 0 0 6px #FFD600, 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: visible;
}

.age-gate-content {
  width: 100%;
}

@media (max-width: 600px) {
  .age-gate-wrapper {
    flex-direction: column;
    align-items: center;
  }
  .kermit-popup {
    width: 160px;
    margin: 0 0 -20px;
  }
  .age-gate-box {
    text-align: center;
  }
}

.age-gate-box h2 {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(90deg, #1565C0, #FF6D00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.age-gate-box .subtitle {
  color: #888;
  margin-bottom: 28px;
  font-size: 1rem;
  transition: opacity 0.4s ease;
}

.age-gate-box .question {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: #333;
}

.age-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

.age-buttons button {
  padding: 18px 12px;
  border: 3px solid #FFD600;
  border-radius: 16px;
  background: white;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  transition: all 0.2s;
  line-height: 1.5;
  color: #333;
}

.age-buttons button:hover {
  border-color: #1565C0;
  background: #E3F2FD;
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 8px 20px rgba(21, 101, 192, 0.3);
}

#age-response {
  margin-top: 20px;
  display: none;
}

#age-message {
  background: #FFF8E1;
  border-left: 5px solid #FFD600;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 1rem;
  color: #333;
  text-align: left;
  line-height: 1.6;
}

.enter-btn {
  background: linear-gradient(135deg, #1565C0, #FF6D00);
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  width: 100%;
  letter-spacing: 0.5px;
}

.enter-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 28px rgba(21, 101, 192, 0.5);
}

/* ========================
   HEADER
======================== */

header {
  background: linear-gradient(135deg, #0D47A1 0%, #1976D2 45%, #FF6D00 100%);
  color: white;
  padding: 56px 24px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::before {
  content: '🔥✨💥🎉🎊🤩🌈💫';
  font-size: 1.4rem;
  position: absolute;
  top: 10px;
  left: 0;
  width: 200%;
  opacity: 0.6;
  white-space: nowrap;
  letter-spacing: 8px;
  animation: ticker 12s linear infinite;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.header-content h1 {
  font-size: 3.2rem;
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: -1px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.35), 0 0 20px rgba(0,0,0,0.2);
}

.header-content p {
  font-size: 1.05rem;
  color: white;
  margin-bottom: 36px;
  font-weight: 700;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
}

.search-wrapper {
  display: flex;
  max-width: 580px;
  margin: 0 auto;
  gap: 12px;
}

.search-wrapper input {
  flex: 1;
  padding: 16px 24px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  color: #1a1a2e;
  border: 3px solid transparent;
  transition: border-color 0.2s;
}

.search-wrapper input:focus {
  border-color: #FFD600;
}

#random-btn {
  padding: 16px 24px;
  background: #1a1a2e;
  color: #FFD600;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  transition: all 0.2s;
}

#random-btn:hover {
  background: #FFD600;
  color: #1a1a2e;
  transform: translateY(-2px) rotate(-2deg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ========================
   MAIN
======================== */

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px;
}

main h2 {
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 24px;
  color: #1a1a2e;
}

/* ========================
   WORD CARDS
======================== */

.word-card {
  border-radius: 20px;
  padding: 32px;
  margin-bottom: 20px;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  position: relative;
  overflow: hidden;
}

.word-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
}

/* Per-card cycling accent colors */
.word-card:nth-child(6n+1) { box-shadow: 0 5px 0 #FF3D8B, 0 8px 28px rgba(255,61,139,0.12); background: linear-gradient(160deg, #fff 85%, #FFF0F5); }
.word-card:nth-child(6n+2) { box-shadow: 0 5px 0 #FF6D00, 0 8px 28px rgba(255,109,0,0.12); background: linear-gradient(160deg, #fff 85%, #FFF5EE); }
.word-card:nth-child(6n+3) { box-shadow: 0 5px 0 #FFD600, 0 8px 28px rgba(255,214,0,0.12); background: linear-gradient(160deg, #fff 85%, #FFFDE7); }
.word-card:nth-child(6n+4) { box-shadow: 0 5px 0 #00C853, 0 8px 28px rgba(0,200,83,0.12);  background: linear-gradient(160deg, #fff 85%, #F0FFF4); }
.word-card:nth-child(6n+5) { box-shadow: 0 5px 0 #00B0FF, 0 8px 28px rgba(0,176,255,0.12); background: linear-gradient(160deg, #fff 85%, #E8F7FF); }
.word-card:nth-child(6n+0) { box-shadow: 0 5px 0 #AA00FF, 0 8px 28px rgba(170,0,255,0.12); background: linear-gradient(160deg, #fff 85%, #F5EEFF); }

.word-card:nth-child(6n+1)::before { background: linear-gradient(90deg, #FF3D8B, #FF6D00); }
.word-card:nth-child(6n+2)::before { background: linear-gradient(90deg, #FF6D00, #FFD600); }
.word-card:nth-child(6n+3)::before { background: linear-gradient(90deg, #FFD600, #00C853); }
.word-card:nth-child(6n+4)::before { background: linear-gradient(90deg, #00C853, #00B0FF); }
.word-card:nth-child(6n+5)::before { background: linear-gradient(90deg, #00B0FF, #AA00FF); }
.word-card:nth-child(6n+0)::before { background: linear-gradient(90deg, #AA00FF, #FF3D8B); }

.word-card:nth-child(6n+1) .card-word { background: linear-gradient(90deg, #FF3D8B, #FF6D00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.word-card:nth-child(6n+2) .card-word { background: linear-gradient(90deg, #FF6D00, #d4a000); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.word-card:nth-child(6n+3) .card-word { background: linear-gradient(90deg, #c8a000, #00A86B); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.word-card:nth-child(6n+4) .card-word { background: linear-gradient(90deg, #00A86B, #0095D9); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.word-card:nth-child(6n+5) .card-word { background: linear-gradient(90deg, #0095D9, #8800CC); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.word-card:nth-child(6n+0) .card-word { background: linear-gradient(90deg, #8800CC, #FF3D8B); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.word-card:hover {
  transform: translateY(-6px) rotate(0.5deg);
  filter: brightness(1.02);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
}

.card-emoji {
  font-size: 72px;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  animation: wiggle 4s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 90%, 100% { transform: rotate(0deg); }
  92%           { transform: rotate(-6deg); }
  96%           { transform: rotate(6deg); }
}

.card-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.card-word-info {
  flex: 1;
  padding-top: 6px;
}

.card-word {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(90deg, #1565C0, #FF6D00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1.1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: #FFD600;
  color: #1a1a2e;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag:nth-child(2n)   { background: #1565C0; color: white; }
.tag:nth-child(3n)   { background: #00E676; color: #1a1a2e; }
.tag:nth-child(4n)   { background: #00B0FF; color: white; }

.card-def {
  font-size: 1.1rem;
  line-height: 1.75;
  color: #2a2a2a;
  margin-bottom: 14px;
}

.card-example {
  font-style: italic;
  color: #555;
  font-size: 1rem;
  line-height: 1.65;
  border-left: 4px solid #FFD600;
  padding-left: 16px;
  margin-bottom: 24px;
  background: #FFFDE7;
  padding: 12px 16px;
  border-radius: 0 10px 10px 0;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.vote-buttons {
  display: flex;
  gap: 8px;
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  border: 2.5px solid #e8e8e8;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: #555;
  transition: all 0.15s;
}

.vote-btn:hover,
.vote-btn.up.active {
  background: #E8FFF0;
  border-color: #00E676;
  color: #00796B;
  transform: scale(1.05);
}

.vote-btn.down:hover,
.vote-btn.down.active {
  background: #E3F2FD;
  border-color: #1565C0;
  color: #1565C0;
  transform: scale(1.05);
}

.wod-badge {
  font-size: 0.82rem;
  font-weight: 800;
  color: #FF6D00;
  background: #FFF3E0;
  padding: 4px 10px;
  border-radius: 50px;
}

/* ========================
   WOD SECTION
======================== */

#wod-section {
  margin-bottom: 52px;
}

#wod-section .word-card {
  box-shadow: 0 4px 0 #FF6D00, 0 6px 24px rgba(255, 109, 0, 0.12);
}

#wod-section .word-card:hover {
  box-shadow: 0 8px 0 #1565C0, 0 14px 36px rgba(21, 101, 192, 0.2);
}

#wod-section .word-card::before {
  background: linear-gradient(90deg, #FFD600, #FF6D00, #1565C0);
}

/* ========================
   NO RESULTS
======================== */

.no-results {
  text-align: center;
  padding: 72px 24px;
  color: #aaa;
}

.no-results p:first-child {
  font-size: 4rem;
  margin-bottom: 16px;
}

.no-results p:last-child {
  font-size: 1.05rem;
}

/* ========================
   FOOTER
======================== */

footer {
  background: linear-gradient(135deg, #1a1a2e, #2d1b4e);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 36px 24px;
  font-size: 0.9rem;
  line-height: 1.8;
  border-top: 6px solid #FFD600;
}

footer strong {
  color: #FFD600;
}

#top-btn {
  margin-top: 16px;
  padding: 12px 28px;
  background: #FFD600;
  color: #1a1a2e;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 900;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 0.15s;
}

#top-btn:hover {
  transform: scale(1.07);
}

@keyframes pageSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

body.spinning {
  animation: pageSpin 3s linear;
  /* transform-origin set dynamically in JS to viewport center */
}

/* ========================
   RESPONSIVE
======================== */

@media (max-width: 600px) {
  .header-content h1 {
    font-size: 2.2rem;
  }

  .age-gate-box {
    padding: 36px 24px;
  }

  .card-top {
    flex-direction: column;
    gap: 12px;
  }

  .card-emoji {
    font-size: 56px;
  }

  .card-word {
    font-size: 1.7rem;
  }

  .word-card {
    padding: 24px;
  }

  .search-wrapper {
    flex-direction: column;
  }

  #random-btn {
    border-radius: 12px;
  }
}
