/* Shared styles for the text pages (privacy, terms, support, delete data).
   Same clay diorama look as the homepage: painted water, cream clay card,
   ink type, letter-tile wordmark and a sandy footer. */
:root {
  /* The game's clay diorama palette (matches index.html) */
  --ink: #0a213b;          /* tile and card ink */
  --body: #1d3246;         /* long-form text on cream (12:1) */
  --ink-soft: #33485a;     /* secondary text on cream */
  --amber: #a65a00;        /* gold headings on cream, large type only */
  --amber-deep: #8f4c00;   /* amber for smaller text on cream */
  --link: #0b5f66;         /* deep lagoon teal for links on cream */
  --cream: #f0e1c8;        /* cream clay face */
  --shell: #fbf3e3;        /* letter tile face */
  --lip: #d4bb93;          /* tile and clay lip */
  --sand: #ead6ad;         /* footer beach */
  --lagoon: #2a9f9b;       /* water, the colour under the painting */
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 600;
  color: var(--body);
  background: var(--lagoon);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Calm painted water behind everything, fixed so the creatures swim over it */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--lagoon) url(img/bg/water.webp) center / cover no-repeat;
}
img { max-width: 100%; height: auto; }
.top, main, footer, .wave { position: relative; z-index: 2; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header: the clay app icon and the letter-tile wordmark, linking home */
.top { display: flex; justify-content: center; padding: 28px 16px 0; }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand img {
  display: block; width: 56px; height: 56px; border-radius: 14px;
  box-shadow: 0 0 0 3px #f6ebd5, 0 4px 0 3px var(--lip), 0 10px 18px rgba(4, 52, 60, .4);
  transform: rotate(-4deg);
  transition: transform .2s var(--bounce);
}
.brand:hover img { transform: rotate(-4deg) translateY(-3px) scale(1.04); }
.brand:focus-visible { border-radius: 16px; outline-offset: 6px; }
.wordmark { display: flex; gap: 10px; }
.wordmark .word { display: flex; gap: 4px; }
.tile {
  --r: 0deg;
  position: relative;
  width: 34px; aspect-ratio: 1;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #fffaf0 0%, var(--shell) 45%, #f1e4cb 100%);
  color: var(--ink);
  border-radius: 7px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(176,146,102,.25),
              0 3px 0 var(--lip), 0 7px 10px rgba(4, 52, 60, .38);
  font-weight: 900; font-size: 20px; line-height: 1;
  overflow: hidden;
  transform: rotate(var(--r));
  transition: transform .2s var(--bounce);
  animation: drop .6s var(--bounce) calc(var(--i, 0) * 45ms) both;
}
.tile:nth-child(odd) { --r: -3deg; }
.tile:nth-child(even) { --r: 2deg; }
.brand:hover .tile { transform: translateY(-3px) rotate(var(--r)); }
@keyframes drop { from { transform: translateY(-40px) rotate(calc(var(--r) * 4)); opacity: 0; } 60% { opacity: 1; } }
/* The page itself: one large cream clay card (a 9-slice, like ClayBox in the game) */
main {
  width: min(780px, calc(100% - 32px));
  margin: 66px auto 64px;
  padding: 4px 64px 52px;
  border-style: solid; border-color: transparent; border-width: 0;
  border-image: url(img/ui/panel_cream_card.webp) 45 fill / 30px stretch;
  filter: drop-shadow(0 10px 12px rgba(4, 52, 60, .32));
  font-size: 17px;
}
/* The title sits on a cream clay ribbon across the card's top edge */
h1 {
  display: table; margin: -36px auto 6px;
  height: 64px; line-height: 58px; padding: 0 70px; white-space: nowrap;
  border-style: solid; border-color: transparent; border-width: 0;
  border-image: url(img/ui/ribbon_cream.webp) 49 84 fill / 32px 55px stretch;
  filter: drop-shadow(0 6px 6px rgba(4, 52, 60, .28));
  color: var(--ink); font-size: 30px; font-weight: 900; text-align: center;
}
.updated {
  display: table; margin: 14px auto 30px; padding: 3px 16px; border-radius: 16px;
  background: var(--shell); color: var(--ink-soft); font-size: 15px; line-height: 1.5; text-align: center;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.8), 0 3px 0 var(--lip);
}
h2 {
  font-size: 25px; font-weight: 900; line-height: 1.25; color: var(--amber);
  margin: 40px 0 10px; padding-top: 30px;
  border-top: 2px dashed rgba(166, 128, 80, .45);
  scroll-margin-top: 24px;
}
h3 { font-size: 19px; font-weight: 900; line-height: 1.3; color: var(--ink); margin: 28px 0 6px; scroll-margin-top: 24px; }
p { margin: 0 0 14px; }
ul { margin: 0 0 16px; padding-left: 24px; }
li { margin: 6px 0; padding-left: 4px; }
li::marker { color: var(--amber); font-size: 1.1em; }
strong { color: var(--ink); font-weight: 800; }
code { font: 800 .92em ui-monospace, Menlo, monospace; background: var(--shell); color: var(--ink); padding: 1px 6px; border-radius: 6px; box-shadow: 0 2px 0 var(--lip); }
main a { color: var(--link); font-weight: 800; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; overflow-wrap: anywhere; }
main a:hover { color: var(--ink); text-decoration-color: var(--amber); }

/* "The short version": a raised shell-coloured tile on the card */
.card {
  background: var(--shell); border-radius: 18px; padding: 20px 24px; margin: 6px 0 24px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.85), inset 0 -3px 0 rgba(176,146,102,.18),
              0 4px 0 var(--lip), 0 10px 16px rgba(120, 90, 50, .14);
}
.card p:first-child { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* Gold clay button (the Support page's email link) */
main a.clay-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 4px 26px 7px; margin: 4px 0;
  border-style: solid; border-color: transparent; border-width: 0;
  border-image: url(img/ui/button_gold.webp) 50 fill / 24px stretch;
  color: var(--ink); text-decoration: none; overflow-wrap: normal;
  filter: drop-shadow(0 4px 5px rgba(4, 52, 60, .25));
  transition: transform .15s var(--bounce);
}
main a.clay-btn:hover { transform: translateY(-2px) scale(1.02); color: var(--ink); }
main a.clay-btn:active { transform: translateY(2px); }

/* Tables on a shell tile, ruled in clay */
.table-wrap {
  overflow-x: auto; margin: 16px 0 22px; border-radius: 16px; background: var(--shell);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.85), 0 4px 0 var(--lip);
}
table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.55; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; }
tr + tr td { border-top: 2px solid rgba(166, 128, 80, .22); }
th { color: var(--ink); font-weight: 900; background: rgba(212, 187, 147, .35); }
th:first-child, td:first-child { width: 40%; }
td:first-child { color: var(--ink); font-weight: 800; }

/* Footer: a sandy beach, as on the homepage */
.wave { display: block; width: 100%; height: 48px; margin-bottom: -1px; }
footer { text-align: center; color: var(--ink-soft); font-size: 14px; line-height: 1.5; padding: 8px 16px 40px; background: var(--sand); }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 10px; }
footer a { color: var(--ink); font-weight: 800; text-decoration: none; }
footer a:hover { text-decoration: underline; }
.lang-switch { margin: 0 0 8px; }
.lang-switch span { color: var(--ink); font-weight: 800; }

/* A few of the game's clay sea creatures in the margins (wide screens only) */
.critters { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.critter {
  position: absolute; left: var(--x); top: var(--y); width: var(--s);
  animation: wander var(--d) ease-in-out var(--delay) infinite alternate;
}
.critter img { display: block; width: 100%; height: auto; }
.critter .sh {
  position: absolute; left: 0; top: 0; opacity: .5;
  transform: translate(calc(var(--s) * .23 * var(--h)), calc(var(--s) * .38 * var(--h))) rotate(var(--tilt)) scaleX(var(--flip, 1));
}
.critter .cr {
  position: relative;
  transform: rotate(var(--tilt)) scaleX(var(--flip, 1));
  animation: hover 5.5s ease-in-out var(--delay) infinite;
}
@keyframes wander {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(calc(var(--dx) * .55), calc(var(--dy) * -1)); }
  100% { transform: translate(var(--dx), var(--dy)); }
}
@keyframes hover {
  0%, 100% { transform: translateY(0) rotate(var(--tilt)) scaleX(var(--flip, 1)); }
  50%      { transform: translateY(-12px) rotate(calc(var(--tilt) + 3deg)) scaleX(var(--flip, 1)); }
}

/* The cookie banner (from analytics.js) in clay, identical to the homepage's */
body .cookie-banner {
  background: var(--cream); color: var(--ink); border: 0; border-radius: 22px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.7), 0 6px 0 var(--lip), 0 18px 40px rgba(4, 40, 48, .45);
}
body .cookie-banner a { color: var(--link); font-weight: 800; }
body .cookie-banner button { border: 2px solid var(--lip); color: var(--ink); background: #fbf3e3; }
body .cookie-banner button.yes { background: #e9b71c; border-color: #c99410; color: var(--ink); }

@media (max-width: 1180px) {
  .critters { display: none; }
}
@media (max-width: 640px) {
  .top { padding-top: 22px; }
  .brand { gap: 10px; }
  .brand img { width: 44px; height: 44px; border-radius: 11px; }
  .wordmark { gap: 8px; }
  .wordmark .word { gap: 3px; }
  .tile { width: clamp(21px, 6.6vw, 26px); border-radius: 6px; font-size: clamp(13px, 4.1vw, 16px); }
  main {
    margin-top: 54px; padding: 2px 20px 32px; font-size: 16px;
    border-image-width: 24px;
  }
  body { line-height: 1.65; }
  h1 {
    margin-top: -30px; height: 54px; line-height: 49px; padding: 0 56px; font-size: 22px;
    border-image-width: 27px 46px;
  }
  /* Long titles (and longer Spanish ones) stay on the ribbon at phone widths */
  @media (max-width: 420px) { h1 { padding: 0 48px; font-size: 20px; } }
  .updated { font-size: 14px; margin: 12px auto 24px; }
  h2 { font-size: 22px; margin-top: 32px; padding-top: 24px; }
  h3 { font-size: 18px; margin-top: 24px; }
  ul { padding-left: 20px; }
  .card { padding: 14px 16px; }
  table { font-size: 14.5px; }
  th, td { padding: 10px 12px; }
}
@media (max-width: 360px) {
  .brand img { width: 40px; height: 40px; }
  h1 { font-size: 19px; padding: 0 48px; border-image-width: 25px 42px; height: 50px; line-height: 45px; margin-top: -28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .critters { display: none; }
}

/* Press kit: trailer and screenshot grid */
.press-video { max-width: 320px; margin: 8px auto 16px; }
.press-video video { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 6px 0 var(--lip); background: #000; }
.press-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin: 0 0 16px; }
.press-shots a { display: block; }
.press-shots img { display: block; width: 100%; border-radius: 12px; box-shadow: 0 4px 0 var(--lip); transition: transform .15s; }
.press-shots a:hover img { transform: translateY(-3px); }
