/* ===========================================================================
   FAVOURITES (web/src/favorites.js): the heart after every game's name,
   the "Add to favourites" button on every end card, the bubble that says so,
   and the My favorites page. Theme tokens only, so both themes follow.
   =========================================================================== */
/* THE SITE'S OWN COLOUR, NOT RED (29 Oct 2026). The owner: "the heart should
   be slightly larger and blue on light mode and green on dark mode to match the
   theme of the site" — which is the accent pair every pill and Play button
   wears (--accent-face: blue on paper, green on dark; theme.css).

   --fav-key is a favorite's face on the page and --fav-key-lip the solid edge
   under it: the Play button's 3D lip (.primary, game.css) on a plain key.

   ON DARK THE KEY IS THE GHOST BUTTON'S FACE (.share-btn.ghost, game.css): the
   panel colour is the card's own, so a key in it showed only its lip — a thin
   dark line, the look the owner asked to lose. */
:root{--fav-heart:var(--accent-face);--fav-key:var(--sheet-2);--fav-key-hi:var(--sheet-3);
  --fav-key-lip:rgba(0,0,0,.45)}
html[data-theme="light"]{--fav-key:#FFFFFF;--fav-key-hi:#FFFDF6;--fav-key-lip:#DCD5C3}

/* THE HEART. An outline until pressed, filled once it is a favorite, in the
   accent either way. 24px of heart in a 32px target. In a game's bar the box
   gives back its extra height (-6px top and bottom: 20px, under the pill's
   21.8 — measured, a bar with the heart is exactly as tall as one without),
   and -4px on the LEFT pulls it in to its pill past the bar's 10px gap: it
   stands after the pill since 5 Nov 2026 (the owner: "Move the heart to the
   right of the pill rather than the left"). */
.fav-heart{appearance:none;-webkit-appearance:none;border:0;background:none;
  padding:0;margin:0;width:32px;height:32px;flex:none;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:50%;color:var(--fav-heart);cursor:pointer;box-shadow:none;
  -webkit-tap-highlight-color:transparent;vertical-align:middle}
.gg-bar .fav-heart,.hl-bar .fav-heart,#modeBanner .fav-heart{margin:-6px -3px -6px -4px}
/* LEVEL WITH THE PILL IN THE ONE BAR THAT IS NOT CENTRED (9 Nov 2026). The
   owner: "make sure that the heart for favorites next to the mode pill is
   always in line with the mode pill on the same row". Every other bar centres
   its row, which centres the heart on the pill. The Gauntlet's hangs from its
   top (gauntlet.css .tg-bar), so the heart is centred by measure instead: the
   pill is 21.75px tall (10.5px type at line-height 1.5, 3px above and below,
   .gg-bar .tag) and the heart's box 32px, so its top sits 5.125px above the
   pill's. No font enters into it, so a phone and a computer agree. */
.gg-bar.tg-bar .fav-heart{margin-top:calc((10.5px * 1.5 + 6px - 32px) / 2)}
.fav-heart svg{width:24px;height:24px;fill:none;stroke:currentColor;
  stroke-width:2.1;stroke-linejoin:round;overflow:visible}
.fav-heart.is-on svg{fill:currentColor}
/* base.css paints every hovered button dark blue and lifts it; a heart is not
   a slab, so it keeps its ground and only swells a little. */
@media (hover:hover) and (pointer:fine){
  .fav-heart:hover{background:none;transform:scale(1.1)}
}
.fav-heart:active{transform:scale(.94)}
.fav-heart:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.fav-heart.pop svg{animation:favPop .38s cubic-bezier(.3,1.6,.5,1)}
@keyframes favPop{0%{transform:scale(1)}40%{transform:scale(1.32)}100%{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){
  .fav-heart.pop svg{animation:none}
  .fav-heart:hover,.fav-heart:active{transform:none}
}

/* THE END CARD'S NEXT FAVOURITE, during a run through the list. */
.fav-next{width:100%;margin-top:10px}
.fav-next.gg-go{white-space:normal;line-height:1.25}

/* "ADDED TO YOUR FAVOURITES": the page's ink on its ground, so it reads in both
   themes, pointing at what was pressed. Fixed, so it never moves the page. */
.fav-pop{position:fixed;z-index:120;transform:translate(-50%,calc(-100% - 9px));
  background:var(--text);color:var(--bg);font:800 12.5px/1 var(--font);
  padding:8px 11px;border-radius:9px;white-space:nowrap;pointer-events:none;
  box-shadow:0 8px 22px rgba(0,0,0,.28);transition:opacity .3s}
.fav-pop::after{content:"";position:absolute;left:50%;top:100%;margin-left:-6px;
  border:6px solid transparent;border-top-color:var(--text)}
.fav-pop.below{transform:translate(-50%,9px)}
.fav-pop.below::after{top:auto;bottom:100%;border-top-color:transparent;
  border-bottom-color:var(--text)}
.fav-pop.out{opacity:0}

/* THE TAB. Its place between Play and Hall of Fame is the markup's; the
   look is .topnav a's own.

   IT COSTS THE TOP BAR ~110px, and a signed-in bar (brand, three tabs, the
   theme switch, the account chip, the bell, Friends, Sign out) had about that
   to spare at a 1024px window: with it, every label broke onto two lines, and
   at 820 the bar ran past its edge and cut the logo off. (It already did, a
   tab fewer, under ~780.)

   990 AND UP: one row, as before. The gaps come in a little up to 1180 and a
   tab's name never breaks, which is what fits it.

   701 TO 989: the tabs take a row of their own under the bar, centred over a
   hairline — the phone's arrangement (responsive.css), without its stacking
   of the account row. `flex-start` because base.css right-aligns the bar,
   which would push a logo left alone on its row over to the right.

   ONLY WHILE THE TAB IS THERE (2 Nov 2026). It ships shut and is drawn in for
   a reader it is open to (admins only, until the console says Everyone), so a
   bar without it keeps the bar it always had: every rule here asks for the
   tab first. `style*="none"` is the shut tag as shipped, and as favorites.js
   writes it when an account change closes the door. */
@media (min-width:990px){ .topnav:has(#navFav:not([style*="none"])) a{white-space:nowrap} }
@media (min-width:990px) and (max-width:1180px){
  .authbar:has(#navFav:not([style*="none"])){gap:18px;padding-left:24px;padding-right:24px}
  .authbar:has(#navFav:not([style*="none"])) .topnav{gap:18px}
  .authbar:has(#navFav:not([style*="none"])) .bar-right{gap:10px}
}
@media (min-width:701px) and (max-width:989px){
  .authbar:has(#navFav:not([style*="none"])){flex-wrap:wrap;justify-content:flex-start;row-gap:4px}
  .authbar:has(#navFav:not([style*="none"])) .topnav{order:3;width:100%;justify-content:center;gap:22px;
    border-top:1px solid var(--hair);padding-top:2px}
  .authbar:has(#navFav:not([style*="none"])) .topnav a{padding:6px 0;white-space:nowrap}
}
/* AND A GUEST'S BAR DOES THE SAME UP TO 1079px (23 Nov 2026), where "Create
   account to save your scores" leaves one row too little: the words of the
   switch beside it were breaking onto two lines at a 1024px window. */
@media (min-width:701px) and (max-width:1079px){
  .authbar:has(#authGuest:not([style*="none"])){flex-wrap:wrap;justify-content:flex-start;row-gap:4px}
  .authbar:has(#authGuest:not([style*="none"])) .topnav{order:3;width:100%;justify-content:center;gap:22px;
    border-top:1px solid var(--hair);padding-top:2px}
  .authbar:has(#authGuest:not([style*="none"])) .topnav a{padding:6px 0;white-space:nowrap}
}

/* THE GUEST'S ASK in the auth panel: a poster like the welcome view. */
.modal[data-view="favorites"] h2{text-align:center;text-wrap:balance}

/* ---------------------------------------------------------------- the page */
/* ROOM UNDER THE LAST ONE. The owner: "add more space at the bottom, the box
   is always cramping the bottom text". The list ended on the page card's own
   edge; 48px keeps the last favorite — and its lip — clear of it. */
.fav-wrap{max-width:680px;margin:0 auto;padding-bottom:48px}
.fav-sum{font-size:13px;color:var(--text-soft);margin:2px 0 14px}
.fav-sum b{color:var(--text);font-weight:800}
.fav-list{display:flex;flex-direction:column;gap:16px}
.fav-row.is-off .fav-info,.fav-row.is-off .fav-streak{opacity:.5}
.fav-info{min-width:0;display:block}
.fav-name{display:block;font:900 16px/1.2 var(--display);letter-spacing:-.005em;
  color:var(--text);overflow-wrap:anywhere}
.fav-label{display:block;margin-top:4px;font-size:12.5px;line-height:1.3;
  font-weight:600;color:var(--text-muted)}
.fav-today{color:var(--mint);font-weight:800;white-space:nowrap}
/* THE STREAK, a mini button rather than a chip: the buttons' face and lip,
   in amber. Two days or more (favorites.js). */
.fav-streak{display:inline-flex;align-items:center;gap:4px;padding:6px 10px 6px 8px;
  border-radius:999px;background:var(--sheet-2);color:var(--amber);
  box-shadow:0 2px 0 rgba(0,0,0,.18);font:900 14px/1 var(--display);
  white-space:nowrap}
.fav-streak svg{width:15px;height:15px;fill:currentColor}
.fav-streak b{color:var(--text);font-weight:900}
.fav-side{display:flex;align-items:center;gap:10px;flex:none}

/* PLAY, the site's Play button in small: the accent face, the display face in
   capitals, and the lip it sinks into when pressed. Played today, the ghost
   of it (.share-btn.ghost, game.css). */
.fav-play{font:900 14px/1 var(--display);letter-spacing:.04em;text-transform:uppercase;
  background:var(--accent-face);color:var(--accent-ink);border:0;border-radius:12px;
  padding:12px 18px;box-shadow:0 4px 0 var(--accent-lip);cursor:pointer;
  transition:transform .1s,box-shadow .1s}
@media (hover:hover) and (pointer:fine){
  .fav-play:hover{background:var(--accent-hi);transform:none}
}
.fav-play:active{transform:translateY(3px);box-shadow:0 1px 0 var(--accent-lip)}
.fav-row.is-played .fav-play{background:var(--sheet-2);color:var(--text);
  box-shadow:0 4px 0 var(--fav-key-lip)}
@media (hover:hover) and (pointer:fine){
  .fav-row.is-played .fav-play:hover{background:var(--sheet-3)}
}

/* A FAVORITE IS A KEY (2 Nov 2026, draft A of three, the owner's pick): its
   face, its lip, and no outline. Pressed anywhere it sinks into the lip the way
   Play does — except on the heart or on Play itself, which press on their own. */
.fav-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:12px;padding:15px 14px 15px 12px;
  background:var(--fav-key);border:0;border-radius:16px;
  box-shadow:0 5px 0 var(--fav-key-lip);cursor:pointer;
  transition:transform .1s,box-shadow .1s,background .1s}
@media (hover:hover) and (pointer:fine){
  .fav-row:hover{background:var(--fav-key-hi)}
}
.fav-row:active:not(:has(.fav-heart:active, .fav-play:active)){
  transform:translateY(3px);box-shadow:0 2px 0 var(--fav-key-lip)}

.fav-empty{text-align:center;padding:34px 16px 30px;background:var(--fav-key);
  border-radius:16px;box-shadow:0 5px 0 var(--fav-key-lip)}
.fav-empty h2{font:900 clamp(19px,4.6vw,24px)/1.2 var(--display);margin:6px auto 8px;
  max-width:24ch;text-wrap:balance}
.fav-empty p{color:var(--text-soft);margin:0 auto;max-width:36ch;font-size:14px}
.fav-empty-ico svg{width:40px;height:40px;fill:var(--fav-heart);stroke:none}
.fav-empty-go{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:18px}

@media (max-width:520px){
  .fav-row{gap:9px;padding:13px 11px 13px 8px}
  .fav-side{gap:8px}
  .fav-play{padding:11px 13px}
  .fav-streak{padding:5px 8px 5px 6px;font-size:13px}
  .fav-name{font-size:15px}
}
