:root {
  --ink: #2d1238;
  --page: #ffc2c0;
  --red: #d2304f;
  --dark-red: #a3173a;
  --blue: #1667a8;
  --cream: #fffaf0;
  --title: Rockwell, "Rockwell Nova", "Roboto Slab", Georgia, serif;
  --arrow: 30px;
}

* { box-sizing: border-box; }

/* Author display rules would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.45 "Avenir Next", Avenir, "Segoe UI", Roboto, sans-serif;
}

h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h2 { overflow-wrap: anywhere; font: 700 25px/1.05 var(--title); }
svg { display: block; }
button { color: var(--ink); font: inherit; cursor: pointer; }

/* A fixed colour: several controls have white lettering, which would vanish on the pink page. */
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.hidden-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.lead { position: relative; padding: 92px max(20px, calc(50% - 520px)) 72px; }
.lead > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
h1 {
  position: relative;
  font: 700 46px/1 var(--title);
  color: #ffe04a;
  -webkit-text-stroke: 8px var(--ink);
  paint-order: stroke fill;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 48px; }

.how, .warning { margin-top: 18px; padding: 14px 18px; background: #fff; border: 2px dashed var(--red); }
.warning { border-style: solid; font-weight: 700; }

.views { display: flex; margin: 18px 0 12px; }
.views a {
  display: flex;
  flex: 0 1 180px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 12px;
  background: #fff;
  border: 2px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.views a + a { border-left: 0; }
.views a[aria-current] { background: var(--ink); color: #fff; }

/* The cheats written into the published pages, for readers that run no scripts. */
.js .plain { display: none; }
.plain { margin-top: 18px; }
.plain a { color: var(--ink); font-weight: 700; }
.plain ol > li { margin-top: 12px; padding: 14px 18px; background: #fff; }
.plain ul { margin-top: 6px; }

/* Sign-in: it sits over the banner, so it never pushes the page down. */
.me { position: absolute; z-index: 2; top: 16px; right: max(20px, calc(50% - 520px)); display: flex; }
.btn { min-height: 40px; padding: 6px 16px; background: #fff; border: 2px solid var(--ink); border-radius: 4px; font-weight: 700; }
.btn.risky { border-color: var(--dark-red); color: var(--dark-red); }
.btn.danger { background: var(--dark-red); border-color: var(--dark-red); color: #fff; }
.me button:disabled, .box button:disabled, .box button[aria-disabled="true"] { cursor: default; opacity: .6; }
.chip { position: relative; display: flex; padding: 0; background: none; border: 0; border-radius: 50%; }
.chip:focus-visible { box-shadow: 0 0 0 6px #fff; }
.me .chip:disabled { opacity: 1; }
.initial { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding-top: 3px; background: #fff; border: 3px double var(--red); border-radius: 50%; color: var(--dark-red); font: 700 21px/1 var(--title); }
.alert { position: absolute; top: -6px; right: -6px; display: grid; place-items: center; width: 20px; height: 20px; background: #ffe04a; border: 2px solid var(--ink); border-radius: 50%; font: 700 13px/1 var(--title); }
.menu { position: absolute; top: 54px; right: 0; width: min(290px, calc(100vw - 40px)); background: #fff; border: 2px solid var(--ink); box-shadow: 0 6px 0 #0002; }
.menu > p { padding: 10px 16px; font-size: 14px; border-bottom: 1.5px solid #cbb8a6; }
.menu > button { display: block; width: 100%; min-height: 44px; padding: 8px 16px; background: #fff; border: 0; text-align: left; font-weight: 700; }
.menu > button:hover { background: var(--cream); }
.menu > button:focus-visible { outline-offset: -4px; }
.who { display: flex; gap: 12px; align-items: center; }
.who p { min-width: 0; overflow-wrap: anywhere; }
.menu .who { padding: 14px 16px; border-bottom: 2px dashed var(--red); }
.small { font-size: 14px; font-weight: 400; }
.box { width: min(430px, calc(100% - 40px)); max-height: calc(100% - 84px); margin: 64px auto auto; padding: 24px; background: var(--cream); color: var(--ink); border: 2px solid var(--ink); overflow-wrap: anywhere; }
.box[open] { display: grid; gap: 14px; }
.box::backdrop { background: #2d1238b3; }
.box h2 { padding-right: 44px; font-size: 28px; line-height: 1.1; }
.box h3 { margin: 0; font: 700 18px/1.2 var(--title); }
.x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; padding: 0; background: none; border: 0; font-size: 26px; line-height: 1; }
/* Google's own button colours and lettering. */
.google { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; background: #fff; border: 1px solid #747775; border-radius: 4px; color: #1f1f1f; font: 500 15px/1.2 Roboto, Arial, sans-serif; }
.trouble { color: var(--dark-red); font-weight: 700; }
.trouble:empty { display: none; }
.part { display: grid; gap: 8px; justify-items: start; padding-top: 14px; border-top: 2px dashed var(--red); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.note { position: fixed; z-index: 3; left: 20px; right: 20px; bottom: 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; max-width: 560px; min-height: 56px; margin: 0 auto; padding: 8px 8px 8px 16px; background: var(--ink); color: #fff; overflow-wrap: anywhere; }
.note button { flex: none; min-width: 40px; min-height: 40px; background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; }
.note :focus-visible { outline-color: #fff; }
/* Room for the message bar, so it never covers the last line or a focused control. */
.signs-in .wrap { padding-bottom: 104px; }
html:has(.signs-in) { scroll-padding-bottom: 96px; }
.unofficial { margin-top: 28px; font-size: 14px; }

.filters, .by { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.by { align-items: center; }
.filters button, .by button, #undo, .go { background: #fff; border: 2px solid var(--ink); border-radius: 4px; }
.filters button { padding: 5px 11px; }
.by button { min-height: 36px; padding: 4px 12px; }
button[aria-pressed="true"]:not(.star) { background: var(--ink); color: #fff; }

.state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 14px 0 12px; }
#undo { min-height: 36px; padding: 4px 12px; font-weight: 700; }

.tick { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; cursor: pointer; }
.tick input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); }

.scores { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; }
.score { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.score i {
  --block: 11.6px;
  --stripe: calc(var(--block) - 2px), #0000 0 var(--block);
  width: calc(5 * var(--block) - 2px);
  height: 10px;
  color: #c22a50;
  background:
    repeating-linear-gradient(90deg, currentColor 0 var(--stripe)) 0 / calc(var(--v) * var(--block) - 2px) 100% no-repeat,
    repeating-linear-gradient(90deg, color-mix(in srgb, currentColor 22%, #0000) 0 var(--stripe));
}

.also { color: var(--dark-red); font-size: 14px; }

/* Postcard pictures; the classes after .scene draw the screen filter cards' effects. */
.scene { position: relative; height: 150px; overflow: hidden; background: #111; }
/* A pixel wider than the card, or a dark line shows at the edge. */
.scene svg { width: calc(100% + 1px); height: 100%; }
.scene::after { content: ""; position: absolute; inset: 0; }
.bars::after { border: solid #000; border-width: 20px 0; }
.pillar::after { border: solid #000; border-width: 0 46px; }
.hole::after { background: radial-gradient(circle, #0000 34%, #000 62%); }
.fish::after { background: radial-gradient(circle at 50% 50%, #0000 49%, #000 50%); }
.scan::after { background: repeating-linear-gradient(#0000 0 2px, #0007 2px 4px); }
.smoke::after { background: radial-gradient(ellipse at 30% 60%, #4a4a45e0, #0000 60%), radial-gradient(ellipse at 75% 40%, #3a3a38e0, #0000 60%), #6b6a5f88; }
.dots::after { background: radial-gradient(#fff 1.5px, #0000 2px) 0 0 / 17px 19px, radial-gradient(#fff 1px, #0000 1.5px) 6px 9px / 23px 13px; }
.track::after { background: linear-gradient(#0000 62%, #fff8 62% 65%, #0000 65% 70%, #7ff6 70% 72%, #0000 72%); }

.cheats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.cheat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 2px 0 #0003;
  scroll-margin-top: 12px;
}
.star {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #fff;
  border: 0;
  border-radius: 50%;
}
/* The star sits on pictures that are sometimes black. */
.star:focus-visible { box-shadow: 0 0 0 8px #fff; }
.star svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 1.8; }
.star[aria-pressed="true"] svg { fill: var(--red); stroke: var(--red); }
.mark, .done .picture::after {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 3px double var(--red);
  border-radius: 50%;
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  transform: rotate(-14deg);
}
.mark { position: absolute; top: 78px; right: 26px; background: #fff; }
.info { display: grid; gap: 5px; padding: 0 4px; }
.cheat .rank {
  position: absolute;
  top: 88px;
  left: 20px;
  display: grid;
  gap: 4px;
  font: 700 16px/1 var(--title);
  color: #ffe04a;
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
}
.cheat .rank span { font-size: 40px; }
.arrows { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 0 4px; }
.group { display: flex; gap: 3px; }
.arrow {
  width: var(--arrow);
  height: var(--arrow);
  padding: 5px;
  background: var(--c);
  fill: #fff;
  outline: 2px dotted #fff;
  outline-offset: -2px;
}
.more { margin-top: auto; padding: 0 4px 4px; }

/* Unlock path: each stop is the back of a postcard, message left and cheats as address lines. */
.route { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 8px; }
.route button {
  position: relative;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  background: var(--blue);
  color: #fff;
  border: 0;
  outline: 2px dotted #fff;
  outline-offset: -4px;
  font-weight: 700;
}
.route button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.route button + button::before { content: ""; position: absolute; right: 100%; top: calc(50% - 1px); width: 8px; border-top: 3px solid var(--red); }
.route .next { background: var(--red); }
.route .done { background: #fff; color: var(--ink); outline-color: var(--ink); }

.path { display: grid; gap: 20px; margin-top: 18px; }
.stop {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  padding: 22px;
  background: var(--cream);
  box-shadow: 0 2px 0 #0003;
  scroll-margin-top: 12px;
}
.say { position: relative; display: flex; flex-direction: column; gap: 10px; }
.say h2 { display: flex; align-items: center; min-height: 72px; padding-left: 80px; font-size: 30px; }
.stamp {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-content: center;
  gap: 5px;
  width: 64px;
  height: 72px;
  background: var(--blue);
  color: #fff;
  outline: 2px dotted #fff;
  outline-offset: -5px;
  font-size: 14px;
  line-height: 1;
  text-align: center;
}
.stamp b { font: 700 28px/1.1 var(--title); }
.next .stamp { background: var(--red); }
.best b { color: var(--dark-red); }
.feed { color: var(--dark-red); }
.picture { position: sticky; top: 12px; flex: 1 0 100px; max-height: 280px; margin-top: 4px; }
.picture .scene { position: absolute; inset: 0; height: auto; }
.picture .bars::after { border-width: 9px 0; }
.done .picture::after { content: "Unlocked"; position: absolute; right: 14px; top: calc(50% - 39px); background: var(--cream); }

.runs { display: grid; align-content: start; gap: 12px; }
.total { padding-left: 12px; border-left: 5px solid var(--red); }
.label { font-size: 14px; font-weight: 700; }
.runs li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 8px 0; border-bottom: 1.5px solid #cbb8a6; }
.runs .tick { align-items: start; min-width: 0; }
.runs .tick input { flex: none; margin-top: 2px; }
.go { min-height: 32px; padding: 2px 10px; border-width: 1.5px; font-size: 14px; }
.about { grid-column: 1 / -1; display: grid; gap: 3px; padding-left: 25px; font-size: 14px; }
.about > p:first-child { font-size: 16px; }
.runs .rank { color: var(--dark-red); }

@media (min-width: 720px) {
  .stop { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; }
  .runs { padding-left: 22px; border-left: 2px solid var(--ink); }
}

@media (max-width: 620px) {
  .route { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .route button:nth-child(5n + 1)::before { content: none; }
}

@media (max-width: 480px) {
  .score i { --block: 7.2px; }
  .scores { column-gap: 10px; }
}
