/* Gameficate guides (authors.html, developers.html, hosting.html): a top bar with the three guides, the contents and
   search in a sidebar, and the guide itself in a readable column. Prints cleanly. */
:root {
  --navy: #17324d;
  --navy-2: #214667;
  --ink: #1f2a37;
  --muted: #5b6b7c;
  --line: #dce6ef;
  --soft: #f4f8fb;
  --bg: #ffffff;
  --side: #f6f9fc;
  --orange: #ff7a3d;
  --orange-d: #e35f1e;
  --gold: #ffc83d;
  --teal: #13a89e;
  --link: #2d6cdf;
  --top-h: 60px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--top-h) + 16px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    17px/1.65 'Nunito',
    system-ui,
    sans-serif;
}
a {
  color: var(--link);
}
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
}

/* ---------- Top bar ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--top-h);
  padding: 0 20px;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff;
  box-shadow: 0 2px 14px rgba(10, 25, 40, 0.18);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font:
    800 24px/1 'Baloo 2',
    'Nunito',
    sans-serif;
}
.brand b {
  color: var(--gold);
  font-weight: 800;
}
.tabs {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}
.tabs a {
  padding: 8px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
}
.tabs a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.tabs a[aria-current='page'] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--orange);
}
.open-craft {
  margin-left: auto;
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.open-craft:hover {
  background: var(--orange-d);
}
.toc-btn {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - var(--top-h));
}
.side {
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 18px 14px 40px;
  background: var(--side);
  border-right: 1px solid var(--line);
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.search:focus-within {
  border-color: var(--orange);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
}
.search-count {
  min-height: 20px;
  margin: 6px 4px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc ol ol {
  margin: 2px 0 6px 12px;
  border-left: 2px solid var(--line);
}
.toc a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}
.toc ol ol a {
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}
.toc a:hover {
  background: #fff;
  color: var(--navy);
}
.toc a.on {
  background: #fff;
  color: var(--orange-d);
  box-shadow: inset 3px 0 0 var(--orange);
}
main {
  min-width: 0;
  padding: 36px 48px 40px;
}
.guide {
  max-width: 860px;
}
.loading {
  color: var(--muted);
}

/* ---------- The guide ---------- */
.guide h1 {
  margin: 0 0 10px;
  font:
    800 40px/1.15 'Baloo 2',
    'Nunito',
    sans-serif;
  color: var(--navy);
}
.guide h2 {
  margin: 52px 0 14px;
  padding-top: 18px;
  border-top: 2px solid var(--line);
  font:
    800 30px/1.2 'Baloo 2',
    'Nunito',
    sans-serif;
  color: var(--navy);
}
.guide section:first-of-type h2 {
  border-top: 0;
  margin-top: 24px;
}
.guide h3 {
  margin: 34px 0 10px;
  font-size: 21px;
  font-weight: 800;
  color: var(--navy);
}
.guide h4 {
  margin: 24px 0 8px;
  font-size: 17px;
  font-weight: 800;
}
.guide h1 + p {
  font-size: 19px;
  color: var(--muted);
}
.guide p,
.guide ul,
.guide ol {
  margin: 0 0 14px;
}
.guide li {
  margin: 4px 0;
}
.guide li.task {
  list-style: none;
  margin-left: -22px;
}
.guide li.task input {
  margin-right: 8px;
  accent-color: var(--teal);
}
.guide strong {
  font-weight: 800;
  color: var(--navy);
}
.guide code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #eef3f8;
  font:
    0.86em/1.5 ui-monospace,
    Menlo,
    Consolas,
    monospace;
  color: #23415f;
}
.guide .code {
  position: relative;
  margin: 0 0 16px;
}
.guide pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: 14px;
  background: #13283d;
  color: #e6eef6;
  font:
    13.5px/1.55 ui-monospace,
    Menlo,
    Consolas,
    monospace;
}
.guide pre code {
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
}
.guide pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  right: 70px;
  font:
    700 11px/1 'Nunito',
    sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.copy {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font:
    700 12px/1.4 'Nunito',
    sans-serif;
  cursor: pointer;
}
.copy:hover {
  background: rgba(255, 255, 255, 0.18);
}
.guide .table {
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.guide table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}
.guide th {
  padding: 10px 14px;
  background: var(--soft);
  border-bottom: 2px solid var(--line);
  text-align: left;
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
}
.guide td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.guide tr:last-child td {
  border-bottom: 0;
}
.guide tbody tr:nth-child(even) td {
  background: #fbfdfe;
}
.guide blockquote {
  margin: 0 0 16px;
  padding: 12px 18px;
  border-left: 4px solid var(--line);
  border-radius: 0 12px 12px 0;
  background: var(--soft);
  color: var(--ink);
}
.guide blockquote p:last-child {
  margin-bottom: 0;
}
.guide blockquote.tip {
  border-color: var(--teal);
  background: #ecf8f6;
}
.guide blockquote.note,
.guide blockquote.example {
  border-color: var(--link);
  background: #eef4fd;
}
.guide blockquote.important {
  border-color: var(--orange);
  background: #fff3ec;
}
.guide img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 6px 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(23, 50, 77, 0.12);
  cursor: zoom-in;
}
.guide figure {
  margin: 8px 0 22px;
}
.guide figure img {
  margin-bottom: 8px;
}
.guide figcaption {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.guide hr {
  margin: 32px 0;
  border: 0;
  border-top: 2px solid var(--line);
}
.guide mark {
  padding: 0 2px;
  border-radius: 4px;
  background: #ffe28a;
}
.anchor {
  margin-left: 8px;
  color: var(--line);
  text-decoration: none;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.15s;
}
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
.anchor:focus {
  opacity: 1;
  color: var(--orange);
}
.load-error {
  padding: 24px;
  border: 2px solid var(--line);
  border-radius: 16px;
}
.small {
  font-size: 14px;
  color: var(--muted);
}
.foot {
  max-width: 860px;
  margin-top: 60px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 20px;
  box-shadow: 0 8px 24px rgba(10, 25, 40, 0.25);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.to-top.show {
  opacity: 1;
  pointer-events: auto;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  padding: 10px 18px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.scrim {
  display: none;
}

/* ---------- Narrow screens: the contents become a drawer ---------- */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc-btn {
    display: block;
  }
  .side {
    position: fixed;
    top: var(--top-h);
    left: 0;
    bottom: 0;
    z-index: 45;
    width: min(320px, 86vw);
    height: auto;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: 10px 0 30px rgba(10, 25, 40, 0.2);
  }
  body.toc-open .side {
    transform: none;
  }
  body.toc-open .scrim {
    display: block;
    position: fixed;
    inset: var(--top-h) 0 0;
    z-index: 44;
    background: rgba(15, 30, 45, 0.35);
  }
  main {
    padding: 24px 18px 40px;
  }
  .tabs {
    margin-left: 0;
    overflow-x: auto;
  }
  .tabs a {
    padding: 8px 10px;
    font-size: 14px;
    white-space: nowrap;
  }
  .brand span {
    display: none;
  }
}
@media (max-width: 600px) {
  .open-craft {
    display: none;
  }
  .guide h1 {
    font-size: 32px;
  }
  .guide h2 {
    font-size: 25px;
  }
}

/* ---------- Print: just the guide ---------- */
@media print {
  .top,
  .side,
  .to-top,
  .progress,
  .toast,
  .foot,
  .anchor,
  .copy {
    display: none !important;
  }
  .layout {
    display: block;
  }
  main {
    padding: 0;
  }
  body {
    font-size: 11.5pt;
  }
  .guide pre {
    white-space: pre-wrap;
    background: #f4f6f8;
    color: #111;
  }
  .guide img {
    box-shadow: none;
    max-height: 60vh;
  }
  .guide h2 {
    break-before: page;
  }
  .guide section {
    display: block !important;
  }
}
