/* Turdle Flush website: one stylesheet for every page.
   Colours are the game's own (RunUI.cs): ink outlines, cream panels, gold, the red ribbon,
   on sewer green. Fonts are Fredoka (headings) and Nunito (words), both free under the SIL Open
   Font License, served from fonts/ so no visitor loads anything from Google. Latin letters only. */

/* Fredoka is pinned to bold, as Arial Rounded MT Bold was: headings and labels never set a weight. */
@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/nunito.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --ink: #2b1a10;
  --ink-soft: rgba(43, 26, 16, 0.75);
  --cream: #fff6dc;
  --cream-deep: #f1e0b6;
  --gold: #ffd43b;
  --red: #ef4444;
  --sewer: #22463e;
  --sewer-deep: #15302a;
  --sewer-light: #2d5b50;
  --slime: #8fd14f;
  --stone: #e9dfc6;
  --white: #ffffff;
  --white-soft: rgba(255, 255, 255, 0.82);

  --tier-common: #dbe6f0;
  --tier-rare: #73c7ff;
  --tier-epic: #d999ff;
  --tier-legendary: #ffcc33;

  --font-display: "Fredoka", "Arial Rounded MT Bold", ui-rounded, system-ui, -apple-system, "Segoe UI",
    Roboto, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 28px;
  --edge: 4px solid var(--ink);
  --lift: 0 6px 0 var(--ink);
  --page: 1120px;
  --gutter: 16px;
}

@media (min-width: 640px) {
  :root { --gutter: 28px; }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--sewer);
  /* Sewer bricks, with a glow from above */
  background-image:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(143, 209, 79, 0.22), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='64'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.16' stroke-width='2'%3E%3Crect x='1' y='1' width='58' height='30' rx='5'/%3E%3Crect x='61' y='1' width='58' height='30' rx='5'/%3E%3Crect x='-29' y='33' width='58' height='30' rx='5'/%3E%3Crect x='31' y='33' width='58' height='30' rx='5'/%3E%3Crect x='91' y='33' width='58' height='30' rx='5'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--white);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 10px;
  z-index: 10;
}
.skip:focus { left: 8px; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* Outlined game lettering: white with a thick ink edge */
.lettering {
  font-family: var(--font-display);
  color: var(--white);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink);
  letter-spacing: 0.01em;
}

/* The red ribbon from the game: its folded ends stay put, the middle stretches to the words */
.ribbon {
  display: inline-block;
  border-style: solid;
  border-width: 0 38px;
  border-image: url("img/banner.webp") 0 110 fill / 0 38px stretch;
  padding: 0.62em 0.25em 1.05em;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.1;
  color: var(--white);
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
}

/* ---------- Hero ---------- */

.hero {
  padding: 28px 0 0;
}

.hero-grid {
  display: grid;
  gap: 32px;
  align-items: center;
  justify-items: center;
  text-align: center;
}

/* On a phone the clip comes straight after the logo and tagline, before the words */
@media (max-width: 899px) {
  .hero-grid { gap: 0; }
  .hero-text { display: contents; }
  .hero-logo { order: 1; }
  .tagline { order: 2; }
  .stage { order: 3; margin-top: 26px; }
  .lede { order: 4; margin-top: 26px; }
  .controls { order: 5; }
  .soon { order: 6; }
  .stores { order: 7; }
}

@media (min-width: 900px) {
  .hero { padding-top: 56px; }
  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 56px;
    justify-items: start;
    text-align: left;
  }
}

.hero-logo {
  margin: 0;
  width: min(480px, 88vw);
}
.hero-logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.25));
}

.tagline {
  margin: 14px 0 0;
  font-size: clamp(24px, 6.2vw, 38px);
}

.lede {
  margin: 14px 0 0;
  max-width: 34em;
  font-size: 18px;
  color: var(--white-soft);
}

.controls {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
@media (min-width: 900px) {
  .controls { justify-content: flex-start; }
}
.controls li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 15px;
  color: var(--white-soft);
}
.controls b {
  font-family: var(--font-display);
  color: var(--white);
  font-weight: 700;
}
.controls .key {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  border: 3px solid var(--ink);
}
.controls .key img { width: 24px; height: 24px; }
.controls .key svg { width: 20px; height: 20px; }
.controls .key.flush { background: #2f86ea; }

.soon {
  margin: 28px 0 10px;
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
@media (min-width: 900px) {
  .stores { justify-content: flex-start; }
}

/* Store buttons. Until launch they say "coming soon" and go nowhere; at launch, give each
   an href to the store page (or swap in Apple's and Google's official badges). */
.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
  padding: 10px 20px 10px 14px;
  background: #0d0d0f;
  color: var(--white);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22), var(--lift);
  text-decoration: none;
  text-align: left;
}
.store svg { width: 28px; height: 28px; flex: none; }
.store span { display: flex; flex-direction: column; line-height: 1.15; }
.store small { font-size: 12px; color: rgba(255, 255, 255, 0.72); }
.store strong { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
a.store[href]:hover { transform: translateY(-2px); }
.store[aria-disabled="true"] { cursor: default; }

/* The phone with the gameplay clip */
.stage {
  position: relative;
  justify-self: center;
  padding: 10px 40px 0;
}

.phone {
  position: relative;
  width: min(290px, 66vw);
  aspect-ratio: 480 / 1044;
  border: 11px solid #101012;
  border-radius: 50px;
  background: #000;
  box-shadow: 0 0 0 4px var(--ink), 0 30px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.phone video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-toggle {
  position: absolute;
  left: 12px;               /* the game's own FLUSH button is bottom right */
  bottom: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  cursor: pointer;
}
.play-toggle svg { width: 16px; height: 16px; }
.play-toggle .icon-play { display: none; }
.play-toggle[aria-pressed="true"] .icon-play { display: block; }
.play-toggle[aria-pressed="true"] .icon-pause { display: none; }

/* Poops peeking round the phone */
.peek {
  position: absolute;
  width: 34%;
  height: auto;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.25));
}
.peek-left { left: -6%; bottom: 8%; transform: rotate(-8deg); }
.peek-right { right: -8%; top: 24%; width: 30%; transform: scaleX(-1) rotate(-6deg); }

@media (prefers-reduced-motion: no-preference) {
  .peek-left { animation: bob 2.6s ease-in-out infinite; }
  .peek-right { animation: bob-flip 3.1s ease-in-out infinite; }
}
@keyframes bob {
  50% { transform: rotate(-8deg) translateY(-10px); }
}
@keyframes bob-flip {
  50% { transform: scaleX(-1) rotate(-6deg) translateY(-8px); }
}

/* The game's walkway: a stone ledge with slime dripping off it */
.ledge {
  margin-top: 48px;
  height: 34px;
  background: var(--stone);
  border-top: var(--edge);
  border-bottom: var(--edge);
  position: relative;
}
.ledge::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='26'%3E%3Cpath d='M0 0h160v6c-6 0-8 3-9 8s-3 7-5 7-4-2-5-7-3-8-9-8H96c-5 0-7 2-8 5s-2 4-4 4-3-1-4-4-3-5-8-5H44c-6 0-8 4-9 10s-3 9-6 9-5-3-6-9-3-10-9-10H0z' fill='%238fd14f' stroke='%232b1a10' stroke-width='3'/%3E%3C/svg%3E") repeat-x;
}

/* ---------- Sections ---------- */

.section {
  padding: 76px 0 24px;
}

.section-head {
  text-align: center;
  margin-bottom: 52px;
}
.section-head h2 {
  font-size: clamp(30px, 5vw, 44px);
}
.section-head p {
  margin: 12px auto 0;
  max-width: 36em;
  color: var(--white-soft);
}

/* The three cards */
.cards {
  display: grid;
  gap: 52px 28px;
}
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
  isolation: isolate;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: 50px 22px 26px;
  text-align: center;
}
.card > .ribbon {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
}
.card > p {
  margin: 18px 0 0;
  font-size: 16.5px;
  color: var(--ink-soft);
}
.card > p strong { color: var(--ink); }
.card-art {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 200px;
  border-radius: 18px;
  background: var(--cream-deep);
  border: 3px solid rgba(43, 26, 16, 0.18);
  padding: 16px 10px;
}

.card-art > .fill { width: 100%; }

/* Bristol: the result card's rating, then the ladder from worst (Type 7) to the ideal (Type 4) */
.rated img {
  width: 116px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 0 14px rgba(255, 212, 59, 0.9));
}
.rated-label {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.1;
  color: var(--gold);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}
.rated-quip {
  margin: 4px 0 0;
  font-size: 15px;
  font-style: italic;
  color: var(--ink-soft);
}
.ladder {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 2px;
}
.ladder li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.ladder li:nth-child(2) { margin-bottom: 5px; }
.ladder li:nth-child(3) { margin-bottom: 10px; }
.ladder li:nth-child(4) { margin-bottom: 15px; }
.ladder li:nth-child(5) { margin-bottom: 20px; }
.ladder li:nth-child(6) { margin-bottom: 25px; }
.ladder li:nth-child(7) { margin-bottom: 30px; }
.ladder img {
  width: 100%;
  max-width: 44px;
  height: auto;
}
.ladder .type {
  min-width: 22px;
  font-family: var(--font-display);
  font-size: 12px;
  line-height: 1;
  padding: 4px 4px 3px;
  border-radius: 6px;
  background: var(--white);
  border: 2px solid var(--ink);
}
.ladder .best .type { background: var(--gold); }
.ladder-caption {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  width: 100%;
}

/* Daily Turdle: the result as it's shared */
.share {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.share img { width: 60px; height: 60px; flex: none; }
.bubble {
  position: relative;
  width: 100%;
  max-width: 290px;
  margin: 0;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
}
.bubble b { font-family: var(--font-display); font-weight: 700; }
.bubble .strip { display: block; margin: 4px 0; font-size: 16px; letter-spacing: 0; word-break: break-all; }
.twists {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.twists li {
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  padding: 4px 9px 3px;
  border-radius: 999px;
  background: var(--sewer);
  color: var(--white);
}

/* Wardrobe tiles, edged by rarity like the game's */
.tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 290px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.tiles li {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: inset 0 0 0 4px var(--tier, var(--cream-deep));
  padding: 12px;
}
.tiles img { width: 100%; height: 100%; object-fit: contain; }
.tiles .common { --tier: var(--tier-common); }
.tiles .rare { --tier: var(--tier-rare); }
.tiles .epic { --tier: var(--tier-epic); }
.tiles .legendary { --tier: var(--tier-legendary); background: #fff3c4; }
.slots {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}

/* Bosses */
.bosses {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 12px;
}
@media (min-width: 900px) {
  .bosses { grid-template-columns: repeat(8, 1fr); }
}
.bosses li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.bosses img {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.3));
}
.bosses span {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.15;
  color: var(--white-soft);
}

.worlds {
  margin: 44px auto 0;
  max-width: 760px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  list-style: none;
  padding: 0;
}
.worlds li {
  font-family: var(--font-display);
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--sewer-deep);
  border: 2px solid rgba(255, 255, 255, 0.14);
}
.worlds li b { color: var(--gold); margin-right: 6px; }

/* Closing call */
.closer {
  text-align: center;
  padding: 72px 0 84px;
}
.closer img {
  width: 150px;
  height: auto;
  margin: 0 auto 18px;
}
.closer h2 { font-size: clamp(28px, 4.6vw, 40px); }
.closer .stores { justify-content: center; margin-top: 22px; }

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

.site-footer {
  background: var(--sewer-deep);
  border-top: var(--edge);
  padding: 36px 0 44px;
  font-size: 15px;
  color: var(--white-soft);
}
.footer-grid {
  display: grid;
  gap: 22px;
  justify-items: center;
  text-align: center;
}
@media (min-width: 760px) {
  .footer-grid {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
    align-items: center;
  }
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 18px;
}
.footer-brand img { width: 44px; height: 44px; border-radius: 11px; border: 2px solid var(--ink); }
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: center;
}
@media (min-width: 760px) {
  .footer-links { justify-self: stretch; justify-content: flex-end; }
}
.footer-links a {
  font-family: var(--font-display);
  color: var(--white);
  text-decoration: none;
}
.footer-links a:hover { color: var(--gold); text-decoration: underline; }
.footer-small {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

/* ---------- Text pages (privacy, support, press) ---------- */

.page-top {
  padding: 22px 0;
}
.page-top a {
  display: inline-block;
  width: 170px;
}
.page-top img { width: 100%; height: auto; }

.doc {
  max-width: 780px;
  margin: 18px auto 72px;
  background: var(--cream);
  color: var(--ink);
  border: var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--lift);
  padding: 34px 22px 38px;
}
@media (min-width: 640px) {
  .doc { padding: 46px 52px 52px; }
}
.doc h1 { font-size: clamp(30px, 6vw, 42px); }
.doc h2 { font-size: 23px; margin: 36px 0 8px; }
.doc h3 { font-size: 18px; margin: 24px 0 4px; }
.doc p, .doc li { color: var(--ink-soft); }
.doc strong { color: var(--ink); }
.doc a { color: #1d5fb8; text-underline-offset: 2px; }
.doc ul { padding-left: 1.25em; }
.doc li + li { margin-top: 6px; }
.doc .updated {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink-soft);
}
.doc .intro { font-size: 18.5px; color: var(--ink); }
.doc .terms { font-size: 14.5px; color: var(--ink-soft); }
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 15.5px;
}
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 10px 10px 0;
  border-bottom: 2px solid rgba(43, 26, 16, 0.12);
}
.doc th { font-family: var(--font-display); color: var(--ink); width: 34%; }
.doc td { color: var(--ink-soft); }

.callout {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--white);
  border: 3px solid var(--ink);
}
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }

.email-button {
  display: inline-block;
  margin-top: 6px;
  padding: 12px 20px 11px;
  border-radius: 14px;
  background: var(--gold);
  color: var(--ink) !important;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--font-display);
  text-decoration: none;
}

.faq details {
  border-bottom: 2px solid rgba(43, 26, 16, 0.12);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  padding: 12px 0;
  font-family: var(--font-display);
  font-size: 17.5px;
  color: var(--ink);
}
.faq details p, .faq details ul { margin-top: 0; }

/* Press kit downloads */
.downloads {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.downloads li { margin: 0 !important; }
.downloads a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 10px;
  border-radius: 16px;
  background: var(--white);
  border: 3px solid var(--ink);
  text-decoration: none;
  color: var(--ink) !important;
  font-family: var(--font-display);
  font-size: 14px;
}
.downloads a:hover { background: #fffbe9; }
.downloads img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 10px;
  background: var(--sewer);
}
.downloads .tall img { aspect-ratio: 9 / 16; object-fit: cover; }
.downloads small {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.not-found {
  text-align: center;
  padding: 40px 0 90px;
}
.not-found img { width: 180px; margin: 0 auto 18px; }
.not-found h1 { font-size: clamp(32px, 6vw, 48px); }
.not-found p { color: var(--white-soft); }
.not-found a.home {
  display: inline-block;
  margin-top: 14px;
  padding: 12px 22px 11px;
  border-radius: 14px;
  background: var(--gold);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  font-family: var(--font-display);
  text-decoration: none;
}
