/* Game switcher (built by nav.js). Tabs at the top on a computer, a bar at the bottom on a phone. Each game has its own colors. */
.games-nav a[data-game="all"]        { --g: #1c1a17; --soft: #ececec; --ink: #1c1a17; }
.games-nav a[data-game="crosswords"] { --g: #006aff; --soft: #e3efff; --ink: #0a3f8f; }
.games-nav a[data-game="top5"]       { --g: #f58220; --soft: #ffeadb; --ink: #7a3300; }
.games-nav a[data-game="scramble"]   { --g: #7a4fd6; --soft: #ece5fb; --ink: #43257f; }
.games-nav a[data-game="wordsearch"] { --g: #14975a; --soft: #dcf4e7; --ink: #0b5230; }

.games-nav { max-width: 1000px; margin: 0 auto; padding: 14px 16px 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; border-bottom: 1px solid #cfe0f5; }
.games-nav a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 3px solid transparent; color: #3d5573; font-size: 15px; font-weight: 400; text-decoration: none; white-space: nowrap; }
@media (min-width: 641px) and (hover: hover){.games-nav a:hover{ background: var(--soft); border-radius: 10px 10px 0 0; }}
.games-nav a[aria-current="page"] { background: var(--soft); border-bottom-color: var(--g); border-radius: 10px 10px 0 0; color: var(--ink); font-weight: 500; }
.games-nav .ico { display: flex; }
.games-nav svg { width: 20px; height: 20px; flex: none; color: var(--g); }

@media (max-width: 640px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .games-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: none; margin: 0; padding: 8px 4px calc(10px + env(safe-area-inset-bottom)); gap: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border-top: 1px solid #cfe0f5; border-bottom: 0; }
  .games-nav a { flex-direction: column; justify-content: flex-start; gap: 3px; padding: 6px 0; margin: 0; border: 0; border-radius: 10px; font-size: 11px; line-height: 1.2; }
  @media (min-width: 641px) and (hover: hover){.games-nav a:hover{ background: none; }}
  .games-nav a[aria-current="page"] { background: none; border: 0; }
  .games-nav .ico { width: 44px; height: 28px; align-items: center; justify-content: center; border-radius: 14px; }
  .games-nav a[aria-current="page"] .ico { background: var(--soft); }
  .games-nav svg { width: 22px; height: 22px; }
  body.kb-open .games-nav, body.typing .games-nav { display: none; }
  body.kb-open, body.typing { padding-bottom: 0; }
}

/* Each game has its own accent color. The whole site already uses --accent / --accent-soft, so one override here recolors the page.
   Crosswords keeps the default blue from crossword.css. Orange and green use the darker "button" shade so white text stays readable. */
html[data-game="top5"]       { --accent: #c2540a; --accent-soft: #ffeadb; --bg: #fffaf5; --border: #f5cfae; --head: #7a3300; --main: #f58220; --line2: #e6b58a; --ph: #9a8068; }
html[data-game="scramble"]   { --accent: #7a4fd6; --accent-soft: #ece5fb; --bg: #faf8fe; --border: #cdbdf0; --head: #43257f; --main: #7a4fd6; --line2: #b79ee8; --ph: #6a5a96; }
html[data-game="wordsearch"] { --accent: #0f7d4a; --accent-soft: #dcf4e7; --bg: #f6fcf9; --border: #b9e3cc; --head: #0b5230; --main: #14975a; --line2: #8fcfae; --ph: #4f7f66; }
/* Page background, borders and the main heading also follow the game, as in the design. Cards stay white. */
html[data-game="top5"] h1, html[data-game="scramble"] h1, html[data-game="wordsearch"] h1 { color: var(--head); }
html:not([data-game="top5"]):not([data-game="scramble"]):not([data-game="wordsearch"]) { --head: #0a3f8f; --main: #006aff; --line2: #9db9df; }

/* Language switch. Computer: at the right end of the game tabs. Phone: in the top bar. */
.topbar { max-width: 1000px; margin: 0 auto; position: relative; height: 0; }
.topbar .brand, .topbar .pill-slot:empty { display: none; }
.top-right { position: absolute; top: 24px; right: 16px; z-index: 2; }
.lang-switch { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: #3d5573; white-space: nowrap; }
.lang-switch [aria-current] { color: #10233d; font-weight: 500; }
.lang-switch a { color: #3d5573; text-decoration: none; }
@media (min-width: 641px) and (hover: hover){.lang-switch a:hover{ color: var(--accent); text-decoration: underline; }}
.lang-switch .sep { opacity: .5; }
.games-nav { padding-right: 90px; } /* room for the language switch */
@media (max-width: 640px) { .games-nav { padding-right: 4px; } }

/* Heading row: heading + description on the left, a small pill (round / progress) on the right */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 8px; margin-bottom: 20px; }
.page-head .ph-text { min-width: 0; }
.page-head h1 { font-size: 44px; line-height: 1.15; margin: 0 0 6px; }
.page-head .intro { margin: 0; padding: 0; border: 0; font-size: 17px; color: #3d5573; }
.pill { flex: none; font-size: 14px; font-weight: 500; padding: 5px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--head); white-space: nowrap; }

@media (max-width: 640px) {
  .topbar { height: auto; display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 0; }
  .topbar .brand { display: block; font-size: 15px; font-weight: 500; color: #10233d; text-decoration: none; }
  .topbar .pill-slot:empty { display: none; }
  .top-right { position: static; display: flex; align-items: center; gap: 10px; }
  .pill-slot .pill { margin: 0; font-size: 13px; padding: 4px 12px; border-radius: 12px; }
  html.with-top main { padding-top: 14px; }
  .page-head { padding-top: 0; }
  .page-head h1 { font-size: 28px; margin-bottom: 4px; }
  .page-head .intro { font-size: 15px; line-height: 1.45; }
  .page-head { margin-bottom: 14px; }
}

/* Share row on computers (built by nav.js, KPShare): WhatsApp, Facebook, X, Copy */
.kp-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 0; }
.kp-share[hidden] { display: none; }
.kp-share.kp-share a, .kp-share.kp-share button { flex: none; width: auto; min-height: 0; margin: 0; font: inherit; font-size: 14px; line-height: 1; padding: 9px 14px; border: 1px solid #cfe0f5; border-radius: 999px; background: #fff; color: #0a3f8f; text-decoration: none; cursor: pointer; }
@media (min-width: 641px) and (hover: hover){.kp-share.kp-share a:hover, .kp-share.kp-share button:hover{ background: #e3efff; }}

/* Footer (built by nav.js) */
.site-footer { max-width: 1000px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; font-size: 13px; color: #3d5573; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 0 0 6px; }
.site-footer a { color: #3d5573; text-decoration: none; }
@media (min-width: 641px) and (hover: hover){.site-footer a:hover{ color: var(--accent); text-decoration: underline; }}
.site-footer p { margin: 0; }
body.phone-play .site-footer, body.typing .site-footer { display: none; }

/* About / Contact / Privacy / 404 pages */
main.info h2 { font-size: 20px; font-weight: 500; margin: 28px 0 8px; color: #0a3f8f; }
main.info p, main.info li { font-size: 16px; line-height: 1.65; margin: 0 0 10px; }
main.info ul { margin: 0 0 10px; padding-left: 20px; }
main.info a { color: var(--accent); }
main.info .updated { font-size: 14px; color: var(--muted); }
main.info .big-link { display: inline-block; margin: 4px 0 10px; font-size: 18px; font-weight: 500; }
main.info .cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
main.info .cta a { padding: 11px 18px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: #0a3f8f; text-decoration: none; }
@media (min-width: 641px) and (hover: hover){main.info .cta a:hover{ background: var(--accent-soft); }}
main.info h1 { overflow-wrap: anywhere; }
@media (max-width: 640px) { main.info h1 { font-size: 30px; } }
