/* Playhall: a games table. Dark green felt, cream cards, one brass accent. */
:root {
  --felt: #0E3B2C;
  --felt-line: #2C5F4C;
  --text: #F4EFE1;
  --muted: #C9DBCF;
  --accent: #F2C14E;
  --card: #F4EFE1;
  --card-art: #D9CFB4;
  --ink: #1B1B14;
  --ink-muted: #4A4A3F;
  --panel: #14251F;
  --heading: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--felt);
  background-image: radial-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 6px 6px;
  color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.5;
}
a { color: var(--text); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
@media (max-width: 520px) { .wrap { padding-left: 20px; padding-right: 20px; } }

/* Header: the name and, for visitors a translation fits, the flags */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none;
  font-family: var(--heading); font-weight: 800; font-size: 26px; letter-spacing: -.01em;
}
.brand svg { display: block; width: 30px; height: 30px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 500; text-decoration: none; }

main { flex: 1; }

/* Home: the question, then the three categories */
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; padding: 48px 0; }
.eyebrow { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
h1 {
  margin: 0; max-width: 16ch; font-family: var(--heading); font-weight: 800;
  font-size: clamp(40px, 6vw, 72px); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance;
}

.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 28px; padding-bottom: 88px; }
.card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; text-decoration: none;
  background: var(--card); color: var(--ink); box-shadow: 0 16px 28px rgba(0, 0, 0, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { color: var(--ink); transform: translateY(-4px); box-shadow: 0 22px 34px rgba(0, 0, 0, .36); }
.card-art { height: 220px; display: flex; align-items: center; justify-content: center; background: var(--card-art); }
.card-art svg { display: block; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 24px 26px 28px; }
.card h2 { margin: 0; font-family: var(--heading); font-weight: 800; font-size: 32px; line-height: 1.1; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--ink-muted); text-wrap: pretty; }
.card-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; }
.card-go svg { transition: transform .15s ease; }
.card:hover .card-go svg { transform: translateX(4px); }
@media (prefers-reduced-motion: reduce) {
  .card, .card-go svg { transition: none; }
  .card:hover { transform: none; }
  .card:hover .card-go svg { transform: none; }
}

/* Category page: the way back, the category, then its games */
.hero.category { gap: 12px; padding: 24px 0 40px; }
.crumb { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; text-decoration: none; color: var(--muted); }
.crumb:hover { color: var(--text); }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 24px; padding-bottom: 88px; }
.game {
  display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; text-decoration: none;
  background: var(--card); color: var(--ink); box-shadow: 0 14px 24px rgba(0, 0, 0, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.game:hover { color: var(--ink); transform: translateY(-4px); box-shadow: 0 20px 30px rgba(0, 0, 0, .34); }
/* The thumbnail: a picture of the game itself, whole, on the paper colour of the puzzles */
.thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #FFFDF8; }
.thumb img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.thumb img[src$=".png"] { padding: 12px; }
.thumb img[src$=".svg"] { object-fit: cover; }
.game-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px 18px; }
.game h2 { margin: 0; font-family: var(--heading); font-weight: 800; font-size: 22px; line-height: 1.15; letter-spacing: -.01em; }
.game .game-meta { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) {
  .game { transition: none; }
  .game:hover { transform: none; }
}

/* Plain pages: licences, page not found */
.page { padding-top: 32px; padding-bottom: 72px; max-width: 760px; }
.page h1 { max-width: none; font-size: clamp(32px, 5vw, 48px); }
.page .lead { margin: 16px 0 0; color: var(--muted); font-size: 18px; }
.page .back { display: inline-flex; align-items: center; min-height: 44px; margin-top: 20px; font-weight: 600; }
.license { margin-top: 28px; padding: 22px 24px; border: 1px solid var(--felt-line); border-radius: 14px; background: var(--panel); }
.license h2 { margin: 0 0 6px; font-family: var(--heading); font-size: 24px; }
.license p { margin: 0 0 12px; color: var(--muted); }
.license dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.license dt { color: var(--muted); }
.license dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Foot: licences and the quiet "Language" link that opens the list of every language */
.foot-line { border-top: 1px solid var(--felt-line); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding-top: 12px; padding-bottom: 12px; font-size: 14px; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.foot a, .foot-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.foot-link { appearance: none; border: 0; background: none; padding: 0; margin: 0; font: inherit; cursor: pointer; }
.foot a:hover, .foot-link:hover { color: var(--text); text-decoration: underline; }
.lang-all { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-bottom: 12px; }
.lang-all[hidden] { display: none; }

/* Language buttons: flags only in the header, flag and name in the list at the foot */
.langs { display: inline-flex; align-items: center; gap: 2px; }
.langs[hidden] { display: none; }
.flag {
  appearance: none; border: 0; background: none; margin: 0; padding: 0; cursor: pointer; line-height: 0;
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  opacity: .55; transition: opacity .15s;
}
.flag svg { display: block; width: 30px; height: 20px; border-radius: 3px; box-shadow: 0 0 0 1px var(--felt-line); }
.flag:hover { opacity: .85; }
.flag[aria-pressed=true] { opacity: 1; cursor: default; }
.flag[aria-pressed=true] svg { box-shadow: 0 0 0 1px var(--felt), 0 0 0 3px var(--accent); }
.flag.named {
  gap: 8px; opacity: 1; line-height: 1.2; font: inherit; font-size: 14px; color: var(--text);
  padding: 0 14px; border: 1px solid var(--felt-line); border-radius: 10px; background: var(--panel);
}
.flag.named svg { width: 22px; height: 14px; }
.flag.named:hover { border-color: var(--muted); }
.flag.named[aria-pressed=true] { border-color: var(--accent); font-weight: 600; }
.flag.named[aria-pressed=true] svg { box-shadow: 0 0 0 1px var(--felt-line); }
