/* =============================================================================
   DODUS — page styles
   Colors and fonts come from config.js (injected as CSS variables by dodus.js).
   Mobile-first. Two breakpoints: 720px and 1040px.
   ========================================================================== */

/* ---- reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.62;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; font-weight: 900; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---- paper grain overlay ------------------------------------------------ */
svg.defs { position: absolute; width: 0; height: 0; }
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

/* ---- layout helpers ----------------------------------------------------- */
.wrap { width: min(100% - 2.4rem, 1080px); margin-inline: auto; }

/* ---- the trademark mark --------------------------------------------------
   Sized against whatever it is attached to, not in px, so it stays in
   proportion from the hero wordmark down to a section heading. 42% is the
   compromise: smaller vanishes on a phone, larger starts competing with the
   word it is marking.

   `vertical-align: super` on its own also raises the line box, which pushes a
   heading's line-height around. Positioning it instead keeps the line exactly
   where it was, which matters on the hero where the type is enormous. */
.tm {
  /* PROPORTIONAL, BUT CAPPED. The hero wordmark runs to 11rem and a section
     heading to 3.4rem; a plain `em` size that suits one looks absurd on the
     other, because a mark on a very large word should be relatively smaller,
     not just bigger. So it scales with its word and then stops: on the hero
     the cap is doing the work, on a heading the em is.

     Fraunces draws a wide, heavy ™ — considerably more presence than the
     system font this was first mocked against, which is why these numbers are
     smaller than that mockup suggested. */
  font-size: clamp(.55rem, .26em, 1.45rem);
  font-weight: 600;
  letter-spacing: .02em;

  /* `super` lifts it relative to the PARENT's font, so it stays at the right
     height on a 3rem heading and a 11rem wordmark alike — which a `top` in em
     cannot do, since that resolves against the mark's own size. The zero line
     height stops it growing the line box, which on the hero would push the
     whole block down. */
  vertical-align: super;
  line-height: 0;
}

/* "Free snowboarding games" — what the section is, said plainly, above the
   sub-line's tone. Small caps-ish and quiet: it is a signpost, not a headline,
   and it must not compete with either the heading above or the cards below. */
.arcade__tag {
  margin: .1rem 0 .15rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--charcoal-so, #5A524A);
  opacity: .9;
}
@media (max-width: 480px) {
  /* On a phone the heading already wraps; the signpost gets out of the way
     rather than adding a fourth line above the game. */
  .arcade__tag { font-size: .74rem; letter-spacing: .04em; margin-bottom: .05rem; }
}

/* ---- out of the Arcade: shop, and support -------------------------------
   Sits under the game frame (WEB-0 moved it there from between the tiles and
   the frame, where it competed with Play). Quiet by construction — this is the third thing
   the page wants, after playing and after the world, and a free game that
   opens with two buttons is not free-feeling.

   The pair is centred and allowed to wrap. On a phone they stack and each
   gets the full width, which is also the easiest thing to hit with a thumb. */
.arcade__after {
  margin: 1.3rem 0 .2rem;
  text-align: center;
}
.arcade__ctas {
  display: flex;
  justify-content: center;
  gap: .55rem;
}
/* Smaller than the hero's buttons: these are an offer, and they are standing
   between somebody and the game. */
.arcade__cta { font-size: .84rem; padding: .55rem 1rem; box-shadow: 2px 3px 0 var(--charcoal); }

/* Under the buttons now, so it needs the top margin rather than the bottom. */
.arcade__note {
  margin: .55rem 0 0;
  font-size: .8rem;
  color: var(--charcoal-so, #5A524A);
  opacity: .85;
}

@media (max-width: 520px) {
  /* ONE ROW, STILL. Under the game now, but a stacked pair would still read
     as louder than it is. They share
     the width instead and the type steps down to fit — each still clears 44px
     of touch target, which is what actually matters for a thumb. */
  .arcade__after { margin: .7rem 0 .15rem; }
  .arcade__ctas { gap: .45rem; }
  .arcade__cta {
    /* Sized to their words, NOT to equal halves. Forced to equal widths
       "Support the Arcade" wrapped onto two lines and stood a head taller
       than "Shop DoDus" — a lopsided pair, and taller than this row can
       afford directly above the game. Let each take what it needs. */
    flex: 0 1 auto;
    white-space: nowrap;
    font-size: .78rem;
    padding: .55rem .8rem;
    letter-spacing: -.01em;
    /* The row got shorter; the thumb target must not. */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .arcade__note { font-size: .75rem; margin-top: .45rem; }
}

/* The footer's written claim. Quieter than the line above it: it is a notice,
   not a sentence anybody came to read. */
.foot__tm {
  margin-top: .45rem;
  font-size: .78rem;
  color: var(--charcoal-so, #5A524A);
  opacity: .85;
}
section { padding-block: clamp(4rem, 12vw, 7.5rem); position: relative; }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--charcoal);
  color: var(--cream); padding: .7rem 1rem; z-index: 10000; border-radius: 0 0 12px 0;
}
.skip:focus { left: 0; }

:focus-visible { outline: 3px dashed var(--clay); outline-offset: 3px; border-radius: 4px; }

/* ---- shared type -------------------------------------------------------- */
.eyebrow {
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 800; color: var(--clay-deep);
}
.h2 {
  font-size: clamp(2.1rem, 9vw, 3.4rem);
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}
.h2 .h2__ink {
  display: inline-block; position: relative;
}
.h2 .h2__ink::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .34em;
  background: var(--underline, var(--snow-blue));
  z-index: -1; border-radius: 40% 60% 55% 45% / 60% 50% 50% 40%;
  transform: rotate(-.6deg);
}
.sub {
  color: var(--charcoal-soft); max-width: 46ch;
  margin-top: .9rem; font-size: 1.02rem;
}
.lede { font-size: clamp(1.08rem, 3.6vw, 1.3rem); max-width: 54ch; margin-top: 1.2rem; }

/* ---- buttons ------------------------------------------------------------ */
.btns { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 800;
  font-size: 1rem; padding: .85rem 1.5rem;
  border: 2.5px solid var(--charcoal);
  border-radius: 28px 20px 26px 18px / 20px 26px 18px 28px;
  background: var(--snow); color: var(--charcoal);
  box-shadow: 3px 4px 0 var(--charcoal);
  transition: transform .12s ease, box-shadow .12s ease;
  transform: rotate(-.7deg);
}
.btn:hover { transform: translate(-1px, -2px) rotate(-.7deg); box-shadow: 5px 6px 0 var(--charcoal); }
.btn:active { transform: translate(2px, 3px) rotate(-.7deg); box-shadow: 1px 1px 0 var(--charcoal); }
.btn--clay { background: var(--clay); color: var(--snow); }
.btn--ghost { background: transparent; box-shadow: 3px 4px 0 var(--snow-blue-lo); transform: rotate(.8deg); }
.btn--ghost:hover { transform: translate(-1px,-2px) rotate(.8deg); }
.btn--ghost:active { transform: translate(2px,3px) rotate(.8deg); }

/* A FILLED SECOND BUTTON, in the night. Outline was the obvious choice for a
   quieter CTA and it was wrong here: sitting above the game on a pale blue
   section, an unfilled button reads as disabled rather than as secondary.

   So it is filled, in Night Ride's own navy — the same #1E2A47 the Night card's
   art strip ends on — with cream text. Plainly the second thing next to the
   clay, because warm advances and cool recedes, but unmistakably a button.
   Cream on this navy is about 12:1, so it is legible at any size. */
.btn--night {
  background: var(--night-navy, #1E2A47);
  color: var(--cream, #F7EFE2);
}

/* ---- top bar ------------------------------------------------------------ */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1.2rem, 5vw, 2.6rem);
  position: relative; z-index: 5;
}
.topbar__brand {
  font-family: var(--font-display); font-weight: 900; font-size: 1.15rem;
  text-decoration: none; letter-spacing: -.01em;
}
.topbar__brand::after { content: " ·"; color: var(--clay); }
.topbar__nav { display: flex; gap: 1.1rem; font-size: .92rem; font-weight: 700; }
.topbar__nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 2.5px solid transparent; }
.topbar__nav a:hover { border-bottom-color: var(--clay); }

/* =============================================================================
   HERO
   ========================================================================== */
.hero {
  padding-top: clamp(1.5rem, 6vw, 3rem);
  padding-bottom: 0;
  overflow: hidden;
}
.hero__in { position: relative; z-index: 2; }
.hero__title {
  font-size: clamp(4.2rem, 26vw, 11rem);
  letter-spacing: -.045em;
  margin-top: .4rem;
  line-height: .85;
  color: var(--clay-deep);
  text-shadow: 3px 4px 0 var(--snow-blue);
}
.hero__aside {
  display: block; font-family: var(--font-body); font-weight: 600;
  font-size: .95rem; letter-spacing: .1em; color: var(--charcoal-soft);
  text-shadow: none; margin-top: .7rem;
}
.hero__sub { font-size: clamp(1.06rem, 4.2vw, 1.35rem); max-width: 40ch; margin-top: 1.4rem; }

/* hand-lettered stickers */
.stickers { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2.2rem; }
.sticker {
  white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-style: italic;
  font-size: .82rem; padding: .38rem .8rem;
  background: var(--snow); border: 2.5px solid var(--charcoal);
  border-radius: 30px 14px 26px 16px / 16px 26px 14px 30px;
  box-shadow: 2px 3px 0 var(--charcoal);
}
.sticker:nth-child(1) { transform: rotate(-3deg); background: var(--glaze-gold); }
.sticker:nth-child(2) { transform: rotate(2.5deg); background: var(--snow-blue); }
.sticker:nth-child(3) { transform: rotate(-1.5deg); }

/* hero snow scene */
.hero__scene { position: relative; margin-top: 2.5rem; }
.hero__scene svg { width: 100%; height: auto; display: block; }

/* torn-paper transition between sections: the previous section's colour
   spilling down over the top of this one */
.edge {
  position: absolute; top: -1px; left: 0;
  width: 100%; height: clamp(34px, 6vw, 62px);
  display: block; pointer-events: none;
  /* Above the section backdrop. The edge is the join between two sections and
     has to be the last thing drawn there, or the game section's mountain —
     whose tallest peak reaches about 70px down, against this wedge's 62 —
     paints across the wobble and the two sections stop meeting cleanly. */
  z-index: 2;
}

/* =============================================================================
   INTRO
   ========================================================================== */
.intro { background: var(--snow-blue); }
.intro .h2 { --underline: var(--snow); }
.notes { display: grid; gap: 1.1rem; margin-top: 2.8rem; }
.note {
  background: var(--snow);
  border: 2.5px solid var(--charcoal);
  border-radius: 26px 14px 24px 16px / 16px 26px 14px 26px;
  padding: 1.4rem 1.4rem 1.6rem;
  box-shadow: 4px 5px 0 var(--charcoal);
}
.note:nth-child(2) { transform: rotate(.7deg); background: var(--cream); }
.note:nth-child(3) { transform: rotate(-.6deg); }
.note h3 { font-size: 1.22rem; margin-bottom: .5rem; }
.note p { color: var(--charcoal-soft); font-size: .98rem; }
.note__mark { display: block; width: 30px; height: 8px; margin-bottom: .9rem; }

/* =============================================================================
   CHARACTER CARDS
   ========================================================================== */
.chars { background: var(--cream); }
.chars .h2 { --underline: var(--glaze-gold); }
.cards { display: grid; gap: 1.6rem; margin-top: 2.8rem; }

.card {
  background: var(--snow);
  border: 3px solid var(--charcoal);
  border-radius: 30px 18px 28px 20px / 20px 30px 18px 30px;
  box-shadow: 5px 6px 0 var(--charcoal);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:nth-child(odd)  { transform: rotate(-.55deg); }
.card:nth-child(even) { transform: rotate(.5deg); }
.card:hover { transform: rotate(0deg) translateY(-3px); box-shadow: 7px 9px 0 var(--charcoal); }

/* ── ART SLOT ──────────────────────────────────────────────────────────────
   The illustration is the fallback. Set `photo` on the character in config.js
   and a photograph of the real ceramic piece covers it. If that file fails to
   load, the illustration reappears by itself.                              */
.card__art {
  position: relative;
  aspect-ratio: 4 / 3;
  border-bottom: 3px solid var(--charcoal);
  overflow: hidden;
}
.card__art-draw {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.card__art-draw svg { width: 88%; height: auto; }
.card__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.card__body { padding: 1.1rem 1.3rem 1.6rem; }
.card__head { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.card__name { font-size: 1.9rem; letter-spacing: -.02em; }
.card__tag { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 1rem; margin-top: .3rem; color: var(--clay-deep); }
.card__blurb { margin-top: 1rem; font-size: .96rem; color: var(--charcoal-soft); }

.chip {
  font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  padding: .28rem .65rem; border: 2px solid var(--charcoal);
  border-radius: 14px 6px 14px 6px; background: var(--snow-blue);
  white-space: nowrap;
}
.chip--available { background: var(--glaze-gold); }
.chip--adopted   { background: var(--cream-deep); color: var(--charcoal-soft); }
.chip--kiln      { background: var(--clay); color: var(--snow); }
.chip--custom    { background: var(--moss); color: var(--snow); }

/* quote + expandable profile + play button */
.card__quote {
  margin-top: 1rem;
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: 1rem; line-height: 1.4;
  padding-left: .9rem; border-left: 4px solid var(--snow-blue);
  color: var(--charcoal);
}
.card__more { margin-top: 1.1rem; }
.card__more summary {
  cursor: pointer; list-style: none;
  font-weight: 800; font-size: .84rem;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .85rem;
  border: 2.5px solid var(--charcoal);
  border-radius: 20px 10px 20px 10px / 10px 20px 10px 20px;
  background: var(--cream);
  transition: background .12s ease;
}
.card__more summary::-webkit-details-marker { display: none; }
.card__more summary::after { content: "＋"; font-weight: 700; line-height: 1; }
.card__more[open] summary::after { content: "－"; }
.card__more summary:hover { background: var(--snow-blue); }
.card__more summary:focus-visible { outline: 3px dashed var(--clay); outline-offset: 3px; }
.card__more > p {
  margin-top: .9rem; font-size: .93rem; color: var(--charcoal-soft);
  border-top: 2px dashed var(--snow-blue-lo); padding-top: .9rem;
}
.btn--sm { font-size: .92rem; padding: .65rem 1.15rem; box-shadow: 3px 3px 0 var(--charcoal); }
.card__play { margin-top: 1.2rem; }

.spec {
  margin-top: 1rem; display: grid; gap: .35rem;
  border-top: 2px dashed var(--snow-blue-lo);
  border-bottom: 2px dashed var(--snow-blue-lo);
  padding-block: .8rem;
}
.spec > div { display: grid; grid-template-columns: 6.6rem 1fr; gap: .6rem; align-items: start; }
.spec dt {
  font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 800;
  color: var(--charcoal-soft); line-height: 1.5; padding-top: .1rem;
}
.spec dd { font-size: .9rem; }
@media (max-width: 380px) {
  .spec > div { grid-template-columns: 1fr; gap: .1rem; }
}

/* =============================================================================
   GAME
   ========================================================================== */
.gamesec { background: var(--snow-blue); overflow: hidden; }
/* The Arcade ends with the Shop / Support row; the links section's own wave
   and padding follow. A full section's worth of padding under that row as
   well read as a gap, so the game section keeps a shorter one. */
.gamesec { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
/* The backdrop is absolutely positioned at section level, so everything that
   is not the backdrop needs to be above it. */
.gamesec > .wrap { position: relative; z-index: 1; }
.gamesec .h2 { --underline: var(--snow); }
/* =============================================================================
   THE ARCADE
   -----------------------------------------------------------------------------
   The ride selector, between the section heading and the game frame. Scoped to
   `.arcade` throughout, so none of it reaches the game, the characters or the
   links.

   HEIGHT IS THE DESIGN CONSTRAINT. The frame below is 460-620px and is what
   people came for; on a phone every pixel the selector spends is a pixel of
   game pushed under the fold. So the cards are deliberately small — a shallow
   strip of art, a name, a line, a pill — and they stay side by side at 390px
   rather than stacking, because two short cards cost half what two tall ones
   in a column do.
   ========================================================================== */
.arcade { position: relative; margin-top: 1.5rem; }

/* ---- the mountain behind the whole section -------------------------------
   Three ridges in the sky's own blues, so it reads as distance rather than as
   a picture. It sits under everything and is never the thing you look at.

   It spans the SECTION, not the cards. Inside `.arcade` it stopped at the
   bottom of the cards, which left the game frame standing on plain blue with
   a strip of mountain above it — the join was the thing you noticed.

   Full bleed, so the ranges run off both edges of the window rather than
   stopping at the content column. `.gamesec` clips it. */
.arcadeback {
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;

  /* IT HAS TO END IN THE SAME BLUE THE NEXT SECTION BEGINS IN.

     The near slope is filled with `--snow`, so at full strength the bottom of
     this section is a pale, almost-white blue — and the teaser below it is
     plain `--snow-blue`. Two different blues meeting on a hard horizontal line
     is a seam, however well the sections themselves line up.

     So the range dissolves over the last third. By the time the section ends
     there is nothing left of it but the background colour, which is the exact
     colour the next section starts with, and the two become one field.

     A browser without mask support simply gets the range at full strength —
     the old behaviour, not a broken one. */
  -webkit-mask-image: linear-gradient(to bottom, #000 58%, transparent 97%);
          mask-image: linear-gradient(to bottom, #000 58%, transparent 97%);
}
/* Each layer has its own tone. The section behind is --snow-blue, so nothing
   here may be --snow-blue: a shape the colour of its own background is not a
   subtle shape, it is an invisible one, which is what the first pass shipped. */
.ab--far   { fill: #8FB2CC; opacity: .62; }
.ab--mid   { fill: #A9C8DD; opacity: .72; }
.ab--near  { fill: var(--snow); opacity: .68; }
.ab--cap   { fill: var(--snow); opacity: .78; }
.ab--trees { fill: #5F7E95; opacity: .40; }

/* =============================================================================
   THE GAME TILES (WEB-0)
   -----------------------------------------------------------------------------
   The Arcade is a game library: these are the main choice on the page.

   MOBILE FIRST: one tile per row, laid out sideways — a picture on the left,
   the name and one line in the middle, the one action on the right. Each is a
   comfortable thumb target and nothing is squeezed into a third of a phone.
   From 720px the same tiles stand up in three columns.

   STATES ARE NEVER COLOUR ALONE:
     open    a warm filled "Play" chip (a quiet ticked "Selected" outline on
             the one in the frame)
     locked  a padlock, the word Locked, and how to open it
     soon    a dashed outline chip that says Coming soon; the tile itself is
             not a control, so it has no hover, press or focus to look broken
   ========================================================================== */
.tiles {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .7rem;
}

.tile {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 78px;
  padding: 0 .7rem 0 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--snow);
  border: 2.5px solid var(--charcoal);
  border-radius: 15px 9px 15px 9px / 9px 15px 9px 15px;
  box-shadow: 3px 4px 0 rgba(43, 39, 35, .2);
  overflow: hidden;
}
button.tile { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
button.tile:hover { transform: translate(-1px, -1px); box-shadow: 4px 5px 0 rgba(43, 39, 35, .26); }
button.tile:active { transform: translate(1px, 1px); box-shadow: 1px 2px 0 rgba(43, 39, 35, .26); }
button.tile:focus-visible { outline: 3px solid var(--charcoal); outline-offset: 3px; }
.tile.is-on { box-shadow: 3px 4px 0 rgba(43, 39, 35, .2), 0 0 0 3px var(--glaze-gold); }

/* the picture, full height of the tile */
.tile .art {
  align-self: stretch;
  height: auto;
  min-height: 78px;
  border-right: 2.5px solid var(--charcoal);
}

.tile__body { display: flex; flex-direction: column; gap: .14rem; padding: .55rem 0; min-width: 0; }
.tile__top { display: flex; align-items: center; gap: .38rem; min-width: 0; }
.tile__title {
  font-family: var(--font-display); font-size: 1.08rem; font-weight: 900; line-height: 1.1;
  /* a name wraps rather than being cut */
  overflow-wrap: anywhere;
}
.tile__blurb { font-size: .82rem; line-height: 1.25; color: var(--charcoal-soft); }
.tile__hint { font-size: .74rem; font-weight: 700; line-height: 1.25; color: var(--charcoal-soft); }

.tile__chip {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 38px;
  padding: .4rem .8rem;
  font-size: .84rem; font-weight: 800; line-height: 1; white-space: nowrap;
  border: 2px solid var(--charcoal);
  border-radius: 10px 6px 10px 6px;
}
.tile__chip--open { background: var(--clay); color: var(--snow); box-shadow: 2px 2px 0 var(--charcoal); }
/* The game already in the frame: a quiet outline with a tick, not a second
   loud button. The tile's gold ring says which one; nothing says "riding"
   until the player has pressed RIDE in the game. */
.tile.is-on .tile__chip--open {
  background: transparent; color: var(--charcoal); box-shadow: none;
  border-color: var(--glaze-gold);
}
.tile.is-on .tile__chip--open::before {
  content: ""; width: .32rem; height: .6rem; margin: -.15rem .1rem 0 0;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.tile__chip--locked { background: var(--plum); color: var(--snow); }
/* Pre-release (RELEASE-GATE-1): pressable, so solid and raised like Play,
   but snow-white rather than clay — playable, by invitation. */
.tile__chip--prerelease {
  background: var(--snow); color: var(--charcoal);
  box-shadow: 2px 2px 0 var(--charcoal);
  font-size: .78rem;
}
.tile__chip--soon {
  background: transparent; color: var(--charcoal);
  border-style: dashed;
  font-size: .76rem;
}

/* A padlock, drawn in the chip's own colour: a body and a shackle. */
.tile__lock {
  position: relative; display: inline-block;
  width: .62rem; height: .5rem; margin-top: .3rem;
  background: currentColor; border-radius: 2px;
}
.tile__lock::before {
  content: ""; position: absolute; left: .1rem; right: .1rem; top: -.36rem; height: .42rem;
  border: 2px solid currentColor; border-bottom: 0; border-radius: .3rem .3rem 0 0;
}

/* A locked game is still yours to be curious about; a coming one is still
   something to look forward to. Neither is greyed into looking broken. */
.tile--soon { background: rgba(251, 250, 247, .86); box-shadow: 2px 3px 0 rgba(43, 39, 35, .14); }

/* the pictures */
.art { display: block; height: 38px; position: relative; overflow: hidden; }
.art--day, .art--park { background: linear-gradient(var(--snow-blue), #DCEAF4); }
.art--night { background: linear-gradient(#141C33, #1E2A47); }
.ridge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 26px; }
.sun, .moon {
  position: absolute; right: 9px; top: 9px;
  width: 11px; height: 11px; border-radius: 50%;
}
.sun { background: var(--glaze-gold); border: 2px solid var(--charcoal); }
.moon { background: #F2F0E4; box-shadow: inset -4px 1px 0 #1E2A47; }
.parkfeat { position: absolute; left: 6%; right: 6%; bottom: 3px; width: 88%; height: 52%; display: block; }
.st { position: absolute; width: 1.5px; height: 1.5px; border-radius: 50%; background: #E8EEFB; }

/* The markers a real mountain uses: a green circle, a blue square, a black
   diamond, and the park's gold. Vocabulary only; nothing reads them. */
.mk {
  display: inline-block; width: 9px; height: 9px;
  border: 2px solid var(--charcoal); flex: 0 0 auto;
}
.mk--green { background: var(--moss); border-radius: 50%; }
.mk--blue { background: #6E93B8; }
.mk--black { background: var(--charcoal); transform: rotate(45deg); }
.mk--special { background: var(--glaze-gold); border-radius: 2px; transform: rotate(45deg); }

.ahead {
  position: relative; z-index: 1;
  margin: .55rem 0 0; text-align: center;
  font-size: .7rem; letter-spacing: .08em;
  color: var(--charcoal-soft);
}

/* Very narrow phones: the chip goes under the words rather than squeezing
   them. */
@media (max-width: 359px) {
  .tile { grid-template-columns: 72px minmax(0, 1fr); padding-bottom: .6rem; }
  .tile .art { grid-row: 1 / span 2; }
  .tile__chip { grid-column: 2; justify-self: start; }
}

/* Tablet and up: three standing tiles. The picture becomes a strip across
   the top; the tile never stretches into a big empty card. */
@media (min-width: 720px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
  .tile {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    align-items: start;
    gap: 0;
    padding: 0 0 .8rem;
  }
  .tile .art { min-height: 0; height: 74px; border-right: 0; border-bottom: 2.5px solid var(--charcoal); }
  .tile__body { padding: .6rem .8rem .55rem; }
  .tile__title { font-size: 1.2rem; }
  .tile__chip { justify-self: start; margin: 0 .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  button.tile { transition: none; }
  button.tile:hover, button.tile:active { transform: none; }
}

.gamewrap {
  margin-top: 1.1rem;
  border: 3px solid var(--charcoal);
  border-radius: 26px 18px 26px 18px / 18px 26px 18px 26px;
  box-shadow: 6px 7px 0 var(--charcoal);
  overflow: hidden;
  background: var(--snow);
  transform: rotate(-.4deg);
}
/* The game's own dialogs have to fit inside this box — the stage crops
   anything taller, and on a phone 460px was not enough for the game-over card,
   which is how "Share your score" ended up cut off below the frame.

   svh is the *small* viewport height: the height with the browser's toolbars
   showing. Using it means the game does not resize every time Safari's chrome
   slides away mid-run. The plain px line above it is the fallback for browsers
   without svh, and min-height keeps a floor on very short screens. Desktop
   heights are set in the breakpoints below and are unchanged. */
.gamewrap iframe {
  display: block; width: 100%; border: 0;
  height: 460px;
  height: min(78svh, 620px);
  /* The floor has to bow to the viewport as well, or a landscape phone (390px
     tall) gets a 460px game with its bottom below the fold. On a portrait
     phone 86svh is comfortably over 460, so the floor still does its job. */
  min-height: 460px;
  min-height: min(460px, 86svh);
}
/* only rendered when the page is opened from disk */
.gamesec__note {
  margin-top: 1rem; font-size: .85rem; line-height: 1.5;
  color: var(--charcoal); background: var(--snow);
  border: 2.5px solid var(--charcoal); border-radius: 18px 10px 18px 10px;
  padding: .7rem .9rem; max-width: 46ch;
}

/* =============================================================================
   THE TEASER
   -----------------------------------------------------------------------------
   A small night-toned panel under the game. Everything here is scoped to
   `.teaser`, so none of it can reach the game, the characters or the links —
   this file's other rules are untouched.

   It is deliberately NOT a full-width band. The game sits directly above it and
   is the thing people came for; a second band of the same weight would read as
   two equal sections and split the page's attention. A panel sitting on the
   same background says "and also this", which is what a teaser is.
   ========================================================================== */
/* `padding-top: 0` is deliberate: this section continues the game section's
   blue, with no join between them.

   But zero top padding is also exactly what lets a child's top margin collapse
   OUT of a section — and `.teaser__panel` has `margin-top: 2.4rem`, which
   passed straight through `.wrap` and became the section's own margin. The
   blue started 2.4rem lower than the section did, and that 2.4rem showed the
   page's cream: a hard cream band across the page between the game and the
   teaser, which read as the two sections failing to meet.

   `flow-root` makes this a block formatting context, so the panel's margin
   stays inside the blue where it was meant to be. The gap it creates is the
   same; it is just the right colour now. */
.teaser {
  background: var(--snow-blue);
  padding-top: 0;
  display: flow-root;
}
/* switched off (config.teaser.enabled: false): gone, padding and all —
   `display: flow-root` above would otherwise override the hidden attribute */
.teaser[hidden] { display: none; }

/* The panel matches the game frame above it exactly — same width, same
   height, same border, same corners. The height rules below are copied from
   `.gamewrap iframe` deliberately rather than shared through a variable: the
   game's sizing is production code that works, and a teaser must not be able
   to change it by editing something they hold in common. If the game's height
   ever moves, this follows by hand, which is the safer direction for the
   dependency to run. */
.teaser__panel {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  margin-top: 2.4rem;
  padding: 1.4rem;
  text-align: center;
  color: #F2F0E4;
  background: linear-gradient(#141C33, #1E2A47);
  border: 3px solid var(--charcoal);
  border-radius: 26px 18px 26px 18px / 18px 26px 18px 26px;
  box-shadow: 6px 7px 0 var(--charcoal);
  /* tilted the other way from the game frame, so two boxes of the same size
     stacked up read as a pair rather than as one crooked slab */
  transform: rotate(.35deg);

  /* ---- the same height the game is, by the same rules ---- */
  height: 460px;
  height: min(78svh, 620px);
  min-height: 460px;
  min-height: min(460px, 86svh);
}

/* the ridge sits along the bottom and scales with the panel's width */
.teaser__ridge {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: 42%;
  display: block;
}
/* the moon keeps its shape at any panel size, so it is sized in rem rather
   than as a fraction of a box whose proportions change */
.teaser__moon {
  position: absolute;
  top: 7%; right: 8%;
  width: clamp(2.6rem, 7vw, 4.4rem);
  height: auto;
  display: block;
}
/* Standing on the near ridge, down in the left third where the copy is not.
   Positioned from the BOTTOM so it stays on the hill whatever height the panel
   takes, and sized in rem so it keeps its proportions when the ridge beside it
   is being stretched. */
.teaser__yeti {
  position: absolute;
  left: 13%;
  bottom: 11%;
  /* wider than it is tall now that the arms are out, so this is the width of
     the whole wingspan rather than of the body */
  width: clamp(2.6rem, 5.2vw, 4rem);
  height: auto;
  display: block;
  opacity: .9;
}

.teaser__star {
  position: absolute;
  border-radius: 50%;
  background: #F2F0E4;
  pointer-events: none;
}

.teaser__line {
  position: relative; z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.3rem, 4.4vw, 2rem);
  line-height: 1.12;
  text-shadow: 0 2px 10px rgba(10,16,32,.55);
}
.teaser__sub {
  position: relative; z-index: 1;
  margin: .55rem 0 0;
  font-size: clamp(.95rem, 3.2vw, 1.1rem);
  color: #C7D3E6;
  text-shadow: 0 2px 10px rgba(10,16,32,.55);
}

/* The stars breathe, slightly, on their own clocks. Purely decorative, and
   switched off entirely for anyone who has asked for less motion. */
@keyframes teaser-twinkle {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}
.teaser__star { opacity: .7; animation: teaser-twinkle 4s ease-in-out infinite; }
.teaser__star--b { animation-duration: 5.5s; animation-delay: -1.2s; }
.teaser__star--c { animation-duration: 3.6s; animation-delay: -2.4s; }
.teaser__star--d { animation-duration: 6.2s; animation-delay: -0.6s; }
.teaser__star--e { animation-duration: 4.8s; animation-delay: -3.1s; }
.teaser__star--f { animation-duration: 5.1s; animation-delay: -1.9s; }
.teaser__star--g { animation-duration: 4.3s; animation-delay: -3.7s; }

@media (prefers-reduced-motion: reduce) {
  .teaser__star { animation: none; opacity: .75; }
  .teaser__panel { transform: none; }
}

@media (max-width: 560px) {
  .teaser__panel { transform: none; padding: 1.1rem; }
}

/* =============================================================================
   LINKS
   ========================================================================== */
.links { background: var(--cream-deep); }
.links .h2 { --underline: var(--clay); }
.linklist { display: grid; gap: 1rem; margin-top: 2.4rem; }
.linkcard {
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none;
  background: var(--snow);
  border: 3px solid var(--charcoal);
  border-radius: 24px 14px 24px 14px / 14px 24px 14px 24px;
  box-shadow: 4px 5px 0 var(--charcoal);
  padding: 1rem 1.2rem;
  transition: transform .14s ease, box-shadow .14s ease;
}
.linkcard:nth-child(even) { transform: rotate(.55deg); }
.linkcard:nth-child(odd)  { transform: rotate(-.45deg); }
.linkcard:hover { transform: rotate(0) translateY(-2px); box-shadow: 6px 8px 0 var(--charcoal); }
.linkcard__txt { flex: 1; min-width: 0; }
.linkcard__label { font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; }
.linkcard__note { font-size: .82rem; color: var(--charcoal-soft); }
.linkcard__handle { font-weight: 800; font-size: .85rem; color: var(--clay-deep); white-space: nowrap; }
.linkcard__ico { width: 34px; height: 34px; flex: none; }

/* =============================================================================
   FOOTER
   ========================================================================== */
.foot {
  background: var(--charcoal); color: var(--cream);
  padding: clamp(3rem, 9vw, 4.5rem) 0 clamp(2.5rem, 8vw, 4rem);
  text-align: center;
}
.foot__sig { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; margin-top: .6rem; }
.foot__line { max-width: 34ch; margin-inline: auto; font-size: .95rem; opacity: .82; }
.foot__small { font-size: .78rem; opacity: .5; margin-top: 1.6rem; }
.foot__dodu { width: 66px; margin: 0 auto 1.2rem; }

/* =============================================================================
   BREAKPOINTS
   ========================================================================== */
@media (min-width: 720px) {
  body { font-size: 18px; }
  .notes { grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .linklist { grid-template-columns: repeat(3, 1fr); }
  /* A landscape phone is ~844 wide and ~390 tall, so it lands in this
     breakpoint and used to get a 520px game inside a 390px viewport — the
     bottom of the game simply below the fold. Capping against the viewport
     height costs a desktop nothing (86svh of a normal window is well over
     520px) and makes landscape usable. */
  .gamewrap iframe { height: min(520px, 86svh); }
  /* the teaser matches the game at every breakpoint the game has */
  .teaser__panel { height: min(520px, 86svh); }
  .sticker { font-size: .95rem; }
}

@media (min-width: 1040px) {
  .hero__in { max-width: 62%; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .gamewrap iframe { height: min(560px, 86svh); }
  .teaser__panel { height: min(560px, 86svh); }
}

/* =============================================================================
   THE ACCESS DIALOG (RELEASE-GATE-1, gate.js) — a SECRET LIFT TICKET.
   A little cream pass for a tiny snowboard park: the game's own tile picture
   across the top with a gold Pre-release stamp, a torn-off line with two
   notches, then the invitation and the code. Built from the page's pieces —
   cream, snow blue, gold, clay, charcoal, the display and body fonts, the
   hand-cut corners — and scoped to .gate. Behaviour is modal.js's.
   ========================================================================== */
/* THE ARCADE'S DIALOGS SHARE A BACKDROP AND A CLOSE (RELEASE-GATE-1 polish):
   the page behind dims and softly blurs (~4px), the panel stays sharp, and
   the ✕ is the same 44px target in the same corner. Each dialog keeps its
   own look (.gate here, .nightmodal in night.css); both panels are the same
   width and fit inside the screen and its safe areas, scrolling inside if
   they must. Behaviour (Escape, the backdrop tap, focus) is modal.js's. */
.dodu-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
           max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  overflow-y: auto; overscroll-behavior: contain;
  background: rgba(24, 28, 38, .5);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .dodu-backdrop { background: rgba(24, 28, 38, .66); }   /* no blur: a little more dim instead */
}
.dodu-backdrop[hidden] { display: none; }
.dodu-close {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  font: 700 1.6rem/1 var(--font-body, system-ui, sans-serif);
  background: transparent; border: 2px solid transparent; border-radius: 50%;
  cursor: pointer;
}
.dodu-close:focus-visible { outline: 3px dashed var(--glaze-gold); outline-offset: 1px; }
/* the one width both dialogs share */
.gate__ticket, .nightmodal__panel { width: 100%; max-width: 340px; }
/* the shadow lives here: the card's notches are a mask, which would clip it */
.gate__ticket {
  position: relative;
  max-height: 100%;
  filter: drop-shadow(4px 5px 0 var(--charcoal));
  animation: gate-in .24s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes gate-in {
  from { opacity: 0; transform: translateY(10px) rotate(-1.5deg) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.gate__card {
  --tear: 95px;                      /* where the ticket tears: the dashed line under the picture */
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  background: var(--cream);
  color: var(--charcoal);
  border: 2.5px solid var(--charcoal);
  border-radius: 18px 12px 18px 12px;
  /* two half-circle notches at the tear line, like a real stub */
  -webkit-mask: radial-gradient(circle 10px at 0 var(--tear), #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 10px at 100% var(--tear), #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 10px at 0 var(--tear), #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 10px at 100% var(--tear), #0000 98%, #000) right / 51% 100% no-repeat;
}
.gate__scene {
  position: relative;
  height: var(--tear);
  background: linear-gradient(var(--snow-blue), #DCEAF4);
  border-bottom: 2.5px dashed var(--charcoal-soft);
  overflow: hidden;
}
/* the Arcade tile's own picture (kicker, box, rail, sun), just taller */
.gate__art, .gate__art .art { position: absolute; inset: 0; height: 100%; }
.gate__art .ridge { height: 60%; }
.gate__art .parkfeat { height: 48%; bottom: 6px; left: 14%; right: 14%; width: 72%; }
.gate__art .sun { width: 15px; height: 15px; top: 12px; right: auto; left: 16px; }
/* the ✕ on the picture, in the same corner as Night Ride's */
.gate__close { color: var(--charcoal); }
.gate__close:hover { border-color: var(--charcoal); }
.gate__stamp {
  position: absolute; bottom: 12px; right: 12px;
  padding: .22rem .55rem .2rem;
  font: 900 .7rem/1 var(--font-body, system-ui, sans-serif);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--charcoal);
  background: var(--glaze-gold);
  border: 2px solid var(--charcoal);
  border-radius: 6px 3px 6px 3px;
  transform: rotate(6deg);
  box-shadow: 2px 2px 0 var(--charcoal);
}
.gate__body { padding: 1rem 1.15rem 1.05rem; }
.gate__kicker {
  margin: 0 0 .15rem;
  font: 800 .7rem/1.2 var(--font-body, system-ui, sans-serif);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--clay);
}
.gate__title { margin: 0; font-family: var(--font-display, inherit); font-size: 1.55rem; line-height: 1.05; }
.gate__tagline {
  margin: .3rem 0 .85rem;
  font-family: var(--font-display, inherit); font-style: italic; font-weight: 600;
  font-size: 1rem; color: var(--charcoal-soft);
}
.gate__tagline[hidden] { display: none; }
.gate__prompt { margin: 0 0 .5rem; font-size: .9rem; color: var(--charcoal-soft); }
.gate__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gate__input {
  display: block; width: 100%; box-sizing: border-box;
  min-height: 48px; padding: .6rem .8rem;
  font: inherit; font-size: 16px; /* 16px: iOS does not zoom the page to type */
  letter-spacing: .04em;
  color: var(--charcoal); background: #fff;
  border: 2px solid var(--charcoal); border-radius: 10px 6px 10px 6px;
}
.gate__input:focus-visible { outline: 3px solid var(--glaze-gold); outline-offset: 2px; }
.gate__msg { min-height: 1.3em; margin: .45rem 0 0; font-size: .86rem; font-weight: 700; color: var(--clay); }
.gate__btns { display: flex; gap: .55rem; align-items: center; margin-top: .45rem; }
.gate__btns .btn { font-size: .95rem; padding: .62rem 1rem; }
/* the way in is the big, warm one; Cancel stays quiet beside it */
.gate__go { flex: 1 1 auto; min-height: 48px; justify-content: center; }
.gate__cancel { flex: 0 0 auto; }
.gate__btns .btn[disabled] { opacity: .6; cursor: progress; }
@media (prefers-reduced-motion: reduce) {
  .gate__ticket { animation: none; }
}

/* =============================================================================
   IMMERSIVE PLAY (ARCADE-UX-2, immersive.js)
   -----------------------------------------------------------------------------
   Ride, in any game: the game's box covers the whole visual viewport and the
   page behind it is hidden and still. Fullscreen (where the browser allows
   it) is the same box, made the browser's fullscreen element. Nothing inside
   the game changes; its frame is simply bigger, and the game resizes itself
   as it does for any window.
     dvh        the viewport as it is NOW (Safari's toolbars in or out), with
                vh before it for browsers without dynamic units
     safe areas the game sits inside the notch and the home bar; the band
                outside is the game's own dark ink, not the page
   ========================================================================== */
html.dodu-immersive, html.dodu-immersive body {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
}
html.dodu-immersive .grain,
html.dodu-immersive .topbar,
html.dodu-immersive .skip { display: none; }
/* the section's own stacking context would keep the box under the page */
html.dodu-immersive .gamesec > .wrap { z-index: auto; }
/* Each selector in its OWN rule: a browser that does not know one of these
   pseudo-classes drops the whole rule it sits in, and the expanded view must
   never be lost to an old Safari not knowing :fullscreen. */
.gamewrap.is-immersive {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  margin: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  background: var(--charcoal, #2B2723);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
           env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}
.gamewrap:fullscreen {
  width: 100vw; height: 100vh; margin: 0; border: 0; border-radius: 0;
  box-shadow: none; transform: none; background: var(--charcoal, #2B2723);
}
.gamewrap:-webkit-full-screen {
  width: 100vw; height: 100vh; margin: 0; border: 0; border-radius: 0;
  box-shadow: none; transform: none; background: var(--charcoal, #2B2723);
}
.gamewrap.is-immersive iframe { width: 100%; height: 100%; min-height: 0; }
.gamewrap:fullscreen iframe { width: 100%; height: 100%; min-height: 0; }
.gamewrap:-webkit-full-screen iframe { width: 100%; height: 100%; min-height: 0; }

/* =============================================================================
   PLAY-2: THE GAME-FIRST ARCADE (play.html, at /play)
   -----------------------------------------------------------------------------
   The same Arcade section, cards, artwork, type and colours as the home page,
   with nothing above the games but the top bar. Every rule here is scoped to
   html[data-page="play"], which only play.html carries, so the home page and
   the mudmagi.com embed (both index.html) are untouched by this block.
   ========================================================================== */
/* the games start near the top: a section's usual 4 to 7.5rem of top padding
   was there to separate it from the section above, and on /play there is none */
html[data-page="play"] .gamesec {
  padding-top: clamp(2.4rem, 7vw, 3.6rem);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  /* the snowy blue runs to the foot of a tall screen rather than stopping
     short of it under three cards */
  min-height: calc(100svh - 4.5rem);
}
/* the top bar's three small ways out fit a phone without spilling sideways */
@media (max-width: 480px) {
  html[data-page="play"] .topbar { flex-wrap: wrap; row-gap: .35rem; }
  html[data-page="play"] .topbar__nav { gap: .8rem; font-size: .85rem; flex-wrap: wrap; }
}
