@font-face { font-family: 'Gowun Dodum'; src: url('fonts/GowunDodum.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Gowun Batang'; src: url('fonts/GowunBatang-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #f6f1e6;
  --bg-deep: #ece4d3;
  --card: #fffcf5;
  --line: #e4dccb;
  --ink: #23312a;
  --ink-soft: #66705f;
  --muted: #9a978a;
  --green: #4f8a55;
  --green-soft: #e3eedb;
  --terra: #c8673f;
  --terra-soft: #f6e1d4;
  --gold: #e3a93a;
  --danger: #b5462e;
  --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --sans: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg-deep); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
body { -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.app { max-width: 480px; min-height: 100vh; margin: 0 auto; background: var(--bg); padding: max(18px, env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom)); position: relative; }
@media (min-width: 560px) {
  body { padding: 28px 0; }
  .app { min-height: calc(100vh - 56px); border-radius: 28px; box-shadow: 0 1px 0 var(--line), 0 18px 50px rgba(35, 49, 42, .10); }
}
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

/* 머리말 */
.top { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 8px; }
.top h1 { flex: 1; margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.top .sub { display: block; font-family: var(--sans); font-weight: 400; font-size: 14px; color: var(--ink-soft); }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-soft); }
.icon-btn:hover { background: rgba(35, 49, 42, .06); }
.icon-btn:active { background: rgba(35, 49, 42, .1); }

/* 카드 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 14px 0; }
.card h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 18px; font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.card h2 small { font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--muted); }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; background: var(--green); color: #fbfaf3; font-size: 16px; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.98); }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.soft { background: var(--green-soft); color: #2f5d35; }
.btn.terra { background: var(--terra); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid #e8c9bd; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

/* 입력 */
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }
.input { width: 100%; height: 50px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-size: 17px; outline: none; }
.input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(79, 138, 85, .15); }
.input.code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-size: 20px; }
.hint { font-size: 13.5px; color: var(--muted); margin: 6px 2px 0; }
.err { color: var(--danger); font-size: 14px; min-height: 21px; margin: 6px 2px 0; }

/* 시작 화면 */
.welcome { text-align: center; padding-top: 4vh; }
.welcome .plant { width: 150px; height: auto; display: block; margin: 0 auto; }
.welcome h1 { font-family: var(--serif); font-size: 32px; margin: 10px 0 4px; }
.welcome p.lead { margin: 0 0 22px; color: var(--ink-soft); }
.seg { display: flex; background: var(--bg-deep); border-radius: 999px; padding: 4px; margin-bottom: 4px; }
.seg button { flex: 1; min-height: 40px; border-radius: 999px; color: var(--ink-soft); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(35, 49, 42, .12); }
.welcome form { text-align: left; }
.how { margin: 30px 0 0; padding: 0; list-style: none; text-align: left; }
.how li { display: flex; gap: 12px; padding: 10px 0; color: var(--ink-soft); font-size: 15px; border-top: 1px dashed var(--line); }
.how b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: #2f5d35; font-size: 14px; }

/* 홈: 화분 목록 */
.pot-card { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px 12px 8px; margin: 12px 0; position: relative; }
.pot-card:active { background: #fdf8ec; }
.pot-card .plant { width: 84px; height: 108px; flex: none; }
.pot-card .who { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.pot-card .meta { color: var(--ink-soft); font-size: 14px; }
.pot-card .bars { display: flex; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: var(--bg-deep); }
.pill.ok { background: var(--green-soft); color: #2f5d35; }
.pill.warn { background: var(--terra-soft); color: #93421f; }
.badge { position: absolute; right: 12px; top: 12px; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--terra); color: #fff; font-size: 12.5px; display: grid; place-items: center; }
.empty { text-align: center; padding: 18px 8px 4px; }
.empty .plant { width: 140px; height: auto; }
.empty h2 { font-family: var(--serif); margin: 6px 0; font-size: 21px; }
.empty p { color: var(--ink-soft); margin: 0 0 18px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* 화분 상세 */
.hero { text-align: center; padding: 6px 0 2px; }
.hero .plant { width: 190px; height: auto; display: block; margin: 0 auto -4px; }
.hero .stage { font-family: var(--serif); font-size: 24px; font-weight: 700; margin: 0; }
.hero .stage-sub { color: var(--ink-soft); font-size: 14.5px; margin: 2px 0 10px; }
.drops { display: inline-flex; gap: 4px; vertical-align: -5px; margin-left: 4px; }
.drops .ic { width: 19px; height: 19px; stroke: #4d8fb3; }
.drops .ic.full { fill: #8cc3df; }
.stats { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { rotate: -1.2deg; } 50% { rotate: 1.4deg; } }
.pot-label { font-family: var(--sans); font-size: 10.5px; fill: #fbe6d8; letter-spacing: .02em; }

.event { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--green-soft); color: #2f5d35; font-size: 14.5px; margin: 12px 0 0; }
.event.bad { background: var(--terra-soft); color: #8a3d1d; }

/* 약속 줄 */
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 2px; }
.item .tag { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-deep); color: var(--ink-soft); flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .txt { font-size: 16px; }
.item .note { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; overflow-wrap: anywhere; }
.item .state { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item .state.ok { color: var(--green); }
.item.done .tag { background: var(--green-soft); color: #2f5d35; }
.check { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #cfc7b3; display: grid; place-items: center; color: transparent; flex: none; transition: background .15s, border-color .15s; }
.check .ic { width: 22px; height: 22px; stroke-width: 2.6; }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.confirm { min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--terra); color: #fff; font-size: 14px; flex: none; }
.confirm.done { background: var(--green-soft); color: #2f5d35; }
.waiting { font-size: 13px; color: var(--muted); flex: none; }
.rest-note { padding: 12px 14px; border-radius: 14px; background: var(--bg-deep); color: var(--ink-soft); font-size: 14.5px; }

.strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; }
.strip i { aspect-ratio: 1; border-radius: 50%; background: var(--bg-deep); position: relative; }
.strip i.kept { background: var(--green); }
.strip i.missed { background: #e3a58c; }
.strip i.idle { background: #d8d2c2; }
.strip i.open { background: transparent; border: 1.5px dashed #c9c1ad; }
.strip i.before { background: transparent; }
.strip i.today::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ink-soft); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: 0; background: var(--c); }
.legend .k { --c: var(--green); } .legend .m { --c: #e3a58c; } .legend .o { --c: #d8d2c2; }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-align: left; font-size: 15px; }
.tool small { color: var(--muted); font-size: 12.5px; }
.tool .ic { color: var(--green); }
.tool.on { background: var(--green-soft); border-color: #c9dfbf; }

/* 시트 (아래에서 올라오는 창) */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-dim { position: absolute; inset: 0; background: rgba(35, 49, 42, .35); animation: fade .2s; }
.sheet { position: relative; width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.2, .9, .3, 1); }
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 6px; }
.sheet p { color: var(--ink-soft); margin: 0 0 14px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.icon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 8px 0 4px; }
.icon-grid button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; border-radius: 12px; border: 1.5px solid var(--line); font-size: 12px; color: var(--ink-soft); }
.icon-grid button.on { border-color: var(--green); background: var(--green-soft); color: #2f5d35; }
.mine { list-style: none; padding: 0; margin: 0 0 12px; }
.mine li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mine li span { flex: 1; }
.code-big { font-family: var(--serif); font-size: 40px; letter-spacing: .18em; text-align: center; padding: 16px 0 4px; }

.toasts { position: fixed; left: 0; right: 0; top: max(14px, env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 50; pointer-events: none; padding: 0 16px; }
.toast { max-width: 440px; padding: 12px 18px; border-radius: 16px; background: var(--ink); color: #f6f1e6; font-size: 15px; box-shadow: 0 10px 30px rgba(35, 49, 42, .25); animation: up .25s; }
.toast.out { transition: opacity .3s, transform .3s; opacity: 0; transform: translateY(-8px); }

.section-title { font-size: 13.5px; color: var(--muted); margin: 22px 4px 0; letter-spacing: .02em; }
.footer-note { text-align: center; color: var(--muted); font-size: 13px; margin-top: 26px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.mt { margin-top: 14px; }
.tool[disabled] { opacity: .5; pointer-events: none; }
.sheet-x { position: absolute; right: 10px; top: 10px; }

.pot-card > span { display: flex; flex-direction: column; min-width: 0; }
.pot-card .plant { object-fit: contain; }
.strip-note { font-size: 13.5px; color: var(--muted); margin: 0 0 10px; }
#remind-form + .btn { margin-top: 10px; }
.privacy { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 8px 0; line-height: 1.5; }
.privacy { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 8px 0; line-height: 1.5; }

/* 휴대폰에 앱 설치 */
.card.install { border-color: #cfe0c9; background: #f3f8ef; text-align: left; }
.card.install h2 { gap: 6px; align-items: center; }
.card.install h2 svg { width: 20px; height: 20px; }
.steps { margin: 4px 0 0; padding-left: 20px; line-height: 1.7; color: var(--ink); }
.steps li { margin: 4px 0; }
.hint.small { font-size: 12.5px; margin-top: 10px; }
.link-btn { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; }

/* 물 주기 / 꽃말 도감 / 상점 / 푸시 */
.water-done { margin: 4px 0 0; text-align: center; }
.water-done .pill { padding: 6px 16px; font-size: 15px; }
.soft-push { display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px 16px; background: #f3f8ef; border-color: #cfe0c9; }
.soft-push span { flex: 1; font-size: 15px; }
.push-state { margin: 10px 0 0; color: #2f5d35; font-weight: 700; }
.pot-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0; }
.pot-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; border: 1.5px solid var(--line); text-align: center; }
.pot-opt.cur { border-color: var(--green); background: var(--green-soft); }
.pot-opt .plant { width: 72px; height: 92px; object-fit: contain; }
.pot-name { font-size: 13px; }
.pot-now { font-size: 12.5px; color: var(--muted); min-height: 36px; display: grid; place-items: center; }
.pot-opt .btn.small { padding: 0 8px; font-size: 12.5px; }
.sheet .event { margin: 8px 0; flex-wrap: wrap; }
.sheet .event .btn { margin-left: auto; }
.sub-h { margin: 14px 0 4px; font-size: 14px; color: var(--ink-soft); }
.dim { color: var(--muted); display: block; font-size: 12.5px; }
.pay-note { margin-top: 14px; }
.bank { display: grid; grid-template-columns: 5.5em 1fr; gap: 8px 10px; margin: 0 0 14px; align-items: center; }
.bank dt { color: var(--muted); font-size: 14px; }
.bank dd { margin: 0; overflow-wrap: anywhere; }
.code-big.dep { font-size: 34px; letter-spacing: .1em; padding: 8px 0 12px; color: var(--terra); }

.chips { display: flex; gap: 8px; margin: 4px 0 12px; }
.chip { min-height: 36px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink-soft); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gcard { position: relative; min-height: 130px; padding: 12px; border-radius: 14px; background: var(--card); border: 2px solid var(--rc, var(--line)); display: flex; flex-direction: column; gap: 4px; }
.gcard .gt { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.gcard .gx { margin: 0; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.gcard .gb { font-size: 12px; color: var(--muted); margin-top: auto; }
.gcard .gn { position: absolute; right: 10px; bottom: 8px; font-size: 12px; color: var(--muted); }
.gcard.locked { background: var(--bg-deep); align-items: center; justify-content: center; }
.gcard.locked .q { font-family: var(--serif); font-size: 38px; color: var(--rc); opacity: .7; }
.gcard.locked .rtag { position: absolute; left: 10px; top: 8px; }
.r-common { --rc: #8fb08a; --rb: #e8f1e2; }
.r-rare { --rc: #4d85b8; --rb: #e2eef8; }
.r-legend { --rc: #d4a02c; --rb: #fbf0d2; }
.rtag { align-self: flex-start; font-size: 12px; padding: 1px 9px; border-radius: 999px; background: var(--rb, var(--bg-deep)); color: var(--rc); font-weight: 700; }

.reveal { text-align: center; }
.reveal-top { margin: 6px 0 14px; }
.rcard-wrap { perspective: 900px; max-width: 280px; margin: 0 auto; }
.rcard { position: relative; min-height: 270px; transform-style: preserve-3d; animation: flip 1s .25s cubic-bezier(.3, .8, .3, 1) both; }
.rface { position: absolute; inset: 0; border-radius: 20px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.rfront { background: var(--rb); border: 3px solid var(--rc); padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow: hidden; }
.rfront .rtag { align-self: center; background: var(--rc); color: #fff; }
.rtitle { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.rtext { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.rby { color: var(--ink-soft); font-size: 14px; }
.rnew { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--rc); }
.rback { transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #dfe9d3, #dfe9d3 10px, #e9f0de 10px, #e9f0de 20px); border: 3px solid #b9cfa9; display: grid; place-items: center; font-size: 56px; }
.r-legend .rfront::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%); transform: translateX(-120%); animation: shimmer 2.6s 1.3s ease-in-out infinite; pointer-events: none; }
@keyframes flip { from { transform: rotateY(180deg); } to { transform: rotateY(0); } }
@keyframes shimmer { to { transform: translateX(120%); } }
