/* Legal pages of the main site (privacy and cookies). */
:root {
  --background: #0b0f17;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --gold: #e5b842;
  --border: rgba(255, 255, 255, 0.08);
  /* Same content width and side gutter as the home page (home.css). */
  --content-width: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  line-height: 1.5;
}
.top, main, .footer {
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--gold);
  text-decoration: none;
}
/* Language as in King: only the flag, in a circle, with a menu */
.language-box { position: relative; }
.language {
  width: 38px;
  height: 38px;
  padding: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.flag { width: 26px; height: 26px; border-radius: 999px; display: block; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }
.language-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #131a26;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 10;
}
.language-menu[hidden] { display: none; }
.language-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.language-menu button:hover,
.language-menu button:focus-visible,
.language-menu button[aria-current='true'] { background: rgba(229, 184, 66, 0.14); outline: none; }
.language-menu .flag { width: 22px; height: 22px; }
h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 28px; margin: 24px 0 4px; }
h2 { font-size: 16px; margin: 24px 0 8px; color: var(--gold); }
p { margin: 0 0 10px; font-size: 14px; }
.date { color: var(--muted); font-size: 13px; }
.footer {
  display: flex;
  gap: 20px;
  margin-top: 32px;
  padding-top: 20px;
  padding-bottom: 28px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.footer a { color: var(--muted); }

/* Menu of the content pages (King, Articles, About, Contact) */
.menu {
  max-width: calc(var(--content-width) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.menu a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.menu a:hover,
.menu a[aria-current='page'] { color: var(--gold); border-color: rgba(229, 184, 66, 0.4); }
main a { color: var(--gold); }
ul { margin: 0 0 10px; padding-left: 20px; font-size: 14px; }
li { margin-bottom: 6px; }
.data-table { overflow-x: auto; margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 700; }
.button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--gold);
  color: #1a1305 !important;
  font-weight: 700;
  text-decoration: none;
}

/* Game page: the app store badges next to the "Play" button (they go under it when there is no room). */
.play-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 10px; }
.play-row p { margin: 0; }
.stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
article > .stores { margin: 0 0 12px; }
.store { display: block; border-radius: 6px; }
.store img { display: block; height: 40px; width: auto; }
.store:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* The language menu now has links (one per language) instead of buttons. */
.language-menu a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.language-menu a:hover,
.language-menu a:focus-visible,
.language-menu a[aria-current='true'] { background: rgba(229, 184, 66, 0.14); outline: none; }

/* Articles: list with filters, date, game tag and related articles */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.filters select {
  min-width: 170px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #131a26;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
}
.article-list { list-style: none; padding: 0; margin: 16px 0; }
.article-list li { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--border); }
.article-list li[hidden] { display: none; }
.article-list h2 { margin: 0 0 4px; font-size: 17px; }
.article-list h2 a { color: var(--text); text-decoration: none; }
.article-list h2 a:hover { color: var(--gold); }
.article-list p { margin: 4px 0 0; color: var(--muted); }
.info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted) !important;
  text-decoration: none;
}
a.tag:hover { color: var(--gold) !important; border-color: rgba(229, 184, 66, 0.4); }
article > .info,
.articles-main > .info { margin: 0 0 14px; }
.related { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--border); }
.empty { color: var(--muted); }

/* "Games" menu: a <details> with the list of games, looking like the other menu buttons. */
.menu-games { position: relative; }
.menu-games summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.menu-games summary::-webkit-details-marker { display: none; }
.menu-games summary::after { content: '▾'; font-size: 11px; transition: transform 0.2s ease; }
.menu-games[open] summary::after { transform: rotate(180deg); }
.menu-games summary:hover,
.menu-games summary:focus-visible,
.menu-games[open] summary,
.menu-games summary[aria-current='page'] { color: #e5b842; border-color: rgba(229, 184, 66, 0.4); outline: none; }
.menu-list {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #131a26;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 10;
}
.menu-list li { margin: 0; }
.menu .menu-list a {
  display: block;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.menu .menu-list a:hover,
.menu .menu-list a:focus-visible,
.menu .menu-list a[aria-current='page'] { background: rgba(229, 184, 66, 0.14); color: #f1f5f9; outline: none; }
/* Social network logos in the footer (edited in the King admin) */
.social-links { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.social-links a { display: inline-flex; }

/* Illustrations in articles and game pages: a screenshot or a short video, with an optional caption written as
   an emphasised line right after it in Markdown (![…](…) then *caption*). */
.article-body img[src^="/images/"],
.article-body video {
  display: block;
  width: 100%;
  height: auto;
  margin: 16px 0 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}
.article-body p > img[src^="/images/"] + em,
.article-body figcaption {
  display: block;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}
.article-body figure { margin: 0; }

/* Sticky header (brand, language and menu): stays at the top while scrolling and gets compact once the page is
   scrolled (useCompactHeader). Opaque background instead of backdrop-filter, which glitches on Chrome Android. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: env(safe-area-inset-top) 0 8px;
  background: var(--background);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, padding 0.2s ease;
}
.site-header .top { transition: height 0.2s ease; }
.site-header .brand { transition: font-size 0.2s ease; }
.site-header--compact {
  padding-bottom: 6px;
  border-bottom-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.site-header--compact .top { height: 46px; }
.site-header--compact .brand { font-size: 18px; }
.site-header--compact .language { width: 32px; height: 32px; }
.site-header--compact .flag { width: 22px; height: 22px; }
.site-header--compact .menu a,
.site-header--compact .menu-games summary { padding-top: 4px; padding-bottom: 4px; }
.site-header--compact .menu .menu-list a { padding-top: 8px; padding-bottom: 8px; }
@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header * { transition: none !important; }
}
/* Links to an anchor stop below the sticky header. */
html { scroll-padding-top: 100px; }

/* Articles page on a computer: the list on the left and the filters in a panel on the right, which stays visible
   below the sticky header while scrolling. On a phone the filters stay above the list. */
@media (min-width: 900px) {
  .articles-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 40px;
    align-items: start;
  }
  .filters-panel {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 100px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #131a26;
  }
  .filters-panel .filters { flex-direction: column; gap: 14px; margin: 0; }
  .filters-panel .filters select { width: 100%; min-width: 0; background: var(--background); }
  .articles-main { grid-column: 1; grid-row: 1; }
  .articles-main .article-list { margin-top: 0; }
}

/* Breadcrumb at the top of the content pages ("♠ Home › Articles › King › …"): arrow-shaped blocks, lighter at each
   level, the current page a gold block, cut with "…" when it does not fit on one line. */
.breadcrumbs { margin: 22px 0 0; max-width: 100%; }
.breadcrumbs ol {
  display: flex;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}
.breadcrumbs li {
  --arrow: 12px;
  display: flex;
  align-items: center;
  flex: none;
  margin: 0 0 0 -10px;
  padding: 9px 18px 9px 26px;
  background: #1c2535;
  clip-path: polygon(0 0, calc(100% - var(--arrow)) 0, 100% 50%, calc(100% - var(--arrow)) 100%, 0 100%, var(--arrow) 50%);
  font-size: 14px;
  font-weight: 600;
}
.breadcrumbs li:first-child {
  margin-left: 0;
  padding-left: 10px;
  border-radius: 12px 0 0 12px;
  clip-path: polygon(0 0, calc(100% - var(--arrow)) 0, 100% 50%, calc(100% - var(--arrow)) 100%, 0 100%);
}
.breadcrumbs li:nth-child(2) { background: #243047; }
.breadcrumbs li:nth-child(3) { background: #2c3a56; }
.breadcrumbs li:last-child { flex: 0 1 auto; min-width: 0; background: linear-gradient(90deg, var(--gold), #f3d279); }
.breadcrumbs a { display: inline-flex; align-items: center; gap: 8px; color: #e2e8f0; text-decoration: none; }
.breadcrumbs a:hover,
.breadcrumbs a:focus-visible { color: var(--gold); outline: none; }
.breadcrumbs-home {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--background);
  color: var(--gold);
  font-size: 13px;
}
.breadcrumbs [aria-current='page'] { overflow: hidden; text-overflow: ellipsis; color: #3a2600; }
.breadcrumbs + h1,
.breadcrumbs + .articles-layout h1 { margin-top: 14px; }
@media (max-width: 480px) {
  .breadcrumbs li { padding: 8px 12px 8px 22px; font-size: 13px; }
  .breadcrumbs li:first-child { padding-left: 8px; }
}

/* Search box of the article filters, with the search button inside it. */
.filters .search { flex: 1 1 100%; }
.search-box { position: relative; display: flex; }
.search-box input {
  width: 100%;
  padding: 9px 40px 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #131a26;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
}
.search-box input:focus { outline: none; border-color: rgba(229, 184, 66, 0.6); }
.search-box button {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.search-box button:hover,
.search-box button:focus-visible { color: var(--gold); background: rgba(229, 184, 66, 0.12); outline: none; }
.filters-panel .search-box input { background: var(--background); }
@media (min-width: 900px) {
  .filters:not(.filters-panel .filters) .search { flex: 0 1 320px; }
}

/* Side panel of an article: heading, filters and other articles of the game. On a phone it comes after the article. */
.article-side > h2 { margin: 0 0 12px; font-size: 15px; color: var(--text); }
.article-side .related { margin-top: 18px; padding-top: 12px; }
.article-side .related h2 { margin: 0 0 8px; font-size: 14px; color: var(--text); }
.article-side .related ul { padding-left: 18px; }
.article-side .related li { font-size: 13px; }
@media (max-width: 899px) {
  .article-side { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
  .article-side .filters { margin-top: 0; }
}
@media (min-width: 900px) {
  .article-side { max-height: calc(100vh - 120px); overflow-y: auto; }
  .articles-main > h1:first-child { margin-top: 12px; }
}

/* Screenshots that open in the lightbox (src/lightbox.ts, PhotoSwipe). */
.article-body img.zoomable { cursor: zoom-in; transition: border-color 0.2s ease; }
.article-body img.zoomable:hover { border-color: rgba(229, 184, 66, 0.5); }
.pswp__caption {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 32px));
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(11, 15, 23, 0.85);
  color: #f1f5f9;
  font: 14px/1.4 'Plus Jakarta Sans', system-ui, sans-serif;
  text-align: center;
}
.pswp__caption:empty { display: none; }
