/* Dor de Remi — content pages: rules, FAQ, "remi online", privacy, account deletion.
   Loads after site.css and reuses its tokens (--night, --card, --ivory, --paper, --gold,
   --mint, --muted, --edge, --serif, --sans, --shell, --nav-h). The landing page loads it
   too, for the shared footer (.foot) and the links under its rules cards (.more-links).
   No scroll scenes here: these pages are plain documents and need no JavaScript. */

:root {
  /* Tile inks from the game client (RemiStrictTable.StrictInk) and its Joly ink. */
  --ink-r: #c0362c;
  --ink-y: #c98a1e;
  --ink-b: #2d5fa6;
  --ink-k: #24211d;
  --ink-j: #8a2f28;
  --rule: color-mix(in srgb, var(--edge) 45%, transparent);
  --text: color-mix(in srgb, var(--paper) 90%, var(--night));
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 90;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--night);
  font-weight: 700;
  font-size: 14px;
  transition: top 0.2s;
}

.skip:focus {
  top: 12px;
}

/* ---------- Header on content pages ---------- */

.page .nav__links a[aria-current="page"] {
  color: var(--ivory);
}

/* The compact menu replaces .nav__links below 900px (site.css hides those). */
.menu {
  display: none;
  position: relative;
}

.menu > summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--paper);
  cursor: pointer;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu > summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.menu[open] > summary {
  border-color: var(--gold);
  color: var(--gold);
}

.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: min(260px, calc(100vw - 32px));
  display: grid;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: 0 24px 50px -20px #000;
}

.menu__panel a {
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 15px;
  color: var(--paper);
}

.menu__panel a:hover,
.menu__panel a[aria-current="page"] {
  background: color-mix(in srgb, var(--edge) 30%, transparent);
  color: var(--ivory);
}

@media (max-width: 900px) {
  .menu {
    display: block;
  }
}

/* ---------- Page hero ---------- */

.doc {
  padding-top: var(--nav-h);
}

.doc-hero {
  position: relative;
  overflow: clip;
  padding-block: clamp(56px, 10vh, 112px) clamp(40px, 7vh, 76px);
  border-bottom: 1px solid var(--rule);
}

.doc-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
}

.doc-hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, var(--night) 8%, color-mix(in srgb, var(--night) 62%, transparent) 55%, color-mix(in srgb, var(--night) 25%, transparent)),
    linear-gradient(to top, var(--night) 2%, transparent 60%);
}

.doc-hero__inner {
  position: relative;
  width: var(--shell);
  margin-inline: auto;
}

.crumbs ol {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.crumbs li + li::before {
  content: "›";
  margin: 0 9px;
  color: var(--edge);
}

.crumbs a:hover {
  color: var(--paper);
}

.doc-title {
  font-size: clamp(40px, 6.6vw, 92px);
  max-width: 15ch;
  overflow-wrap: break-word;
}

.doc-lede {
  margin: clamp(18px, 3vh, 28px) 0 0;
  max-width: 60ch;
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.55;
  color: var(--text);
}

.doc-meta {
  margin: 18px 0 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: clamp(24px, 4vh, 36px);
}

.textlink {
  color: var(--gold);
  font-weight: 500;
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold) 45%, transparent);
  text-underline-offset: 4px;
}

.textlink:hover {
  text-decoration-color: var(--gold);
}

/* ---------- Body: table of contents + prose ---------- */

.doc-body {
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 88px);
  padding-block: clamp(48px, 8vh, 96px);
}

.doc-body--single {
  grid-template-columns: minmax(0, 1fr);
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 28px);
  align-self: start;
  max-height: calc(100svh - var(--nav-h) - 56px);
  overflow-y: auto;
  padding-right: 6px;
}

.toc__t {
  font-size: 10.5px;
  letter-spacing: 0.24em;
  font-weight: 700;
  color: var(--mint);
  text-transform: uppercase;
  margin: 0 0 14px;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  display: grid;
  gap: 2px;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  transition: color 0.2s;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--serif);
  color: var(--gold);
  font-size: 14px;
  flex: none;
  width: 1.6em;
}

.toc a:hover {
  color: var(--ivory);
}

@media (max-width: 900px) {
  .doc-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 20px 20px 14px;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    border: 1px solid var(--rule);
    border-radius: 12px;
  }

  .toc ol {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    column-gap: 14px;
  }

  .toc a {
    font-size: 13.5px;
    padding: 5px 0;
  }
}

/* ---------- Prose ---------- */

.prose {
  min-width: 0;
  max-width: 72ch;
  color: var(--text);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ivory);
  margin: 2.1em 0 0.55em;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose h3 {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--ivory);
  margin: 1.9em 0 0.5em;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose p,
.prose ul,
.prose ol,
.prose dl {
  margin: 0 0 1.05em;
}

.prose strong {
  color: var(--ivory);
  font-weight: 700;
}

.prose a:not(.play):not(.card) {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold) 45%, transparent);
  text-underline-offset: 3px;
}

.prose a:not(.play):not(.card):hover {
  text-decoration-color: var(--gold);
}

.prose ul {
  list-style: none;
  padding: 0;
}

.prose ul > li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 0.45em;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.68em;
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
  opacity: 0.8;
}

.prose ol {
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.prose ol > li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 0.7em;
}

.prose ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.05em;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--gold);
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4em 0;
}

.placeholder {
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  color: var(--ivory);
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 700;
}

/* Quick facts */
/* Cell rules are drawn as right/bottom shadows and clipped at the frame, so a short
   last row leaves plain background instead of a filled gap. */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
}

.facts > div {
  padding: 16px 18px;
  box-shadow: 1px 0 0 var(--rule), 0 1px 0 var(--rule);
}

.facts dt {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 6px;
}

.facts dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.3em;
  border: 1px solid var(--rule);
  border-radius: 12px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.prose caption {
  text-align: left;
  padding: 14px 16px 0;
  font-size: 13px;
  color: var(--muted);
}

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

.prose tr:last-child > td,
.prose tr:last-child > th[scope="row"] {
  border-bottom: 0;
}

.prose thead th {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}

.prose th[scope="row"] {
  color: var(--ivory);
  font-weight: 500;
}

.prose td.num,
.prose th.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.prose td.num {
  color: var(--gold);
  font-weight: 700;
}

.prose td small,
.prose th small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  margin-top: 3px;
}

@media (max-width: 560px) {
  .prose table {
    font-size: 14px;
  }

  .prose th,
  .prose td {
    padding: 10px 11px;
  }
}

/* Callouts */
.note {
  margin: 1.6em 0;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 36%, transparent);
  background: color-mix(in srgb, var(--gold) 6%, var(--card));
}

.note--mint {
  border-color: color-mix(in srgb, var(--mint) 34%, transparent);
  background: color-mix(in srgb, var(--mint) 5%, var(--card));
}

.note > :last-child {
  margin-bottom: 0;
}

.note__t {
  margin: 0 0 6px !important;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold);
}

.note--mint .note__t {
  color: var(--mint);
}

.formula {
  margin: 1.2em 0 1.4em;
  padding: 18px 20px;
  border-left: 2px solid var(--gold);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  font-family: var(--serif);
  font-size: clamp(21px, 2.2vw, 27px);
  line-height: 1.3;
  color: var(--ivory);
}

/* ---------- Tiles ---------- */

/* A formation on a strip of felt; role="img" + aria-label carry its meaning. */
.meld {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px;
  border-radius: 9px;
  background: radial-gradient(120% 140% at 50% 30%, #14503a 0%, var(--green) 70%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--gold) 18%, transparent), 0 10px 24px -14px #000;
  vertical-align: middle;
}

.pt {
  position: relative;
  width: 32px;
  height: 45px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  padding-bottom: 9px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  color: var(--ink-k);
  background: linear-gradient(170deg, #fffdf5 0%, #f6efd8 55%, #efe8d4 100%);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.16), inset 0 1px 0 #fff, 0 4px 10px -4px rgb(0 0 0 / 0.7);
}

/* The colour dot under the number, as on the game's tiles. */
.pt::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: currentColor;
}

.pt[data-c="r"] { color: var(--ink-r); }
.pt[data-c="y"] { color: var(--ink-y); }
.pt[data-c="b"] { color: var(--ink-b); }
.pt[data-c="k"] { color: var(--ink-k); }

.pt[data-c="j"] {
  color: var(--ink-j);
  background: linear-gradient(170deg, #f6eed6 0%, #e0d5b8 100%);
  padding-bottom: 0;
}

.pt[data-c="j"]::after {
  display: none;
}

.exs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  margin: 1.2em 0 1.6em;
}

.ex {
  margin: 0;
  display: grid;
  gap: 9px;
  justify-items: start;
  max-width: 100%;
}

.ex figcaption {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  max-width: 34ch;
}

.ex figcaption b {
  color: var(--gold);
}

.ex--bad .meld {
  background: radial-gradient(120% 140% at 50% 30%, #4a1f1a 0%, #2a1210 75%);
}

.verdict {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
  background: color-mix(in srgb, var(--mint) 18%, transparent);
  color: var(--mint);
}

.verdict--no {
  background: color-mix(in srgb, #e0675c 20%, transparent);
  color: #f08a80;
}

@media (max-width: 560px) {
  .pt {
    width: 28px;
    height: 40px;
    font-size: 14.5px;
    padding-bottom: 8px;
  }

  .pt::after {
    bottom: 7px;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
  }

  .pt[data-c="j"] {
    padding-bottom: 0;
  }
}

/* ---------- FAQ ---------- */

.qa {
  border-top: 1px solid var(--rule);
  padding-top: 4px;
}

.qa h3 {
  margin-top: 1.4em;
}

.faq-group + .faq-group {
  margin-top: 1em;
}

/* ---------- "Read next" cards (reuse .card from site.css) ---------- */

.more {
  width: var(--shell);
  margin-inline: auto;
  padding-bottom: clamp(56px, 9vh, 104px);
}

.more__t {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.8vw, 36px);
  color: var(--ivory);
  margin: 0 0 22px;
}

.more__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
}

a.card {
  display: block;
  transition: border-color 0.25s, transform 0.35s var(--ease);
}

a.card:hover {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  transform: translateY(-2px);
}

a.card > span {
  display: block;
}

a.card .card__t {
  margin-top: 8px;
}

/* ---------- Closing call to play ---------- */

.cta {
  position: relative;
  overflow: clip;
  text-align: center;
  padding-block: clamp(76px, 13vh, 140px);
  border-top: 1px solid var(--rule);
}

.cta__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.cta__veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 70% at 50% 55%, transparent, color-mix(in srgb, var(--night) 90%, transparent) 72%),
    linear-gradient(to top, var(--night), transparent 55%);
}

.cta__inner {
  position: relative;
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  justify-items: center;
  gap: clamp(16px, 2.6vh, 26px);
}

.cta__title {
  font-size: clamp(38px, 6.4vw, 84px);
}

.cta .lede {
  margin: 0;
}

/* ---------- Links under the landing's rules cards ---------- */

.more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(26px, 4vh, 40px);
}

.more-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-size: 14px;
  font-weight: 500;
  color: var(--paper);
  transition: border-color 0.25s, color 0.25s;
}

.more-links a:hover {
  border-color: var(--gold);
  color: var(--ivory);
}

.more-links a:first-child {
  border-color: color-mix(in srgb, var(--gold) 60%, transparent);
  color: var(--gold);
}

/* ---------- Footer (all pages) ---------- */

.foot {
  border-top: 1px solid var(--rule);
  background: var(--night);
  padding-block: clamp(44px, 7vh, 72px) 36px;
  font-size: 14px;
  color: var(--muted);
}

.foot__inner {
  width: var(--shell);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 32px clamp(24px, 4vw, 56px);
}

.foot__brand .brand {
  margin-bottom: 16px;
  color: var(--paper);
}

.foot__brand p {
  margin: 0 0 6px;
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.55;
}

.foot__h {
  margin: 0 0 12px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mint);
}

.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.foot ul a {
  color: var(--paper);
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}

.foot ul a:hover {
  opacity: 1;
  color: var(--ivory);
}

.foot__base {
  width: var(--shell);
  margin: clamp(36px, 6vh, 56px) auto 0;
  padding-top: 22px;
  border-top: 1px solid color-mix(in srgb, var(--edge) 28%, transparent);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  font-size: 12px;
}

.foot__base p {
  margin: 0;
}

.foot__sig {
  font-size: 18px;
}

@media (max-width: 900px) {
  .foot__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .foot__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  a.card,
  .skip {
    transition: none;
  }

  a.card:hover {
    transform: none;
  }
}
