/* Выше крыш: an old New Year postcard. Ink-blue night, cranberry
   Santa, mandarin light, snow paper; Marck Script for the greetings,
   Golos Text for everything else. */

@font-face {
  font-family: 'Golos Text';
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/golos-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/golos-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Marck Script';
  font-display: swap;
  src: url(fonts/marck-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Marck Script';
  font-display: swap;
  src: url(fonts/marck-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #141F3B;
  --night: #1E2F55;
  --teal: #4FA3A5;
  --pine: #1F5F4A;
  --cranberry: #C8283C;
  --cranberry-deep: #86172A;
  --mandarin: #F39237;
  --snow: #EEF3F1;
  --paper: #E9EFEC;
  --safe-top: max(env(safe-area-inset-top), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --script: 'Marck Script', 'Segoe Script', cursive;
  --sans: 'Golos Text', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--snow);
  font: 400 16px/1.45 var(--sans);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

#app {
  position: relative;
  width: min(100vw, 480px);
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: var(--night);
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

[hidden] { display: none !important; }

h1, h2, p { margin: 0; }

button { font: inherit; color: inherit; }

/* ----------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  font: 700 17px/1 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
  touch-action: manipulation;
}
.btn:focus-visible, .icon-btn:focus-visible {
  outline: 3px solid var(--mandarin);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--cranberry);
  color: var(--snow);
  box-shadow: 0 4px 0 var(--cranberry-deep);
}
.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--cranberry-deep);
}

/* A plate of night sky, so the roofs behind don't eat the words. */
.btn-ghost {
  background: rgba(20, 31, 59, 0.72);
  box-shadow: inset 0 0 0 1.5px rgba(238, 243, 241, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(20, 31, 59, 0.8);
}
.btn-ghost:active { background: rgba(20, 31, 59, 0.88); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(20, 31, 59, 0.55);
  font-weight: 600;
}
.btn-outline:active { background: rgba(20, 31, 59, 0.08); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 31, 59, 0.55);
  color: var(--snow);
  cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stack { display: grid; gap: 12px; width: 100%; }

/* ----------------------------------------------------------- settings */

/* The way in: a plate-of-night button like its neighbours. In the pause
   it is a row of its own, a gear before the word; on the title screen
   only the gear, square, at the end of the records' and the bag's row,
   so the screen is no taller for it. */
.btn-settings { gap: 10px; }
.btn-settings svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.row-gear { grid-template-columns: 1fr 1fr auto; }
.btn-gear { width: 52px; padding: 0; }
.btn-gear svg { width: 26px; height: 26px; }

/* The card: a postcard like the gift's, a row for the music and one for
   the sounds, each a switch and a volume, parted by a perforation. */
.postcard.settings {
  --tilt: 0.8deg;
  max-width: 360px;
  display: grid;
  gap: 4px;
}
.settings .greeting { margin: 0 0 6px; }
.setting {
  --fill: 70%;
  display: grid;
  gap: 8px;
  padding: 14px 0 12px;
  border-top: 2px dotted rgba(20, 31, 59, 0.28);
}
.setting-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 18px/1.2 var(--sans);
  cursor: pointer;
}
.setting-name span { flex: 1; }
.setting-name svg { width: 24px; height: 24px; flex: none; color: var(--cranberry); transition: opacity 160ms ease; }
.setting-name .glyph { fill: currentColor; }
.setting-name .wave { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

/* A switch: pine when on, the knob a snowball. */
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  margin: 0;
  border-radius: 15px;
  background: rgba(20, 31, 59, 0.24);
  cursor: pointer;
  transition: background 160ms ease;
}
.switch::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FAFCFA;
  box-shadow: 0 1px 2px rgba(20, 31, 59, 0.45);
  transition: transform 180ms cubic-bezier(0.3, 1.3, 0.5, 1);
}
.switch:checked { background: var(--pine); }
.switch:checked::before { transform: translateX(22px); }
.switch:focus-visible { outline: 3px solid var(--mandarin); outline-offset: 2px; }

.setting-volume {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding-left: 34px;
}
.setting-volume output {
  min-width: 3.4em;
  text-align: right;
  font: 700 15px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: rgba(20, 31, 59, 0.75);
}

/* The volume: a mandarin line up to the snowball, with the print's
   cranberry misprint under the knob. */
.volume {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 32px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}
.volume::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--mandarin) var(--fill), rgba(20, 31, 59, 0.16) var(--fill));
}
.volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border-radius: 50%;
  background: #FAFCFA;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--cranberry);
}
.volume::-moz-range-track { height: 8px; border-radius: 4px; background: rgba(20, 31, 59, 0.16); }
.volume::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--mandarin); }
.volume::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FAFCFA;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--cranberry);
}
.volume:focus-visible { outline: 3px solid var(--mandarin); outline-offset: 2px; border-radius: 6px; }

/* Off: the row fades, the line goes grey; the slider still works and
   switches it back on. */
.setting.off .setting-name svg, .setting.off .setting-volume { opacity: 0.5; }
.setting.off .volume::-webkit-slider-runnable-track {
  background: linear-gradient(to right, rgba(20, 31, 59, 0.4) var(--fill), rgba(20, 31, 59, 0.16) var(--fill));
}
.setting.off .volume::-moz-range-progress { background: rgba(20, 31, 59, 0.4); }
.settings .btn-primary { margin-top: 14px; }

/* The tilt: a spirit level whose bubble is where Santa would fly now,
   pine while he would stand still; under it «Ровно», and «Сбросить» once
   the player has a level of their own. */
.setting-name .outline { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.setting-tilt .setting-name { cursor: default; }
.level {
  position: relative;
  height: 30px;
  margin-left: 34px;
  border-radius: 15px;
  background: rgba(20, 31, 59, 0.12);
  box-shadow: inset 0 0 0 1.5px rgba(20, 31, 59, 0.3);
}
.level::before, .level::after {
  content: '';
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: rgba(20, 31, 59, 0.4);
}
.level::before { left: calc(50% - 17px); }
.level::after { left: calc(50% + 15px); }
.level-bubble {
  --x: 0;
  position: absolute;
  top: 3px;
  left: calc(50% - 12px + var(--x) * (50% - 15px));
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mandarin);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--cranberry);
  transition: background 120ms ease;
}
.level-bubble.still { background: var(--pine); }
.setting-note {
  margin: 0 0 0 34px;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(20, 31, 59, 0.75);
}
.tilt-actions {
  display: flex;
  gap: 10px;
  margin-left: 34px;
}
.tilt-actions .btn { flex: 1; min-height: 44px; }
/* On a short screen the card may outgrow it. */
#screen-settings { justify-content: safe center; overflow-y: auto; }

/* --------------------------------------------------------------- HUD */

.hud {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "score bag";
  align-content: start;
  align-items: start;
  gap: 10px;
  padding: calc(var(--safe-top) + 10px) 14px 0;
  pointer-events: none;
}
.hud .icon-btn { pointer-events: auto; }

.hud-score { grid-area: score; display: grid; line-height: 1; text-shadow: 2px 2px 0 var(--ink); }
#hud-score {
  font: 800 30px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--snow);
}
#hud-metres {
  margin-top: 4px;
  font: 600 13px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: rgba(238, 243, 241, 0.75);
}

.hud-bag {
  grid-area: bag;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  padding-top: 4px;
}

/* In the bottom left corner, under the thumb and away from where the
   player aims: snowballs mostly fly up. */
#btn-pause {
  position: absolute;
  left: 14px;
  bottom: calc(var(--safe-bottom) + 16px);
  width: 54px;
  height: 54px;
  /* No blur behind it: over a picture that changes every frame, a phone
     would blur it again every frame. */
  background: rgba(20, 31, 59, 0.7);
  box-shadow: inset 0 0 0 1.5px rgba(238, 243, 241, 0.5);
}
#btn-pause svg { width: 22px; height: 22px; }
#btn-pause:active { background: rgba(20, 31, 59, 0.85); }

/* Telegram in full screen: its buttons sit at the corners of a bar over
   the game. The score takes the free middle of that bar, the bag goes
   right under it. */
.tg-bar .hud {
  grid-template-columns: 1fr;
  grid-template-rows: var(--tg-content-safe-area-inset-top) auto;
  grid-template-areas: "score" "bag";
  gap: 4px;
  padding-top: var(--tg-safe-area-inset-top, 0px);
}
.tg-bar .hud-score {
  display: flex;
  align-items: baseline;
  align-self: center;
  justify-self: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 17px;
  background: rgba(20, 31, 59, 0.55);
  text-shadow: none;
}
.tg-bar #hud-score { font-size: 24px; }
.tg-bar #hud-metres { margin-top: 0; }
.tg-bar .hud-bag { padding-top: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 26px;
  padding: 0 8px 0 5px;
  border-radius: 13px;
  background: rgba(20, 31, 59, 0.62);
  font: 700 13px/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.chip.lead {
  background: var(--snow);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--mandarin);
}

/* -------------------------------------------------------- base screen */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 18px) 22px calc(var(--safe-bottom) + 22px);
}

.script-heading {
  font: 400 40px/1.05 var(--script);
  color: var(--snow);
  text-shadow: 2px 2px 0 var(--cranberry);
}

.address {
  font: 400 24px/1.2 var(--script);
  color: var(--mandarin);
}

/* ------------------------------------------------------- title screen */

.screen-start {
  align-items: center;
  text-align: center;
  padding-top: calc(var(--safe-top) + 7vh);
  /* A short phone scrolls to the hint rather than losing it; only up
     and down, though the sleigh's route runs off the edge. */
  overflow: hidden auto;
  /* Dims the level behind the words; Santa's roofs below stay clear. */
  background: linear-gradient(rgba(20, 31, 59, 0.82) 0%, rgba(20, 31, 59, 0.7) 52%, rgba(20, 31, 59, 0) 74%);
}

.logo {
  display: grid;
  font: 400 clamp(62px, 19vw, 84px)/0.86 var(--script);
  color: var(--snow);
  text-shadow: 3px 3px 0 var(--cranberry);
  transform: rotate(-4deg);
}
.logo span:last-child { margin-left: 0.6em; font-size: 0.62em; }

.screen-start .lead {
  max-width: 32ch;
  margin-top: 26px;
  color: rgba(238, 243, 241, 0.88);
  text-wrap: balance;
}
.gift-icon {
  width: 1.4em;
  height: 1.4em;
  margin: -0.3em 0 -0.15em;
  vertical-align: baseline;
}
.screen-start .address { margin-top: 14px; }
.start-actions {
  display: grid;
  gap: 12px;
  width: min(100%, 320px);
  margin-top: 24px;
}
.start-actions .row { gap: 10px; }
.start-actions .btn-primary { min-height: 58px; font-size: 19px; }
.best {
  margin-top: 16px;
  font: 700 15px/1.3 var(--sans);
  color: var(--mandarin);
  font-variant-numeric: tabular-nums;
}
/* On a plate of night sky, so the roofs behind don't eat the words. */
.hint {
  max-width: 34ch;
  margin-top: 20px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(20, 31, 59, 0.8);
  font-size: 14px;
  line-height: 1.4;
  color: rgba(238, 243, 241, 0.92);
  text-wrap: balance;
}

/* --------------------------------------------------------- the postcard */

.screen-card {
  justify-content: center;
  background: rgba(14, 21, 48, 0.55);
}

.postcard {
  --tilt: -1.5deg;
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 18px 20px 20px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, rgba(20, 31, 59, 0.025) 0 1px, transparent 1px 4px),
    var(--paper);
  color: var(--ink);
  box-shadow: 6px 7px 0 rgba(20, 31, 59, 0.6);
  transform: rotate(var(--tilt));
  animation: card-in 420ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.postcard::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1.5px solid rgba(20, 31, 59, 0.22);
  border-radius: 3px;
  pointer-events: none;
}

.postcard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 92px;
}

/* A postage stamp: the paper's colour punches the perforation. */
.stamp {
  --stamp: var(--mandarin);
  position: relative;
  width: 80px;
  height: 90px;
  padding: 7px;
  background:
    radial-gradient(circle, var(--paper) 2.7px, transparent 3.1px) -5px -5px / 10px 10px,
    #FAFCFA;
  filter: drop-shadow(1.5px 1.5px 0 rgba(20, 31, 59, 0.35));
  transform: rotate(3deg);
  animation: stamp-in 360ms 260ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.stamp-face {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  height: 100%;
  padding: 4px 3px;
  background: var(--stamp);
  color: var(--snow);
  text-align: center;
}
.stamp-emoji { font-size: 30px; line-height: 1; }
.stamp-name {
  font: 700 9.5px/1.1 var(--sans);
  text-wrap: balance;
}

.postmark {
  width: 132px;
  height: 88px;
  margin-right: -6px;
  color: var(--ink);
  opacity: 0.62;
  transform: rotate(-8deg);
  animation: stamp-in 300ms 420ms ease-out both;
}
.postmark-waves, .postmark-ring {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
}
.postmark-ring.thin { stroke-width: 1.2; }
.postmark-arc-text { font: 700 11px var(--sans); fill: currentColor; letter-spacing: 0.04em; }
.postmark-date { font: 400 26px var(--script); fill: currentColor; }

.greeting {
  margin-top: 8px;
  font: 400 30px/1.1 var(--script);
  color: var(--cranberry);
}
.idea-title {
  margin-top: 6px;
  font: 800 24px/1.15 var(--sans);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.idea-text {
  margin-top: 8px;
  max-width: 60ch;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(20, 31, 59, 0.86);
}

.loader { display: grid; place-items: center; padding: 18px 0 8px; }
.loader svg { width: 64px; height: 60px; animation: wobble 900ms ease-in-out infinite; }

.card-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.card-actions.single { grid-template-columns: 1fr; }

/* ---------------------------------------------------- pause, game over */

.screen-center {
  justify-content: center;
  align-items: center;
  gap: 28px;
  background: rgba(14, 21, 48, 0.62);
}
.screen-center .stack { max-width: 300px; }

.screen-over {
  align-items: center;
  text-align: center;
  background: rgba(14, 21, 48, 0.7);
  padding-top: calc(var(--safe-top) + 6vh);
  overflow-y: auto;
}
.screen-over .script-heading { font-size: 34px; max-width: 16ch; text-wrap: balance; }
.over-metres { margin-top: 10px; color: rgba(238, 243, 241, 0.75); font-variant-numeric: tabular-nums; }
.final-score {
  display: block;
  margin-top: 6px;
  font: 800 clamp(56px, 17vw, 76px)/1 var(--sans);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 3px 3px 0 var(--cranberry);
}
.record-mark {
  margin-top: 12px;
  padding: 6px 14px;
  border-radius: 4px;
  background: var(--mandarin);
  color: var(--ink);
  font: 800 15px/1.2 var(--sans);
  transform: rotate(-3deg);
  box-shadow: 2px 2px 0 var(--ink);
  animation: stamp-in 320ms 200ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
.over-best { margin-top: 10px; font-size: 14px; color: rgba(238, 243, 241, 0.7); font-variant-numeric: tabular-nums; }
.screen-over .leaderboard { width: min(100%, 340px); margin: 20px 0 24px; }
.screen-over .stack { max-width: 340px; margin-top: auto; }

.leaderboard {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.leaderboard li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(238, 243, 241, 0.07);
}
.leaderboard .place { color: rgba(238, 243, 241, 0.55); font-weight: 700; }
.leaderboard .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard .pts { font-weight: 800; }
.leaderboard li.me { background: var(--snow); color: var(--ink); }
.leaderboard li.me .place { color: var(--cranberry); }
.leaderboard li:first-child .place { color: var(--mandarin); }
.leaderboard.roomy li { min-height: 48px; font-size: 17px; }

/* -------------------------------------------------------------- lists */

.screen-list {
  background: var(--night);
  overflow-y: auto;
  gap: 16px;
}
.list-head { display: flex; align-items: center; gap: 12px; }
.list-head h2 { font: 400 38px/1 var(--script); text-shadow: 2px 2px 0 var(--cranberry); }
.list-note { color: rgba(238, 243, 241, 0.7); font-size: 14px; }

.bag-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bag-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 3px 4px 0 rgba(20, 31, 59, 0.55);
}
.bag-list .mini-stamp {
  display: grid;
  place-items: center;
  width: 40px;
  height: 46px;
  background: var(--stamp, var(--mandarin));
  font-size: 22px;
  box-shadow: 0 0 0 3px #FAFCFA, 1px 1px 0 3px rgba(20, 31, 59, 0.25);
}
.bag-list h3 { margin: 0; font: 800 17px/1.2 var(--sans); }
.bag-list p { margin-top: 4px; font-size: 14.5px; line-height: 1.45; color: rgba(20, 31, 59, 0.82); }

.empty { display: grid; gap: 18px; justify-items: start; color: rgba(238, 243, 241, 0.85); max-width: 32ch; }

/* ----------------------------------------------- the sleigh's tap hint */

/* Over the sky ahead of the sleigh while it hovers, on a plate of night. */
.tap-hint {
  position: absolute;
  left: 50%;
  top: 40%;
  padding: 8px 18px 10px;
  border-radius: 14px;
  background: rgba(20, 31, 59, 0.72);
  font: 400 32px/1 var(--script);
  color: var(--snow);
  text-shadow: 2px 2px 0 var(--cranberry);
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  animation: breathe 1.6s ease-in-out infinite;
}

/* The sleigh's title: its route runs under the name and off the edge. */
[data-game=sleigh] .logo { position: relative; margin-bottom: 26px; }
[data-game=sleigh] .logo::after {
  content: '';
  position: absolute;
  left: 4%;
  right: -40vw;
  bottom: -36px;
  height: 34px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 34' preserveAspectRatio='none'%3E%3Cpath d='M2 30 C 90 30 140 4 230 10 S 360 26 398 6' fill='none' stroke='%23141F3B' stroke-opacity='.45' stroke-width='3' stroke-dasharray='9 10' stroke-linecap='round' transform='translate(2 2)'/%3E%3Cpath d='M2 30 C 90 30 140 4 230 10 S 360 26 398 6' fill='none' stroke='%23F39237' stroke-width='3' stroke-dasharray='9 10' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
  pointer-events: none;
}

/* ------------------------------------------------------------- motion */

@keyframes card-in {
  from { opacity: 0; transform: translateY(46px) rotate(5deg) scale(0.92); }
  to { opacity: 1; transform: rotate(var(--tilt)); }
}
@keyframes stamp-in {
  from { opacity: 0; scale: 1.7; }
  to { opacity: 1; scale: 1; }
}
@keyframes breathe {
  0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.82; transform: translateX(-50%) scale(1.04); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg) translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .postcard, .stamp, .postmark, .record-mark, .tap-hint { animation: none; }
  .loader svg { animation-duration: 2.4s; }
}

@media (max-height: 640px) {
  .screen-start { padding-top: calc(var(--safe-top) + 3vh); }
  .logo { font-size: 58px; }
  .postcard-head { min-height: 80px; }
}
