/* Police des titres, boutons, onglets et menus : Nunito, ronde et grasse (copiée par npm run vendor).
   Le texte courant reste en Open Sans. Ici parce que toutes les pages chargent menu.css, l'île comprise. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/vendor/nunito/nunito-latin-wght-normal.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: "Nunito";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/vendor/nunito/nunito-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
:root { --font-title: "Nunito", "Open Sans", system-ui, sans-serif; }

/* Icônes (menu.js) : dans le texte (phrases, liens), à la taille du texte ; dans les boutons et les titres,
   à la taille du menu de gauche (26 px). Toujours de leur couleur. */
.ico { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.24em; color: var(--ic, currentColor); }
.btn .ico, h1 .ico, h2 .ico { width: 26px; height: 26px; vertical-align: middle; }
.ico .f { fill: currentColor; fill-opacity: .22; }
/* Pas d'icône sur un bouton plein (vert, jaune, bleu, rouge) : « Jouer » avec un ami en ligne, par exemple. */
.btn.primary .ico, .btn.warm .ico, .btn.blue .ico, .btn.danger .ico { display: none; }
.btn .ico, .link .ico, .report .ico { margin-right: .35em; }
.btn .ico:only-child, .btn .ico:has(+ .badge) { margin-right: 0; }

/* Menu de gauche (menu.js) : sur ordinateur seulement, autour de l'application et des pages à part.
   Couleurs de style.css, ou celles de l'île (ile.html) qui a les siennes. */
.sidebar { display: none; }
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 22px 14px;
    border-right: 2px solid var(--line); background: var(--bg); font-family: var(--font-title); }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 14px 20px; background: none; border: 0;
    color: var(--text, var(--ink)); font-weight: 900; font-size: 1.4rem; text-decoration: none; cursor: pointer; }
  .side-brand .logo { width: 36px; height: 36px; }
  .sidebar .side-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px; background: none; border: 2px solid transparent; border-radius: 14px;
    color: var(--muted); font: 900 .95rem/1.5 var(--font-title); letter-spacing: .04em; text-transform: uppercase; text-align: left; white-space: nowrap; text-decoration: none; cursor: pointer; }
  .sidebar .side-item:hover { background: var(--surface-2, var(--soft)); }
  .sidebar .side-item.on { background: var(--accent-soft, var(--sel-soft)); border-color: var(--accent, var(--sel)); color: var(--accent-ink, var(--sel)); }
  .side-icon { display: grid; place-items: center; width: 32px; font-size: 1.5rem; line-height: 1; }
  .side-icon .ico { width: 26px; height: 26px; }
  .shell-main { min-width: 0; padding: 24px 32px 64px; }
  .shell-main > :not(.landing) { max-width: 720px; margin-left: auto; margin-right: auto; }
  .shell-main > .btn.block { display: flex; }
  /* Page qui occupe tout l'écran (l'île) : la colonne de droite fait la hauteur de la fenêtre. */
  .shell.full { height: 100vh; }
  .shell.full .shell-main { height: 100vh; padding: 0; overflow: hidden; }
  .shell.full .shell-main > * { max-width: none; }
  /* Le menu ramène à l'accueil : les liens « ← Accueil » des pages à part ne servent plus. */
  .shell a.back-home[href="/"], .shell a.back-site[href="/"] { display: none; }
  .shell .topnav:has(> a.back-home[href="/"]:only-child) { display: none; }
}

/* Onglets du bas (menu.js) : sur téléphone seulement, à la place du menu de gauche. */
.tabbar { display: none; }
@media (max-width: 959px) {
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; justify-content: flex-start;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 2px solid var(--line);
    font-family: var(--font-title); }
  .tabbar::-webkit-scrollbar { display: none; }
  /* Cinq onglets et demi à l'écran : celui qui dépasse invite à faire défiler. */
  .tabbar .tab { flex: 0 0 calc((100% - 8px) / 5.4); min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
    background: none; border: 2px solid transparent; border-radius: 12px; color: var(--muted);
    font: 800 .72rem/1.2 var(--font-title); letter-spacing: -.01em; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbar .tab.on { background: var(--accent-soft, var(--sel-soft)); border-color: var(--accent, var(--sel)); color: var(--accent-ink, var(--sel)); }
  .tab-icon { position: relative; font-size: 1.45rem; line-height: 1; }
  .tab-icon .ico { display: block; width: 26px; height: 26px; }
  .tab-icon .badge { position: absolute; top: -6px; right: -12px; font-size: .65rem; line-height: 1.5; min-width: 1.5em; padding: 0 4px; }
  /* Place pour les onglets en bas de la page, et barres d'action posées juste au-dessus. */
  /* #toast est à côté de #app, pas dedans : il lui faut sa propre copie de la hauteur des onglets. */
  .has-tabbar, .has-tabbar ~ #toast { --tabbar-h: calc(64px + env(safe-area-inset-bottom)); }
  body.has-tabbar, #app.has-tabbar { padding-bottom: calc(var(--tabbar-h) + 24px); }
  #app.has-tabbar:has(.actionbar) { padding-bottom: calc(var(--tabbar-h) + 96px); }
  .has-tabbar .actionbar { bottom: var(--tabbar-h); padding-bottom: 10px; }
  #app.has-tabbar ~ #toast { bottom: calc(var(--tabbar-h) + 16px); }
  /* Au-dessus des boutons de la barre d'action (« Jouer seul », etc.), sans les cacher. */
  #app.has-tabbar:has(.actionbar) ~ #toast { bottom: calc(var(--tabbar-h) + 88px); }
}
