/* 한글 놀이터 — 유아 한글 공부. 색: 코랄 · 하늘 · 민트 · 라벤더 · 해바라기 */
.hg {
  --ink: #2E2A4A;
  --ink-2: #6B6585;
  --paper: #FFFBF7;
  --line: #F1E7E2;
  --coral: #FF7A88;
  --coral-d: #F05A6E;
  --sky: #5AA9F5;
  --mint: #33C2A0;
  --lav: #9B86F2;
  --sun: #FFC24B;
  --r: 22px;
  --shadow: 0 10px 30px -12px rgba(70, 40, 90, .28), 0 2px 6px rgba(70, 40, 90, .06);
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: 14px clamp(12px, 3vw, 22px) 22px;
  border-radius: 28px;
  background:
    radial-gradient(120% 60% at 0% 0%, #FFE9E4 0%, rgba(255, 233, 228, 0) 60%),
    radial-gradient(90% 50% at 100% 10%, #E6F1FF 0%, rgba(230, 241, 255, 0) 60%),
    var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 20px 50px -30px rgba(80, 40, 90, .35);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}
:where(.hg) button { font: inherit; line-height: inherit; }
.hg button { color: inherit; cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.hg button:disabled { cursor: default; }
.hg :focus-visible { outline: 3px solid rgba(90, 169, 245, .6); outline-offset: 2px; }
.hg [hidden] { display: none !important; }

/* 윗줄 */
.hg-bar { display: flex; align-items: center; gap: 8px; min-height: 46px; margin-bottom: 10px; }
.hg-bar-title { flex: 1; min-width: 0; font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hg-back { width: 42px; height: 42px; flex: none; border: 0; border-radius: 14px; background: #fff; box-shadow: var(--shadow); font-size: 1.9rem !important; line-height: 1; font-weight: 700; padding-bottom: 4px; }
.hg-bar-stats { display: flex; gap: 6px; }
.hg-pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 999px; background: #fff; box-shadow: 0 2px 8px -3px rgba(70, 40, 90, .25); font-size: .92rem; white-space: nowrap; }
.hg-pill b { font-weight: 800; font-variant-numeric: tabular-nums; }
.hg-icon-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: 13px; background: #fff; box-shadow: 0 2px 8px -3px rgba(70, 40, 90, .25); font-size: 1.05rem; }

.hg-screen { animation: hgIn .32s ease both; }
@keyframes hgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 처음 화면 */
.hg-hero { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(135deg, #FFF2E0, #FFE4EA); box-shadow: var(--shadow); }
.hg-mascot { flex: none; animation: hgFloat 3.2s ease-in-out infinite; }
@keyframes hgFloat { 50% { transform: translateY(-6px) rotate(3deg); } }
.hg-hero-text { flex: 1; min-width: 0; }
.hg-bubble { position: relative; margin: 0 0 10px; padding: 12px 14px; border-radius: 18px; background: #fff; font-weight: 700; font-size: clamp(.98rem, 3.6vw, 1.1rem); line-height: 1.45; box-shadow: 0 4px 12px -6px rgba(70, 40, 90, .3); }
.hg-bubble::before { content: ""; position: absolute; left: -7px; top: 18px; border: 8px solid transparent; border-right-color: #fff; border-left: 0; }
.hg-today { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; color: var(--ink-2); }
.hg-today b { color: var(--coral-d); font-size: 1.12rem; font-weight: 800; margin-right: 2px; }

.hg-h { margin: 22px 4px 10px; font-size: 1.12rem; font-weight: 800; letter-spacing: -.02em; }
.hg-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .hg-menu { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hg-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 148px; padding: 14px 14px 16px; border: 0; border-radius: var(--r); text-align: left; background: var(--bg, #fff); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.hg-card::after { content: ""; position: absolute; right: -26px; top: -26px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.hg-card:hover { transform: translateY(-2px); }
.hg-card:active { transform: scale(.97); }
.hg-card-art { font-size: 2rem; font-weight: 900; line-height: 1.15; letter-spacing: .02em; color: var(--fg); margin-bottom: auto; }
.hg-card-name { font-weight: 800; font-size: 1.02rem; letter-spacing: -.02em; line-height: 1.3; margin-top: 8px; }
.hg-card-sub { font-size: .82rem; color: var(--ink-2); line-height: 1.35; }
.hg-prog { display: block; width: 100%; height: 7px; margin-top: 8px; border-radius: 99px; background: rgba(255, 255, 255, .75); overflow: hidden; }
.hg-prog i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--fg); transition: width .6s ease; }
.c-coral { --bg: linear-gradient(150deg, #FFE3E7, #FFD0D7); --fg: #F05A6E; }
.c-sky { --bg: linear-gradient(150deg, #E2F0FF, #CDE3FD); --fg: #3E8CE0; }
.c-mint { --bg: linear-gradient(150deg, #DDF7EF, #C6EFE2); --fg: #1FA585; }
.c-lav { --bg: linear-gradient(150deg, #ECE6FF, #DDD3FD); --fg: #7E66E6; }
.c-sun { --bg: linear-gradient(150deg, #FFF1CF, #FFE3A6); --fg: #E39A00; }

.hg-foot-btns { display: grid; gap: 10px; margin-top: 22px; }
.hg-install { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: var(--r); text-align: left; color: #fff !important; background: linear-gradient(120deg, #FF7A88, #FFA36B); box-shadow: 0 12px 26px -12px rgba(240, 90, 110, .7); }
.hg-install-icon img { display: block; width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.hg-install b { display: block; font-size: 1rem; font-weight: 800; }
.hg-install small { display: block; font-size: .82rem; opacity: .92; }
.hg-ghost { justify-self: center; padding: 10px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2) !important; font-weight: 700; }

/* 단추 */
.hg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px; border: 0; border-radius: 16px; background: #fff; font-weight: 800; font-size: 1rem; box-shadow: var(--shadow); white-space: nowrap; transition: transform .12s; }
.hg-btn:active { transform: scale(.96); }
.hg-btn.main { color: #fff !important; background: linear-gradient(120deg, var(--coral), #FF9A6E); box-shadow: 0 10px 22px -10px rgba(240, 90, 110, .75); }
.hg-btn.ghost { background: #fff; }
.hg-btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 12px; }
.hg-btn.big { min-height: 58px; font-size: 1.15rem; padding: 12px 30px; border-radius: 20px; }
.hg-round { width: 52px; height: 52px; flex: none; border: 0; border-radius: 50%; background: #fff; box-shadow: var(--shadow); font-size: 1.05rem; color: var(--ink-2) !important; }
.hg-round:disabled { opacity: .35; }
.hg-lead { margin: 2px 4px 14px; color: var(--ink-2); font-weight: 600; line-height: 1.5; }
.hg-label { display: block; margin: 18px 4px 8px; font-weight: 800; font-size: .95rem; }

/* 글자 고르기 */
.hg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.hg-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow); transition: transform .12s; }
.hg-tile:active { transform: scale(.95); }
.hg-tile-ch { font-size: 2.6rem; font-weight: 800; line-height: 1.15; color: var(--ink); }
.hg-tile.done .hg-tile-ch { color: var(--coral-d); }
.hg-tile-name { font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.hg-tile-stars { font-size: .95rem; letter-spacing: 1px; color: #E5DDE9; }
.hg-tile.done .hg-tile-stars { color: var(--sun); text-shadow: 0 1px 0 #E29B00; }
.hg-tile.sing, .hg-chart .sing { transform: scale(1.1); box-shadow: 0 0 0 3px var(--sun), var(--shadow); }
.hg-listen-all { display: block; margin: 16px auto 0; }

/* 따라 쓰기 */
.hg-trace-head { display: flex; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.hg-say { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 10px; border: 0; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); text-align: left; }
.hg-say-char { display: grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: 18px; background: linear-gradient(140deg, #FFE3E7, #FFD0D7); color: var(--coral-d); font-size: 2.1rem; font-weight: 900; }
.hg-say-name b { display: block; font-size: 1.3rem; font-weight: 900; letter-spacing: -.02em; }
.hg-say-name small { color: var(--ink-2); font-size: .8rem; font-weight: 700; }
.hg-example { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 88px; padding: 6px 10px; border: 0; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); font-weight: 800; font-size: .92rem; }
.hg-example-emoji { font-size: 1.9rem; line-height: 1.2; }
.hg-board-wrap { position: relative; display: flex; justify-content: center; }
.hg-board { display: block; width: 100%; max-width: 460px; aspect-ratio: 1; border-radius: 26px; background: #fff; box-shadow: 0 0 0 3px #FFE1E6 inset, var(--shadow); touch-action: none; -webkit-user-select: none; user-select: none; }
.hg-board-wrap.shake .hg-board { animation: hgShake .35s; }
@keyframes hgShake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.hg-steps { position: absolute; top: 10px; right: calc(50% - min(50%, 230px) + 12px); display: flex; gap: 4px; }
.hg-steps span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #F2EEF6; color: #B7AEC6; font-size: .72rem; font-weight: 800; transition: .2s; }
.hg-steps span.now { box-shadow: 0 0 0 2px var(--c); color: var(--c); background: #fff; }
.hg-steps span.on { background: var(--c); color: #fff; }
.hg-msg { min-height: 1.5em; margin: 12px 4px 10px; text-align: center; font-weight: 800; font-size: clamp(1rem, 3.8vw, 1.12rem); color: var(--ink); line-height: 1.45; }
.hg-msg.good { color: #18A07F; }
.hg-msg.oops { color: var(--coral-d); }
.hg-trace-btns { display: flex; align-items: center; justify-content: center; gap: 8px; }
.hg-trace-btns .hg-btn { flex: 1; max-width: 150px; padding-inline: 10px; }

/* 글자 만들기 */
.hg-formula { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2vw, 12px); padding: 16px 8px; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); }
.hg-fbox { display: grid; place-items: center; width: clamp(64px, 20vw, 92px); aspect-ratio: 1; border: 0; border-radius: 22px; font-size: clamp(2rem, 9vw, 2.9rem); font-weight: 900; }
.hg-fbox.c { background: linear-gradient(140deg, #FFE3E7, #FFD0D7); color: var(--coral-d); }
.hg-fbox.v { background: linear-gradient(140deg, #E2F0FF, #CDE3FD); color: #3E8CE0; }
.hg-fbox.r { width: clamp(78px, 25vw, 112px); font-size: clamp(2.6rem, 12vw, 3.7rem); background: linear-gradient(140deg, #FFF1CF, #FFDE8F); color: #8A5A00; box-shadow: 0 10px 22px -12px rgba(227, 154, 0, .8); }
.hg-fbox.bump, .hg-picture.bump, .hg-st.bump { animation: hgBump .42s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hgBump { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
.hg-op { font-size: 1.6rem; font-weight: 900; color: #C4BAD3; }
.hg-b-actions { display: flex; gap: 10px; justify-content: center; margin: 14px 0 4px; flex-wrap: wrap; }
.hg-picks { display: flex; flex-wrap: wrap; gap: 7px; }
.hg-picks button { width: 48px; height: 48px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 3px 10px -5px rgba(70, 40, 90, .35); font-size: 1.4rem; font-weight: 800; }
.hg-picks button.on { background: var(--ink); color: #fff !important; }
.hg-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hg-chart-head .hg-label { margin-bottom: 8px; }
.hg-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.hg-chart button { aspect-ratio: 1; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 3px 10px -5px rgba(70, 40, 90, .35); font-size: clamp(1.2rem, 5vw, 1.6rem); font-weight: 800; transition: transform .12s; }
.hg-chart button.on { background: linear-gradient(140deg, #FFF1CF, #FFDE8F); }
.hg-chart button.done::after { content: "★"; display: block; font-size: .55rem; color: var(--sun); line-height: 1; }

/* 고르기 · 퀴즈 */
.hg-setup { display: grid; justify-items: center; gap: 14px; padding: 26px 12px; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); text-align: center; }
.hg-setup .hg-lead { margin: 0; }
.hg-choose { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hg-choose button { min-width: 74px; padding: 10px 16px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 800; }
.hg-choose button.on { border-color: var(--coral); background: #FFF0F2; color: var(--coral-d) !important; }
.hg-choose.small button { min-width: 0; padding: 7px 12px; font-size: .9rem; }
.hg-check { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-2); }
.hg-check input, .hg-set-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--coral); }
.hg-play { text-align: center; }
.hg-dots { display: flex; justify-content: center; gap: 6px; margin: 2px 0 16px; }
.hg-dots i { width: 12px; height: 12px; border-radius: 50%; background: #EDE6F1; transition: .2s; }
.hg-dots i.now { background: #fff; box-shadow: 0 0 0 2px var(--coral); transform: scale(1.15); }
.hg-dots i.ok { background: var(--mint); }
.hg-dots i.no { background: var(--sun); }
.hg-speaker { display: grid; place-items: center; width: 108px; height: 108px; margin: 0 auto; border: 0; border-radius: 50%; background: linear-gradient(140deg, #FFC24B, #FF9A6E); box-shadow: 0 14px 30px -12px rgba(255, 140, 80, .8), 0 0 0 8px rgba(255, 194, 75, .18); font-size: 3rem; animation: hgPulse 2s ease-in-out infinite; }
@keyframes hgPulse { 50% { box-shadow: 0 14px 30px -12px rgba(255, 140, 80, .8), 0 0 0 16px rgba(255, 194, 75, .08); } }
.hg-q { margin: 16px 4px 16px; font-size: clamp(1.05rem, 4vw, 1.25rem); font-weight: 800; text-align: center; line-height: 1.45; }
.hg-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hg-opt { aspect-ratio: 1 / 1.05; border: 0; border-radius: 24px; background: #fff; box-shadow: var(--shadow); font-size: clamp(2.6rem, 13vw, 4rem); font-weight: 900; line-height: 1; transition: transform .14s; }
.hg-opt.o0 { color: var(--coral-d); } .hg-opt.o1 { color: #3E8CE0; } .hg-opt.o2 { color: #1FA585; }
.hg-opt:active { transform: scale(.95); }
.hg-opt.right { background: linear-gradient(140deg, #DDF7EF, #B9EEDC); animation: hgBump .4s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 0 0 4px var(--mint), var(--shadow); }
.hg-opt.wrong { animation: hgShake .35s; opacity: .4; }
.hg-opt.hint { box-shadow: 0 0 0 4px var(--sun), var(--shadow); animation: hgPulse 1.2s infinite; }
.hg-options.words .hg-opt { aspect-ratio: auto; min-height: 84px; padding: 10px 6px; font-size: clamp(1.25rem, 5.6vw, 1.8rem); letter-spacing: -.02em; }
.hg-picture { display: grid; place-items: center; width: min(200px, 52vw); aspect-ratio: 1; margin: 0 auto; border-radius: 36px; background: radial-gradient(circle at 30% 25%, #fff, #FFEFD9); box-shadow: var(--shadow); font-size: clamp(5rem, 26vw, 7.5rem); line-height: 1; }
.hg-word-help { display: flex; justify-content: center; margin-top: 14px; }

/* 풍선 */
.hg-sky { position: relative; height: min(68vh, 560px); min-height: 400px; border-radius: 26px; overflow: hidden; background: linear-gradient(180deg, #CFE7FF 0%, #EAF4FF 55%, #FFF4E6 100%); box-shadow: var(--shadow); touch-action: manipulation; }
.hg-sky-top { position: absolute; z-index: 5; top: 10px; left: 10px; right: 10px; display: flex; gap: 6px; align-items: center; }
.hg-target { flex: 1; min-width: 0; padding: 10px 14px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); text-align: left; font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hg-target b { font-size: 1.25rem; color: var(--coral-d); }
.hg-cloud { position: absolute; width: 140px; height: 44px; border-radius: 44px; background: rgba(255, 255, 255, .8); filter: blur(.5px); }
.hg-cloud::before { content: ""; position: absolute; left: 30px; top: -24px; width: 66px; height: 60px; border-radius: 50%; background: inherit; }
.hg-cloud.c1 { top: 90px; left: -30px; animation: hgCloud 26s linear infinite; }
.hg-cloud.c2 { top: 200px; right: -40px; transform: scale(.7); animation: hgCloud 34s linear infinite reverse; }
@keyframes hgCloud { 50% { translate: 60px 0; } }
.hg-balloon { position: absolute; top: 0; left: 0; z-index: 2; padding: 0; border: 0; background: transparent; will-change: transform; }
.hg-balloon span { position: relative; display: grid; place-items: center; width: 100%; height: 85%; border-radius: 50% 50% 48% 48% / 55% 55% 45% 45%; background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .7) 0 9%, transparent 10%), var(--b); box-shadow: inset -8px -10px 0 rgba(0, 0, 0, .08); color: #fff; font-size: clamp(2rem, 8vw, 2.6rem); font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.hg-balloon span::after { content: ""; position: absolute; bottom: -7px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top: 8px solid var(--b); }
.hg-balloon::after { content: ""; position: absolute; left: 50%; top: 90%; width: 1.5px; height: 30px; background: rgba(60, 50, 90, .3); }
.hg-balloon.popped span { animation: hgPop .26s ease-out forwards; }
.hg-balloon.nope span { animation: hgShake .3s; }
@keyframes hgPop { to { transform: scale(1.6); opacity: 0; } }
.hg-spark { position: absolute; z-index: 3; font-style: normal; pointer-events: none; animation: hgSpark .7s ease-out forwards; }
@keyframes hgSpark { from { transform: translate(-50%, -50%) rotate(var(--a)) translateY(0); opacity: 1; } to { transform: translate(-50%, -50%) rotate(var(--a)) translateY(-70px); opacity: 0; } }

/* 스티커 */
.hg-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; padding: 16px; border-radius: var(--r); background: repeating-linear-gradient(0deg, #fff 0 34px, #FCF4F6 34px 35px); box-shadow: var(--shadow); }
.hg-st { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; background: #F3EEF6; color: #CFC5DA; font-weight: 900; font-size: 1.3rem; }
.hg-st.on { background: #fff; color: inherit; font-size: 2.1rem; box-shadow: 0 0 0 3px #fff, 0 6px 14px -6px rgba(70, 40, 90, .45); cursor: pointer; }
.hg-how { margin: 16px 4px 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--ink-2); font-size: .92rem; font-weight: 600; }

/* 보호자 설정 */
.hg-set { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 16px 16px; border-radius: var(--r); background: #fff; box-shadow: var(--shadow); }
.hg-set + .hg-set { margin-top: 14px; }
.hg-set-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.hg-set-row span { flex: 1 1 200px; min-width: 0; }
.hg-set-row b { display: block; font-weight: 800; }
.hg-set-row small { display: block; color: var(--ink-2); font-size: .82rem; line-height: 1.4; }
.hg-set-row input[type="range"] { flex: 1 1 160px; accent-color: var(--coral); }
.hg-set > .hg-btn { margin-top: 12px; justify-self: start; }
.hg-set.danger .hg-set-row { border: 0; }
.hg-note { margin: 6px 0 0; color: var(--ink-2); font-size: .84rem; line-height: 1.5; }

/* 축하 창 */
.hg-pop { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: rgba(46, 42, 74, .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: hgFade .2s; }
@keyframes hgFade { from { opacity: 0; } }
.hg-pop-card { width: min(360px, 100%); padding: 24px 20px 20px; border-radius: 30px; background: linear-gradient(180deg, #FFF6EE, #fff 45%); text-align: center; color: var(--ink); box-shadow: 0 30px 60px -20px rgba(46, 42, 74, .55); animation: hgCard .42s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes hgCard { from { transform: scale(.75); opacity: 0; } }
.hg-pop-card h3 { margin: 6px 0 4px; font-size: 1.55rem; font-weight: 900; letter-spacing: -.03em; }
.hg-pop-card p { margin: 0; color: var(--ink-2); font-weight: 600; line-height: 1.5; }
.hg-pop-stars { display: flex; justify-content: center; gap: 4px; min-height: 8px; }
.hg-pop-stars span { font-size: 3.2rem; line-height: 1; color: #EFE7EE; animation: hgStar .5s cubic-bezier(.3, 1.8, .5, 1) both; }
.hg-pop-stars span:nth-child(2) { font-size: 3.9rem; margin-top: -10px; }
.hg-pop-stars span.on { color: var(--sun); text-shadow: 0 3px 0 #E29B00, 0 8px 18px rgba(255, 180, 40, .45); }
@keyframes hgStar { from { transform: scale(0) rotate(-40deg); } }
.hg-pop-sticker { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px auto 0; padding: 10px 14px; border-radius: 18px; background: #FFF1CF; font-weight: 800; }
.hg-pop-sticker span { font-size: 2.2rem; animation: hgBump .6s cubic-bezier(.3, 1.6, .5, 1) .4s both; }
.hg-pop-btns { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.hg-pop-btns .hg-btn { flex: 1 1 120px; }
.hg-pop-card.guide { text-align: left; }
.hg-pop-card.guide h3 { text-align: center; font-size: 1.3rem; }
.hg-inst-icon { display: block; margin: 0 auto 8px; border-radius: 18px; box-shadow: 0 8px 20px -8px rgba(240, 90, 110, .6); }
.hg-pop-card.guide ol { margin: 12px 0 0; padding-left: 1.3em; display: grid; gap: 8px; line-height: 1.5; font-weight: 600; }
.hg-pop-card.guide p { margin-top: 10px; }
.hg-key { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 7px; background: #EEF3FF; color: #2F6FEA; font-size: .85rem; }

/* 꽃가루 */
.hg-confetti { position: fixed; inset: 0; z-index: 1001; pointer-events: none; overflow: hidden; }
.hg-confetti span { position: absolute; top: -40px; animation: hgFall 2.3s cubic-bezier(.25, .6, .4, 1) forwards; }
@keyframes hgFall { to { transform: translate(var(--dx), 108vh) rotate(540deg); } }

/* 전체 화면 */
.hg:fullscreen { max-width: none; border-radius: 0; overflow: auto; padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 20px max(14px, env(safe-area-inset-left)); }
.hg:fullscreen > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.hg.pseudo-full { position: fixed; inset: 0; z-index: 900; max-width: none; border-radius: 0; overflow: auto; }

/* 홈 화면 아이콘으로 열었을 때: 앱처럼 꽉 차게 */
html.hg-app .site-header, html.hg-app .breadcrumb, html.hg-app .tool-header, html.hg-app .tool-doc,
html.hg-app .related, html.hg-app .site-footer, html.hg-app .skip-link { display: none !important; }
html.hg-app .site-main { padding-top: 0; }
html.hg-app .tool-page { padding-top: env(safe-area-inset-top); }
html.hg-app .hg { margin-top: 8px; }
html.hg-app .hg [data-full] { display: none; }

/* 다크 모드: 놀이판은 밝은 종이 그대로 두고 바깥 그림자만 조정 */
[data-theme="dark"] .hg { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }

/* 목소리 고르기 */
.hg-voicebar { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 10px 8px 14px; border-radius: 18px; background: rgba(255, 255, 255, .7); box-shadow: 0 2px 10px -6px rgba(70, 40, 90, .3); flex-wrap: wrap; }
.hg-voicebar > span { font-weight: 800; font-size: .92rem; white-space: nowrap; }
.hg-voices { display: flex; flex-wrap: wrap; gap: 6px; }
.hg-voices button { padding: 7px 11px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font-weight: 800; font-size: .88rem; white-space: nowrap; }
.hg-voices button.on { border-color: var(--sky); background: #EEF6FF; color: #2F78D0 !important; }
.hg-select { flex: 1 1 200px; min-width: 0; max-width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: .9rem; color: var(--ink); }

/* 받아쓰기 카드 */
.hg-wide { width: 100%; flex-direction: row; align-items: center; gap: 14px; min-height: 0; margin-top: 12px; padding: 16px; }
.hg-wide-art { display: grid; grid-template-columns: repeat(2, 34px); gap: 3px; flex: none; }
.hg-wide-art span { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #9CC6F5; border-radius: 6px; background: #fff; color: #2F78D0; font-weight: 900; font-size: 1.15rem; }
.hg-wide-text { display: grid; gap: 4px; min-width: 0; }
.hg-wide-text .hg-card-name { margin: 0; font-size: 1.12rem; }

/* 받아쓰기 고르기 */
.hg-setup.left { justify-items: stretch; text-align: left; padding: 18px 14px; }
.hg-setup.left .hg-lead { text-align: center; }
.hg-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .hg-levels { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hg-lv { display: grid; gap: 2px; padding: 12px; border: 2px solid var(--line); border-radius: 18px; background: #fff; text-align: left; }
.hg-lv b { color: var(--coral-d); font-size: .82rem; font-weight: 900; }
.hg-lv span { font-weight: 900; font-size: 1rem; }
.hg-lv small { color: var(--ink-2); font-size: .8rem; }
.hg-lv i { font-style: normal; font-size: .76rem; color: #B09FC0; font-weight: 700; }
.hg-lv.on { border-color: var(--coral); background: #FFF4F5; box-shadow: 0 8px 18px -12px rgba(240, 90, 110, .8); }
.hg-note.center { text-align: center; margin: 0; }
.hg-setup-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* 받아쓰기 풀기 */
.hg-dc-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.hg-dc-head .hg-dots { margin: 0; }
.hg-dc-no { padding: 4px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 900; font-size: .95rem; }
.hg-dc-tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.hg-dc-tools .hg-btn { min-height: 44px; padding: 8px 14px; }
.hg-paper { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 76px)); justify-content: center; gap: 0; margin: 0 auto; padding: 10px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
.hg-paper span { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; margin: -1px 0 0 -1px; border: 2px solid #FFB3BE; background: linear-gradient(#FFE9EC, #FFE9EC) center / 100% 1px no-repeat, linear-gradient(#FFE9EC, #FFE9EC) center / 1px 100% no-repeat, #fff; }
.hg-paper span b { font-size: clamp(1.8rem, 9vw, 2.8rem); font-weight: 800; color: var(--ink); line-height: 1; }
.hg-paper span.sp { background: #F6F2F8; }
.hg-paper span.extra { border-style: dashed; opacity: .7; }
.hg-paper span.cur { box-shadow: inset 0 0 0 3px rgba(90, 169, 245, .45); }
.hg-paper span.good b { color: #1FA585; }
.hg-paper span.bad { background: #FFF1F3; }
.hg-paper span.bad b { color: var(--coral-d); text-decoration: line-through 3px; }
.hg-paper span em { position: absolute; right: 3px; bottom: 1px; font-style: normal; font-weight: 900; font-size: .95rem; color: #1FA585; }
.hg-keys { display: grid; gap: 8px; margin-top: 4px; }
.hg-keyrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.hg-keyrow button { width: clamp(38px, 11vw, 48px); height: clamp(42px, 12vw, 50px); border: 0; border-radius: 12px; background: #fff; box-shadow: 0 3px 0 #EBDDE2, 0 4px 10px -6px rgba(70, 40, 90, .35); font-size: clamp(1.15rem, 5vw, 1.4rem); font-weight: 800; transition: transform .08s; }
.hg-keyrow.c button { color: var(--coral-d); }
.hg-keyrow.v button { color: #2F78D0; box-shadow: 0 3px 0 #DCE7F5, 0 4px 10px -6px rgba(70, 40, 90, .35); }
.hg-keyrow button:active { transform: translateY(2px); box-shadow: none; }
.hg .hint { animation: hgPulse 1s ease-in-out infinite; box-shadow: 0 0 0 3px var(--sun), 0 0 0 8px rgba(255, 194, 75, .25) !important; background: #FFF6DA !important; }
.hg-dc-actions, .hg-marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.hg-dc-actions .hg-btn { flex: 1 1 100px; max-width: 200px; }
.hg-marks .hg-btn { flex: 1 1 150px; max-width: 230px; min-height: 56px; font-size: 1.05rem; }
.hg-btn.mark-o { background: #E7F8F2; color: #138A6D !important; }
.hg-btn.mark-x { background: #FFEFF1; color: var(--coral-d) !important; }
.hg-hand-wrap { display: none; justify-content: center; }
.hg-hand { display: block; border-radius: 14px; background: #fff; box-shadow: var(--shadow); touch-action: none; }
.hg .hand-only { display: none; }
.hg.dc-hand .hg-hand-wrap { display: flex; }
.hg.dc-hand .hg-paper, .hg.dc-hand .hg-keys, .hg.dc-hand [data-dc-space] { display: none !important; }
.hg.dc-hand .hand-only { display: inline-flex; }

/* 참 잘했어요 도장 */
.hg-stamp { position: relative; width: 96px; height: 96px; margin: -6px auto 6px; border: 5px double #E2433F; border-radius: 50%; display: grid; place-items: center; transform: rotate(-14deg); animation: hgStamp .5s cubic-bezier(.3, 1.6, .5, 1) .25s both; opacity: .9; }
.hg-stamp span { width: 64px; color: #E2433F; font-weight: 900; font-size: 1.02rem; line-height: 1.15; text-align: center; letter-spacing: .02em; }
@keyframes hgStamp { from { transform: rotate(-14deg) scale(2.2); opacity: 0; } }
@media (max-width: 420px) {
  .hg-voicebar { padding: 8px 10px; }
  .hg-voices button { padding: 6px 9px; font-size: .82rem; }
  .hg-wide-art { grid-template-columns: repeat(2, 28px); }
  .hg-wide-art span { width: 28px; height: 28px; font-size: .98rem; }
}

@media (max-width: 420px) {
  .hg { padding-inline: 10px; border-radius: 22px; }
  .hg-bar-stats .hg-pill { padding: 5px 8px; font-size: .85rem; }
  .hg-card { min-height: 136px; padding: 12px; }
  .hg-card-art { font-size: 1.7rem; }
  .hg-chart { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hg-trace-btns { gap: 6px; }
  .hg-trace-btns .hg-btn { font-size: .92rem; }
  .hg-round { width: 46px; height: 46px; }
  .hg-mascot svg { width: 84px; height: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .hg *, .hg-pop *, .hg-confetti * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
