/* Extracted from the existing home navigation and dialog system. Shared source. */
  /* ===== NAV ===== */
  nav {
    position: fixed; top: clamp(14px, 2.6vh, 26px); left: 50%; z-index: 50;
    transform: translateX(-50%);
    display: flex; align-items: center; gap: clamp(12px, 1.8vw, 22px);
    width: fit-content; max-width: calc(100% - 28px);
    padding: 8px 10px 8px 12px;
    background: rgba(255,255,255,0.82);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid rgba(30,40,32,0.10);
    border-radius: 12px;
    box-shadow:
      0 12px 34px rgba(31,42,31,0.16),
      0 3px 10px rgba(31,42,31,0.10),
      inset 0 1px 0 rgba(255,255,255,0.75);
  }
  /* narrow screens: drop the wordmark, keep the icon so the pill fits */
  @media (max-width: 720px) {
    nav { gap: 8px; padding: 6px 8px 6px 10px; max-width: calc(100% - 20px); border-radius: 20px; }
    .logo b { display: none; }
    .logo svg { width: 30px; height: 30px; }
  }
  .logo { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0; }
  .logo svg { width: 34px; height: 34px; }
  /* 👑 大世界 LOGO — clone the home logo (same SVG + HASHLINGS) so the world
     section opens with a brand mark that visually matches the nav. Centered,
     non-clickable (no #top jump — you're already in the world section). */
  .world-logo { justify-content: center; margin: 0 auto 8px; cursor: default; width: max-content; }
  .world-logo svg { width: 34px; height: 34px; }
  .logo b {
    font-size: 17px; letter-spacing: 3px; font-weight: 800;
    color: #24694f;
  }
  /* AnimeNavBar-style glass pill with floating mascot above the active tab */
  nav .links {
    display: inline-flex; align-items: center; gap: 4px;
    position: relative; padding: 5px; margin-right: 12px;
    background: rgba(244,246,240,0.65);
    border: 1px solid rgba(30,40,32,0.08);
    border-radius: 8px;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(31,42,31,0.12), 0 0 0 1px rgba(31,42,31,0.05);
    flex-shrink: 0;
    animation: navPillDrop .7s cubic-bezier(.22,1,.36,1) both;
    isolation: isolate;
  }
  nav .links a {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 18px;
    color: rgba(29,37,48,0.62);
    text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
    border-radius: 9999px;
    transition: color .3s ease;
    white-space: nowrap; flex-shrink: 0;   /* CJK labels must never wrap per-char */
  }
  nav .links a:hover { color: rgba(29,37,48,0.95); }
  nav .links a.active { color: #16211c; }
  nav .links a.active::before {
    content: ''; position: absolute; inset: 0; border-radius: 9999px;
    background: rgba(78,192,137,0.18);
    box-shadow: 0 0 0 1px rgba(78,192,137,0.45), inset 0 0 14px rgba(78,192,137,0.2);
    animation: navTabGlow 2.4s ease-in-out infinite;
    pointer-events: none;
  }
  nav .links a.active::after {
    content: ''; position: absolute; inset: -2px; border-radius: 9999px;
    background: linear-gradient(90deg, transparent 0%, rgba(78,192,137,0.5) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: navTabShine 3s ease-in-out infinite;
    pointer-events: none;
  }
  .nav-mascot {
    position: absolute; top: -42px; left: 0;
    width: 48px; height: 48px;
    pointer-events: none;
    filter: drop-shadow(0 6px 12px rgba(31,42,31,0.28));
    transition: left .45s cubic-bezier(.22,1,.36,1);
    z-index: 2;
  }
  /* arrow variant — sits closer to the pill so it reads as "stuck in" */
  .nav-mascot--arrow { top: -26px; width: 44px; height: 44px; }
  .nav-mascot--arrow svg { width: 100%; height: 100%; image-rendering: pixelated; animation: navMascotBob 2.4s ease-in-out infinite; }
  @keyframes navPillDrop {
    0%   { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0);     opacity: 1; }
  }
  @keyframes navTabGlow {
    0%, 100% { opacity: .7; transform: scale(1); }
    50%      { opacity: 1;  transform: scale(1.02); }
  }
  @keyframes navTabShine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  @keyframes navMascotBob {
    0%, 100% { transform: translateY(0)   rotate(-3deg); }
    50%      { transform: translateY(-4px) rotate(3deg); }
  }
  .nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-shrink: 0; flex-wrap: nowrap; }
  .modal {
    position: fixed; inset: 0; z-index: 100;
    display: none; align-items: center; justify-content: center;
    background: rgba(26,34,26,0.45); backdrop-filter: blur(4px);
    padding: 20px; overflow-y: auto; overscroll-behavior: contain;
  }
  .modal.show { display: flex; }
  .modal-card {
    position: relative; max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 12px; padding: 28px; width: 470px; max-width: 100%;
  }
  .modal-card h3 { font-size: 15px; text-align: center; margin-bottom: 18px; }
