/* Scacelith website. The colours follow the game and the server's pages: dark wood, ivory, brass.
   Logical properties throughout, so that Arabic (dir="rtl") mirrors the layout. */

/* --------------------------------------------------------------------------------------------
   Fonts: the game's own typefaces (SIL OFL 1.1), subset per script; chess figures from GNU
   FreeFont (GPL v3 with the font exception). Licences in assets/fonts/. */

@font-face {
  font-family: "Scacelith Cinzel";
  src: url("../fonts/cinzel-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303, U+0308, U+2000-206F, U+2074, U+20AC, U+2116, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Scacelith Cinzel";
  src: url("../fonts/cinzel-latin-ext.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0300-036F, U+1E00-1EFF;
}
@font-face {
  font-family: "Scacelith Garamond";
  src: url("../fonts/ebgaramond-regular-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303, U+0308, U+2000-206F, U+2074, U+20AC, U+2116, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Scacelith Garamond";
  src: url("../fonts/ebgaramond-regular-cyrillic.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Scacelith Garamond";
  src: url("../fonts/ebgaramond-italic-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0300-0301, U+0303, U+0308, U+2000-206F, U+2074, U+20AC, U+2116, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Scacelith Garamond";
  src: url("../fonts/ebgaramond-italic-cyrillic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Scacelith Garamond";
  src: url("../fonts/ebgaramond-regular-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+0300-036F, U+1E00-1EFF, U+20A0-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Scacelith Garamond";
  src: url("../fonts/ebgaramond-regular-greek.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "Scacelith Garamond";
  src: url("../fonts/ebgaramond-italic-latin-ext.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-024F, U+0259, U+0300-036F, U+1E00-1EFF, U+20A0-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Scacelith Garamond";
  src: url("../fonts/ebgaramond-italic-greek.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "Scacelith Amiri";
  src: url("../fonts/amiri-arabic.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Scacelith Chess";
  src: url("../fonts/freeserif-chess.woff2") format("woff2");
  font-display: block;
  unicode-range: U+2654-265F;
}

/* --------------------------------------------------------------------------------------------
   Tokens */

:root {
  color-scheme: dark;
  --bg: #120d09;
  --bg-2: #17110c;
  --surface: #1e1711;
  --surface-2: #261d15;
  --surface-3: #30251b;
  --card: linear-gradient(180deg, #2a2017 0%, #221911 100%);
  --line: rgba(201, 164, 92, 0.16);
  --line-2: rgba(201, 164, 92, 0.34);
  --wood: #5a4330;
  --ivory: #f6eedc;
  --text: #e6dbc4;
  --muted: #b9a98a;
  --faint: #998b70;
  --gold: #c9a45c;
  --gold-2: #e2c487;
  --gold-3: #a5823f;
  --gold-ink: #1d150c;
  --win: #b4cf93;
  --loss: #e5a08e;
  --draw: #cfc4ad;
  --aborted: #a09479;
  --danger: #d4705f;
  --danger-bg: rgba(160, 50, 40, 0.18);
  --danger-line: #8a3a2e;
  --ok: #b9d79a;
  --ok-bg: rgba(110, 150, 70, 0.14);
  --ok-line: #5d7a3c;
  --paper: #f3ead8;
  --paper-ink: #1f160f;
  --paper-line: #b89b6a;
  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-display: "Scacelith Cinzel", "Scacelith Garamond", Georgia, serif;
  --font-body: "Scacelith Garamond", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --track: 0.16em;
  --track-wide: 0.22em;
  --shell: 1220px;
  --gutter: clamp(16px, 4vw, 44px);
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Scripts without Cinzel: titles in the body face, without the inscriptional tracking. Cinzel
   has no Vietnamese letters with two marks: Vietnamese titles are all in the body face, so that no
   word mixes the two. */
:lang(ru), :lang(uk), :lang(bg), :lang(el) {
  --track: 0.1em;
  --track-wide: 0.14em;
}
:lang(vi) {
  --font-display: "Scacelith Garamond", Georgia, serif;
  --track: 0.1em;
  --track-wide: 0.14em;
}
:lang(ar) {
  --font-body: "Scacelith Garamond", "Scacelith Amiri", "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", serif;
  --font-display: "Scacelith Amiri", "Noto Naskh Arabic", "Geeza Pro", serif;
  --track: 0;
  --track-wide: 0;
}
:lang(ja) {
  --font-body: "Scacelith Garamond", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --font-display: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --track: 0.06em;
  --track-wide: 0.08em;
}
:lang(zh-Hans) {
  --font-body: "Scacelith Garamond", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --track: 0.06em;
  --track-wide: 0.08em;
}
:lang(zh-Hant) {
  --font-body: "Scacelith Garamond", "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "MingLiU", serif;
  --font-display: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "MingLiU", serif;
  --track: 0.06em;
  --track-wide: 0.08em;
}
:lang(ko) {
  --font-body: "Scacelith Garamond", "Noto Serif KR", "Source Han Serif K", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  --font-display: "Noto Serif KR", "Source Han Serif K", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif;
  --track: 0.04em;
  --track-wide: 0.06em;
}
:lang(hi) {
  --font-body: "Scacelith Garamond", "Noto Serif Devanagari", "Tiro Devanagari Hindi", "Kokila", "Nirmala UI", "Mangal", serif;
  --font-display: "Noto Serif Devanagari", "Tiro Devanagari Hindi", "Kokila", "Nirmala UI", "Mangal", serif;
  --track: 0;
  --track-wide: 0;
}
/* Devanagari letters hang from one joined headline: tracking between them breaks it. */
:lang(hi) :is(.nav-list a, .section-title, .page-title, .legal-title, .form-title, .server-card-title, .verify-title, .chooser-title-small, .video-soon-title) { letter-spacing: 0; }
:lang(hi) .video div.video-consent .cll .c-tl { letter-spacing: 0; }

/* --------------------------------------------------------------------------------------------
   Base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(120, 82, 42, 0.22), transparent 70%),
    var(--bg);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

:lang(ja) body, :lang(zh-Hans) body, :lang(zh-Hant) body, :lang(ko) body, :lang(hi) body { font-size: 1.0625rem; line-height: 1.8; }
:lang(ar) body { font-size: 1.1875rem; line-height: 1.75; }

main { flex: 1 0 auto; outline: none; }

img, picture, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--gold-2); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ivory); }

h1, h2, h3, h4 { margin: 0; color: var(--ivory); font-weight: 400; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, kbd { font-family: var(--font-mono); font-size: 0.86em; }
[hidden] { display: none !important; }
html.is-framed body { visibility: hidden !important; }

::selection { background: rgba(201, 164, 92, 0.38); color: var(--ivory); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 3px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  letter-spacing: var(--track);
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus-visible { top: 12px; color: var(--gold-ink); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  display: inline-block;
  vertical-align: -0.2em;
}
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.rotate-180 { transform: rotate(180deg); }
[dir="rtl"] .flip-rtl.rotate-180 { transform: none; }

.shell {
  width: min(100% - 2 * var(--gutter), var(--shell));
  margin-inline: auto;
}

.piece {
  font-family: "Scacelith Chess", "Segoe UI Symbol", "DejaVu Sans", serif;
  font-variant-emoji: text;
  line-height: 1;
}

.diamond {
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  background: var(--gold);
  transform: rotate(45deg);
  flex: none;
  vertical-align: 0.12em;
}

.num, .tabular { font-variant-numeric: lining-nums tabular-nums; }

/* --------------------------------------------------------------------------------------------
   Typography helpers */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow-num {
  display: inline-grid;
  place-items: center;
  min-width: 2.1em;
  height: 2.1em;
  padding-inline: 0.35em;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: "Scacelith Cinzel", serif;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: var(--gold-2);
}

.section-title {
  margin-top: 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: 0.04em;
  text-wrap: balance;
}
.section-title em, .page-title em {
  font-family: var(--font-body);
  font-style: italic;
  letter-spacing: 0;
  color: var(--gold-2);
}
:lang(ar) .section-title em, :lang(ja) .section-title em, :lang(zh-Hans) .section-title em, :lang(zh-Hant) .section-title em, :lang(ko) .section-title em, :lang(hi) .section-title em { font-style: normal; }
.section-lead {
  margin-top: 1.1rem;
  max-width: 40rem;
  font-size: 1.2rem;
  color: var(--muted);
  text-wrap: pretty;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-2);
}
.text-link:hover { color: var(--ivory); }
.text-link .icon { transition: transform 0.2s var(--ease); }
.text-link:hover .icon { transform: translateX(3px); }
[dir="rtl"] .text-link:hover .icon.flip-rtl { transform: scaleX(-1) translateX(3px); }

.ornament-rule {
  position: relative;
  height: 1px;
  width: min(30rem, 90%);
  margin-block: 1.3rem 1rem;
  background: linear-gradient(90deg, var(--gold) 0%, rgba(201, 164, 92, 0.45) 55%, transparent 100%);
}
[dir="rtl"] .ornament-rule { background: linear-gradient(270deg, var(--gold) 0%, rgba(201, 164, 92, 0.45) 55%, transparent 100%); }
.ornament-rule .diamond {
  position: absolute;
  inset-inline-start: -2px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  background: var(--gold-2);
}

/* --------------------------------------------------------------------------------------------
   Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 48px;
  padding: 0.7em 1.45em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
:lang(ar) .btn, :lang(ja) .btn, :lang(zh-Hans) .btn, :lang(zh-Hant) .btn, :lang(ko) .btn, :lang(hi) .btn { font-size: 0.98rem; font-weight: 400; }
.btn .icon { width: 1.25em; height: 1.25em; }
.btn:active { transform: translateY(1px); }

.btn-gold {
  color: var(--gold-ink);
  background: linear-gradient(180deg, #ecd39c 0%, #d2ae67 48%, #b48f4b 100%);
  border-color: #e9cf96;
  box-shadow: inset 0 1px 0 rgba(255, 248, 228, 0.55), 0 8px 24px rgba(201, 164, 92, 0.16);
}
.btn-gold:hover {
  color: var(--gold-ink);
  background: linear-gradient(180deg, #f4e0b2 0%, #ddbb76 48%, #bf9a55 100%);
  box-shadow: inset 0 1px 0 rgba(255, 248, 228, 0.6), 0 10px 30px rgba(201, 164, 92, 0.26);
}
.btn-ghost {
  color: var(--ivory);
  background: rgba(18, 13, 9, 0.35);
  border-color: var(--line-2);
}
.btn-ghost:hover { color: var(--ivory); border-color: var(--gold); background: rgba(201, 164, 92, 0.08); }
.btn-danger {
  color: #fbe9e4;
  background: linear-gradient(180deg, #92302c, #74211f);
  border-color: #a8453c;
}
.btn-danger:hover { color: #fff; background: linear-gradient(180deg, #a3372f, #822522); }
.btn-small { min-height: 40px; padding: 0.55em 1.05em; font-size: 0.76rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"]:not(.is-busy) { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  width: 1.2em; height: 1.2em;
  border: 2px solid currentColor;
  border-color: var(--gold-ink) var(--gold-ink) transparent transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-ghost.is-busy::after { border-color: var(--ivory) var(--ivory) transparent transparent; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gold-2);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.icon-button:hover { color: var(--ivory); border-color: var(--gold); background: rgba(201, 164, 92, 0.08); }

.button-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }

/* --------------------------------------------------------------------------------------------
   Menus (details/summary): language and download */

.menu { position: relative; }
.menu[open] { z-index: 90; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .chevron { transition: transform 0.2s var(--ease); }
.menu[open] > summary .chevron { transform: rotate(180deg); }

.menu-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 10px);
  inset-inline-start: 0;
  min-width: 300px;
  padding: 0.65rem;
  background: linear-gradient(180deg, #2b2118, #211810);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: menu-in 0.16s var(--ease);
}
.menu-title {
  padding: 0.35rem 0.6rem 0.55rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--gold);
}
.menu-foot {
  margin-top: 0.4rem;
  padding: 0.6rem 0.6rem 0.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--faint);
}
.menu-foot a { color: var(--gold-2); }

@keyframes menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.download-panel { min-width: min(360px, calc(100vw - 32px)); }
.os-list { list-style: none; display: grid; gap: 2px; }
.os-item, .os-group-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--ivory);
  text-decoration: none;
}
a.os-item:hover, a.os-item:focus-visible { background: rgba(201, 164, 92, 0.12); color: var(--ivory); }
.os-icon { width: 1.5rem; height: 1.5rem; color: var(--gold-2); }
.os-text { display: grid; line-height: 1.25; }
.os-name { font-size: 1.05rem; }
.os-meta { font-size: 0.88rem; color: var(--muted); }
.os-item.is-unavailable, .os-group.is-unavailable .os-group-head { color: var(--faint); }
.os-item.is-unavailable .os-icon, .os-group.is-unavailable .os-icon { color: var(--faint); opacity: 0.7; }
.os-group.is-current .os-group-head .os-name::after, .os-item.is-current .os-name::after {
  content: attr(data-current);
  margin-inline-start: 0.6em;
  padding: 0.05em 0.5em;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--gold-2);
  vertical-align: 0.15em;
}
.os-files { list-style: none; display: grid; gap: 2px; padding-inline-start: 2.35rem; }
.os-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: 0.98rem;
}
.os-file:hover, .os-file:focus-visible { background: rgba(201, 164, 92, 0.12); color: var(--ivory); }
.os-file .icon { color: var(--gold); }
.os-file-name { display: inline-flex; align-items: center; gap: 0.55rem; }
.os-file-size { color: var(--faint); font-size: 0.88rem; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.os-flag {
  display: inline-block;
  margin-inline-start: 0.15em;
  padding: 0.05em 0.5em;
  border: 1px solid rgba(226, 196, 135, 0.6);
  border-radius: 999px;
  background: rgba(201, 164, 92, 0.12);
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-2);
  vertical-align: 0.2em;
  white-space: nowrap;
}
:lang(ar) .os-flag, :lang(ja) .os-flag, :lang(zh-Hans) .os-flag, :lang(zh-Hant) .os-flag, :lang(ko) .os-flag, :lang(hi) .os-flag { font-size: 0.8rem; letter-spacing: 0; }
/* The source code, after the systems, set apart by a rule. */
.os-source { position: relative; margin-top: 0.5rem; }
.os-source::before { content: ""; position: absolute; inset-inline: 0.65rem; top: -0.3rem; border-top: 1px solid var(--line); }

/* --------------------------------------------------------------------------------------------
   Header */

/* The blur sits on a pseudo-element: a backdrop-filter on the header itself would make it the
   containing block of the fixed mobile menu. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  transition: border-color 0.3s var(--ease);
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(18, 13, 9, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  transition: opacity 0.3s var(--ease);
}
[data-page="home"] .site-header.is-top { border-bottom-color: transparent; }
[data-page="home"] .site-header.is-top::before {
  background: linear-gradient(180deg, rgba(12, 9, 6, 0.6), rgba(12, 9, 6, 0));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body.nav-open .site-header::before { background: rgba(18, 13, 9, 0.98); }

.header-bar {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ivory);
  text-decoration: none;
  flex: none;
}
.brand:hover { color: var(--ivory); }
.brand-icon { width: 34px; height: 34px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5)); }
.brand-word {
  font-family: "Scacelith Cinzel", serif;
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-inline-end: -0.24em;
}

.site-nav { flex: 1; display: flex; align-items: center; justify-content: center; min-width: 0; }
.nav-list { list-style: none; display: flex; align-items: center; gap: clamp(0.4rem, 1.4vw, 1.5rem); }
.nav-list a, .nav-account {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.45rem 0.15rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
:lang(ar) .nav-list a, :lang(ja) .nav-list a, :lang(zh-Hans) .nav-list a, :lang(zh-Hant) .nav-list a, :lang(ko) .nav-list a, :lang(hi) .nav-list a { font-size: 0.98rem; }
.nav-list a:hover { color: var(--ivory); border-bottom-color: var(--line-2); }
.nav-list a[aria-current] { color: var(--gold-2); border-bottom-color: var(--gold); }
.nav-extra { display: none; }

.header-tools { display: flex; align-items: center; gap: 0.6rem; flex: none; }
.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 40px;
  padding-inline: 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(18, 13, 9, 0.35);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.tool-button:hover, .menu[open] > .tool-button { color: var(--ivory); border-color: var(--gold); background: rgba(201, 164, 92, 0.08); }
.tool-button .icon { width: 1.2rem; height: 1.2rem; }
.lang-code { font-family: "Scacelith Cinzel", var(--font-body); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; }
.account-button-label { font-family: var(--font-display); font-size: 0.74rem; letter-spacing: var(--track); text-transform: uppercase; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:lang(ar) .account-button-label, :lang(ja) .account-button-label, :lang(zh-Hans) .account-button-label, :lang(zh-Hant) .account-button-label, :lang(ko) .account-button-label, :lang(hi) .account-button-label { font-size: 0.94rem; }
.account-button.is-signed-in { border-color: rgba(201, 164, 92, 0.55); color: var(--gold-2); }
.account-button.is-signed-in .account-button-label { text-transform: none; letter-spacing: 0.02em; font-family: var(--font-body); font-size: 1rem; }

/* Thirty-four languages: three columns, scrolled when the window is short. */
.lang-menu .menu-panel { inset-inline-start: auto; inset-inline-end: 0; min-width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - var(--header-h) - 24px); overflow-y: auto; }
.lang-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.lang-list a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}
.lang-list a:hover, .lang-list a:focus-visible { background: rgba(201, 164, 92, 0.12); color: var(--ivory); }
.lang-list a[aria-current] { color: var(--gold-2); background: rgba(201, 164, 92, 0.08); }

.header-download .download-summary { min-height: 40px; padding: 0.5em 1em; font-size: 0.76rem; }
.header-download .menu-panel { inset-inline-start: auto; inset-inline-end: 0; }

.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline-block; }

@media (max-width: 1360px) {
  .account-button:not(.is-signed-in) .account-button-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .account-button.is-signed-in .account-button-label { display: inline; max-width: 7rem; }
  .nav-list { gap: clamp(0.4rem, 1.1vw, 1.1rem); }
  .nav-list a { letter-spacing: 0.1em; }
}

@media (max-width: 1180px) {
  .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 55;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1rem;
    padding: 1.5rem var(--gutter) 2rem;
    background: var(--bg);
    overflow-y: auto;
  }
  .js .site-nav.is-open { display: flex; animation: menu-in 0.18s var(--ease); }
  .js .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .js .nav-list a, .js .nav-account {
    width: 100%;
    padding: 1rem 0.25rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--line);
  }
  .js .nav-extra { display: block; }
  .no-js .site-nav { display: none; }
  .account-button { display: none; }
  .js body.nav-open { overflow: hidden; }
}

@media (max-width: 560px) {
  :root { --header-h: 60px; }
  .brand-word { font-size: 0.98rem; letter-spacing: 0.18em; margin-inline-end: -0.18em; }
  .brand-icon { width: 30px; height: 30px; }
  .header-tools { gap: 0.4rem; }
  .header-download .download-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .header-download .download-summary { padding-inline: 0.75em; }
  .lang-menu .lang-code { display: none; }
  .tool-button { padding-inline: 0.6rem; }
  .menu-panel { min-width: min(300px, calc(100vw - 32px)); }
  .site-header .menu-panel { position: fixed; top: calc(var(--header-h) + 6px); inset-inline: 12px; min-width: 0; max-height: calc(100dvh - var(--header-h) - 18px); overflow-y: auto; }
  .lang-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { padding-inline: 0.7rem; letter-spacing: 0.1em; }
  .dash-tabs { flex-wrap: wrap; overflow-x: visible; }
  .dash-tabs .tab { flex: 1 1 auto; text-align: center; }
}
@media (max-width: 380px) {
  .brand-word { display: none; }
}

/* --------------------------------------------------------------------------------------------
   Hero */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: min(100svh, 980px);
  margin-top: calc(-1 * var(--header-h));
  padding-block: calc(var(--header-h) + 3rem) 5.5rem;
  overflow-x: clip;
  isolation: isolate;
  /* Above the sections that follow, which an open download menu may reach over. */
  z-index: 1;
}
.hero-media {
  position: absolute;
  z-index: -1;
  inset-block: 0;
  inset-inline-end: 0;
  width: 74%;
}
.hero-media picture, .hero-media img { width: 100%; height: 100%; }
.hero-media img {
  object-fit: cover;
  object-position: 30% 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.55) 18%, #000 42%), linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.55) 18%, #000 42%), linear-gradient(180deg, #000 70%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  filter: saturate(0.92) contrast(1.02);
}
/* Right to left, the picture sits on the left and fades towards the text; it is never mirrored
   (a mirrored chessboard would put a light square in the corner). */
[dir="rtl"] .hero-media img {
  object-position: 45% 50%;
  -webkit-mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, 0.55) 18%, #000 42%), linear-gradient(180deg, #000 70%, transparent 100%);
  mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, 0.55) 18%, #000 42%), linear-gradient(180deg, #000 70%, transparent 100%);
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 13, 9, 0.35) 0%, transparent 18%),
    radial-gradient(ellipse 60% 70% at 18% 50%, rgba(18, 13, 9, 0.75), transparent 70%);
  pointer-events: none;
}
[dir="rtl"] .hero::after {
  background:
    linear-gradient(180deg, rgba(18, 13, 9, 0.35) 0%, transparent 18%),
    radial-gradient(ellipse 60% 70% at 82% 50%, rgba(18, 13, 9, 0.75), transparent 70%);
}
.hero-inner { position: relative; }
.hero-copy { max-width: 36rem; }
.hero-eyebrow .diamond { width: 6px; height: 6px; }
.hero-title {
  margin-top: 1.2rem;
  font-family: "Scacelith Cinzel", serif;
  font-size: clamp(2.1rem, 9vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.17em;
  margin-inline-end: -0.17em;
  text-transform: uppercase;
  color: var(--ivory);
  text-shadow: 0 0 34px rgba(226, 196, 135, 0.28), 0 2px 18px rgba(0, 0, 0, 0.6);
}
.hero-tagline {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  color: #dccaa2;
}
:lang(ar) .hero-tagline, :lang(ja) .hero-tagline, :lang(zh-Hans) .hero-tagline, :lang(zh-Hant) .hero-tagline, :lang(ko) .hero-tagline, :lang(hi) .hero-tagline { font-style: normal; }
.hero-lead {
  margin-top: 1.4rem;
  max-width: 32rem;
  font-size: clamp(1.15rem, 1.6vw, 1.32rem);
  color: var(--text);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.2rem; }
.hero-actions .download-summary { min-height: 54px; padding-inline: 1.7em; font-size: 0.92rem; }
.hero-actions .btn-ghost { min-height: 54px; }
.hero-meta { margin-top: 1.4rem; font-size: 0.98rem; color: var(--muted); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
.hero-caption {
  position: absolute;
  inset-inline-end: var(--gutter);
  bottom: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.86rem;
  font-style: italic;
  color: rgba(230, 219, 196, 0.72);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}
.hero-caption .diamond { width: 5px; height: 5px; }

@media (max-width: 900px) {
  .hero {
    min-height: 0;
    align-items: end;
    padding-block: 0 3rem;
  }
  .hero-media {
    position: relative;
    inset: auto;
    width: 100%;
    height: clamp(300px, 78vw, 500px);
    grid-row: 1;
  }
  .hero-media img, [dir="rtl"] .hero-media img {
    object-position: 35% 40%;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, #000 22%, #000 62%, transparent 100%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, #000 22%, #000 62%, transparent 100%);
    -webkit-mask-composite: source-over;
    mask-composite: add;
  }
  .hero::after { display: none; }
  .hero-inner { grid-row: 2; margin-top: -3rem; }
  .hero-eyebrow { text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); }
  .hero-caption { display: none; }
}

/* --------------------------------------------------------------------------------------------
   Highlights strip */

.highlights {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 0;
  padding: 1.4rem 0;
  border-block: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
}
:lang(ar) .highlights, :lang(ja) .highlights, :lang(zh-Hans) .highlights, :lang(zh-Hant) .highlights, :lang(ko) .highlights, :lang(hi) .highlights { font-size: 0.98rem; }
.highlights li { display: inline-flex; align-items: center; }
.highlights li + li::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-inline: 1.3rem;
  background: var(--gold-3);
  transform: rotate(45deg);
}

/* --------------------------------------------------------------------------------------------
   Sections */

.section { position: relative; padding-block: clamp(4.5rem, 9vw, 8.5rem); }
.section-head { max-width: 46rem; }
.section-head-center { margin-inline: auto; text-align: center; }
.section-head-center .eyebrow { justify-content: center; }
.section-head-center .section-lead { margin-inline: auto; }
.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 3rem;
  max-width: none;
}
.section-head-row .section-lead { max-width: 28rem; }

/* Experience */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.1rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.feature {
  position: relative;
  padding: 2rem 1.8rem 1.9rem;
  background: linear-gradient(180deg, rgba(42, 32, 23, 0.72), rgba(30, 23, 17, 0.5));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s var(--ease);
}
.feature:hover { border-color: var(--line-2); transform: translateY(-2px); }
.feature-piece {
  display: block;
  font-size: 2.6rem;
  color: var(--gold-2);
  text-shadow: 0 0 22px rgba(226, 196, 135, 0.25);
}
.feature-title {
  margin-top: 1.1rem;
  font-family: var(--font-display);
  font-size: 1.12rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
:lang(ar) .feature-title, :lang(ja) .feature-title, :lang(zh-Hans) .feature-title, :lang(zh-Hant) .feature-title, :lang(ko) .feature-title, :lang(hi) .feature-title { font-size: 1.3rem; letter-spacing: 0.02em; }
.feature p { margin-top: 0.7rem; color: var(--muted); }

/* Ways to play: styled after the game's title menu */
.section-modes { overflow: hidden; }
.modes-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(18, 13, 9, 0.82) 30%, rgba(18, 13, 9, 0.82) 70%, var(--bg) 100%),
    url("../img/title-screen-1000.webp") center / cover no-repeat;
  opacity: 0.55;
  filter: blur(2px) saturate(0.8);
}
.section-modes .shell { position: relative; }
.modes-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.mode-list { list-style: none; counter-reset: mode; display: grid; gap: 0.2rem; }
.mode {
  position: relative;
  padding: 1.15rem 1.4rem 1.2rem;
  border-inline-start: 1px solid var(--line);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.mode::before {
  content: "";
  position: absolute;
  inset-inline-start: -4px;
  top: 1.75rem;
  width: 7px;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--gold-3);
  transform: rotate(45deg);
  transition: background 0.25s;
}
.mode:hover { border-inline-start-color: var(--gold); background: linear-gradient(90deg, rgba(201, 164, 92, 0.07), transparent 70%); }
[dir="rtl"] .mode:hover { background: linear-gradient(270deg, rgba(201, 164, 92, 0.07), transparent 70%); }
.mode:hover::before { background: var(--gold); }
.mode-name {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: 0.12em;
  color: var(--ivory);
}
:lang(ar) .mode-name, :lang(ja) .mode-name, :lang(zh-Hans) .mode-name, :lang(zh-Hant) .mode-name, :lang(ko) .mode-name, :lang(hi) .mode-name { letter-spacing: 0.03em; }
.mode-text { margin-top: 0.4rem; color: var(--muted); max-width: 36rem; }

@media (max-width: 900px) {
  .modes-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Gallery */
/* Twelve columns: the wide picture, four beside it (two by two) and a last row of three. Below
   1100 px, the wide picture spans the row, then two per row, then the three. */
.gallery {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 0.9rem;
  margin-top: clamp(2.2rem, 4vw, 3.2rem);
}
.shot { grid-column: span 6; }
.shot-wide { grid-column: span 12; }
.shot-third { grid-column: span 4; }
@media (min-width: 1100px) {
  .shot { grid-column: span 3; }
  .shot-wide { grid-column: span 6; grid-row: span 2; }
  .shot-third { grid-column: span 4; }
}
.shot a {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.shot img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
}
.shot a:hover img { transform: scale(1.035); }
.shot-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 2.2rem 1.1rem 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(10, 7, 4, 0.62) 35%, rgba(10, 7, 4, 0.94));
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--ivory);
}
:lang(ar) .shot-caption, :lang(ja) .shot-caption, :lang(zh-Hans) .shot-caption, :lang(zh-Hant) .shot-caption, :lang(ko) .shot-caption, :lang(hi) .shot-caption { font-size: 0.98rem; }
.gallery-note { margin-top: 1rem; font-size: 0.95rem; font-style: italic; color: var(--faint); }
:lang(ar) .gallery-note, :lang(ja) .gallery-note, :lang(zh-Hans) .gallery-note, :lang(zh-Hant) .gallery-note, :lang(ko) .gallery-note, :lang(hi) .gallery-note { font-style: normal; }
@media (max-width: 640px) {
  .shot, .shot-wide, .shot-third { grid-column: span 12; }
}

/* Lightbox */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(8, 6, 4, 0.96);
  color: var(--text);
}
.lightbox::backdrop { background: rgba(8, 6, 4, 0.9); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox-frame { display: grid; justify-items: center; gap: 0.9rem; padding: 4.5rem 1rem 3rem; }
.lightbox-image {
  max-width: min(92vw, 1600px);
  max-height: calc(100dvh - 10rem);
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.lightbox-caption { font-family: var(--font-display); font-size: 0.86rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--ivory); text-align: center; }
.lightbox-button {
  position: fixed;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(18, 13, 9, 0.7);
  color: var(--ivory);
}
.lightbox-button:hover { border-color: var(--gold); color: var(--gold-2); }
.lightbox-close { top: 1rem; inset-inline-end: 1rem; }
.lightbox-prev { top: 50%; inset-inline-start: 1rem; transform: translateY(-50%); }
.lightbox-next { top: 50%; inset-inline-end: 1rem; transform: translateY(-50%); }
.lightbox-prev .icon { transform: rotate(180deg); }
[dir="rtl"] .lightbox-prev .icon { transform: none; }
[dir="rtl"] .lightbox-next .icon { transform: rotate(180deg); }
.lightbox-count { position: fixed; top: 1.55rem; inset-inline-start: 1.4rem; font-size: 0.9rem; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { top: auto; bottom: 1rem; transform: none; }
}

/* Trailer */
.section-trailer { background: linear-gradient(180deg, transparent, rgba(30, 22, 15, 0.6) 30%, rgba(30, 22, 15, 0.6) 70%, transparent); }
.video {
  position: relative;
  max-width: 1040px;
  margin: clamp(2rem, 4vw, 3rem) auto 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #0b0805;
  box-shadow: var(--shadow);
}
.video-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.62) saturate(0.9); }
.video-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 1.5rem; text-align: center; }
.video-soon { display: grid; gap: 0.6rem; max-width: 30rem; padding: 1.2rem 1.5rem; border-radius: var(--radius-sm); background: rgba(12, 9, 6, 0.78); }
.video-soon-title { font-family: var(--font-display); font-size: clamp(1.2rem, 2.6vw, 1.7rem); letter-spacing: 0.1em; color: var(--ivory); }
.video-soon-text { color: var(--muted); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-note { max-width: 1040px; margin: 0.9rem auto 0; font-size: 0.92rem; color: var(--faint); text-align: center; }
/* The trailer's consent notice (iframemanager, assets/vendor/iframemanager) in the site's colours */
.video-consent {
  --im-font-family: var(--font-body);
  --im-color: var(--ivory);
  --im-bg: #0b0805;
  --im-link-color: var(--gold-2);
  --im-link-hover-color: var(--ivory);
  --im-btn-color: var(--gold-ink);
  --im-btn-bg: linear-gradient(180deg, var(--gold-2), var(--gold));
  --im-btn-hover-bg: linear-gradient(180deg, #ecd39f, var(--gold-2));
  --im-btn-active-box-shadow: 0 0 0 0.25em rgba(201, 164, 92, 0.3);
  --im-overlay-bg: linear-gradient(180deg, rgba(12, 9, 6, 0.5), rgba(12, 9, 6, 0.88));
}
.video div.video-consent { position: absolute; inset: 0; display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; font-size: 1rem; }
.video div.video-consent::before { display: none; }
.video div.video-consent .cll .c-bg { z-index: 0; opacity: 1; }
.video div.video-consent .cll .c-tl { margin-bottom: 0.7em; font-family: var(--font-display); font-size: clamp(1.15rem, 2.4vw, 1.6rem); font-weight: 400; letter-spacing: 0.08em; }
.video div.video-consent .cll .c-n-t { max-width: 36em; font-size: clamp(0.92rem, 1.6vw, 1.05rem); line-height: 1.5; }
.video div.video-consent .cll .c-n-a { margin-top: 1.1em; }
.video div.video-consent .cll .c-l-b { padding: 0.85em 1.35em; border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 0.86rem; letter-spacing: var(--track); text-transform: uppercase; }
.video div.video-consent .cll .c-l-b:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
[dir="rtl"] .video div.video-consent .cll .c-l-b::before { margin-right: 0; margin-left: 0.75em; } /* a play sign is not mirrored */
.video div.video-consent .cll iframe { background: #000; }
/* A phone's 16:9 box is too short for the notice: it grows until the player is accepted. */
@media (max-width: 640px) {
  .video:has(.video-consent:not(.c-h-n)) { aspect-ratio: 4 / 5; }
}

/* Online */
.online-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
.checklist { list-style: none; display: grid; gap: 0.85rem; margin-block: 2rem 2.3rem; }
.checklist li {
  position: relative;
  padding-inline-start: 1.9rem;
  color: var(--text);
}
.checklist li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.3rem;
  top: 0.6em;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}
@media (max-width: 960px) {
  .online-grid { grid-template-columns: minmax(0, 1fr); }
}

.card-brand {
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  overflow-wrap: anywhere;
}
:lang(ar) .card-brand, :lang(ja) .card-brand, :lang(zh-Hans) .card-brand, :lang(zh-Hant) .card-brand, :lang(ko) .card-brand, :lang(hi) .card-brand { font-size: 0.9rem; }

.server-card, .panel, .auth-card, .gif-card {
  background: var(--card);
  border: 1px solid var(--wood);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 240, 210, 0.05);
}
.server-card { padding: 1.8rem; }
.server-card-title { margin-top: 0.6rem; font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.06em; }
.status { display: inline-flex; align-items: center; gap: 0.55rem; margin-top: 0.6rem; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.status.is-online { color: var(--ok); }
.status.is-online .status-dot { background: #8fc46a; box-shadow: 0 0 0 0 rgba(143, 196, 106, 0.6); animation: pulse 2.4s infinite; }
.status.is-offline { color: var(--danger); }
.status.is-offline .status-dot { background: var(--danger); }
.status.is-busy { color: var(--gold-2); }
.status.is-busy .status-dot { background: var(--gold); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(143, 196, 106, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(143, 196, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 196, 106, 0); }
}
.server-facts { display: grid; gap: 0.15rem; margin-top: 1.3rem; border-top: 1px solid var(--line); }
.server-facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.server-facts dt { color: var(--muted); }
.server-facts dd { color: var(--ivory); text-align: end; }
.server-facts code { font-size: 0.9rem; color: var(--gold-2); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; justify-content: flex-end; }
.chip {
  display: inline-block;
  padding: 0.05rem 0.55rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 0.9rem;
  font-variant-numeric: lining-nums;
  color: var(--text);
  direction: ltr;
}
.mini-board { margin-top: 1.5rem; }
.mini-board-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mini-board-title { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--font-display); font-size: 0.82rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold); }
.mini-board-list { list-style: none; margin-block: 0.8rem 1.1rem; display: grid; gap: 2px; }
.mini-board-list li { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: 0.75rem; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); background: rgba(18, 13, 9, 0.35); }
.mini-board-list li.placeholder { display: block; color: var(--faint); background: none; padding-inline: 0; }
.mini-board-list .rank { color: var(--gold-2); text-align: center; font-variant-numeric: lining-nums; }
.mini-board-list a { color: var(--ivory); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board-list a:hover { color: var(--gold-2); text-decoration: underline; }
.mini-board-list .rating { font-variant-numeric: lining-nums tabular-nums; color: var(--text); }

.select-wrap { display: inline-grid; gap: 0.3rem; position: relative; }
.select-label { font-family: var(--font-display); font-size: 0.72rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--muted); }
:lang(ar) .select-label, :lang(ja) .select-label, :lang(zh-Hans) .select-label, :lang(zh-Hant) .select-label, :lang(ko) .select-label, :lang(hi) .select-label { font-size: 0.9rem; }
select {
  min-height: 42px;
  padding: 0.4rem 2.2rem 0.4rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(18, 13, 9, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23c9a45c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='m6.5 9.5 5.5 5.5 5.5-5.5'/%3E%3C/svg%3E") no-repeat right 0.6rem center / 1.1rem;
  color: var(--ivory);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
[dir="rtl"] select { padding: 0.4rem 0.8rem 0.4rem 2.2rem; background-position: left 0.6rem center; }
select:hover { border-color: var(--gold); }
select:disabled { opacity: 0.5; cursor: default; }
select option { background: #241a12; color: var(--ivory); }
.select-small select { min-height: 36px; font-size: 0.98rem; }

/* Download */
.section-download { border-top: 1px solid var(--line); background: radial-gradient(ellipse 70% 60% at 80% 30%, rgba(120, 82, 42, 0.16), transparent 70%); }
.download-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: clamp(2.5rem, 5vw, 5rem); align-items: start; }
@media (max-width: 960px) { .download-grid { grid-template-columns: minmax(0, 1fr); } }
.release-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-block: 1.8rem 1.4rem; }
.release-name { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.08em; color: var(--ivory); direction: ltr; }
.release-date { color: var(--muted); font-size: 0.98rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.12em 0.65em;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-2);
  white-space: nowrap;
}
:lang(ar) .badge, :lang(ja) .badge, :lang(zh-Hans) .badge, :lang(zh-Hant) .badge, :lang(ko) .badge, :lang(hi) .badge { font-size: 0.86rem; letter-spacing: 0; }
.badge .icon { width: 1.05em; height: 1.05em; }
.badge-accent { border-color: rgba(226, 196, 135, 0.6); background: rgba(201, 164, 92, 0.12); }
.badge-ok { color: var(--ok); border-color: rgba(143, 196, 106, 0.45); }
.badge-muted { color: var(--faint); border-color: var(--line); }
.badge-danger { color: var(--danger); border-color: rgba(212, 112, 95, 0.5); }

.requirements { display: grid; gap: 0; margin-top: 2.2rem; border-top: 1px solid var(--line); }
.requirements > div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.requirements dt { font-family: var(--font-display); font-size: 0.76rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold); padding-top: 0.2em; }
:lang(ar) .requirements dt, :lang(ja) .requirements dt, :lang(zh-Hans) .requirements dt, :lang(zh-Hant) .requirements dt, :lang(ko) .requirements dt, :lang(hi) .requirements dt { font-size: 0.95rem; }
.requirements dd { color: var(--text); }
@media (max-width: 520px) { .requirements > div { grid-template-columns: 1fr; gap: 0.2rem; } }

.platforms { list-style: none; display: grid; gap: 0.8rem; }
.platform {
  padding: 1.15rem 1.3rem;
  background: var(--card);
  border: 1px solid var(--wood);
  border-radius: var(--radius);
}
.platform.is-unavailable { background: rgba(30, 23, 17, 0.4); border-color: var(--line); }
.platform-head { display: flex; align-items: center; gap: 0.8rem; }
.platform-icon { width: 1.7rem; height: 1.7rem; color: var(--gold-2); }
.platform.is-unavailable .platform-icon { color: var(--faint); }
.platform-name { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.08em; flex: 1; }
.platform-files { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.9rem; }
.platform-files:empty { display: none; }
.platform.is-unavailable .platform-files { margin-top: 0.4rem; color: var(--faint); font-size: 0.98rem; }
.platform-note { margin-top: 0.8rem; color: var(--muted); font-size: 0.95rem; }
.platform-note[hidden] { display: none; }
.file-button { flex-direction: column; align-items: flex-start; gap: 0.15rem; min-height: 0; padding: 0.7rem 1rem; }
.file-button .file-size { font-family: var(--font-body); font-size: 0.88rem; font-weight: 400; letter-spacing: 0; text-transform: none; opacity: 0.85; }
.file-button-row { display: inline-flex; align-items: center; gap: 0.5rem; }

.verify { margin-top: 1.4rem; padding: 1.3rem; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.verify-title { display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.08em; color: var(--ivory); }
.verify-title .icon { color: var(--gold); }
.verify p { margin-top: 0.6rem; color: var(--muted); font-size: 1rem; }
.code-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
  background: #0c0906;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  direction: ltr;
}
.code-line code { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--gold-2); padding-block: 0.4rem; }
.verify-sums { margin-top: 0.9rem; }

/* Credits */
.section-credits { padding-block: clamp(4rem, 7vw, 6rem); border-top: 1px solid var(--line); }
.credits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1.6rem 2.2rem; margin-top: 2.6rem; }
.credits dt { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold); }
:lang(ar) .credits dt, :lang(ja) .credits dt, :lang(zh-Hans) .credits dt, :lang(zh-Hant) .credits dt, :lang(ko) .credits dt, :lang(hi) .credits dt { font-size: 0.98rem; }
.credits dd { margin-top: 0.5rem; color: var(--muted); font-size: 1rem; }
.quote { margin: 3.2rem auto 0; max-width: 34rem; text-align: center; }
.quote p { font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.7rem); color: var(--ivory); }
:lang(ar) .quote p, :lang(ja) .quote p, :lang(zh-Hans) .quote p, :lang(zh-Hant) .quote p, :lang(ko) .quote p, :lang(hi) .quote p { font-style: normal; }
.quote footer { margin-top: 0.6rem; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--gold); }

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

.site-footer { margin-top: auto; padding-block: 4rem 2rem; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(23, 17, 12, 0.6), #0d0a07); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.footer-brand .brand-icon { width: 44px; height: 44px; }
.footer-tagline { margin-top: 0.8rem; font-style: italic; color: #dccaa2; }
/* Only the home page uses the italic face elsewhere: the inner pages do not download it for one line. */
html:not([data-page="home"]) .footer-tagline { font-style: normal; }
/* The names of the languages in another script: system fonts, so that no page downloads a whole
   script subset for one word. */
:root:not(:lang(ru)):not(:lang(uk)):not(:lang(bg)):not(:lang(el)) :is(.lang-list, .lang-columns) a:is([lang="ru"], [lang="uk"], [lang="bg"], [lang="el"]) { font-family: Georgia, "Times New Roman", serif; }
:root:not(:lang(ar)) :is(.lang-list, .lang-columns) a[lang="ar"] { font-family: "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", "Arial", sans-serif; }
:lang(ar) .footer-tagline, :lang(ja) .footer-tagline, :lang(zh-Hans) .footer-tagline, :lang(zh-Hant) .footer-tagline, :lang(ko) .footer-tagline, :lang(hi) .footer-tagline { font-style: normal; }
.footer-text { margin-top: 0.7rem; font-size: 0.98rem; color: var(--faint); max-width: 22rem; }
.footer-head { font-family: var(--font-display); font-size: 0.74rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold); }
:lang(ar) .footer-head, :lang(ja) .footer-head, :lang(zh-Hans) .footer-head, :lang(zh-Hant) .footer-head, :lang(ko) .footer-head, :lang(hi) .footer-head { font-size: 0.95rem; }
.footer-col ul { list-style: none; display: grid; gap: 0.45rem; margin-top: 1rem; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 1rem; }
.footer-col a:hover { color: var(--ivory); text-decoration: underline; }
.footer-col a[aria-current] { color: var(--gold-2); }
.footer-langs { grid-column: 1 / -1; }
.lang-columns { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); column-gap: 1rem; }
.footer-credits { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: grid; gap: 0.5rem; font-size: 0.9rem; color: var(--faint); }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.footer-legal .diamond { width: 5px; height: 5px; background: var(--gold-3); }
.footer-legal a { color: var(--muted); }
.footer-legal a:hover { color: var(--ivory); }
@media (max-width: 1020px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-langs { grid-column: 1 / -1; }
  .lang-columns { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------------------------------------------------
   Inner pages */

.page-head {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 4vw, 3rem);
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}
.page-head-compact { padding-block: clamp(2.4rem, 5vw, 3.8rem) clamp(1.6rem, 3vw, 2.4rem); }
.page-head-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/hero-960.webp") center 45% / cover no-repeat;
  opacity: 0.4;
  filter: saturate(0.8) blur(1px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 100%);
}
.page-title {
  margin-top: 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  letter-spacing: 0.06em;
  line-height: 1.1;
}
.page-lead { margin-top: 0.9rem; max-width: 44rem; font-size: 1.18rem; color: var(--muted); }
.page-body { padding-block: clamp(2rem, 4vw, 3rem) clamp(4rem, 8vw, 6rem); }

/* Legal notice, privacy and terms */
.legal-updated { margin-top: 0.8rem; font-size: 0.95rem; color: var(--faint); }
.legal-body { display: grid; grid-template-columns: 13rem minmax(0, 46rem); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.legal-toc { position: sticky; top: calc(var(--header-h) + 1.5rem); display: grid; gap: 0.2rem; padding-inline-start: 1rem; border-inline-start: 1px solid var(--line-2); }
.legal-toc a { padding: 0.3rem 0; color: var(--muted); text-decoration: none; font-family: var(--font-display); font-size: 0.82rem; letter-spacing: var(--track); text-transform: uppercase; }
:lang(ar) .legal-toc a, :lang(ja) .legal-toc a, :lang(zh-Hans) .legal-toc a, :lang(zh-Hant) .legal-toc a, :lang(ko) .legal-toc a, :lang(hi) .legal-toc a { font-size: 1rem; letter-spacing: 0.02em; }
.legal-toc a:hover { color: var(--ivory); }
.legal section + section { margin-top: clamp(2.5rem, 5vw, 3.5rem); padding-top: clamp(2rem, 4vw, 2.8rem); border-top: 1px solid var(--line); }
.legal section { scroll-margin-top: calc(var(--header-h) + 1rem); }
.legal-title { font-family: var(--font-display); font-size: clamp(1.5rem, 2.8vw, 2rem); letter-spacing: 0.06em; color: var(--ivory); }
.legal-subtitle { margin-top: 1.8rem; font-family: var(--font-display); font-size: 1.02rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold); }
:lang(ar) .legal-subtitle, :lang(ja) .legal-subtitle, :lang(zh-Hans) .legal-subtitle, :lang(zh-Hant) .legal-subtitle, :lang(ko) .legal-subtitle, :lang(hi) .legal-subtitle { font-size: 1.2rem; letter-spacing: 0.02em; }
.legal p, .legal-list { margin-top: 0.9rem; color: var(--text); }
.legal-title + p { margin-top: 1.1rem; }
.legal-list { display: grid; gap: 0.55rem; padding-inline-start: 1.2rem; }
.legal-list li::marker { color: var(--gold-3); }
.legal strong { color: var(--ivory); font-weight: 600; }
.legal-facts { display: grid; margin-top: 1.4rem; border-top: 1px solid var(--line); }
.legal-facts > div { display: grid; grid-template-columns: 12rem 1fr; gap: 1rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); }
.legal-facts dt { padding-top: 0.2em; font-family: var(--font-display); font-size: 0.76rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold); }
:lang(ar) .legal-facts dt, :lang(ja) .legal-facts dt, :lang(zh-Hans) .legal-facts dt, :lang(zh-Hant) .legal-facts dt, :lang(ko) .legal-facts dt, :lang(hi) .legal-facts dt { font-size: 0.95rem; letter-spacing: 0.02em; }
.legal-facts dd { color: var(--text); overflow-wrap: anywhere; }
.legal-version { margin-top: clamp(2.5rem, 5vw, 3.5rem); font-size: 0.95rem; color: var(--faint); }
@media (max-width: 900px) {
  .legal-body { grid-template-columns: minmax(0, 1fr); }
  .legal-toc { position: static; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; padding: 0 0 1rem; border-inline-start: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) { .legal-facts > div { grid-template-columns: 1fr; gap: 0.25rem; } }

.panel { padding: clamp(1.2rem, 2.5vw, 1.8rem); }
.panel + .panel, .panel + section, section + .panel { margin-top: 1.2rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.5rem; }
.panel-note { margin-top: 0.5rem; color: var(--muted); font-size: 1rem; }
.panel-danger { border-color: rgba(168, 69, 60, 0.6); background: linear-gradient(180deg, rgba(60, 24, 18, 0.55), rgba(34, 25, 17, 0.9)); }
.block-title {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ivory);
}
:lang(ar) .block-title, :lang(ja) .block-title, :lang(zh-Hans) .block-title, :lang(zh-Hant) .block-title, :lang(ko) .block-title, :lang(hi) .block-title { font-size: 1.2rem; letter-spacing: 0.02em; }
.block-title .icon { color: var(--gold); }

.notice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(201, 164, 92, 0.07);
  color: var(--text);
}
.notice + * { margin-top: 1.2rem; }
.notice-warning { border-color: rgba(226, 196, 135, 0.5); }
.notice-danger { border-color: var(--danger-line); background: var(--danger-bg); color: #f0c8bd; }
.notice .icon { margin-top: 0.2em; }

.placeholder { color: var(--faint); }

.spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(201, 164, 92, 0.25);
  border-top-color: var(--gold-2);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 0.9rem; min-height: 14rem; color: var(--muted); }
.account-body { min-height: calc(100svh - var(--header-h)); }

.back-link { display: inline-flex; align-items: center; gap: 0.5em; margin-bottom: 1.2rem; font-family: var(--font-display); font-size: 0.78rem; letter-spacing: var(--track); text-transform: uppercase; text-decoration: none; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 0.85rem 1.1rem;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
:lang(ar) .tab, :lang(ja) .tab, :lang(zh-Hans) .tab, :lang(zh-Hant) .tab, :lang(ko) .tab, :lang(hi) .tab { font-size: 1rem; }
.tab:hover { color: var(--ivory); }
.tab:focus-visible { outline-offset: -4px; }
.tab[aria-selected="true"] { color: var(--gold-2); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 0.8rem;
  bottom: -1px;
  height: 2px;
  background: var(--gold);
}

.segmented { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.segmented button {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-variant-numeric: lining-nums;
  direction: ltr;
}
.segmented button:hover { border-color: var(--gold); color: var(--ivory); }
.segmented button[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }

/* Forms */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.05rem; }
.form-title { display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--font-display); font-size: 1.45rem; letter-spacing: 0.05em; }
.form-title .icon { color: var(--gold); }
.form-text { color: var(--muted); }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 1rem; color: #dcd0b8; }
.hint { font-size: 0.92rem; color: var(--faint); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--paper-ink);
  font-size: 1.05rem;
  transition: box-shadow 0.15s;
}
input[type="text"]:focus-visible, input[type="email"]:focus-visible, input[type="password"]:focus-visible, input[type="search"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
input::placeholder { color: #6e5d43; }
.input-with-button { position: relative; }
.input-with-button input { padding-inline-end: 3rem; }
.reveal {
  position: absolute;
  inset-inline-end: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #6d5a3d;
}
.reveal:hover { color: var(--paper-ink); background: rgba(0, 0, 0, 0.05); }
.reveal[aria-pressed="true"] { color: #9a6d1f; }
.check { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; color: var(--text); font-size: 1rem; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.form-error, .form-success {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.form-error { background: var(--danger-bg); border: 1px solid var(--danger-line); color: #f0c8bd; }
.form-success { background: var(--ok-bg); border: 1px solid var(--ok-line); color: #d8ebc4; }
.form-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1.4rem; font-size: 0.98rem; }
.form-note { display: flex; gap: 0.55rem; align-items: flex-start; font-size: 0.94rem; color: var(--faint); }
.form-note .icon { margin-top: 0.25em; color: var(--gold-3); }
.form-done { display: grid; gap: 0.9rem; text-align: center; justify-items: center; outline: none; }
.done-icon { width: 3rem; height: 3rem; color: var(--gold-2); }
.progress { height: 4px; border-radius: 4px; background: rgba(201, 164, 92, 0.18); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 30%; background: var(--gold); border-radius: 4px; animation: indeterminate 1.3s var(--ease) infinite; }
@keyframes indeterminate {
  from { transform: translateX(-100%); }
  to { transform: translateX(340%); }
}
[dir="rtl"] .progress-bar { animation-direction: reverse; }

.switch { display: inline-flex; align-items: center; gap: 0.8rem; margin-top: 1rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 46px; height: 26px; border-radius: 13px; background: #3a2e22; border: 1px solid var(--line-2); transition: background 0.2s; flex: none; }
.switch-thumb { position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform 0.2s var(--ease), background 0.2s; }
.switch input:checked + .switch-track { background: var(--gold-3); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); background: var(--ivory); }
[dir="rtl"] .switch input:checked + .switch-track .switch-thumb { transform: translateX(-20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: 0.5; }

/* Auth */
.auth { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.auth-card { width: min(100%, 470px); padding: clamp(1.4rem, 4vw, 2.2rem); }
.auth-tabs { margin-block: 1rem 1.5rem; }
.auth-tabs .tab { flex: 1; white-space: normal; text-align: center; line-height: 1.3; }
.auth-panel { display: grid; grid-template-columns: minmax(0, 1fr); }
.auth-foot { margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: 0.92rem; color: var(--faint); text-align: center; }
/* Sign in with Google: Google's dark button (its colours, its "G", a plain sans-serif face) in the
   shape of the site's buttons, under an "or" rule. */
.sso { display: grid; gap: 1.05rem; }
.sso-or { display: flex; align-items: center; gap: 0.9rem; font-family: var(--font-display); font-size: 0.74rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--faint); }
.sso-or::before, .sso-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
:lang(ar) .sso-or, :lang(ja) .sso-or, :lang(zh-Hans) .sso-or, :lang(zh-Hant) .sso-or, :lang(ko) .sso-or, :lang(hi) .sso-or { font-size: 0.92rem; letter-spacing: 0; }
.btn-google {
  gap: 12px;
  color: #e3e3e3;
  background: #131314;
  border-color: #8e918f;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
}
:lang(ar) .btn-google, :lang(ja) .btn-google, :lang(zh-Hans) .btn-google, :lang(zh-Hant) .btn-google, :lang(ko) .btn-google, :lang(hi) .btn-google { font-size: 0.95rem; font-weight: 500; }
.btn-google:hover { color: #e3e3e3; background: #262628; border-color: #c4c7c5; }
.btn-google .google-mark { width: 20px; height: 20px; flex: none; }
.btn-google.is-busy .google-mark { visibility: hidden; }
.btn-google.is-busy::after { border-color: #e3e3e3 #e3e3e3 transparent transparent; }

/* Dashboard */
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 1.4rem; margin-bottom: 1.6rem; }
.medallion {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 18px;
  background: radial-gradient(circle at 35% 30%, #3b3326, #191612 70%);
  border: 1px solid #b89b6a;
  box-shadow: inset 0 0 0 3px rgba(18, 13, 9, 0.8), inset 0 0 0 4px rgba(201, 164, 92, 0.35), var(--shadow-soft);
  font-family: "Scacelith Cinzel", var(--font-display);
  font-size: 2.1rem;
  color: var(--ivory);
  text-transform: uppercase;
}
.profile-ident { flex: 1; min-width: min(100%, 14rem); }
.profile-name { font-family: var(--font-body); font-size: clamp(1.7rem, 3.5vw, 2.3rem); letter-spacing: 0.01em; overflow-wrap: anywhere; direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .profile-name { text-align: right; }
.profile-sub { color: var(--muted); }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
/* Each badge a flex item: one that starts with text sits on the same line as one that starts with an icon. */
.badges > li { display: flex; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.dash-tabs { margin-bottom: 1.6rem; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 1.2rem; }
.overview-grid > .panel + .panel { margin-top: 0; }
.overview-grid + .panel { margin-top: 1.2rem; }
@media (max-width: 900px) { .overview-grid { grid-template-columns: minmax(0, 1fr); } }
.facts { display: grid; margin-top: 1rem; }
.facts > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { color: var(--ivory); text-align: end; overflow-wrap: anywhere; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; align-items: start; }
.settings-grid > .panel { margin-top: 0; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
.sanctions { list-style: none; display: grid; gap: 0.5rem; margin-top: 0.9rem; }
.sanctions li { padding: 0.7rem 0.9rem; border: 1px solid var(--danger-line); border-radius: var(--radius-sm); background: var(--danger-bg); color: #f0c8bd; }

/* Ratings */
.ratings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 0.8rem; margin-top: 1rem; }
.ratings-empty { grid-column: 1 / -1; color: var(--faint); }
.rating-card { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(18, 13, 9, 0.35); }
.rating-cat { font-family: "Scacelith Cinzel", serif; font-size: 0.92rem; letter-spacing: 0.08em; color: var(--gold); direction: ltr; display: inline-block; }
.rating-value { margin-top: 0.15rem; font-family: var(--font-body); font-size: 2.2rem; line-height: 1.15; font-variant-numeric: lining-nums tabular-nums; color: var(--ivory); direction: ltr; }
.rating-value .provisional { color: var(--gold-2); }
.rating-meta { display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.92rem; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.wdl-bar { display: flex; height: 5px; margin-top: 0.7rem; border-radius: 3px; overflow: hidden; background: rgba(201, 164, 92, 0.12); }
.wdl-bar span { display: block; height: 100%; }
.wdl-bar .w { background: var(--win); }
.wdl-bar .d { background: var(--draw); opacity: 0.6; }
.wdl-bar .l { background: var(--loss); }
.wdl-text { margin-top: 0.4rem; font-size: 0.9rem; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.wdl-text .w { color: var(--win); }
.wdl-text .l { color: var(--loss); }
.ratings-hint { grid-column: 1 / -1; margin-top: 0.2rem; font-size: 0.9rem; color: var(--faint); }

/* Games list */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 0.9rem 1.1rem; margin-bottom: 1.2rem; }
.filters-total { margin-inline-start: auto; color: var(--muted); font-variant-numeric: lining-nums; }
.games { list-style: none; display: grid; gap: 0.7rem; }
.game {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8.5rem, 0.8fr) minmax(0, 2.2fr) minmax(9rem, 1fr) auto;
  grid-template-areas: "outcome players meta actions";
  align-items: center;
  gap: 0.8rem 1.4rem;
  padding: 1rem 1.2rem 1rem 1.45rem;
  background: linear-gradient(180deg, rgba(42, 32, 23, 0.7), rgba(30, 23, 17, 0.55));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
[dir="rtl"] .game { padding: 1rem 1.45rem 1rem 1.2rem; }
.game::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--aborted);
}
.game.is-win::before { background: var(--win); }
.game.is-loss::before { background: var(--loss); }
.game.is-draw::before { background: var(--draw); }
.game-outcome { grid-area: outcome; display: grid; gap: 0.15rem; }
.outcome-label { font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; }
:lang(ar) .outcome-label, :lang(ja) .outcome-label, :lang(zh-Hans) .outcome-label, :lang(zh-Hant) .outcome-label, :lang(ko) .outcome-label, :lang(hi) .outcome-label { font-size: 1.1rem; letter-spacing: 0; }
.is-win .outcome-label { color: var(--win); }
.is-loss .outcome-label { color: var(--loss); }
.is-draw .outcome-label { color: var(--draw); }
.is-aborted .outcome-label { color: var(--aborted); }
.outcome-reason { font-size: 0.95rem; color: var(--muted); line-height: 1.35; }
.game-players { grid-area: players; display: grid; gap: 0.3rem; min-width: 0; }
.player-line { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto 1.6rem; align-items: center; gap: 0.6rem; }
.player-piece {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  font-size: 0.95rem;
  background: linear-gradient(180deg, #fbf4e3, #ddd0b4);
  color: #2a2017;
  box-shadow: inset 0 0 0 1px #b89b6a;
}
.player-piece .piece { transform: translateY(-0.04em); }
.player-line.is-black .player-piece {
  background: linear-gradient(180deg, #2b241c, #0d0a07);
  color: var(--ivory);
  box-shadow: inset 0 0 0 1px var(--gold-3);
}
.player-name { display: inline-flex; align-items: baseline; gap: 0.45rem; min-width: 0; color: var(--text); }
.player-name a, .player-name span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.player-name a { color: var(--text); text-decoration: none; }
.player-name a:hover { color: var(--gold-2); text-decoration: underline; }
.player-line.is-me .player-name a, .player-line.is-me .player-name span.name { color: var(--ivory); }
.me-tag { flex: none; padding: 0 0.4em; border: 1px solid var(--line-2); border-radius: 4px; font-size: 0.74rem; color: var(--gold-2); line-height: 1.5; }
.player-rating { font-size: 0.95rem; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.diff-up { color: var(--win); }
.diff-down { color: var(--loss); }
.player-score { font-family: var(--font-body); text-align: center; font-size: 1.1rem; color: var(--faint); font-variant-numeric: lining-nums; }
.player-line.is-winner .player-score { color: var(--gold-2); }
.game-meta { grid-area: meta; display: grid; gap: 0.1rem; font-size: 0.95rem; color: var(--muted); }
.game-meta .meta-cat { color: var(--text); font-variant-numeric: lining-nums; }
.game-meta time { font-variant-numeric: lining-nums; }
.game-actions { grid-area: actions; display: flex; gap: 0.4rem; justify-content: flex-end; }
.action {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: rgba(18, 13, 9, 0.4);
  color: var(--gold-2);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
:lang(ar) .action, :lang(ja) .action, :lang(zh-Hans) .action, :lang(zh-Hant) .action, :lang(ko) .action, :lang(hi) .action { font-size: 0.9rem; letter-spacing: 0; }
.action:hover { border-color: var(--gold); color: var(--ivory); background: rgba(201, 164, 92, 0.1); }
.action .icon { width: 1.1rem; height: 1.1rem; }
.action.is-busy { opacity: 0.6; pointer-events: none; }
.action.is-done { color: var(--ok); border-color: var(--ok-line); }
.action.is-signin { color: var(--muted); border-style: dashed; }
.list-foot { display: grid; justify-items: center; gap: 0.6rem; margin-top: 1.2rem; color: var(--faint); }
.empty { padding: 2.2rem 1rem; text-align: center; color: var(--faint); border: 1px dashed var(--line); border-radius: var(--radius-sm); }

@media (max-width: 1100px) {
  .game {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "outcome meta"
      "players players"
      "actions actions";
  }
  .game-meta { text-align: end; }
  .game-actions { justify-content: flex-start; }
}
@media (max-width: 520px) {
  .game { grid-template-areas: "outcome" "players" "meta" "actions"; grid-template-columns: minmax(0, 1fr); padding-inline-start: 1.2rem; }
  .game-meta { text-align: start; }
  .player-line { grid-template-columns: 1.4rem minmax(0, 1fr) auto 1.4rem; gap: 0.45rem; }
  .game-actions { flex-wrap: wrap; }   /* long labels (de, ru...) take a second row rather than overflow */
  .game-actions .action { flex: 1; justify-content: center; }
}

/* Devices */
.devices { list-style: none; display: grid; gap: 0.6rem; margin-top: 1.1rem; }
.device {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(18, 13, 9, 0.35);
}
.device.is-current { border-color: var(--line-2); }
.device > .icon { width: 1.6rem; height: 1.6rem; color: var(--gold); }
.device-name { color: var(--ivory); display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; overflow-wrap: anywhere; }
.device-meta { font-size: 0.92rem; color: var(--muted); }
@media (max-width: 520px) { .device { grid-template-columns: auto minmax(0, 1fr); } .device .btn { grid-column: 1 / -1; } }

/* Players page */
.players-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
.search-bar {
  position: relative;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  max-width: 36rem;
}
.search-bar input { flex: 1; min-width: 0; padding-inline-start: 2.6rem; }
.search-icon { position: absolute; inset-inline-start: 0.85rem; top: 50%; transform: translateY(-50%); color: #6d5a3d; width: 1.2rem; height: 1.2rem; pointer-events: none; }
.search-bar .btn { min-height: 46px; }
.leaderboard .panel-head { margin-bottom: 0.4rem; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
.board-table { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
.board-table th { padding: 0.6rem 0.8rem; text-align: start; font-family: var(--font-display); font-size: 0.72rem; font-weight: 400; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
:lang(ar) .board-table th, :lang(ja) .board-table th, :lang(zh-Hans) .board-table th, :lang(zh-Hant) .board-table th, :lang(ko) .board-table th, :lang(hi) .board-table th { font-size: 0.92rem; letter-spacing: 0; }
.board-table td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); }
.board-table .num { text-align: end; }
.board-table tbody tr:hover { background: rgba(201, 164, 92, 0.05); }
.board-table a { color: var(--ivory); text-decoration: none; direction: ltr; unicode-bidi: isolate; }
.board-table a:hover { color: var(--gold-2); text-decoration: underline; }
.board-table .placeholder { text-align: center; padding: 2rem; }
.rank-cell { color: var(--muted); }
.rank-1 .rank-cell, .rank-2 .rank-cell, .rank-3 .rank-cell { color: var(--gold-2); }
.rank-1 .rank-cell::before, .rank-2 .rank-cell::before, .rank-3 .rank-cell::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 0.55rem;
  background: currentColor;
  transform: rotate(45deg);
  vertical-align: 0.15em;
}
.rank-2 .rank-cell { color: #d8d2c4; }
.rank-3 .rank-cell { color: #c8956a; }
.wdl-col { white-space: nowrap; }
/* The player column takes the room left by the numbers, and a long name ends in an ellipsis. */
.board-table .player-cell { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) {
  .board-table .hide-sm { display: none; }
  .board-table th, .board-table td { padding-inline: 0.45rem; }
  .board-table th { letter-spacing: 0.06em; }
  /* Han and kana headers may break between any two characters; Latin ones keep their line. */
  :lang(ja) .board-table th, :lang(zh-Hans) .board-table th, :lang(zh-Hant) .board-table th, :lang(ko) .board-table th, :lang(hi) .board-table th { white-space: normal; }
}
@media (max-width: 480px) {
  .board-table .hide-xs { display: none; }
}
.profile .ratings { margin-top: 0; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; }
.profile-stats div { display: grid; text-align: center; }
.profile-stats dt { font-size: 0.85rem; color: var(--muted); }
.profile-stats dd { font-family: var(--font-body); font-size: 1.6rem; color: var(--ivory); font-variant-numeric: lining-nums; }
.games-section { margin-top: 1.8rem; }
.games-section .block-title { margin-bottom: 1rem; }

/* GIF page */
.gif-body { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.gif-card { width: min(100%, 760px); padding: clamp(1.4rem, 4vw, 2.2rem); }
.gif-title { margin-top: 0.7rem; font-family: var(--font-body); font-size: clamp(1.5rem, 3.2vw, 2.1rem); overflow-wrap: anywhere; }
.gif-players { margin-top: 0.3rem; color: var(--muted); }
.gif-stage {
  display: grid;
  place-items: center;
  min-height: 22rem;
  margin-top: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    repeating-conic-gradient(rgba(201, 164, 92, 0.05) 0% 25%, transparent 0% 50%) 50% / 48px 48px,
    #100c08;
}
.gif-status { display: grid; justify-items: center; gap: 0.9rem; text-align: center; color: var(--muted); max-width: 28rem; }
.gif-status.is-error { color: #f0c8bd; }
.gif-image { max-width: 100%; height: auto; image-rendering: auto; box-shadow: var(--shadow); }
.gif-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.3rem; }
.gif-options-box { margin-top: 1.3rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.gif-options-box summary { cursor: pointer; font-family: var(--font-display); font-size: 0.8rem; letter-spacing: var(--track); text-transform: uppercase; color: var(--gold-2); }
.gif-options { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-top: 1rem; }
.gif-note { margin-top: 1.2rem; }

/* Toasts */
.toasts {
  position: fixed;
  z-index: 90;
  inset-inline: 0;
  bottom: 1.2rem;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding-inline: 1rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: min(34rem, 100%);
  padding: 0.75rem 1.1rem;
  background: #2b2118;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: var(--ivory);
  pointer-events: auto;
  animation: toast-in 0.2s var(--ease);
}
.toast .icon { color: var(--gold-2); }
.toast > span { min-width: 0; overflow-wrap: anywhere; }
.toast.is-error { border-color: var(--danger-line); }
.toast.is-error .icon { color: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Language chooser (site root) and 404 */
.chooser-page { min-height: 100vh; }
.chooser {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem var(--gutter);
  isolation: isolate;
}
.chooser-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at center, rgba(18, 13, 9, 0.55), rgba(18, 13, 9, 0.95) 75%),
    url("../img/hero.webp") center / cover no-repeat;
}
.chooser-card {
  width: min(100%, 900px);
  padding: clamp(1.6rem, 5vw, 3rem);
  text-align: center;
  background: rgba(30, 22, 15, 0.82);
  border: 1px solid var(--wood);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.chooser-logo { width: 88px; height: 88px; margin-inline: auto; }
.chooser-title { margin-top: 1rem; font-family: "Scacelith Cinzel", serif; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: 0.2em; margin-inline-end: -0.2em; text-transform: uppercase; }
.chooser-title-small { font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: 0.08em; margin-inline-end: 0; text-transform: none; }
.chooser-code { margin-top: 0.8rem; font-family: "Scacelith Cinzel", serif; font-size: 0.9rem; letter-spacing: 0.3em; color: var(--gold); }
.chooser .ornament-rule { margin-inline: auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.chooser .ornament-rule .diamond { inset-inline-start: 50%; margin-inline-start: -3.5px; }
.chooser-lead { color: var(--muted); margin-bottom: 1.4rem; }
.chooser-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 1.4rem; text-align: start; }
.chooser-list a {
  display: grid;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(18, 13, 9, 0.45);
  color: var(--ivory);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.chooser-list a:hover, .chooser-list a:focus-visible { border-color: var(--gold); background: rgba(201, 164, 92, 0.08); }
.chooser-list a.is-suggested { border-color: var(--gold); }
.chooser-name { font-size: 1.1rem; }
.chooser-tagline { font-size: 0.92rem; font-style: italic; color: var(--muted); }
.chooser-list-compact { margin-top: 2rem; }
@media (max-width: 760px) { .chooser-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .chooser-list { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------------------------
   Motion preferences */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .spinner, .btn.is-busy::after { animation-duration: 1.6s !important; animation-iteration-count: infinite !important; }
}

@media print {
  .site-header, .site-footer, .toasts, .hero-media, .video { display: none !important; }
  body { background: #fff; color: #000; }
}
