/* 像花美好的小花園（種花 app）。顏色、字、按鈕跟網站的測驗／抽牌／種花頁同一套（site.css 的 pk-），柯基和 18 盆是闆娘的圖。
   版面：手機一個畫面＝上面標題、中間花園（兩層花架各三盆＋草地上的柯基）、下面一顆大按鈕＋分頁列。電腦上置中成手機寬。 */
:root {
  --paper: #F6EEE0; --card: #FFFCF6; --ink: #4A3526; --ink-2: #806555; --cocoa: #8B4A2E;
  --coral: #E3876F; --coral-deep: #C25F45; --green: #4E8A62; --line: #EADFD0;
  --tape: #FBDDA0; --accent: #E3876F; --soft: #FFF3D6;
  --hand: "LXGW WenKai TC", "DFKai-SB", "KaiTi", serif;
  --body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --script: "Segoe Print", "Bradley Hand", "Chalkboard SE", cursive;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
.tone-yellow { --tape: #FBDDA0; --accent: #E3962B; --soft: #FFF3D6; }
.tone-pink { --tape: #F7CFD6; --accent: #D46F88; --soft: #FCE9EC; }
.tone-blue { --tape: #D2DFF2; --accent: #5B83C0; --soft: #EBF1FA; }
.tone-red { --tape: #F5C6BD; --accent: #C5534B; --soft: #FBE5E0; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: #E8DDCB; color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
img, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 外框：手機全螢幕；電腦置中一支手機寬 ---------- */
.app, .planting { position: fixed; top: 0; bottom: 0; left: 0; right: 0; width: 100%; max-width: 480px; margin: 0 auto; background: var(--paper); }
.app { display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 560px) and (min-height: 700px) {
  .app, .planting { top: 18px; bottom: 18px; border-radius: 30px; box-shadow: 0 34px 70px -34px rgba(79, 53, 41, .55); overflow: hidden; }
}
.screen { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.tape { display: inline-block; padding: 3px 16px 5px; border-radius: 4px 14px 5px 12px; background: var(--tape); transform: rotate(-2deg);
  font-family: var(--hand); font-weight: 700; font-size: 20px; color: var(--ink); letter-spacing: .04em; }
.script-en { font-family: var(--script); font-size: 13px; line-height: 1.2; color: var(--ink-2); }
.page-head { text-align: center; }
.page-head h1 { font-family: var(--hand); font-weight: 700; font-size: 27px; color: var(--cocoa); letter-spacing: .06em; line-height: 1.35; }

/* 按鈕 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px; border-radius: 999px;
  font-family: var(--hand); font-weight: 700; font-size: 18px; letter-spacing: .06em; transition: transform .15s, background .2s, box-shadow .2s; user-select: none; -webkit-user-select: none; }
.btn:active { transform: scale(.97); }
.btn-coral { min-width: 230px; background: var(--coral); color: #fff; box-shadow: 0 14px 26px -16px rgba(200, 90, 60, .85); }
.btn-coral:disabled { background: #EBCABC; color: #FFF8F3; box-shadow: none; cursor: default; }
.btn-coral.is-water { background: #6F9FCB; box-shadow: 0 14px 26px -16px rgba(60, 100, 160, .85); }
.btn-line { background: var(--green); color: #fff; box-shadow: 0 14px 26px -16px rgba(40, 90, 55, .8); }
.btn-line::before { content: "LINE"; padding: 2px 7px; border-radius: 999px; background: #fff; color: var(--green); font-family: var(--body); font-weight: 700; font-size: 11px; letter-spacing: 0; }
.btn-ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.link { font-family: var(--hand); font-size: 15px; color: var(--coral-deep); text-decoration: underline; text-underline-offset: 4px; padding: 6px 2px; }

/* ---------- 花園 ---------- */
.garden { display: flex; flex-direction: column; overflow: hidden; padding-top: var(--safe-t); }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 12px 16px 2px; }
.brand h1 { font-family: var(--hand); font-weight: 700; font-size: 22px; color: var(--cocoa); letter-spacing: .05em; line-height: 1.3; }
.chip { flex: none; margin-bottom: 2px; padding: 6px 14px; border-radius: 99px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line);
  font-family: var(--hand); font-size: 15px; white-space: nowrap; }
.chip b { color: var(--coral-deep); }
.install-tip { display: flex; align-items: center; gap: 10px; margin: 8px 12px 0; padding: 7px 4px 7px 9px; border-radius: 16px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line), 0 10px 18px -16px rgba(79, 53, 41, .7); }
.install-tip img { flex: none; border-radius: 10px; }
.install-tip p { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; }
.mini { flex: none; padding: 6px 13px; border-radius: 99px; background: var(--coral); color: #fff; font-family: var(--hand); font-weight: 700; font-size: 14px; }
.tip-x { flex: none; width: 30px; height: 34px; color: var(--ink-2); font-size: 20px; line-height: 1; }

.garden-scene { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; margin: 10px 12px 0; border-radius: 26px; overflow: hidden;
  background: linear-gradient(#E4EEF2 0%, #F3F1E7 46%, #F5EEDD 100%); box-shadow: inset 0 0 0 1.5px rgba(139, 74, 46, .1); }
/* 遠遠的兩座小山 */
.garden-scene::before { content: ""; position: absolute; left: -20%; right: -20%; bottom: 0; height: 72%; pointer-events: none;
  background: radial-gradient(48% 46% at 22% 100%, #DDE7CC 0 99%, transparent 100%), radial-gradient(52% 40% at 82% 100%, #E5ECD6 0 99%, transparent 100%); }
.sky { position: absolute; inset: 0; pointer-events: none; }
.sun { position: absolute; top: 16px; left: 18px; width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #FFF0B8, #FDD670 60%, #F4B84E); box-shadow: 0 0 0 9px rgba(255, 226, 140, .22), 0 0 36px 16px rgba(255, 226, 140, .35); }
.cloud { position: absolute; width: 84px; height: 26px; border-radius: 99px; background: rgba(255, 255, 255, .92); }
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 38px; height: 38px; left: 14px; top: -18px; }
.cloud::after { width: 30px; height: 30px; left: 40px; top: -12px; }
.c1 { top: 34px; left: 62%; animation: drift 70s linear infinite; }
.c2 { top: 78px; left: 18%; transform: scale(.7); opacity: .8; animation: drift 95s linear infinite -40s; }
@keyframes drift { from { translate: -60vw 0; } to { translate: 60vw 0; } }

.spots { position: relative; display: flex; flex-direction: column; gap: 4px; }
.shelf { position: relative; display: flex; justify-content: center; gap: 8px; padding: 0 10px; }
/* 木頭花架：盆子坐在木板上，名牌貼在木板前面 */
.shelf::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 15px; height: 13px; border-radius: 3px 3px 5px 5px; z-index: 0;
  background: linear-gradient(#DDBB95 0 35%, #C99E77 36% 100%); box-shadow: 0 7px 10px -7px rgba(90, 60, 40, .65); }
.spot { position: relative; z-index: 1; width: var(--spot-w, 100px); padding-bottom: 26px; border-radius: 16px; transition: transform .15s; }
.spot:active { transform: scale(.95); }
.spot-cv { width: 130%; max-width: none; height: auto; margin: 0 0 -14px -15%; pointer-events: none; }
.spot-tag { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); max-width: calc(100% + 6px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 1px 9px 2px; border-radius: 6px; background: var(--card); box-shadow: 0 3px 6px -4px rgba(90, 60, 40, .5);
  font-family: var(--hand); font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.spot.is-empty .spot-tag { background: rgba(255, 252, 246, .85); color: var(--coral-deep); box-shadow: inset 0 0 0 1.5px #EDB4A2; font-weight: 700; }
.spot.is-grow .spot-tag { background: #FFF0E9; color: #B4553C; box-shadow: inset 0 0 0 1.5px #F0B9A5; font-weight: 700; }
.spot.is-grow .spot-tag::after { content: " ›"; }
.spot.is-empty .spot-cv { opacity: .9; }
.spot.is-new::before { content: ""; position: absolute; left: -12%; right: -12%; top: 4%; bottom: 18%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 236, 170, .95), rgba(255, 236, 170, 0)); animation: glow 2.6s ease-out forwards; }
@keyframes glow { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1.15); } }

.ground { position: relative; flex: none; height: var(--ground-h, 104px);
  background: radial-gradient(90% 85% at 50% 108%, #CADBB3 0 70%, rgba(202, 219, 179, 0) 100%); }
.corgi { position: absolute; right: 6px; bottom: 2px; width: min(122px, 31%); }
.corgi img { width: 100%; height: auto; }
.corgi.is-hop { animation: hop .45s ease-out 2; }
@keyframes hop { 40% { transform: translateY(-12px) rotate(-3deg); } }
.bubble { position: absolute; right: calc(min(122px, 31%) + 2px); bottom: 42%; max-width: 64%; padding: 8px 14px 9px; border-radius: 18px 18px 4px 18px;
  background: var(--card); box-shadow: 0 10px 20px -14px rgba(79, 53, 41, .7), inset 0 0 0 1.5px var(--line);
  font-family: var(--hand); font-size: 15px; line-height: 1.5; color: var(--ink); text-wrap: balance; }
.bubble.is-in { animation: pop .3s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.9); } }
.garden-foot { flex: none; padding: 12px 16px 8px; text-align: center; }
.garden-tip { margin-top: 6px; font-family: var(--hand); font-size: 13.5px; color: var(--ink-2); }

/* ---------- 分頁列 ---------- */
.tabbar { flex: none; display: flex; padding: 4px 6px calc(4px + var(--safe-b)); background: #FFFCF6; box-shadow: 0 -1px 0 var(--line); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0 3px; color: #B3A08C;
  font-family: var(--hand); font-size: 12.5px; letter-spacing: .04em; }
.tabbar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar .is-on { color: var(--coral-deep); font-weight: 700; }
.tabbar .is-on svg { stroke-width: 1.9; }

/* ---------- 種花台 ---------- */
.planting { z-index: 50; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 6px) 14px calc(var(--safe-b) + 14px); }
.pl-play { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pl-top { display: flex; align-items: center; gap: 8px; }
.back { flex: none; padding: 8px 10px 8px 2px; font-family: var(--hand); font-size: 16px; color: var(--ink-2); }
.pl-steps { flex: 1; display: flex; justify-content: space-between; gap: 2px; list-style: none; }
.pl-steps li { font-family: var(--hand); font-size: 13.5px; color: #CDBFAE; transition: color .3s; }
.pl-steps li.is-done { color: var(--ink-2); }
.pl-steps li.is-now { color: var(--coral); font-weight: 700; }
.pl-bar { height: 7px; margin: 4px 0 10px; border-radius: 99px; background: #EFE4D3; overflow: hidden; }
.pl-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #B9CDA5, var(--coral)); transition: width .2s linear; }
.pl-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.pl-stage-box { position: relative; }
.pl-canvas { width: 100%; height: 100%; border-radius: 24px; touch-action: manipulation; cursor: pointer; user-select: none; -webkit-user-select: none;
  box-shadow: inset 0 0 0 1.5px rgba(139, 74, 46, .12), 0 16px 30px -26px rgba(90, 61, 46, .6); }
.pl-corgi { position: absolute; right: 3%; bottom: 2%; width: 21%; height: auto; pointer-events: none; }
.pl-corgi.is-happy { animation: hop .5s ease-out 3; }
.pl-say { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 10px; padding: 4px 14px 4px 4px; border-radius: 99px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line); font-family: var(--hand); font-size: 17px; line-height: 1.4; transition: background .2s, box-shadow .2s; }
.pl-say.is-ask { background: #FFF0E9; box-shadow: inset 0 0 0 1.5px #F0B9A5; color: #B4553C; font-weight: 700; }
.pl-say img { flex: none; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: 50% 35%; background: #FFF3D6; }
.pl-act { margin-top: 12px; text-align: center; }

/* 開花以後：你種出了 → 變成這一盆 */
.pl-reveal { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -14px; padding: 10px 18px 0; }
.rv { text-align: center; }
.rv-flower { margin-top: 10px; font-family: var(--hand); font-weight: 700; font-size: 26px; line-height: 1.35; }
.rv-turn { margin-top: 14px; font-family: var(--hand); font-size: 16px; color: var(--ink-2); }
.rv-card { position: relative; width: min(270px, 78%); margin: 8px auto 0; padding: 14px 12px 10px; border-radius: 22px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--tape), 0 18px 30px -24px rgba(79, 53, 41, .8); animation: card-in .8s cubic-bezier(.2, .8, .3, 1.15); }
@keyframes card-in { from { opacity: 0; transform: rotateY(80deg) scale(.85); } }
.rv-sticker { width: 80%; margin: 0 auto; }
.pot-name { margin-top: 4px; font-family: var(--hand); font-weight: 700; font-size: 24px; line-height: 1.35; }
.pot-name em { font-style: normal; font-weight: 400; font-size: 16px; color: var(--ink-2); }
.badge { position: absolute; top: -11px; right: -8px; padding: 3px 12px; border-radius: 99px; background: var(--coral); color: #fff; transform: rotate(6deg);
  font-family: var(--hand); font-weight: 700; font-size: 14px; box-shadow: 0 6px 12px -8px rgba(200, 90, 60, .9); }
.badge-again { background: #B9A897; box-shadow: none; }
.work { display: flex; align-items: center; gap: 12px; max-width: 430px; margin: 18px auto 0; padding: 12px; border-radius: 20px; background: var(--soft); text-align: left; }
.work-photo { flex: none; width: 36%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: var(--card); }
.work-text p { font-size: 14px; line-height: 1.65; }
.work .btn-line { margin-top: 10px; min-height: 44px; padding: 0 14px; gap: 7px; font-size: 15px; letter-spacing: .02em; white-space: nowrap; }
.rv-actions { position: sticky; bottom: 0; margin-top: 8px; padding: 18px 0 2px; background: linear-gradient(rgba(246, 238, 224, 0), var(--paper) 40%); }

/* ---------- 圖鑑 ---------- */
.book { padding: calc(var(--safe-t) + 16px) 14px 28px; }
.book-sum { margin-top: 4px; font-family: var(--hand); font-size: 16px; color: var(--ink-2); }
.book-sum b { color: var(--coral-deep); font-size: 20px; }
.book-bar { width: min(240px, 70%); height: 7px; margin: 8px auto 0; border-radius: 99px; background: #EFE4D3; overflow: hidden; }
.book-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #B9CDA5, var(--coral)); }
.book-group h2 { display: flex; align-items: center; gap: 10px; margin: 24px 2px 10px; }
.book-group h2 .tape { font-size: 18px; }
.book-group h2 small { font-family: var(--hand); font-size: 15px; font-weight: 400; color: var(--ink-2); }
.book-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.book-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 6px 7px; border-radius: 18px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .15s; }
.book-item:active { transform: scale(.96); }
.book-item img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.book-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--hand); font-size: 14px; }
.book-item:not(.is-got) { background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--tape); }
.book-item:not(.is-got) img { filter: grayscale(1) blur(3px); opacity: .32; }   /* 還沒收集：只看得到模模糊糊的灰色影子 */
.book-item:not(.is-got) span { color: var(--ink-2); letter-spacing: .1em; }
.book-tip { margin-top: 22px; text-align: center; font-family: var(--hand); font-size: 14px; color: var(--ink-2); }

/* ---------- 像花美好 ---------- */
.shop { padding: calc(var(--safe-t) + 16px) 18px 28px; text-align: center; }
.shop-logo { width: 150px; height: auto; margin: 12px auto 0; border-radius: 24px; }
.shop-text { margin-top: 12px; font-size: 15px; line-height: 1.85; }
.shop-btns { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 18px; }
.shop-btns .btn { min-width: 250px; }
.shop-list { margin-top: 24px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); overflow: hidden; text-align: left; }
.row { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 18px; border-top: 1px solid var(--line);
  font-family: var(--hand); font-size: 16px; }
.row:first-child { border-top: 0; }
.row i { font-style: normal; font-size: 20px; color: #C4B2A0; }
.row-quiet { color: var(--ink-2); font-size: 14.5px; }
.shop-small { margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }

/* ---------- 下面滑上來的卡片 ---------- */
.sheet { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-end; justify-content: center; background: rgba(79, 53, 41, .45); }
.sheet-box { position: relative; width: 100%; max-width: 480px; max-height: 90%; overflow-y: auto; overscroll-behavior: contain;
  padding: 24px 18px calc(22px + var(--safe-b)); border-radius: 26px 26px 0 0; background: var(--paper);
  transform: translateY(40px); opacity: 0; transition: transform .28s cubic-bezier(.2, .8, .3, 1), opacity .2s; }
.sheet.is-open .sheet-box { transform: none; opacity: 1; }
.sheet-x { position: absolute; top: 8px; right: 8px; width: 42px; height: 42px; font-size: 26px; line-height: 1; color: var(--ink-2); }
.sheet-title { text-align: center; }
.sheet-sub { margin-top: 6px; text-align: center; font-family: var(--hand); font-size: 15px; color: var(--ink-2); }
.sheet-btns { margin-top: 16px; text-align: center; }

/* 種子包（跟網站種花頁同一個樣子） */
.packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 24px 8px 12px; border-radius: 10px 10px 16px 16px;
  background: var(--tape); box-shadow: 0 14px 24px -18px rgba(90, 61, 46, .7); transition: transform .15s; }
.pack:active { transform: scale(.96); }
.pack-top { position: absolute; left: 0; right: 0; top: 0; height: 14px; border-radius: 10px 10px 0 0; background: rgba(255, 255, 255, .45);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 95% 100%, 90% 60%, 85% 100%, 80% 60%, 75% 100%, 70% 60%, 65% 100%, 60% 60%, 55% 100%, 50% 60%, 45% 100%, 40% 60%, 35% 100%, 30% 60%, 25% 100%, 20% 60%, 15% 100%, 10% 60%, 5% 100%, 0 60%); }
.pack-art { width: 72px; height: 72px; border-radius: 50%; background: #FFFCF6; }
.pack-name { margin-top: 4px; font-family: var(--hand); font-weight: 700; font-size: 18px; }
.pack-got { font-size: 12.5px; opacity: .75; }

/* 看一盆 */
.pot-pair { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin-top: 12px; }
.pot-pair figure { width: 44%; max-width: 160px; text-align: center; }
.pot-pair img, .pot-pair canvas { width: 100%; max-width: 130px; height: auto; margin: 0 auto; }
.pot-pair figcaption { margin-top: 4px; font-family: var(--hand); font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.pot-sheet .work { margin-top: 14px; }
.pot-more { display: flex; justify-content: center; gap: 26px; margin-top: 12px; }

/* 放到手機桌面 */
.install-body { margin-top: 14px; font-size: 15px; line-height: 1.8; }
.how { margin: 4px 0 0 1.5em; }
.how li { padding: 2px 0; }
.ico { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; fill: none; stroke: #3B7BD4; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.url-box { margin-top: 10px; padding: 10px; border-radius: 12px; background: var(--card); text-align: center; font-weight: 700; word-break: break-all; }
.install-icon { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 18px; font-size: 12px; color: var(--ink-2); }
.install-icon img { border-radius: 15px; box-shadow: 0 8px 16px -10px rgba(79, 53, 41, .6); }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 150px); z-index: 90; transform: translateX(-50%); max-width: 86%; padding: 10px 18px; border-radius: 99px;
  background: rgba(74, 53, 38, .92); color: #fff; font-size: 14px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
