/* Topple Day help and legal pages (privacy, terms, support, delete your data). Readable first: long text on a calm card. */

:root {
  --ink: #2b2a3a;
  --muted: #5d5b70;
  --gold: #d9663f;
  --gold-deep: #b0482a;
  --teal: #2f8f86;
  --card: rgba(255, 252, 245, 0.92);
  --line: #e3dcef;
  --shadow: 0 18px 40px rgba(40, 30, 80, 0.12);
  --font: "Nunito", "Segoe UI", system-ui, sans-serif;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  color: var(--ink);
  font: 700 17px/1.65 var(--font);
  background: linear-gradient(180deg, #cfe6fb 0%, #f4f1fb 45%, #fbf3ec 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--gold-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid #8a4f10; outline-offset: 3px; border-radius: 4px; }
strong { font-weight: 800; }

/* ------------------------------------------------------------------ header */
.site-head {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px;
  padding: 10px 22px;
  background: rgba(255, 248, 236, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.75);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.2rem; }
.brand img { width: 38px; height: 38px; border-radius: 11px; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-left: auto; }
.site-head nav a { text-decoration: none; color: var(--ink); padding: 6px 12px; border-radius: 999px; font-size: 0.95rem; }
.site-head nav a:hover { background: rgba(255, 255, 255, 0.8); }
.site-head nav a[aria-current="page"] { background: #fff; box-shadow: 0 4px 12px rgba(40, 30, 80, 0.1); color: var(--gold-deep); }

/* ------------------------------------------------------------------ the document card */
main.doc {
  position: relative;
  max-width: 820px;
  margin: 34px auto 0;
  padding: 36px 44px 40px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  box-shadow: var(--shadow);
}
main.doc::before {
  /* The page mascot peeks over the card's corner. */
  content: ""; position: absolute; top: -46px; right: 26px; width: 96px; height: 90px;
  filter: drop-shadow(0 10px 10px rgba(90, 50, 10, 0.18));
  pointer-events: none;
}
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.9rem, 4.4vw, 2.6rem); line-height: 1.15; margin: 0 0 6px; padding-right: 96px; }
h2 {
  font-family: var(--display); font-weight: 800; font-size: 1.45rem; line-height: 1.25;
  margin: 34px 0 8px; padding-top: 18px; border-top: 2px dashed var(--line);
  display: flex; align-items: center; gap: 10px;
}
h2::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 4px; background: var(--gold); }
h3 { font-family: var(--display); font-weight: 800; font-size: 1.15rem; margin: 22px 0 4px; }
p, li { color: var(--ink); }
ul, ol { padding-left: 1.3em; }
li { margin: 4px 0; }
li::marker { color: var(--gold); }
.updated { display: inline-block; color: var(--muted); background: rgba(230, 163, 58, 0.12); border-radius: 999px; padding: 2px 12px; margin: 4px 0 18px; font-size: 0.92rem; }
.summary {
  background: linear-gradient(160deg, #fff6e0, #fffdf8);
  border: 2px solid rgba(230, 163, 58, 0.35);
  border-radius: 22px; padding: 6px 22px; margin: 14px 0;
}
table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 800; background: rgba(230, 163, 58, 0.1); }
.table-wrap { overflow-x: auto; border-radius: 14px; }
.code { font-family: var(--display); font-size: 1.6rem; letter-spacing: 4px; color: var(--gold-deep); background: #fff; border-radius: 12px; padding: 0 10px; }

/* Store buttons (official badges). */
.open-game { display: inline-block; font-family: var(--display); font-size: 1.25rem; color: #fff; background: var(--teal);
  border-radius: 14px; padding: 10px 22px; text-decoration: none; box-shadow: var(--shadow); }
.open-game:hover { filter: brightness(1.08); color: #fff; }
.store-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.store { display: inline-flex; line-height: 0; border-radius: 10px; transition: transform 0.15s ease; }
.store:hover { transform: translateY(-2px); }
.store img { display: block; width: auto; }
.store-google img { height: 70px; margin: -12px -9px; }
.store-apple img { height: 46px; }

/* ------------------------------------------------------------------ footer */
.site-foot { max-width: 820px; margin: 26px auto 34px; padding: 22px 22px 18px; text-align: center; color: var(--muted); }
.site-foot .foot-icon { width: 56px; height: 56px; border-radius: 16px; }
.site-foot p { margin: 8px 0; }
.site-foot .store-row { justify-content: center; margin: 10px 0; }
.site-foot nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0; }
.site-foot nav a { color: var(--ink); }
.site-foot .fine { font-size: 0.8rem; }

@media (max-width: 640px) {
  body { font-size: 16px; background-size: 60px, 50px, 26px, auto, auto; }
  .site-head { padding: 8px 14px; }
  .site-head nav { margin-left: -10px; width: calc(100% + 10px); }
  .site-head nav a { padding: 4px 10px; font-size: 0.9rem; }
  main.doc { margin: 42px 12px 0; padding: 26px 20px 28px; border-radius: 24px; }
  main.doc::before { width: 70px; height: 66px; top: -38px; right: 14px; }
  h1 { padding-right: 56px; }
  .summary { padding: 4px 16px; }
}
@media print {
  body { background: #fff; }
  .site-head, .site-foot .store-row, main.doc::before, h2::before { display: none; }
  main.doc { box-shadow: none; border: 0; margin: 0; padding: 0; }
}
