:root {
  --bg-dark: #0a1712;
  --bg-soft: #10241c;
  --paper: #ecfff4;
  --cyan: #84f7b2;
  --yellow: #d8ff78;
  --red: #ff4d4d;
  --lime: #b5ff93;
  --ink: #141414;
  --muted: #b6d7c4;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--paper);
  background: var(--bg-dark);
}

.app-root {
  position: relative;
  min-height: calc(100vh - 68px);
  isolation: isolate;
  overflow-x: hidden;
}

.site-topbar {
  width: min(960px, 100% - 2rem);
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 10;
}

.site-logo {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
}

.site-logo-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #082014;
  font-weight: 800;
  background: linear-gradient(135deg, #84f7b2, #d8ff78);
  font-family: "Plus Jakarta Sans", sans-serif;
}

.site-logo-text strong {
  display: block;
  line-height: 1;
  font-size: 0.98rem;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.site-logo-text span {
  color: var(--muted);
  font-size: 0.75rem;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.top-links a {
  color: var(--lime);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.scene-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(circle at 14% 12%, rgba(47, 204, 116, 0.20), transparent 36%),
    radial-gradient(circle at 86% 18%, rgba(216, 255, 120, 0.14), transparent 34%),
    radial-gradient(circle at 32% 82%, rgba(132, 247, 178, 0.12), transparent 38%),
    linear-gradient(140deg, #0a1712 0%, #10241c 58%, #09120f 100%);
  animation: drift 16s ease-in-out infinite alternate;
}

.scene-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.shell {
  width: min(960px, 100% - 2rem);
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.hero {
  position: relative;
  padding: 1rem 1rem 1.25rem;
}

.hero::before {
  content: "meme chaos";
  position: absolute;
  top: -0.55rem;
  right: 0;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  transform: rotate(4deg);
}

.hero-kicker {
  margin: 0;
  color: var(--yellow);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0.35rem 0 0;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
}

.hero-subtitle {
  margin: 0.75rem 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  color: var(--cyan);
}

.hero-intro {
  margin: 0.8rem 0 0;
  max-width: 60ch;
  color: var(--paper);
  opacity: 0.9;
}

.question-card,
.results-card {
  background: linear-gradient(140deg, rgba(12, 34, 24, 0.9), rgba(16, 42, 30, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.progress-wrap {
  margin-bottom: 1rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--yellow), #47d88e);
  transition: width 260ms ease;
}

.question-text {
  margin: 0.6rem 0 0;
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  line-height: 1.35;
}

.question-weight {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.meme-frame {
  margin: 0.7rem 0 1rem;
  padding: 0.42rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.24);
  transform: rotate(var(--meme-tilt, 0deg));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  transition: transform 180ms ease;
}

.meme-frame:hover {
  transform: rotate(var(--meme-tilt, 0deg)) translateY(-1px);
}

.meme-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.meme-frame figcaption {
  margin-top: 0.42rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.answers-grid {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.answer-btn {
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
  cursor: pointer;
  text-align: left;
  padding: 0.85rem 0.95rem;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.answer-btn strong {
  display: block;
  font-size: 1rem;
}

.answer-btn:hover {
  transform: translateY(-2px) rotate(-0.35deg);
  border-color: rgba(132, 247, 178, 0.75);
  background: rgba(132, 247, 178, 0.14);
}

.answer-btn:active {
  transform: translateY(1px);
}

.answers-grid .answer-btn:nth-child(1) {
  border-color: rgba(155, 255, 69, 0.45);
}

.answers-grid .answer-btn:nth-child(2) {
  border-color: rgba(132, 247, 178, 0.45);
}

.answers-grid .answer-btn:nth-child(3) {
  border-color: rgba(255, 255, 255, 0.22);
}

.answers-grid .answer-btn:nth-child(4) {
  border-color: rgba(255, 196, 0, 0.4);
}

.answers-grid .answer-btn:nth-child(5) {
  border-color: rgba(255, 77, 77, 0.45);
}

.question-actions,
.results-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.notice-pill {
  display: inline-block;
  background: rgba(255, 77, 77, 0.14);
  border: 1px solid rgba(255, 77, 77, 0.45);
  color: #ffdede;
  border-radius: 999px;
  padding: 0.36rem 0.72rem;
  font-size: 0.77rem;
}

.ghost-btn,
.solid-btn {
  appearance: none;
  border-radius: 12px;
  padding: 0.62rem 0.9rem;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--paper);
}

.ghost-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.solid-btn {
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: linear-gradient(95deg, var(--yellow), #96e85f);
  color: var(--ink);
}

.results-hero::before {
  content: "top 3 unlocked";
}

.meter-box {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 1rem;
}

.meter-box span {
  color: var(--muted);
  font-size: 0.88rem;
}

.meter-box strong {
  font-size: 1.9rem;
  font-family: "Space Grotesk", sans-serif;
}

.meter-box small {
  color: #f9e89f;
  font-size: 0.85rem;
}

.meter-track {
  margin-top: 0.3rem;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lime), var(--yellow), var(--red));
  animation: pulse 1.7s ease-in-out infinite alternate;
}

.top-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.rank-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.rank-1 {
  border-color: rgba(245, 231, 10, 0.6);
}

.rank-2 {
  border-color: rgba(132, 247, 178, 0.6);
}

.rank-3 {
  border-color: rgba(255, 77, 77, 0.6);
}

.rank-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rank-card h2 {
  margin: 0.28rem 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
}

.rank-score {
  margin: 0.25rem 0 0;
  color: var(--yellow);
  font-weight: 700;
}

.rank-track {
  margin-top: 0.45rem;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--yellow));
}

.rank-blurb {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.full-ranking {
  margin-top: 1rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.full-ranking h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.full-ranking ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.34rem;
}

.full-ranking li {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.full-ranking strong {
  color: var(--cyan);
}

@keyframes drift {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.05) translate3d(-1.5%, 1.5%, 0);
  }
}

@keyframes pulse {
  0% {
    filter: saturate(0.95);
  }
  100% {
    filter: saturate(1.3);
  }
}

@media (max-width: 900px) {
  .top-three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-topbar {
    width: min(960px, 100% - 1rem);
    margin-top: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .top-links {
    gap: 8px;
  }

  .shell {
    width: min(960px, 100% - 1rem);
    padding-top: 1.2rem;
  }

  .question-card,
  .results-card {
    border-radius: 18px;
    padding: 1rem;
  }

  .answers-grid {
    grid-template-columns: 1fr;
  }

  .meme-frame,
  .meme-frame:hover {
    transform: none;
  }

  .hero::before {
    right: auto;
    left: 0;
  }
}
