/* Album Cover Memory - Potato-core */
@import url("https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700;800&display=swap");

:root {
  --comic-font: "Comic Sans MS", "Comic Sans", "Comic Neue", system-ui, sans-serif;
  --ink: #25162f;
  --paper: #fff8d6;
  --hot-pink: #ff4fd8;
  --banana: #ffe45c;
  --acid: #9cff3b;
  --sky: #60e7ff;
  --purple: #8c5cff;
  --danger: #ff5a5f;
  --mint: #baffef;
  --lavender: #e1d3ff;
  --shadow: 0 18px 45px rgba(37, 22, 47, 0.22);
  --border: 4px solid #25162f;
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 7.75rem;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", system-ui, sans-serif;
  background:
    radial-gradient(
      circle at 8% 10%,
      rgba(255, 79, 216, 0.35),
      transparent 26rem
    ),
    radial-gradient(
      circle at 92% 7%,
      rgba(96, 231, 255, 0.34),
      transparent 28rem
    ),
    linear-gradient(rgba(255, 248, 214, 0.22), rgba(255, 248, 214, 0.22)),
    url("assets/cloudbackground.gif");
  background-size: auto, auto, auto, cover;
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "🧠 🥔 🎴 🎸";
  position: fixed;
  inset: auto 1rem 1rem auto;
  z-index: 0;
  font-size: clamp(1.8rem, 4vw, 4rem);
  opacity: 0.16;
  pointer-events: none;
  animation: floaty 4s ease-in-out infinite alternate;
}

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 0 !important;
}

button,
input {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

code {
  padding: 0.1rem 0.35rem;
  border: 2px solid rgba(37, 22, 47, 0.25);
  border-radius: 8px;
  background: rgba(255, 248, 214, 0.85);
  font-family: inherit;
  font-weight: 900;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 99;
  padding: 0.75rem 1rem;
  background: var(--banana);
  border: var(--border);
  border-radius: 999px;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.nav-shell {
  width: min(1180px, calc(100% - 1rem));
  margin: 0 auto;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(255, 248, 214, 0.88);
  border: var(--border);
  border-radius: 999px;
  box-shadow: 7px 7px 0 rgba(37, 22, 47, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-potato {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--banana);
  border: 3px solid var(--ink);
  font-size: 1.5rem;
  animation: wiggle 1.8s ease-in-out infinite;
}

.brand strong {
  display: block;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1;
}

.brand small {
  display: block;
  max-width: 32ch;
  font-size: 0.8rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-links > a {
  display: inline-flex;
  align-items: center;
  min-height: 2.55rem;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
}

.nav-links > a:hover,
.nav-links > a.active {
  background: var(--hot-pink);
  border-color: var(--ink);
  transform: rotate(-1deg);
}

main {
  position: relative;
  z-index: 1;
}

.memory-hero {
  width: min(1180px, calc(100% - 2rem));
  margin: 2rem auto 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 1.5rem;
  align-items: stretch;
}

.hero-copy,
.score-card,
.game-shell,
.info-shell,
.site-footer {
  border: var(--border);
  border-radius: var(--radius);
  box-shadow:
    var(--shadow),
    9px 9px 0 rgba(37, 22, 47, 0.24);
}

.hero-copy {
  position: relative;
  min-height: 430px;
  padding: clamp(3rem, 6vw, 5rem) clamp(1.2rem, 3vw, 3rem)
    clamp(1.5rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background:
    linear-gradient(135deg, rgba(255, 228, 92, 0.95), rgba(255, 79, 216, 0.88)),
    url("assets/buttonbackground.gif");
  background-size: cover;
  overflow: hidden;
}

.hero-copy::after {
  content: "MATCH";
  position: absolute;
  right: -1.5rem;
  bottom: 0.5rem;
  font-size: clamp(4rem, 13vw, 11rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  color: rgba(255, 255, 255, 0.23);
  -webkit-text-stroke: 2px rgba(37, 22, 47, 0.22);
  transform: rotate(-7deg);
}

.eyebrow {
  width: fit-content;
  margin: 0 0 1rem;
  padding: 0.4rem 0.75rem;
  background: var(--acid);
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
  max-width: 100%;
  font-size: clamp(2.7rem, 6vw, 5.6rem);
  line-height: 0.88;
  letter-spacing: -0.07em;
  text-shadow:
    3px 3px 0 var(--sky),
    6px 6px 0 var(--purple);
}

.hero-copy > p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  max-width: 58ch;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
  font-weight: 800;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.85rem 1.1rem;
  border: 3px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 5px 5px 0 rgba(37, 22, 47, 0.35);
  transition: 0.15s ease;
}

.button:hover,
.button:focus-visible {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 8px 8px 0 rgba(37, 22, 47, 0.35);
  outline: none;
}

.button-primary {
  background: var(--sky);
}

.button-secondary {
  background: var(--paper);
}

.score-card {
  position: relative;
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: 1rem;
  background:
    linear-gradient(rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.64)),
    url("assets/pinkclouds.jpg");
  background-size: cover;
}

.score-sticker {
  position: absolute;
  top: 0.6rem;
  left: 0.4rem;
  z-index: 2;
  padding: 0.55rem 0.8rem;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--danger);
  color: white;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(37, 22, 47, 0.3);
  transform: rotate(-9deg);
}

.stat {
  padding: 1.25rem;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: rgba(255, 248, 214, 0.92);
  box-shadow: 5px 5px 0 rgba(37, 22, 47, 0.16);
}

.stat strong {
  display: block;
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.stat span {
  font-weight: 900;
  text-transform: uppercase;
}

.marquee-strip {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 1.5rem;
  overflow: hidden;
  border: var(--border);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 7px 7px 0 rgba(37, 22, 47, 0.22);
}

.marquee-strip div {
  display: flex;
  width: max-content;
  gap: 2rem;
  padding: 0.75rem 1rem;
  white-space: nowrap;
  animation: scroll 18s linear infinite;
}

.marquee-strip span {
  font-weight: 900;
}

.game-shell,
.info-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.5rem auto;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(255, 248, 214, 0.92);
  scroll-margin-top: 7.75rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.game-message {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: white;
  font-weight: 900;
  box-shadow: 5px 5px 0 rgba(37, 22, 47, 0.12);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 1rem;
}

.memory-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  perspective: 1000px;
}

.memory-card[disabled] {
  cursor: default;
}

.card-inner {
  position: absolute;
  inset: 0;
  border: 3px solid var(--ink);
  border-radius: 22px;
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
  box-shadow: 5px 5px 0 rgba(37, 22, 47, 0.18);
}

.memory-card.is-flipped .card-inner,
.memory-card.is-matched .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  backface-visibility: hidden;
}

.card-front {
  background:
    radial-gradient(
      circle at 25% 20%,
      rgba(255, 255, 255, 0.55),
      transparent 2rem
    ),
    linear-gradient(135deg, var(--hot-pink), var(--sky));
}

.card-front span {
  font-size: clamp(2.5rem, 7vw, 5rem);
  filter: drop-shadow(4px 4px 0 rgba(37, 22, 47, 0.28));
}

.card-back {
  transform: rotateY(180deg);
  background: var(--paper);
}

.card-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-label {
  position: absolute;
  left: 0.45rem;
  right: 0.45rem;
  bottom: 0.45rem;
  padding: 0.32rem 0.45rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 248, 214, 0.9);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.memory-card.is-matched .card-inner {
  box-shadow:
    0 0 0 5px var(--acid),
    7px 7px 0 rgba(37, 22, 47, 0.18);
}

.memory-card.is-matched .card-label {
  background: var(--acid);
  color: var(--ink);
  opacity: 1;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.info-card {
  min-width: 0;
  padding: 1rem;
  background: white;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 5px 5px 0 rgba(37, 22, 47, 0.16);
}

.info-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.35rem;
}

.info-card p {
  margin-bottom: 0;
  line-height: 1.45;
  font-weight: 800;
}

.site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 1.5rem auto 2rem;
  padding: 1.25rem;
  text-align: center;
  background: rgba(37, 22, 47, 0.92);
  color: var(--paper);
}

.site-footer p {
  margin: 0.25rem 0;
  font-weight: 800;
}

.site-footer a {
  color: var(--sky);
  font-weight: 900;
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(7deg) scale(1.06);
  }
}

@keyframes floaty {
  from {
    transform: translateY(0) rotate(-4deg);
  }
  to {
    transform: translateY(-1rem) rotate(5deg);
  }
}

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

@media (max-width: 900px) {
  html {
    scroll-padding-top: 1rem;
  }

  .site-header {
    position: static;
  }

  .nav-shell {
    border-radius: 28px;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
  }

  .memory-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 390px;
  }

  .score-card {
    grid-template-columns: repeat(3, 1fr);
    padding-top: 3.2rem;
  }

  .memory-grid {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }

  .section-heading {
    display: block;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand small {
    white-space: normal;
  }

  .nav-links > a {
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
  }

  h1 {
    font-size: clamp(2.7rem, 14vw, 4.9rem);
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .score-card {
    grid-template-columns: 1fr;
  }

  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .card-label {
    font-size: 0.68rem;
  }

  .marquee-strip div {
    animation-duration: 12s;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .card-inner {
    transition: none;
  }
}

/* ===== Unlock archive ===== */

.unlock-dashboard {
  display: grid;
  grid-template-columns: minmax(170px, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.unlock-meter {
  padding: 1rem;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: white;
  box-shadow: 5px 5px 0 rgba(37, 22, 47, 0.16);
}

.unlock-meter strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: clamp(1.35rem, 3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.unlock-meter span {
  font-weight: 900;
  text-transform: uppercase;
  opacity: 0.75;
}

.unlock-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.unlock-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem;
  border: 3px solid var(--ink);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 4px 4px 0 rgba(37, 22, 47, 0.14);
  opacity: 0.62;
  filter: grayscale(0.7);
  transition: 0.16s ease;
}

.unlock-item.is-unlocked {
  opacity: 1;
  filter: none;
  background: linear-gradient(
    135deg,
    rgba(156, 255, 59, 0.42),
    rgba(255, 255, 255, 0.92)
  );
}

.unlock-cover {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
}

.unlock-text {
  min-width: 0;
}

.unlock-text strong,
.unlock-text span {
  display: block;
  overflow-wrap: anywhere;
}

.unlock-text strong {
  line-height: 1.05;
}

.unlock-text span {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  font-weight: 900;
  opacity: 0.75;
}

.unlock-replay {
  min-height: 2.35rem;
  padding: 0.45rem 0.65rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sky);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(37, 22, 47, 0.18);
}

.unlock-replay:disabled {
  cursor: not-allowed;
  background: #ddd;
  color: rgba(37, 22, 47, 0.58);
  box-shadow: none;
}

.unlock-replay:not(:disabled):hover,
.unlock-replay:not(:disabled):focus-visible {
  transform: translate(-1px, -1px) rotate(-1deg);
  box-shadow: 5px 5px 0 rgba(37, 22, 47, 0.2);
  outline: none;
}

.unlock-item.is-unlocked .unlock-replay {
  background: var(--acid);
}

@media (max-width: 650px) {
  .unlock-dashboard {
    grid-template-columns: 1fr;
  }

  .unlock-item {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .unlock-cover {
    width: 52px;
    height: 52px;
  }

  .unlock-replay {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* ===== Launch V1 nav dropdown ===== */

.nav-menu {
  position: relative;
  padding-bottom: 0.35rem;
  margin-bottom: -0.35rem;
}

.nav-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.55rem;
}

.nav-menu-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.55rem;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.nav-menu-button:hover,
.nav-menu-button:focus,
.nav-menu:hover .nav-menu-button,
.nav-menu:focus-within .nav-menu-button {
  background: var(--hot-pink);
  border-color: var(--ink);
  transform: rotate(-1deg);
}

.nav-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 60;
  min-width: 240px;
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem;
  background: rgba(255, 248, 214, 0.96);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 7px 7px 0 rgba(37, 22, 47, 0.28);
  opacity: 0;
  transform: translateY(-0.35rem) scale(0.98);
  pointer-events: none;
  transition: 0.16s ease;
}

.nav-menu:hover .nav-menu-list,
.nav-menu:focus-within .nav-menu-list {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nav-menu-list a {
  display: flex;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.55rem 0.75rem;
  border: 2px solid transparent;
  border-radius: 14px;
  font-weight: 900;
}

.nav-menu-list a:hover,
.nav-menu-list a:focus,
.nav-menu-list a.active {
  background: var(--sky);
  border-color: var(--ink);
}

@media (max-width: 560px) {
  .nav-menu-list {
    left: 0;
    right: auto;
  }

  .nav-menu-button {
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
  }
}

/* ===== Launch V1 anchor offsets ===== */

#game,
#guide,
#how,
#assets {
  scroll-margin-top: 7.75rem;
}

@media (max-width: 900px) {
  #game,
  #guide,
  #how,
  #assets {
    scroll-margin-top: 1rem;
  }
}

/* Match index hero label/content positioning */
.memory-hero .hero-copy {
  padding-top: clamp(1.5rem, 3vw, 2.25rem);
  padding-left: clamp(1rem, 2.2vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2.4rem);
}

/* ===== Mobile dropdown stacking fix ===== */

.site-header {
  position: relative;
  z-index: 9999;
}

.nav-shell {
  position: relative;
  z-index: 10000;
  overflow: visible;
}

.nav-links,
.nav-menu {
  position: relative;
  z-index: 10001;
}

.nav-menu-list {
  z-index: 10002;
}

main {
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .site-header {
    position: relative;
    z-index: 9999;
  }

  .nav-shell {
    overflow: visible;
  }
}

/* ===== Horizontal overflow guard ===== */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}