/* YSSCHOOL Learning Game World Font Pack V13
   한글 글씨 겹침(Line-height 1.18 충돌 및 버튼 overflow) 및 깨짐 방지 패치
   원칙: 제목은 선명한 가독성 확보(줄간격 1.4+), 본문/문제는 선명하게(Noto Sans KR), 방향키/선택지는 모양 보존.
*/
@import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Jua&family=Noto+Sans+KR:wght@400;500;700;800;900&display=swap');

:root{
  --ys-font-title:'Jua','Noto Sans KR','Gowun Dodum',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --ys-font-main:'Noto Sans KR','Gowun Dodum',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --ys-font-soft:'Gowun Dodum','Noto Sans KR',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --ys-font-ui:'Jua','Noto Sans KR',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}

html,body{
  font-family:var(--ys-font-main)!important;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  word-break:keep-all;
  overflow-wrap:break-word;
}

button,input,select,textarea,a,.btn,.chip,.tab,.pill,.tag,.card,.panel,.game,.hud,.overlay,.choice,.ctrl,.memo,.cell,
#ys-v9-hub,#ys-v9-hub button,#ys-v9-toast,#ys-v9-recap,#ys-v9-result,#ys-arcade-end-overlay{
  font-family:var(--ys-font-main)!important;
}

h1,h2,h3,h4,.title,.dashboard-title,.game-title,.logo,.hero h1,.heroBox h1,.eyebrow,.top .title,.game h3,
.ys-v9-recap-card h2,.ys-v9-result-card h2,.ys-arcade-end-box h2{
  font-family:var(--ys-font-title)!important;
  font-weight:400!important;
  letter-spacing:0!important;
  line-height:1.38!important;
  word-break:keep-all!important;
  overflow-wrap:break-word!important;
  text-shadow:none!important;
}

/* 대시보드의 큰 제목은 둥글게 보이되 한글 획이 뭉개지지 않게 크기와 줄간격 보정 */
.hero h1,.heroBox h1{
  font-family:var(--ys-font-title)!important;
  font-size:clamp(2.4rem, 7vw, 5.1rem)!important;
  line-height:1.2!important;
  letter-spacing:-0.01em!important;
  font-weight:400!important;
}

p,.hint,.notice,.desc,.card-desc,.learning-tip,.review-card,.ys-v9-recap-card p,.ys-v9-result-card p,.switch p,.game p,.feature p,
textarea::placeholder,input::placeholder{
  font-family:var(--ys-font-soft)!important;
  line-height:1.65!important;
  letter-spacing:-0.01em!important;
  word-break:keep-all!important;
}

.question,.quiz,.problem,.choice,.answer,.score,.scoreboard,#problem,#score,#level,#hp,#combo,.pill b,.summary b,
.stat,.badge,.count,.timer,.mission,.result{
  font-family:var(--ys-font-main)!important;
  font-weight:700!important;
  letter-spacing:-0.01em!important;
  line-height:1.45!important;
}

/* 일반 버튼은 Jua 글꼴 및 둥근 필 스타일 */
button:not(.ctrl):not([data-act]):not(.cell):not(.mem-card):not(.action-btn):not(.choice):not(.hud div):not(.pad button),
.btn:not(.ctrl):not([data-act]):not(.action-btn):not(.choice):not(.mini),
.chip,.tab,.play-button,.menu-button,.miniIcon,.filter-btn{
  font-family:var(--ys-font-ui)!important;
  font-weight:400!important;
  letter-spacing:0!important;
  border-radius:999px!important;
}

/* 컨트롤러 방향키, 조이스틱, 퀴즈 선택지 버튼은 글씨가 잘리거나 겹치지 않게 안정적인 사각 둥근형 유지 */
.ctrl,.pad button,[data-act],.joystick button,.choice,.cell,.mem-card,.action-btn,.mini{
  font-family:var(--ys-font-main)!important;
  font-weight:800!important;
  border-radius:14px!important;
  line-height:1.25!important;
}

/* 기존 V11 장식 글꼴 계열이 남아 있는 요소도 강제로 정상화 */
[style*="Bagel"],[style*="Gaegu"],[style*="Gamja"],[style*="Dongle"]{
  font-family:var(--ys-font-main)!important;
}

/* 카드 제목과 주요 플레이 버튼 */
.game-card h3,.card h3,.game h3,.play-button,.btn.primary{
  font-family:var(--ys-font-ui)!important;
}

/* 모바일에서 글자가 뭉개져 보이지 않게 글자 크기와 줄간격 확보 */
@media(max-width:640px){
  .hero h1,.heroBox h1{font-size:clamp(2.1rem, 12vw, 3.4rem)!important; line-height:1.15!important;}
  h1,h2,h3,.title{letter-spacing:0!important; line-height:1.32!important;}
  p,.hint,.notice,.desc,.card-desc{line-height:1.68!important;}
}
