/* The same night, sand and team colours as the games. */
:root {
  --night: #0f0d22;
  --board: #17142f;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4efe6;
  --muted: #a8a3c9;
  --sand: #f6e7c8;
  --sand-edge: #b98d4f;
  --sand-ink: #2a1c0c;
  --sun: #ffc145;
  --sun-2: #ff8a3d;
  --bad: #ff5470;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Kufi Arabic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--night);
}
:root[lang="en"] body { font-family: Nunito, "Noto Kufi Arabic", system-ui, sans-serif; line-height: 1.65; }

a { color: var(--sand); text-underline-offset: 3px; }
a:hover { color: var(--sun); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }

.page { width: min(100% - 32px, 760px); margin-inline: auto; }
.sprites { position: absolute; }

/* The sand card the game shows its word on, used here for names. */
.word-card {
  display: inline-block;
  margin: 0;
  padding: 6px 24px 12px;
  font-family: Lalezar, "Noto Kufi Arabic", serif;
  font-weight: 400;
  font-size: clamp(38px, 8vw, 64px);
  line-height: 1.2;
  color: var(--sand-ink);
  text-decoration: none;
  background: var(--sand);
  border-radius: 18px;
  box-shadow: 0 5px 0 var(--sand-edge);
}
:root[lang="en"] .word-card { padding: 10px 24px 8px; }

/* Every page starts the same way: the name, then where you can go. */
.site-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 16px; }
.site-top .word-card { padding: 1px 12px 5px; font-size: 24px; border-radius: 10px; box-shadow: 0 3px 0 var(--sand-edge); }
:root[lang="en"] .site-top .word-card { padding: 5px 12px 2px; }
.site-top .word-card:hover { color: var(--sand-ink); }
.site-top nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; font-weight: 600; }
.site-top nav a { text-decoration: none; }
.site-top nav a:hover { text-decoration: underline; }

/* The game's board. */
.board-band { background: var(--board); border-block: 1px solid var(--line); }
.board-band svg { display: block; width: 100%; height: clamp(190px, 26vw, 320px); }

.hero { padding-block: 26px 0; }
h1.headline {
  margin: 0;
  font-family: Lalezar, "Noto Kufi Arabic", serif;
  font-weight: 400;
  font-size: clamp(34px, 6.5vw, 54px);
  line-height: 1.25;
  color: var(--sand);
}
.lead { margin: 14px 0 22px; font-size: 19px; line-height: 1.7; }
.game-hero { margin-block-start: -38px; position: relative; padding-block: 0; }
.game-hero .lead { margin-block-start: 22px; }

.play {
  display: inline-block;
  padding: 11px 28px;
  font-weight: 800;
  color: #2b1300;
  text-decoration: none;
  background: linear-gradient(180deg, var(--sun), var(--sun-2));
  border-radius: 14px;
}
.play:hover { color: #2b1300; filter: brightness(1.08); }

section { margin-block-start: 56px; scroll-margin-block-start: 16px; }
h2 { margin: 0 0 10px; font-size: 25px; line-height: 1.4; }
p { margin: 0 0 12px; }
.note { font-size: 14px; color: var(--muted); }

/* A game in the list: its board beside its name. The whole thing opens its page. */
.game-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: 22px;
  margin-block-start: 16px;
  color: inherit;
  text-decoration: none;
}
.game-row:hover { color: inherit; }
.game-row .thumb { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; transition: border-color 0.15s; }
.game-row:hover .thumb { border-color: var(--sun); }
.game-row svg { display: block; width: 100%; height: 170px; }
.game-row h3 { margin: 0 0 4px; font-family: Lalezar, "Noto Kufi Arabic", serif; font-weight: 400; font-size: 30px; line-height: 1.3; color: var(--sand); }
.game-row p { margin: 0 0 8px; }
.game-row .more { font-weight: 700; color: var(--sand); text-decoration: underline; text-underline-offset: 3px; }
.game-row:hover .more { color: var(--sun); }

/* Prices: each skin is drawn as a little snake, the way it looks in a match. */
.prices { width: 100%; margin-block: 16px; border-collapse: collapse; }
.prices th { padding: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); text-align: start; }
.prices td { padding: 10px 0; border-block-start: 1px solid var(--line); vertical-align: middle; }
.prices .amount, .prices th:last-child { text-align: end; }
.prices .amount { font-weight: 800; white-space: nowrap; }
.skin { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.mini-snake { flex: none; width: 76px; height: 24px; }
[dir="rtl"] .mini-snake { transform: scaleX(-1); }

/* Work that isn't a game. */
.project { padding-block: 14px; border-block-start: 1px solid var(--line); }
.project:last-child { border-block-end: 1px solid var(--line); }
.project h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 2px; font-size: 18px; }
.project p { margin: 0; color: var(--muted); }
.tag { padding: 1px 9px; font-size: 12px; font-weight: 700; color: var(--muted); background: rgba(255, 255, 255, 0.08); border-radius: 99px; }

.rules { margin: 0; padding-inline-start: 22px; }
.rules li { margin-block-end: 4px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 16px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Details only the owner can give, marked so they can't go online by mistake. */
.fill { padding: 0 6px; color: var(--sand-ink); background: var(--sun); border-radius: 4px; }

/* Terms, refund and privacy pages. */
h1.title { margin: 18px 0 6px; font-family: Lalezar, "Noto Kufi Arabic", serif; font-weight: 400; font-size: 40px; line-height: 1.25; color: var(--sand); }
.legal h2 { margin-block-start: 30px; font-size: 19px; }
.legal ul { margin: 0 0 12px; padding-inline-start: 22px; }
.legal li { margin-block-end: 6px; }

footer { margin-block-start: 64px; padding-block: 22px 40px; border-block-start: 1px solid var(--line); }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* The skins, the same colours as in the game. */
.body { stroke: var(--skin); }
.head { fill: var(--skin); }
.stripe { stroke: var(--stripe, transparent); }
.mint { --skin: #4fd1a5; }
.coral { --skin: #ff7f7f; }
.violet { --skin: #a78bfa; }
.lime { --skin: #c3e85a; }
.candy { --skin: #f472b6; --stripe: #ffd6ea; }
.zebra { --skin: #f4f1ea; --stripe: #2b2a3a; }

@media (max-width: 560px) {
  .lead { font-size: 18px; }
  .game-hero { margin-block-start: -28px; }
  .game-row { grid-template-columns: 1fr; gap: 12px; }
  .mini-snake { width: 58px; height: 18px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-block-end: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
