@font-face{font-family:'Cairo';font-style:normal;font-display:swap;font-weight:200 1000;src:url(/assets/cairo-arabic.748022f50c.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1}
@font-face{font-family:'Cairo';font-style:normal;font-display:swap;font-weight:200 1000;src:url(/assets/cairo-latin.82c13cbd13.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Reem Kufi';font-style:normal;font-display:swap;font-weight:400 700;src:url(/assets/reem-kufi-arabic.9eccd028ae.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;size-adjust:122%}
@font-face{font-family:'Reem Kufi';font-style:normal;font-display:swap;font-weight:400 700;src:url(/assets/reem-kufi-latin.99554d5210.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* Hayrat Games site. Tokens from docs/design/naqsh-spec.md §2 (light only, no star shapes).
   The @font-face rules are prepended by build.mjs. */

:root {
  --plaster: #ece4d6;
  --lintel-a: #e2d6c2;
  --lintel-b: #d8cab2;
  --court: #e4d9c7;
  --panel: #fbf6ee;
  --sunken: #f1e8da;
  --edge: #cdbb9f;
  --teak: #6b4a2f;
  --ink: #2b2219;
  --muted: #6f5f4e; /* the spec's muted (#857462), darkened for small text contrast on plaster */
  --line: #d9cbb6;
  --lattice: #d6c8b1;
  --us: #2f4a9e;
  --us-edge: #1f3373;
  --them: #b9552c;
  --lose-bg: #f3dccf;
  --lose-ink: #9a4322;

  --raised: 0 3px 0 var(--edge), 0 10px 22px rgba(90, 60, 30, 0.16);
  --sunk: inset 0 2px 6px rgba(110, 80, 45, 0.25);

  --font-ui: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Reem Kufi', 'Cairo', system-ui, sans-serif;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--font-ui);
  /* Lozenge lattice: a 32px diamond in 1px lines with a 1.8px dot at its centre (spec §2.5). */
  background: var(--plaster)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M16 .5 31.5 16 16 31.5.5 16Z' fill='none' stroke='%23D6C8B1'/%3E%3Ccircle cx='16' cy='16' r='.9' fill='%23D6C8B1'/%3E%3C/svg%3E");
}

:lang(ar) body,
body:lang(ar) {
  line-height: 1.85;
}

a {
  color: var(--us);
  text-underline-offset: 3px;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--us);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--raised);
}

.skip:focus {
  top: 12px;
}

.draft-banner {
  background: var(--them);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.95rem;
}

/* Lintel: the top band, with a dentil band underneath (3px marks every 12px, 6px high). */
.lintel {
  position: relative;
  background: linear-gradient(var(--lintel-a), var(--lintel-b));
  padding-bottom: 6px;
}

.lintel::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--edge) 0 3px, transparent 3px 12px);
}

.bar {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  font: 700 1.3rem/1 var(--font-display);
}

.brand svg {
  width: 32px;
  height: 32px;
  flex: none;
}

nav.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin-inline-end: -8px;
}

nav.site a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

nav.site a:hover {
  color: var(--us);
}

nav.site a[aria-current='page'] {
  color: var(--us);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

nav.site a.lang {
  margin-inline-start: 6px;
  padding: 0 16px;
  background: var(--sunken);
  box-shadow: var(--sunk);
}

main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 16px 56px;
}

/* ---- Home ---- */

.hero {
  text-align: center;
  padding-top: 16px;
}

.hero h1 {
  margin: 0;
  font: 700 clamp(2.6rem, 9vw, 4.75rem)/1.1 var(--font-display);
  letter-spacing: -0.01em;
}

.alt {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font: 500 1.25rem/1.4 var(--font-display);
}

.hero .tagline {
  margin: 1rem 0 0.25rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.hero .note {
  margin: 0;
  color: var(--muted);
}

/* The game sits in an arched niche: radius half the width (spec §2.3). Container units keep
   the arch a true half circle at any width; the px value is the fallback. */
.niche-wrap {
  container-type: inline-size;
  width: min(100%, 400px);
  margin: 40px auto 0;
}

.niche {
  background: var(--panel);
  box-shadow: var(--raised);
  border-radius: 200px 200px 20px 20px;
  border-radius: 50cqi 50cqi 20px 20px;
  padding: 18px 18px 28px;
  text-align: center;
}

.court {
  position: relative;
  display: grid;
  place-items: end center;
  aspect-ratio: 5 / 4;
  background: var(--court);
  box-shadow: var(--sunk);
  border-radius: 182px 182px 12px 12px;
  border-radius: calc(50cqi - 18px) calc(50cqi - 18px) 12px 12px;
  padding-bottom: 6%;
}

.court-word {
  color: var(--teak);
  font: 700 clamp(4rem, 30cqi, 7rem)/1 var(--font-display);
}

.pearl {
  position: absolute;
  top: 22%;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, #f6efe3 45%, #e3d6c2 100%);
  box-shadow: 0 2px 0 var(--edge), 0 4px 10px rgba(90, 60, 30, 0.2);
}

.eyebrow {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.niche h2 {
  margin: 0;
  font: 700 2rem/1.25 var(--font-display);
}

.niche .short {
  margin: 0.75rem auto 0;
  max-width: 30ch;
}

.pill {
  display: inline-block;
  margin: 20px 0 0;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--sunken);
  box-shadow: var(--sunk);
  color: var(--teak);
  font-weight: 700;
}

/* ---- Documents (legal pages, support) ---- */

.doc {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 52px);
  background: var(--panel);
  border-radius: 20px;
  box-shadow: var(--raised);
  overflow-wrap: break-word;
}

.doc-short {
  max-width: 680px;
}

.doc h1 {
  margin: 0 0 0.75rem;
  font: 700 clamp(1.8rem, 5vw, 2.5rem)/1.25 var(--font-display);
}

.doc h2 {
  margin: 2.2em 0 0.5em;
  padding-top: 0.9em;
  border-top: 1px solid var(--line);
  font: 700 1.45rem/1.35 var(--font-display);
}

.doc h3 {
  margin: 1.6em 0 0.4em;
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.4;
}

.doc h2,
.doc h3 {
  scroll-margin-top: 16px;
}

.doc ul,
.doc ol {
  padding-inline-start: 1.4em;
}

.doc li::marker {
  color: var(--teak);
}

.doc li + li {
  margin-top: 0.2em;
}

.doc strong {
  font-weight: 700;
}

.doc a {
  overflow-wrap: anywhere;
}

[dir='rtl'] .doc a {
  unicode-bidi: isolate;
}

.table-wrap {
  overflow-x: auto;
  margin: 1em 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  line-height: 1.55;
}

.doc th,
.doc td {
  padding: 10px 14px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.doc th {
  background: var(--sunken);
  font-weight: 800;
}

.doc tr:last-child td {
  border-bottom: 0;
}

.toc {
  margin: 1.25rem 0 0;
}

.toc summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--sunken);
  box-shadow: var(--sunk);
  font-weight: 700;
  cursor: pointer;
}

.toc ol {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  columns: 2 16rem;
  column-gap: 2rem;
}

.toc li {
  break-inside: avoid;
}

.toc a {
  display: inline-block;
  padding: 3px 0;
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

mark.placeholder {
  padding: 0 0.25em;
  border-radius: 4px;
  background: var(--lose-bg);
  color: var(--lose-ink);
  outline: 1px dashed var(--them);
}

.lead {
  font-size: 1.2rem;
}

.mail {
  margin: 1.5rem 0;
}

a.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 12px;
  background: var(--us);
  box-shadow: 0 3px 0 var(--us-edge), 0 8px 18px rgba(31, 51, 115, 0.25);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  direction: ltr;
}

a.button:hover {
  background: #2a4390;
}

.not-found > div + div {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* ---- Footer ---- */

.foot {
  border-top: 1px solid var(--line);
  padding: 20px 16px 28px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
  background: rgba(236, 228, 214, 0.85);
}

.foot p {
  margin: 0.2rem 0;
}

.foot a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Hex values (deal-check page): long, left to right in both languages. */
.doc code {
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--sunken);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
  unicode-bidi: isolate;
}

.hex code {
  display: block;
  padding: 10px 14px;
}
