/* tryagain.games: one stylesheet, no external requests. It dresses the pages like the game: its
   purple background with drifting doodles, white panels with blue title bars, its outlined
   Lilita One titles, and its minigames' logos around the home's logo. */

@font-face {
  font-family: "Lilita One";
  src: url("../fonts/LilitaOne.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  /* The game's background: GradientBackdrop and DoodlePattern (LobbyBackdrop.cs). */
  --backdrop:
    radial-gradient(68% 36% at 50% 50%, rgb(146 128 255 / 24%), rgb(146 128 255 / 0%)),
    linear-gradient(180deg, rgb(36 27 112) 0%, rgb(54 43 148) 36%, rgb(58 47 154) 68%, rgb(30 22 98) 100%);
  --backdrop-base: rgb(54 43 148);
  --doodle-tile: 288px;
  --on-backdrop: #ffffff;
  --on-backdrop-muted: rgb(255 255 255 / 80%);
  /* Panels, like the game's popups: white, with a blue title bar. */
  --surface: #ffffff;
  --surface-2: #f1eeff;
  --text: #241b4f;
  --muted: #554d80;
  --border: #e1dcf7;
  --heading: #3a2f9a;
  --link: #3653d4;
  --link-hover: #1f37a3;
  --title-bar: rgb(64 135 244);
  --focus: #d6336c;
  /* The game's green button. */
  --button-top: #3fb51c;
  --button-bottom: #23902a;
  --button-shadow: #0d6b3f;
  --mark-bg: #fff3bf;
  --mark-text: #5c3c00;
  --shadow: 0 3px 0 rgb(18 10 70 / 22%), 0 16px 36px rgb(12 6 48 / 30%);
  --radius: 28px;
  --radius-sm: 14px;
  --font-display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* The grid every page lines up on: the header, the hero and the document share its edges. */
  --page: 70rem;
  --sidebar: 15rem;
  --gutter: 1.5rem;
  --measure: 52rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #211a4b;
    --surface-2: #2b235e;
    --text: #f3f0ff;
    --muted: #c3bbec;
    --border: #3a3078;
    --heading: #ffffff;
    --link: #ffd75e;
    --link-hover: #ffe8a3;
    --title-bar: rgb(52 118 228);
    --focus: #ffd43b;
    --mark-bg: #5c4400;
    --mark-text: #fff3bf;
    --shadow: 0 3px 0 rgb(0 0 0 / 30%), 0 16px 36px rgb(0 0 0 / 36%);
  }
}

/* Base ------------------------------------------------------------------ */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--backdrop-base);
  color: var(--on-backdrop);
  font: 400 1.0625rem/1.65 var(--font-body);
  overflow-wrap: break-word;
}

/* The backdrop and its doodles stay put while the page scrolls; the doodles drift up and to the
   left by one tile and wrap, as in the game. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}
body::before { inset: 0; background: var(--backdrop); }
body::after {
  inset: 0 calc(-1 * var(--doodle-tile)) calc(-1 * var(--doodle-tile)) 0;
  background: url("../img/doodles.svg") 0 0 / var(--doodle-tile) var(--doodle-tile) repeat;
  opacity: .07;
  animation: doodle-drift 60s linear infinite;
}

@keyframes doodle-drift {
  to { transform: translate(calc(-1 * var(--doodle-tile)), calc(-1 * var(--doodle-tile))); }
}

main { flex: 1 0 auto; }
main:focus { outline: none; }

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

a {
  color: var(--link);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}
a:hover { color: var(--link-hover); }

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

/* Straight on the backdrop, focus rings are yellow. */
.site-header,
.hero,
.site-footer,
.page-index main { --focus: #ffd43b; }

.wrap {
  width: min(100% - 2rem, var(--page));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: #ffffff;
  color: #3a2f9a;
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

mark.todo {
  background: var(--mark-bg);
  color: var(--mark-text);
  padding: .05em .3em;
  border-radius: 6px;
  font-weight: 700;
}

/* Header and hero ------------------------------------------------------- */

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding-block: 1rem .25rem;
}

.brand { display: inline-flex; align-items: center; }

/* The game's logo at header size: its idle loop, or the still until it plays. */
.brand-logo {
  position: relative;
  display: block;
  height: 64px;
  aspect-ratio: 190 / 128;
}
.brand-logo .logo-still { display: block; width: auto; height: 100%; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.site-nav a {
  display: inline-block;
  padding: .3rem .95rem .35rem;
  border-radius: 999px;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: .02em;
  text-decoration: none;
  text-shadow: 0 2px 0 rgb(0 0 0 / 35%);
}
.site-nav a:hover { background: rgb(255 255 255 / 14%); color: #ffffff; }

/* Phones: the logo and the menu still share one row. */
@media (max-width: 30rem) {
  .brand-logo { height: 52px; }
  .site-nav a { padding: .25rem .6rem .3rem; font-size: 1.0625rem; }
}
.site-nav a[aria-current="page"] {
  background: #ffffff;
  color: #3a2f9a;
  text-shadow: none;
  box-shadow: 0 3px 0 rgb(0 0 0 / 25%);
}

.hero { padding-block: 1.75rem 1.5rem; }

/* The game's title style: a white face with a black outline, over a black underlay a little
   wider and lower. */
.hero h1 {
  margin: .25rem 0 .9rem;
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.7rem + 2.6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: .015em;
  -webkit-text-stroke: .075em #000000;
  paint-order: stroke fill;
  text-shadow:
    0 .085em 0 #000000,
    .03em .085em 0 #000000,
    -.03em .085em 0 #000000,
    0 .05em 0 #000000;
}

.eyebrow {
  margin: 0;
  color: #ffd43b;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgb(0 0 0 / 35%);
}

.hero-lead {
  margin: 0;
  max-width: 40rem;
  font-size: 1.1875rem;
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  padding: .3rem .9rem;
  border-radius: 999px;
  background: #ffffff;
  color: #3a2f9a;
  font-size: .9375rem;
  font-weight: 800;
  box-shadow: 0 3px 0 rgb(0 0 0 / 22%);
}

/* Minigame logos recorded from the game (static/media/games/), floating around the home's logo. */
.side-games { display: none; }

.game-logo {
  display: block;
  width: 100%;
  height: auto;
  animation: game-bob 6s ease-in-out infinite;
}

@keyframes game-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

/* Home: the game's logo and the store badges, nothing else; the links are in the footer. */
.page-index .site-header { display: none; }

.page-index main {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 78svh;
  padding: 3rem 1rem;
}

.page-index .home { position: relative; z-index: 1; }

@media (min-width: 64rem) {
  .page-index .side-games {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  .page-index .side-games .game-logo {
    position: absolute;
    width: clamp(10rem, 15vw, 15rem);
  }
  .page-index .game-logo--1 { top: 8%; left: 7%; rotate: -8deg; }
  .page-index .game-logo--2 { top: 40%; left: 2.5%; rotate: 5deg; animation-delay: -2s; }
  .page-index .game-logo--3 { top: 70%; left: 8%; rotate: -4deg; animation-delay: -4s; }
  .page-index .game-logo--4 { top: 6%; right: 7%; rotate: 7deg; animation-delay: -1s; }
  .page-index .game-logo--5 { top: 39%; right: 2.5%; rotate: -5deg; animation-delay: -3s; }
  .page-index .game-logo--6 { top: 70%; right: 8%; rotate: 6deg; animation-delay: -5s; }
}

.home {
  display: grid;
  justify-items: center;
  gap: 2rem;
  text-align: center;
}

.home-title { margin: 0; line-height: 0; }

/* The game's logo: a still, or its recording once the video plays (static/js/logo.js). */
.home-logo {
  position: relative;
  display: block;
  width: min(88vw, 30rem);
  aspect-ratio: 800 / 682;
}

.home-logo .logo-still { display: block; width: 100%; height: auto; }

.logo-video {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
}

.logo--intro .logo-still,
.logo--loop .logo-still { visibility: hidden; }
.logo--intro [data-part="intro"],
.logo--loop [data-part="loop"] { display: block; }

.store-block { display: grid; gap: .9rem; justify-items: center; }

.store-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .75rem;
}

/* The official artwork as it comes: no frame of our own. */
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { display: block; height: 48px; width: auto; }

/* The stores' own trademark notices, which their badge guidelines ask for. */
.trademarks {
  max-width: 34rem;
  margin: 0;
  color: var(--on-backdrop-muted);
  font-size: .75rem;
}

.store-status {
  margin: 0;
  padding: .3rem 1rem .35rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 24%);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: .02em;
}

/* Buttons: the game's green button ------------------------------------ */

.button {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.4rem .7rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--button-top), var(--button-bottom));
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.1875rem;
  letter-spacing: .02em;
  text-decoration: none;
  text-shadow: 0 2px 0 rgb(0 60 30 / 60%);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 30%), 0 4px 0 var(--button-shadow);
  transition: transform .12s ease, filter .12s ease;
}
.button:hover { color: #ffffff; filter: brightness(1.06); }
.button:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgb(255 255 255 / 30%), 0 2px 0 var(--button-shadow); }

/* Documents (legal pages, support): the game's panels ----------------- */

.doc {
  display: grid;
  gap: 1.25rem;
  padding-block: .5rem 4rem;
}

.doc > * { min-width: 0; }

/* One column, on the grid's left edge like the title above it. */
.doc--single > * { max-width: var(--measure); }

@media (min-width: 64rem) {
  .doc--toc {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    column-gap: var(--gutter);
    align-items: start;
  }
  .doc--toc .summary,
  .doc--toc .prose { grid-column: 2; }
  .doc--toc .toc {
    grid-column: 1;
    grid-row: 1 / span 2;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
    overflow: auto;
  }
}

.summary,
.toc,
.prose {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* The panel titles: the game's blue title bar. */
.summary h2,
.toc h2 {
  display: inline-block;
  margin: 0 0 .75rem;
  padding: .25rem 1.1rem .3rem;
  border-radius: 999px;
  background: var(--title-bar);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: .02em;
  text-shadow: 0 2px 0 rgb(10 40 110 / 45%);
}

.summary { padding: 1.1rem 1.5rem 1.35rem; }
.summary ul { margin: 0; padding-left: 1.2rem; }
.summary li + li { margin-top: .35rem; }
.summary p { margin: 0; }
.summary p + p { margin-top: .5rem; }

.toc {
  padding: 1rem 1.1rem 1.1rem;
  font-size: .9375rem;
  line-height: 1.45;
}
.toc h2 { font-size: 1.0625rem; }

.toc-list { margin: 0; padding-left: 1.3rem; }
.toc-list li { margin: .3rem 0; }
.toc-list a { text-decoration: none; }
.toc-list a:hover { text-decoration: underline; }

.prose { padding: clamp(1.25rem, .9rem + 1.6vw, 2.25rem); }

.prose h2 {
  margin: 2.5rem 0 .75rem;
  color: var(--heading);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.3rem + .8vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: .01em;
  scroll-margin-top: 1rem;
}
.prose > h2:first-child,
.prose > section:first-child > h2:first-child { margin-top: 0; }

.prose h3 {
  margin: 1.75rem 0 .5rem;
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.35;
  scroll-margin-top: 1rem;
}

.prose p,
.prose ul,
.prose ol,
.prose dl { margin: 0 0 1rem; }
.prose > :last-child { margin-bottom: 0; }

.prose ul,
.prose ol { padding-left: 1.4rem; }

.prose li + li { margin-top: .35rem; }

.prose strong { font-weight: 800; }

.table-wrap {
  margin: 0 0 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: .65rem .8rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose thead th { background: var(--surface-2); font-weight: 800; }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose tbody th { font-weight: 800; }

.facts {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.facts > div {
  display: grid;
  gap: .15rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-weight: 800; }
.facts dt span { display: block; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.facts dd { margin: 0; }

@media (min-width: 40rem) {
  .facts > div { grid-template-columns: 13rem 1fr; gap: 1rem; }
}

.callout {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.callout > :last-child { margin-bottom: 0; }

.steps {
  list-style: none;
  counter-reset: step;
  padding-left: 0 !important;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  min-height: 2rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -.05rem;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--button-top), var(--button-bottom));
  box-shadow: 0 2px 0 var(--button-shadow);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgb(0 60 30 / 60%);
}

.contact-card {
  display: grid;
  gap: .75rem;
  justify-items: start;
}
.contact-card h2 { margin-bottom: 0; }
.contact-card .email { font-size: 1.25rem; font-weight: 800; }

/* Third-party notices */

.notice-list {
  list-style: none;
  padding: 0 !important;
  display: grid;
  gap: .75rem;
}
.notice-list li + li { margin-top: 0; }

.notice {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.notice h3 { margin: 0 0 .25rem !important; font-size: 1.0625rem; }
.notice p { margin: 0 !important; color: var(--muted); font-size: .9375rem; overflow-wrap: anywhere; }
.notice-detail { color: var(--muted); font-weight: 600; font-size: .9375rem; }

.license h3 { margin-top: 2rem; }

.license-text {
  max-height: 28rem;
  margin: 0 0 1rem;
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font: .8125rem/1.5 var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
  position: relative;
  z-index: 1;
  padding-block: 1.5rem 2.5rem;
  color: var(--on-backdrop-muted);
  font-size: .9375rem;
}

.site-footer a { color: #ffffff; }

.footer-links {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.25rem;
}
.footer-links a {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  letter-spacing: .02em;
  text-decoration: none;
  text-shadow: 0 2px 0 rgb(0 0 0 / 30%);
}
.footer-links a:hover { text-decoration: underline; }
.footer-links a[aria-current="page"] { color: #ffd43b; }

.footer-contact,
.footer-copy { margin: .3rem 0; }

/* The home is centred: so is its footer. */
.page-index .site-footer { text-align: center; }
.page-index .footer-links { justify-content: center; }

/* Cookie banner for Google Analytics (static/js/consent.js): a panel like the game's popups.
   Accept and Reject look the same; nothing loads until one is pressed. */
.consent-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .75rem 1.25rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.consent-text { margin: 0; flex: 1 1 18rem; font-size: .9375rem; }
.consent-actions { display: flex; gap: .6rem; }
.consent-button { min-width: 7rem; justify-content: center; border: 0; cursor: pointer; }
.consent-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Motion and print ------------------------------------------------------ */

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

@media print {
  body::before, body::after,
  .site-header, .site-nav, .skip-link, .toc, .site-footer nav, .side-games, .consent-banner { display: none !important; }
  body { background: #ffffff; color: #000000; }
  .hero { padding: 0; }
  .hero h1, .eyebrow { color: #000000; -webkit-text-stroke: 0; text-shadow: none; }
  .chip { padding: 0; box-shadow: none; }
  .summary, .prose { box-shadow: none; padding: 0; }
  .doc--toc { display: block; }
  .license-text { max-height: none; overflow: visible; }
  a { color: #000000; }
}
