/* ── Colour palette (extracted from #BigFatCannibal logo) ───────────── */
:root {
  --yellow:      #F5C511;
  --yellow-dark: #8F6E00;
  --red:         #D9434D;
  --black:       #111111;
  --white:       #FFFFFF;
  --bg:          #FFFFFF;
  --bg-card:     #FFFFFF;
  --bg-card-h:   #FAFAFA;
  --border:      #E5E5E5;
  --text:        #1A1A1A;
  --text-muted:  #666666;
  --radius:      10px;
  --radius-lg:   16px;
  --transition:  0.18s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.logo-wrap svg {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.site-logo {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  object-fit: contain;
}
.site-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition);
}
.site-nav a:hover { color: var(--yellow-dark); }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: 700px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--red); }
.tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* ── Games section ──────────────────────────────────────────────────── */
.games-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.section-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.section-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--black);
}

/* ── Filter bar ─────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-btn {
  padding: 5px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--yellow-dark); color: var(--yellow-dark); }
.filter-btn.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
}

/* ── Game card grid ─────────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.empty {
  color: var(--text-muted);
  grid-column: 1/-1;
  padding: 40px 0;
  text-align: center;
}

/* ── Individual game card ───────────────────────────────────────────── */
.game-card {
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--yellow);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.card-link {
  display: block;
  height: 100%;
}
.card-thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-color-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-initial {
  font-size: 3.5rem;
  font-weight: 900;
  color: rgba(255,255,255,0.3);
  line-height: 1;
  user-select: none;
}
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--red);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 4px;
}
.card-category {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  color: var(--yellow);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
}
.card-body {
  padding: 16px 18px 18px;
}
.card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 6px;
}
.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-players {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.play-btn {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--yellow-dark);
  letter-spacing: 0.03em;
  transition: color var(--transition);
}
.game-card:hover .play-btn { color: var(--red); }

/* ── Shared page layout ─────────────────────────────────────────────── */
[hidden] { display: none !important; }
.site-nav a[aria-current="page"] {
  color: var(--black);
  box-shadow: inset 0 -3px 0 var(--yellow);
  padding-bottom: 4px;
}
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.block { margin-bottom: 64px; }
.section-link {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--yellow-dark);
  transition: color var(--transition);
}
.section-link:hover { color: var(--red); }
.hero-sm { padding: 56px 24px 40px; }
.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 11px 24px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-primary:hover { background: var(--black); color: var(--yellow); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.btn-ghost { border-color: var(--black); color: var(--black); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }

/* ── What's new ─────────────────────────────────────────────────────── */
.news-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.news-item {
  display: grid;
  grid-template-columns: 110px 80px 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.news-item:last-child { border-bottom: none; }
.news-date { font-size: 0.8rem; color: var(--text-muted); }
.news-tag {
  justify-self: start;
  background: var(--black);
  color: var(--yellow);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.news-text { font-weight: 600; }
.news-text a { box-shadow: inset 0 -2px 0 var(--yellow); transition: color var(--transition); }
.news-text a:hover { color: var(--red); }

/* ── Blog cards ─────────────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.post-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-top: 4px solid var(--yellow);
  background: var(--bg-card);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.post-card .card-link { padding: 18px 20px 20px; display: flex; flex-direction: column; }
.post-card .card-desc { flex: 1; }
.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--yellow);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.post-card:hover .play-btn { color: var(--red); }
.post-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #F3F3F3;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ── External links ─────────────────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.link-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), background var(--transition);
}
.link-card:hover { border-color: var(--black); background: var(--yellow); }
.link-label { font-weight: 800; font-size: 1rem; color: var(--black); }
.link-handle { font-size: 0.8rem; color: var(--red); font-weight: 600; }
.link-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.link-card:hover .link-desc { color: var(--black); }

/* ── Links directory (links.html) ───────────────────────────────────── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.links-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 16px;
}
.search-field { flex: 1; min-width: 220px; max-width: 520px; }
.search-field input {
  width: 100%;
  font: inherit;
  padding: 11px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-field input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245, 197, 17, 0.3);
}
.link-count { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.tag-bar { margin-bottom: 28px; }
.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.resource-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.resource-card:hover { border-color: var(--yellow); box-shadow: 0 6px 24px rgba(0,0,0,0.08); }
.resource-title { font-weight: 800; font-size: 1.02rem; color: var(--black); transition: color var(--transition); }
.resource-title:hover { color: var(--red); }
.resource-title span { color: var(--yellow-dark); font-size: 0.85em; }
.resource-host { font-size: 0.76rem; font-weight: 600; color: var(--red); word-break: break-all; }
.resource-desc { font-size: 0.86rem; color: var(--text-muted); margin: 4px 0 10px; flex: 1; }
.tag-btn { border: none; font-family: inherit; cursor: pointer; transition: background var(--transition), color var(--transition); }
.tag-btn:hover { background: var(--yellow); color: var(--black); }

/* ── About ──────────────────────────────────────────────────────────── */
.about { max-width: 700px; margin-inline: auto; text-align: center; }
.about h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 12px; }
.about p { color: var(--text-muted); line-height: 1.8; }
.about a { color: var(--black); font-weight: 700; box-shadow: inset 0 -2px 0 var(--yellow); }

/* ── Single blog post ───────────────────────────────────────────────── */
.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.back-link:hover { color: var(--yellow-dark); }
.post-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.post-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--black);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.prose { font-size: 1.05rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.4rem; font-weight: 800; color: var(--black); margin-top: 1.8em; }
.prose h3 { font-size: 1.15rem; font-weight: 800; margin-top: 1.5em; }
.prose a { font-weight: 600; box-shadow: inset 0 -2px 0 var(--yellow); }
.prose a:hover { color: var(--red); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.3em; }
.prose li::marker { color: var(--red); }
.prose blockquote {
  border-left: 4px solid var(--yellow);
  padding: 4px 0 4px 18px;
  color: var(--text-muted);
  font-style: italic;
}
.prose code {
  font-family: Consolas, 'Cascadia Code', monospace;
  font-size: 0.88em;
  background: #F3F3F3;
  padding: 1px 6px;
  border-radius: 4px;
}
.prose pre {
  background: var(--black);
  color: #EEE;
  padding: 16px 18px;
  border-radius: var(--radius);
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose img { border-radius: var(--radius); }
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-nav a {
  display: flex;
  flex-direction: column;
  font-weight: 800;
  color: var(--black);
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.post-nav a:hover { border-color: var(--yellow); }
.post-nav a.next { text-align: right; }
.post-nav small { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Contact ────────────────────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  max-width: 960px;
}
.contact-form { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field span { font-size: 0.82rem; font-weight: 700; color: var(--black); }
.field input, .field select, .field textarea {
  font: inherit;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245, 197, 17, 0.3);
}
.hp { position: absolute; left: -9999px; }
.form-status { font-size: 0.88rem; font-weight: 600; min-height: 1.4em; }
.form-status.ok { color: #2D6A4F; }
.form-status.error { color: var(--red); }
.contact-aside {
  background: var(--black);
  color: #DDD;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  align-self: start;
}
.contact-aside h2 { color: var(--yellow); font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.contact-aside h3 { color: var(--white); font-size: 0.95rem; font-weight: 800; margin: 20px 0 4px; }
.contact-aside p { font-size: 0.88rem; }
.contact-aside a { color: var(--yellow); font-weight: 700; word-break: break-all; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .site-title { display: none; }
  .page { padding: 0 16px 60px; }
  .post { padding: 28px 16px 60px; }
  .hero-sm { padding: 40px 16px 28px; }
  .posts-grid { grid-template-columns: 1fr; }
  .resource-list { grid-template-columns: 1fr; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 0.85rem; }
  .news-item { grid-template-columns: auto 1fr; gap: 6px 12px; padding: 12px 16px; }
  .news-text { grid-column: 1 / -1; }
  .field-row { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .hero { padding: 50px 24px 40px; }
  .header-inner { padding: 0 16px; }
  .games-section { padding: 0 16px 60px; }
  .games-grid { grid-template-columns: 1fr; }
}
