/* Elbow Room's page, in the game's own look: stickers on the night sky. Cream cards, the cast's navy
   outline, flat boxes (owner: no doubled edges), Fredoka. Its own file, so Merge Defenders' styles.css stays as approved. */

@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #1e1b3a;
  --night: #2a2560;
  --cream: #fff6e6;
  --paper: #fffdf7;
  --gold: #ffd15c;
  --orange: #ffa94d;
  --orange-lip: #d67428;
  --mint: #7edec4;
  --lavender: #e9e1fc;
  --radius: 24px;
  --display: "Fredoka", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--night);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; line-height: 1.1; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }

/* NAV ------------------------------------------------------------------ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px var(--gutter);
  transition: background .3s, box-shadow .3s, padding .3s;
}
.nav.scrolled {
  background: rgba(30, 27, 58, .9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  padding-top: 10px; padding-bottom: 10px;
}
.brand {
  font-family: var(--display); font-size: 1.3rem; color: #fff; text-decoration: none; white-space: nowrap;
  paint-order: stroke fill; -webkit-text-stroke: .16em var(--ink);
}
.nav-links { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.nav-links a { font-family: var(--display); color: #fff; text-decoration: none; paint-order: stroke fill; -webkit-text-stroke: .2em var(--ink); white-space: nowrap; }
.nav-links a:hover { color: var(--gold); }
.nav-links a.nav-cta {
  background: var(--orange); color: var(--ink); -webkit-text-stroke: 0;
  padding: 8px 16px; border-radius: 999px; border: 2.5px solid var(--ink);
}
.nav-links a.nav-cta:hover { background: #ffb765; color: var(--ink); }
@media (max-width: 760px) { .nav-links a:not(.nav-cta) { display: none; } }

/* SCALLOPED CLOUD EDGE: the next section's colour, in the cast's outline ------- */
.edge {
  position: absolute; inset: auto 0 -1px 0; height: 37px; pointer-events: none;
  background-size: 74px 37px; background-repeat: repeat-x; background-position: 50% 100%;
}
.edge-cream { background-image: radial-gradient(circle at 50% 100%, var(--cream) 32px, var(--ink) 33px 36px, transparent 37px); }
.edge-night { background-image: radial-gradient(circle at 50% 100%, var(--night) 32px, var(--ink) 33px 36px, transparent 37px); }

/* HERO ----------------------------------------------------------------- */
.hero {
  position: relative; min-height: 100svh; overflow: hidden; isolation: isolate;
  display: grid; place-items: center;
  padding: 84px 20px 150px;
  background: var(--night) url("/assets/elbow-room/sky.webp") center 42% / cover no-repeat;
  color: #fff; text-align: center;
}
.hero-copy { max-width: 620px; position: relative; z-index: 1; }
.hero-icon {
  width: clamp(104px, 15vh, 148px); aspect-ratio: 1; margin: 0 auto 14px;
  border-radius: 24%; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--ink), 0 16px 26px rgba(0, 0, 0, .35);
}
.eyebrow {
  margin: 0 0 4px; font-family: var(--display); font-size: 1rem; letter-spacing: .03em; color: var(--gold);
  paint-order: stroke fill; -webkit-text-stroke: .22em var(--ink);
}
.title {
  font-size: clamp(3.1rem, 13vw, 6.4rem); line-height: 1; color: #fff;
  paint-order: stroke fill; -webkit-text-stroke: .13em var(--ink);
  text-shadow: 0 .07em 0 var(--ink);
}
.subtitle {
  margin: .22em 0 0; font-family: var(--display); font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.1; color: var(--gold);
  paint-order: stroke fill; -webkit-text-stroke: .14em var(--ink);
}
.tagline {
  margin: .5em 0 0; font-family: var(--display); font-size: clamp(1.2rem, 4.4vw, 1.6rem); color: #fff;
  paint-order: stroke fill; -webkit-text-stroke: .14em var(--ink);
}
.hero-lede {
  margin: 12px auto 16px; max-width: 36ch; padding: 8px 14px; border-radius: 14px;
  font-weight: 600; color: #fff; background: rgba(30, 27, 58, .74);
}
.play-badge { display: inline-block; line-height: 0; transition: transform .15s; }
.play-badge img { height: 66px; width: auto; }
.play-badge:hover { transform: translateY(-2px); }
.hero-note {
  width: fit-content; margin: 2px auto 0; padding: 2px 12px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; color: #fff; background: rgba(30, 27, 58, .74);
}
.hero-pal {
  position: absolute; bottom: 14px; z-index: 0; height: auto;
  filter: drop-shadow(0 8px 6px rgba(30, 27, 58, .45));
  transform-origin: 50% 100%;
  animation: bob 2.8s ease-in-out infinite;
}
.hero-pal.zip { width: clamp(118px, 19vw, 280px); right: max(5vw, calc(50% - 640px)); }
.hero-pal.louis { width: clamp(118px, 19vw, 290px); left: max(5vw, calc(50% - 640px)); animation-delay: -1.3s; }
@keyframes bob {
  0%, 100% { translate: 0 0; scale: 1 1; }
  50%      { translate: 0 -8px; scale: 1.02 .98; }
}

/* SECTIONS ------------------------------------------------------------- */
.section { position: relative; padding: clamp(56px, 9vw, 104px) var(--gutter) clamp(84px, 12vw, 136px); }
.section-title { font-size: clamp(2rem, 6vw, 3.2rem); text-wrap: balance; }
.section-title.on-night, .lede.on-night { text-align: center; }
.section-title.on-night {
  color: #fff; paint-order: stroke fill; -webkit-text-stroke: .1em var(--ink); text-shadow: 0 .06em 0 var(--ink);
}
.lede { margin: 12px 0 0; font-size: 1.15rem; max-width: 52ch; }
.lede.center { margin-left: auto; margin-right: auto; text-align: center; }
.lede.on-night { color: #f3efff; }

/* HOW IT PLAYS */
.how, .ads { background: var(--cream); }
.how .section-title, .ads .section-title { color: var(--ink); }
.ads .section-title { text-align: center; }
.how-grid {
  display: grid; gap: 36px; align-items: center; margin: 0 auto; max-width: 1080px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
@media (max-width: 860px) { .how-grid { grid-template-columns: minmax(0, 1fr); } }
.rules { display: grid; gap: 12px; margin-top: 22px; }
.rules li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.chip {
  flex: none; width: 128px; text-align: center; font-family: var(--display); font-size: 1rem;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 12px; padding: 6px 8px;
}
.promise { margin: 22px 0 0; font-family: var(--display); font-size: 1.2rem; line-height: 1.3; color: var(--night); }

.demo { margin: 0 auto; width: min(100%, 380px); }
.board {
  --cell: 20%;
  display: grid; grid-template-columns: repeat(5, 1fr);
  aspect-ratio: 1; overflow: hidden;
  border: 6px solid var(--ink); border-radius: 22px; background: var(--ink);
  box-shadow: 0 18px 30px rgba(30, 27, 58, .25);
}
.cell {
  position: relative; background: var(--fill); transition: background-color .35s;
  box-shadow: inset 0 0 0 .5px rgba(30, 27, 58, .28);
  border: 0 solid var(--ink);
}
.cell.solved { background: var(--solved); }
.cell.bt { border-top-width: 3px; } .cell.bl { border-left-width: 3px; }
.cell.br { border-right-width: 3px; } .cell.bb { border-bottom-width: 3px; }
.cell .x {
  position: absolute; inset: 24%; opacity: 0; transform: scale(.4);
  transition: opacity .2s var(--delay, 0s), transform .25s cubic-bezier(.2, 1.6, .4, 1) var(--delay, 0s);
  background:
    linear-gradient(45deg, transparent 42%, var(--ink) 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--ink) 42% 58%, transparent 58%);
}
.cell.crossed .x { opacity: .85; transform: none; }
.cell .piece {
  position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain;
  opacity: 0; transform: scale(.3) translateY(-30%);
  transition: opacity .15s, transform .4s cubic-bezier(.2, 1.7, .4, 1);
  filter: drop-shadow(0 2px 1px rgba(30, 27, 58, .4));
}
.cell.placed .piece { opacity: 1; transform: none; }
.cell.placed .x { opacity: 0; }
.demo figcaption {
  margin-top: 22px; min-height: 3.95em; text-align: center;
  font-family: var(--display); font-size: 1.1rem; line-height: 1.3; color: var(--night);
  text-wrap: balance;
}

.moves, .notes, .extras {
  display: grid; gap: 18px; margin: 0 auto; max-width: 1080px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}
.moves { margin-top: 44px; }
.move, .ad-card, .extra, .friend {
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius);
}
.move { padding: 16px 20px; }
.move h3 { font-size: 1.5rem; }
.move p { margin: 4px 0 0; }
.notes { margin-top: 30px; }
.note h3 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; }
.note h3 img { width: 26px; flex: none; }
.note p { margin: 6px 0 0; }

/* SCREENS */
.shots-section { background: linear-gradient(180deg, var(--night), #231f50); }
.shots {
  display: grid; gap: 18px; margin: 36px auto 0; max-width: 1120px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.shots img { width: 100%; border-radius: 18px; border: 3px solid var(--ink); background: var(--ink); }
@media (max-width: 860px) {
  /* A thumb-sized swipe rather than a long grid; the row runs off both edges of the phone. */
  .shots {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px;
    margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1);
    padding: 4px var(--gutter) 14px; scroll-padding: 0 var(--gutter); scrollbar-width: none;
  }
  .shots::-webkit-scrollbar { display: none; }
  .shots li { flex: 0 0 min(66vw, 280px); scroll-snap-align: center; }
}
.extras { margin-top: 44px; }
.extra { padding: 18px 20px 20px; }
.extra img { height: 44px; width: auto; margin-bottom: 10px; filter: drop-shadow(0 2px 0 rgba(30, 27, 58, .35)); }
.extra h3 { font-size: 1.3rem; }
.extra p { margin: 6px 0 0; }

/* FAIR ADS */
.ads-grid {
  display: grid; gap: 22px; margin: 34px auto 0; max-width: 980px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
@media (max-width: 760px) { .ads-grid { grid-template-columns: minmax(0, 1fr); } }
.ad-side { display: grid; gap: 22px; }
.ad-card { padding: 22px 24px 24px; }
.ad-card h3 { font-size: 1.45rem; }
.ad-card p { margin: 10px 0 0; }
.ad-never { background: var(--gold); }
.never { display: grid; gap: 8px; margin-top: 14px; }
.never li {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display); font-size: 1.2rem; line-height: 1.2;
}
.never li::before {
  content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 43%, #fff 43% 57%, transparent 57%) center / 62% 62% no-repeat,
    linear-gradient(-45deg, transparent 43%, #fff 43% 57%, transparent 57%) center / 62% 62% no-repeat,
    var(--ink);
}

/* MONSTER FRIENDS */
.friends { background: var(--night); padding-bottom: clamp(32px, 5vw, 56px); }
.album {
  display: grid; gap: 16px; margin: 36px auto 0; max-width: 1120px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 860px) { .album { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) { .album { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.friend { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 12px 12px; }
.friend img { height: 118px; width: 100%; object-fit: contain; filter: drop-shadow(0 4px 2px rgba(30, 27, 58, .3)); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1); }
.friend:hover img { transform: translateY(-4px) rotate(-3deg) scale(1.05); }
.friend h3 { margin-top: 8px; font-size: 1.3rem; }
.friend .line { margin: 4px 0 8px; font-size: .95rem; line-height: 1.35; }
.friend .meet {
  margin: auto 0 0; padding: 2px 12px; border-radius: 999px; background: var(--lavender);
  font-family: var(--display); font-size: .9rem;
}

/* GET IT */
.get {
  /* The sky comes up out of the night above it. */
  background: linear-gradient(180deg, var(--night) 0%, rgba(42, 37, 96, 0) 42%), url("/assets/elbow-room/sky.webp") center 60% / cover no-repeat;
  padding: clamp(40px, 7vw, 72px) var(--gutter) clamp(64px, 9vw, 104px);
}
.get-card {
  max-width: 760px; margin: 0 auto; overflow: hidden;
  background: var(--cream); border: 4px solid var(--ink); border-radius: 28px;
  box-shadow: 0 0 0 5px var(--gold);
}
.get-art { width: 100%; border-bottom: 4px solid var(--ink); }
.get-copy { padding: 22px 20px 24px; text-align: center; }
.get-copy h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); text-wrap: balance; margin-bottom: 12px; }
.get-copy p { margin: 8px 0 0; }
.get-copy p a { font-weight: 700; color: var(--night); }

/* FOOTER */
.footer {
  background: var(--ink); color: #d9d6ee; text-align: center;
  padding: 32px 16px 38px; display: grid; gap: 12px; justify-items: center;
}
.foot-brand { font-family: var(--display); font-size: 1.3rem; color: #fff; text-decoration: none; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.footer nav a { color: var(--gold); font-weight: 700; text-decoration: none; padding: 6px 0; }
.footer nav a:hover { text-decoration: underline; }
.fine { margin: 0; font-size: .85rem; }

/* SCROLL REVEAL: only hidden once the script has said it is running. */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* MOTION SAFETY */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
