/* JollyTap Games - shared styles.
   Look: "Day and night". Light theme is a daytime sky, dark theme is the same scene at night.
   Every colour is a variable below, so a theme is just a second set of values. */

@font-face {
  font-family: "Titan One";
  src: url("/assets/fonts/titan-one-latin-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --sky: #bde7ff;
  --ink: #1b1b3a;
  --ink-soft: #4a4f6e;
  --line: #1b1b3a;
  --letter-line: #1b1b3a;
  --press: #1b1b3a;
  --card: #ffffff;
  --card-shadow: #1b1b3a;
  --card-shadow-alt: #1b1b3a;
  --pill: #ffffff;
  --cloud: #ffffff;
  --cloud-line: #1b1b3a;
  --hill: #7ed957;
  --hill-line: #1b1b3a;
  --hill-ink: #1b1b3a;
  --play: #ffb703;
  --play-ink: #1b1b3a;
  --toggle: #ffd23f;
  --stage: #0e1430;
  --soon-1: #ffe08a;
  --soon-2: #cdb8ff;
  --l1: #ff4d6d;
  --l2: #ffb703;
  --l3: #3a86ff;
  --l4: #8ac926;
  --l5: #9b5de5;
  --tap: #ffffff;
  --display: "Titan One", "Arial Black", system-ui, sans-serif;
  --body: "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
  --gutter: 20px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --sky: #131b45;
  --ink: #e9eeff;
  --ink-soft: #b5c0ee;
  --line: #e9eeff;
  --letter-line: #080c26;
  --press: #080c26;
  --card: #1f2a5c;
  --card-shadow: #ffb703;
  --card-shadow-alt: #5b9dff;
  --pill: #1f2a5c;
  --cloud: #2a356e;
  --cloud-line: #080c26;
  --hill: #256b43;
  --hill-line: #080c26;
  --hill-ink: #e9eeff;
  --toggle: #fff3c4;
  --soon-1: #1e6a66;
  --soon-2: #4a3d8f;
  --l1: #ff6b88;
  --l2: #ffc53d;
  --l3: #5b9dff;
  --l4: #a4dd4a;
  --l5: #b58cff;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.5;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--pill);
  color: var(--ink);
  border: 3px solid var(--line);
  border-radius: 14px;
  font-weight: 700;
}
.skip:focus {
  top: 12px;
}

/* ---------- Sky scene (decoration only) ---------- */

.sky {
  position: absolute;
  inset: 0 0 auto 0;
  height: 680px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.sky svg {
  position: absolute;
  height: auto;
}
.cloud {
  fill: var(--cloud);
  stroke: var(--cloud-line);
  stroke-width: 3.5;
  stroke-linejoin: round;
}
.sky__cloud--a {
  left: -46px;
  top: 92px;
  width: 112px;
}
.sky__cloud--b {
  right: -52px;
  top: 168px;
  width: 124px;
}
.sky__cloud--c {
  display: none;
  left: 17%;
  top: 292px;
  width: 112px;
}
@media (min-width: 760px) {
  .sky__cloud--a {
    left: -34px;
    top: 118px;
    width: 170px;
  }
  .sky__cloud--b {
    right: -44px;
    top: 236px;
    width: 210px;
  }
  /* The small third cloud sits beside the name, so only the home page shows it. */
  .sky--home .sky__cloud--c {
    display: block;
  }
}
.sky__star {
  display: none;
  fill: #ffe27a;
}
html[data-theme="dark"] .sky__star {
  display: block;
}
html[data-theme="dark"] .sky__cloud--a,
html[data-theme="dark"] .sky__cloud--c {
  display: none;
}
.sky__star--1 { left: 6%; top: 132px; width: 26px; }
.sky__star--2 { right: 9%; top: 150px; width: 18px; }
.sky__star--3 { left: 17%; top: 290px; width: 14px; }
.sky__star--4 { right: 20%; top: 388px; width: 22px; }
.sky__star--5 { left: 38%; top: 92px; width: 12px; }
.sky__star--6 { right: 36%; top: 470px; width: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .sky__cloud--a { animation: drift 18s ease-in-out infinite alternate; }
  .sky__cloud--b { animation: drift 24s ease-in-out infinite alternate-reverse; }
  .sky__cloud--c { animation: drift 30s ease-in-out infinite alternate; }
  .sky__star { animation: twinkle 3.6s ease-in-out infinite alternate; }
  .sky__star--2,
  .sky__star--5 { animation-delay: 1.2s; }
  .sky__star--3,
  .sky__star--6 { animation-delay: 2.1s; }
}
@keyframes drift {
  from { transform: translateX(-10px); }
  to { transform: translateX(22px); }
}
@keyframes twinkle {
  from { opacity: 1; }
  to { opacity: 0.45; }
}

/* ---------- Top bar ---------- */

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px var(--gutter);
}
.brand {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 0;
}
.top__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  background: var(--pill);
  color: var(--ink);
  border: 3px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--press);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s;
}
.theme-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  background: var(--toggle);
  color: #1b1b3a;
  border: 3px solid var(--press);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--press);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.theme-btn svg {
  width: 22px;
  height: 22px;
  grid-area: 1 / 1;
}
.theme-btn .icon-moon,
html[data-theme="dark"] .theme-btn .icon-sun {
  display: none;
}
html[data-theme="dark"] .theme-btn .icon-moon {
  display: block;
}
.pill:active,
.theme-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--press);
}

/* ---------- Page body ---------- */

.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Home: name and tagline ---------- */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(8px, 2vw, 20px) 0 clamp(30px, 5vw, 52px);
}
.wordmark {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4.25rem, 21vw, 8.25rem);
  line-height: 1;
  -webkit-text-stroke: 0.05em var(--letter-line);
  paint-order: stroke fill;
  text-shadow: 0 0.075em 0 var(--letter-line);
  -webkit-user-select: none;
  user-select: none;
}
.wordmark__jolly {
  display: flex;
  gap: 0.02em;
}
.wordmark__jolly span {
  display: inline-block;
  color: var(--c);
  transform: translateY(var(--y, 0)) rotate(var(--r, 0deg));
  cursor: pointer;
}
.wordmark__tap {
  display: block;
  margin-top: 0.02em;
  font-size: 0.78em;
  letter-spacing: 0.08em;
  padding-left: 0.08em;
  color: var(--tap);
  transform: rotate(-2deg);
}
.tagline {
  margin: clamp(16px, 2.6vw, 24px) 0 0;
  padding: 8px 16px;
  font-size: clamp(0.95rem, 4.1vw, 1.0625rem);
  background: var(--pill);
  border: 3px solid var(--line);
  border-radius: 24px;
  font-weight: 600;
  text-wrap: balance;
}

@media (prefers-reduced-motion: no-preference) {
  .wordmark__jolly span {
    animation: pop 0.52s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
    animation-delay: calc(var(--i) * 70ms);
  }
  .wordmark__tap {
    animation: drop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.42s both;
  }
  .wordmark__jolly span.is-hopping {
    animation: hop 0.42s ease-out;
  }
}
@keyframes pop {
  0% { opacity: 0; transform: translateY(-45%) scale(0.6) rotate(var(--r, 0deg)); }
  70% { opacity: 1; transform: translateY(6%) scale(1.06) rotate(var(--r, 0deg)); }
  100% { opacity: 1; transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)); }
}
@keyframes drop {
  0% { opacity: 0; transform: translateY(-30%) rotate(-2deg); }
  100% { opacity: 1; transform: translateY(0) rotate(-2deg); }
}
@keyframes hop {
  0% { transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)); }
  40% { transform: translateY(-24%) rotate(calc(var(--r, 0deg) * -1)); }
  100% { transform: translateY(var(--y, 0)) rotate(var(--r, 0deg)); }
}

/* ---------- Game cards ---------- */

.games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 18px;
}
.card--feature {
  grid-column: 1 / -1;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--card);
  border: 4px solid var(--line);
  border-radius: 26px;
  box-shadow: 7px 8px 0 var(--card-shadow);
  overflow: hidden;
}
.card__media {
  aspect-ratio: 16 / 9;
  background: var(--stage);
  border-bottom: 4px solid var(--line);
}
.card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 22px;
}
.card__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.1;
}
.card__hook {
  margin: 0;
  max-width: 54ch;
  color: var(--ink-soft);
}
.btn-play {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-top: 8px;
  padding: 0 28px;
  background: var(--play);
  color: var(--play-ink);
  border: 3.5px solid var(--press);
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--press);
  font-family: var(--display);
  font-size: 1.3rem;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-play svg {
  width: 18px;
  height: 18px;
}
/* The whole card is one big tap target for its Play button. */
.card--game .btn-play::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card--game {
  transition: transform 0.12s, box-shadow 0.12s;
}
@media (hover: hover) {
  .card--game:hover {
    transform: translate(-2px, -3px);
    box-shadow: 9px 11px 0 var(--card-shadow);
  }
}
.card--game:active .btn-play,
.btn-play:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--press);
}

.card--soon {
  box-shadow: 7px 8px 0 var(--card-shadow-alt);
}
.card--soon .card__art {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 112px;
  background: var(--soon-bg, var(--soon-1));
  border-bottom: 4px solid var(--line);
  font-family: var(--display);
  font-size: clamp(3.75rem, 9vw, 5.25rem);
  line-height: 1;
  color: #ffffff;
  -webkit-text-stroke: 0.05em var(--letter-line);
  paint-order: stroke fill;
  text-shadow: 0 0.07em 0 var(--letter-line);
}
.card--soon .card__art span {
  display: block;
  transform: rotate(var(--r, -8deg));
}
.card--soon .card__body {
  gap: 2px;
  padding: 10px 14px 14px;
}
.card--soon .card__title {
  font-size: 1.2rem;
}
@media (min-width: 560px) {
  .card--soon .card__art {
    min-height: 132px;
  }
  .card--soon .card__body {
    padding: 12px 18px 16px;
  }
  .card--soon .card__title {
    font-size: 1.3rem;
  }
}
.card--soon .card__hook {
  font-weight: 600;
}

@media (min-width: 560px) {
  .games {
    gap: 28px;
  }
}
@media (min-width: 880px) {
  .games {
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
    grid-template-rows: repeat(var(--beside, 2), minmax(0, 1fr));
    gap: 32px;
  }
  .card--feature {
    grid-column: 1;
    grid-row: 1 / span var(--beside, 2);
  }
  /* With more than two games beside the big card, those cards drop their description to stay short. */
  .games--more {
    gap: 24px 32px;
  }
  .games--more > .card--game:not(.card--feature) .card__hook {
    display: none;
  }
  .games--more > .card--game:not(.card--feature) .card__body {
    padding: 12px 18px 16px;
  }
  /* Four or more games beside the big card sit in two columns. */
  .games--two-cols {
    grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
  .games--more > .card--game:not(.card--feature) .card__title {
    font-size: clamp(1.15rem, 1.8vw, 1.5rem);
    overflow-wrap: anywhere;
  }
  .card--feature .card__body {
    padding: 20px 26px 28px;
  }
  /* The featured card is as tall as the two cards beside it. Its picture takes up any extra height,
     so no empty space is left under the Play button. */
  .card--feature .card__media {
    position: relative;
    flex: 1 0 auto;
  }
  .card--feature .card__media img {
    position: absolute;
    inset: 0;
  }
}

/* ---------- Home: category buttons and category rows ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  margin: 0 0 clamp(26px, 4vw, 36px);
}
.chip {
  min-height: 42px;
  padding: 0 16px;
}
/* Phones: smaller buttons so all the sections fit in about three rows above Featured. */
@media (max-width: 560px) {
  .chips {
    gap: 8px;
  }
  .chip {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.9rem;
  }
}
#games,
.shelf {
  scroll-margin-top: 16px;
}
.shelf {
  margin-top: clamp(40px, 6vw, 60px);
}
.shelf__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 14px;
}
@media (min-width: 700px) {
  .shelf__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px 22px;
  }
}
@media (min-width: 1080px) {
  .shelf__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.card--small {
  border-radius: 20px;
  border-width: 3.5px;
  box-shadow: 5px 6px 0 var(--card-shadow);
}
.card--small .card__media {
  border-bottom-width: 3.5px;
}
.card--small .card__body {
  flex: 1;
  gap: 4px;
  padding: 10px 12px 14px;
}
.card--small .card__title {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
}
.card--small .card__hook {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-bottom: 8px;
  font-size: 0.92rem;
  line-height: 1.35;
}
.card--small .btn-play {
  margin-top: auto;
  min-height: 40px;
  padding: 0 18px;
  font-size: 1.05rem;
  border-width: 3px;
  box-shadow: 0 4px 0 var(--press);
}
@media (max-width: 559px) {
  .card--small .card__hook {
    display: none;
  }
}
/* On phones and tablets the two smaller featured cards sit side by side, so they take the small look. */
@media (max-width: 879px) {
  .games > .card--game:not(.card--feature) .card__body {
    flex: 1;
    gap: 4px;
    padding: 10px 12px 14px;
  }
  .games > .card--game:not(.card--feature) .card__title {
    font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  }
  .games > .card--game:not(.card--feature) .card__hook {
    display: none;
  }
  .games > .card--game:not(.card--feature) .btn-play {
    margin-top: auto;
    min-height: 40px;
    padding: 0 18px;
    font-size: 1.05rem;
    border-width: 3px;
    box-shadow: 0 4px 0 var(--press);
  }
}

/* ---------- Good to know ---------- */

.notes {
  margin-top: clamp(48px, 7vw, 80px);
}
.section-title {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.1;
}
.notes__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.note {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--pill);
  border: 3px solid var(--line);
  border-radius: 20px;
}
.note__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid var(--press);
  border-radius: 999px;
  background: var(--note-bg, var(--l2));
  color: #1b1b3a;
}
.note__icon svg {
  width: 22px;
  height: 22px;
}
.note h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
}
.note p {
  margin: 2px 0 0;
  color: var(--ink-soft);
}
@media (min-width: 760px) {
  .notes__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Footer on the hill ---------- */

.foot {
  position: relative;
  z-index: 1;
  margin-top: clamp(96px, 15vw, 180px);
  background: var(--hill);
  color: var(--hill-ink);
}
.foot__hill {
  position: absolute;
  left: 0;
  bottom: calc(100% - 1px);
  display: block;
  width: 100%;
  height: clamp(54px, 9vw, 112px);
}
.foot__hill .fill {
  fill: var(--hill);
}
.foot__hill .edge {
  fill: none;
  stroke: var(--hill-line);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 4px var(--gutter) 26px;
}
.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}
.foot__links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.foot__social {
  gap: 8px;
}
.foot__social .icon-in {
  width: 22px;
  height: 22px;
  flex: none;
}
.foot__copy {
  margin: 0;
  font-size: 0.95rem;
}

/* ---------- Buttons used across pages ---------- */

[hidden] {
  display: none !important;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  background: var(--pill);
  color: var(--ink);
  border: 3px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--press);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn--primary {
  background: var(--play);
  color: var(--play-ink);
  border-color: var(--press);
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--press);
}

/* ---------- Game page ---------- */

.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-top: 8px;
}
.play__main {
  min-width: 0;
  display: grid;
  gap: 22px;
}
.play__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
@media (min-width: 1080px) {
  .play {
    grid-template-columns: minmax(0, 1fr) 306px;
    column-gap: 28px;
  }
  .play--solo {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The game sits on a dark surround in both themes, like a cinema screen. */
.stage {
  background: var(--stage);
  color: #e9eeff;
  border: 4px solid var(--line);
  border-radius: 26px;
  box-shadow: 7px 8px 0 var(--card-shadow);
  overflow: hidden;
}
.frame {
  position: relative;
  width: 100%;
  height: min(72vh, 620px);
  height: min(72dvh, 620px);
  background: #070b1f;
}
@media (min-width: 700px) {
  .frame {
    height: auto;
    aspect-ratio: 16 / 9;
  }
}
/* Never taller than the screen below the header, so a phone turned sideways shows the whole game. */
.frame {
  max-height: max(200px, calc(100vh - 100px));
  max-height: max(200px, calc(100dvh - 100px));
}
.frame iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.frame__poster,
.frame__screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}
.frame__poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5);
}
.frame__start {
  position: relative;
  min-height: 68px;
  margin: 0;
  padding: 0 40px;
  font-size: 1.75rem;
  border-color: #080c26;
  box-shadow: 0 6px 0 #080c26;
  cursor: pointer;
}
.frame__start svg {
  width: 24px;
  height: 24px;
}
.frame__start:active {
  box-shadow: 0 1px 0 #080c26;
}
.frame__screen {
  background: var(--stage);
}
.frame__screen > div {
  max-width: 460px;
}
.frame__screen h2 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.4rem, 4.4vw, 2rem);
  line-height: 1.15;
}
.frame__screen p {
  margin: 0 0 18px;
  color: #b5c0ee;
}
.frame__screen .btn {
  background: var(--play);
  color: #1b1b3a;
  border-color: #080c26;
  box-shadow: 0 4px 0 #080c26;
}
.frame__spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border: 5px solid #33408a;
  border-top-color: #ffb703;
  border-radius: 999px;
}
@media (prefers-reduced-motion: no-preference) {
  .frame__spinner {
    animation: spin 0.9s linear infinite;
  }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.stage__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-top: 4px solid var(--line);
}
.stage__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
  line-height: 1.2;
}
.stage__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  background: #1f2a5c;
  color: #e9eeff;
  border: 3px solid #e9eeff;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.stage__btn {
  flex: none;
  white-space: nowrap;
}
.stage__btn svg {
  width: 18px;
  height: 18px;
}
.stage__btn:focus-visible,
.frame__start:focus-visible,
.frame__screen .btn:focus-visible {
  outline-color: #e9eeff;
}
.stage__notice {
  margin: 0;
  padding: 8px 18px;
  background: #ffb703;
  color: #1b1b3a;
  font-weight: 600;
  text-align: center;
}
/* Full screen, and the stand-in for phones that cannot do real full screen. */
.stage.is-expanded,
.stage:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.stage.is-expanded .frame,
.stage:fullscreen .frame {
  flex: 1;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
}
body.has-expanded-stage {
  overflow: hidden;
}
/* The page area sits under the site header by default. While the game fills the screen, lift it above the
   header (z-index 2) so the JollyTap name and menu do not show over the game. The cookie box (60) stays on top. */
body.has-expanded-stage .page {
  z-index: 55;
}
/* Narrow phones: a smaller title and button so the bar fits on one screen. */
@media (max-width: 420px) {
  .stage__bar {
    padding: 8px 8px 8px 12px;
    gap: 8px;
  }
  .stage__title {
    font-size: 1rem;
  }
  .stage__btn {
    padding: 0 12px;
    gap: 6px;
    font-size: 0.9rem;
  }
}

/* ---------- Ad spaces ---------- */

.ad {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}
.ad.is-on {
  display: flex;
}
.ad__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.ad__box {
  box-sizing: content-box;
  display: grid;
  place-items: center;
  width: var(--w);
  height: var(--h);
  max-width: calc(100% - 6px);
  background: var(--pill);
  border: 3px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.ad__box--empty {
  border-style: dashed;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}
.ad__box iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Only one banner size is used at a time: the wide one on big screens, the small one on phones. */
.ad--wide.is-on {
  display: none;
}
@media (min-width: 800px) {
  .ad--wide.is-on {
    display: flex;
  }
  .ad--phone.is-on {
    display: none;
  }
}

/* ---------- Text pages and game details ---------- */

.sheet {
  max-width: 820px;
  margin: 8px auto 0;
  padding: clamp(20px, 4vw, 40px);
  background: var(--card);
  border: 4px solid var(--line);
  border-radius: 26px;
  box-shadow: 7px 8px 0 var(--card-shadow);
}
.sheet--wide {
  max-width: none;
  margin: 0;
}
.sheet h1 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 1.05;
}
.sheet h2 {
  margin: 1.7em 0 0.4em;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.35rem, 3.4vw, 1.6rem);
  line-height: 1.15;
}
.sheet > h2:first-child,
.sheet > section:first-child > h2 {
  margin-top: 0;
}
.sheet p,
.sheet li {
  max-width: 68ch;
}
.sheet p {
  margin: 0 0 0.9em;
}
.sheet ul,
.sheet ol {
  margin: 0 0 0.9em;
  padding-left: 1.3em;
}
.sheet li {
  margin-bottom: 0.35em;
}
.sheet li::marker {
  font-weight: 700;
}
.sheet a {
  font-weight: 600;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.sheet .meta {
  color: var(--ink-soft);
}
.sheet .btn {
  margin: 4px 0 8px;
}
.note-line {
  color: var(--ink-soft);
}

.controls {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 0.9em;
}
.controls th,
.controls td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 3px solid var(--line);
}
.controls thead th {
  font-weight: 700;
}
.controls tbody th {
  font-weight: 700;
  white-space: nowrap;
}
.controls tbody tr:last-child th,
.controls tbody tr:last-child td {
  border-bottom: 0;
}
@media (max-width: 639px) {
  .controls,
  .controls tbody,
  .controls tr,
  .controls th,
  .controls td {
    display: block;
  }
  .controls thead {
    display: none;
  }
  .controls tbody tr {
    padding: 10px 0;
    border-bottom: 3px solid var(--line);
  }
  .controls tbody tr:last-child {
    border-bottom: 0;
  }
  .controls tbody th,
  .controls tbody td {
    padding: 2px 0;
    border: 0;
  }
  .controls tbody th {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.15rem;
  }
  .controls td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
  }
}

.shots {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sheet .shots {
  padding: 0;
}
.shots li {
  max-width: none;
  margin: 0;
}
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: var(--stage);
}
@media (min-width: 560px) {
  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.more {
  margin-top: clamp(40px, 6vw, 64px);
}

/* ---------- Not found and offline ---------- */

.lost {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: clamp(16px, 5vw, 48px) 0 0;
  text-align: center;
}
.lost__mark {
  font-family: var(--display);
  font-size: clamp(6rem, 26vw, 11rem);
  line-height: 1;
  color: var(--l2);
  -webkit-text-stroke: 0.05em var(--letter-line);
  paint-order: stroke fill;
  text-shadow: 0 0.07em 0 var(--letter-line);
  transform: rotate(-8deg);
}
.lost h1 {
  margin: 0.3em 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.8rem, 6vw, 2.75rem);
  line-height: 1.1;
}
.lost p {
  margin: 0 0 14px;
  max-width: 44ch;
}

/* ---------- Cookie choice (shown to visitors in Europe and the UK) ---------- */

.consent {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 18px 18px;
  background: var(--card);
  color: var(--ink);
  border: 4px solid var(--line);
  border-radius: 22px;
  box-shadow: 6px 7px 0 var(--card-shadow);
}
.consent h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.15;
}
.consent p {
  margin: 0 0 12px;
}
.consent a {
  font-weight: 600;
}
.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.consent__actions .btn {
  flex: 1 1 160px;
}

/* ---------- Game details: two columns on wide screens ---------- */

.game-info {
  margin-top: 24px;
}
.game-info section > h2 {
  margin-top: 1.5em;
}
.game-info section:first-child > h2 {
  margin-top: 0;
}
@media (min-width: 960px) {
  .game-info {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-areas:
      "about controls"
      "how controls"
      "shots shots";
    column-gap: 52px;
  }
  .game-info__about { grid-area: about; }
  .game-info__how { grid-area: how; }
  .game-info__controls { grid-area: controls; }
  .game-info__shots { grid-area: shots; }
  .game-info .game-info__controls > h2 {
    margin-top: 0;
  }
  .game-info .shots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
