:root {
  --ink: #17241e;
  --muted: #3d5148;
  --paper: #f4f1ea;
  --paper-2: #e7f2ec;
  --white: #fffdf8;
  --green: #0e4b3a;
  --green-2: #146b52;
  --line: #d7ddd4;
  --blue: #164a7a;
  --red-suit: #9d1c2b;
  --gold: #7a5b24;
  --warn: #f8f1df;
  --bad: #f8e8e6;
  --ok: #e6f3eb;
  --shadow: 0 1px 2px rgba(23, 36, 30, 0.06);
  --max: 72rem;
  --text: 1.0625rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 12rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--text);
  line-height: 1.65;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--blue); }
a:hover { text-decoration-thickness: 2px; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--green);
  color: #fff;
  padding: 0.5rem 0.75rem;
  z-index: 50;
}
.skip-link:focus { top: 0.75rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 8px rgba(23, 36, 30, 0.06);
}
body.admin-bar .site-header { top: 32px; }
.header-inner,
.footer-inner,
.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border-radius: 0.7rem;
  object-fit: cover;
}
.brand-name {
  display: block;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--green);
}
.brand-kicker {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 0.4rem;
  padding: 0.4rem 0.7rem;
  font: inherit;
}
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0 0 0.9rem;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.98rem;
}
.site-nav a:hover,
.site-nav .current-menu-item a,
.site-nav .current_page_item a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}
.search-form {
  display: flex;
  gap: 0.4rem;
  padding-bottom: 0.9rem;
}
.search-form input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.45rem 0.6rem;
  font: inherit;
  background: #fff;
}
.search-form button,
.button,
button.button {
  display: inline-block;
  border: 0;
  border-radius: 0.45rem;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 0.9rem;
  font: inherit;
  line-height: 1.3;
  cursor: pointer;
}
.button.secondary {
  background: transparent;
  color: var(--green);
  box-shadow: inset 0 0 0 1.5px var(--green);
}
.button:hover { background: var(--green-2); color: #fff; }
.button.secondary:hover { background: var(--paper-2); color: var(--green); }

.hero {
  padding: 2.4rem 0 1.4rem;
}
.hero h1,
.page-head h1,
.entry-title {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}
.lede { font-size: 1.15rem; max-width: 42rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.1rem; }
.eyebrow {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}

.section { padding: 1.1rem 0 1.4rem; }
.section h2,
.prose h2,
.entry-content h2 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.25;
  margin: 1.6rem 0 0.6rem;
}
.prose h3,
.entry-content h3 {
  font-size: 1.15rem;
  margin: 1.2rem 0 0.4rem;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.grid-3, .grid-2 {
  display: grid;
  gap: 0.9rem;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-link {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1rem;
  color: inherit;
  text-decoration: none;
  height: 100%;
}
.card-link:hover { border-color: var(--green-2); }
.card-link h2,
.card-link h3 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0.2rem 0 0.4rem;
  color: var(--green);
}
.meta { color: var(--muted); font-size: 0.92rem; }
.trust-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}
.age-note {
  display: inline-block;
  margin-right: 0.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--green);
}

.steps { margin: 0; padding-left: 1.2rem; }
.steps li { margin: 0.45rem 0; }

.path-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.path-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  margin: 0.7rem 0;
}
.path-list li::before {
  content: counter(step);
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

.callout {
  border-radius: 0.7rem;
  padding: 0.8rem 0.95rem;
  margin: 0.9rem 0;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.callout-variation { background: var(--warn); }
.callout-mistake { background: var(--bad); }
.callout-ok { background: var(--ok); }
.callout strong { display: block; margin-bottom: 0.15rem; }

.card-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.55rem 0;
}
.card-figure {
  margin: 0.8rem 0 1rem;
  padding: 0.75rem;
  background: #f7fbf8;
  border: 1px dashed var(--line);
  border-radius: 0.7rem;
}
.card-figure figcaption {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.35rem;
}
.playing-card {
  width: 4.3rem;
  min-height: 5.7rem;
  background: #fff;
  border: 1px solid #cfc6b6;
  border-radius: 0.45rem;
  padding: 0.35rem 0.4rem 0.3rem;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  box-shadow: var(--shadow);
}
.playing-card .rank { font-weight: 750; font-size: 1.2rem; font-weight: 700; }
.playing-card .suit { font-size: 1.15rem; margin-top: 0.15rem; }
.playing-card .code { font-size: 0.75rem; letter-spacing: 0.04em; margin-top: auto; }
.playing-card[data-suit="H"],
.playing-card[data-suit="D"] { color: var(--red-suit); }
.playing-card[data-suit="S"],
.playing-card[data-suit="C"] { color: #1c1c1c; }
.playing-card[data-suit="PJ"] { color: var(--green); }
.playing-card .stands {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.2;
  margin-top: 0.25rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 1.5rem;
  padding-bottom: 2.5rem;
}
.toc {
  position: sticky;
  top: 0.75rem;
  align-self: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.8rem;
  font-size: 0.92rem;
}
.toc ol { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .toc-h3 { list-style: circle; margin-left: 0.4rem; }

.prose, .entry-content { max-width: 46rem; }
.prose p, .entry-content p { margin: 0.7rem 0; }
.page-head { padding-top: 1.5rem; }
.miss-code {
	margin: 0 0 0.2rem;
	font-size: clamp(3rem, 12vw, 4.6rem);
	line-height: 0.9;
	font-weight: 700;
	color: var(--green);
}
.miss h2 { margin: 1.3rem 0 0.6rem; }
.miss-pages {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem 0.9rem;
	margin: 0 0 1.4rem;
	padding: 0;
	list-style: none;
}
.miss-pages a { font-weight: 700; }

details.faq {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.7rem 0.9rem;
  margin: 0.55rem 0;
}
details.faq summary { cursor: pointer; font-weight: 650; font-weight: 600; }
details.faq .faq-answer { padding-top: 0.4rem; }

.table-wrap { overflow-x: auto; max-width: 100%; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.98rem;
}
th, td {
  border: 1px solid var(--line);
  text-align: left;
  padding: 0.45rem 0.55rem;
  vertical-align: top;
}
th { background: var(--paper-2); }

.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 0.6rem; }
.crumbs a { color: var(--muted); }

.related { margin-top: 1.5rem; }
.link-rail { margin-top: 1.5rem; }
.link-rail h2 { margin-top: 0; }
.link-rail ul {
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}
.link-rail a { font-weight: 700; text-decoration: none; }
.link-rail li span {
	display: block;
	color: var(--muted);
	font-size: 0.92rem;
	line-height: 1.45;
	margin-top: 0.15rem;
}
@media (min-width: 720px) {
	.link-rail ul { grid-template-columns: 1fr 1fr; }
}
.site-footer {
  background: #10241d;
  color: #e6eee9;
  padding: 2rem 0 1.4rem;
  margin-top: 1rem;
}
.site-footer a { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.15fr 0.85fr 1.1fr;
  gap: 1.2rem;
}
.site-footer h2 { font-size: 1rem; margin: 0 0 0.4rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.25rem 0; }
.fine-print { color: #c5d4cc; font-size: 0.9rem; }
.end-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.6rem 0 1rem;
}

.app-showcase h2 { margin-top: 0.2rem; }
.showcase-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 16rem));
  justify-content: center;
  gap: 1.15rem;
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
}
.showcase-row a {
  display: block;
  overflow: hidden;
  border-radius: 1.35rem;
  background: #140c10;
  box-shadow: 0 12px 28px rgba(23, 36, 30, 0.16);
  line-height: 0;
}
.showcase-row img {
  display: block;
  width: 100%;
  height: auto;
}

.download-bar { display: none; }

@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  html { scroll-padding-top: 4.6rem; }
  .site-header { max-height: 100dvh; overflow-y: auto; }
  .header-bar { gap: 0.55rem; padding: 0.6rem 0; }
  .brand { min-width: 0; gap: 0.55rem; }
  .brand > span { min-width: 0; }
  .brand-mark { width: 2.5rem; height: 2.5rem; border-radius: 0.55rem; }
  .brand-name { font-size: 0.95rem; line-height: 1.15; }
  .brand-kicker { font-size: 0.75rem; }
  .hero { padding: 1.25rem 0 0.8rem; }
  .hero h1 { font-size: 1.65rem; }
  .lede { font-size: 1.02rem; line-height: 1.55; }
  .grid-3, .grid-2, .layout, .footer-grid { grid-template-columns: 1fr; }
  .toc { position: static; }
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; padding-bottom: 0.8rem; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding-bottom: 0.4rem; }
  body { padding-bottom: 5rem; }
  .download-bar {
    display: flex;
    position: fixed;
    z-index: 40;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom));
    background: #101820;
    color: #fff;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.28);
  }
  .download-bar .brand-mark { width: 2.35rem; height: 2.35rem; }
  .download-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1;
    color: #fff;
    text-decoration: none;
  }
  .download-brand > span { min-width: 0; }
  .download-brand strong {
    display: block;
    font-size: 0.84rem;
    line-height: 1.15;
  }
  .download-brand span span {
    display: block;
    color: #c5d0dc;
    font-size: 0.72rem;
    line-height: 1.2;
  }
  .download-apk {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.5rem 0.7rem;
    font-size: 0.88rem;
    white-space: nowrap;
  }
  .fine-print { overflow-wrap: anywhere; }
  .showcase-row {
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0.75rem;
    margin-inline: -0.25rem;
    padding: 0.15rem 0.25rem 0.55rem;
  }
  .showcase-row li {
    flex: 0 0 13.75rem;
    scroll-snap-align: start;
  }
}

@media (max-width: 420px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button { text-align: center; }
  .brand-name { font-size: 0.84rem; }
}

@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
