/* FIX-01 Block 1 (the founder, 15 Nov: "it must be the same menu for everyone"): the site's headers and its ONE main
   menu. Every page links this stylesheet - before g3.css where a page has it - so that the pages of web/app.css (the
   encyclopedia, cards, unlimited, about, the legal pages, padel, 404) draw the very header Today draws:
   - .g3-head: the capybara and the wordmark, TODAY · CAREER · MY DAY · ARCHIVE · ENCYCLOPEDIA, the Tennis / Padel
     switch and the two chips; on the desktop it spans the window as Today's does (the same x on every page);
   - .g3-mhead: a mode's header and the phone's title header of the other pages (‹ back, the wordmark, the title);
   - .g3-tabs: the phone's tab bar, the same five tabs on every page that is not a game.
   The rules below up to «FIX-01» were web/g3.css's (GAME-03 ... LAUNCH-01), moved here as they were. */
/* header */
.g3-head { height: 56px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--ground); position: relative; z-index: 5; }
.g3-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink) !important; font: 400 19px Silkscreen, monospace; letter-spacing: 2px; white-space: nowrap; }
.g3-brand i { width: 12px; height: 12px; background: var(--accent); display: inline-block; }
.g3-brand b { font-weight: 400; } .g3-brand span { color: var(--accent); }
/* PLAY-01 H2: the capybara mark (28 CSS px; 56 / 84 px files by pixel density) before the wordmark; in a mode's header
   a smaller wordmark, then «· MODE»; .g3-tight (foot.js fitHead): the row does not fit - the wordmark goes first */
.g3-mark { width: 28px; height: 28px; flex: none; display: block; }
.g3-mhead .g3-mbrand { gap: 6px; font-size: 14px; letter-spacing: 1px; flex: none; }
.g3-mhead .name .dot { font-family: inherit; }
.g3-tight .g3-brand .wm { display: none; }
.g3-brand { min-width: 44px; justify-content: center; }   /* the capybara alone is still a 44 px target */
.g3-back { flex: none; }
/* a tight row also closes up: smaller gaps, the name and the right pill without their letter-spacing */
.g3-mhead.g3-tight { gap: 4px; }
.g3-mhead.g3-tight .name { letter-spacing: 1px; }
.g3-mhead.g3-tight .pill { letter-spacing: 0; padding-left: 6px; padding-right: 6px; }
.g3-chips { margin-left: auto; display: flex; gap: 6px; align-items: center; min-width: 0; }
.g3-chips .acid { overflow: hidden; text-overflow: ellipsis; min-width: 0; display: block; }
.g3-chip { font: 400 11px Silkscreen, monospace; letter-spacing: 1px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 8px; display: flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; }
.g3-chip.acid { background: var(--accent); color: var(--ground) !important; border-color: var(--accent); }
.g3-topnav, .g3-track { display: none; }
.g3-track { gap: 0; border: 1px solid var(--line); }
.g3-track a, .g3-track span { font: 400 10px Silkscreen, monospace; letter-spacing: 1px; padding: 7px 9px; text-decoration: none; color: var(--muted); }
.g3-track a[aria-current] { background: var(--surface); color: var(--ink); }
.g3-track .soon { color: var(--faint); }
.g3-trackrow { display: flex; justify-content: flex-end; }
.g3-trackrow .g3-track { display: flex; }

/* mode header */
.g3-mhead { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 4px; border-bottom: 1px solid var(--line); background: var(--ground); }
.g3-back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--ink) !important; }
.g3-mhead .sq { width: 10px; height: 10px; display: inline-block; }
.g3-mhead .name { font: 400 17px Silkscreen, monospace; letter-spacing: 2px; white-space: nowrap; }
.g3-mhead .right { margin-left: auto; }
.g3-mhead .pill { font: 400 11px Silkscreen, monospace; letter-spacing: 1px; padding: 7px 8px; white-space: nowrap; }
.g3-mhead .pill.out { border: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.g3-hdate { font: 400 10px Silkscreen, monospace; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.g3-hdate .d { color: var(--clay); }
@media (max-width: 600px) { .g3-deskonly { display: none !important; } }
@media (min-width: 601px) { .g3-phoneonly { display: none !important; } }
/* tab bar */
.g3-tabs { height: 62px; flex: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--board); position: sticky; bottom: 0; z-index: 6; }
.g3-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted) !important; font: 400 9px Silkscreen, monospace; letter-spacing: 1px; border-top: 3px solid transparent; min-height: 44px; }
.g3-tabs a[aria-current="page"] { color: var(--accent) !important; border-top-color: var(--accent); }
@media (min-width: 601px) {
  .g3-tabs { display: none; }
  .g3-topnav { display: flex; gap: 2px; margin-left: 18px; }
  .g3-topnav a { font: 400 11px Silkscreen, monospace; letter-spacing: 1px; color: var(--muted); text-decoration: none; padding: 8px 10px; min-height: 44px; display: flex; align-items: center; border-bottom: 3px solid transparent; }
  .g3-topnav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
  .g3-topnav a[href$="players.html"] { display: none; }   /* ENCY-01: ENCYCLOPEDIA (was PLAYERS) belongs to the desktop navigation (from 1024 px, below) - the tablet's line is as it was; the tablet reaches it by the footer */
  .g3-head .g3-track { display: flex; margin-left: 10px; }
  .g3-trackrow { display: none; }
  .g3-head, .g3-mhead { padding-left: max(16px, calc(50% - 560px)); padding-right: max(16px, calc(50% - 560px)); }
}
@media (max-width: 420px) {
  .g3-head { gap: 6px; padding: 0 12px; }
  .g3-brand { font-size: 16px; letter-spacing: 1px; gap: 8px; }
  .g3-chip { padding: 7px 6px; font-size: 10px; letter-spacing: .5px; gap: 4px; }
}
@media (max-width: 370px) {
  .g3-brand { font-size: 14px; } .g3-brand i { width: 10px; height: 10px; }
}
@media (max-width: 600px) { html { scroll-padding-bottom: 72px; } }   /* s3: a focused control never sits under the sticky tab bar */
.g3-tabs { padding-bottom: env(safe-area-inset-bottom); }
/* 44 px hit areas around the small header chips, the brand and the track switch (the visual stays as drawn) */
.g3-brand { min-height: 44px; }
.g3-hit { min-height: 44px; display: flex; align-items: center; text-decoration: none; min-width: 0; }
.g3-hit .g3-chip.acid { overflow: hidden; text-overflow: ellipsis; display: block; }
.g3-track a { min-height: 44px; display: flex; align-items: center; padding: 0 9px; }
.g3-track { border: 0; } .g3-track a span { display: block; padding: 7px 0; }
.g3-track a { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.g3-track a:first-child { border-left: 1px solid var(--line); } .g3-track a:last-child { border-right: 1px solid var(--line); }
.g3-track a[aria-current] { background: var(--surface); }
/* ENCY-01 3.4: the desktop top navigation leads to the players section. Between 1024 and 1119 px the line - with the
   RANKINGS entry of the online features as well - is set tighter, so that no entry wraps and the chips are not cut */
@media (min-width: 1024px) {
  .g3-topnav a[href$="players.html"] { display: flex; }
}
@media (min-width: 1024px) and (max-width: 1119px) {
  .g3-topnav { margin-left: 8px; }
  .g3-topnav a { padding-left: 4px; padding-right: 4px; letter-spacing: .5px; white-space: nowrap; }
}
/* RELEASE-01 3.2: between the phone and the desktop the header - with the RANKINGS entry of the online features - needs
   about 945 px (the brand, five entries, the sport switch, two chips) and pushed the page sideways on a tablet (50 px
   at 768). Up to 859 px the header is arranged as on the phone: the navigation set tighter and the sport switch in
   Today's own row under the header instead of the header (the other pages have no switch there, as on the phone);
   below 660 px the streak chip gives way to the rank chip. */
@media (min-width: 601px) and (max-width: 859px) {
  .g3-topnav { margin-left: 8px; }
  .g3-topnav a { padding-left: 4px; padding-right: 4px; letter-spacing: .5px; white-space: nowrap; }
  .g3-head .g3-track { display: none; }
  .g3-trackrow { display: flex; }
}
@media (min-width: 601px) and (max-width: 659px) {
  .g3-chips .g3-chip:not(.acid) { display: none; }
}

/* LAUNCH-01 (L9): from 721 to 859 px no entry of the header is given up - the sport switch is back in the line on
   every page but Today (which keeps the switch in its own row and its header as it was). With the RANKINGS entry of
   the online features the line cannot hold everything: on those pages the two chips take a second line on the right
   and the first line keeps the brand, the five entries and the switch. Without that entry (a build with the online
   features off) the line is one, as before RELEASE-01. A browser without :has() keeps RELEASE-01's line - one line,
   the switch in Today's row only. Nothing changes below 721 px or from 860 px up. */
@media (min-width: 721px) and (max-width: 859px) {
  .g3-head .g3-track { display: flex; margin-left: 4px; }
  body.g3.today > .g3-head .g3-track { display: none; }
  body:not(.today) > .g3-head:has(.g3-topnav a[href="rankings.html"]) { flex-wrap: wrap; height: auto; min-height: 56px; row-gap: 0; }
  body:not(.today) > .g3-head:has(.g3-topnav a[href="rankings.html"]) .g3-chips { flex-basis: 100%; justify-content: flex-end; align-items: center; height: 44px; margin-left: 0; }
}
@supports not selector(:has(a)) {
  @media (min-width: 721px) and (max-width: 859px) {
    .g3-head .g3-track { display: none; }
  }
}

/* ---- FIX-01 Block 1 ---------------------------------------------------------------------------------------------
   The desktop (the layout desk.js switches on): every page's header spans the window with Today's side padding - the
   wordmark, each item, the switch and the chips stand at the same x on every page at the same width. (Before, the
   other pages' header sat in their 1120 px column: 136 px to the right at 1440.) Today's own grid rule in g3.css
   gives its header the same padding (--pad). */
@media (min-width: 1024px) and (min-height: 600px) {
  .g3-head { padding-left: max(24px, calc(50vw - 840px)); padding-right: max(24px, calc(50vw - 840px)); }
}
/* the phone's title header of a page of web/app.css: its title is the page's h1, cut with an ellipsis where it does
   not fit */
.g3-ptitle .name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* ---- FIX-02 Block 2 ------------------------------------------------------------------------------------------------
   The account control (web/js/acct_head.js): ONE button at the right end of every header - Today's, the title header of
   the other pages (phone and desktop), the encyclopedia's and the five games' - the same place on the phone and the
   desktop. A guest: the person icon + «Save progress»; narrower than 400 px the icon alone with a small dot. Signed
   in: the nickname (narrower than 400 px its first letter in a circle) or the email's first letter in a circle. */
.g3-acct { flex: none; margin-left: auto; position: relative; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 10px; border: 1px solid var(--line-2, #3A4A7A); background: var(--surface, #121A2F); color: var(--ink, #EEF2FA); font: 600 13px Inter, sans-serif; letter-spacing: 0;
  white-space: nowrap; cursor: pointer; border-radius: 0; box-sizing: border-box; }
.g3-chips ~ .g3-acct, .right ~ .g3-acct, .g3-hdate ~ .g3-acct { margin-left: 6px; }
.g3-acct:hover { border-color: var(--accent, #D4FF3A); }
.g3-acct:focus-visible { outline: 2px solid var(--accent, #D4FF3A); outline-offset: 2px; }
.g3-acct-ic { position: relative; display: inline-flex; color: var(--accent, #D4FF3A); }
.g3-acct-dot { display: none; position: absolute; top: -2px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--clay, #D8703E); }
.g3-acct-nm { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.g3-acct-av { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent, #D4FF3A);
  color: var(--ground, #0B1020); font: 700 14px 'Space Grotesk', Inter, sans-serif; }
.g3-acct.in { padding: 0 8px; }
.g3-acct.nick .g3-acct-avn { display: none; }
.g3-acct-inf { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: #E8B931; color: #1A1405;
  font: 700 12px/16px Inter, sans-serif; font-style: normal; text-align: center; box-sizing: border-box; }
@media (max-width: 399px) {
  .g3-acct { padding: 0; }
  .g3-acct-t { display: none; }
  .g3-acct-dot { display: block; }
  .g3-acct.nick .g3-acct-nm { display: none; }
  .g3-acct.nick .g3-acct-avn { display: inline-flex; }
}

/* ---- FIX-02 Block 3 ------------------------------------------------------------------------------------------------
   The menu is TODAY · ME · ARCHIVE · ENCYCLOPEDIA (· RANKINGS with the online features): the tab bar takes as many equal
   columns as it has tabs. The chips read in plain words («🔥 3-day streak», «Qualifier · 0 pts») in the body font,
   never cut: where the row does not fit, the wordmark goes first (fitHead), the capybara stays. A tap on a chip opens
   a small note under it (.g3-pop, web/js/menu.js). */
.g3-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.g3-chipbtn { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: inherit; font: inherit; }
.g3-chips { flex: none; min-width: auto; }
.g3-chip { font: 600 12px Inter, system-ui, sans-serif; letter-spacing: 0; text-transform: none; padding: 6px 8px; }
.g3-chips .acid, .g3-hit .g3-chip.acid { overflow: visible; text-overflow: clip; min-width: auto; display: flex; }
@media (max-width: 420px) { .g3-chip { font-size: 12px; letter-spacing: 0; padding: 6px 7px; gap: 4px; } }
@media (max-width: 370px) { .g3-chip { font-size: 11px; padding: 6px 5px; } .g3-head { gap: 5px; } }
.g3-pop { position: fixed; z-index: 40; box-sizing: border-box; padding: 12px 14px; background: var(--surface, #121A2F); border: 1px solid var(--accent, #D4FF3A);
  color: var(--ink, #EEF2FA); font: 400 14px/1.4 Inter, system-ui, sans-serif; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.g3-pop p { margin: 0 0 6px; } .g3-pop .g3-pop-more { font-size: 12px; color: var(--muted, #8C98B8); }
.g3-pop a { display: inline-flex; align-items: center; min-height: 36px; color: var(--accent, #D4FF3A); font-weight: 600; }

/* FIX-02 Block 3 (the founder's addition, 17 Nov): Unlimited shows on the account control - a gold badge «UNLIMITED»
   under it, every page, phone and desktop (gold, never the green of the buttons); the guest's dot gives way to it */
.g3-acct.unl { border-color: #E8B931; }
.g3-acct-unl { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); padding: 2px 4px; background: #E8B931; color: #1A1405;
  font: 400 8px/1 Silkscreen, monospace; letter-spacing: 1px; font-style: normal; white-space: nowrap; pointer-events: none; }
.g3-acct.unl .g3-acct-dot { display: none !important; }
.g3-head > .g3-brand { flex: none; }   /* (FIX-02: the chips no longer shrink - the brand must not either: fitHead then drops the wordmark) */
@media (max-width: 370px) { .g3-mhead.g3-tight .name { font-size: 15px; letter-spacing: .5px; } .g3-mhead.g3-tight { padding-right: 8px; } }   /* (FIX-02: the account control fits a 360 px game header) */

/* FIX-03 Block 1: a sent code lives 20 minutes - the guest's control reads «Enter code» (at every width: the icon gives
   way on a narrow phone, the words stay) */
.g3-acct-tc { font: 700 13px Inter, system-ui, sans-serif; color: var(--accent, #D4FF3A); }
.g3-acct.code { border-color: var(--accent, #D4FF3A); padding: 0 10px; }
@media (max-width: 399px) { .g3-acct.code { padding: 0 8px; } .g3-acct.code .g3-acct-ic { display: none; } .g3-acct-tc { font-size: 12px; line-height: 1.1; white-space: normal; width: 44px; text-align: center; } }
