/* site-nav.css — the site's top bar (site/site-nav.mjs, concept D2): a slim frosted see-through bar, sticky at the top;
   the wordmark and then Games (a disclosure: All games, High scores) on the left; Connect your AI and Login on the right,
   or Connect your AI and the account chip and its menu when signed in. A green line along the top edge, with a soft glow under it, marks
   the current section. When the bar is under 780px wide the links (and Connect your AI) fold into one menu button.

   Every page family links it (the v3 account, profile and Terms pages, the design-system home, tree and game pages, the
   join and 404 pages), so nothing here leans on a page's own sheet: the bar carries its own copy of the design sheet v3
   tokens (site/account-assets/v3.css) and every rule is scoped under .cv-nav. The account chip and its menu are the
   account pages' own rules (v3.css "top bar" and its 640px rules), copied value for value under .cv-nav; their look is
   not changed here. This sheet is linked after a page's own sheets, so its two font faces (the site's own files under
   /shared/fonts/) are the ones a page uses. */

@font-face{font-family:"Russo One";font-weight:400;font-style:normal;font-display:swap;src:url(/shared/fonts/russo-one.woff2) format("woff2")}
@font-face{font-family:"Rubik";font-weight:300 900;font-style:normal;font-display:swap;src:url(/shared/fonts/rubik.woff2) format("woff2")}

/* The bar is drawn at 80% of its design size (--nav-zoom), the size it had at an 80% browser zoom: the bar row
   (.cv-nav__bar, with everything in it) is zoomed, and the header around it is not, so a page's own margins on the header
   and the narrow-width container queries keep their real pixels. So the wordmark, type, padding, menus and Login all shrink together. ONE number drives the design size:
   --nav-h-base (84px, 68px on a phone). Inside the bar --nav-h is that design number (the zoom then scales it); outside
   the bar --nav-h is the height the bar really takes, which every page's sticky offset and scroll margin uses. */
:root{--nav-zoom:.8;--nav-h-base:84px;--nav-h:calc(var(--nav-h-base)*var(--nav-zoom))}
@media (max-width:780px){:root{--nav-h-base:68px}}
/* an anchor jumped to on a page with the bar lands below it, not under it */
html:has(.cv-nav){scroll-padding-top:calc(var(--nav-h) + 8px)}

/* ===== the bar ===== */
.cv-nav{
  /* design sheet v3 tokens, as v3.css names and sets them (the page gutter is set on the bar row below) */
  --ground:#0a0d12; --tone-1:#10161d; --tone-2:#172029; --tone-3:#1f2a36; --ink:#e8ecf1; --dim:#93a0ad;
  --mint:#78d8aa; --mint-bright:#c8fce3; --mint-deep:#2f8a62; --coin:#ffc94d; --danger:#ff6b6b;
  --f-show:"Russo One","Arial Black",Impact,sans-serif;
  --f-text:"Rubik","Segoe UI",system-ui,sans-serif;
  --surface-raised:linear-gradient(165deg,#25323f 0%,#1b2631 48%,#151e27 100%);
  --surface-low:linear-gradient(170deg,#18222d,#10171f);
  --edge-light:inset 0 1px 0 #ffffff1f; --edge-dark:inset 0 -2px 0 #00000059;
  --shadow-contact:0 2px 3px #00000066; --shadow-soft:0 10px 22px -8px #00000099;
  --depth-raised:var(--edge-light),var(--edge-dark),var(--shadow-contact),var(--shadow-soft);
  --depth-recessed:inset 0 2px 5px #00000080,inset 0 -1px 0 #ffffff12;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:24px; --space-6:32px;
  --radius-quiet:12px; --radius-card:20px; --radius-pill:999px; --step--1:15px;
  container:cv-nav/inline-size;
  position:sticky;top:0;z-index:60;
  display:block;box-sizing:border-box;width:auto;max-width:none;margin:0;padding:0;border:0;
  color:var(--ink);font:400 16px/1.55 var(--f-text);letter-spacing:normal;text-transform:none;text-align:left;
  /* the frosted glass (D2, shared with concept B): the page slides under it and shows through softly */
  background:color-mix(in srgb,var(--ground) 80%,transparent);
  -webkit-backdrop-filter:blur(18px) saturate(1.2);backdrop-filter:blur(18px) saturate(1.2);
  box-shadow:0 1px 0 #ffffff0d,0 12px 28px -14px #000;
}
.cv-nav *,.cv-nav *::before,.cv-nav *::after{box-sizing:border-box}
.cv-nav [hidden]{display:none!important}
.cv-nav svg.cv-nav__sprite{position:absolute;width:0;height:0;overflow:hidden}
.cv-nav svg.i{width:20px;height:20px;flex:none}
.cv-nav button{font:inherit;color:inherit;margin:0}
.cv-nav p{margin:0}
/* A page's own link and button effects stay off the bar: the join and 404 pages (site.css) lift, ring and glow every
   control with rules as strong as (0,4,0) and take the focus outline away, so these repeat the bar's class to stay
   above them. The bar's controls that have a shadow of their own put it back below, just as strongly. */
.cv-nav.cv-nav.cv-nav :is(a,button):is(:hover,:focus-visible,:active){transform:none;box-shadow:none}
.cv-nav.cv-nav.cv-nav :is(a,button):focus-visible{outline:3px solid var(--coin);outline-offset:3px;border-radius:6px}
.cv-nav.cv-nav.cv-nav .cv-nav__link:focus-visible{outline-offset:-3px;border-radius:0}
.cv-nav.cv-nav.cv-nav :is(button.who,.cv-nav__burger):is(:hover,:focus-visible,:active){box-shadow:var(--depth-recessed)}
.cv-nav :focus-visible{outline:3px solid var(--coin);outline-offset:3px;border-radius:6px}

.cv-nav__bar{zoom:var(--nav-zoom);--nav-h:var(--nav-h-base);--gutter:24px;
  /* the logo lockup, the same on every bar (design-system tokens.css --lockup-tree .68, --lockup-word .42): the tree's height and
     the size of the words beside it (the site's "chimpvibe" and the game page's title), both as parts of the bar's height */
  --nav-tree:calc(var(--nav-h)*.68);--nav-word:calc(var(--nav-h)*.42);position:relative;display:flex;align-items:center;gap:var(--space-2);height:var(--nav-h);padding:0 var(--gutter)}

/* the wordmark: the tree (its see-through copy, /brand/mark-clear.png), then white chimp, green vibe with apple i's.
   The tree is the game page's own tree at the same --nav-tree, and the words are set like the game's title: their x-height
   is Rubik's at --nav-word (0.519em, so the 167.78-unit-tall words svg, 70 units of x-height, is 1.244em), their baseline
   dropped .086em onto the title's, and the gap from the tree is the title's (owner, 2026-11-18: one lockup on every page). */
.cv-nav__brand{display:flex;align-items:center;gap:var(--space-4);flex:none;margin-right:var(--space-3);text-decoration:none;border-radius:6px}
.cv-nav__brand .cv-wordmark{display:block;width:auto;max-width:none;overflow:visible}
.cv-nav__brand .cv-nav__tree{height:var(--nav-tree)}
.cv-nav__brand .cv-nav__words{position:relative;top:.086em;font-size:var(--nav-word);height:1.244em}

/* ===== the links (D: on the right, full height, a green top-edge line over the current one) ===== */
.cv-nav__links{display:flex;align-items:stretch;align-self:stretch;margin-left:var(--space-4);margin-right:auto;min-width:0}
.cv-nav__item{position:relative;display:flex}
.cv-nav .cv-nav__link{position:relative;display:flex;align-items:center;gap:6px;height:100%;padding:0 calc(var(--nav-h)*.26);border:0;border-radius:0;background:none;
  font:500 18px/1 var(--f-text);color:var(--dim);text-decoration:none;white-space:nowrap;cursor:pointer;transition:color .14s,background-color .14s}
.cv-nav__link::before{content:"";position:absolute;left:calc(var(--nav-h)*.14);right:calc(var(--nav-h)*.14);top:0;height:3px;border-radius:0 0 3px 3px;background:transparent}
.cv-nav__link:hover,.cv-nav__toggle[aria-expanded="true"]{color:var(--ink);background:#ffffff08}
.cv-nav__link.is-current{color:var(--ink);background:linear-gradient(180deg,color-mix(in srgb,var(--mint) 13%,transparent),transparent 85%)}
.cv-nav__link.is-current::before{background:var(--mint);box-shadow:0 0 10px color-mix(in srgb,var(--mint) 60%,transparent)}
.cv-nav__toggle .chev{width:18px;height:18px;color:var(--dim);transition:transform .14s ease}
.cv-nav__toggle[aria-expanded="true"] .chev{transform:rotate(180deg)}

/* ===== the right end: Connect your AI, Login (a dark rounded button), the account chip, the phone menu button ===== */
.cv-nav__end{display:flex;align-items:center;gap:var(--space-2);flex:none}
/* Connect your AI: bold mint text with a solid green underline bar (3px, a gap below the words); no box, no background.
   It sits just left of Login or the account chip, and folds into the phone menu with the other links. */
.cv-nav__connect{display:inline-flex;align-items:center;white-space:nowrap;cursor:pointer;margin-right:var(--space-3);border-radius:6px;
  font:700 calc(17px + (var(--nav-h) - 70px)*.1)/1.3 var(--f-text);color:var(--mint-bright);
  text-decoration:underline;text-decoration-color:var(--mint-deep);text-decoration-thickness:3px;text-underline-offset:7px;text-decoration-skip-ink:none;transition:color .14s,text-decoration-color .14s}
.cv-nav a.cv-nav__connect:is(:hover,:focus-visible){color:#fff;text-decoration-color:var(--mint)}
/* The Login text is mint in every state and on every page, on a dark rounded button with no border. `.cv-nav a.cv-nav__login`
   outranks page link rules such as `.cv-home a{color:inherit}` and the sheets' bare `a` / `a:visited`; the state selectors
   keep hover, focus, visited and active from ever recolouring it. The colour is the bar's own token (it carries its own
   copy of the tokens, so the page's sheet cannot change it). */
.cv-nav__login{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer;
  font:700 calc(17px + (var(--nav-h) - 70px)*.1)/1 var(--f-text);background:var(--tone-2);padding:calc(var(--nav-h)*.18) calc(var(--nav-h)*.34);border:0;border-radius:14px;text-decoration:none;transition:background-color .14s}
.cv-nav a.cv-nav__login,.cv-nav a.cv-nav__login:link,.cv-nav a.cv-nav__login:visited,.cv-nav a.cv-nav__login:hover,
.cv-nav a.cv-nav__login:focus,.cv-nav a.cv-nav__login:focus-visible,.cv-nav a.cv-nav__login:active{color:var(--mint-bright)}
.cv-nav a.cv-nav__login:hover{background:var(--tone-3)}
.cv-nav__burger{display:none;place-items:center;width:max(40px,calc(var(--nav-h)*.5));height:max(40px,calc(var(--nav-h)*.5));padding:0;border:0;border-radius:var(--radius-quiet);
  background:var(--surface-low);box-shadow:var(--depth-recessed);color:var(--ink);cursor:pointer;flex:none}
.cv-nav__burger:hover{filter:brightness(1.15)}
.cv-nav__burger svg{width:22px;height:22px}

/* ===== EXISTING: the account chip and its menu (v3.css "top bar"), unchanged ===== */
.cv-nav .who-menu{position:relative}
.cv-nav button.who{font:inherit;font-size:calc(15px + (var(--nav-h) - 70px)*.1);color:var(--ink);cursor:pointer;border:0;min-height:max(44px,calc(var(--nav-h)*.58));padding:5px 12px 5px 6px;border-radius:var(--radius-pill);background:var(--surface-low);box-shadow:var(--depth-recessed);display:flex;align-items:center;gap:var(--space-2)}
.cv-nav button.who:hover{filter:brightness(1.15)}
/* Unread inbox messages: a small coin dot on the avatar's top corner of the closed button (the menu's count is the same coin) */
.cv-nav button.who{position:relative}
.cv-nav .who-dot{position:absolute;top:50%;margin-top:calc(var(--nav-h)*-.2 - 3px);left:calc(6px + var(--nav-h)*.4 - 9px);width:11px;height:11px;border-radius:50%;background:var(--coin);box-shadow:0 0 0 2px #10171f;pointer-events:none}
.cv-nav button.who .chev{width:18px;height:18px;color:var(--dim);transition:transform .14s ease}
.cv-nav button.who[aria-expanded="true"] .chev{transform:rotate(180deg)}
.cv-nav .menu{position:absolute;top:calc(100% + var(--space-2));right:0;z-index:10;width:280px;max-width:calc(100vw - 2*var(--gutter));padding:var(--space-2);border-radius:var(--radius-card);background:var(--surface-raised);box-shadow:var(--depth-raised)}
.cv-nav .menu[hidden]{display:none}
.cv-nav .menu-head{padding:var(--space-3);margin-bottom:var(--space-1);border-radius:var(--radius-quiet);background:#0a1118;box-shadow:var(--depth-recessed)}
.cv-nav .menu-head b{display:block;font:400 18px/1.2 var(--f-show);color:var(--ink);overflow-wrap:anywhere}
.cv-nav .menu-head span{display:block;color:var(--dim);font-size:var(--step--1);overflow-wrap:anywhere}
.cv-nav .menu a,.cv-nav .menu button{position:relative;display:flex;align-items:center;gap:var(--space-3);width:100%;min-height:44px;padding:10px var(--space-3);border:0;border-radius:var(--radius-quiet);background:none;font:500 16px/1.2 var(--f-text);color:var(--mint-bright);text-decoration:none;text-align:left;cursor:pointer}
.cv-nav .menu a:hover,.cv-nav .menu button:hover{background:var(--tone-3)}
.cv-nav .menu svg.i{color:var(--mint)}
.cv-nav .menu .who-count{margin-left:auto;min-width:24px;padding:3px 7px;border-radius:999px;font:600 13px/1.2 var(--f-text);text-align:center;color:#0a1118;background:var(--coin)}
.cv-nav .menu hr{border:0;height:2px;margin:var(--space-2);background:#0a1118;box-shadow:0 1px 0 #ffffff12}
.cv-nav .menu .out,.cv-nav .menu .out svg.i{color:var(--danger)}
.cv-nav .menu .out:hover{background:linear-gradient(170deg,#492b31,#2b1b23)}
/* the account's chimp (shared/chimp-avatar.js), drawn by the server into the chip; the menu's bigger one is a <use> of it */
.cv-nav .avatar{width:calc(var(--nav-h)*.4);height:calc(var(--nav-h)*.4);border-radius:50%;display:block;flex:none;overflow:hidden;background:var(--tone-3)}
.cv-nav .avatar svg{display:block;width:100%;height:100%}
.cv-nav .menu-head{display:flex;align-items:center;gap:var(--space-3)}
/* 56px on screen: the bar row is drawn at --nav-zoom */
.cv-nav .menu-head .avatar{width:calc(56px/var(--nav-zoom));height:calc(56px/var(--nav-zoom))}
/* the "My Avatar" row: a full green tint while its page is open, and the small "New" pill at its right end
   (11px bold capitals, 2px 8px padding on screen) */
.cv-nav #who-panel a[aria-current="page"]{background:color-mix(in srgb,var(--mint) 12%,transparent);border-radius:calc(10px/var(--nav-zoom))}
.cv-nav .menu .menu-new{flex:none;margin-left:auto;padding:calc(2px/var(--nav-zoom)) calc(8px/var(--nav-zoom));border-radius:var(--radius-pill);background:var(--coin);color:#3d2a05;font:700 calc(11px/var(--nav-zoom))/1.3 var(--f-text);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.cv-nav .menu-head .menu-who{min-width:0}

/* ===== the Games menu: the account menu's card and rows, under its button; the current page is marked (D) ===== */
.cv-nav .cv-nav__menu{left:0;right:auto;top:calc(100% + 1px);width:240px}
.cv-nav .menu a[aria-current="page"]{background:linear-gradient(90deg,color-mix(in srgb,var(--mint) 13%,transparent),transparent 80%)}
.cv-nav .menu a[aria-current="page"]::before{content:"";position:absolute;left:0;top:10px;bottom:10px;width:3px;border-radius:0 3px 3px 0;background:var(--mint)}

/* ===== the phone menu: the same card, full width under the bar; its rows plain (ink), Games as a small group ===== */
.cv-nav .cv-nav__panel{left:var(--gutter);right:var(--gutter);top:calc(100% + 2px);width:auto;max-width:none}
.cv-nav .cv-nav__panel a{color:var(--ink);min-height:48px}
.cv-nav .cv-nav__panel a svg.i{color:var(--dim)}
.cv-nav .cv-nav__panel a[aria-current="page"] svg.i{color:var(--mint)}
.cv-nav__group{padding:var(--space-2) var(--space-3) var(--space-1);font:500 12px/1.2 var(--f-text);letter-spacing:.07em;text-transform:uppercase;color:var(--dim)}

/* ===== a page's own part of the bar (the game page: its name, its version tag, Tree) ===== */
.cv-nav__slot{display:flex;align-items:center;gap:var(--space-3);flex:1 1 auto;min-width:0}
.cv-nav__title{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:400 20px/1.1 var(--f-show);letter-spacing:.04em;text-transform:uppercase;color:var(--ink)}
.cv-nav__plain{flex:none;padding:10px 8px;border-radius:8px;font:500 15px/1 var(--f-text);color:var(--dim);text-decoration:none;white-space:nowrap;transition:color .14s,background-color .14s}
.cv-nav__plain:hover{color:var(--ink);background:#ffffff08}
.cv-nav--slotted .cv-nav__links{margin-left:var(--space-2)}

/* ===== the game page's own bar (site/game-bar.mjs): the tree, the game's title set like the wordmark, and on the right
   Game tree, Report, the account and room for the full-screen toggle (game.css places it). No site links. ===== */
.cv-nav--bare .cv-nav__brand{margin-right:var(--space-2)}
/* room for the full-screen toggle, which game.css draws outside the zoom at the real 24px, 40px and 8px */
.game-bar--playing .cv-nav__bar{padding-right:calc(24px/var(--nav-zoom) + max(40px/var(--nav-zoom),var(--nav-h)*.5) + var(--space-2))}
.game-bar .cv-nav__slot{flex:1 1 auto;min-width:0}
.game-bar .game-bar__name{flex:0 1 auto;min-width:0;margin:0;font:inherit}
.game-bar .game-bar__vh{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
/* the letters: heavy lower case in white, the last word of a longer title in the wordmark's green; a long title ends in
   an ellipsis rather than pushing the buttons off. The line is tall enough that the apples and the descenders are kept. */
.game-bar .game-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:.18em 2px 0;
  font:800 var(--nav-word)/1.3 var(--f-text);letter-spacing:-.005em;color:var(--ink)}
.game-bar .game-title__word--last{color:var(--mint)}
/* every i: Rubik's dotless stem with the wordmark's apple sitting just over it (shared/wordmark.mjs appleSymbol) */
.game-bar .game-title__i{position:relative}
.game-bar .game-title__apple{position:absolute;left:50%;top:-.175em;width:.34em;height:.39em;margin-left:-.17em;overflow:visible;pointer-events:none}
/* Game tree (the clear one: a mint button) and Report (quieter: a dim outline that warms on hover) */
.game-bar .game-bar__links{display:flex;align-items:center;gap:var(--space-2);margin-right:var(--space-2)}
.game-bar .game-bar__btn{display:inline-flex;align-items:center;gap:8px;height:max(40px,calc(var(--nav-h)*.5));padding:0 14px 0 12px;border:1px solid transparent;border-radius:var(--radius-quiet);
  font:500 calc(15px + (var(--nav-h) - 70px)*.1)/1 var(--f-text);text-decoration:none;white-space:nowrap;transition:color .14s,background-color .14s,border-color .14s}
.game-bar .game-bar__btn svg.i{width:20px;height:20px}
.game-bar .game-bar__btn--tree,.game-bar .game-bar__btn--report{color:var(--dim);background:none;border-color:#ffffff1a;padding:0 12px 0 10px}
.game-bar .game-bar__btn--tree svg.i,.game-bar .game-bar__btn--report svg.i{width:18px;height:18px}
/* Game tree rests exactly like Report; the green glow and border come only on hover or keyboard focus */
.game-bar .game-bar__btn--tree:is(:hover,:focus-visible){color:#fff;background:color-mix(in srgb,var(--mint) 22%,transparent);border-color:var(--mint)}
.game-bar .game-bar__btn--tree:is(:hover,:focus-visible) svg.i{color:var(--mint)}
.game-bar .game-bar__btn--report:hover{color:#ffc4c4;background:color-mix(in srgb,var(--danger) 9%,transparent);border-color:color-mix(in srgb,var(--danger) 50%,transparent)}
/* Back (right-hand group, just left of Game tree): the buttons' height, radius, type and focus ring, but quieter: no fill
   and no outline until hovered */
.game-bar .game-bar__btn--back{flex:none;color:var(--dim);background:none;padding:0 12px 0 6px;gap:4px}
.game-bar .game-bar__btn--back svg.i{width:22px;height:22px}
.game-bar .game-bar__btn--back:hover{color:var(--ink);background:#ffffff0d;border-color:#ffffff1a}
@container cv-nav (max-width:960px){
  /* the buttons fold to their icons; their words stay for a screen reader and in the tooltip */
  /* the bar is drawn at 80% (--nav-zoom), so a 50px button is 40px on screen: the icon buttons keep a 40px tap target */
  .game-bar .game-bar__btn,.game-bar .game-bar__btn:is(.game-bar__btn--report,.game-bar__btn--back){width:max(40px/var(--nav-zoom),calc(var(--nav-h)*.5));height:max(40px/var(--nav-zoom),calc(var(--nav-h)*.5));padding:0;justify-content:center}
  .game-bar .game-bar__label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
@container cv-nav (max-width:640px){
  /* the words of the lockup step down together: the game's title and the site's chimpvibe */
  .cv-nav__bar{--nav-word:calc(var(--nav-h)*.36)}
  .game-bar .game-bar__links{gap:6px;margin-right:0}
}

/* ===== narrow: the wordmark, Login or the chip, and one menu button for the links ===== */
@container cv-nav (max-width:780px){
  .cv-nav__bar{--gutter:16px}
  .cv-nav__links,.cv-nav__connect{display:none}
  .cv-nav__burger{display:grid}
  /* the bar is drawn at 80%, so a 55px control is 44px on screen: taps keep their 44px minimum */
  .cv-nav__burger{width:max(55px,calc(var(--nav-h)*.5));height:max(55px,calc(var(--nav-h)*.5))}
  .cv-nav__login{min-height:55px}
  .cv-nav button.who{min-height:55px}
  .cv-nav .cv-nav__panel a{min-height:60px}
  .cv-nav__brand{margin-right:0}
  .cv-nav__end{margin-left:auto}
  /* beside a page's own part only the tree stays, so the page's name keeps its room */
  .cv-nav--slotted .cv-nav__brand .cv-nav__words{display:none}
  .cv-nav--slotted .cv-nav__title{font-size:17px}
}
/* the account chip at phone width, as v3.css has it: no name, the menu across the width under the bar */
@container cv-nav (max-width:640px){
  .cv-nav .who-menu{position:static}
  .cv-nav button.who{padding:5px 8px 5px 5px}
  .cv-nav .who-dot{left:calc(5px + var(--nav-h)*.4 - 9px)}
  .cv-nav button.who .name{display:none}
  .cv-nav .menu{left:var(--gutter);right:var(--gutter);width:auto;max-width:none;top:calc(100% + 2px)}
  .cv-nav .menu a,.cv-nav .menu button{min-height:60px}
}

@media (prefers-reduced-motion:reduce){.cv-nav *{transition:none!important}}
@media print{.cv-nav{display:none}}
