:root {
  --bg: #F7F3EA; --card: #FFFDF8; --line: #E2DACB; --ink: #2B2A26; --ink-2: #6B665C;
  --leaf: #2F5E35; --on-leaf: #FFFFFF; --sprout: #5E9B54; --soil: #8A6A4F; --sun: #E8B04A; --bloom: #C8614A; --sky: #8DB3C7;
  --sky-top: #DCE9EE; --art-line: #5A4A3B; --art-fill: #FFFDF8;
  --font: 'Pretendard Variable', Pretendard, 'Malgun Gothic', system-ui, sans-serif;
  color-scheme: light dark;
}
html[lang="ja"] { --font: 'Pretendard JP Variable', 'Pretendard JP', 'Hiragino Sans', 'Yu Gothic UI', system-ui, sans-serif; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1B18; --card: #272521; --line: #3A3731; --ink: #EDE7DA; --ink-2: #A8A194;
    --leaf: #8CC27E; --on-leaf: #17240F; --sprout: #6FA863; --soil: #9C7B5E; --sun: #E2A93F; --bloom: #E07C64; --sky: #5F8799;
    --sky-top: #24333A; --art-line: #E3D6C2; --art-fill: #3B352C;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--font); word-break: keep-all; overflow-wrap: anywhere; }
/* 일본어는 띄어쓰기가 없어 keep-all 을 쓰면 넘친다 */
html[lang="ja"] body { word-break: normal; line-break: strict; }
.langs { display: inline-flex; gap: 14px; }
.langs a { text-decoration: underline; text-underline-offset: 3px; }
.langs a[aria-current] { font-weight: 700; text-decoration: none; color: var(--ink); }
footer .langs { display: flex; margin-top: 10px; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--leaf); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font); font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; margin: 0; }
h1 { font-size: 28px; } h2 { font-size: 19px; } h3 { font-size: 17px; }
p { margin: 0 0 12px; }
svg { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.small { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 56px; width: 100%; padding: 10px 18px; border: 1px solid var(--leaf); border-radius: 10px; background: var(--leaf); color: var(--on-leaf); font-weight: 600; text-align: center; line-height: 1.4; }
.btn.line { background: transparent; color: var(--leaf); }
.btn.bloom { background: var(--bloom); border-color: var(--bloom); color: #fff; }
.stack > * + * { margin-top: 10px; }

/* 머리(PC)·하단 탭(폰) */
.top { display: none; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.mid svg { width: 28px; height: 28px; }
.tabs a[aria-current] { color: var(--leaf); font-weight: 700; }
.tabs a[aria-current] svg { fill: color-mix(in srgb, var(--leaf) 20%, transparent); }
.page-head { display: flex; align-items: center; gap: 8px; padding: 18px 20px 10px; max-width: 1120px; margin: 0 auto; }
.page-head h1 { font-size: 24px; }
.back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -10px; font-size: 28px; line-height: 1; }
footer { margin-top: 40px; padding: 22px 20px calc(96px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
footer .in { max-width: 1080px; margin: 0 auto; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
footer nav a { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1024px) {
  .tabs { display: none; }
  footer { padding-bottom: 48px; }
  .top { display: block; border-bottom: 1px solid var(--line); }
  .top .in { display: flex; align-items: center; height: 64px; max-width: 1120px; margin: 0 auto; padding: 0 20px; gap: 12px; }
  .logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; white-space: nowrap; }
  .top .langs { margin-left: 22px; font-size: 13px; color: var(--ink-2); }
  .top nav a { white-space: nowrap; }
  .logo svg { width: 28px; height: 28px; }
  .top nav { margin-left: auto; display: flex; gap: 26px; }
  .top nav a[aria-current] { color: var(--leaf); font-weight: 700; }
}

/* 홈 */
.hero-art { background: linear-gradient(var(--sky-top), var(--bg)); height: 220px; display: flex; align-items: flex-end; }
.hero-art svg { width: 100%; height: 100%; }
.hero-art .pc { display: none; }
.hero-text { padding: 20px 20px 0; }
.hero-text h1 { font-size: 28px; }
.hero-text .btn { margin-top: 14px; }
.hero-text .small { margin-top: 8px; }
.home { max-width: 1120px; margin: 0 auto; padding: 0 20px; display: grid; gap: 28px; margin-top: 24px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.sec-head a { font-size: 13px; color: var(--ink-2); }
.row-card { display: flex; gap: 14px; align-items: center; padding: 14px; }
.row-card .pic { flex: none; width: 64px; height: 64px; display: grid; place-items: center; }
.row-card .pic svg { width: 64px; height: 64px; }
.row-card b { display: block; line-height: 1.5; }
.week .pic16 { height: 170px; border-bottom: 1px solid var(--line); display: grid; place-items: end center; }
.week .pic16 svg { height: 160px; }
.week .txt { padding: 12px 14px; }
.scroller { display: flex; gap: 12px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scroll-snap-type: x mandatory; scroll-padding-left: 20px; }
.scroller > * { flex: none; width: 156px; scroll-snap-align: start; }
.tile { display: block; overflow: hidden; }
.tile .pic { aspect-ratio: 1; display: grid; place-items: end center; border-bottom: 1px solid var(--line); }
.tile .pic svg { width: 76%; height: 92%; }
.tile .txt { display: block; padding: 10px 12px 12px; line-height: 1.45; }
.opt .t { text-wrap: balance; }
.tile b { display: block; min-height: 2.9em; font-weight: 600; font-size: 15px; }
.soon { cursor: default; }
.soon .pic { opacity: .45; }
.list { overflow: hidden; }
.list > * { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.list > * + * { border-top: 1px solid var(--line); }
.list .pic { flex: none; width: 48px; height: 48px; }
.list .pic svg { width: 48px; height: 48px; }
.list .meta { margin-left: auto; flex: none; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.page { max-width: 1120px; margin: 0 auto; padding: 4px 20px 0; }
.page.text { max-width: 640px; }
.page.text h2 { margin: 26px 0 8px; }
@media (min-width: 1024px) {
  .hero { max-width: 1120px; margin: 0 auto; padding: 24px 20px 0; display: grid; grid-template-columns: 7fr 5fr; gap: 28px; align-items: center; height: 440px; }
  .hero-art { height: 100%; border-radius: 12px; overflow: hidden; }
  .hero-art .ph { display: none; }
  .hero-art .pc { display: block; }
  .hero-text { padding: 0; }
  .hero-text .btn { max-width: 320px; }
  .home { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 36px; }
  .home > .c2 { grid-column: span 2; } .home > .c3 { grid-column: span 3; } .home > .c6 { grid-column: span 6; }
  .scroller { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }
  .scroller > * { width: auto; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* 놀이 */
.stage { text-align: center; padding-top: 8px; }
.stage .envelope { width: 190px; margin: 6px auto 14px; }
.stage .btn { margin-top: 16px; }
.friend { padding: 12px 14px; text-align: left; margin-bottom: 14px; border-left: 4px solid var(--sun); }
.q-top { display: flex; align-items: center; gap: 8px; }
.q-top button { border: 0; background: none; width: 40px; height: 40px; font-size: 28px; line-height: 1; margin-left: -10px; padding: 0; }
.q-text { font-size: 20px; margin: 10px 0 16px; min-height: 2.8em; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt { display: flex; flex-direction: column; padding: 0; overflow: hidden; background: var(--card); border: 2px solid var(--line); border-radius: 12px; text-align: center; }
.opt .pic { display: grid; place-items: center; height: 104px; border-bottom: 1px solid var(--line); }
.opt .pic svg { width: 78px; height: 74px; }
.opt .t { flex: 1; display: grid; place-items: center; padding: 10px 10px 12px; font-size: 15px; line-height: 1.5; min-height: 4.4em; }
.opt[aria-pressed="true"] { border-color: var(--leaf); box-shadow: inset 0 0 0 1px var(--leaf); }
.opts.map { gap: 3px; background: var(--soil); border: 3px solid var(--soil); border-radius: 12px; }
.opts.map .opt { border-radius: 8px; border-color: var(--card); }
.opts.map .opt .pic { height: auto; aspect-ratio: 16 / 10; }
.opts.map .opt .pic svg { width: 100%; height: 100%; }
.opts.map .opt[aria-pressed="true"] { border-color: var(--leaf); }
.holes { display: flex; justify-content: center; gap: 8px; margin: 22px 0 6px; }
.holes i { position: relative; width: 26px; height: 14px; border-radius: 50%; background: color-mix(in srgb, var(--soil) 45%, var(--bg)); }
.holes i.on::after { content: ''; position: absolute; left: 8px; top: 1px; width: 10px; height: 10px; border-radius: 50% 50% 55% 55%; background: var(--sun); }
.holes i.drop::after { animation: drop .35s ease-in both; }
@keyframes drop { from { transform: translateY(-34px); opacity: 0; } }
.gather { position: relative; height: 340px; }
.gather svg { position: absolute; left: 50%; bottom: 0; width: 220px; margin-left: -110px; }
.gather i { position: absolute; left: 50%; top: 40%; width: 14px; height: 16px; margin: -8px 0 0 -7px; border-radius: 50% 50% 55% 55%; background: var(--soil); animation: gather 1.35s cubic-bezier(.5, 0, .6, 1) both; }
@keyframes gather { 0% { transform: translate(var(--x), var(--y)); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(0, 150px) scale(.4); opacity: 0; } }

/* 결과 */
.bloom-box { background: linear-gradient(var(--sky-top), var(--bg)); border-radius: 12px; display: grid; justify-items: center; padding-top: 12px; }
.bloom-box > svg { width: min(100%, 320px); height: auto; }
.res-head { text-align: center; margin: 14px 0 18px; }
.res-head h1 { font-size: 36px; }
.sec { padding: 14px 16px; margin-bottom: 10px; }
.sec h3 { font-size: 15px; margin-bottom: 4px; }
.sec p:last-child { margin-bottom: 0; }
.side-row { display: flex; gap: 12px; align-items: center; }
.side-row svg { width: 64px; flex: none; }
.pair-cap p { margin-bottom: 8px; }
[hidden] { display: none !important; }
.rise > * { animation: rise .6s ease-out both; }
.rise > :nth-child(2) { animation-delay: .12s; } .rise > :nth-child(3) { animation-delay: .24s; } .rise > :nth-child(n+4) { animation-delay: .36s; }
.rise.late > * { animation-delay: 2.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 30; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 14px; white-space: nowrap; }

/* 식물 움직임 */
.plant.grow .stem { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s ease-out var(--d) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.plant.grow .pop { transform-box: fill-box; transform-origin: 50% 100%; animation: pop .55s cubic-bezier(.3, 1.5, .5, 1) var(--d) both; }
@keyframes pop { from { transform: scale(0); } }
.plant .wiggle { transform-origin: 100px 192px; animation: wiggle 3s ease-in-out infinite; }
@keyframes wiggle { 0%, 82%, 100% { transform: rotate(0); } 86% { transform: rotate(-7deg); } 91% { transform: rotate(6deg); } 96% { transform: rotate(-3deg); } }

/* 정원 */
.garden { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 8px; }
.garden figure { margin: 0; text-align: center; }
.garden figure > svg { width: 100%; height: auto; border-bottom: 12px solid var(--soil); }
.garden figcaption { padding: 6px 4px 18px; font-size: 13px; line-height: 1.5; }
@media (min-width: 1024px) { .garden { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.text-btn { border: 0; background: none; padding: 8px 0; color: var(--ink-2); text-decoration: underline; font-size: 13px; }

/* 유형 모임: 네 글자 눈금 맞추기 */
.dials { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.dial { display: grid; grid-template-rows: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.dial button { border: 0; background: none; height: 68px; font: 700 30px var(--font); color: var(--ink-2); }
.dial button + button { border-top: 1px solid var(--line); }
.dial button[aria-pressed="true"] { background: var(--leaf); color: var(--on-leaf); }
.rooms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rooms a { background: var(--card); text-align: center; padding: 14px 0; font-weight: 700; letter-spacing: 0; font-size: 15px; }
.rooms a.mine { background: color-mix(in srgb, var(--sun) 28%, var(--card)); }

/* 도움 카드 */
.help { padding: 16px; }
.help a.tel { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.help a.tel b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--leaf); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .plant.grow .stem { stroke-dashoffset: 0; }
  .gather i { display: none; }
}
