/* 폰트 로드 */
@font-face {
    font-family: 'KidsMagazine';
    src: url('/static/fonts/KidsMagazine.ttf') format('truetype');
}
@font-face {
    font-family: 'BM HANNA Pro';
    src: url('/static/fonts/BM HANNA Pro.otf') format('truetype');
}
/* 폰트 KidsMagazine */
.font-kidsmagazine {
    font-family: 'KidsMagazine';
}
/* 폰트 BMHannaPro */
.font-bmhannapro {
    font-family: 'BM Hanna Pro';
}
/* 드래그 방지 스타일 */
.nodrag {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* 표준 */
}
/* 퍼즐 페이지 스타일 */    
#title-container {
    display: flex;
    flex-direction: column;
    justify-content: center; /* 가로 방향 중앙 정렬 */
    align-items: center; /* 세로 방향 중앙 정렬 */
    /* margin-top: 10vh; 화면 높이의 n% 만큼 위에 여백 설정 */
    padding-top: min(1vw, 10px); /* 화면 너비의 n% 또는 n px 중 작은 값 사용 */
    padding-left: 10%; /* 양옆에 n%씩 여백 추가 */
    padding-right: 10%;
    box-sizing: border-box; /* padding을 포함하여 크기 계산 */
    z-index: 3;
}
.title-image { /*타이틀*/
    max-width: 500px;
    max-height: auto;
}
#top-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
/* 닉네임 설정 팝업 */
#user-name-popup {
    display: none;
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background-color: white;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    text-align: center;
    width: 300px;
}
#user-name-popup input {
    width: 80%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}
#user-name-popup button {
    padding: 5px 20px;
    background-color: #3e81f2;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: KidsMagazine, 'KidsMagazine';
}
#user-name-popup button:hover {
    background-color: #0056b3;
}
#popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
/* 스탑워치 */
#record-image {
    display: block;
    margin: 0 auto;
    width: 30vw; /* 너비를 뷰포트 너비의 비율로 설정 */
    max-width: 200px; /* 필요에 따라 너비 조절 */
    min-width: 80px;
    height: auto;
    padding-top: min(1vw, 10px); /* 화면 너비의 n% 또는 n px 중 작은 값 사용 */
}
/* 스탑워치 폰트 */
#stopwatch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
}
#left-container {
    display: block;
    align-items: center;
    justify-content: center;
    width: 10vw; /* 너비를 뷰포트 너비의 비율로 설정 */
    max-width: 50px; /* 필요에 따라 너비 조절 */
    min-width: 25px;
    height: auto;
    margin-right: min(1vw); /* 더 오른쪽으로 이동시키기 위해 마진 추가 */
    z-index: 3;
}
#button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 7vw; /* 너비를 뷰포트 너비의 비율로 설정 */
    max-width: 40px; /* 필요에 따라 너비 조절 */
    min-width: 20px;
    height: auto;
    gap: calc(2vw); /* 이미지들 사이의 간격 조정 */
    margin-left: calc(2vw); /* 브라우저 너비의 5%만큼 마진을 추가 */
    z-index: 3;
}
#button-container img {
    flex: 1 1 auto;
    max-width: 100%;
    height: auto;
}
/*스탑워치*/
.stopwatch {
    font-size: 2rem; /* 기본 폰트 크기, JavaScript에서 동적으로 변경 */
    text-align: center;
    margin-bottom: 20px;
    font-family: 'KidsMagazine', monospace, sans-serif;
} 
.stopwatch-display {
    display: flex;
    justify-content: center;
    gap: 0.5px; /* 숫자 사이의 간격 조정 */
}
.stopwatch-digit {
    display: inline-block;
    width: 1ch; /* 숫자의 너비를 동일하게 설정 */
    text-align: center;
    color: #4f4545;  
}
/* 사용자 정보 및 퍼즐 레벨 */
.player-info {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 450px;
    font-size: 1em;
    text-align: center;
}
#player-name {
    color: #4f4545;
}
#puzzle-level {
    color: #4f4545;
    margin-left: auto; /* 항상 오른쪽 정렬 */
}
/* 퍼즐 패널 컨테이너 */
#svg-container-wrapper { /*전체 컨테이너*/
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0 auto;
    width: 95vw; /* 브라우저 너비의 n% */
    padding-left: 10%; /* 양옆에 n%씩 여백 추가 */
    padding-right: 10%;
    box-sizing: border-box; /* padding을 포함하여 크기 계산 */
    z-index: 3;
}
.svg-container, .svg-container2 { 
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: absolute; 
    top: 0; 
    left: 0;
    padding-left: 10%; /* 양옆에 n%씩 여백 추가 */
    padding-right: 10%;
    box-sizing: border-box; /* padding을 포함하여 크기 계산 */
    z-index: 4;
}
#panel_h-container {
    
    position: absolute;
    z-index: 5;
    max-width: 750px;
    min-width: 750px;
    max-height: 850px;
    width: 100%; 
    height: 100%;
}
#panel_v-container {
    position: absolute;
    z-index: 5;
    max-width: 530px;
    min-width: 300px;
    width: 100%; 
    height: 100%;
    padding-left: 30px; /* 양옆에 n씩 여백 추가 */
    padding-right: 30px;
    box-sizing: border-box; /* padding을 포함하여 크기 계산 */
}
/* 퍼즐 그리드 스타일 */
#spink-container{
    position: absolute;
    max-width: 590px;
    min-width: 300px;
    width: 100%;
    height: 100%;
    z-index: 6;
    padding-left: 30px; /* 양옆에 n씩 여백 추가 */
    padding-right: 30px;
    box-sizing: border-box; /* padding을 포함하여 크기 계산 */
}
.spink-puzzle {
    position: absolute;
    width: 100%;
    height: 100%;
}
.pin-image {
    pointer-events: none; /* 핀 이미지의 포인터 이벤트 비활성화 */
    z-index: 10;
}

/* 난이도 및 확인 팝업 */
#svg-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}
#svg-popup {
    display: none; /* 초기에는 보이지 않도록 설정 */
    position: fixed;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 999;
    width: 40%;
    max-width: 300px;
    min-width: 10%;
}
#svg-popup-content {
    max-width: 100%;
    height: auto;
    min-width: 150px;
    z-index: 1000;
}
/* 코멘트 입력 필드 */
#comment-input {
    position: absolute;
    width: 90%;
    border: none;
    outline: none;
    padding: 0 10px;
    font-size: clamp(2vh, 2vmin, 24px);
    border-radius: 12px;
    background-color: transparent;
    z-index: 6;
    font-family: BMHANNAProOTF-KSCpc-EUC-H, 'BM Hanna Pro';
    color: #4f4545;
}
.comment-input-container {
    position: absolute;
    top: 67.5%; /* intro_object 이미지 내에서 상대적 위치 조정 */
    left: 24.5%; /* intro_object 이미지 내에서 상대적 위치 조정 */
    width: 49%; /* intro_object 이미지 너비의 n% */
    height: 10%;
    border-radius: 10px;
    border: 0px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
}

/* 튜토리얼 영상 모달 */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
.modal-content {
    margin: 5% auto;
    padding: 0;
    border: none;
    width: 90%;
    /* height: 60%; */
    height: calc(90vw * 9 / 16); /* 16:9 비율을 유지 */
    max-width: 1000px; /* 최대 너비 설정 */
    max-height: calc(1000px * 9 / 16); /* 최대 높이 설정 */
    margin-top: max(200px, calc((88vh - calc(90vw * 9 / 16)) / 2));
}
#youtube-iframe {
    width: 100%;
    height: 100%;
    border: none; /* Remove iframe border */
}

/* 랭킹 스타일 */
#ranking-popup {
    display: none; /* 초기에는 숨겨진 상태로 둡니다 */
    position: fixed;
    /* top: 50%; */
    left: 50%;
    transform: translate(-50%, -5%);
    width: 80%; /* 원하는 너비로 설정 */
    height: auto; /* 원하는 높이로 설정 */
    max-width: 450px;
    background: none;
    box-shadow: none;
    z-index: 1000;
    overflow: hidden; /* 자식 컨테이너가 넘칠 경우 숨깁니다 */
}
#ranking-svg-wrapper {
    width: 100%;
    height: auto;
    position: relative; /* 상대 위치로 설정 */
    overflow: hidden; /* 자식 컨테이너가 넘칠 경우 숨깁니다 */
}
#ranking-list-container {
    position: absolute;
    top: 30%;
    left: 10%;
    width: 75%; /* 또는 원하는 너비 */
    height: 50%; /* 또는 원하는 높이 */
    overflow: auto; /* 스크롤을 활성화합니다 */
    display: flex; /* 플렉스 박스를 사용하여 내부 요소 정렬 */
    align-items: flex-start; /* 수직 정렬을 최상단으로 설정 */    
}
#ranking-overlay {
    display: none; /* 초기에는 숨겨진 상태로 둡니다 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
#ranking-svg-wrapper svg {
    width: 100%;
    height: 100%;
    object-fit: contain;    
}
/* SEO 최적화 */
#welcome-container {
    position: absolute; /* 절대 위치 설정 */
    height: auto;
    width: 85%;
    max-width: 800px;
    text-align: center; /* 텍스트 중앙 정렬 */
    top: 50%; /* 세로 가운데 정렬 */
    left: 50%; /* 가로 가운데 정렬 */
    transform: translate(-50%, -50%); /* 컨테이너를 화면 중앙으로 이동 */
    z-index: 1;
}
.welcome {
    color: #ffffff;
    font-size: 20px;
}
/* 광고 */
.ad-container {
    width: 80%;
    height: auto;
    margin: 10px auto;
    padding: 10px;
    background-color: #ffffff;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    position: absolute; /* 절대 위치 설정 */
    top: 85%; /* 세로 가운데 정렬 */
    left: 50%; /* 가로 가운데 정렬 */
    transform: translate(-50%, 0%); /* 컨테이너를 화면 중앙으로 이동 */
}
/* 랭킹 툴팁 */
#tooltip {
    position: absolute;
    background-color: #333; /* 툴팁 배경색 */
    color: #fff; /* 툴팁 텍스트 색 */
    padding: 5px; /* 툴팁 패딩 */
    border-radius: 8px; /* 툴팁 모서리 둥글게 */
    pointer-events: none; /* 툴팁은 마우스 이벤트를 받지 않음 */
    opacity: 0; /* 기본적으로 보이지 않게 설정 */
    transition: opacity 0.2s; /* 투명도 전환 애니메이션 */
    z-index: 1000; /* 툴팁을 다른 요소 위에 표시 */
    max-width: 30%; /* 툴팁의 최대 너비 */
    word-wrap: break-word; /* 단어가 너무 길면 줄바꿈 */
    overflow: hidden; /* 내용이 넘치면 숨기기 */
    text-align: left; /* 텍스트 정렬 */
    font-family: 'BM Hanna Pro';
}

/* 추가 스타일로 툴팁의 스크롤바 및 배경색 조정 */
#tooltip::-webkit-scrollbar {
    width: 8px;
}

#tooltip::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
}

#tooltip::-webkit-scrollbar-thumb:hover {
    background-color: #777;
}
/* 팝업 오버레이 스타일 */
.guide-popup-overlay {
    display: none; /* 초기에는 보이지 않음 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

/* 팝업 내용 스타일 */
.guide-popup-content {
    position: relative;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 500px;

    overflow: auto;
}

/* 닫기 버튼 스타일 */
.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close-popup:hover,
.close-popup:focus {
    color: black;
}

/* 팝업 내 이미지 스타일 */
.guide-popup-content img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.dont-show-again-button {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #6e6eff;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: block;
    margin-left: auto;
    margin-right: auto;
    font-size: 20px;
    font-weight: lighter;
    
}

.dont-show-again-button:hover {
    background-color: #0056b3;
}
/* 클래스 */
.cls-none1,.cls-none2,.cls-black1,.cls-black2,.cls-black3,.cls-black4,.cls-white1,.cls-white2,.cls-white3,.cls-white4,.cls-red1,.cls-red2,.cls-red3,.cls-red4,.cls-red5,.cls-red6,.cls-red7,
.cls-red8,.cls-red9,.cls-red10,.cls-yellow1,.cls-yellow2,.cls-yellow3,.cls-yellow4,.cls-green1,.cls-green2,.cls-green3,.cls-blue1,.cls-blue2,.cls-blue3,.cls-blue4,.cls-blue5 {
    stroke-width:0px;
}
/* 무색 */
.cls-none1,.cls-rk-none1,.cls-rk-none2 {
    fill:none;
}
.cls-none2 {
    fill:none;
    clip-rule:evenodd;
}
/* 검은색 */
.cls-black1 {
    fill:#4f4545;
}
.cls-black2 {
    fill:#969696;
}
.cls-black3 {
    fill:#515151;
}
.cls-black4 {
    fill:#000;
}
/* 흰색 */
.cls-white1,.cls-rk-white1,.cls-check-white1 {
    fill:#fff;
}
.cls-white2 {
    fill:#fffdd4;
}
.cls-white3 {
    fill:#ffd6d7;
}
.cls-white4 {
    fill:#d5d5d5;
}
.cls-white5 {
    fill:#fff;
    stroke-width: 2px;
    stroke: #4f4545;
}
/* 빨간색 */
.cls-red1,.cls-check-red1 {
    fill:#ff868b;
}
.cls-red2 {
    fill:#e74133;
}
.cls-red3 {
    fill:#fc92ff;
}
.cls-red4{
    fill:#ff8f8f;
}
.cls-red5 {
    fill:#ff6168;
}
.cls-red6 {
    fill:#ee7ab6;
}
.cls-red7 {
    fill:#ff9a74;
}
.cls-red8 {
    fill:#e080b5;
}
.cls-red9 {
    fill:#ffad5d;
}
.cls-red10 {
    fill:#ffb1b3;
}
/* 노란색 */
.cls-yellow1 {
    fill:#f9bb00;
}
.cls-yellow2{
    fill:#ffc48f;
}
.cls-yellow3 {
    fill:#fffb7d;
}
.cls-yellow4 {
    fill:#fffa4a;
}
/* 녹색 */
.cls-green1 {
    fill:#32a753;
}
.cls-green2 {
    fill:#64ffc0;
}
.cls-green3 {
    fill:#64ff83;
}
.cls-green4 {
    fill:#92ffc6;
    stroke-width: 2px;
    stroke: #4f4545;
}
/* 파란색 */
.cls-blue1 {
    fill:#3e82f1;
}
.cls-blue2 {
    fill:#64fffc;
}
.cls-blue3 {
    fill:#c492ff;
}
.cls-blue4,.cls-check-blue1 {
    fill:#9191ff;
}
.cls-blue5{
    fill:#6e6eff;
}
.cls-clippath {
    clip-path: url(#clippath);
}
.cls-clippath1 {
    clip-path: url(#clippath-1);
}
.cls-clippath2 {
    clip-path: url(#clippath-2);
}
.cls-clippath3 {
    clip-path: url(#clippath-3);
}
.panel-1 {
    stroke-width:2.84px;
}
.cls-rk-white1,.cls-rk-none2,.cls-rk-none2,.cls-check-blue1,.cls-check-red1,.cls-check-white1,.incorrectcls-8,.panel-1,.correctcls-7 {
    stroke: #4f4545;
}
.cls-check-white1,.correctcls-7 {
    stroke-miterlimit: 10;
}
.incorrectcls-8,.incorrectcls-9,.panel-1,.correctcls-7 {
    fill: #fff;
}
.incorrectcls-9 {
    stroke: #515151;
}
.cls-rk-none2,.cls-check-white1,.incorrectcls-8,.incorrectcls-9,.correctcls-7 {
    stroke-width: 2px;
}
.cls-rk-white1,.cls-white1 {
    stroke-width: 3px;
}
.cls-rk-white1,.cls-rk-none2,.cls-rk-none2,.incorrectcls-8,.incorrectcls-9,.panel-1 {
    stroke-miterlimit: 10;
}
.rkcls-20 {
    letter-spacing: -.18em;
}
#phraseTime {
    font-family: 'KidsMagazine', sans-serif;
    font-size: 40px;
    fill: #4f4545;
    letter-spacing: 2px;
}
/* 인트로 텍스트 */
.cls-intro-text1 {
    fill:#4f4545;
    font-size: 30px;
}
.cls-intro-text2 {
    fill:#4f4545;
    font-size: 30px;
}
/* 난이도 선택 텍스트 */
.cls-dif-text1 {
    fill:#4f4545;
    font-size: 50px;
    font-weight: bold;
}
.cls-dif-text2 {
    fill:#4f4545;
    font-size: 37.75px;
}
/* 랭킹 텍스트 */
.cls-rk-text1 {
    fill:#4f4545;
    font-size: 37.75px;
}
.cls-rk-text2 {
    fill:#4f4545;
    font-size: 37.75px;
}
.cls-rk-text3 {
    fill: #64ff83;
    font-size: 50px;
}
.cls-rk-number {
    fill: #4f4545;
    font-size: 30px;
}
.nickname { 
    fill: #4f4545;
    font-family: BMHANNAProOTF-KSCpc-EUC-H, 'BM Hanna Pro';
    font-size: 25px;
} 
.comment {
    fill: #6262ff;
    font-family: BMHANNAProOTF-KSCpc-EUC-H, 'BM Hanna Pro';
    font-size: 25px;
}
.final-time {
    fill: #45454f;
    font-family: BMHANNAProOTF-KSCpc-EUC-H, 'BM Hanna Pro';
    font-size: 25px;
}
/* 확인 텍스트 */
.cls-check-text1 {
    fill:#4f4545;
    font-size: 28.54px;
}
.cls-check-text2 {
    fill:#4f4545;
    font-size: 21.91px;
}
.cls-check-text3 {
    fill:#4f4545;
    font-size: 50px;
}
.cls-check-text4 {
    fill:#4f4545;
    font-size: 39.02px;
}
.cls-check-text5 {
    fill:#4f4545;
    font-size: 26.19px;
}
.highlight {
    fill:#ffb1b3;
}

