/* ===== Kickwise: shared styles ===== */

/* Our own copies of the fonts (SIL Open Font License, see assets/fonts/OFL-*.txt) */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 700 900; font-display: swap;
  src: url("fonts/bigshoulders-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 700 900; font-display: swap;
  src: url("fonts/bigshoulders-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Russian (Cyrillic) headings: Oswald, under the same family name, so it only loads for Cyrillic letters.
   Arabic: Cairo for headings and text. Both SIL Open Font License (assets/fonts/OFL-*.txt). */
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 700 900; font-display: swap;
  src: url("fonts/oswald-cyrillic-700.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Big Shoulders Display"; font-style: normal; font-weight: 700 900; font-display: swap;
  src: url("fonts/cairo-arabic-900.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("fonts/cairo-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 700 900; font-display: swap;
  src: url("fonts/cairo-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --bg: #0b120e;
  --bg-2: #0f1813;
  --surface: #14201a;
  --surface-2: #1a2a21;
  --line: rgba(232, 243, 236, 0.10);
  --line-strong: rgba(232, 243, 236, 0.22);
  --text: #eaf2ec;
  --muted: #93a89a;
  --accent: #d4ff3a;        /* floodlight yellow-green */
  --accent-ink: #0b120e;
  --chalk: #f4f7f2;
  --ok: #4fe38a;
  --bad: #ff6a55;
  --warn: #ffc24a;
  --radius: 14px;
  --radius-sm: 9px;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the hidden attribute must win over .btn / .empty display rules */
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
/* Browser surfaces in our colours */
::selection { background: var(--accent); color: var(--accent-ink); }
input, textarea { caret-color: var(--accent); }
html { color-scheme: dark; scrollbar-color: var(--line-strong) var(--bg); }
strong, .scorebox strong, .tabular { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 900; font-size: 26px;
  letter-spacing: 0.02em; text-decoration: none; text-transform: uppercase;
}
.logo-mark {
  width: 30px; height: 30px; flex: none;
  transform: translateY(-.11em);   /* the mark's K stands on the same line as the letters (its dot rises above them) */
  background: var(--accent);
  -webkit-mask: url("brand/kickwise-mark.svg") center / contain no-repeat;
  mask: url("brand/kickwise-mark.svg") center / contain no-repeat;
}
.logo span { color: var(--accent); }
/* ".io" right after the name, so nobody types kickwise.com by habit */
.logo b { display: inline-flex; align-items: baseline; }
.logo .tld { font-family: var(--body); font-size: 14px; font-weight: 700; letter-spacing: 0; text-transform: lowercase;
  color: var(--muted); margin-left: 1px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 600; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-links .dot-new { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; }
/* Phones: the main links move to a tab bar at the bottom of the screen */
@media (max-width: 720px) {
  /* a backdrop-filter on the header would trap the fixed tab bar inside it */
  .nav { backdrop-filter: none; background: var(--bg); }
  .nav .wrap { gap: 10px; height: 58px; }
  .nav-links {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; gap: 0;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line-strong);
  }
  .nav-links a { justify-content: center; height: 44px; padding: 0 4px; font-size: 13.5px; border-radius: 10px; }
  .nav-links a[aria-current="page"] { color: var(--accent); background: transparent; }
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .nav .coin-badge { margin-left: auto; }
  .logo { font-size: 23px; gap: 8px; }
  .logo-mark { width: 26px; height: 26px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--text); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 78%, white); border-color: color-mix(in srgb, var(--accent) 78%, white); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Type ---------- */
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.display {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  line-height: 0.92; letter-spacing: 0.005em; margin: 0;
}
h2.display { font-size: clamp(38px, 5vw, 60px); }
.lead { color: var(--muted); font-size: 18px; max-width: 54ch; }

/* Player initials badge (games) */
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 16px;
  background: var(--chalk); color: var(--bg);
}
.lead { color: var(--muted); font-size: 18px; max-width: 54ch; }

/* ---------- Sections ---------- */
section.block { padding: 96px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head p { margin: 0; }

/* ---------- Chips (filters, tabs) ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

/* ================= Game pages ================= */
.game-hero { border-bottom: 1px solid var(--line); padding: 44px 0 36px; }
.crumb { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 22px; }
.crumb:hover { color: var(--text); }
.game-hero h1 { font-size: clamp(48px, 7vw, 88px); margin: 10px 0 14px; }
.game-hero .row { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.game-hero .meta-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }

/* Compact game header: icon tile, name, one-line goal, How to play. The game itself starts right below. */
.game-top { border-bottom: 1px solid var(--line); padding: 14px 0 18px; }
.game-top .crumb { margin-bottom: 12px; }
.crumb .kw-ico { width: 15px; height: 15px; }
.gt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; }
.gt > .g-icon { width: 60px; height: 60px; border-radius: 16px; grid-row: 1 / span 2; }
.gt h1 { font-size: clamp(36px, 4.4vw, 54px); line-height: .92; align-self: end; }
.gt-goal { margin: 0; font-size: 17px; line-height: 1.4; color: var(--text); max-width: 56ch; align-self: start; }
.gt-actions { grid-column: 3; grid-row: 1 / span 2; display: flex; gap: 8px; }
.gt-actions .kw-ico { width: 17px; height: 17px; }
@media (max-width: 720px) {
  .game-top { padding: 10px 0 14px; }
  .game-top .crumb { margin-bottom: 8px; }
  .gt { grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; }
  .gt > .g-icon { width: 46px; height: 46px; border-radius: 12px; grid-row: 1; }
  .gt h1 { font-size: 32px; align-self: center; }
  .gt-goal { grid-column: 1 / -1; font-size: 15.5px; margin-top: 8px; }
  .gt-actions { grid-column: 3; grid-row: 1; }
  .gt-actions .btn span { display: none; }                 /* phones: icon-only buttons */
  .gt-actions .btn { width: 40px; padding: 0; }
}

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-block: 24px 96px; align-items: start; }
@media (max-width: 920px) {
  /* Phones and tablets: the score sits as a slim bar above the game, everything else after it */
  .game-layout { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
  .game-layout > main { order: 1; width: 100%; }
  .game-layout > .side { display: contents; }
  .game-layout > .side > * { order: 2; }
  .game-layout > .side > .score-panel { order: 0; }
  .score-panel { padding: 10px 12px; }
  .score-panel h2 { display: none; }
  .score-panel .scorebox div { padding: 6px 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
  .score-panel .scorebox strong { font-size: 22px; }
}

/* Game icon tile: the game's own colour, used the same everywhere */
.g-icon { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--g, var(--accent)); color: #0b120e; }
.g-icon .kw-ico { width: 56%; height: 56%; }
.kw-ico { width: 1.1em; height: 1.1em; flex: none; }

/* How to play: a dialog that opens on the first visit and from the "How to play" button */
.howto { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line-strong);
  border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
.howto::backdrop { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(3px); }
.howto form { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.howto-head { display: flex; gap: 14px; align-items: center; }
.howto-head .g-icon { width: 52px; height: 52px; border-radius: 14px; }
.howto-head h2 { font-family: var(--display); font-size: 38px; font-weight: 900; text-transform: uppercase; margin: 0; line-height: .92; }
.howto-head p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.howto-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.howto-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; counter-increment: step; }
.howto-steps li::before { content: counter(step); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent); font-family: var(--display); font-weight: 900; font-size: 18px; }
.howto-steps b { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.howto-steps span { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.45; margin-top: 2px; }
.howto-score { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--bg-2); font-size: 14px; color: var(--muted); }
.howto-score b { color: var(--text); font-weight: 600; }
.howto .btn-primary { height: 52px; font-size: 16px; }
.howto-note { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.quests-none { margin: 0; font-size: 14px; color: var(--muted); }
.quests-none a { color: var(--text); }
.linklike { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.linklike:hover { color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  .howto[open] { animation: howto-in .32s cubic-bezier(.16, 1, .3, 1); }
  .howto[open]::backdrop { animation: fade-in .25s ease-out; }
}
@keyframes howto-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }

/* "More games" rows in the sidebar */
.mg-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0;
  border-top: 1px solid var(--line); text-decoration: none; }
.mg-row:first-child { border-top: 0; padding-top: 0; }
.mg-row .g-icon { width: 40px; height: 40px; border-radius: 11px; }
.mg-row b { display: block; font-size: 15px; font-weight: 600; line-height: 1.25; transition: color .15s; }
.mg-row small { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; }
.mg-row:hover b { color: var(--accent); }

/* Result actions on a game's final screen */
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.result-actions .kw-ico { width: 18px; height: 18px; }

/* Small toast for "Copied" (assets/share.js) */
.kw-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 70; transform: translate(-50%, 16px);
  padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14.5px; font-weight: 600;
  box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .7); opacity: 0; pointer-events: none; transition: opacity .2s, transform .3s cubic-bezier(.16, 1, .3, 1); }
.kw-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) { .kw-toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel h2 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; font-weight: 700; }
.rules ol { margin: 0; padding-left: 20px; color: var(--muted); }
.rules li + li { margin-top: 8px; }
.rules li::marker { color: var(--accent); font-weight: 700; }
.side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 84px; }
@media (max-width: 920px) { .side { position: static; } }
.next-games a { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.next-games a:hover { color: var(--accent); }
.next-games a small { color: var(--muted); font-weight: 500; }

.scorebox { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.scorebox div { background: var(--bg-2); border-radius: var(--radius-sm); padding: 12px; }
.scorebox small { display: block; color: var(--muted); font-size: 12px; }
.scorebox strong { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1.1; }

.toast { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; display: none; }
.toast.show { display: block; }
.toast.ok { background: rgba(79,227,138,.12); color: var(--ok); border: 1px solid rgba(79,227,138,.3); }
.toast.bad { background: rgba(255,106,85,.1); color: var(--bad); border: 1px solid rgba(255,106,85,.3); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Difficulty (knowledge level): one quiet segmented row, the game stays the brightest thing ---------- */
.levelbar { margin-bottom: 14px; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.lvl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lvl-head span { font-size: 14px; font-weight: 600; color: var(--text); }
.lvl-head small { font-size: 13px; color: var(--muted); }
.lvl-row { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.lvl {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.lvl:hover { color: var(--text); }
.lvl b { font-size: 14px; font-weight: 600; }
.lvl small { display: none; }
.lvl-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.lvl-bars i { width: 3px; border-radius: 1px; background: var(--line-strong); }
.lvl-bars i:nth-child(1) { height: 5px; } .lvl-bars i:nth-child(2) { height: 7px; }
.lvl-bars i:nth-child(3) { height: 9px; } .lvl-bars i:nth-child(4) { height: 12px; }
.lvl-bars i.on { background: currentColor; }
.lvl[aria-checked="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.lvl[aria-checked="true"] .lvl-bars i.on { background: var(--accent); }
@media (max-width: 520px) {
  .levelbar { gap: 8px; }
  .lvl-row { display: flex; width: 100%; }
  .lvl { flex: 1; justify-content: center; padding: 0 6px; gap: 5px; }
  .lvl b { font-size: 13px; }
}

/* ---------- Coins & daily quests ---------- */
.coin {
  display: inline-block; flex: none; width: 18px; height: 18px; vertical-align: -3px;
  background: url("brand/coin-football.webp") center / contain no-repeat;
}
.coin-badge {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-2); text-decoration: none;
  font-family: var(--display); font-weight: 800; font-size: 19px; transition: border-color .15s;
}
.coin-badge:hover { border-color: #ffd23f; }
.nav .coin-badge + .btn { margin-left: -16px; }

/* ---------- Language picker, top right of every page (assets/lang.js) ---------- */
.lang-pick { position: relative; flex: none; }
.nav .btn + .lang-pick, .nav .coin-badge + .lang-pick { margin-left: -16px; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 9px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  font-size: 13px; font-weight: 700; letter-spacing: .05em; cursor: pointer; transition: border-color .15s;
}
.lang-btn:hover, .lang-btn[aria-expanded="true"] { border-color: var(--text); }
.lang-btn svg { width: 17px; height: 17px; flex: none; }
.lang-btn .chev { width: 13px; height: 13px; color: var(--muted); transition: transform .15s; }
.lang-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 268px; padding: 6px;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .75);
}
.lang-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 10px;
  border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
}
.lang-menu button:hover, .lang-menu button:focus-visible { background: var(--bg-2); }
.lang-menu button svg { width: 16px; height: 16px; color: var(--accent); }
.lang-menu .soon { margin: 4px 0 0; padding: 9px 10px 5px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) {
  .nav .btn + .lang-pick, .nav .coin-badge + .lang-pick { margin-left: -6px; }   /* "Sign in" is hidden here */
  .lang-btn { width: 36px; padding: 0; justify-content: center; }   /* phones: only the globe */
  .lang-btn .lang-code, .lang-btn .chev { display: none; }
}
@media (max-width: 380px) {            /* the smallest phones: a little less air in the top bar */
  .nav .wrap { gap: 10px; }
  .nav-links { gap: 10px; }
  .nav .coin-badge { padding: 0 10px 0 8px; }
}

/* ---------- Player cards (packs, collection, profiles, home) ----------
   A framed portrait card. The frame is the rarity of the copy; sizes scale with the card (container units). */
.pcard {
  --f1: #c9d2cc; --f2: #7d8983; --f3: #3e4743; --tc: #d7dfda; --glow: transparent;
  position: relative; flex: none; width: 150px; aspect-ratio: 5 / 7; border-radius: 14px;
  background: linear-gradient(150deg, var(--f1), var(--f2) 45%, var(--f3));
  font-family: var(--display); text-transform: uppercase; user-select: none; isolation: isolate;
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .85), 0 0 0 0 var(--glow);
  container-type: inline-size;
}
.pcard.r-rare      { --f1: #b8e6ff; --f2: #3d95ea; --f3: #123a78; --tc: #8fd3ff; }
.pcard.r-epic      { --f1: #ead1ff; --f2: #a35cff; --f3: #3a1170; --tc: #d2a6ff; --glow: rgba(163, 92, 255, .35); }
.pcard.r-legendary { --f1: #fff3b8; --f2: #f2b521; --f3: #7d4f00; --tc: #ffd65c; --glow: rgba(242, 181, 33, .4); }
.pcard.r-mythic    { --tc: #ffd0f0; --glow: rgba(255, 95, 168, .45);
  background: conic-gradient(from 200deg, #ff7cc8, #8fe3ff, #b8ff9c, #fff08a, #ffa36b, #ff7cc8); }
.pcard.r-epic, .pcard.r-legendary, .pcard.r-mythic { box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .85), 0 0 22px -6px var(--glow); }
.pc-in { position: absolute; inset: 2.2cqw; border-radius: calc(14px - 2.2cqw); overflow: hidden; background: #0c1510; }
.pc-in::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 9, 7, .62) 0%, transparent 27%, transparent 48%, rgba(5, 9, 7, .96) 80%); }
.pc-portrait { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
/* No portrait yet: the flag, darkened, with big initials */
.pc-art { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: #0e1511; }
.pc-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .2; }
.pc-art::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .035) 0 2cqw, transparent 2cqw 5cqw); }
.pc-art b { position: relative; margin-top: -14cqw; font-size: 40cqw; font-weight: 900; line-height: 1; color: rgba(255, 255, 255, .9);
  text-shadow: 0 2cqw 6cqw rgba(0, 0, 0, .5); letter-spacing: .02em; }
.pc-rating { position: absolute; z-index: 2; left: 7cqw; top: 5cqw; font-size: 25cqw; font-weight: 900; line-height: .85; color: #fff; }
.pc-pos { position: absolute; z-index: 2; left: 7.6cqw; top: 28cqw; font-size: 9.5cqw; font-weight: 800; letter-spacing: .04em; color: var(--tc); }
.pc-flag { position: absolute; z-index: 2; left: 7.6cqw; top: 41cqw; width: 13cqw; height: auto; border-radius: 1.2cqw; box-shadow: 0 0 0 .5cqw rgba(0, 0, 0, .35); }
.pc-name { position: absolute; z-index: 2; left: 6cqw; right: 6cqw; bottom: 12cqw; padding-top: 4.5cqw; text-align: center;
  font-size: 11.5cqw; font-weight: 900; line-height: .95; color: #fff; border-top: max(1px, .7cqw) solid var(--tc); }
.pc-rar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 4.5cqw; text-align: center; font-family: var(--body);
  font-size: max(8px, 5.6cqw); font-weight: 700; letter-spacing: .14em; color: var(--tc); }
.pc-new, .pc-count { position: absolute; z-index: 4; right: 6cqw; top: 6cqw; padding: .25em .65em; border-radius: 999px;
  font-family: var(--body); font-size: max(10px, 6.6cqw); font-weight: 700; letter-spacing: .05em; line-height: 1.3; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); }
.pc-count { top: auto; bottom: 34cqw; letter-spacing: 0; background: rgba(5, 9, 7, .82); color: #fff; box-shadow: inset 0 0 0 1px var(--tc); }
/* Small cards (fusion slots, pickers): no rarity line, the frame colour says it */
@container (max-width: 112px) { .pc-rar { display: none; } .pc-name { bottom: 7cqw; } .pc-pips { display: none; } }
/* Which rarities of this player you own */
.pc-pips { position: absolute; z-index: 4; left: 50%; bottom: -3.2cqw; transform: translateX(-50%); display: flex; gap: 1.6cqw;
  padding: 1.4cqw 2.4cqw; border-radius: 999px; background: var(--bg); box-shadow: 0 0 0 1px var(--line-strong); }
.pc-pips i { width: 4cqw; height: 4cqw; min-width: 5px; min-height: 5px; border-radius: 50%; background: var(--line-strong); }
.pc-pips i.on.r-common { background: #c9d2cc; } .pc-pips i.on.r-rare { background: #4fb3ff; } .pc-pips i.on.r-epic { background: #b26bff; }
.pc-pips i.on.r-legendary { background: #ffc93c; } .pc-pips i.on.r-mythic { background: #ff5fa8; }

/* Legendary and Mythic: a slow sheen across the portrait */
.pcard.r-legendary .pc-in::before, .pcard.r-mythic .pc-in::before { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  mix-blend-mode: color-dodge; opacity: .4; background-size: 300% 100%; animation: foil-sheen 5s linear infinite;
  background-image: linear-gradient(115deg, transparent 30%, rgba(255, 225, 140, .6) 45%, rgba(255, 255, 255, .5) 50%, transparent 65%); }
.pcard.r-mythic .pc-in::before { opacity: .55; animation-duration: 4s;
  background-image: linear-gradient(115deg, transparent 25%, rgba(255, 120, 230, .55) 40%, rgba(120, 220, 255, .55) 50%, rgba(255, 245, 140, .55) 60%, transparent 75%); }
@keyframes foil-sheen { from { background-position: 100% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pcard .pc-in::before { animation: none !important; background-position: 40% 0; } }

/* Missing: the album slot shows who you are looking for, but not their face */
.pcard.missing { background: var(--line-strong); box-shadow: none; }
.pcard.missing .pc-in { background: radial-gradient(90% 70% at 50% 35%, var(--surface-2), var(--bg-2)); box-shadow: inset 0 0 0 1.5px var(--line); }
.pcard.missing .pc-in::after { display: none; }
.pcard.missing .pc-flag { opacity: .5; filter: grayscale(1); }
.pc-q { position: absolute; inset: 0 0 22% 0; display: grid; place-items: center; font-size: 62cqw; font-weight: 900; color: var(--line-strong); }
.pcard.missing .pc-rating, .pcard.missing .pc-name { color: var(--muted); }
.pcard.missing .pc-pos { color: var(--muted); opacity: .8; }
.pcard.missing .pc-name { border-top-color: var(--line-strong); bottom: 8cqw; }

.pcard.lg { width: min(300px, 76vw); border-radius: 22px; }
.pcard.lg .pc-in { border-radius: calc(22px - 2.2cqw); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 14px; }
.card-grid .pcard { width: 100%; }
.rar-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: 0; background: #c9d2cc; }
.rar-dot.r-rare { background: #4fb3ff; } .rar-dot.r-epic { background: #b26bff; } .rar-dot.r-legendary { background: #ffc93c; } .rar-dot.r-mythic { background: #ff5fa8; }

/* Player faces in games: the portrait when we have one, initials otherwise */
.avatar.has-face { padding: 0; overflow: hidden; background: var(--surface-2); }
/* small portrait beside a name in lists (Daily Player guesses, Budget Team market, recaps) */
.avatar.mini { display: inline-grid; width: 24px; height: 24px; vertical-align: -6px; margin-right: 7px; flex: none; }
.kd-name .avatar.mini { width: 20px; height: 20px; vertical-align: -4px; margin-right: 6px; align-self: center; }
/* Odd One Out: a face on each player card */
.avatar.oo-face { width: 46px; height: 46px; margin: 0 0 6px; font-size: 16px; }
.avatar.oo-face:not(.has-face) { background: var(--bg-2); color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.avatar.inline-face { display: inline-grid; width: 44px; height: 44px; vertical-align: middle; margin-right: 10px; }
.avatar.has-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }

.coin-pops { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.coin-pop {
  display: flex; align-items: center; gap: 10px; max-width: 340px; padding: 10px 16px 10px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid #ffd23f; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: coin-in .4s cubic-bezier(.16,1,.3,1); transition: opacity .4s, transform .4s;
}
.coin-pop b { font-family: var(--display); font-weight: 900; font-size: 22px; color: #ffd23f; line-height: 1; }
.coin-pop span:last-child { font-size: 13px; color: var(--muted); }
.coin-pop.quest { border-radius: var(--radius); background: #ffd23f; border-color: #ffd23f; }
.coin-pop.quest b, .coin-pop.quest span:last-child { color: var(--accent-ink); }
.coin-pop.out { opacity: 0; transform: translateY(8px); }
@keyframes coin-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .coin-pop { animation: none; } }

.quests-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.quests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.quests li { padding: 12px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--line); }
.quests li.done { border-color: rgba(79,227,138,.35); }
.quests .q-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.quests .q-top b { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.quests .q-reward { display: inline-flex; align-items: center; gap: 5px; font-family: var(--display); font-weight: 800; font-size: 17px; color: #ffd23f; white-space: nowrap; }
.quests .q-reward .coin { width: 14px; height: 14px; }
.quests .q-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 10px 0 8px; }
.quests .q-bar i { display: block; height: 100%; background: #ffd23f; border-radius: 3px; }
.quests li.done .q-bar i { background: var(--ok); }
.quests .q-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.quests li.done .q-foot span { color: var(--ok); }
.quests .q-foot a { color: var(--text); text-decoration: none; font-weight: 600; }
.quests .q-foot a:hover { color: var(--accent); }
.home-quests { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .home-quests { grid-template-columns: 1fr; } }

/* ---------- Sport icons (assets/sport-icons.js) ---------- */
.ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Home: top stories (assets/home-news.js) ---------- */
section.top-news { padding-bottom: 0; }
.top-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.top-grid > .top-notice { grid-column: 1 / -1; }

.top-news .kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; min-height: 18px; }
.top-news .kicker svg { width: 18px; height: 18px; color: var(--accent); margin-right: -4px; flex: none; }
.top-news .kicker span { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.top-news .kicker .sport { color: var(--text); }
.top-news h3 { margin: 0; font-weight: 600; line-height: 1.3; text-wrap: pretty; overflow-wrap: anywhere; hyphens: auto; }
.top-news h3 a { text-decoration: none; transition: color .15s; }
.top-news h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card is the link */
.top-news h3 a:focus-visible { outline: none; }
.top-news .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13px; color: var(--muted); }
.top-news .meta .src { color: var(--text); font-weight: 600; }
.top-news .meta .sep::before { content: "·"; display: inline-block; margin-right: 8px; color: var(--muted); font-weight: 400; text-decoration: none; }
.top-news .meta time, .top-news .meta .cover, .top-news .meta .tr { position: relative; z-index: 1; cursor: help; }   /* above the card link: tooltips work */
.top-news .meta .tr { text-decoration: underline dotted; text-underline-offset: 3px; }
.top-news .meta .cover { color: var(--accent); font-weight: 600; }
.top-row .meta .tr { flex-basis: 100%; }   /* "Translated from …" on its own line */
.top-row .meta .tr::before { display: none; }
.top-img.ph, .top-thumb.ph { display: grid; place-items: center; color: var(--line-strong);
  background: radial-gradient(120% 90% at 50% 120%, color-mix(in srgb, var(--accent) 9%, var(--bg-2)), var(--bg-2)); }
.top-img img, .top-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* The big story */
.top-lead { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.top-lead:hover, .top-row:hover { border-color: var(--line-strong); }
.top-lead:focus-within, .top-row:focus-within { border-color: var(--accent); }
.top-lead:hover h3 a, .top-row:hover h3 a { color: var(--accent); }
.top-img { aspect-ratio: 16 / 9; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.top-img.ph svg { width: 64px; height: 64px; }
.top-lead .top-body { padding: 20px 22px 22px; }
.top-lead h3 { font-size: clamp(21px, 2.1vw, 27px); margin-bottom: 10px; }
.top-lead .sum { margin: 0 0 14px; color: var(--muted); font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.top-lead .also { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.top-lead .also b { color: var(--accent); font-weight: 700; }

/* The other six */
.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.top-row { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) 84px; gap: 14px; align-items: start;
  padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s; }
.top-row .rank { font-family: var(--display); font-weight: 900; font-size: 26px; line-height: 1; color: var(--line-strong); padding-top: 2px; }
.top-row h3 { font-size: 15.5px; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.top-row .kicker { margin-bottom: 6px; }
.top-thumb { aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-2); }
.top-thumb.ph svg { width: 34px; height: 34px; }

.top-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.top-note time { cursor: help; }
.top-notice { text-align: center; padding: 40px 24px; }
.top-notice b { display: block; font-size: 18px; margin-bottom: 6px; }
.top-notice p { margin: 0 auto 16px; max-width: 46ch; color: var(--muted); }

/* Loading */
.top-news .sk { pointer-events: none; }
.top-news .sk .ln { height: 12px; border-radius: 6px; background: var(--line); margin-top: 10px; }
.top-news .sk .ln:first-child { margin-top: 0; }
.top-news .sk .ln.t { height: 16px; }

@media (max-width: 860px) {
  .top-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .top-row { grid-template-columns: 26px minmax(0, 1fr) 64px; gap: 10px; padding: 12px; }
  .top-row .rank { font-size: 21px; }
  .top-row h3 { font-size: 15px; }
  .top-row .meta .cover { flex-basis: 100%; }      /* "7 outlets" on its own line */
  .top-row .meta .cover::before { display: none; }
  .top-lead .top-body { padding: 16px; }
  .top-lead .sum { font-size: 14.5px; }
}
@media (max-width: 380px) {
  .top-row { grid-template-columns: 24px minmax(0, 1fr); }     /* the smallest phones: no small pictures, more room for the headline */
  .top-row .top-thumb { display: none; }
}

/* ---------- Themes (bought in the shop; set on <html data-theme="…">) ---------- */
html[data-theme="champions"] {
  --bg: #070b1d; --bg-2: #0b1126; --surface: #111a36; --surface-2: #18234a;
  --line: rgba(225, 232, 255, 0.10); --line-strong: rgba(225, 232, 255, 0.22);
  --text: #eaf0ff; --muted: #8f9cc4; --accent: #5ab0ff; --accent-ink: #061024; --chalk: #f2f5ff;
}
html[data-theme="derby"] {
  --bg: #100a0b; --bg-2: #160d0f; --surface: #1f1214; --surface-2: #2a181b;
  --line: rgba(255, 232, 232, 0.10); --line-strong: rgba(255, 232, 232, 0.22);
  --text: #f6ecec; --muted: #b39b9d; --accent: #ff4848; --accent-ink: #160406; --chalk: #fbf3f3;
  --bad: #ff9a3c;   /* keep "wrong" visibly different from the red accent */
}
html[data-theme="oranje"] {
  --bg: #0d0f13; --bg-2: #12151b; --surface: #191d25; --surface-2: #212733;
  --line: rgba(236, 240, 247, 0.10); --line-strong: rgba(236, 240, 247, 0.22);
  --text: #f1f3f7; --muted: #9aa3b2; --accent: #ff8a1e; --accent-ink: #1a0d00; --chalk: #f6f7fa;
}
html[data-theme="samba"] {
  --bg: #06140c; --bg-2: #091a10; --surface: #0e2417; --surface-2: #14301f;
  --line: rgba(236, 247, 232, 0.10); --line-strong: rgba(236, 247, 232, 0.22);
  --text: #f2f7ee; --muted: #a3b8a6; --accent: #ffd23f; --accent-ink: #0a1a05; --chalk: #f7faf3;
}
html[data-theme="ice"] {
  --bg: #0b1015; --bg-2: #0f151c; --surface: #151d26; --surface-2: #1c2733;
  --line: rgba(232, 244, 250, 0.10); --line-strong: rgba(232, 244, 250, 0.22);
  --text: #eef6fa; --muted: #95a7b4; --accent: #9fe8ff; --accent-ink: #04161d; --chalk: #f5fbfd;
}
html[data-theme="court"] {
  --bg: #120d09; --bg-2: #18110c; --surface: #211810; --surface-2: #2c2016;
  --line: rgba(250, 240, 230, 0.10); --line-strong: rgba(250, 240, 230, 0.22);
  --text: #f8f1ea; --muted: #b5a493; --accent: #ffb347; --accent-ink: #1e1003; --chalk: #fcf7f2;
}
/* Every theme: the accent glows softly behind the logo mark, so a theme change is felt in the header too */
.logo-mark { transition: background-color .3s; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 35%, transparent)); }

/* "Match card earned" pop with an Open button (game pages) */
.coin-pop.card-pop { pointer-events: auto; gap: 12px; padding: 10px 10px 10px 12px; border-radius: var(--radius);
  background: var(--surface-2); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.card-pop > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.25; }
.card-pop b { font-family: var(--body); font-size: 15px; color: var(--text); font-weight: 700; }
.card-pop small { font-size: 13px; color: var(--muted); }
.cp-card { flex: none; width: 26px; height: 36px; border-radius: 5px; background: linear-gradient(150deg, #ead1ff, #a35cff 45%, #3a1170);
  box-shadow: 0 0 14px -2px rgba(163, 92, 255, .7); position: relative; }
.cp-card::after { content: ""; position: absolute; inset: 3px; border-radius: 3px; background: #0c1510; -webkit-mask: url("brand/kickwise-mark.svg") center / 60% no-repeat; mask: url("brand/kickwise-mark.svg") center / 60% no-repeat; background: #fff; opacity: .85; }
.match-card-note { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.match-card-note b { color: var(--text); }
.match-card-note .cp-card { width: 20px; height: 28px; }
.coin-badge .cb-cards { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #a35cff; color: #fff; font-size: 12px; font-weight: 700; }


/* Check and cross icons in game recaps */
.recap .kw-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }
/* Settings menu: site colours */
.lang-menu .menu-head { margin: 4px 0 0; padding: 10px 10px 4px; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
/* Theme tiles: the logo in each theme's own colours */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 4px 6px 6px; }
.lang-menu .theme-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; height: auto; padding: 10px;
  border-radius: 10px; background: var(--tb); border: 1px solid rgba(255, 255, 255, .1); color: #fff; }
.lang-menu .theme-grid button:hover { border-color: var(--ta); }
.lang-menu .theme-grid button[aria-checked="true"] { border-color: var(--ta); box-shadow: inset 0 0 0 1px var(--ta); }
.th-mark { width: 100%; height: 34px; border-radius: 7px; background: var(--ts); position: relative; }
.th-mark::after { content: ""; position: absolute; inset: 6px; background: var(--ta);
  -webkit-mask: url("brand/kickwise-mark.svg") center / contain no-repeat; mask: url("brand/kickwise-mark.svg") center / contain no-repeat; }
.th-name { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .88); white-space: nowrap; }
/* Inline icons inside game text (arrows in chains and transfers, quiz icons) */
#pairLabel .kw-ico, .result .kw-ico, .move .kw-ico { display: inline-block; width: 1em; height: 1em; vertical-align: -.15em; margin: 0 .3em; }
.pack .ic .kw-ico { width: 28px; height: 28px; color: var(--accent); }
.btn .kw-ico { width: 17px; height: 17px; }
.mini-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.pack.mixed .ic .kw-ico { color: currentColor; }
@media (max-width: 920px) { .game-layout { align-items: stretch; } }
/* "A friend sent you this" note on challenge links */
.challenge-note { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 15px; }
.challenge-note .kw-ico { width: 20px; height: 20px; color: var(--accent); }
.challenge-note b { color: var(--accent); }

/* ---------- Account button in the header (assets/account.js) ---------- */
.acc-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--bg-2); text-decoration: none; font-size: 14px; font-weight: 600; flex: none; }
.acc-btn .kw-ico { width: 19px; height: 19px; color: var(--accent); }
.acc-btn:hover { border-color: var(--text); }
.acc-btn.in { width: 38px; height: 38px; padding: 0; justify-content: center; border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.acc-btn .acc-face { width: 32px; height: 32px; font-size: 13px; }
.acc-dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  background: #a35cff; color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 0 0 2px var(--bg); }
@media (max-width: 720px) { .acc-btn:not(.in) span { display: none; } .acc-btn:not(.in) { width: 36px; padding: 0; justify-content: center; } }

/* ---------- Sign-in dialog ---------- */
.acc-dialog { width: min(420px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface); color: var(--text); }
.acc-dialog::backdrop { background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(4px); }
.acc-box { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 26px 24px 22px; }
.acc-box h2 { font-size: 40px; padding-right: 36px; }
.acc-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; }
.acc-x .kw-ico { width: 16px; height: 16px; }
.acc-why { margin: -4px 0 4px; color: var(--muted); font-size: 15px; }
.acc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-2); }
.acc-tabs button { height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.acc-tabs button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.acc-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.acc-field input, .field-input { height: 48px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text); font: inherit; font-size: 16px; }
.acc-field input:focus, .field-input:focus { outline: none; border-color: var(--accent); }
.acc-hint { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.acc-err { margin: 0; min-height: 1.2em; color: var(--bad); font-size: 14px; }
.acc-err:empty { display: none; }
.acc-go { height: 50px; }
.acc-tg { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.acc-tg:empty { display: none; }
.acc-tg p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Live drops line under the header (assets/ticker.js) ---------- */
.ticker { position: sticky; top: 64px; z-index: 19; display: flex; align-items: center; height: 34px; overflow: hidden;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); border-bottom: 1px solid var(--line); font-size: 13px; }
.tk-live { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 12px 0 16px; font-weight: 700; color: var(--text);
  background: var(--bg-2); box-shadow: 8px 0 14px var(--bg-2); position: relative; z-index: 1; }
.tk-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); animation: tk-blink 1.6s ease-in-out infinite; }
@keyframes tk-blink { 50% { opacity: .25; } }
.tk-view { flex: 1; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 40px), transparent); mask: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 40px), transparent); }
.tk-track { display: flex; width: max-content; animation: tk-move var(--tk-time, 60s) linear infinite; }
.ticker:hover .tk-track, .ticker:focus-within .tk-track { animation-play-state: paused; }
.tk-run { display: flex; }
@keyframes tk-move { to { transform: translateX(-50%); } }
.tk-item { display: inline-flex; align-items: center; gap: 6px; padding: 0 22px; white-space: nowrap; text-decoration: none; color: var(--muted); border-right: 1px solid var(--line); }
.tk-item b { color: var(--text); font-weight: 700; }
.tk-item em { font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.tk-item strong { color: var(--text); font-weight: 600; }
.tk-item img { border-radius: 2px; }
.tk-item small { font-size: 12px; opacity: .8; }
.tk-item:hover b, .tk-item:hover strong { text-decoration: underline; }
.rtext.r-common { color: #c9d2cc; } .rtext.r-rare { color: #4fb3ff; } .rtext.r-epic { color: #b26bff; } .rtext.r-legendary { color: #ffc93c; } .rtext.r-mythic { color: #ff5fa8; }
@media (max-width: 720px) { .ticker { top: 58px; height: 30px; font-size: 12.5px; } .tk-item small { display: none; } .tk-item { padding: 0 16px; } }
@media (prefers-reduced-motion: reduce) { .tk-track { animation: none; } .tk-view { overflow-x: auto; scrollbar-width: none; } .tk-run[aria-hidden] { display: none; } .tk-live i { animation: none; } }
/* Inside Telegram: Telegram draws its own top bar */
.in-telegram .nav { position: static; }
.in-telegram .ticker { top: 0; }

/* "Open in your language" offer (assets/lang.js), bottom of the screen, once */
.lang-offer { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 4px;
  padding: 4px 4px 4px 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: 0 12px 30px -10px #000; }
.lang-offer a { font-weight: 700; text-decoration: none; color: var(--accent); white-space: nowrap; }
.lang-offer button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.lang-offer .kw-ico { width: 16px; height: 16px; }
@media (min-width: 721px) { .lang-offer { bottom: 24px; } }

/* ---------- Right-to-left (Arabic pages, html[dir="rtl"]) ---------- */
[dir="rtl"] .nav-links { margin-left: 0; margin-right: auto; }
[dir="rtl"] .lang-menu { right: auto; left: 0; }
[dir="rtl"] .coin-pops { right: auto; left: 20px; align-items: flex-start; }
[dir="rtl"] .mh-next { margin-left: 0; margin-right: auto; }
[dir="rtl"] .i-arrow-left, [dir="rtl"] .i-arrow-right { transform: scaleX(-1); }
[dir="rtl"] .logo, [dir="rtl"] .pcard, [dir="rtl"] .coin-badge, [dir="rtl"] .tabular, [dir="rtl"] .rv-card { direction: ltr; }
[dir="rtl"] .ticker { direction: ltr; }
[dir="rtl"] .tk-item { direction: rtl; }
[dir="rtl"] .acc-dot { right: auto; left: -4px; }
[dir="rtl"] .acc-x { right: auto; left: 14px; }
@media (max-width: 720px) { [dir="rtl"] .nav .coin-badge { margin-left: 0; margin-right: auto; } }
