/* FreeWorldz. The page is FreeWorldz blue; content sits on a white sheet with the big
   rounded corner; categories sit on the blue. Two voices, like the 2002 original:
   hand-lettering (GoodDog Plain, drawn as outlined SVGs by bin/build-hand.ps1, so no
   font file is ever served) and Verdana for everything else.
   Palette sampled from the original header GIFs. */

:root {
  --blue: #3366cc;
  --blue-deep: #2a52ad;
  --sky: #0099ff;
  --ice: #99ccff;
  --green: #00ff66;
  --yellow: #ffcc33;
  --ink: #15213b;
  --text: #333a4a;
  --muted: #6d7488;
  --link: #0033cc;
  --rule: #c9d3ea;
  --hand: "GoodDog Plain", "Comic Sans MS", "Comic Neue", cursive; /* only for text not yet outlined */
  --body: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --side: 191px;          /* sidebar width; the swoosh SVG is drawn to match */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  color: var(--text);
  font: 13.5px/1.55 var(--body);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cg fill='%23fff' fill-opacity='.08'%3E%3Ccircle cx='22' cy='26' r='3'/%3E%3Ccircle cx='104' cy='92' r='2'/%3E%3Ccircle cx='128' cy='38' r='2.5'/%3E%3Cpath d='M72 16h3v6h6v3h-6v6h-3v-6h-6v-3h6z'/%3E%3Cpath d='M30 102h3v6h6v3h-6v6h-3v-6h-6v-3h6z'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(#3b6fd6, var(--blue) 320px, #2c58b5);
  background-color: var(--blue);
}

p { margin: 0; }

/* Hand-lettered text is an inline SVG sized in em, so font-size and color work as for text.
   The drawing is 1.095em tall; the negative margin makes it sit exactly like a line of
   GoodDog with line-height 1. The real words stay in a visually hidden span. */
svg.hand { display: block; max-width: 100%; margin: -.0475em 0; fill: currentColor; overflow: visible; }
.hand-plain { font-family: var(--hand); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 10; padding: 6px 10px; background: #fff; color: #000; font-weight: 700; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

.frame { position: relative; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

.head { position: relative; height: 128px; }

/* Header geometry is the original 2002 header scaled by 1.25:
   blue 0-66, ice stripe 66-72, sky band 72-128, curve measured from the old GIFs. */

/* ice stripe: one thin line right across the page, behind the logo */
.stripe {
  position: absolute;
  left: -4000px;
  right: -4000px;
  top: 66px;
  height: 6px;
  background: var(--ice);
}

/* sky band: starts under the swoosh, runs off the right edge of the screen */
.ribbon {
  position: absolute;
  left: 250px;
  right: -4000px;
  top: 72px;
  height: 56px;
  background: var(--sky);
}

.swoosh {
  position: absolute;
  left: -4000px;
  top: 0;
  width: 4500px;
  height: 200px;
  z-index: 1;
  pointer-events: none;
}

.logo {
  position: absolute;
  left: 24px;
  top: 24px;
  z-index: 2;
  display: block;
  line-height: 0;
  filter: drop-shadow(0 0 6px rgba(0, 153, 255, .95));
  transform-origin: 30% 60%;
}
.logo img { display: block; width: 340px; height: auto; }
.logo:hover { animation: wiggle .5s ease-in-out; }
@keyframes wiggle {
  25% { transform: rotate(-2.5deg) scale(1.03); }
  60% { transform: rotate(2deg) scale(1.03); }
}

.tagline {
  position: absolute;
  z-index: 2;
  left: 24px;
  top: 97px;
  width: 300px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
  font: 400 23.5px/1.1 var(--hand);
  color: var(--blue);
  white-space: nowrap;
  cursor: pointer;
}
.tagline svg.hand { margin: .0025em auto; }
.tagline.swap { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: translateY(7px) rotate(-2deg); opacity: 0; } }

.nav {
  position: absolute;
  z-index: 2;
  right: 4px;
  top: 0;
  height: 66px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}
.nav a, .side a { color: #fff; font-weight: 700; }
.nav a:hover, .side a:hover { color: var(--green); }
.nav a:first-child { font-size: 15px; }

.band {
  position: absolute;
  z-index: 2;
  left: 440px;
  right: 4px;
  top: 72px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.save { font-weight: 700; font-size: 13px; color: #0c2147; text-decoration: none; white-space: nowrap; }
.save b { color: #fff; }
.save:hover b { text-decoration: underline; }

.search { display: flex; flex: 0 1 300px; min-width: 0; gap: 6px; }
.search input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border: 2px solid #000;
  border-radius: 999px;
  background: #fff;
  font: 12px var(--body);
  color: var(--ink);
}
.search input:focus { outline: 3px solid var(--yellow); outline-offset: 0; }

/* ---------- stickers: buttons, tiles, pills ---------- */

.btn {
  display: inline-block;
  padding: 6px 13px;
  border: 2px solid #000;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 2px 2px 0 #000;
  color: #000;
  font: 700 12px/1.3 var(--body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px) rotate(-1.5deg); box-shadow: 3px 3px 0 #000; }
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #000; }
.btn.plain { background: #fff; }
.btn.tiny { padding: 3px 10px; font-size: 11px; }

.tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid #000;
  border-radius: 14px;
  background: var(--c, var(--sky));
  color: #fff;
  font: 700 17px/1 var(--body);
  transform: rotate(-4deg);
}

.tile.pic { padding: 4px; background: #fff; overflow: hidden; }
.tile.pic img { display: block; width: 100%; height: 100%; object-fit: contain; }

.pill {
  display: inline-block;
  margin-right: 3px;
  padding: 0 7px;
  border: 1px solid #00a843;
  border-radius: 999px;
  background: #dfffea;
  color: #00632a;
  font-weight: 700;
  font-size: 10px;
  line-height: 15px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.pill.bogo { border-color: #d9a300; background: #fff3cc; color: #7a5200; }

/* ---------- sidebar (on the blue) + paper ---------- */

.body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); align-items: start; }

.side { position: sticky; top: 0; padding: 52px 12px 30px 16px; color: #fff; font-size: 12.5px; line-height: 19px; }
.side summary { list-style: none; pointer-events: none; }
.side summary::-webkit-details-marker { display: none; }
.side h2 {
  margin: 0 0 22px -8px;
  font: 400 23.5px/1 var(--hand);
  color: #fff;
  white-space: nowrap;
  text-align: center;
}
.side h2 svg.hand { margin-inline: auto; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { padding: 0; }
.side hr { border: 0; border-top: 2px solid rgba(0, 0, 0, .3); margin: 14px 8px 14px 0; }

.paper {
  min-width: 0;
  padding: 0 34px 22px 30px;
  background: #fff;
  border-radius: 0 127px 26px 26px / 0 116px 26px 26px;
}

.paper a { color: var(--link); }
.paper a:hover { background: var(--yellow); color: #000; }

.hotline { height: 36px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }

h1, .paper h2 { margin: 0; font-family: var(--hand); font-weight: 400; color: var(--blue); line-height: 1; }
h1 {
  position: relative;
  display: inline-block;
  margin: 14px 0 26px;
  padding: 0 6px;
  font-size: 44px;
  transform: rotate(-1.5deg);
  background: linear-gradient(transparent 58%, var(--yellow) 58% 92%, transparent 92%);
}
.paper h2 { font-size: 29px; }

/* freebie of the moment */
.moment {
  position: relative;
  margin-bottom: 30px;
  border: 2.5px solid #000;
  border-radius: 18px;
  background: #fff;
  box-shadow: 6px 6px 0 var(--blue);
}
.burst {
  position: absolute;
  right: -24px;
  top: -34px;
  width: 80px;
  height: 80px;
  transform: rotate(12deg);
  transition: transform .4s;
}
.moment:hover .burst { transform: rotate(-6deg) scale(1.08); }
.moment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 66px 5px 18px;
  background: var(--yellow);
  border-bottom: 2.5px solid #000;
  border-radius: 15px 15px 0 0;
}
.moment-head h2 { color: #000033; font-size: 27px; }
.moment-body { display: flex; align-items: center; gap: 16px; padding: 14px 18px 15px; }
.moment-body .txt { flex: 1; min-width: 0; }
.moment-title { display: inline-block; margin: 2px 0; font-weight: 700; font-size: 16px; line-height: 1.35; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.meta > span { white-space: nowrap; }
.paper .meta a { color: var(--muted); }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 214px; gap: 30px; align-items: start; }

.rows { list-style: none; margin: 2px 0 0; padding: 0; counter-reset: fb; }
.rows > li {
  counter-increment: fb;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 2px dotted var(--rule);
}
.rows > li::before {
  content: counter(fb);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #000;
  border-radius: 50%;
  background: var(--yellow);
  font: 700 14px/1 var(--body);
  color: #000;
  transform: rotate(-8deg);
  transition: transform .15s;
}
.rows > li:nth-child(even)::before { background: var(--green); transform: rotate(7deg); }
.rows > li:hover::before { transform: rotate(0) scale(1.15); }
.row-title { font-weight: 700; font-size: 14px; }
.rows .txt p { font-size: 12.5px; }
.rows .txt .meta { font-size: 11px; }
.more-link { margin-top: 12px; text-align: right; font-weight: 700; font-size: 12px; }

.rail ul { list-style: none; margin: 4px 0 0; padding: 0; }
.rail li { padding: 7px 0; border-bottom: 2px dotted var(--rule); font-size: 12px; line-height: 1.4; }
.rail li a { font-weight: 700; }
.rail li small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }

.promo {
  margin: 22px 4px 0 0;
  padding: 13px 14px 15px;
  border: 2.5px solid #000;
  border-radius: 16px;
  background: var(--sky);
  box-shadow: 4px 4px 0 #000;
  color: #06254d;
  transform: rotate(1.5deg);
}
.promo strong { display: block; font: 400 28px/1 var(--hand); color: #fff; }
.promo strong svg.hand + .vh + svg.hand { margin-top: 0; }
.promo p { margin: 4px 0 11px; font-weight: 700; font-size: 11px; line-height: 1.45; }

.foot { margin-top: 34px; text-align: center; font-size: 12px; }
.foot hr { width: 92%; border: 0; border-top: 2px solid #9a9fab; margin: 0 auto 12px; }
.foot nav { font-weight: 700; }
.foot p { margin-top: 3px; color: #666; }


/* ---------- list pages, the freebie page, text pages ---------- */

.desc:empty { display: none; }
.intro { margin: -12px 0 14px; font-size: 13px; }
.empty { padding: 14px 0; }
.rail .more-link { margin-top: 10px; }

.pager { margin-top: 20px; text-align: center; font-weight: 700; font-size: 13px; }
.pager b { display: inline-block; min-width: 22px; padding: 1px 5px; border: 2px solid #000; border-radius: 999px; background: var(--yellow); color: #000; }

.kicker { position: relative; margin: 12px 0 14px; font: 400 31px/1 var(--hand); color: var(--blue); }
.moment.single { margin-bottom: 22px; }
.moment.single .moment-body { padding: 18px; }
.moment.single .desc { margin-top: 2px; font-size: 13.5px; }
.moment.ended { box-shadow: 6px 6px 0 #9a9fab; }
.moment.ended .tile { filter: grayscale(1); }
h1.plain { display: block; margin: 0 0 4px; padding: 0; transform: none; background: none; font: 700 19px/1.35 var(--body); color: var(--ink); }
.btn.big { padding: 9px 18px; font-size: 14px; }
.terms { padding: 10px 18px 12px; border-top: 2px dotted var(--rule); font-size: 11.5px; color: var(--muted); }
.aside-links { margin: 0 0 12px; font-weight: 700; font-size: 12px; }
.report { margin: 0 0 28px; font-size: 12px; color: var(--muted); }
.report .thanks { position: relative; margin-bottom: 4px; font: 400 26px/1 var(--hand); color: var(--blue); }
.linklike { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--link); text-decoration: underline; cursor: pointer; }
.linklike:hover { background: var(--yellow); color: #000; }
.paper h2.spaced { position: relative; margin-top: 6px; }
.paper h2 { position: relative; }

.prose { max-width: 640px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 5px; }
.prose h3 { margin: 22px 0 6px; font: 700 14px/1.3 var(--body); color: var(--ink); }
.code { margin: 0 0 12px; padding: 10px 12px; border: 2px solid #000; border-radius: 10px; background: #f3f6fd; font: 12px/1.5 Consolas, "Courier New", monospace; white-space: pre-wrap; word-break: break-all; }

.foot .fine { margin-top: 6px; font-size: 10.5px; color: #8a8f9c; }

/* ---------- medium ---------- */
@media (max-width: 1020px) {
  .save { display: none; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .rail { margin-top: 26px; }
  .promo { max-width: 300px; }
}
@media (max-width: 860px) {
  .nav .opt, .nav .opt-sep { display: none; }
}

/* ---------- phone ---------- */
@media (max-width: 720px) {
  .frame { padding: 0 10px; }
  .head { height: auto; display: flex; flex-direction: column; align-items: center; margin: 0 -10px; }
  .stripe, .ribbon, .swoosh { display: none; }
  .nav { position: static; height: auto; padding-top: 8px; }
  .nav a:first-child { font-size: 12px; }
  .logo { position: relative; left: auto; top: auto; z-index: 3; margin: 8px 0 -22px; }
  .logo img { width: 270px; }
  .tagline {
    position: relative; left: auto; top: auto; z-index: 1;
    width: 100%;
    margin-top: 0;
    padding: 24px 12px 12px;
    font-size: 23.5px;
    /* the planet on a phone: same edge shading, grey edge line and ice haze as the desktop SVG */
    background: radial-gradient(130% 160% at 42% -20%, #fff 64%, #d6e8ff 88%, #bcdaff);
    border-top: 5px solid var(--ice);
    border-radius: 0 0 50% 50% / 0 0 26px 26px;
    box-shadow: 0 1.5px 0 #8c8c8c, 0 3px 9px 2px rgba(153, 204, 255, .75);
  }
  .band { position: relative; z-index: 0; left: auto; right: auto; top: auto; width: 100%; height: auto; margin-top: -26px; padding: 38px 12px 12px; background: var(--sky); justify-content: center; }
  .search { flex: 1; }

  .body { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; padding: 14px 8px 12px; line-height: 1.55; }
  .side summary { pointer-events: auto; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
  .side summary::after { content: "▾"; font-size: 18px; padding-right: 4px; }
  .side details[open] summary::after { content: "▴"; }
  .side h2 { margin: 0; font-size: 27px; text-align: left; }
  .side details[open] summary { margin-bottom: 10px; }
  .side ul { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; font-size: 13px; }
  .side li { padding: 3px 0; }
  .side hr { margin-right: 0; }

  .paper { padding: 0 16px 18px; border-radius: 22px 54px 22px 22px; }
  .hotline { height: auto; padding: 16px 30px 10px 0; }
  h1 { margin-top: 2px; }
  h1 { font-size: 36px; margin-bottom: 34px; }
  .moment { box-shadow: 4px 4px 0 var(--blue); margin-bottom: 26px; }
  .burst { right: -8px; top: -54px; width: 62px; height: 62px; }
  .moment-head { padding: 6px 10px 5px 14px; }
  .moment-head h2 { font-size: 23px; }
  .moment-body { flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 14px; }
  .moment-body .tile { width: 42px; height: 42px; border-radius: 12px; font-size: 14px; }
  .moment-body .btn { width: 100%; text-align: center; }
  .rows > li { grid-template-columns: 30px minmax(0, 1fr); align-items: start; }
  .rows .btn { grid-column: 2; justify-self: start; }
  .rows .txt p { font-size: 12.5px; }
  .meta > span:first-child { white-space: normal; }
  .kicker { font-size: 27px; margin-top: 4px; }
  .moment.single .btn { width: 100%; text-align: center; }
  .intro { margin-top: -20px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo:hover, .tagline svg.hand { margin: .0025em auto; }
.tagline.swap { animation: none; }
  .btn, .burst, .rows > li::before { transition: none; }
}
