:root {
  /* 레이아웃: 연못색 바탕 위에 종이 카드. 굵은 잉크 외곽선 + 살짝 삐뚤어진 모서리로 손그림 느낌, 채색은 전부 단색 */
  --pond: #DDF1EC;
  --paper: #FFFBF0;
  --ink: #3A2E2A;
  --duck: #FFD84D;
  --orange: #FF9838;
  --teal: #4CC2B2;
  --red: #EE5A52;
  --muted: #8A7C74;
  --line: rgba(58, 46, 42, .16);
  --f-display: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --f-note: "Gaegu", "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --wob: 22px 30px 24px 32px / 30px 22px 32px 24px;
  --wob2: 18px 26px 20px 28px / 26px 20px 28px 18px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--pond); color: var(--ink); font-family: var(--f-display); font-size: 16px; line-height: 1.35;
  overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
img { max-width: 100%; -webkit-user-drag: none; }

#app { position: relative; height: 100%; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; padding: var(--ncq-top, 0px) var(--ncq-right, 0px) var(--ncq-bottom, 0px) var(--ncq-left, 0px); }
.scr { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 16px 14px; gap: 10px; }
.grow { flex: 1; }

/* 아이콘 */
.ic { display: inline-block; width: 1.5em; height: 1.5em; background: center / contain no-repeat; flex: none; }

/* 상단 바 */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.topbar .title { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 24px; }
.iconbtn { width: 46px; height: 46px; display: grid; place-items: center; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wob2); box-shadow: 0 3px 0 var(--ink); }
.iconbtn .ic { width: 28px; height: 28px; }
.iconbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 14px 0 10px; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wob2); font-size: 18px; box-shadow: 0 3px 0 var(--ink); }
.chip b { font-weight: 400; font-size: 20px; }
.badge.t1 { background: var(--duck); color: var(--ink); }
.badge.t2 { background: #FF7A4D; color: #fff; }
.badge { font-size: 14px; padding: 2px 10px; background: var(--red); color: #fff; border: 2.5px solid var(--ink); border-radius: var(--wob2); transform: rotate(-3deg); }

/* 버튼 */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 22px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wob); box-shadow: 0 5px 0 var(--ink);
  font-size: 22px; text-align: center; transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--orange); }
.btn.yellow { background: var(--duck); }
.btn.teal { background: var(--teal); }
.btn.ghost { background: var(--paper); }
.btn.big { min-height: 76px; font-size: 32px; flex-direction: column; gap: 0; }
.btn.big small { font-size: 16px; opacity: .8; }
.btn.sub { min-height: 56px; font-size: 21px; }
.btn.sub small { font-size: 14px; color: var(--muted); margin-left: 4px; }
.btn.sub.locked { background: #E8E3D8; color: var(--muted); }
.btn.small { min-height: 42px; font-size: 18px; padding: 4px 16px; box-shadow: 0 3px 0 var(--ink); border-radius: var(--wob2); }
.btn.small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn .ic { width: 30px; height: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 홈 */
.home-hero { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
/* 로비: 레벨 길 (아래가 지나온 판, 위가 앞으로 갈 판) */
.map { flex: 1; min-height: 0; align-self: stretch; position: relative; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: none; cursor: grab;
  -webkit-mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 22px), transparent); }
.map::-webkit-scrollbar { display: none; }
.map-in { position: relative; width: 100%; }
.map-in svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-in .way { fill: none; stroke: rgba(58, 46, 42, .3); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: .1 15; vector-effect: non-scaling-stroke; }
.map-in .way.edge { stroke: var(--ink); stroke-width: 17; stroke-dasharray: none; }   /* 지나온 길: 노드처럼 굵은 테두리가 있는 리본 */
.map-in .way.done { stroke: #8FDCCB; stroke-width: 11; stroke-dasharray: none; }
.nd { position: absolute; width: 50px; height: 50px; margin: -25px 0 0 -25px; display: grid; place-items: center; }
.nd .nb { position: relative; width: 100%; height: 100%; display: grid; place-items: center; font-size: 20px; background: var(--paper); border: 3px solid var(--ink); border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%; box-shadow: 0 4px 0 var(--ink); }
.nd.done .nb { background: #BFEADF; }
.nd.todo .nb { color: #7c6f66; }
.nd.t1 { width: 62px; height: 62px; margin: -31px 0 0 -31px; }
.nd.t2 { width: 70px; height: 70px; margin: -35px 0 0 -35px; }
.nd.t1 .nb { background: #FFE78F; font-size: 23px; color: var(--ink); }
.nd.t2 .nb { background: #FFA37A; font-size: 25px; color: var(--ink); }
.nd.t1.done .nb, .nd.t2.done .nb { filter: saturate(.55) brightness(1.06); }
.nd.cur .nb { background: var(--duck); animation: toolpick 1.4s ease-in-out infinite; }
.nd .face { position: absolute; z-index: 1; left: 50%; bottom: 62%; width: 74%; aspect-ratio: 1; margin-left: -37%; background: center bottom / contain no-repeat; pointer-events: none; }
.nd .tag { position: absolute; z-index: 2; top: 100%; margin-top: 7px; padding: 1px 8px 0; font-style: normal; font-size: 12px; letter-spacing: .6px; white-space: nowrap; background: var(--duck); border: 2px solid var(--ink); border-radius: 9px 11px 10px 12px; }
.nd.t2 .tag { background: #FF7A4D; color: #fff; }
.nd .side { position: absolute; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 3px; padding: 3px 9px 3px 6px; white-space: nowrap; font-size: 14px; background: var(--paper); border: 2px dashed var(--ink); border-radius: 15px 13px 16px 12px; }
.nd .side.r { left: calc(100% + 10px); }
.nd .side.l { right: calc(100% + 10px); }
.nd .side .ic { width: 24px; height: 24px; background: center / contain no-repeat; }
.nd .side b { font-weight: 400; }
.nd .side .bar { width: 2px; height: 18px; margin: 0 4px; border-radius: 1px; background: rgba(58, 46, 42, .25); }
.nd.done .side { opacity: .4; }
.nd .me { position: absolute; z-index: 3; left: 50%; bottom: 80%; width: 70px; height: 70px; margin-left: -35px; pointer-events: none; }
.nd .me.pic { width: 104px; height: 88px; margin-left: -52px; bottom: 74%; background: center bottom / contain no-repeat; }
.logo { width: min(88%, 360px); aspect-ratio: 4.08 / 1; background: center / contain no-repeat; display: grid; place-items: center; font-size: 54px; letter-spacing: 1px; }
.home-actions { display: flex; flex-direction: column; gap: 14px; padding: 6px 12px 10px; }

/* HUD: 레벨·점수 → 하트 → 규칙 카드 3장 → 색깔별 진행 */
.scorebox { flex: 1; display: flex; justify-content: center; gap: 36px; }
.sb { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.sb span { font-size: 15px; color: var(--muted); }
.sb b { font-weight: 400; font-size: 31px; font-variant-numeric: tabular-nums; display: inline-block; }
.sb b.bump { animation: bump .3s; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wob2); }
.hearts-row, .colors-row { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; }
.hearts .ic { width: 34px; height: 34px; }
.hearts.pill { padding: 5px 16px; gap: 6px; }
.hearts .ic:nth-child(2) { animation-delay: .18s; }
.hearts .ic:nth-child(3) { animation-delay: .36s; }
.hearts .ic.empty { animation: none; }
.hearts .ic.lost { animation: heartlost .55s ease-out; }
.rules { display: flex; justify-content: space-between; gap: 5px; width: 100%; padding: 7px; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wob2); }
.rule { position: relative; flex: 1 1 auto; display: flex; align-items: center; gap: 6px; padding: 6px 5px 6px 6px; background: #F4EEDD; border-radius: 12px; text-align: left; min-width: 0; transition: background .2s; }
.rule em { font-style: normal; font-size: clamp(11px, 3.3vw, 14.5px); line-height: 1.15; letter-spacing: -.3px; white-space: nowrap; color: #5b4d46; }
.rg { width: clamp(28px, 9.6vw, 42px); height: clamp(28px, 9.6vw, 42px); flex: none; }
.rg svg { width: 100%; height: 100%; display: block; }
.rule.bad { background: #FFC9C4; animation: shake .3s 2; }
/* 틀린 이유가 된 규칙 카드: 빨간 점선 테두리가 돌아요 */
.rule .rb { position: absolute; inset: -3px; width: calc(100% + 6px); height: calc(100% + 6px); overflow: visible; pointer-events: none; display: none; }
.rule .rb rect { x: 1.5px; y: 1.5px; width: calc(100% - 3px); height: calc(100% - 3px); rx: 14px; fill: none; stroke: var(--red); stroke-width: 3; stroke-dasharray: 9 7; stroke-linecap: round; animation: dash .55s linear infinite; }
.rule.bad .rb { display: block; }
.colors { gap: 4px; justify-content: center; padding: 6px 14px 5px; }
.cdot { position: relative; width: var(--cd, 40px); height: var(--cd, 40px); flex: none; }
.cdot i { position: absolute; inset: 0; background: var(--c); -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.cdot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: none; }
.cdot u { position: absolute; right: -1px; bottom: 0; width: calc(var(--cd, 40px) * .34); height: calc(var(--cd, 40px) * .34); border-radius: 50%; background: var(--c); border: 2px solid var(--ink); display: none; }
.cdot.on i { display: none; }
.cdot.on img, .cdot.on u { display: block; }
.cdot.on { animation: cdin .3s ease-out; }                  /* 줄 안에서만 조용히 나타나요 */
@keyframes cdin { from { transform: scale(.6); opacity: .3; } }

/* 안내 말풍선(튜토리얼) */
.guide { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 6px 0 10px; background: #FFF1B8; border: 3px solid var(--ink); border-radius: var(--wob2); box-shadow: 0 4px 0 var(--ink); min-height: 108px; }
.guide::after { content: ""; position: absolute; left: 50%; bottom: -13px; width: 20px; height: 20px; background: #FFF1B8; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.guide img { height: 70px; width: auto; flex: none; }
.guide #guide-ok { position: absolute; right: 14px; bottom: -22px; z-index: 2; }   /* 확인 버튼은 말풍선 아래 모서리에 걸쳐 둬서 글자 자리를 좁히지 않아요 */
.guide p { flex: 1; margin: 0; font-family: var(--f-note); font-size: 23px; line-height: 1.22; text-wrap: balance; word-break: keep-all; }
.guide p b { font-family: var(--f-display); font-weight: 400; font-size: 1.04em; padding: 0 3px; background: linear-gradient(transparent 56%, #FFB45A 56%, #FFB45A 94%, transparent 94%); }

/* 보드 */
.board-holder { flex: 1; min-height: 0; display: grid; place-items: start center; }
/* 세로가 모자란 화면(작은 휴대폰, 위쪽 배너 광고): 판이 줄기 전에 위아래 줄을 먼저 줄여요 (View.fit이 붙여요). tight2는 규칙 카드까지 접어요 */
.scr.tight { padding-top: 6px; padding-bottom: 8px; gap: 6px; }
.scr.tight .topbar { min-height: 44px; }
.scr.tight .hearts-row, .scr.tight .colors-row { min-height: 30px; }
.scr.tight .hearts .ic { width: 26px; height: 26px; }
.scr.tight .hearts.pill { padding: 3px 14px; }
.scr.tight .colors { padding: 3px 12px 2px; }
.scr.tight .cdot { width: min(var(--cd, 40px), 30px); height: min(var(--cd, 40px), 30px); }
.scr.tight .rules { padding: 4px; }
.scr.tight .rule { padding: 3px 4px; }
.scr.tight .rg { width: 26px; height: 26px; }
.scr.tight .status { min-height: 16px; font-size: 16px; }
.scr.tight .tool { padding: 4px 2px 3px; }
.scr.tight .tool .ic { width: 30px; height: 30px; }
.scr.tight .guide { min-height: 86px; padding: 8px 12px; margin: 2px 0 8px; }
.scr.tight .guide img { height: 56px; }
.scr.tight .guide p { font-size: 20px; }
.scr.tight2 .rules { display: none; }
.board { position: relative; width: 100px; height: 100px; background: var(--paper); border: 3px solid var(--ink); border-radius: 20px 26px 22px 28px / 26px 20px 28px 22px; box-shadow: 0 5px 0 var(--ink); padding: 5px; touch-action: none; }
.board .regions, .board .cells, .board .fx { position: absolute; inset: 5px; }
.regions { width: calc(100% - 10px); height: calc(100% - 10px); overflow: visible; }
.regions .fillp { stroke: none; }
.regions .inner { fill: none; stroke: rgba(58, 46, 42, .24); stroke-width: 1.8; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.regions .pat { display: none; pointer-events: none; }
.board.patterns .regions .pat { display: block; }
.regions .hl-reg { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-dasharray: 9 7; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: dash 1.2s linear infinite; }
.regions .hl-line { fill: rgba(255, 255, 255, .28); stroke: var(--ink); stroke-width: 3.5; stroke-dasharray: 9 7; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: dash 1.2s linear infinite; }
.regions .hl-dead { fill: rgba(238, 90, 82, .3); stroke: var(--red); }
.regions .pick { fill: #fff; opacity: 0; animation: pickpulse 1.1s ease-in-out infinite; pointer-events: none; }
/* 오리찾기: 손을 댄 색 구역 전체를 점선으로 */
.regions .pick-on { fill: rgba(255, 255, 255, .42); stroke: var(--ink); stroke-width: 4.5; stroke-dasharray: 9 7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; animation: dash .6s linear infinite; pointer-events: none; }
/* 틀린 이유: 빨간 점선이 움직여요 */
.regions .hl-bad { fill: rgba(238, 90, 82, .2); stroke: var(--red); stroke-width: 5; animation: dash .55s linear infinite, fade .2s; pointer-events: none; }
/* 튜토리얼 딤: 판 전체를 한 장으로 덮고 밝힐 칸만 색 구역 모양대로 뚫어요 */
.board .dim { position: absolute; inset: 0; border-radius: 17px 23px 19px 25px / 23px 17px 25px 19px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .25s; }
.board .dim.on { opacity: 1; }
.board .dim svg { position: absolute; inset: 5px; width: calc(100% - 10px); height: calc(100% - 10px); overflow: visible; }
.board .dim .dimr { fill: rgba(58, 46, 42, .36); }
@keyframes dash { to { stroke-dashoffset: -32; } }
@keyframes pickpulse { 0%, 100% { opacity: 0; } 50% { opacity: .38; } }
.cells { display: grid; }
.cell { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; }
.mk { position: absolute; pointer-events: none; }
.mk.x { inset: 16%; width: 68%; height: 68%; overflow: visible; }
.mk.x path { fill: none; stroke: var(--ink); stroke-width: 11; stroke-linecap: round; opacity: .62; stroke-dasharray: 1; }
.mk.x.in { animation: xpop .26s ease-out; }
.mk.x.in path:nth-child(1) { animation: draw .11s ease-out both; }
.mk.x.in path:nth-child(2) { animation: draw .11s .08s ease-out both; }
.mk.x.out { animation: xout .14s ease-in forwards; }
.mk.x.wrong { inset: 12%; width: 76%; height: 76%; }
.mk.x.wrong path { stroke: var(--red); opacity: 1; stroke-width: 13; }
.mk.x.draft path { stroke: #2E7BD6; opacity: .9; stroke-dasharray: .16 .12; stroke-width: 9; }
.mk.x.ghost path { stroke: #fff; opacity: 1; stroke-width: 13; }
.mk.x.ghost { animation: blink .8s ease-in-out infinite; filter: drop-shadow(0 0 1.5px var(--ink)) drop-shadow(0 0 1.5px var(--ink)); }
.mk.x.blink { animation: blink .6s ease-in-out infinite; }
.mk.duck { inset: 2%; width: 96%; height: 96%; object-fit: contain; transform-origin: 50% 92%; animation: breathe 3.6s ease-in-out var(--d, 0s) infinite; }
.mk.duck.in { animation: duckin .36s cubic-bezier(.3, 1.6, .5, 1); }
.mk.duck.draft { opacity: .55; filter: saturate(.5); }
.mk.duck.ghost { opacity: .75; animation: blink .8s ease-in-out infinite; }
.mk.duck.hop { animation: cheer .5s ease-in-out; }
.mk.num { right: 4%; top: 2%; font-size: 70%; background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; width: 1.5em; height: 1.5em; display: grid; place-items: center; line-height: 1; }
.cell .ring { position: absolute; inset: 7%; border: 3px dashed var(--ink); border-radius: 42% 48% 44% 50%; pointer-events: none; }
.cell .ring.tut { inset: 6%; border: 4px dashed var(--orange); background: rgba(255, 255, 255, .5); animation: glow 1.2s ease-in-out infinite; }
.cell .ring.target { inset: 4%; border: 4px solid var(--ink); background: rgba(255, 255, 255, .65); box-shadow: 0 0 0 5px var(--orange); animation: pulse .9s ease-in-out infinite; }
.cell.shake { animation: shake .3s; }
@keyframes xin { from { transform: scale(.4); opacity: 0; } }
@keyframes duckin { from { transform: scale(.2) translateY(20%); } }
@keyframes cheer { 30% { transform: translateY(-7%) scale(1.03, .98); } 60% { transform: translateY(0) scale(.98, 1.03); } }
@keyframes hop { 30% { transform: translateY(-26%) scale(1.06, .96); } 60% { transform: translateY(0) scale(.96, 1.05); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes pulse { 50% { transform: scale(.86); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 25% { transform: translateX(-7%); } 50% { transform: translateX(7%); } 75% { transform: translateX(-4%); } }
@keyframes pop { 40% { transform: scale(1.5) rotate(-12deg); } }
.fx { pointer-events: none; overflow: visible; }
.fx .float small { display: block; font-size: 13px; }
.fx .float { position: absolute; transform: translate(-50%, -50%); font-size: 19px; text-align: center; line-height: 1.05; color: var(--ink); text-shadow: 0 2px 0 var(--paper), 2px 0 0 var(--paper), -2px 0 0 var(--paper), 0 -2px 0 var(--paper); animation: floatup .9s ease-out forwards; white-space: nowrap; }
.fx .frog { position: absolute; width: 12%; transform: translate(-50%, -50%); transition: left .45s cubic-bezier(.4, 0, .4, 1), top .45s cubic-bezier(.4, 0, .4, 1); }
.fx .frog.jump { animation: frogjump .45s ease-in-out; }
.fx .bit { position: absolute; width: 9px; height: 9px; border-radius: 3px; animation: confetti 1.1s ease-out forwards; }
@keyframes floatup { to { transform: translate(-50%, -190%); opacity: 0; } }
@keyframes frogjump { 50% { margin-top: -9%; } }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

.status { margin: 0; min-height: 22px; text-align: center; font-family: var(--f-note); font-size: 19px; color: #5b4d46; }

/* 도구 */
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 2px 2px 4px; }
.tool { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 7px 2px 5px; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wob2); box-shadow: 0 4px 0 var(--ink); }
.tool:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tool .ic { width: 36px; height: 36px; }
.tool em { font-style: normal; font-size: 14px; white-space: nowrap; letter-spacing: -.2px; }
.tool .cnt { position: absolute; top: -9px; right: -5px; min-width: 26px; height: 26px; padding: 0 5px; display: grid; place-items: center; background: var(--red); color: #fff; border: 2.5px solid var(--ink); border-radius: 14px 12px 15px 11px; font-weight: 400; font-size: 15px; }
.tool .cnt.zero { background: var(--teal); color: var(--ink); }
.tool.locked { background: #E8E3D8; color: var(--muted); }
.tool.locked .ic { filter: grayscale(1); opacity: .45; }
.tool.locked .cnt { background: var(--paper); color: var(--ink); font-size: 12px; }
.tool.on { background: var(--duck); transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tools.dim .tool:not(.on) { opacity: .4; pointer-events: none; }
/* 새 도구 써 보기: 눌러야 할 도구만 밝게, 주황 테두리가 번쩍이고 손가락이 톡톡 가리켜요 */
.tools.tt .tool:not(.pick) { opacity: .35; pointer-events: none; }
/* HARD · SUPER HARD 판 시작 알림: 판 위로 1초쯤 자동으로 나왔다 사라져요. 글자는 화면에 따로 그려요 (그림에 넣지 않음) */
.tier { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: rgba(58, 46, 42, .68); }
.scr > .tier { animation: tierbg 1.5s ease both; }
.tier img { position: relative; z-index: 2; width: min(64%, 300px); max-height: 38vh; object-fit: contain; margin-bottom: -30px; animation: tierduck 1.5s cubic-bezier(.2, 1.4, .4, 1) both; }
.tier-band { position: relative; z-index: 1; flex: none; width: 130%; padding: 26px 0 16px; text-align: center; background: var(--duck); border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: rotate(-7deg); animation: tierband 1.5s cubic-bezier(.2, 1.1, .3, 1) both; }
.tier.t2 .tier-band { background: #FF8A5B; }
.tier-band b { display: block; font-weight: 400; font-size: clamp(54px, 17vw, 84px); line-height: 1; letter-spacing: 3px; color: var(--ink); }
.tier.t2 .tier-band b { font-size: clamp(38px, 12.2vw, 60px); letter-spacing: 2px; }
.tier p { position: relative; z-index: 2; margin: 30px 0 0; font-family: var(--f-note); font-size: 28px; color: #FFF6DC; animation: tierline 1.5s ease both; }
@keyframes tierbg { 0% { opacity: 0; } 12%, 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tierduck { 0% { transform: translateY(40px) scale(.5); opacity: 0; } 18% { transform: translateY(0) scale(1.06); opacity: 1; } 26%, 100% { transform: none; opacity: 1; } }
@keyframes tierband { 0% { transform: rotate(-7deg) translateX(-110%); } 20%, 100% { transform: rotate(-7deg) translateX(0); } }
@keyframes tierline { 0%, 22% { opacity: 0; transform: translateY(8px); } 34%, 100% { opacity: 1; transform: none; } }
/* 튜토리얼 마지막: 화면을 80% 어둡게 덮고 말풍선과 도쿠힌트 버튼만 밝게 */
.spot { position: absolute; inset: 0; z-index: 6; background: rgba(58, 46, 42, .8); }
.scr > .spot { animation: fade .3s both; }
.scr.spoton .guide, .scr.spoton .tools { position: relative; z-index: 7; }
/* 말풍선에 '알겠어요'가 떠 있는 동안: 말풍선만 밝게 두고 나머지는 살짝 어둡게 덮어 못 누르게 해요. 버튼은 까딱까딱 흔들리고 웅웅 번져요 */
.okdim { position: absolute; inset: 0; z-index: 6; background: rgba(58, 46, 42, .45); }
.scr > .okdim { animation: fade .25s both; }
.scr.okon .guide { position: relative; z-index: 7; }
.scr.okhole .board-holder { position: relative; z-index: 7; pointer-events: none; }   /* 설명하는 칸만 밝게: 판을 덮개 위로 올리고 판의 어둠에서 그 칸만 뚫어요 */
.scr.okhole .board .dim .dimr { fill: rgba(58, 46, 42, .45); }
.scr.okhole .cell.unlit > .base { opacity: .5; }                                /* 밝게 남긴 칸이 아니면 그 칸의 오리·X도 같이 어둡게 */
.scr.okon .hintbar { z-index: 7; }                                              /* 힌트 안내 줄('확인')은 덮개 위에 */
.btn.nudge { animation: oknudge 1.25s ease-in-out infinite; }
.guide #guide-ok.nudge { background: var(--duck); }
@keyframes oknudge {
  0%, 62%, 100% { transform: none; outline: 0 solid rgba(255, 152, 56, 0); outline-offset: 0; }
  7% { transform: rotate(-9deg) scale(1.08); }
  16% { transform: rotate(8deg) scale(1.12); }
  25% { transform: rotate(-6deg) scale(1.12); }
  34% { transform: rotate(4deg) scale(1.08); }
  43% { transform: none; outline: 0 solid rgba(255, 152, 56, .95); outline-offset: 0; }
  61% { transform: scale(1.05); outline: 7px solid rgba(255, 152, 56, 0); outline-offset: 5px; }
}
.tool.pick { z-index: 2; background: #FFF1B8; animation: toolpick 1s ease-in-out infinite; }
.tthand { position: absolute; left: 50%; bottom: 78%; width: 46px; margin-left: -23px; transform: rotate(180deg); pointer-events: none; z-index: 3; animation: ttbob .9s ease-in-out infinite; }
.tthand svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 -4px 0 rgba(58, 46, 42, .22)); }
/* 낙서연필 써 보기: 칸에 그리는 동안 '확정'은 흐리게, 그린 뒤에는 '확정'이 번쩍이고 손가락이 가리켜요 */
.draftbar .btn.wait { opacity: .35; pointer-events: none; }
.draftbar .dcount { margin-right: auto; align-self: center; font-size: 16px; color: #7c6f66; }
.draftbar .btn.pick { position: relative; outline: 0 solid rgba(255, 152, 56, 0); animation: btnpick 1s ease-in-out infinite; }
@keyframes btnpick { 50% { outline: 6px solid rgba(255, 152, 56, .9); outline-offset: 2px; } }
@keyframes toolpick { 0%, 100% { box-shadow: 0 4px 0 var(--ink), 0 0 0 0 rgba(255, 152, 56, 0); } 50% { box-shadow: 0 4px 0 var(--ink), 0 0 0 7px rgba(255, 152, 56, .9); } }
@keyframes ttbob { 0%, 100% { transform: rotate(180deg) translateY(10px); } 50% { transform: rotate(180deg) translateY(0); } }

.hintbar, .draftbar { position: absolute; left: 16px; right: 16px; bottom: 12px; z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wob2); box-shadow: 0 4px 0 var(--ink); }
.hintbar { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.hintbar img { height: 44px; width: auto; grid-row: 1; }
.hintbar p, .draftbar p { margin: 0; font-family: var(--f-note); font-size: 18px; line-height: 1.18; text-wrap: balance; }
.hintbar .btn.small, .draftbar .btn.small { min-height: 38px; }
.hintbar .row { grid-column: 1 / -1; }
.row { display: flex; gap: 10px; justify-content: flex-end; }

/* 토스트 */
.toast { position: absolute; left: 50%; bottom: 112px; transform: translate(-50%, -12px); width: max-content; max-width: 90%; padding: 8px 16px; background: var(--ink); color: var(--paper); border-radius: var(--wob2); font-size: 17px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 모달 */
.modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(58, 46, 42, .45); animation: fade .15s; }
.sheet { position: relative; width: min(100%, 380px); max-height: 100%; overflow-y: auto; padding: 20px 18px 18px; background: var(--paper); border: 3px solid var(--ink); border-radius: 24px 30px 26px 32px / 30px 24px 32px 26px; box-shadow: 0 7px 0 var(--ink); animation: sheetin .22s cubic-bezier(.3, 1.4, .5, 1); display: flex; flex-direction: column; gap: 12px; }
.sheet h2 { margin: 0; font-size: 28px; font-weight: 400; text-align: center; text-wrap: balance; }
.sheet p { margin: 0; font-family: var(--f-note); font-size: 19px; text-align: center; text-wrap: balance; }
.sheet .hero { height: 128px; width: auto; align-self: center; object-fit: contain; }
.sheet .hero.joy { animation: hop .7s ease-in-out infinite; }
.sheet .row2 { display: flex; gap: 10px; margin-top: 4px; }
.sheet .row2 .btn { flex: 1; min-width: 0; }
.sheet .col { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; background: #FFF3CF; border: 2.5px solid var(--ink); border-radius: var(--wob2); }
.stat span { font-size: 13px; color: var(--muted); }
.stat b { font-weight: 400; font-size: 22px; font-variant-numeric: tabular-nums; }
.rewards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.reward { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 8px; background: #E4F6F2; border: 2.5px solid var(--ink); border-radius: var(--wob2); font-size: 17px; }
.reward .ic { width: 26px; height: 26px; }
.ver { align-self: flex-end; font-size: 12px; color: var(--muted); opacity: .7; }
.note { font-size: 13px !important; font-family: var(--f-display) !important; color: var(--muted); }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 2px dashed var(--line); font-size: 19px; }
.opt:last-of-type { border-bottom: 0; }
.opt .ic { width: 28px; height: 28px; }
.opt span.l { flex: 1; }
.opt small { display: block; font-size: 13px; color: var(--muted); }
.sw { width: 58px; height: 32px; padding: 0; border: 3px solid var(--ink); border-radius: 18px 16px 19px 15px; background: #D9D3C7; position: relative; flex: none; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 50% 46% 52% 48%; transition: transform .15s; }
.sw[aria-checked="true"] { background: var(--teal); }
.sw[aria-checked="true"]::after { transform: translateX(26px); }
.rulecard { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; text-align: left; }
.rulecard svg { width: 64px; height: 64px; }
.rulecard p { text-align: left; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.week { padding: 5px 4px; }
.week .wd { position: relative; aspect-ratio: 1; display: grid; place-items: center; font-size: 16px; background: #EFE9DC; border: 2.5px solid var(--ink); border-radius: 46% 52% 48% 54%; }
.week .wd.on { background: var(--duck); }                                  /* 받은 날: 완료 표시 */
.week .wd svg { width: 64%; height: 64%; overflow: visible; }
.week .wd svg path { fill: none; stroke: var(--ink); stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; }
.week .wd.sel::after { content: ""; position: absolute; inset: -6px; border: 2.5px dashed var(--ink); border-radius: 50%; animation: spin 9s linear infinite; pointer-events: none; }   /* 고른 날: 점선 테두리가 돌아요 */
.gift { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 104px; padding: 10px 8px; background: #F4EEDD; border-radius: 16px 20px 17px 21px; }
.gift b { font-weight: 400; font-size: 19px; }
.gift small { font-family: var(--f-note); font-size: 17px; color: var(--muted); }
.stepper { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.stepper b { font-weight: 400; min-width: 64px; text-align: center; font-size: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetin { from { transform: translateY(24px) scale(.94); opacity: 0; } }


/* ---------- 움직임: 나타날 때 그려지고 통통 튀되, 가만히 있을 때는 조용하게 ---------- */
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes plop { 0% { opacity: 0; transform: scale(.86) rotate(-2deg); } 60% { opacity: 1; transform: scale(1.03) rotate(.6deg); } 100% { transform: none; } }
@keyframes bump { 40% { transform: scale(1.3) rotate(-5deg); } }
@keyframes breathe { 50% { transform: scale(1.018, .982); } }
@keyframes nudge { 0%, 88%, 100% { transform: none; } 93% { transform: scale(1.03); } 97% { transform: scale(.992); } }
@keyframes heartlost { 0% { transform: scale(1.6) rotate(-16deg); } 30% { transform: translateX(-5px) rotate(12deg); } 60% { transform: translateX(4px) rotate(-7deg); } 100% { transform: none; } }
@keyframes xpop { 0% { transform: scale(1.3) rotate(-7deg); } 100% { transform: none; } }
@keyframes xout { to { transform: scale(.3) rotate(22deg); opacity: 0; } }
@keyframes spark { 0% { stroke-dashoffset: 1; opacity: 1; } 55% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: -1; opacity: 0; } }
@keyframes toastin { 0% { transform: translate(-50%, -16px) scale(.8); } 60% { transform: translate(-50%, 2px) scale(1.05); } 100% { transform: translate(-50%, 0); } }
@keyframes glow { 50% { background: rgba(255, 255, 255, .15); } }
/* 오리 "여어!": 앉은 모양 그대로 한쪽 날개만 들었다가(그림 바꿈) 팍 내리며 살짝 눌려요 */
@keyframes settle { 0% { transform: scale(1.06, .92); } 55% { transform: scale(.98, 1.03); } 100% { transform: none; } }
/* 오리 아이들 동작: 몸은 가만히, 머리 쪽 조각만 움직여서 칸 밖으로 나가지 않아요 */
.dk .hd { position: absolute; inset: 0; transform-origin: 48.1% 57.6%; animation: tilt var(--fd, 13s) ease-in-out var(--fo, 0s) infinite; }   /* 머리 묶음: 목을 축으로 기울어요 */
.dk i { position: absolute; inset: 0; background: center / contain no-repeat; transform-origin: 50% 35.5%; }
.dk .b1 { visibility: hidden; }
.dk.wave .b0 { visibility: hidden; }
.dk.wave .b1 { visibility: visible; }
.dk.wave .hd { rotate: 0deg !important; }                     /* 날개를 든 동안은 고개를 바로 (든 날개가 뺨 옆에 붙어 있어서) */
.dk .hr { transform-origin: 57.6% 16.1%; animation: hair var(--fd, 13s) ease-in-out var(--fo, 0s) infinite; }   /* 머리 깃털: 뿌리를 축으로 흔들려요 */
.dk .fb { --amp: 1.5%; animation: dori var(--fd, 13s) ease-in-out var(--fo, 0s) infinite; }
.dk .fk { --amp: 4%; animation: dori var(--fd, 13s) ease-in-out var(--fo, 0s) infinite; }
.dk .fe { --amp: 3.3%; animation: dori var(--fd, 13s) ease-in-out var(--fo, 0s) infinite, blinkeye var(--bd, 4.6s) linear var(--d, 0s) infinite; }
/* 고개 도리도리 한 번 (가운데 조각일수록 많이 움직여 고개를 돌리는 것처럼 보여요) */
@keyframes dori { 0%, 18%, 32%, 100% { translate: 0 0; } 22% { translate: calc(var(--amp) * -1) 0; } 27% { translate: var(--amp) 0; } }
/* 갸우뚱: 몸은 그대로 두고 머리만 크게 기울어요 */
@keyframes tilt { 0%, 57%, 83%, 100% { rotate: 0deg; } 61% { rotate: -17deg; } 64%, 76% { rotate: -15deg; } 80% { rotate: 2deg; } }
/* 머리 깃털: 고개를 돌리거나 기울일 때 한 박자 늦게 따라오며 찰랑 */
@keyframes hair {
  0%, 18%, 36%, 57%, 71%, 88%, 100% { rotate: 0deg; }
  21% { rotate: 14deg; } 25.5% { rotate: -15deg; } 30.5% { rotate: 10deg; } 33.5% { rotate: -4deg; }
  60% { rotate: 22deg; } 63.5% { rotate: -14deg; } 66.5% { rotate: 7deg; } 69% { rotate: -3deg; }
  78.5% { rotate: -20deg; } 81.5% { rotate: 12deg; } 84.5% { rotate: -5deg; }
}
/* 눈 깜빡 … 꿈빡꿈빡 */
@keyframes blinkeye { 0%, 45.5%, 48.5%, 88.7%, 91.7%, 93.3%, 96.3%, 100% { scale: 1 1; } 47%, 90.2%, 94.8% { scale: 1 .1; } }
/* 튜토리얼 손가락 시범 */
@keyframes tap2 { 0%, 50%, 100% { transform: translate(10%, 14%); } 12%, 36% { transform: translate(0, 0) scale(.94); } 24% { transform: translate(10%, 14%); } }
@keyframes tap1 { 0%, 55%, 100% { transform: translate(10%, 14%); } 22% { transform: translate(0, 0) scale(.94); } }
@keyframes ring2 { 0%, 11% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 12% { transform: translate(-50%, -50%) scale(.3); opacity: .9; } 30% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } 35% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 36% { transform: translate(-50%, -50%) scale(.3); opacity: .9; } 54%, 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }
@keyframes ring1 { 0%, 21% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 22% { transform: translate(-50%, -50%) scale(.3); opacity: .9; } 50%, 100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }
@keyframes rubwig { 0%, 100% { transform: rotate(-5deg) scale(.95); } 50% { transform: rotate(5deg) scale(.95); } }

.scr > * { animation: rise .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.scr > *:nth-child(2) { animation-delay: .04s; }
.scr > *:nth-child(3) { animation-delay: .08s; }
.scr > *:nth-child(4) { animation-delay: .12s; }
.scr > *:nth-child(5) { animation-delay: .16s; }
.scr > *:nth-child(n+6) { animation-delay: .2s; }
.scr > .hintbar, .scr > .draftbar { animation: rise .3s cubic-bezier(.2, 1.3, .4, 1) both; }
.board { animation: plop .5s cubic-bezier(.2, 1.3, .4, 1) both; }
.tool:active .ic { animation: bump .3s; }
.tool .cnt.bump { animation: bump .35s; }
.logo { animation: plop .6s cubic-bezier(.2, 1.3, .4, 1) both; }
.home-actions > * { animation: rise .45s cubic-bezier(.2, 1.3, .4, 1) .25s both; }
.home-actions > .btn.big.primary { animation: rise .45s cubic-bezier(.2, 1.3, .4, 1) .15s both, nudge 5s ease-in-out 2s infinite; }
.sheet > * { animation: rise .36s cubic-bezier(.2, 1.3, .4, 1) both; }
.sheet > *:nth-child(2) { animation-delay: .05s; }
.sheet > *:nth-child(3) { animation-delay: .1s; }
.sheet > *:nth-child(4) { animation-delay: .15s; }
.sheet > *:nth-child(n+5) { animation-delay: .2s; }
.sheet .hero { animation: plop .5s cubic-bezier(.2, 1.3, .4, 1) both; transform-origin: 50% 92%; }
.sheet .hero.joy { animation: plop .5s cubic-bezier(.2, 1.3, .4, 1) both, hop .9s ease-in-out .5s 3; }
.toast.show { animation: toastin .32s cubic-bezier(.2, 1.3, .4, 1); }
.regions .paint { fill: none; stroke: #fff; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .55s cubic-bezier(.45, 0, .55, 1) forwards; }
.regions .inner { animation: fade .4s .5s both; }
.fx .sparks { position: absolute; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%); overflow: visible; }
.fx .sparks path { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1; animation: spark .5s ease-out forwards; }
.mk.duck.settle { animation: settle .3s ease-out; }
.fx .hand { position: absolute; z-index: 3; transform: translate(-42%, -6%); transition: left .28s ease-in-out, top .28s ease-in-out, opacity .2s; pointer-events: none; }
.fx .hand svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 4px 0 rgba(58, 46, 42, .22)); }
.fx .hand.tap2 svg { animation: tap2 1.5s ease-in-out infinite; }
.fx .hand.tap1 svg { animation: tap1 1.2s ease-in-out infinite; }
.fx .hand.rub svg { animation: rubwig .5s ease-in-out infinite; }
.fx .tapring { position: absolute; aspect-ratio: 1; border: 5px solid var(--orange); border-radius: 50%; transform: translate(-50%, -50%) scale(.2); opacity: 0; pointer-events: none; }
.fx .tapring.tap2 { animation: ring2 1.5s ease-out infinite; }
.fx .tapring.tap1 { animation: ring1 1.2s ease-out infinite; }

@media (max-height: 700px) {
  .hearts .ic { width: 28px; height: 28px; }
  .sb b { font-size: 26px; }
  .guide { min-height: 88px; padding: 8px 12px; }
  .guide img { height: 54px; }
  .guide p { font-size: 20px; }
}
@media (max-height: 640px) {
  .rule em { font-size: 11px; }
  .rg { width: 28px; height: 28px; }
  .tool .ic { width: 30px; height: 30px; }
  .btn.big { min-height: 64px; font-size: 28px; }
}

/* 언어 (NcqLang): 여는 첫 순간 다른 언어가 비치지 않게, 언어가 정해지기 전에는 글자를 숨겨요 */
html:not([lang]) [data-i18n], html:not([lang]) [data-i18n-html] { visibility: hidden; }
.opt.lang { flex-wrap: wrap; row-gap: 6px; }
.opt.lang .seg { display: flex; gap: 6px; flex: none; }
.segb { font: inherit; font-size: 16px; padding: 4px 12px; border: 3px solid var(--ink); border-radius: 14px 12px 15px 11px; background: var(--paper); color: var(--ink); }
.segb.on { background: var(--duck); }
