/* Ulysses Universe - shared top navigation.
   Generated markup comes from _partials/nav.json via scripts/build_nav.py.
   Values are copied verbatim from the original free-games/ nav so that any
   remaining inline copies of these rules resolve identically whichever order
   they load in. Do not "tidy" the numbers without checking a rendered page. */

/* position:fixed, not sticky. Several game pages set `body { display:flex }`
   for their own layout; a sticky nav becomes a flex item there and gets thrown
   down the page (this broke /bow). Fixed takes it out of flow entirely, so the
   nav is immune to whatever layout the host page uses. ulysses-nav.js measures
   the rendered height and pads the body to match. */
nav.top {
  border-bottom: 1px solid var(--border, rgba(244, 236, 216, 0.12));
  padding: 14px 0;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  box-sizing: border-box;
}
nav.top * {
  box-sizing: border-box;
}
/* `.wrap` is also a page-level container class on most pages, so pin the values
   we need here rather than inheriting whatever the host page happens to set. */
nav.top .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}
nav.top .brand {
  font-family: var(--font-display, 'Cinzel', ui-serif, Georgia, serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--gold, #d4af37);
  text-decoration: none;
}
nav.top .brand span {
  color: var(--bone, #f4ecd8);
  font-weight: 400;
}
nav.top ul.menu {
  display: flex;
  gap: 22px;
  list-style: none;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
}
nav.top a,
nav.top .dd-toggle {
  font-family: var(--font-ui, 'Rajdhani', system-ui, sans-serif);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--grey, rgba(244, 236, 216, 0.6));
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
nav.top a:hover,
nav.top a.active,
nav.top .dd-toggle:hover,
nav.top .dd-toggle.open {
  color: var(--gold, #d4af37);
}

/* Dropdown ------------------------------------------------------------- */
nav.top li.dd {
  position: relative;
}
nav.top .dd-toggle::after {
  content: ' ▾';
  opacity: 0.7;
}
nav.top .dd-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  background: var(--void-dark, #15151c);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 4px;
  min-width: 260px;
  padding: 8px 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 200;
}
nav.top .dd-menu.open {
  display: block;
}
/* Specificity note: `nav.top a` (0,0,1,2) outranks a bare `.dd-menu a` (0,0,1,1),
   so the original rules were losing padding:0 and color:grey to the top-level
   link rule and the dropdown rows rendered flush to the panel edge. Scoping
   these under nav.top raises them to (0,0,2,2) so they win as intended. */
nav.top .dd-menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 11px 18px;
  color: var(--bone, #f4ecd8);
  font-size: 13px;
  text-transform: none;
}
nav.top .dd-menu a:hover {
  background: rgba(212, 175, 55, 0.06);
  color: var(--gold, #d4af37);
}
nav.top .dd-menu .ddl-name {
  font-family: var(--font-ui, 'Rajdhani', system-ui, sans-serif);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
nav.top .dd-menu .ddl-tag {
  font-family: var(--font-ui, 'Rajdhani', system-ui, sans-serif);
  font-size: 10px;
  color: var(--gold-dim, #8a7325);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  white-space: nowrap;
}
nav.top .dd-menu .dd-section {
  font-family: var(--font-ui, 'Rajdhani', system-ui, sans-serif);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.55);
  padding: 10px 16px 4px;
  margin-top: 4px;
  border-top: 1px solid rgba(212, 175, 55, 0.08);
}
nav.top .dd-menu .dd-section:first-child {
  border-top: none;
  margin-top: 0;
}
nav.top .dd-menu .dd-all {
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  padding-bottom: 12px;
  margin-bottom: 4px;
}
nav.top .dd-menu a.current {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold, #d4af37) !important;
}

/* Calls to action ------------------------------------------------------ */
nav.top .nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}
nav.top a.cta-primary {
  background: var(--gold, #d4af37);
  color: var(--void-black, #0a0a0f);
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 4px;
  white-space: nowrap;
}
nav.top a.cta-primary:hover {
  background: var(--gold-light, #e5c156);
  color: var(--void-black, #0a0a0f);
}
nav.top a.cta-secondary {
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold, #d4af37);
  padding: 6px 13px;
  border-radius: 4px;
  white-space: nowrap;
}
nav.top a.cta-secondary:hover {
  border-color: var(--gold, #d4af37);
  background: rgba(212, 175, 55, 0.08);
}

/* Panel + burger ------------------------------------------------------- */
nav.top .nav-panel {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
nav.top .nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 4px;
  color: var(--gold, #d4af37);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
nav.top .nav-burger svg {
  width: 22px;
  height: 22px;
  display: block;
}
nav.top .nav-scrim {
  display: none;
}

/* Drawer. Breakpoint is 1024px so iPhone Pro Max landscape (932px) still gets
   the drawer rather than a cramped horizontal row - same call the previous
   runtime nav made. */
@media (max-width: 1023px) {
  nav.top .nav-burger {
    display: inline-flex;
  }
  nav.top .nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 86vw;
    max-width: 380px;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
    background: var(--void-black, #0a0a0f);
    border-left: 1px solid rgba(212, 175, 55, 0.25);
    padding: 74px 22px 32px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
  }
  nav.top.drawer-open .nav-panel {
    transform: translateX(0);
    visibility: visible;
  }
  nav.top.drawer-open .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 2050;
    background: rgba(5, 5, 8, 0.72);
  }
  nav.top ul.menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  nav.top ul.menu > li {
    border-bottom: 1px solid rgba(244, 236, 216, 0.08);
  }
  nav.top ul.menu > li > a,
  nav.top .dd-toggle {
    display: block;
    width: 100%;
    padding: 15px 2px;
    font-size: 15px;
    text-align: left;
  }
  /* In the drawer the dropdowns become inline accordions, not overlays. */
  nav.top .dd-menu {
    position: static;
    transform: none;
    display: none;
    min-width: 0;
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: rgba(244, 236, 216, 0.03);
    padding: 4px 0 10px;
  }
  nav.top .dd-menu.open {
    display: block;
  }
  nav.top .dd-menu a {
    padding: 11px 12px;
  }
  nav.top .nav-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 22px;
    width: 100%;
  }
  nav.top a.cta-primary,
  nav.top a.cta-secondary {
    text-align: center;
    padding: 13px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  nav.top .nav-panel {
    transition: none;
  }
}
