/* Cluepuff Adventures on the web: the game's menus on its sky. Cream paper cards with a darker lower edge, ink
   letters, mint for what is on, amber for what moves things along, orange titles with a soft lift, DynaPuff for
   titles and buttons, Fredoka for words. Colourful and light: never dark, never gritty. */

@font-face {
  font-family: 'DynaPuff';
  src: url('/fonts/DynaPuff.woff2?v=1') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/Fredoka-SemiBold.woff2?v=1') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: rgb(255, 246, 230);
  --paper-edge: rgb(212, 192, 158);
  --ink: rgb(40, 36, 64);
  --ink-dim: rgba(40, 36, 64, 0.7);
  --well: rgba(40, 36, 64, 0.08);
  --well-hover: rgba(40, 36, 64, 0.14);
  --well-edge: rgba(40, 36, 64, 0.16);
  --mint: rgb(132, 232, 214);
  --mint-edge: rgb(58, 170, 166);
  --amber: rgb(255, 205, 120);
  --amber-hover: rgb(255, 221, 152);
  --amber-edge: rgb(222, 150, 62);
  --orange: rgb(230, 110, 20);
  --light: rgb(255, 250, 238);
  /* the sky: Dreamscape's, from its zenith down to its horizon */
  --sky-top: #5d4fd3;
  --sky-mid: #8d6fe2;
  --sky-low: #f2a8d6;
  --sky-foot: #ffd2e2;
  --cloud: #fbe4f6;
  --gutter: clamp(16px, 4vw, 40px);
  --title: 'DynaPuff', 'Fredoka', ui-rounded, system-ui, sans-serif;
  --text: 'Fredoka', ui-rounded, system-ui, sans-serif;
  --shadow: 0 14px 34px rgba(48, 26, 110, 0.22);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  font: 600 17px/1.45 var(--text);
  color: var(--ink);
  background: var(--sky-top);
  overflow-x: hidden;
}
/* the sky stays put while the cards float past it */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 60% at 80% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 38%, var(--sky-low) 78%, var(--sky-foot) 100%);
}
main { flex: 1 0 auto; width: 100%; }
img, canvas, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--mint-edge); outline-offset: 3px; border-radius: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

/* ── the bar along the top ──────────────────────────────────────────────────────────────────────────────── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 6px;
}
.top__home { display: block; flex-shrink: 0; border-radius: 14px; }
.top__home img { height: 52px; width: auto; filter: drop-shadow(0 3px 4px rgba(40, 20, 90, 0.25)); }
.top__nav { display: flex; align-items: center; gap: 10px; }
.top__nav .btn { min-height: 44px; padding: 0 18px; font-size: 16px; border-radius: 15px; }
@media (max-width: 560px) {
  .top__home img { height: 40px; }
  .top__nav .btn--get { display: none; }
  .top__nav .btn { padding: 0 14px; font-size: 15px; }
}

/* ── paper ──────────────────────────────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border-radius: 28px;
  border-bottom: 8px solid var(--paper-edge);
  padding: 22px 26px 24px;
  box-shadow: var(--shadow);
}
@media (max-width: 560px) { .card { padding: 18px 18px 20px; border-radius: 24px; } }
.title {
  font-family: var(--title);
  color: var(--orange);
  text-shadow: 0 2px 2px rgba(92, 36, 14, 0.22);
  letter-spacing: 0.5px;
  line-height: 1.15;
}
.dim { color: var(--ink-dim); }

/* a section's name on the sky: a paper tab, so it reads on any part of the sky */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border-bottom: 5px solid var(--paper-edge);
  border-radius: 18px;
  padding: 8px 20px 7px;
  font: 400 clamp(22px, 3.2vw, 30px)/1.15 var(--title);
  color: var(--orange);
  text-shadow: 0 2px 2px rgba(92, 36, 14, 0.22);
  box-shadow: 0 8px 22px rgba(48, 26, 110, 0.18);
}
.tag img { width: 40px; height: 40px; margin: -6px -4px -6px -10px; }
.on-sky {
  color: var(--light);
  text-shadow: 0 2px 3px rgba(40, 20, 90, 0.45);
}

/* ── buttons: wells, amber for what moves things along; they press down ────────────────────────────────── */
.btn {
  --edge: var(--well-edge);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  margin-bottom: 6px;
  padding: 0 24px;
  border: 0;
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 6px 0 var(--edge), 0 10px 18px rgba(48, 26, 110, 0.14);
  font: 400 19px/1.1 var(--title);
  letter-spacing: 0.3px;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease-out, background-color 0.1s, box-shadow 0.1s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { transform: translateY(-1px) scale(1.03); background: #fffaf0; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--edge), 0 4px 8px rgba(48, 26, 110, 0.12); }
.btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.btn--well { background: var(--well); box-shadow: 0 5px 0 var(--edge); }
.btn--well:hover { background: var(--well-hover); }
.btn--amber { --edge: var(--amber-edge); background: var(--amber); }
.btn--amber:hover { background: var(--amber-hover); }
.btn--mint { --edge: var(--mint-edge); background: var(--mint); }
.btn--mint:hover { background: #a3f0e2; }
.btn--big { min-height: 64px; padding: 0 30px; font-size: 22px; border-radius: 20px; }
.btn--small { min-height: 44px; padding: 0 16px; font-size: 16px; border-radius: 14px; margin-bottom: 4px; box-shadow: 0 4px 0 var(--edge); }
.btn--small:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }

/* a store: what it is, and where; "Coming soon" when it isn't there yet */
.store { flex-direction: row; text-align: left; gap: 12px; padding: 0 22px 0 18px; }
.store__words { display: flex; flex-direction: column; gap: 1px; }
.store__small { font: 600 12.5px/1.1 var(--text); letter-spacing: 0.2px; opacity: 0.75; }
.store__name { font: 400 19px/1.1 var(--title); }
.store svg { width: 28px; height: 28px; }
.btn--big.store .store__name { font-size: 22px; }
.btn--big.store svg { width: 32px; height: 32px; }
.store--soon { cursor: default; background: var(--paper); color: var(--ink-dim); box-shadow: 0 6px 0 var(--paper-edge), 0 10px 18px rgba(48, 26, 110, 0.12); }
.store--soon:hover, .store--soon:active { transform: none; background: var(--paper); box-shadow: 0 6px 0 var(--paper-edge), 0 10px 18px rgba(48, 26, 110, 0.12); }
.store--soon .store__small { color: var(--orange); opacity: 1; }
.store--soon svg { opacity: 0.55; }
.stores { display: flex; flex-wrap: wrap; gap: 12px 14px; }
@media (max-width: 560px) {
  .stores .btn { flex: 1 1 100%; justify-content: flex-start; }
}

/* ── the hero: the title screen on the web ──────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow-x: clip; /* (the rays and clouds reach past the sides: no sideways scroll on a phone) */
  padding-bottom: clamp(56px, 9vw, 110px);
}
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 24px;
  min-height: min(70vh, 600px);
}
.hero__logo { width: 100%; max-width: 640px; height: auto; filter: drop-shadow(0 8px 10px rgba(40, 20, 90, 0.28)); }
.hero__pitch {
  margin: 18px 0 26px;
  max-width: 34ch;
  font-size: clamp(19px, 2.1vw, 24px);
  line-height: 1.35;
}
.hero__buttons { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 14px; }
.hero__note { margin-top: 14px; font-size: 15px; opacity: 0.95; }

/* Cluepuff, leaping out in front of slow sunburst rays and a glow, with twinkles */
.hero__art { position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; }
.rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: rgb(255, 236, 190);
  -webkit-mask: url('/assets/rays.webp?v=1') center / contain no-repeat;
  mask: url('/assets/rays.webp?v=1') center / contain no-repeat;
  opacity: 0.4;
  animation: spin 140s linear infinite;
  pointer-events: none;
}
.rays--back { width: 250%; background: rgb(255, 248, 225); opacity: 0.16; animation-duration: 220s; animation-direction: reverse; }
.glow {
  position: absolute;
  inset: -2%;
  background: radial-gradient(closest-side, rgba(255, 228, 160, 0.75), rgba(255, 228, 160, 0.25) 55%, transparent);
  pointer-events: none;
}
.hero__puff {
  position: absolute;
  inset: 6% 4% 4% 6%;
  width: 90%;
  height: auto;
  animation: bob 4.2s ease-in-out infinite;
  filter: drop-shadow(0 18px 18px rgba(40, 20, 90, 0.25));
}
.sparkle {
  position: absolute;
  width: 14%;
  aspect-ratio: 1;
  translate: -50% -50%;
  background: rgb(255, 240, 180);
  -webkit-mask: url('/assets/sparkle.webp?v=1') center / contain no-repeat;
  mask: url('/assets/sparkle.webp?v=1') center / contain no-repeat;
  animation: twinkle 3.2s ease-in-out infinite;
  pointer-events: none;
}
.sparkle--1 { left: 82%; top: 8%; width: 18%; }
.sparkle--2 { left: 97%; top: 32%; width: 9%; animation-delay: -1.1s; }
.sparkle--3 { left: 40%; top: 6%; width: 8%; animation-delay: -2.2s; }
.sparkle--4 { left: 6%; top: 40%; width: 10%; animation-delay: -0.6s; }
.sparkle--5 { left: 90%; top: 72%; width: 7%; animation-delay: -1.7s; }

@keyframes spin { to { rotate: 360deg; } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
@keyframes twinkle { 0%, 100% { scale: 0.2; opacity: 0; rotate: 0deg; } 45% { scale: 1; opacity: 1; rotate: 45deg; } 70% { scale: 0.7; opacity: 0.9; } }

.hero__inner { position: relative; z-index: 1; }

@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 0; min-height: 0; padding-top: 6px; }
  .hero__text { display: contents; }
  .hero__logo { order: 1; margin: 0 auto; max-width: 480px; }
  .hero__art { order: 2; width: 66%; max-width: 330px; margin: 6px auto 0; }
  .hero__pitch { order: 3; margin: 14px auto 20px; }
  .hero__buttons { order: 4; justify-content: center; flex-direction: column; align-items: center; }
  .hero__buttons .btn { width: 100%; max-width: 360px; }
  .hero__note { order: 5; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .sparkle { scale: 0.8; opacity: 0.9; }
}

/* ── sections ───────────────────────────────────────────────────────────────────────────────────────────── */
.section { margin: 0 auto clamp(44px, 6vw, 72px); }
.trailer { padding: 10px; border-radius: 30px; }
.trailer video { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 20px; object-fit: cover; background: var(--sky-mid); }

/* what the game is: four cards, a picture over each */
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; gap: 18px; } }
.feature { display: flex; flex-direction: column; gap: 14px; padding: 14px 14px 22px; }
.feature__pic {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #b6a6ff, #ffd0e6);
}
.feature__words { padding: 0 10px; }
.feature__title { font-size: clamp(22px, 2.6vw, 27px); margin-bottom: 6px; }
.feature__words p { color: var(--ink-dim); font-size: 17px; }
.feature__pic canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Cluepuff and its speech bubble (the game's: cream paper, the tail at the speaker) */
.pic-friend { display: flex; align-items: flex-end; justify-content: center; gap: 4%; padding: 0 6% 0; }
.pic-friend img { width: 36%; height: auto; margin-bottom: -3%; filter: drop-shadow(0 10px 10px rgba(40, 20, 90, 0.2)); }
.bubble {
  position: relative;
  align-self: center;
  max-width: 58%;
  margin-bottom: 8%;
  padding: 12px 16px;
  background: var(--paper);
  border-radius: 20px;
  border-bottom: 4px solid var(--paper-edge);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.3;
  box-shadow: 0 8px 18px rgba(48, 26, 110, 0.18);
}
.bubble::after {
  content: '';
  position: absolute;
  left: -12px;
  bottom: 16px;
  border: 10px solid transparent;
  border-right: 14px solid var(--paper);
  border-left: 0;
}
.bubble b { color: var(--orange); font-weight: 600; }

/* the editor: its door and a code to share */
.pic-make { display: flex; align-items: center; justify-content: center; gap: 6%; }
.pic-make img { width: 30%; height: auto; }
.pic-make .code-chip { font-size: clamp(22px, 3vw, 32px); padding: 10px 18px; }

/* the album: postcards of three dimensions, a little crooked */
.pic-album { display: flex; align-items: center; justify-content: center; }
.postcard {
  position: relative;
  width: 34%;
  aspect-ratio: 4 / 3;
  padding: 2.4%;
  background: #fffdf8;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(48, 26, 110, 0.22);
  margin: 0 -3%;
}
.postcard canvas { position: relative; width: 100%; height: 100%; border-radius: 4px; }
.postcard:nth-child(1) { rotate: -8deg; translate: 0 6%; }
.postcard:nth-child(2) { rotate: 3deg; z-index: 1; translate: 0 -4%; }
.postcard:nth-child(3) { rotate: 10deg; translate: 0 8%; }
.pic-album img { position: absolute; right: 4%; bottom: 4%; width: 20%; height: auto; z-index: 2; }

/* ── levels ─────────────────────────────────────────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 1060px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .grid--three > :nth-child(n + 4) { display: none; }
}

.lcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px 10px 16px;
  border-radius: 26px;
  transition: transform 0.12s ease-out;
}
.lcard:hover { transform: translateY(-3px); }
.lcard:active { transform: translateY(2px); }
.lcard__pic { position: relative; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: var(--well); }
.lcard__pic canvas { width: 100%; height: 100%; }
.lcard__body { display: flex; flex-direction: column; gap: 6px; padding: 12px 8px 0; flex-grow: 1; }
.lcard__name { font: 400 21px/1.2 var(--title); color: var(--ink); overflow-wrap: anywhere; }
.lcard__name a { text-decoration: none; }
.lcard__name a::after { content: ''; position: absolute; inset: 0; border-radius: inherit; } /* the whole card opens it */
.lcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.pick {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px 4px 8px;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font: 400 13.5px/1.2 var(--title);
  letter-spacing: 0.3px;
  box-shadow: 0 3px 0 rgb(176, 78, 6);
}
.pick svg { width: 15px; height: 15px; }

/* numbers, small: an icon and a count each */
.nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; color: var(--ink-dim); font-size: 15px; }
.nums li { display: inline-flex; align-items: center; gap: 5px; }
.nums svg { width: 17px; height: 17px; opacity: 0.85; }

/* a level's code, the way it is read aloud */
.code-chip {
  display: inline-block;
  padding: 3px 10px 2px;
  border-radius: 10px;
  background: var(--well);
  font: 400 15px/1.3 var(--title);
  letter-spacing: 1.5px;
  color: var(--ink);
  white-space: nowrap;
}

/* a maker: their look as a round puff with two eyes, their name, their rank */
.maker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  max-width: 100%;
  padding: 2px 8px 2px 2px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 15.5px;
}
a.maker:hover { background: var(--well); }
.maker__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.puff {
  --look: #7ddedc;
  --s: 26px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--s) * 0.15);
  flex-shrink: 0;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.55), transparent 42%), var(--look);
  border: 2px solid rgba(40, 36, 64, 0.18);
  padding-bottom: calc(var(--s) * 0.08);
}
.puff i { display: block; width: calc(var(--s) * 0.13); height: calc(var(--s) * 0.22); border-radius: 50%; background: var(--ink); }
.puff--big { --s: 96px; border-width: 4px; box-shadow: 0 8px 18px rgba(48, 26, 110, 0.18); }
.rank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 2px 9px 2px 6px;
  border-radius: 9px;
  font: 600 12.5px/1.25 var(--text);
  color: var(--ink);
  white-space: nowrap;
}
.rank svg { width: 13px; height: 13px; }
.rank--0 { background: rgba(128, 255, 189, 0.55); }
.rank--1 { background: rgba(132, 232, 214, 0.8); }
.rank--2 { background: rgba(255, 143, 196, 0.6); }
.rank--3 { background: rgba(255, 205, 120, 0.95); }
.rank--4 { background: rgb(142, 91, 217); color: #fff; }

/* waiting: a card's shape, breathing */
.lcard--ghost .lcard__pic, .ghost-line { background: rgba(40, 36, 64, 0.07); animation: breathe 1.4s ease-in-out infinite; }
.ghost-line { height: 16px; border-radius: 8px; width: 70%; }
.ghost-line--short { width: 45%; }
@keyframes breathe { 50% { opacity: 0.55; } }

/* when the hub can't answer, or there's nothing yet */
.note-card { display: flex; align-items: center; gap: 18px; padding: 20px 24px; }
.grid > .note-card { grid-column: 1 / -1; justify-self: start; max-width: 620px; }
.note-card img { width: 92px; height: auto; flex-shrink: 0; }
.note-card__words { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.note-card .title { font-size: 22px; }
@media (max-width: 480px) { .note-card { flex-direction: column; text-align: center; } .note-card__words { align-items: center; } }

.more { display: flex; justify-content: center; margin-top: 26px; }

/* ── the hub ────────────────────────────────────────────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin: 18px 0 22px; }
.page-title { font: 400 clamp(32px, 5vw, 52px)/1.1 var(--title); }
.page-sub { margin-top: 6px; font-size: 17px; }
.codebox { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 22px; }
.codebox label { font: 400 16px/1.2 var(--title); color: var(--ink-dim); white-space: nowrap; }
.codebox input {
  width: 8.2em;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 2px solid var(--well-edge);
  border-radius: 14px;
  background: #fff;
  font: 400 20px/1 var(--title);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
}
.codebox input:focus { outline: none; border-color: var(--mint-edge); }
.codebox .btn { margin-bottom: 4px; }
.codebox__said { flex-basis: 100%; font-size: 14.5px; color: rgb(204, 62, 60); }
.codebox { flex-wrap: wrap; }

.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.tab {
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 17px;
  background: var(--paper);
  box-shadow: 0 5px 0 var(--paper-edge), 0 8px 16px rgba(48, 26, 110, 0.14);
  margin-bottom: 5px;
  font: 400 18px/1 var(--title);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease-out;
}
.tab:hover { transform: translateY(-1px); }
.tab[aria-selected='true'] { background: var(--ink); color: var(--paper); box-shadow: 0 5px 0 rgb(16, 14, 30), 0 8px 16px rgba(48, 26, 110, 0.2); }
@media (max-width: 560px) {
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tab { padding: 0 10px; font-size: 17px; }
  .codebox { width: 100%; padding-left: 16px; }
  .codebox input { flex: 1 1 0; width: 0; }
}

/* ── a level ────────────────────────────────────────────────────────────────────────────────────────────── */
.level {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  grid-template-areas: 'pic side' 'get side';
  grid-template-rows: auto 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 14px;
}
.level__pic { grid-area: pic; }
.level__side { grid-area: side; }
.level__get { grid-area: get; }
@media (max-width: 900px) { .level { grid-template-columns: 1fr; grid-template-areas: 'pic' 'side' 'get'; grid-template-rows: auto; gap: 18px; } }
.level__pic { padding: 10px; border-radius: 30px; }
.level__pic .frame { position: relative; aspect-ratio: 16 / 11; border-radius: 22px; overflow: hidden; background: var(--well); }
.level__pic canvas { width: 100%; height: 100%; }
.level__info .pick { position: static; margin-bottom: 10px; font-size: 14px; padding: 4px 12px 4px 9px; }
.level__info { display: flex; flex-direction: column; gap: 16px; }
.level__name { font-size: clamp(30px, 3.6vw, 42px); overflow-wrap: anywhere; }
.level__by { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: -4px; }
.level__by .maker { font-size: 17px; }
.level__by .puff { --s: 32px; }
.level__when { font-size: 15px; color: var(--ink-dim); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.stats--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { padding: 12px 8px 10px; border-radius: 18px; background: var(--well); text-align: center; }
.stat dd { margin: 0; font: 400 clamp(20px, 2.2vw, 26px)/1.1 var(--title); color: var(--ink); }
.stat dt { margin-top: 4px; font-size: 13.5px; color: var(--ink-dim); white-space: nowrap; }
@media (max-width: 420px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.code-big { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 14px 14px; border-radius: 22px; background: rgba(132, 232, 214, 0.3); border-bottom: 4px solid rgba(58, 170, 166, 0.5); }
.code-big__label { font-size: 15px; color: var(--ink-dim); }
.code-big__row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; }
.code-big__code { font: 400 clamp(38px, 5vw, 50px)/1 var(--title); letter-spacing: 4px; color: var(--ink); user-select: all; }
.copied { --edge: var(--mint-edge); background: var(--mint) !important; }

/* Play: the title's own pill */
.play {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 384px);
  aspect-ratio: 3 / 1;
  margin: -14px auto -10px;
  padding-bottom: 3%;
  background: url('/assets/pill.webp?v=1') center / contain no-repeat;
  font: 400 clamp(22px, 2.6vw, 27px)/1 var(--title);
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(170, 70, 0, 0.55), 0 3px 6px rgba(120, 50, 0, 0.35);
  text-decoration: none;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.play:hover { transform: scale(1.05); }
.play:active { transform: scale(0.97) translateY(2px); }
.play__note, .how { text-align: center; font-size: 15px; color: var(--ink-dim); }

.level__stores { display: flex; flex-direction: column; gap: 12px; }
.level__stores .stores .btn { flex: 1 1 160px; }
.level__get .title { font-size: clamp(22px, 2.4vw, 28px); }

/* ── a maker ────────────────────────────────────────────────────────────────────────────────────────────── */
.maker-card { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin: 14px 0 34px; }
.maker-card__words { display: flex; flex-direction: column; gap: 8px; flex: 1 1 300px; min-width: 0; }
.maker-card__name { font-size: clamp(30px, 3.4vw, 42px); overflow-wrap: anywhere; }
.maker-card__line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-dim); font-size: 15.5px; }
.maker-card__line .rank { font-size: 14px; padding: 3px 11px 3px 8px; }
.maker-card .stats { flex: 0 1 430px; }

/* ── get the game ───────────────────────────────────────────────────────────────────────────────────────── */
.get { display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; padding: 30px 26px 30px; margin-top: 64px; }
.get .title { font-size: clamp(28px, 3.6vw, 40px); }
.get .stores { justify-content: center; }
.get__puff { width: 120px; height: auto; margin-top: -86px; filter: drop-shadow(0 10px 12px rgba(40, 20, 90, 0.25)); }
.steam-widget { width: 100%; max-width: 646px; height: 190px; border: 0; border-radius: 12px; }

/* ── your account ───────────────────────────────────────────────────────────────────────────────────────── */
/* for what can't be undone: the game's soft coral */
.btn--danger { --edge: rgb(206, 96, 84); background: rgb(255, 196, 189); }
.btn--danger:hover { background: rgb(255, 176, 166); }
.btn:disabled, .btn:disabled:hover, .btn:disabled:active { transform: none; opacity: 0.55; cursor: default; }

.said { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 22px; padding: 16px 22px 18px; font-size: 17px; }
.said .btn { margin-bottom: 4px; }
.said-line { font-size: 15px; color: rgb(204, 62, 60); }
.said-ok { font-size: 15px; color: var(--mint-edge); }
.small { font-size: 14.5px; }

/* a box to type in, as the hub's code box */
.field {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 2px solid var(--well-edge);
  border-radius: 14px;
  background: #fff;
  font: 600 18px/1 var(--text);
  color: var(--ink);
}
.field:focus { outline: none; border-color: var(--mint-edge); }

/* signed out: a code, or Steam */
.signin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; margin-bottom: clamp(44px, 6vw, 72px); }
@media (max-width: 760px) { .signin { grid-template-columns: 1fr; gap: 18px; } }
.signin__card, .signin__body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.signin__body { align-self: stretch; }
.signin__card .title { font-size: clamp(24px, 2.6vw, 30px); }
.code-big--signin { align-self: stretch; }
.code-big--signin .code-big__code { font-size: clamp(32px, 9vw, 50px); letter-spacing: 3px; white-space: nowrap; }
.steps { margin: 0; padding-left: 1.3em; color: var(--ink-dim); }
.steps li + li { margin-top: 4px; }
.steps strong { color: var(--ink); font-weight: 600; }
.waiting { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 15.5px; }
.waiting__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mint-edge); animation: breathe 1.4s ease-in-out infinite; }

/* signed in: who, their levels and drafts, where they're signed in */
.me-card { margin-top: 0; }
.me-card__buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.head__note { font-size: 16px; }
.lcard__tools { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.lcard__body .said-line { position: relative; z-index: 1; }
.pick--hidden { left: auto; right: 10px; background: var(--ink); box-shadow: 0 3px 0 rgb(16, 14, 30); }
.pick--draft { background: var(--paper); color: var(--ink); box-shadow: 0 3px 0 var(--paper-edge); padding: 4px 11px; }
.dcard:hover, .dcard:active { transform: none; }
.dcard .lcard__pic { aspect-ratio: 16 / 4; }   /* (a draft has no preview in the list: a band of its theme's sky) */
.rename { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; }
.rename__buttons { display: flex; gap: 10px; }

.where { display: flex; flex-direction: column; gap: 12px; }
.where__title { font: 400 20px/1.2 var(--title); color: var(--ink); }
.where__title + * { margin-top: -4px; }
.where__title:not(:first-child) { margin-top: 8px; }
.rows { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; padding: 12px 16px; border-radius: 16px; background: var(--well); }
.row > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.row__when { font-size: 15px; color: var(--ink-dim); }
.chip { padding: 2px 10px; border-radius: 9px; background: rgba(132, 232, 214, 0.8); font-size: 13px; }
.where__buttons, .delete__buttons { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 4px; }
.prose.prose--wide { max-width: none; margin: 0; }
.prose--wide .btn { margin-top: 8px; }
.prose ul + p { margin-top: 10px; }

/* a question before what can't be undone */
.ask { padding: 0; border: 0; background: transparent; color: var(--ink); max-width: min(520px, calc(100vw - 32px)); width: 100%; overflow: visible; }
.ask::backdrop { background: rgba(40, 20, 90, 0.5); }
.ask__card { display: flex; flex-direction: column; gap: 14px; }
.ask__title { font-size: clamp(24px, 3vw, 30px); }
.ask__words { display: flex; flex-direction: column; gap: 10px; color: var(--ink-dim); }
.ask__words strong { color: var(--ink); font-weight: 600; }
.ask__type { display: flex; flex-direction: column; gap: 8px; }
.ask__type label { font-size: 15.5px; }
.ask__type .field { letter-spacing: 2px; text-transform: uppercase; }
.ask__buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 12px; margin-top: 4px; }

/* ── plain pages ────────────────────────────────────────────────────────────────────────────────────────── */
.prose { max-width: 760px; margin: 18px auto 0; padding: 30px clamp(20px, 4vw, 44px) 34px; }
.prose h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 14px; }
.prose h2 { font: 400 22px/1.25 var(--title); color: var(--ink); margin: 26px 0 8px; }
.prose p, .prose li { color: var(--ink-dim); font-size: 17px; }
.prose p + p { margin-top: 10px; }
.prose ul { padding-left: 1.2em; margin: 8px 0 0; }
.prose li + li { margin-top: 6px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--mint-edge); }

.lost { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; max-width: 560px; margin: 100px auto 0; padding: 30px 26px 30px; }
.lost img { width: 150px; height: auto; margin-top: -90px; }
.lost .title { font-size: clamp(28px, 4vw, 36px); }

/* ── the foot: the cloud sea ────────────────────────────────────────────────────────────────────────────── */
.foot {
  margin-top: clamp(40px, 6vw, 70px);
  padding: 96px 0 calc(30px + env(safe-area-inset-bottom));
  background: url('/assets/clouds.svg?v=1') center top / 1440px 120px repeat-x, linear-gradient(transparent 118px, var(--cloud) 118px);
  color: var(--ink-dim);
}
.foot__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.foot a { text-decoration: none; color: var(--ink); }
.foot a:hover { text-decoration: underline; }
.foot small { font-size: 14.5px; }
@media (max-width: 560px) { .foot__inner { flex-direction: column; text-align: center; } .foot nav { justify-content: center; } }

/* clouds drifting across the title's sky */
.sky-cloud { position: absolute; fill: #fff; pointer-events: none; animation: drift 26s ease-in-out infinite alternate; }
.sky-cloud--1 { left: 1%; top: 80%; width: clamp(110px, 16vw, 230px); aspect-ratio: 200 / 92; opacity: 0.42; }
.sky-cloud--2 { right: 2%; top: 6%; width: clamp(90px, 12vw, 170px); aspect-ratio: 200 / 92; opacity: 0.3; animation-duration: 34s; }
.sky-cloud--3 { left: 44%; top: 84%; width: clamp(120px, 18vw, 260px); aspect-ratio: 200 / 92; opacity: 0.5; animation-duration: 30s; animation-direction: alternate-reverse; }
@keyframes drift { to { translate: 40px 0; } }
@media (max-width: 860px) {
  .sky-cloud--1 { top: 22%; left: -8%; }
  .sky-cloud--3 { display: none; }
}
