<!DOCTYPE html>
<html lang="ko">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/icon-192x192.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    
    <!-- Google Analytics - SPA 라우팅 최적화 + 서치 콘솔 연동 -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-7GK1BFTECJ"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', 'G-7GK1BFTECJ', {
        cookie_domain: 'auto',
        cookie_flags: 'SameSite=None;Secure',
        // SPA 라우팅을 위해 자동 페이지뷰 비활성화
        send_page_view: false,
        transport_type: 'beacon',
        // 서치 콘솔 연동 강화
        site_speed_sample_rate: 100,
        custom_map: {
          'custom_parameter_1': 'page_language',
          'custom_parameter_2': 'traffic_source'
        }
      });
      
      // 검색 유입 감지 및 서치 콘솔 연동 데이터 전송
      var referrer = document.referrer;
      var traffic_source = 'direct';
      if (referrer.includes('googl')) {
        traffic_source = 'google_search';
      } else if (referrer.includes('bing')) {
        traffic_source = 'bing_search';
      } else if (referrer.includes('naver')) {
        traffic_source = 'naver_search';
      } else if (referrer.includes('daum')) {
        traffic_source = 'daum_search';
      } else if (referrer) {
        traffic_source = 'referral';
      }
      
      // 초기 페이지 로드 추적 + 검색 유입 정보
      gtag('event', 'page_view', {
        page_title: document.title,
        page_location: window.location.href,
        page_path: window.location.pathname,
        page_referrer: referrer,
        custom_parameter_1: window.location.pathname.split('/')[1] || 'ko',
        custom_parameter_2: traffic_source
      });
      
      // 서치 콘솔 연동: 검색 키워드 감지 (UTM 파라미터)
      var urlParams = new URLSearchParams(window.location.search);
      if (urlParams.get('utm_source') === 'google' || traffic_source === 'google_search') {
        gtag('event', 'search_traffic', {
          search_engine: 'google',
          page_path: window.location.pathname,
          utm_campaign: urlParams.get('utm_campaign') || 'organic'
        });
      }
    </script>
    
    <!-- SEO 최적화 메타 태그 -->
    <title>띠별나이 계산기 - 2025년 뱀띠 나이표, 만나이 세는나이 한번에</title>
    <meta name="description" content="띠별나이 한눈에 확인! 2025년 뱀띠부터 모든 띠 나이표. 만나이 세는나이 동시 계산, 2023년 만나이 통일법 적용." />
    <meta name="keywords" content="띠별나이, 띠별나이표, 2025년띠별나이, 뱀띠나이, 만나이계산기, korean age calculator, 한국나이계산기, 나이계산, 세는나이계산기" />
    
    <!-- 이미지 검색 최적화 메타태그 추가 -->
    <meta name="image" content="https://korean-age.com/website-preview.webp" />
    <meta name="thumbnail" content="https://korean-age.com/logo-square-512x512.svg" />
    
    <!-- 사이트 로고 (검색 엔진 최적화) -->
    <meta property="og:logo" content="https://korean-age.com/logo-square-512x512.svg" />
    <link rel="apple-touch-icon" sizes="512x512" href="/logo-square-512x512.svg" />
    <link rel="shortcut icon" type="image/svg+xml" href="/logo-square-512x512.svg" />
    
    <!-- Open Graph / Facebook -->
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://korean-age.com/" />
    <meta property="og:title" content="띠별나이 계산기 - 2025년 뱀띠 나이표, 만나이 세는나이" />
    <meta property="og:description" content="띠별나이 한눈에 확인! 2025년 뱀띠부터 모든 띠 나이표. 만나이 세는나이 동시 계산" />
    <meta property="og:image" content="https://korean-age.com/website-preview.webp" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />
    <meta property="og:image:alt" content="띠별나이 계산기 웹사이트 - 2025년 뱀띠 나이표, 만나이 세는나이 계산 화면" />
    <meta property="og:image:type" content="image/webp" />
    <meta property="og:logo" content="https://korean-age.com/logo-square-512x512.svg" />

    <!-- Twitter -->
    <meta property="twitter:card" content="summary_large_image" />
    <meta property="twitter:url" content="https://korean-age.com/" />
    <meta property="twitter:title" content="띠별나이 계산기 - 2025년 뱀띠 나이표, 만나이 세는나이" />
    <meta property="twitter:description" content="띠별나이 한눈에 확인! 2025년 뱀띠부터 모든 띠 나이표. 만나이 세는나이 동시 계산" />
    <meta property="twitter:image" content="https://korean-age.com/website-preview.webp" />
    <meta property="twitter:image:alt" content="띠별나이 계산기 웹사이트 화면" />
    
    <!-- 구조화된 데이터 - Organization 스키마 (구글 검색 로고 표시용) -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "Organization",
      "name": "띠별나이 계산기",
      "alternateName": ["한국 나이 계산기", "만나이 계산기", "세는나이 계산기", "띠계산기", "Korean Age Calculator"],
      "url": "https://korean-age.com",
      "logo": {
        "@type": "ImageObject",
        "url": "https://korean-age.com/logo-square-512x512.svg",
        "width": 512,
        "height": 512,
        "caption": "띠별나이 계산기 로고"
      },
      "image": [
        {
          "@type": "ImageObject",
          "url": "https://korean-age.com/logo-square-512x512.svg",
          "width": 512,
          "height": 512
        },
        {
          "@type": "ImageObject", 
          "url": "https://korean-age.com/logo-512x512.svg",
          "width": 512,
          "height": 512
        },
        {
          "@type": "ImageObject",
          "url": "https://korean-age.com/website-preview.webp",
          "width": 1200,
          "height": 630
        }
      ],
      "sameAs": [
        "https://korean-age.com"
      ],
      "description": "띠별나이 계산기 - 2025년 뱀띠부터 모든 띠 나이표 제공. 만나이, 세는나이, 한국나이를 계산하는 온라인 도구. 10개 언어 지원",
      "foundingDate": "2024",
      "contactPoint": {
        "@type": "ContactPoint",
        "contactType": "customer service",
        "url": "https://korean-age.com/ko/contact"
      },
      "address": {
        "@type": "PostalAddress",
        "addressCountry": "KR"
      },
      "areaServed": "Worldwide",
      "knowsLanguage": ["ko", "en", "ja", "zh-cn", "es", "fr", "de", "ms", "ru", "vi"],
      "potentialAction": {
        "@type": "SearchAction",
        "target": "https://korean-age.com/?q={search_term_string}",
        "query-input": "required name=search_term_string"
      },
      "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://korean-age.com/"
      }
    }
    </script>

    <!-- 구조화된 데이터 - WebApplication 스키마 (포털 최적화) -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebApplication",
      "name": "띠별나이 계산기",
      "alternateName": ["Korean Age Calculator", "만나이 계산기", "세는나이 계산기", "띠계산기", "2025년 띠별나이표"],
      "description": "띠별나이 계산기 - 2025년 뱀띠부터 모든 띠 나이표 제공. 만나이, 세는나이, 한국나이를 계산하는 온라인 도구. 2023년 만나이 통일법 적용, 10개 언어 지원",
      "url": "https://korean-age.com",
      "applicationCategory": "UtilityApplication",
      "operatingSystem": "All",
      "browserRequirements": "모든 브라우저 지원",
      "softwareVersion": "2025.1",
      "datePublished": "2024-01-01",
      "dateModified": "2025-01-26",
      "inLanguage": ["ko", "en", "ja", "zh-cn", "es", "fr", "de", "ms", "ru", "vi"],
      "keywords": "띠별나이, 띠별나이표, 2025년띠별나이, 뱀띠나이, 만나이계산기, 세는나이, 한국나이계산기, 띠계산기, 만나이통일법",
      "offers": {
        "@type": "Offer",
        "price": "0",
        "priceCurrency": "KRW",
        "availability": "https://schema.org/InStock"
      },
      "author": {
        "@type": "Organization",  
        "name": "띠별나이 계산기",
        "logo": {
          "@type": "ImageObject",
          "url": "https://korean-age.com/logo-square-512x512.svg",
          "width": 512,
          "height": 512
        },
        "url": "https://korean-age.com"
      },
      "image": [
        {
          "@type": "ImageObject",
          "url": "https://korean-age.com/website-preview.webp",
          "width": 1200,
          "height": 630
        },
        {
          "@type": "ImageObject",
          "url": "https://korean-age.com/logo-square-512x512.svg",
          "width": 512,
          "height": 512
        },
        {
          "@type": "ImageObject",
          "url": "https://korean-age.com/logo-512x512.svg",
          "width": 512,
          "height": 512
        }
      ],
      "applicationSubCategory": "Age Calculator",
      "logo": {
        "@type": "ImageObject",
        "url": "https://korean-age.com/logo-square-512x512.svg",
        "width": 512,
        "height": 512,
        "caption": "띠별나이 계산기 앱 로고"
      },
      "screenshot": "https://korean-age.com/website-preview.webp",
      "aggregateRating": {
        "@type": "AggregateRating",
        "ratingValue": "4.8",
        "reviewCount": "1250",
        "bestRating": "5",
        "worstRating": "1"
      },
      "featureList": [
        "띠별나이 계산",
        "만나이 계산",
        "세는나이 계산", 
        "한국나이 계산",
        "띠 계산",
        "생일까지 남은 일수",
        "10개 언어 지원",
        "모바일 최적화"
      ]
    }
    </script>

    <!-- 구조화된 데이터 - BreadcrumbList 스키마 -->
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "BreadcrumbList",
      "itemListElement": [
        {
          "@type": "ListItem",
          "position": 1,
          "name": "홈",
          "item": "https://korean-age.com"
        },
        {
          "@type": "ListItem",
          "position": 2,
          "name": "한국 나이 계산기",
          "item": "https://korean-age.com"
        }
      ]
    }
    </script>

    <!-- Google AdSense -->
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3313180403313535" crossorigin="anonymous"></script>

    <!-- AdSense 오류 핸들링 (강화) -->
    <script>
      // 전역 오류 핸들링: Promise rejection 및 일반 오류 모두 처리
      window.addEventListener('unhandledrejection', function (event) {
        console.log('Promise rejection detected:', event.reason);
        
        // AdSense 관련 오류 감지 및 처리
        var errorSource = '';
        var shouldHandle = false;
        
        // 오류 소스 확인
        if (event.reason === undefined) {
          errorSource = 'undefined rejection';
          shouldHandle = true;
        } else if (event.reason && event.reason.toString) {
          var reasonStr = event.reason.toString();
          if (reasonStr.includes('adsbygoogle') || 
              reasonStr.includes('show_ads') || 
              reasonStr.includes('googlesyndication')) {
            errorSource = 'AdSense related';
            shouldHandle = true;
          }
        }
        
        // 스크립트 URL로 AdSense 관련 확인
        if (event.target && event.target.src) {
          if (event.target.src.includes('googlesyndication') ||
              event.target.src.includes('googleads') ||
              event.target.src.includes('adtrafficquality')) {
            errorSource = 'AdSense script';
            shouldHandle = true;
          }
        }
        
        if (shouldHandle) {
          console.warn('🛡️ AdSense Promise rejection handled (' + errorSource + '):', event.reason);
          event.preventDefault(); // 콘솔 빨간 오류 억제
        }
      });

      // 일반 JavaScript 오류도 AdSense 관련이면 처리
      window.addEventListener('error', function (event) {
        if (event.filename && (
            event.filename.includes('show_ads_impl') ||
            event.filename.includes('googlesyndication') ||
            event.filename.includes('adtrafficquality'))) {
          console.warn('🛡️ AdSense script error handled:', event.message);
        }
      });

      // AdSense 자동 광고 초기화 (페이지 로드 후)
      window.addEventListener('load', function() {
        try {
          // AdSense 자동 광고가 로드되었는지 확인
          if (typeof window.adsbygoogle !== 'undefined') {
            console.log('✅ AdSense script loaded successfully');
            // 수동 광고 단위가 있을 때만 초기화 (현재는 자동 광고만 사용)
            // (window.adsbygoogle = window.adsbygoogle || []).push({});
          } else {
            console.warn('⚠️ AdSense script not loaded');
          }
        } catch (e) {
          console.warn('⚠️ AdSense initialization error:', e);
        }

        // 접근성 문제 해결: body의 aria-hidden 속성 제거
        if (document.body.hasAttribute('aria-hidden')) {
          console.warn('🔧 Removing aria-hidden from body element for accessibility');
          document.body.removeAttribute('aria-hidden');
        }
      });

      // DOM 변경 감지하여 aria-hidden이 동적으로 추가되는 것을 방지
      var observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
          if (mutation.type === 'attributes' && 
              mutation.attributeName === 'aria-hidden' && 
              mutation.target === document.body) {
            console.warn('🔧 Preventing aria-hidden on body element');
            document.body.removeAttribute('aria-hidden');
          }
        });
      });

      // DOM이 로드된 후 관찰 시작
      document.addEventListener('DOMContentLoaded', function() {
        observer.observe(document.body, { 
          attributes: true, 
          attributeFilter: ['aria-hidden'] 
        });
      });
    </script>

    <!-- 구글 검색 로고 최적화 -->
    <meta name="application-name" content="Korean Age Calculator" />
    <meta name="msapplication-TileImage" content="/logo-square-512x512.svg" />
    <meta name="msapplication-square512x512logo" content="/logo-square-512x512.svg" />
    <link rel="icon" type="image/svg+xml" sizes="512x512" href="/logo-square-512x512.svg" />
    <link rel="mask-icon" href="/logo-square-512x512.svg" color="#3B82F6" />
    
    <!-- Additional SEO - 구글 서치 콘솔 최적화 -->
    <link rel="canonical" href="https://korean-age.com/" />
    <meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
    <meta name="author" content="띠별나이 계산기" />
    <meta name="language" content="Korean" />
    <meta name="geo.region" content="KR" />
    <meta name="geo.placename" content="Korea" />
    <meta name="ICBM" content="37.566535, 126.9779692" />
    
    <!-- 네이버 웹마스터도구 인증 -->
    <meta name="naver-site-verification" content="naverde7319eeeca003ba2eaf495fbb52df41" />
    
    <!-- Bing 웹마스터도구 인증 (실제 인증 필요 시 교체) -->
    <meta name="msvalidate.01" content="실제_빙_인증코드_필요" />
    
    <!-- 네이버 포털 최적화 메타태그 -->
    <meta property="naver:title" content="띠별나이 계산기 - 2025년 뱀띠 나이표, 만나이 세는나이" />
    <meta property="naver:description" content="띠별나이 한눈에 확인! 2025년 뱀띠부터 모든 띠 나이표. 만나이 세는나이 동시 계산, 10개 언어 지원" />
    <meta property="naver:image" content="https://korean-age.com/website-preview.webp" />
    <meta property="naver:url" content="https://korean-age.com/" />
    
    <!-- 다음(Kakao) 포털 최적화 -->
    <meta property="daumoa:title" content="띠별나이 계산기 - 2025년 뱀띠 나이표, 만나이 세는나이" />
    <meta property="daumoa:description" content="띠별나이 한눈에 확인! 2025년 뱀띠부터 모든 띠 나이표. 만나이 세는나이 동시 계산" />
    <meta property="daumoa:image" content="https://korean-age.com/website-preview.webp" />
    
    <!-- 다국어 hreflang 태그 (모든 언어 지원) -->
    <link rel="alternate" hreflang="ko" href="https://korean-age.com/ko/" />
    <link rel="alternate" hreflang="en" href="https://korean-age.com/en/" />
    <link rel="alternate" hreflang="ja" href="https://korean-age.com/ja/" />  
    <link rel="alternate" hreflang="zh-cn" href="https://korean-age.com/zh-cn/" />
    <link rel="alternate" hreflang="es" href="https://korean-age.com/es/" />
    <link rel="alternate" hreflang="fr" href="https://korean-age.com/fr/" />
    <link rel="alternate" hreflang="de" href="https://korean-age.com/de/" />
    <link rel="alternate" hreflang="ms" href="https://korean-age.com/ms/" />
    <link rel="alternate" hreflang="ru" href="https://korean-age.com/ru/" />
    <link rel="alternate" hreflang="vi" href="https://korean-age.com/vi/" />
    <link rel="alternate" hreflang="x-default" href="https://korean-age.com/ko/" />
    
    <!-- DNS 프리페치 최적화 (핵심만) -->
    <link rel="dns-prefetch" href="//www.googletagmanager.com">
    <link rel="dns-prefetch" href="//pagead2.googlesyndication.com">
    <link rel="dns-prefetch" href="//partner.googleadservices.com">
    <link rel="dns-prefetch" href="//fonts.googleapis.com">
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    
    <!-- 폰트 최적화 -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    
    <!-- 모바일 최적화 -->
    <meta name="format-detection" content="telephone=no" />
    <meta name="mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="apple-mobile-web-app-title" content="띠별나이 계산기" />
    <script type="module" crossorigin src="/assets/index-XyIiLyYp.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/index-wSgonMwL.css">
  </head>
  <body>
    <!-- Google Analytics Fallback for noscript -->
    <noscript>
      <img src="https://www.googletagmanager.com/gtag/js?id=G-7GK1BFTECJ" 
           style="display:none;visibility:hidden" alt="Google Analytics">
    </noscript>
    
    <div id="root"></div>
  </body>
</html>
