:root {
  --bg: #FFF9F2;
  --card: #FFFFFF;
  --ink: #14243B;
  --muted: #56617A;
  --line: #E9E1D5;
  --pink: #F8C8DC;
  --pink-soft: #FDEDF4;
  --blue: #A9D3F8;
  --blue-soft: #EAF4FD;
  --star: #F5C451;
  --danger: #A23B4C;
  --radius: 18px;
  --tabs-h: 64px;
  color-scheme: light;
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:lang(ko) { font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
:lang(ko) body { word-break: keep-all; overflow-wrap: anywhere; }
:lang(ja) { font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; line-break: strict; }
:lang(zh-Hans) { font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

.top { padding: 14px 16px 4px; max-width: 520px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct { min-height: 38px; padding: 6px 14px; font-size: .85rem; }

/* 로그인 */
.social { gap: 10px; border-color: var(--line); background: #fff; color: #1f1f1f; }
.social.google, .social.plain { border-color: #DADCE0; }
.social.kakao { background: #FEE500; border-color: #FEE500; color: #191919; }
.social.facebook { background: #1877F2; border-color: #1877F2; color: #fff; }
.social.apple, .social.dark { background: #000; border-color: #000; color: #fff; }
.social.linkedin { background: #0A66C2; border-color: #0A66C2; color: #fff; }
.social.discord { background: #5865F2; border-color: #5865F2; color: #fff; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; }
.logo { height: 36px; width: auto; display: block; }
.tagline { font-size: 11px; letter-spacing: .08em; color: var(--muted); margin: -2px 0 0 4px; font-family: Georgia, "Times New Roman", serif; font-style: italic; }

main { max-width: 520px; margin: 0 auto; padding: 8px 16px 24px; outline: none; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h2 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.now { border: 2px solid var(--ink); box-shadow: 0 6px 0 var(--pink); }
.label { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
:lang(ko) .label, :lang(zh-Hans) .label { letter-spacing: 0; }

.btn {
  appearance: none; border: 2px solid var(--ink); background: var(--card); border-radius: 999px;
  padding: 10px 16px; min-height: 44px; font-weight: 600; cursor: pointer; text-align: center;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.soft { border-color: var(--line); background: var(--blue-soft); }
.btn.ghost { border-color: transparent; background: transparent; text-decoration: underline; padding: 8px 10px; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .tab:focus-visible {
  outline: 3px solid #3D7BD9; outline-offset: 2px;
}
.chip { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer; font-weight: 600; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--pink-soft); }

.field { display: block; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; background: #fff; padding: 12px 14px; min-height: 48px;
}
textarea.input { resize: vertical; min-height: 64px; }
.input:focus { border-color: var(--ink); }

/* 지금 카드 */
.now-head { display: flex; gap: 12px; align-items: flex-start; }
.now-head .txt { flex: 1; min-width: 0; }
.step-text { font-size: 1.25rem; font-weight: 700; margin: 4px 0 2px; overflow-wrap: anywhere; }
.task-of { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.buddy { width: 64px; height: 64px; flex: none; }
.buddy.lg { width: 96px; height: 96px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge { font-size: .7rem; border-radius: 999px; padding: 2px 8px; background: var(--blue-soft); color: var(--ink); white-space: nowrap; }
details > summary { cursor: pointer; font-weight: 600; padding: 8px 0; list-style-position: inside; }
.menu { display: grid; gap: 8px; margin-top: 10px; }

/* 집중: 1인 독서실 부스 */
.booth {
  position: relative; border-radius: 24px; overflow: hidden; background: #fff;
  border: 10px solid #EFE6D8; border-top-width: 0; box-shadow: inset 0 0 0 2px var(--line);
}
.booth-scene { height: 120px; background: url(assets/focus-room.svg) center 35% / cover no-repeat; opacity: .9; }
.booth-body { padding: 0 16px 18px; margin-top: -56px; position: relative; text-align: center; }
.booth .buddy { margin: 0 auto; display: block; }
.timer-wrap { position: relative; width: 220px; max-width: 70vw; margin: 8px auto 4px; aspect-ratio: 1; }
.timer-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-digits { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-digits .num { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.timer-digits .cap { font-size: .8rem; color: var(--muted); }
.ring-bg { stroke: var(--blue-soft); }
.ring-fg { stroke: var(--ink); transition: stroke-dashoffset .9s linear; }
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.focus-actions { display: grid; gap: 10px; margin-top: 14px; }
.focus-actions .row { justify-content: center; }

/* 하단 탭 */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 249, 242, .96); border-top: 1px solid var(--line);
  display: flex; justify-content: center; z-index: 10;
}
.tab { flex: 1; max-width: 130px; border: 0; background: transparent; cursor: pointer; font-weight: 600; font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"] .dot { background: var(--pink); }
.tab .dot { width: 36px; height: 4px; border-radius: 4px; background: transparent; }

/* 오버레이 */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 36, 59, .35); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; border-radius: 24px 24px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 1.2rem; }
.step-edit { display: flex; gap: 8px; align-items: center; }
.step-edit .input { flex: 1; }
.icon-btn { border: 2px solid var(--line); background: #fff; border-radius: 12px; min-width: 44px; min-height: 44px; cursor: pointer; font-size: 1.1rem; }
.note { background: var(--blue-soft); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.note.warn { background: var(--pink-soft); }
.reward { text-align: center; }
.reward .stars { display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 1.6rem; font-weight: 800; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; }

/* 통계 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { font-size: .75rem; color: var(--muted); }
.day h3 { font-size: .9rem; color: var(--muted); margin: 14px 0 4px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.switch input { width: 48px; height: 28px; accent-color: var(--ink); }

/* 움직임: 켠 경우에만 */
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
@keyframes hop { 0% { transform: translateY(0); } 35% { transform: translateY(-10px); } 70% { transform: translateY(0); } 85% { transform: translateY(-3px); } 100% { transform: translateY(0); } }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.motion .buddy[data-state="idle"] { animation: breathe 5s ease-in-out infinite; }
body.motion .buddy[data-state="focus"] { animation: breathe 8s ease-in-out infinite; }
body.motion .buddy[data-state="done"] { animation: hop .9s ease-out 1; }
body.motion .sheet { animation: fadein .2s ease-out; }
body:not(.motion) *, body:not(.motion) *::before, body:not(.motion) *::after { animation: none !important; transition: none !important; }

/* 광고 자리: 광고 계정이 연결되기 전에는 hidden */
.ad-slot { max-width: 520px; margin: 8px auto; padding: 0 16px; min-height: 50px; text-align: center; overflow: hidden; }
body.landing .ad-slot { max-width: 720px; }
.ad-preview { border: 2px dashed #C9B8E8; border-radius: 12px; background: repeating-linear-gradient(45deg, #FBF7FF, #FBF7FF 8px, #F4EEFD 8px, #F4EEFD 16px); color: #6B5B8C; font-size: .8rem; font-weight: 600; min-height: 50px; display: flex; align-items: center; justify-content: center; padding: 6px; }
/* 함께 탭 */
.pal { align-items: flex-start !important; }
.pal-check { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; margin-top: 2px; }
.pal-check.on { border: 0; background: linear-gradient(135deg, #F4A3BA, #A9CBEA); }
.pal-ok { color: #2F7D5B; font-weight: 600; }
.invite-box { background: var(--blue-soft); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.invite-code { font-size: 1.6rem; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.invite-link { overflow-wrap: anywhere; }
.tab span { font-size: .72rem; }
/* 실시간 독서실 */
.hall-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; cursor: pointer; width: 100%; font: inherit; color: inherit; background: linear-gradient(135deg, #FFF8E8, #FDF2F7); }
.hall-join { color: var(--ink); font-weight: 700; }
.hall-panel { background: linear-gradient(135deg, #FFF8E8, #FDF2F7); }
.hall-head { display: flex; align-items: center; gap: 8px; }
.hall-dot { width: 10px; height: 10px; border-radius: 50%; background: #C9C3D6; flex: none; }
.hall-dot.on { background: #F5C451; box-shadow: 0 0 0 4px rgba(245, 196, 81, .25); }
.booth-tiles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.booth-tile { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(180deg, #FFE7A3, #F5C451); border: 2px solid #E3B33C; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: #5B4310; box-shadow: 0 2px 8px rgba(245, 196, 81, .35); }
.booth-tile.mine { background: linear-gradient(135deg, #F4A3BA, #A9CBEA); border-color: var(--ink); color: #fff; }
body.motion .hall-dot.on { animation: breathe 3s ease-in-out infinite; }
.booth-tile.dark { background: linear-gradient(180deg, #4A4E69, #2E3150); border-color: #23263F; color: #C9C3D6; box-shadow: none; }
/* 스케줄러 */
.sched-opt summary { color: var(--muted); padding: 2px 0; }
.sched-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sched-grid .field:last-child { grid-column: 1 / -1; }
.tl-nav { display: flex; align-items: center; gap: 8px; }
.tl-day { flex: 1; text-align: center; font-size: 1rem; }
.tl-row { align-items: flex-start !important; }
.tl-time { flex: none; min-width: 56px; font-weight: 800; font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl-row.done { opacity: .6; }
.tl-row.done b { text-decoration: line-through; }
.overdue { border: 2px dashed #E3B33C; background: #FFFBEF; }
.od-item { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.od-item:first-of-type { border-top: 0; padding-top: 0; }
/* 1인 독서실 50석 좌석표 */
.seat-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin-top: 10px; padding: 10px; border-radius: 14px; background: #EFE6D8; }
.seat-grid.compact { gap: 3px; padding: 6px; }
.seat { position: relative; aspect-ratio: 1; border-radius: 6px 6px 3px 3px; display: flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.seat::before { content: ""; position: absolute; left: 12%; right: 12%; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: rgba(0,0,0,.12); }
.seat.empty { background: #FFFDF8; border: 1.5px dashed #D8CBB3; color: #B9A98C; }
.seat.lit { background: radial-gradient(circle at 50% 20%, #FFF4C7, #F5C451 70%); border: 1.5px solid #E3B33C; color: #5B4310; box-shadow: 0 0 10px rgba(245, 196, 81, .55); }
.seat.dark { background: linear-gradient(180deg, #4A4E69, #2E3150); border: 1.5px solid #23263F; color: #C9C3D6; }
.seat.mine { outline: 3px solid #F4A3BA; outline-offset: 1px; }
.seat.lit.mine { background: radial-gradient(circle at 50% 20%, #FFF4C7, #F4A3BA 75%); }
.seat-grid.compact .seat { border-radius: 3px; font-size: 0; }
.seat-grid.compact .seat::before { display: none; }
.seat-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.seat-legend i.seat { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; aspect-ratio: auto; }
body.motion .seat.lit { animation: breathe 6s ease-in-out infinite; }
.hall-card .seat-grid.compact { max-width: 230px; gap: 2px; padding: 4px; border-radius: 8px; }
.hall-card .seat-grid.compact .seat { border-width: 1px; }
/* 캐릭터 방 */
.room-svg { width: 100%; height: auto; display: block; }
.room-card { padding: 10px; background: linear-gradient(180deg, #FFFDF9, #FFF6EC); }
.room-mini { position: relative; padding: 6px; cursor: pointer; width: 100%; font: inherit; color: inherit; background: linear-gradient(180deg, #FFFDF9, #FFF6EC); }
.room-mini .room-svg { max-height: 220px; }
.room-mini-label { position: absolute; right: 12px; bottom: 10px; background: var(--ink); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: .8rem; font-weight: 700; }
.fur { align-items: center !important; }
.fur-ico { font-size: 1.5rem; width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--pink-soft); }
.fur.locked .fur-ico { background: #F2EEE8; filter: grayscale(1); opacity: .7; }
.fur.locked b { color: var(--muted); }
.lamp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lamp-card { border: 2px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: #fff; }
.lamp-card.pink { background: linear-gradient(180deg, #FFF, #FDEDF4); }
.lamp-card.sky { background: linear-gradient(180deg, #FFF, #EAF4FD); }
.lamp-dot { width: 28px; height: 28px; border-radius: 50%; }
.lamp-card.pink .lamp-dot { background: radial-gradient(circle, #FFE3EC, #F2A5BE); box-shadow: 0 0 14px #F9C3D4; }
.lamp-card.sky .lamp-dot { background: radial-gradient(circle, #E6F2FF, #A9CDF0); box-shadow: 0 0 14px #C9E2F8; }
.new-fur { display: flex; align-items: center; justify-content: center; gap: 8px; background: #FFF8E8; border: 2px dashed #E3B33C; border-radius: 14px; padding: 10px; }
body.motion .new-fur .fur-ico { animation: hop .9s ease-out 1; }
/* 1인 독서실 부스 (집중 화면) */
.booth-scene { height: auto !important; background: linear-gradient(180deg, #FBF3F7, #FFF9F2) !important; opacity: 1 !important; padding: 8px 8px 0; }
.booth-svg { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto; }
.booth-body { margin-top: 0 !important; }
/* 좌석표: 칸 하나하나를 작은 부스(캐비닛)처럼 */
.seat-grid { background: #E9E4EC !important; }
.seat { border-radius: 3px !important; overflow: hidden; }
.seat::before { left: auto !important; right: 0 !important; top: 0 !important; width: 48%; height: 100% !important; border-radius: 0 !important; background: rgba(255,255,255,.55) !important; border-left: 1px solid rgba(0,0,0,.12); }
.seat::after { content: ""; position: absolute; right: 12%; top: 46%; width: 2px; height: 14%; border-radius: 1px; background: rgba(0,0,0,.25); }
.seat.empty { background: linear-gradient(180deg, #F7F1E6, #EFE6D6) !important; border: 1.5px solid #D8D2DE !important; }
.seat.empty::before { width: 22% !important; transform: skewY(8deg); transform-origin: right top; background: #FFFFFF !important; box-shadow: -2px 0 3px rgba(0,0,0,.06); }
.seat.empty::after { display: none; }
.seat.lit { background: linear-gradient(180deg, #FFE9A8, #F5C451) !important; }
.seat.lit::before { background: rgba(255,255,255,.35) !important; }
.seat.dark { background: linear-gradient(180deg, #8C92A6, #6E748A) !important; }
.seat.dark::before { background: rgba(255,255,255,.18) !important; }
.seat-grid.compact .seat::before { display: block !important; }
.seat-grid.compact .seat::after { display: none; }
/* 발자국 달력 */
.paw-card { background: linear-gradient(180deg, #FFFFFF, #FFF8FB); }
.paw-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.paw-day { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .72rem; color: var(--muted); }
.paw-day svg { width: 100%; max-width: 44px; height: auto; display: block; }
.paw-day:not(.on) svg { opacity: .7; }
.paw-day.today span { color: var(--ink); font-weight: 800; }
.paw-day.today { background: #EAF4FD; border-radius: 12px; padding: 2px 0; }
body.motion .paw-day.on.today svg { animation: hop .9s ease-out 1; }
.paw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.paw-stats div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; }
.paw-stats b { display: block; font-size: 1.4rem; }
.paw-stats span { font-size: .72rem; color: var(--muted); }
.paw-line { color: #C2557A; font-weight: 700; }
/* 별 상점 · Plus */
.shop-group { display: flex; flex-direction: column; gap: 6px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.swatch { position: relative; border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font: inherit; color: inherit; min-height: 44px; }
.swatch.on { border-color: var(--ink); }
.sw-color { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center; color: #FFF3B8; font-size: 1.1rem; }
.sw-name { font-size: .72rem; font-weight: 600; text-align: center; }
.sw-tag { font-size: .66rem; font-weight: 800; color: #8A6A1A; }
.sw-tag.on { color: var(--ink); }
.sw-tag.plus { color: #7B5BD6; }
.plus-btn { border-color: #C9B8E8; background: linear-gradient(135deg, #F6F0FF, #FDEDF4); color: #5B3FB0; }
.plus-hero { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, #F6F0FF, #FDEDF4, #EAF4FD); border-radius: 18px; padding: 12px; }
.plus-hero h2 { font-size: 1.3rem; }
.plus-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.plus-list li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: .92rem; }
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-box { position: relative; border: 2px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; background: #fff; display: flex; flex-direction: column; }
.price-box b { font-size: 1.3rem; }
.price-box span { font-size: .78rem; color: var(--muted); }
.price-box.best { border-color: #7B5BD6; }
.price-box i { position: absolute; top: -10px; right: 10px; font-style: normal; font-size: .68rem; font-weight: 800; background: #7B5BD6; color: #fff; border-radius: 999px; padding: 2px 8px; }
.theme-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card { border: 1px solid var(--line); border-radius: 16px; padding: 8px; background: #fff; display: flex; flex-direction: column; gap: 6px; text-align: center; }
.theme-card .btn { font-size: .8rem; padding: 8px 10px; }
a.btn.primary { color: #fff; }
.beg-btn { border-color: #F2A5BE; background: linear-gradient(135deg, #FFF0F5, #FDEDF4); color: #C2557A; }
.theme-card .beg-btn { font-size: .78rem; padding: 6px 10px; min-height: 36px; }
.room-img { width: 100%; height: auto; display: block; border-radius: 14px; }
.room-mini .room-img { max-height: 240px; object-fit: contain; }
/* Plus 미리보기: 방 + 독서실 나란히 */
.premium-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.premium-row figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: center; }
.premium-row figure img, .premium-row figure svg { width: 100%; height: auto; display: block; }
.premium-row figcaption { padding: 4px 6px 8px; font-weight: 700; }
.premium-row .booth-scene { padding: 4px 4px 0; }

/* 함께 연속 기록 */
.streak { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: #FFF4E5; border: 1px solid #F8DDB8; }
.streak.on { background: #FFE9EF; border-color: #F7C3D3; }
.streak-badge { font-size: 1.3rem; line-height: 1; }
.streak-msg { flex-basis: 100%; }
.streak-save { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.small-btn { padding: 4px 10px; font-size: .85rem; min-height: 0; }

/* 함께 키우는 캐릭터 */
.pet { display: flex; gap: 10px; align-items: center; margin-top: 8px; padding: 10px; border-radius: 14px; background: linear-gradient(135deg, #FDEFF4, #EEF5FD); border: 1px solid #EBDDEA; }
.pet-pic { flex: 0 0 84px; display: grid; place-items: center; height: 92px; }
.pet-egg { width: 62px; height: 74px; animation: egg-wiggle 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes egg-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-7deg); } 90% { transform: rotate(7deg); } 95% { transform: rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) { .pet-egg { animation: none; } }
.pet-img { display: block; height: auto; }
.pet-img.s1 { width: 56px; } .pet-img.s2 { width: 72px; } .pet-img.s3 { width: 88px; }
.pet-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pet-stage { font-size: .78rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.pet-bar { height: 8px; background: #fff; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.pet-bar i { display: block; height: 100%; background: linear-gradient(90deg, #F4A3BA, #A9CBEA); border-radius: 99px; }
.pet .icon-btn { width: 28px; height: 28px; min-width: 0; min-height: 0; padding: 0; font-size: .8rem; }
.pet .row { flex-wrap: wrap; }

/* ===== 생동감 (MotionSites 기법 참고): 움직임 줄이기 설정·기기 설정을 모두 따른다 ===== */
:root { --ease-out-expo: cubic-bezier(.16, 1, .3, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1); }
/* 1) 배경 빛: 분홍·하늘·노랑이 아주 천천히 흐른다(40초 안팎, 집중을 방해하지 않게 흐릿하게) */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ambient i { position: absolute; border-radius: 50%; }
.ambient i:nth-child(1) { width: 70vmax; height: 70vmax; left: -30vmax; top: -28vmax; background: radial-gradient(circle, rgba(248, 200, 220, .55) 0%, rgba(248, 200, 220, 0) 65%); }
.ambient i:nth-child(2) { width: 64vmax; height: 64vmax; right: -30vmax; top: 22vh; background: radial-gradient(circle, rgba(169, 211, 248, .45) 0%, rgba(169, 211, 248, 0) 65%); }
.ambient i:nth-child(3) { width: 48vmax; height: 48vmax; left: 4vw; bottom: -26vmax; background: radial-gradient(circle, rgba(255, 228, 168, .40) 0%, rgba(255, 228, 168, 0) 65%); }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-7vmax, -5vmax) scale(1.1); } }
@keyframes drift3 { to { transform: translate(5vmax, -4vmax) scale(.94); } }
body.motion .ambient i:nth-child(1) { animation: drift1 38s ease-in-out infinite alternate; }
body.motion .ambient i:nth-child(2) { animation: drift2 46s ease-in-out infinite alternate; }
body.motion .ambient i:nth-child(3) { animation: drift3 52s ease-in-out infinite alternate; }

/* 2) 카드: 살짝 뜬 느낌(그림자) + 화면 바꿀 때 차례로 흐림 → 선명하게 떠오르기 */
.card { box-shadow: 0 1px 0 rgba(20, 36, 59, .03), 0 10px 28px -16px rgba(20, 36, 59, .18); }
@keyframes blurRise { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
body.motion .rise { animation: blurRise .7s var(--ease-out-expo) var(--d, 0ms) both; }
body.motion .card.now.rise { animation: blurRise .7s var(--ease-out-expo) var(--d, 0ms) both, nowGlow 1.6s ease-out calc(var(--d, 0ms) + .5s) 1; }
@keyframes nowGlow { 0% { box-shadow: 0 6px 0 var(--pink), 0 0 0 0 rgba(244, 163, 186, .55); } 100% { box-shadow: 0 6px 0 var(--pink), 0 0 0 16px rgba(244, 163, 186, 0); } }

/* 3) 버튼: 누르면 말랑하게 눌리고, 마우스를 올리면 살짝 뜬다 */
.btn { transition: transform .22s var(--ease-spring), box-shadow .25s ease, background-color .2s ease; }
body.motion .btn:active:not(:disabled) { transform: scale(.95); transition-duration: .08s; }
@media (hover: hover) {
  body.motion .btn:hover:not(:disabled) { transform: translateY(-2px); }
  .btn.primary:hover:not(:disabled) { box-shadow: 0 8px 18px -8px rgba(20, 36, 59, .55); }
  .btn.soft:hover:not(:disabled) { box-shadow: 0 6px 14px -8px rgba(78, 133, 191, .5); }
}

/* 4) 아래 탭: 고른 탭의 아이콘이 콩 튀고, 점이 늘어나며 생긴다 */
@keyframes tabPop { 0% { transform: scale(.8) translateY(2px); } 60% { transform: scale(1.15) translateY(-2px); } 100% { transform: none; } }
@keyframes dotIn { from { transform: scaleX(.2); opacity: 0; } to { transform: none; opacity: 1; } }
body.motion .tab[aria-current="page"] svg { animation: tabPop .5s var(--ease-spring); }
body.motion .tab[aria-current="page"] .dot { animation: dotIn .45s var(--ease-spring); }

/* 5) 시그니처: 할 일을 끝내면 발자국 6개가 콩콩 찍히며 지나가고, 캐릭터에서 하트·별이 터진다 */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.paw-print { position: absolute; left: var(--x); top: var(--y); width: 48px; height: 48px; filter: drop-shadow(0 2px 0 rgba(20, 36, 59, .14)); opacity: 0; animation: pawStep 1.6s var(--ease-out-expo) var(--d) forwards; }
.paw-print svg, .spark svg { display: block; width: 100%; height: 100%; }
@keyframes pawStep { 0% { opacity: 0; transform: rotate(var(--r)) scale(.3); } 16% { opacity: .95; transform: rotate(var(--r)) scale(1.18); } 28% { transform: rotate(var(--r)) scale(1); } 70% { opacity: .9; } 100% { opacity: 0; transform: rotate(var(--r)) scale(.96) translateY(-8px); } }
.spark { position: absolute; left: var(--ox); top: var(--oy); width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); opacity: 0; animation: sparkFly 1.15s cubic-bezier(.2, .8, .3, 1) var(--d) forwards; }
@keyframes sparkFly { 0% { opacity: 0; transform: translate(0, 0) scale(.3); } 14% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1) rotate(var(--rot)); } }
@keyframes starPop { 0% { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.25) rotate(12deg); } 100% { transform: none; } }
body.motion .reward .stars img { animation: starPop .8s var(--ease-spring) .15s both; }
body.motion .sheet { animation: sheetUp .45s var(--ease-out-expo); }
@keyframes sheetUp { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }

/* 6) 알림 말풍선이 통통 올라온다 */
#toast { transition: opacity .2s, transform .35s var(--ease-spring); transform: translate(-50%, 10px); }
#toast.show { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .ambient i, .rise, .btn, .tab svg, .tab .dot, .paw-print, .spark, .reward .stars img, .sheet { animation: none !important; transition: none !important; }
  .burst { display: none; }
}

/* 글씨: 프리텐다드(한국어·영어). 제목은 굵고 촘촘하게, 숫자는 폭을 맞춰 흔들리지 않게 */
h1 { font-weight: 800; letter-spacing: -0.025em; }
h2 { letter-spacing: -0.01em; }
:lang(ko) h1, :lang(en) h1 { line-height: 1.25; }
.btn { letter-spacing: -0.005em; }
.stat b, .invite-code, .pet-bar + span { font-variant-numeric: tabular-nums; }

/* 캐릭터 얼굴 사진 */
.face-card .face-prev { width: 76px; height: 76px; flex: 0 0 76px; }
.face-pick { cursor: pointer; }
.crop-box { width: 240px; height: 240px; margin: 4px auto; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--pink), 0 8px 24px -12px rgba(20, 36, 59, .35); touch-action: none; background: #f3eef5; }
.crop-box canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.crop-box canvas:active { cursor: grabbing; }
.crop-zoom { width: 100%; accent-color: #EE8FAE; }
.face-btns { gap: 8px; } .face-btns .face-pick { flex: 1; min-width: 0; padding-left: 10px; padding-right: 10px; }

/* 로고: 하트 그림 + FOCUSTEP 글자 (Fraunces Black Soft, 이 글자들만 받아 옴) */
.wordlogo { display: inline-flex; align-items: center; gap: 4px; height: 36px; color: #14243B; text-decoration: none; }
.wordlogo img { height: 100%; width: auto; display: block; }
.wordlogo b { font-family: "Fraunces", "Cooper Black", Georgia, serif; font-weight: 900; font-variation-settings: "SOFT" 100, "opsz" 144; font-size: 27px; line-height: 1; letter-spacing: .01em; }
.wordlogo.big { height: 52px; margin: 0 auto; display: flex; justify-content: center; }
.wordlogo.big b { font-size: 38px; }
/* 앱을 열 때 잠깐 보이는 화면 */
#splash { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-content: center; justify-items: center; gap: 6px; transition: opacity .45s ease; }
#splash img { width: 168px; height: 168px; animation: splashPop .7s cubic-bezier(.34, 1.56, .64, 1) both; }
#splash p { margin: 0; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; font-size: 1.35rem; color: #14243B; animation: splashUp .6s cubic-bezier(.16, 1, .3, 1) .25s both; }
#splash.hide { opacity: 0; pointer-events: none; }
@keyframes splashPop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes splashUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #splash { display: none; } }
.wordlogo b { white-space: nowrap; word-break: keep-all; overflow-wrap: normal; }
@media (max-width: 420px) {
  .top .wordlogo { height: 30px; }
  .top .wordlogo b { font-size: 21px; }
}

/* 앱 첫 화면(환영): 랜딩과 같은 큰 FOCUSTEP + 책 읽는 큰 캐릭터 */
.onb-hero .onb-word { font-family: "Fraunces", "Cooper Black", Georgia, serif; font-weight: 900; font-variation-settings: "SOFT" 100, "opsz" 144; font-size: clamp(44px, 15vw, 96px); line-height: .95; color: #14243B; margin: 4px 0 0; white-space: nowrap; word-break: keep-all; overflow-wrap: normal; }
.onb-hero .onb-buddy { width: min(300px, 74vw); height: auto; display: block; margin: -6px auto -4px; }
.onb-hero .onb-title { font-size: clamp(1.35rem, 5.6vw, 1.8rem); line-height: 1.3; white-space: pre-line; word-break: keep-all; margin: 0; }

/* 앱 안 ADHD 체크 카드 */
.adhd-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; background: linear-gradient(135deg, #FDEFF4, #EEF5FD); border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--pink); }
.adhd-ico { font-size: 1.8rem; line-height: 1; }
.adhd-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.adhd-go { font-size: 1.6rem; font-weight: 800; color: var(--muted); }
/* 앱 위쪽: 로고 글씨 작게 + 옆에 ADHD 테스트 버튼, 로고 밑줄 없애기 */
.brand { text-decoration: none; color: inherit; }
body:not(.landing) .top { gap: 8px; }
body:not(.landing) .top .wordlogo { height: 28px; }
body:not(.landing) .top .wordlogo b { font-size: 19px; }
body:not(.landing) .top .tagline { font-size: 10px; }
.top-tab { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .82rem; white-space: nowrap; box-shadow: 0 3px 0 var(--pink); }
.top-tab:active { transform: scale(.96); }
.top .acct { white-space: nowrap; flex-shrink: 0; padding: 6px 12px; }
.top-tab { flex-shrink: 0; padding: 6px 10px; }
body:not(.landing) .top .brand { flex-shrink: 1; min-width: 0; }
.top-tab { font-size: .7rem; min-height: 32px; padding: 4px 9px; gap: 3px; }
/* 위쪽 두 버튼(ADHD 테스트 · 계정) 크기 통일 */
body:not(.landing) .top .top-tab, body:not(.landing) .top .acct { height: 36px; min-height: 36px; padding: 0 12px; font-size: .78rem; font-weight: 700; line-height: 1; border-width: 2px; box-shadow: none; display: inline-flex; align-items: center; justify-content: center; }
/* 좁은 휴대폰(약 400px 이하): 로고·버튼·간격을 함께 줄여 겹치지 않게 */
@media (max-width: 400px) {
  body:not(.landing) .top { padding: 12px 12px 4px; gap: 6px; }
  body:not(.landing) .top .wordlogo { height: 26px; gap: 3px; }
  body:not(.landing) .top .wordlogo b { font-size: 17px; }
  body:not(.landing) .top .tagline { font-size: 9.5px; margin-left: 2px; }
  body:not(.landing) .top .top-tab, body:not(.landing) .top .acct { height: 32px; min-height: 32px; padding: 0 10px; font-size: .72rem; }
  .top-tab { gap: 2px; }
}
@media (max-width: 340px) {
  body:not(.landing) .top .wordlogo b { font-size: 15px; }
  body:not(.landing) .top .top-tab, body:not(.landing) .top .acct { padding: 0 8px; }
}
