/* ============================================================
   Book Buddies App — shared page navigation shell
   Menu button + slide-out menu, centered Book Buddies logo,
   and the right-side Home / Globe / Cards buttons.
   Linked by landing.html, home.html, book_buddies/buddySelect2.html,
   book_buddies/iceGlobe.html so the nav stays identical everywhere.
   Positions are absolute within each page's frame element.
   ============================================================ */

/* Book Buddies logo — same size and place on every page */
.floating-logo {
  position: absolute;
  top: 8px;
  left: 50%;
  z-index: 5;
  width: 232px;
  height: 104px;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

/* ---------- Corner buttons ---------- */
.menu-button {
  position: absolute;
  top: 12px;
  z-index: 100;   /* above page content (buddySelect2 cards/controls reach z-62) */
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(222, 246, 255, 0.42);
  border-radius: 8px;
  background: rgba(13, 27, 57, 0.38);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  pointer-events: auto;
}

.menu-button.is-left {
  left: 16px;
  z-index: 220;   /* stays on top of the open panel */
}

.menu-button.is-right {
  right: 16px;
}

/* Mute, directly under the menu button. 64 is the same step the right-hand
   column uses (12 + 46 + 6), so the two columns line up across the frame.

   Deliberately NOT raised to the menu button's z-index: .menu-panel opens at
   exactly this position, so the panel covers it while open. The two are
   mutually exclusive by design -- close the menu, then mute. */
.menu-button.is-left-2 {
  top: 64px;
  left: 16px;
}

/* 64 and 116, not 68 and 124. At 10px gaps the third button ended at y=170 and
   the globe page's chip strip starts at 168 -- a 2px overlap that read as a
   mistake. The chips cannot move (they sit right above Geo's head), so the
   column closed up instead: 6px between buttons, which clears the chips by 6.
   The buttons keep their full 46px, since the target size is what prevents
   mis-taps and is the thing worth protecting. Applied site-wide so the
   navigation lands in the same place on every page.

   Keep .menu-button.is-right-2 as one compound selector. Splitting it across a
   comment turns the newline into a descendant combinator, and the rule silently
   stops matching anything. */
.menu-button.is-right-2 {
  top: 64px;
  right: 16px;
}

.menu-button.is-right-3 {
  top: 116px;
  right: 16px;
}

/* Hamburger icon */
.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  transition: transform 200ms ease, top 200ms ease, background 160ms ease;
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-icon::before {
  top: -7px;
}

.menu-icon::after {
  top: 7px;
}

/* Hamburger morphs to an X when the menu is open */
.menu-button.is-open .menu-icon {
  background: transparent;
}

.menu-button.is-open .menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-button.is-open .menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Icon glyphs (home, globe, cards) */
.home-icon {
  width: 22px;
  height: 22px;
  display: block;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28));
}

/* Mute icon. One SVG carrying both states: the two arcs are the sound, the
   slash is the muted state, and the button's .is-muted class swaps which are
   drawn. Two separate SVGs would be two things to keep in visual sync. */
.mute-icon {
  width: 23px;
  height: 23px;
  display: block;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28));
}

.mute-icon .slash { display: none; }
.menu-button.is-muted .mute-icon .wave { display: none; }
.menu-button.is-muted .mute-icon .slash { display: block; }

/* ---------- Slide-out menu ---------- */
.menu-backdrop {
  position: absolute;
  inset: 0;
  z-index: 200;   /* over content + right-side buttons when the menu opens */
  background: rgba(6, 12, 8, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.menu-panel {
  position: absolute;
  top: 64px;
  left: 16px;
  z-index: 210;
  width: min(72%, 258px);
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(222, 246, 255, 0.42);
  background: rgba(13, 27, 57, 0.42);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform-origin: top left;
  opacity: 0;
  transform: scale(0.92) translateY(-6px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.3, 0.9, 0.35, 1.15);
}

.menu-panel.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Notification badge on the menu button, the way an app icon carries a count.
   .menu-button is already position:absolute, so this anchors to it directly.
   The white ring is what keeps it legible over whatever video is playing
   behind the button. */
.menu-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid #fff;
  background: linear-gradient(#ff5a4d, #e0332a);
  color: #fff;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* The same flag used on the Match Three tile, so the badge on the button, the
   menu row and the game icon all read as one trail to follow. */
.menu-new {
  flex: 0 0 auto;
  padding: 3px 8px 4px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: linear-gradient(#ff5a4d, #e0332a);
  color: #fff;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

/* Rows carrying a flag lay out as a row so the pill sits at the right edge. */
.menu-panel a.has-new {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.menu-panel a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: #fff7df;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.menu-panel a + a {
  margin-top: 2px;
}

.menu-panel a:hover,
.menu-panel a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

/* Archive disclosure row — no persistent highlight box */
.menu-disclosure {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #fff7df;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.menu-disclosure:focus-visible {
  outline: none;
}

.disclosure-tri {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: #cfe0ff;
  transition: transform 220ms ease;
}

.menu-disclosure.is-open .disclosure-tri {
  transform: rotate(90deg);
}

/* Animated sublist (collapses to zero height) */
.menu-sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms ease;
}

.menu-sub.is-open {
  grid-template-rows: 1fr;
}

.menu-sub-inner {
  overflow: hidden;
}

.menu-sub-inner a {
  display: block;
  padding: 10px 14px 10px 32px;
  border-radius: 10px;
  color: #e9e7dc;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.menu-sub-inner a:hover,
.menu-sub-inner a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}
