/* What the website's pages and the game's own page (index.html) share: the font, the colors (the
   app's, theme/colors.ts), and the header, which is the same on every page so it stays still when
   you go from one to another. Light unless the app is set to dark: each page reads the app's saved
   setting and sets data-theme (make-site.py; WebShell in the app keeps it in step). In a browser
   it's the game's navigation too, on a phone as on a computer; the installed apps have their tabs. */

@font-face { font-family: Nunito; font-weight: 600; font-display: swap; src: url('/fonts/Nunito_600SemiBold.ttf') format('truetype'); }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url('/fonts/Nunito_700Bold.ttf') format('truetype'); }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url('/fonts/Nunito_800ExtraBold.ttf') format('truetype'); }

:root {
  --bg: #e9edf4;
  --surface: #ffffff;
  --surface-alt: #f2f5fa;
  --text: #1e2b45;
  --muted: #5f6f8e;
  --line: #d6dde8;
  --primary: #3b6fe0;
  --primary-soft: #e3ebfc;
  --orange: #ff8a3d;
  --shadow: 0 1px 3px rgba(30, 43, 69, 0.08), 0 8px 24px rgba(30, 43, 69, 0.06);
  /* The board pictures, in the app's board colors. */
  --board: #ffffff;
  --line-thin: #c9d3e3;
  --line-thick: #344561;
  --tint: #e5edfd;
  --tint2: #fce5d4;
  --tint3: #ddf3e8;
  --tint-strong: #b7cef4;
  --answer: #d6e3f8;
  --danger: #e5484d;
  --danger-soft: #fde4e5;
  --link: #8a56d6;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0f141d;
  --surface: #182030;
  --surface-alt: #1e283a;
  --text: #e7ecf5;
  --muted: #9aa6bd;
  --line: #2a3548;
  --primary: #5b8bf5;
  --primary-soft: #1d2a45;
  --shadow: none;
  --board: #161e2b;
  --line-thin: #2c384d;
  --line-thick: #8c9dbd;
  --tint: #1e2d4c;
  --tint2: #3a2b20;
  --tint3: #173a2b;
  --tint-strong: #294068;
  --answer: #1d2941;
  --danger: #ff6b6e;
  --danger-soft: #44232a;
  --link: #b38cf7;
  color-scheme: dark;
}

/* The bar inviting an Android phone's browser to the app (make-site.py's app_bar): above the header,
   scrolling away with the page, gone once its × is pressed. */
.app-bar, .app-bar * { box-sizing: border-box; }
.app-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 6px; background: var(--surface); border-bottom: 1px solid var(--line);
  font-family: Nunito, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text); line-height: 1.25; }
.app-bar[hidden] { display: none; }
.app-bar-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.app-bar-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.app-bar img { flex: none; width: 40px; height: 40px; border-radius: 10px; }
.app-bar-text { flex: 1; min-width: 0; }
.app-bar-text b { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Two lines where one doesn't fit (German's on the smallest phones). */
.app-bar-text span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; font-weight: 600; color: var(--muted); }
.app-bar-get { flex: none; padding: 7px 16px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 800; text-decoration: none; }
@media (max-width: 380px) { .app-bar { gap: 8px; padding-right: 10px; } .app-bar-get { padding: 7px 12px; } }

.top, .top * { box-sizing: border-box; }
/* 72 px tall on a computer (WEB_HEADER in components/web.tsx): 16 above and below the 40 px bell and links. */
.top { padding: 16px 0; font-family: Nunito, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-weight: 600; line-height: 1.6; color: var(--text); }
.top .wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.top a { text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 20px; margin-right: auto; }
.brand b { white-space: nowrap; }
.brand span { color: var(--primary); }
.logo { width: 34px; height: 34px; flex: none; display: block; }
.nav { display: flex; gap: 2px; }
.nav a { font-size: 16px; line-height: 24px; font-weight: 700; color: var(--text); padding: 8px 12px; border-radius: 10px; white-space: nowrap; }
.nav a:hover, .nav a[aria-current='page'] { background: var(--primary-soft); }
.nav a[aria-current='page'] { color: var(--primary); }
/* The bell: your notifications, with how many the game last counted (localStorage inbox-count). */
.round { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.round:hover { background: var(--surface-alt); }
.round svg { width: 18px; height: 18px; fill: currentColor; }
.bell.on, .round:hover, .round[aria-current='page'] { color: var(--text); }
.top .wrap > .round { margin-left: 4px; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; border: 2px solid var(--bg); background: var(--orange); color: #161b26; font-size: 11px; line-height: 16px; font-weight: 800; text-align: center; }
.badge[hidden] { display: none; }
/* The menu: its button comes first, before the logo. Its links are the learning pages, About, the
   languages and the game's settings; on a computer it drops down from the button, and narrower it's over the
   whole page with the tabs in it too (.m-tab; the class names are the menu's own, as site.css
   has a .phone and a .button of its own), the header then being this button, the logo and the
   bell. A details element, so it opens without scripts; a click anywhere else or Escape closes it
   (make-site.py). */
.menu { position: relative; order: -1; margin-left: -8px; }
/* The menu's own button only (">"): the language dropdown inside it has a summary of its own. */
.menu > summary { list-style: none; cursor: pointer; position: relative; z-index: 61; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--text); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--primary-soft); }
.menu > summary svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.menu .i-close, .menu[open] .i-open { display: none; }
.menu[open] .i-close { display: block; }
.menu-panel { position: absolute; top: 48px; left: 0; z-index: 60; width: max-content; padding: 8px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 32px rgba(30, 43, 69, 0.16); }
.menu-panel a { display: flex; align-items: center; gap: 10px; font-size: 16px; line-height: 24px; font-weight: 700; color: var(--text); padding: 10px 14px; border-radius: 10px; }
.menu-panel a:hover, .menu-panel a[aria-current='page'] { background: var(--primary-soft); }
.menu-panel a[aria-current='page'] { color: var(--primary); }
/* The language, over the settings and after a line: the Settings page's dropdown (Dropdown in
   components/Overlays.tsx), a button with the page's (in the game, the game's) language, and the
   list of them under it, the chosen one checked. */
.menu-panel .lang-row { margin-top: 6px; padding: 10px 0 4px; position: relative; display: flex; align-items: center; }
.menu-panel .lang-row::before { content: ''; position: absolute; left: 6px; right: 6px; top: -1px; border-top: 1px solid var(--line); }
/* As wide as the menu, which is as wide as its widest item (in German, Einstellungen), the arrow at its end. */
.lang-pick { position: relative; flex: 1; }
.lang-pick summary .name { flex: 1; }
.lang-pick summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap; }
.lang-pick summary::-webkit-details-marker { display: none; }
.lang-pick summary:hover, .lang-pick[open] summary { background: var(--surface-alt); }
.lang-pick .flag { font-size: 17px; line-height: 22px; }
.lang-pick summary svg { width: 16px; height: 16px; fill: var(--muted); }
.lang-list { position: absolute; top: calc(100% + 6px); left: 0; z-index: 62; width: max-content; min-width: 100%; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(30, 43, 69, 0.18); overflow: hidden; }
:root[data-theme='dark'] .lang-list { box-shadow: none; }
.menu-panel .lang-list a { gap: 8px; height: 48px; padding: 0 16px; border-radius: 0; font-size: 15px; color: var(--text); }
.menu-panel .lang-list a .flag { font-size: 20px; line-height: 26px; }
.menu-panel .lang-list .name { flex: 1; }
.menu-panel .lang-list a svg { width: 16px; height: 16px; fill: var(--primary); visibility: hidden; }
.menu-panel .lang-list a:hover { background: var(--surface-alt); }
.menu-panel .lang-list a[aria-current] { color: var(--primary); }
.menu-panel .lang-list a[aria-current] svg { visibility: visible; }
.menu-panel .settings svg { width: 20px; height: 20px; fill: currentColor; color: var(--muted); }
.menu-panel .m-tab { display: none; }
@media (max-width: 959px) {
  .menu { margin-left: 0; }
  .menu-panel { position: fixed; inset: 0; width: auto; min-width: 0; overflow-y: auto; background: var(--bg); border: 0; border-radius: 0; box-shadow: none; padding: 88px 24px 48px; align-items: center; justify-content: center; gap: 4px; }
  .menu-panel a { font-size: 18px; color: var(--muted); padding: 10px 18px; border-radius: 12px; }
  .menu-panel a:hover, .menu-panel a[aria-current='page'] { color: var(--text); }
  .menu-panel .m-tab { display: flex; }
  .menu-panel .m-play { justify-content: center; min-width: 220px; min-height: 50px; margin-bottom: 12px; border-radius: 14px; background: var(--primary); color: #fff; font-size: 17px; font-weight: 800; }
  .menu-panel .m-play:hover, .menu-panel .m-play[aria-current='page'] { background: var(--primary); color: #fff; filter: brightness(1.06); }
  .menu-panel .lang-row { margin-top: 12px; padding: 0; justify-content: center; }
  .menu-panel .lang-row::before { display: none; }
  .lang-pick { flex: none; }
  .lang-pick summary .name { flex: none; }
  .lang-list { left: 50%; transform: translateX(-50%); }
  .menu-panel .lang-list a { font-size: 16px; }
  .menu-panel .settings { margin-top: 8px; }
  html:has(.menu[open]) { overflow: hidden; }
  .nav { display: none; }
  .top .wrap { gap: 8px; }
}
@media (max-width: 360px) {
  .brand { font-size: 17px; gap: 8px; }
  .logo { width: 30px; height: 30px; }
}
/* In the game (index.html) on a phone, a game itself (the solo game, a room) keeps the whole screen
   for the board: no header (WebShell, and a script before it, set data-screen). */
@media (max-width: 959px) {
  html[data-screen='game'] .shell .top, html[data-screen='game'] .shell .app-bar { display: none; }
}
