/* ===== 字體：粉圓子集（SIL OFL，見 fonts/NOTICE.txt），缺的字退回系統字體 ===== */
@font-face { font-family: 'MF-Fallback'; src: url(../fonts/mf-fallback-subset.woff2) format('woff2'); font-display: swap; }
:root {
  --f-body: 'MF-Fallback', -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}
:root {
  --bg: #e5e5e6; --card: #ffffff; --ink: #1c1c1e; --muted: #66666a; --line: #d3d2c3;
  --brown: #1c1c1e; --accent: #eee467; --accent-ink: #1c1c1e; --soft: #d3d2c3; --ok: #1c1c1e;
  --shadow: 0 2px 10px rgba(28, 28, 30, .14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1c1e; --card: #2a2a2c; --ink: #e5e5e6; --muted: #a8a8a4; --line: #46463f;
    --brown: #e5e5e6; --accent: #eee467; --accent-ink: #1c1c1e; --soft: #3a3a36; --shadow: 0 2px 10px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--f-body);
  line-height: 1.6; -webkit-tap-highlight-color: transparent;
}
#app { max-width: 640px; margin: 0 auto; padding: 14px 16px 96px; min-height: 100vh; }
h1 { font-size: 1.45rem; margin: .2em 0 .3em; }
h2 { font-size: 1.1rem; margin: 1.1em 0 .4em; }
p { margin: .3em 0 .6em; }
.muted { color: var(--muted); font-size: .88rem; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.topbar .title { font-weight: 700; font-size: 1.1rem; color: var(--brown); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--soft); border-radius: 999px; padding: 3px 11px; font-size: .85rem; white-space: nowrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); margin: 10px 0; }
.btn {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 14px;
  padding: 10px 16px; font-weight: 600; min-height: 44px; box-shadow: var(--shadow);
}
.btn.ghost { background: var(--soft); color: var(--ink); box-shadow: none; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.grow > * { flex: 1; }
input[type=text], select {
  font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: 9px 12px; min-height: 44px; width: 100%;
}
.row select { width: auto; flex: 1; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; margin: .5em 0; }
label.check input { margin-top: 4px; width: 18px; height: 18px; }

/* 庭院 */
.yard {
  position: relative; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(#cdeeff 0 36%, #a8dc8c 36% 100%); border: 3px solid #fff;
  user-select: none; -webkit-user-select: none;
}

.yard .sun { position: absolute; right: 8%; top: 6%; font-size: 1.8rem; }
.yard .cloudy { position: absolute; left: 10%; top: 8%; font-size: 1.6rem; animation: drift 14s ease-in-out infinite alternate; }
.me { position: absolute; left: 50%; bottom: 4%; width: calc(46% * var(--s, 1)); aspect-ratio: 1; transform: translateX(-50%); z-index: 50; transition: width .4s; }
.me .mon, .nb .mon { width: 100%; height: 100%; }
.mon { position: relative; display: block; }
.mon img, .mon svg { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.me { animation: stroll var(--walk, 14s) ease-in-out infinite alternate; }
.me .mon { animation: step var(--stepd, 0.55s) ease-in-out infinite; transform-origin: 50% 100%; }
.me.flip .mon > img, .me.flip .mon > svg, .me.flip .mon > .bdbody, .nb.flip .mon > img, .nb.flip .mon > svg, .nb.flip .mon > .bdbody { transform: scaleX(-1); }
.me .mon[data-pose="play"] { animation: hop .6s ease-in-out infinite; }
.me:has(.mon[data-pose="sleep"]), .me:has(.mon[data-pose="eat"]) { animation-play-state: paused; }
.me .mon[data-pose="eat"] { animation: chomp .5s ease-in-out infinite; }
.me .mon[data-pose="sleep"] { animation: breathe 3s ease-in-out infinite; filter: brightness(.92); }
.me .mon[data-pose="happy"] { animation: hop .45s ease-in-out infinite; }
.petbuddy { position: absolute; left: -34%; bottom: 0; width: 46%; aspect-ratio: 1; z-index: 49; padding: 0; border: 0; background: transparent; filter: drop-shadow(0 3px 3px rgba(28,28,30,.18)); animation: petfloat 2.5s ease-in-out infinite; }
.petbuddy img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.petbuddy:active, .petbuddy.act-play { animation: hop .35s ease-in-out 2; }
.petbuddy.act-eat { animation: chomp .35s ease-in-out 2; }
.petbuddy.act-sleep { animation: breathe 2.4s ease-in-out 1; filter: brightness(.9); }
@keyframes petfloat { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-4%) } }
.petbar { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 10px; }
.petbar-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.petbar-main img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.petbar-main span { min-width: 0; }
.petbar-main b, .petbar-main small { display: block; line-height: 1.3; }
.petbar-main small { color: var(--muted); font-size: .76rem; }
.petgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 8px; margin: 12px 0 18px; }
.petoption { min-height: 116px; padding: 6px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); text-align: center; }
.petoption.selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--accent); }
.petoption img { display: block; width: 66px; height: 66px; object-fit: contain; margin: 0 auto; }
.petoption span, .petoption small { display: block; line-height: 1.25; }
.petoption span { font-size: .78rem; }
.petoption small { font-size: .7rem; color: var(--muted); }
.nb { position: absolute; width: 17%; aspect-ratio: 1; transform: translate(-50%, -100%); animation: wander var(--d, 7s) ease-in-out infinite alternate; z-index: 20; }
.nb .mon { animation: step 0.7s ease-in-out infinite; transform-origin: 50% 100%; }
.nb .nm { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); font-size: .62rem; white-space: nowrap; background: rgba(255,255,255,.8); color: #1c1c1e; border-radius: 8px; padding: 0 5px; }
.bubble { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); background: #fff; color: #1c1c1e; border-radius: 14px; padding: 6px 12px;
  font-size: .85rem; white-space: nowrap; box-shadow: var(--shadow); opacity: 0; transition: opacity .25s; pointer-events: none; max-width: 90vw; }
.bubble.on { opacity: 1; }
.bubble::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: #fff; }
.fx { position: absolute; inset: -20% 0 auto 0; text-align: center; font-size: 1.6rem; pointer-events: none; }
.fx span { display: inline-block; animation: float 1.8s ease-out forwards; }
.decor { position: absolute; transform: translate(-50%, -100%); font-size: clamp(1.4rem, 7vw, 2.2rem); cursor: grab; touch-action: none; line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.18)); }
.decor:active { cursor: grabbing; }
.decor .x { position: absolute; right: -10px; top: -10px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #e8453c; color: #fff; font-size: .8rem; line-height: 1; padding: 0; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.actions .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; }
.actions .btn span { font-size: 1.4rem; }
.bag { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.bag button { flex: 0 0 auto; background: var(--card); border: 2px solid var(--line); border-radius: 14px; min-width: 62px; min-height: 62px; font-size: 1.5rem; position: relative; }
.bag button small { position: absolute; right: 4px; bottom: 2px; font-size: .7rem; color: var(--muted); }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; font-size: .85rem; }
.tile .big { font-size: 1.8rem; }
.cand { display: flex; gap: 12px; align-items: center; cursor: pointer; border: 3px solid transparent; text-align: left; width: 100%; background: var(--card); }
.cand.sel { border-color: var(--accent); }
.cand .slot { flex: 0 0 96px; height: 96px; }
.cand .slot .mon { width: 96px; height: 96px; }
.cand b { font-size: 1.05rem; }
.diary li { margin: 4px 0; font-size: .9rem; }
.diary { padding-left: 1.1em; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; z-index: 100;
  padding-bottom: env(safe-area-inset-bottom); }
.tabs .in { display: flex; width: 100%; max-width: 560px; }
.tabs button { flex: 1; background: none; border: 0; padding: 8px 2px 9px; font-size: .78rem; color: var(--muted); min-height: 56px; }
.tabs button span { display: block; font-size: 1.3rem; line-height: 1.1; }
.tabs button[aria-current="page"] { color: var(--accent); font-weight: 700; }

.overlay { position: fixed; inset: 0; background: rgba(28, 28, 30, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 200; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto; animation: rise .25s ease-out; }
.sheet h2 { margin-top: 0; }
.sheet .pair { display: flex; align-items: center; justify-content: center; gap: 6px; }
.sheet .pair .mon { width: 90px; height: 90px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #1c1c1e; color: #fff; padding: 9px 16px; border-radius: 14px; z-index: 300; font-size: .9rem; box-shadow: var(--shadow); max-width: 90vw; text-align: center; animation: rise .25s ease-out; }
.banner { background: #eee467; color: #1c1c1e; border-radius: 16px; padding: 10px 14px; margin: 8px 0; font-weight: 600; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti span { position: absolute; top: -10%; font-size: 1.4rem; animation: fall linear forwards; }
.egg { text-align: center; font-size: 6rem; margin: 22vh 0 1rem; animation: wobble .8s ease-in-out infinite; }
.egg + p { text-align: center; }
.help { background: var(--soft); border-radius: 12px; padding: 8px 12px; font-size: .86rem; color: var(--muted); }
ul.plain { padding-left: 1.2em; margin: .3em 0; }

@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-3%) } }
@keyframes hop { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-14%) } }
@keyframes chomp { 0%,100% { transform: scale(1) } 50% { transform: scale(1.05, .95) } }
@keyframes breathe { 0%,100% { transform: scale(1) } 50% { transform: scale(1.03, .97) } }
@keyframes wander { from { margin-left: -6% } to { margin-left: 6% } }
@keyframes stroll { from { margin-left: calc(-1 * var(--range, 22%)) } to { margin-left: var(--range, 22%) } }
/* 小步伐：左右微晃＋輕微起伏，像在走路 */
@keyframes step { 0%, 100% { transform: translateY(0) rotate(-2.5deg) } 50% { transform: translateY(-2.5%) rotate(2.5deg) } }
@keyframes drift { from { transform: translateX(0) } to { transform: translateX(40px) } }
@keyframes float { from { opacity: 1; transform: translateY(20px) scale(.8) } to { opacity: 0; transform: translateY(-34px) scale(1.2) } }
@keyframes rise { from { transform: translateY(24px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes wobble { 0%,100% { transform: rotate(-6deg) } 50% { transform: rotate(6deg) } }
@keyframes fall { to { transform: translateY(115vh) rotate(360deg); opacity: .9 } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* 無 emoji 版：以文字標籤、圓點與 CSS 形狀取代圖示 */
.dtag { display: inline-block; background: hsl(var(--h) 75% 88%); color: hsl(var(--h) 45% 22%); border: 2px solid hsl(var(--h) 55% 62%);
  border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; line-height: 1.5; }
.bag button { min-width: 0; min-height: 52px; padding: 6px 10px 14px; font-size: .9rem; }
.decor { font-size: .8rem; }
.actions .btn { padding: 14px 6px; font-size: 1.05rem; }
.tabs button { padding-top: 14px; font-size: .9rem; min-height: 52px; }
.tile { padding: 14px 8px; }
.sep { font-size: 1.5rem; font-weight: 700; color: var(--muted); padding: 0 4px; }
.yard .sun { width: 34px; height: 34px; border-radius: 50%; background: #ffd75e; box-shadow: 0 0 0 6px rgba(255, 215, 94, .35); font-size: 0; }
.yard .cloudy { width: 54px; height: 20px; border-radius: 99px; background: #fff; box-shadow: 14px -8px 0 2px #fff, 30px 0 0 -2px #fff; font-size: 0; }
.egg { margin-top: 20vh; animation: wobble .8s ease-in-out infinite; font-size: 0; }
.egg-shape { width: 110px; height: 140px; margin: 0 auto; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%; background: radial-gradient(circle at 35% 30%, #fffaf0, #f3d9b8); border: 4px solid #e2bf92; }
.fx .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin: 0 4px; background: hsl(var(--h) 85% 68%); animation: floatx 1.8s ease-out forwards; }
.confetti span { width: 12px; height: 12px; border-radius: 3px; background: hsl(var(--h) 85% 62%); font-size: 0; }
@keyframes floatx { from { opacity: 1; transform: translate(0, 20px) scale(.8) } to { opacity: 0; transform: translate(var(--x, 0), -40px) scale(1.2) } }

a { color: var(--accent); font-weight: 600; }

h3.sub { font-size: .9rem; color: var(--muted); font-weight: 600; margin: 1.1em 0 .3em; }
.attrs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 6px 0 2px; text-align: center; font-size: .72rem; color: var(--muted); }
.attrs b { display: block; font-size: 1.05rem; color: var(--ink); }

h4.mini { font-size: .85rem; color: var(--accent); margin: .9em 0 .15em; font-weight: 700; }
p.para { margin: 0; line-height: 1.75; }

/* 場景圖（16:9）：草地在畫面下半部 */
.yard.scene { aspect-ratio: 16 / 9; background-size: cover; background-position: center bottom; border: 3px solid #fff; }
.yard.scene::before { display: none; }
.yard.scene .me { width: calc(25% * var(--s, 1)); bottom: 6%; }
.yard.scene .nb { width: 11%; }
.yard.scene .nb .nm { bottom: -12px; font-size: .58rem; }
.yard.scene .decor { font-size: .72rem; }
.tabs .in { max-width: 640px; }
.sheet, .overlay .sheet { max-width: 640px; }

.nb .nm { display: none; }

/* ===== 配色：#e5e5e6、#d3d2c3、黑白灰、#eee467（黃色只當底色，不當文字色） ===== */
.btn { border: 1.5px solid var(--ink); box-shadow: none; }
.btn.ghost { background: var(--soft); border-color: transparent; }
.btn:disabled { border-color: transparent; }
.card, .sheet, .tile, .bag button { border-color: var(--line); }
.cand.sel { border-color: var(--ink); box-shadow: 0 0 0 4px var(--accent); }
.chip { background: var(--soft); color: var(--ink); }
.tabs button[aria-current="page"] { color: var(--ink); font-weight: 700; box-shadow: inset 0 3px 0 var(--accent); }
h4.mini { color: var(--ink); border-left: 4px solid var(--accent); padding-left: 8px; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: 2px; font-weight: 600; }
.banner { background: var(--accent); color: #1c1c1e; }
.toast { background: #1c1c1e; color: #e5e5e6; }
.bar { background: var(--line); }
.bar > i { background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--ink); }
.help { background: var(--soft); }
.dtag { background: #fff; color: #1c1c1e; border: 2px solid #1c1c1e; }
.dtag.t0 { background: #eee467; } .dtag.t1 { background: #d3d2c3; } .dtag.t2 { background: #e5e5e6; }
.egg-shape { background: radial-gradient(circle at 35% 30%, #ffffff, #d3d2c3); border-color: #1c1c1e; }
.fx .dot { background: #eee467; border: 1.5px solid #1c1c1e; }
.fx .dot:nth-child(3n+2) { background: #ffffff; } .fx .dot:nth-child(3n) { background: #d3d2c3; }
.confetti span { background: #eee467; border: 1.5px solid #1c1c1e; }
.confetti span:nth-child(4n+2) { background: #ffffff; } .confetti span:nth-child(4n+3) { background: #d3d2c3; } .confetti span:nth-child(4n) { background: #1c1c1e; border-color: #fff; }
.bubble { background: #fff; color: #1c1c1e; border: 1.5px solid #1c1c1e; }
.bubble::after { border-top-color: #1c1c1e; }
input[type=text]:focus, select:focus { border-color: var(--ink); }

/* 排版微調 */
button, input, select { font-family: inherit; }
h1 { font-size: 1.6rem; line-height: 1.3; margin: .3em 0 .4em; }
h2 { font-size: 1.2rem; line-height: 1.35; }
.topbar .title { font-size: 1.3rem; font-weight: 700; }
.btn { font-size: 1rem; font-weight: 700; letter-spacing: .02em; }
.tabs button { font-size: .95rem; font-weight: 600; }
.attrs b { font-size: 1.25rem; font-weight: 700; }
p.para { line-height: 1.85; letter-spacing: .02em; }

.row.grow > .btn { white-space: nowrap; }
.card .muted { line-height: 1.55; }

input[type=checkbox] { accent-color: #eee467; }
.row { row-gap: 8px; }

/* 簡約場景：符合配色的灰黃色，不使用圖片 */
.yard.scene.plain { background-image: none;
  background: radial-gradient(ellipse 60% 55% at 50% 118%, #d3d2c3 0 99%, transparent 100%),
              radial-gradient(ellipse 38% 40% at 12% 106%, #c9c8b9 0 99%, transparent 100%),
              radial-gradient(ellipse 36% 38% at 90% 108%, #c9c8b9 0 99%, transparent 100%),
              linear-gradient(#e5e5e6 0 62%, #d3d2c3 62% 100%); }
.yard.scene.plain::after { content: ""; position: absolute; right: 11%; top: 13%; width: 8%; aspect-ratio: 1; border-radius: 50%; background: #eee467; box-shadow: 0 0 0 6px rgba(238, 228, 103, .35); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .yard.scene.plain { background: radial-gradient(ellipse 60% 55% at 50% 118%, #4a4a45 0 99%, transparent 100%),
              radial-gradient(ellipse 38% 40% at 12% 106%, #42423d 0 99%, transparent 100%),
              radial-gradient(ellipse 36% 38% at 90% 108%, #42423d 0 99%, transparent 100%),
              linear-gradient(#2c2c2e 0 62%, #3a3a36 62% 100%); }
}
.nb { cursor: pointer; }
textarea { font: inherit; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px; width: 100%; min-height: 76px; resize: vertical; }
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--ink); }
.field { padding: 12px 14px; }
.field .lab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 700; }
.field .pub { font-weight: 400; font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.field .pub input { width: 18px; height: 18px; }
.idcard { display: flex; gap: 14px; align-items: center; }
.idcard .slot { flex: 0 0 96px; height: 96px; }
.idcard .slot .mon { width: 96px; height: 96px; }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.kv { display: grid; grid-template-columns: minmax(6.5em, auto) 1fr; gap: 4px 10px; font-size: .95rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.tabs button { font-size: .9rem; }

.scenegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.scenebtn { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 5px; text-align: center; font-size: .82rem; display: flex; flex-direction: column; gap: 4px; }
.scenebtn.sel { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent); }
.scenebtn .thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; object-fit: cover; display: block; }
.plainthumb { background: linear-gradient(#e5e5e6 0 62%, #d3d2c3 62% 100%); border: 1px solid var(--line); }
.autothumb { display: flex; align-items: center; justify-content: center; background: #eee467; color: #1c1c1e; font-weight: 700; }

/* 段落留白 */
p.para { margin: 0 0 1.4em; line-height: 1.9; }
h4.mini { margin: 1.6em 0 .5em; }
h4.mini:first-of-type { margin-top: .9em; }
.sheet ul.plain li, .card ul.plain li { margin: .45em 0; line-height: 1.75; }
h3.sub { margin: 1.6em 0 .5em; }

/* 每日資訊與日記 */
.daily { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.daily .chip { font-size: .85rem; }
.daily .chip.up { background: var(--accent); color: #1c1c1e; }
.camwrap canvas { width: 100%; height: auto; border-radius: 14px; border: 2px solid var(--line); display: block; background: var(--soft); }
.camwrap .row { margin: 8px 0; }
.entry { padding: 14px; }
.entry .when { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.entry img.shot { width: 100%; border-radius: 12px; margin: 8px 0; display: block; border: 2px solid var(--line); }
.entry p.txt { margin: .5em 0 .8em; line-height: 1.8; white-space: pre-wrap; }
.seg { display: flex; gap: 6px; margin: 6px 0 10px; }
.seg button { flex: 1; background: var(--soft); border: 2px solid transparent; border-radius: 12px; padding: 8px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--ink); color: #1c1c1e; }
.kai { font-family: "Kaiti TC", "BiauKai", "DFKai-SB", "標楷體", "STKaiti", serif; }

/* 庭院看板 */
.prop { position: absolute; transform: translate(-50%, -100%); padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; filter: drop-shadow(0 3px 2px rgba(0,0,0,.2)); }
.prop img { width: 100%; height: auto; display: block; pointer-events: none; }
.prop:hover, .prop:focus-visible { transform: translate(-50%, -100%) scale(1.05); }
.prop:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ptext { position: absolute; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #1c1c1e; white-space: nowrap; line-height: 1; visibility: hidden; overflow: hidden; }

.prop[data-k="camera"] { cursor: pointer; }

/* 銀白小相機與閃光 */
.cambtn { position: absolute; transform: translate(-50%, -100%); padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; z-index: 60; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .28)); transition: transform .12s; }
.cambtn svg { width: 100%; height: auto; display: block; pointer-events: none; }
.cambtn:hover { transform: translate(-50%, -100%) scale(1.08); }
.cambtn:active { transform: translate(-50%, -100%) scale(.93); }
.cambtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 12px; }
.cambtn.flash .fw { animation: fwglow 1s ease-out; }
@keyframes fwglow { 0% { fill: #fff; filter: none; } 20% { fill: #fff; filter: drop-shadow(0 0 5px #fff) drop-shadow(0 0 12px #fffbd0); } 100% { filter: none; } }
.flashfx { position: absolute; inset: 0; z-index: 300; pointer-events: none; opacity: 0; animation: flashfx 1s ease-out forwards;
  background: radial-gradient(circle at var(--fx, 90%) var(--fy, 90%), rgba(255, 255, 255, 1) 0, rgba(255, 255, 255, .92) 30%, rgba(255, 255, 255, .55) 100%); }
@keyframes flashfx { 0% { opacity: 0; } 18% { opacity: 1; } 45% { opacity: .85; } 100% { opacity: 0; } }

/* 點心圖 */
.tile .foodimg { width: 72px; height: 72px; object-fit: contain; display: block; margin: 0 auto 6px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.foodtiny { width: 22px; height: 22px; object-fit: contain; vertical-align: -6px; margin-left: 2px; }
.fx .foodpop { position: absolute; left: 50%; top: 0; width: 64px; height: 64px; margin-left: -32px; object-fit: contain; opacity: 0; animation: foodup 1.9s ease-out forwards; }
@keyframes foodup { 0% { opacity: 0; transform: translateY(26px) scale(.6); } 22% { opacity: 1; transform: translateY(0) scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-34px) scale(1); } }
.fx { position: absolute; left: 0; right: 0; }

/* 生日怪獸圖：圖片加下方名牌 */
.mon.bdmon { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.mon.bdmon .bdbody { position: relative; height: 86%; max-width: 100%; aspect-ratio: var(--ar, 295 / 320); flex: 0 0 auto; }
.mon.bdmon .bdbody .body { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(0,0,0,.22)); }
.mon .gear { position: absolute; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.mon.bdmon .bdname { display: inline-block; margin-top: -4%; padding: 1px 9px; border-radius: 999px; background: #fff; color: #1c1c1e; border: 1.5px solid #1c1c1e; font-weight: 700; font-size: .78rem; line-height: 1.45; white-space: nowrap; max-width: none; overflow: visible; }
.mon.bdmon { overflow: visible; }
.nb .mon.bdmon .bdname { font-size: .6rem; padding: 0 6px; }
.me .mon.bdmon[data-pose="sleep"] .body { filter: brightness(.9) drop-shadow(0 4px 3px rgba(0,0,0,.22)); }
.yard.scene .me { width: calc(30% * var(--s, 1)); }

.egg.leap { animation: wobble 1.1s ease-in-out infinite; }
.egg.leap svg { width: 180px; height: 180px; margin: 0 auto; display: block; filter: drop-shadow(0 0 18px rgba(255, 210, 122, .7)); animation: eggglow 1.6s ease-in-out infinite alternate; }
@keyframes eggglow { from { filter: drop-shadow(0 0 6px rgba(255, 210, 122, .3)); } to { filter: drop-shadow(0 0 26px rgba(255, 210, 122, .9)); } }

/* 怪獸圖鑑 */
.dexmonth { padding: 0; overflow: hidden; }
.dexhead { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px; background: none; border: 0; text-align: left; font-size: 1.05rem; }
.dexhead .chev { font-size: .85rem; color: var(--muted); }
.dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 0 12px 12px; }
.dexcell { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .78rem; }
.dexcell .dexday { align-self: flex-start; font-weight: 700; color: var(--muted); font-size: .8rem; }
.dexcell .dexday i { font-style: normal; margin-left: 4px; background: var(--accent); color: #1c1c1e; border-radius: 99px; padding: 0 6px; font-size: .7rem; }
.dexcell .dexart, .dexcell .dexart .mon { width: 72px; height: 72px; }
.dexcell .dexname { text-align: center; line-height: 1.3; min-height: 2.6em; }
.dexcell .rar { position: absolute; right: 6px; top: 6px; font-size: .68rem; font-weight: 800; border-radius: 6px; padding: 0 5px; border: 1.5px solid #1c1c1e; }
.r-R { background: #e5e5e6; color: #1c1c1e; } .r-SR { background: #b6c6d7; color: #1c1c1e; } .r-SSR { background: linear-gradient(135deg, #b39465 0%, #876f4d 45%, #c4a873 70%, #876f4d 100%); color: #ffffff; text-shadow: 0 1px 1px rgba(0,0,0,.35); } .r-UR { background: #1c1c1e; color: #eee467; }
.dexcell.r-SR { border-color: #8fa3b8; } .dexcell.r-SSR { border-color: #876f4d; box-shadow: 0 0 0 2px #c4a873 inset; } .dexcell.r-UR { border-color: #1c1c1e; box-shadow: 0 0 0 3px #eee467; }
.chip.r-UR { background: #1c1c1e; color: #eee467; }

.dexcell .mon.bdmon .bdname, .pair .mon.bdmon .bdname { display: none; }
.pair .slot, .pair .mon { overflow: visible; }
.pair .mon.bdmon .bdname { display: inline-block; font-size: .72rem; }
.dexcell .mon.bdmon .bdname { display: none; }
.dexcell .mon.bdmon .bdbody { height: 100%; }

/* 搭檔報告：淺灰底 */
.sheet-duo { background: #dfe0e1; color: #1c1c1e; }
.sheet-duo .chip { background: #ffffff; }
.sheet-duo .help { background: #eef0f1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sheet-duo { background: #dfe0e1; color: #1c1c1e; } :root:not([data-theme="light"]) .sheet-duo .muted { color: #5e5e62; } :root:not([data-theme="light"]) .sheet-duo h3.sub { color: #5e5e62; } :root:not([data-theme="light"]) .sheet-duo svg text { fill: #1c1c1e !important; } }

.sheet-duo select, .sheet-duo .btn.ghost { background: #ffffff; color: #1c1c1e; border-color: #c4c5c7; }
.sheet-duo .btn { color: #1c1c1e; }
.sheet-duo .pair .chip, .sheet-duo .row .chip { color: #1c1c1e; }
.sheet-duo .chip[style*="eee467"] { background: #eee467 !important; }
.sheet-duo .chip[style*="d3d2c3"] { background: #ffffff !important; border: 1.5px dashed #1c1c1e; }

.duopick label { display: flex; flex-direction: column; gap: 6px; }
.duopick label .muted { padding-left: 4px; }
.nb { animation-direction: var(--dir, alternate); }
.me.pause, .me.pause .mon { animation-play-state: paused; }
.nb:nth-child(odd) .mon { animation-duration: .8s; }

.pactlist { display: flex; flex-direction: column; gap: 6px; }
.pact { text-align: left; background: #fff; border: 2px solid #c4c5c7; border-radius: 12px; padding: 10px 12px; font-size: .92rem; line-height: 1.5; color: #1c1c1e; }
.pact.on { background: #eee467; border-color: #1c1c1e; font-weight: 700; }

/* 搭檔報告內的卡片一律白底黑字（不受深色模式影響） */
.sheet-duo .card { background: #ffffff; color: #1c1c1e; border-color: #c4c5c7; box-shadow: none; }
.sheet-duo .card .muted, .sheet-duo .muted { color: #5e5e62; }
.sheet-duo .card .chip { background: #eef0f1; color: #1c1c1e; border: 1px solid #c4c5c7; }
.sheet-duo ul.plain li, .sheet-duo p, .sheet-duo b { color: #1c1c1e; }
.sheet-duo .banner { background: #eee467; color: #1c1c1e; }

.duo-block { padding: 12px 14px; margin: 8px 0; }
.duo-block .duo-h { font-size: .9rem; color: #5e5e62; margin: .2em 0 .3em; }
.duo-block .duo-h b { color: #1c1c1e; }
.duo-block .duo-h + ul { margin-bottom: .6em; }
.duo-block ul.plain li { margin: .3em 0; }

/* 搭檔報告：屬性小色塊 */
.abars { display: flex; flex-direction: column; gap: 3px; margin: 4px 0 6px; }
.abar { display: grid; grid-template-columns: minmax(0, 7.5em) 1fr 2.2em; align-items: center; gap: 8px; font-size: .82rem; }
.abar-n { color: #5e5e62; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abar-t { height: 8px; background: #c4c5c7; border-radius: 99px; overflow: hidden; }
.abar-t i { display: block; height: 100%; border-radius: 99px; }
.abar-v { text-align: right; font-weight: 700; color: #1c1c1e; }

/* 搭檔報告：區段導覽（黏在上方） */
.duonav { position: sticky; top: -1px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; margin: 4px 0 2px; background: #dfe0e1; border-bottom: 1px solid #c4c5c7; }
.duonav .chip { cursor: pointer; border: 1.5px solid #1c1c1e; background: #fff; color: #1c1c1e; font-size: .8rem; padding: 3px 10px; }
.duonav .chip:hover { background: #eee467; }
.duo-sec { scroll-margin-top: 110px; }

/* 餵食：碎屑往下散 */
.fx .crumb { position: absolute; left: 50%; top: 10px; width: 7px; height: 7px; border-radius: 2px; background: #d3d2c3; border: 1.5px solid #1c1c1e; opacity: 0; animation: crumb 1.1s ease-in forwards; transform: scale(var(--sc, 1)) rotate(var(--r, 0deg)); }
.fx .crumb:nth-child(3n) { background: #eee467; } .fx .crumb:nth-child(3n+1) { background: #fff; }
@keyframes crumb { 0% { opacity: 1; transform: translate(0, 0) scale(var(--sc, 1)); } 100% { opacity: 0; transform: translate(var(--x, 0), 70px) rotate(var(--r, 0deg)) scale(var(--sc, 1)); } }
/* 玩耍：亮片往外炸（菱形） */
.fx .spark { position: absolute; left: 50%; top: 20px; width: 12px; height: 12px; background: #eee467; border: 1.5px solid #1c1c1e; opacity: 0; animation: spark 1.3s ease-out forwards; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.fx .spark:nth-child(2n) { background: #fff; }
@keyframes spark { 0% { opacity: 1; transform: translate(0, 10px) scale(.3); } 60% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(var(--x, 0) * 1.6), calc(-40px - 30px * var(--sc, 1))) rotate(var(--r, 0deg)) scale(var(--sc, 1)); } }
/* 休息：灰色睡泡慢慢往上 */
.fx .zz { position: absolute; left: 60%; top: 0; width: 16px; height: 16px; border-radius: 50%; background: #e5e5e6; border: 1.5px solid #6e6e72; opacity: 0; animation: zz 3s ease-in-out forwards; }
.fx .zz::after { content: ''; position: absolute; left: 30%; top: 25%; width: 35%; height: 35%; border-radius: 50%; background: #fff; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 10px) scale(.4); } 20% { opacity: .95; } 100% { opacity: 0; transform: translate(calc(var(--x, 0) * .4 + 20px), -70px) scale(calc(.6 + var(--sc, 1) * .6)); } }

/* 音樂開關：庭院左下角的小喇叭 */
.musicbtn { position: absolute; left: 2.5%; bottom: 3%; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid #1c1c1e; background: rgba(255,255,255,.85); color: #1c1c1e; padding: 5px; cursor: pointer; z-index: 60; opacity: .75; transition: opacity .2s, transform .12s; }
.musicbtn svg { width: 100%; height: 100%; display: block; }
.musicbtn:hover { opacity: 1; transform: scale(1.08); }
.musicbtn.on { background: #eee467; opacity: 1; }

/* 衣櫃 */
.wardrobe .preview, .wardrobe .preview .slot, .wardrobe .preview .mon { width: min(300px, 80vw); height: min(300px, 80vw); }
.wardrobe .preview { margin: 0 auto 8px; }
.wardrobe .gearrow { display: flex; flex-wrap: wrap; gap: 8px; margin: .3em 0 .8em; }
.wardrobe .geartile { width: 72px; padding: 6px 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font-size: .72rem; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wardrobe .geartile img { width: 48px; height: 48px; object-fit: contain; }
.wardrobe .geartile[aria-pressed="true"] { background: #eee467; color: #1c1c1e; border-color: #1c1c1e; }
.wardrobe .tune { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: .4em 0; }
.wardrobe .tune .btn { padding: 8px 0; }

/* 衣櫃預覽裡的配件可以拖曳 */
#gearPreview .gear { pointer-events: auto; cursor: grab; touch-action: none; }
#gearPreview .gear.dragging { cursor: grabbing; filter: drop-shadow(0 0 0 2px #eee467) drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
#gearPreview .gear:hover { outline: 2px dashed #eee467; outline-offset: 2px; border-radius: 6px; }

/* 設定：展開式區塊 */
.setsec { padding: 0; overflow: hidden; }
.setsec > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.setsec > summary::-webkit-details-marker { display: none; }
.setsec > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; margin-right: 4px; opacity: .6; }
.setsec[open] > summary::after { transform: rotate(-135deg); }
.setsec .setbody { padding: 0 16px 14px; }

/* 名片：口頭禪與同天生日的名人 */
.myquip { position: relative; margin: 0 0 14px; padding: 18px 18px 14px 22px; border-radius: 18px; background: #eee467; color: #1c1c1e; border: 2px solid #1c1c1e; }
.myquip .mq-label { font-size: .75rem; font-weight: 700; letter-spacing: .08em; opacity: .7; }
.myquip p { margin: .2em 0 .4em; font-size: 1.25rem; font-weight: 700; line-height: 1.45; }
.myquip p::before { content: '「'; } .myquip p::after { content: '」'; }
.myquip .mq-hint { font-size: .75rem; opacity: .65; }
.celebs { display: grid; gap: 12px; }
.celeb { border-radius: 18px; background: var(--card); border: 1.5px solid var(--line); padding: 14px 16px 6px; }
.celeb header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.celeb .cyear { flex: 0 0 auto; font-weight: 700; font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--bg); letter-spacing: .04em; }
.celeb header b { display: block; font-size: 1.05rem; }
.celeb .cen { display: block; font-size: .75rem; opacity: .55; letter-spacing: .02em; }
.celeb .cwhat { display: block; font-size: .85rem; opacity: .75; margin-top: 2px; }
.qline { margin: 0 0 10px; padding: 10px 0 0 14px; border-left: 3px solid #eee467; border-top: 1px dashed var(--line); }
.qline:first-of-type { border-top: 0; padding-top: 2px; }
.qline.inspired { border-left-color: #d3d2c3; }
.qline p { margin: 0; font-size: 1rem; line-height: 1.6; }
.qline footer { margin-top: 4px; font-size: .72rem; opacity: .6; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.qline .qorig { font-style: italic; }
.qline a { color: inherit; }
.qnote { font-size: .72rem; opacity: .55; margin: 10px 2px 0; }

.celeb .cbio { margin: 0 0 12px; font-size: .9rem; line-height: 1.75; opacity: .9; }
.qline .qorig { margin: 4px 0 0; font-size: .8rem; font-style: italic; opacity: .6; line-height: 1.5; }
.qline .qctx { margin: 6px 0 0; font-size: .8rem; line-height: 1.6; opacity: .75; }

/* 名片：我的生日小檔案 */
.bdsum { display: grid; gap: 10px; }
.bdsum-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.bdsum-head b { font-size: 1.3rem; }
.bdsum-line { margin: 0; }
.bdsum-row { display: grid; grid-template-columns: 4.6em 1fr; gap: 8px; align-items: start; }
.bdsum-k { display: block; font-size: .75rem; font-weight: 700; opacity: .6; letter-spacing: .04em; padding-top: 4px; }
.bdsum-q { margin: 2px 0; padding: 10px 14px; border-left: 4px solid #eee467; background: color-mix(in srgb, var(--line) 25%, transparent); border-radius: 0 12px 12px 0; font-size: 1.02rem; line-height: 1.6; }
.bdsum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.bdsum-grid > div { padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--line); }
.bdsum-grid b { display: block; margin-top: 2px; }
.bdsum-grid p { margin: 4px 0 0; font-size: .85rem; opacity: .8; line-height: 1.55; }

/* 給自己的鼓勵：淡淡浮在背景裡的文字 */
.yard .decor.note { font-size: clamp(.78rem, 3vw, 1rem); font-weight: 700; letter-spacing: .06em; line-height: 1.4; width: max-content; max-width: 11em; padding: 2px 4px; background: none; border: 0; box-shadow: none; filter: none;
  color: #ffffff; text-shadow: 0 1px 6px rgba(0,0,0,.35), 0 0 14px rgba(255,255,255,.35); white-space: normal; text-align: center; transform: translate(-50%, -100%); cursor: pointer;
  animation: notebreathe 7s ease-in-out infinite; }
.yard .decor.note.n1 { animation-delay: -2.3s; } .yard .decor.note.n2 { animation-delay: -4.6s; }
.yard .decor.note:active { cursor: grabbing; }
@keyframes notebreathe { 0%, 100% { opacity: .38; transform: translate(-50%, -100%); } 50% { opacity: .72; transform: translate(-50%, calc(-100% - 4px)); } }
@media (prefers-reduced-motion: reduce) { .yard .decor.note { animation: none; opacity: .6; } }
.notelist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.noteitem { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px dashed var(--line); }
.noteitem .notetext { flex: 1; font-weight: 700; }

/* 名片：齒輪與公開標記 */
.gearbtn { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); padding: 8px; cursor: pointer; align-self: flex-start; }
.gearbtn svg { width: 100%; height: 100%; display: block; }
.gearbtn:hover { background: #eee467; color: #1c1c1e; border-color: #1c1c1e; }
.pubchip { white-space: nowrap; font-size: .66rem; padding: 0 6px; margin-left: 6px; background: #eee467; color: #1c1c1e; border: 1px solid #1c1c1e; vertical-align: middle; }
.sheet-cardedit h2:not(:first-child) { font-size: 1rem; margin: 1.1em 0 .4em; opacity: .75; }

/* 頁面橫幅：底部漸層淡出融進頁面 */
.pagebanner { height: clamp(120px, 34vw, 190px); margin: 4px -16px 6px; background-size: cover; background-position: center 30%; border-radius: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, rgba(0,0,0,.6) 78%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 55%, rgba(0,0,0,.6) 78%, transparent 100%); }
@media (min-width: 680px) { .pagebanner { margin: 4px 0 6px; border-radius: 18px 18px 0 0; } }
.pagebanner + h1 { margin-top: -.2em; }

/* 療癒角落 */
.entries { display: grid; gap: 12px; }
.entry { display: block; width: 100%; padding: 0; border: 2px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--card); color: var(--ink); cursor: pointer; text-align: left; }
.entry img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.entry .entry-t { display: block; padding: 10px 14px 12px; } .entry .entry-t b { font-size: 1.1rem; display: block; } .entry .entry-t small { color: var(--muted); }
.entry:hover { border-color: #eee467; }
.fscene, .bscene, .vscene { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 70vh; border-radius: 18px; overflow: hidden; background-size: cover; background-position: center; border: 2px solid var(--line); }
.bscene { background: #1c1c1e url(../assets/healing/burn-bg.webp) center / cover no-repeat; }
.vscene { touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
/* 占卜 */
.ftube { position: absolute; left: 50%; top: 66%; width: 24%; transform: translate(-50%, -50%); transform-origin: 50% 90%; }
.ftube img { width: 100%; display: block; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); }
.ftube.shaking { animation: ftshake .55s ease-in-out infinite alternate; }
@keyframes ftshake { from { transform: translate(-50%, -50%) rotate(-9deg); } to { transform: translate(-50%, -50%) rotate(9deg); } }
.fstick { position: absolute; left: 50%; top: 56%; width: 5%; transform: translate(-50%, 0); opacity: 0; }
.fstick img { width: 100%; display: block; }
.fstick.out { animation: fstick 2s ease-out forwards; }
@keyframes fstick { 0% { opacity: 0; transform: translate(-50%, 0) rotate(0); } 30% { opacity: 1; } 100% { opacity: 1; transform: translate(-50%, -70%) rotate(18deg); } }
.slipcard { margin-top: 10px; padding: 18px 18px 14px; border-radius: 18px; background: #f4ebd3; color: #1c1c1e; border: 3px solid #7a2a2a; box-shadow: inset 0 0 0 2px #c9a24a; }
.slipcard .muted { color: #6a5a40; } .slipcard .sub { color: #7a2a2a; }
.slipcard .chip { background: #fff; color: #1c1c1e; border: 1px solid #7a2a2a; } .slipcard .chip-dim { background: #e5e5e6; border-color: #9a9a9d; color: #5e5e62; }
.slipcard .setsec { background: #fff8e8; border-color: #c9a24a; } .slipcard .setsec summary { color: #1c1c1e; }
.slip-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.slip-core { font-size: 1.6rem; font-weight: 800; color: #7a2a2a; margin-left: auto; }
.slip-poem { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; margin: 12px 0 8px; font-size: 1.2rem; letter-spacing: .06em; font-weight: 700; text-align: center; line-height: 1.6; }
/* 焚信 */
.bwizard { position: absolute; left: 4%; bottom: 8%; width: 42%; transform: translateX(-120%); transition: transform .9s ease-out; }
.bwizard.in { transform: translateX(0); } .bwizard img { width: 100%; display: block; }
.bletter { position: absolute; right: 8%; top: 14%; width: 44%; }
.bletter img { width: 100%; display: block; } .bletter.ready { animation: bfloat 2s ease-in-out infinite; }
.bletter.burn1, .bletter.burn2 { animation: bshake .12s ease-in-out infinite alternate; } .bletter.burn3 { animation: brise 1.6s ease-out forwards; }
@keyframes bfloat { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes bshake { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
@keyframes brise { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-40%); } }
.bltext { position: absolute; inset: 30% 18% 20% 24%; font-size: clamp(.6rem, 2.4vw, .85rem); line-height: 1.5; color: #4a3a2a; overflow: hidden; white-space: pre-wrap; word-break: break-all; transform: rotate(-4deg); }
/* 出氣室 */
.vstraw { position: absolute; left: 50%; top: 8%; width: 36%; transform: translateX(-50%); transform-origin: 50% 100%; }
.vstraw img:first-child { width: 100%; display: block; } .vstraw.sway { animation: vsway 2.4s ease-in-out infinite; } .vstraw.flinch { animation: vflinch .35s ease-out; } .vstraw.down { animation: vdown .5s ease-out forwards; }
.vstuck { position: absolute; width: 22%; pointer-events: none; }
@keyframes vsway { 0%, 100% { transform: translateX(-50%) rotate(-5deg); } 50% { transform: translateX(-50%) rotate(5deg); } }
@keyframes vflinch { 0% { transform: translateX(-50%) rotate(0); } 40% { transform: translateX(-50%) rotate(-14deg) translateY(-3%); } 100% { transform: translateX(-50%) rotate(0); } }
@keyframes vdown { to { transform: translateX(-50%) translateY(18%); } }
.varrow { position: absolute; left: 50%; bottom: 10%; width: 36%; transform: translateX(-50%) rotate(-90deg); animation: varrow .32s ease-in forwards; pointer-events: none; }
@keyframes varrow { to { bottom: 62%; transform: translateX(-50%) rotate(-90deg) scale(.6); opacity: 0; } }
.vbow { position: absolute; left: 50%; bottom: 2%; width: 18%; transform: translateX(-50%) rotate(90deg); pointer-events: none; opacity: .9; }
.vbag { position: absolute; left: 50%; top: 6%; width: 38%; transform: translateX(-50%); transform-origin: 50% 0; }
.vbag img { width: 100%; display: block; } .vbag.swing { animation: vswing 3s ease-in-out infinite; } .vbag.hit { animation: vhit .18s ease-out; } .vbag.over { animation: vover .6s ease-in forwards; }
@keyframes vswing { 0%, 100% { transform: translateX(-50%) rotate(-3deg); } 50% { transform: translateX(-50%) rotate(3deg); } }
@keyframes vhit { 0% { transform: translateX(-50%) rotate(0) scale(1); } 40% { transform: translateX(-50%) rotate(12deg) scale(.95, 1.05); } 100% { transform: translateX(-50%) rotate(0); } }
@keyframes vover { to { transform: translateX(-50%) translateY(60%) rotate(80deg); } }
.vpow { position: absolute; width: 22%; transform: translate(-50%, -50%); pointer-events: none; animation: vpow .18s ease-out; }
@keyframes vpow { from { transform: translate(-50%, -50%) scale(.4); } to { transform: translate(-50%, -50%) scale(1.1); opacity: .9; } }
.vtimer, .vcount { position: absolute; right: 12px; top: 10px; background: rgba(28,28,30,.75); color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 999px; }
.vdone { position: absolute; left: 50%; bottom: 10%; transform: translateX(-50%); background: rgba(255,255,255,.92); color: #1c1c1e; padding: 12px 18px; border-radius: 14px; text-align: center; font-weight: 700; border: 2px solid #1c1c1e; width: max-content; max-width: 86%; line-height: 1.7; }
.vbar { position: absolute; left: var(--p, 50%); top: 38%; width: 60%; transform: translateX(-50%) rotate(-8deg); transition: left .25s; pointer-events: none; }
.vbar img { width: 100%; display: block; }
.vslash { position: absolute; width: 26%; transform: translate(-50%, -50%) rotate(-30deg); pointer-events: none; animation: vpow .22s ease-out; }
.vpiece { position: absolute; top: 44%; width: 14%; transform: translate(-50%, 0) rotate(var(--rot, 0)); animation: vfall 1s ease-in forwards; pointer-events: none; }
@keyframes vfall { to { top: 58%; opacity: .95; } }
.vplate { position: absolute; left: 40%; bottom: 22%; width: 44%; transform: translateX(-50%); pointer-events: none; }
.veat { position: absolute; right: 4%; bottom: 4%; width: 34%; animation: bfloat 2s ease-in-out infinite; } .veat img { width: 100%; display: block; }

/* 寵物跟在怪獸身邊，怪獸轉身時換到另一側 */
.me.flip .petbuddy { left: auto; right: -34%; }
.me.flip .petbuddy img { transform: scaleX(-1); }
.me.pause .petbuddy { animation-play-state: paused; }

/* 會飛的小寵物：飄在怪獸肩膀高度，上下浮動 */
.me .petbuddy.fly { bottom: 52%; width: 38%; left: -30%; animation: petfly 3.2s ease-in-out infinite; filter: drop-shadow(0 14px 6px rgba(28,28,30,.14)); }
.me.flip .petbuddy.fly { left: auto; right: -30%; }
@keyframes petfly { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-16%) rotate(4deg); } }

/* 團隊組合 */
.teamslots { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.teamslot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border-radius: 14px; background: #fff; border: 1.5px solid #c4c5c7; color: #1c1c1e; }
.teamslot .ts-art, .teamslot .ts-art .slot, .teamslot .ts-art .mon { width: 64px; height: 64px; }
.teamslot .ts-art .bdname { display: none !important; }
.teamslot select, .teamslot input { width: 100%; font-size: .78rem; padding: 4px 6px; }
.teamslot .ts-x { position: absolute; top: 4px; right: 4px; font-size: .66rem; padding: 1px 6px; border-radius: 99px; border: 1px solid #c4c5c7; background: #f2f2f3; color: #5e5e62; cursor: pointer; }
.ts-add { justify-content: center; border-style: dashed; cursor: pointer; min-height: 150px; background: transparent; }
.ts-add span { font-size: 1.8rem; line-height: 1; } .ts-add small { color: #5e5e62; }
.teamtable { display: grid; gap: 3px; font-size: .78rem; overflow-x: auto; }
.tt-row { display: grid; grid-template-columns: minmax(5.5em, 1.4fr) repeat(6, minmax(2.6em, 1fr)); gap: 3px; align-items: center; }
.tt-head span { text-align: center; font-weight: 700; color: #5e5e62; font-size: .72rem; }
.tt-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-cell { text-align: center; padding: 6px 0; border-radius: 6px; font-weight: 700; color: #1c1c1e; background: color-mix(in srgb, #eee467 calc(var(--v) * 100%), #ffffff); border: 1px solid #d8d8da; }
.teamslot select, .teamslot input { background: #fff; color: #1c1c1e; border: 1px solid #c4c5c7; border-radius: 8px; }
.teamslot input::placeholder { color: #9a9a9d; }
.sheet-duo .plain .chip { background: #fff; color: #1c1c1e; border: 1px solid #9a9a9d; }

.teamstyle { margin: 10px 0 4px; }
.teamstyle > b { display: block; font-size: 1.35rem; margin: 2px 0 6px; }

.fwait { animation: fwait 2.4s ease-in-out infinite; }
@keyframes fwait { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.fscene::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 62%, rgba(180,140,255,.0) 0, rgba(28,20,50,.0) 60%); transition: background 1.2s; }
.fscene:has(.shaking)::after { background: radial-gradient(circle at 50% 62%, rgba(238,228,103,.28) 0, rgba(28,20,50,.35) 70%); }

/* 生日選擇器 */
.mdsel { display: flex; gap: 6px; width: 100%; }
.mdsel select { flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; padding: 9px 26px 9px 12px; border-radius: 12px; border: 1.5px solid #c4c5c7; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231c1c1e' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center; color: #1c1c1e; font-weight: 700; font-size: .92rem; text-align: center; text-align-last: center; }
.mdsel select:focus { outline: 2px solid #eee467; border-color: #1c1c1e; }
.teamslot .mdsel select { padding: 6px 18px 6px 6px; font-size: .78rem; background-position: right 6px center; }
.duopick label { display: flex; flex-direction: column; gap: 4px; }
/* 籤詩說明：一句一行，不在句中斷開 */
.slip-note { margin: .2em 0 .8em; text-align: center; line-height: 1.8; }
.slip-note span { display: inline-block; margin: 0 .2em; }

/* 選日期按鈕與面板 */
.mdbtn { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid #c4c5c7; background: #fff; color: #1c1c1e; font-weight: 800; font-size: .95rem; cursor: pointer; letter-spacing: .02em; }
.mdbtn:hover, .mdbtn:focus { border-color: #1c1c1e; box-shadow: 0 0 0 3px #eee467; outline: none; }
.teamslot .mdbtn { padding: 6px 4px; font-size: .8rem; }
.mdpop { position: fixed; inset: 0; z-index: 400; background: rgba(28,28,30,0); display: flex; align-items: flex-end; justify-content: center; transition: background .2s; }
.mdpop.show { background: rgba(28,28,30,.45); }
.mdpop-in { width: 100%; max-width: 520px; background: #f5f5f6; color: #1c1c1e; border-radius: 22px 22px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out; box-shadow: 0 -6px 20px rgba(0,0,0,.18); }
.mdpop.show .mdpop-in { transform: translateY(0); }
.mdpop-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mdpop-h b { font-size: 1.05rem; }
.mdpop-x { border: 0; background: none; color: #5e5e62; font-weight: 700; cursor: pointer; }
.mdpop-m { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 12px; }
.mdpop-m button, .mdpop-d button { border: 1.5px solid #d3d2c3; background: #fff; color: #1c1c1e; border-radius: 10px; padding: 8px 0; font-weight: 700; cursor: pointer; font-size: .85rem; }
.mdpop-m button.on, .mdpop-d button.on { background: #eee467; border-color: #1c1c1e; }
.mdpop-w, .mdpop-d { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.mdpop-w span { font-size: .72rem; color: #9a9a9d; font-weight: 700; padding-bottom: 2px; }
.mdpop-d button { padding: 9px 0; font-size: .92rem; }
.mdpop-d button:hover, .mdpop-m button:hover { border-color: #1c1c1e; }

/* 三隻寵物的位置 */
.me .petbuddy.pos1 { left: auto; right: -30%; bottom: 0; width: 40%; animation-delay: -.8s; }
.me .petbuddy.pos2 { left: -62%; bottom: 0; width: 36%; animation-delay: -1.6s; }
.me .petbuddy.pos1.fly { right: -26%; left: auto; bottom: 58%; }
.me .petbuddy.pos2.fly { left: -50%; bottom: 66%; }
.me.flip .petbuddy.pos1 { right: auto; left: -30%; }
.me.flip .petbuddy.pos2 { left: auto; right: -62%; }
.me.flip .petbuddy.pos1.fly { left: -26%; right: auto; }
.me.flip .petbuddy.pos2.fly { right: -50%; left: auto; }
.petbar-main img + img { margin-left: -10px; }
.petbar .btn { white-space: nowrap; flex: 0 0 auto; }

/* 報告裡的人名上色（和雷達圖顏色對應） */
.who { font-weight: 800; padding: 0 3px; border-radius: 4px; color: #1c1c1e; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.who.w0 { background: #eee467; } .who.w1 { background: #c9c9cc; } .who.w2 { background: #e2dcc4; } .who.w3 { background: #ffffff; box-shadow: inset 0 0 0 1.5px #1c1c1e; }
.who.w4 { background: #f5c9a8; } .who.w5 { background: #bfdbe8; } .who.w6 { background: #cfe6c4; } .who.w7 { background: #e6cde6; }
.whokey { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; font-size: .85rem; }
.chip .who, .teamslot .who { background: none; padding: 0; box-shadow: none; }

/* 依人物換文字顏色（淺底上清楚易讀的深色） */
.wt0, .pw0 li, .pw0 p, .pw0 .muted { color: #6e5410; }
.wt1, .pw1 li, .pw1 p, .pw1 .muted { color: #2f4f6b; }
.wt2 { color: #5a5236; } .wt3 { color: #3a3a3c; } .wt4 { color: #8a3f1f; } .wt5 { color: #1f5f7a; } .wt6 { color: #3f6b2f; } .wt7 { color: #6b2f6b; }
.pw0 { box-shadow: inset 4px 0 0 #eee467; } .pw1 { box-shadow: inset 4px 0 0 #9a9a9d; }

/* ===== 公共留言板（黑板） ===== */
.chalkboard {
  --slate: #2b2c2b; --chalk: #f4f4f0; --chalk-dim: rgba(244, 244, 240, .58);
  background: radial-gradient(120% 80% at 30% 20%, rgba(255, 255, 255, .06), transparent 60%), var(--slate);
  color: var(--chalk); border: 10px solid #7a5a3a; border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .35), inset 0 0 40px rgba(0, 0, 0, .35), var(--shadow);
  padding: 14px; margin: 10px 0;
}
.chalkboard.compose { border-bottom-width: 16px; }
.compose-who { display: flex; align-items: center; gap: 10px; color: var(--chalk-dim); font-size: .9rem; margin-bottom: 8px; }
.compose-who b { color: var(--chalk); }
.chalkboard .bav { width: 44px; height: 44px; flex: 0 0 44px; }
.chalkboard .bav .bdname { display: none; }
.chalkboard textarea {
  width: 100%; background: rgba(255, 255, 255, .05); color: var(--chalk); border: 1.5px dashed rgba(244, 244, 240, .3);
  border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 1.05rem; line-height: 1.6; resize: vertical; min-height: 84px;
}
.chalkboard textarea::placeholder { color: rgba(244, 244, 240, .4); }
.chalkboard textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.compose-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.compose-row .btn { margin-left: auto; }
.chalks { display: flex; gap: 8px; }
.chalk-pick { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid transparent; box-shadow: 0 0 0 2px rgba(0, 0, 0, .3); padding: 0; }
.chalk-pick.on { border-color: var(--slate); box-shadow: 0 0 0 3px var(--c); }
.chalk-dim { color: var(--chalk-dim); font-size: .82rem; }
#boardTs { margin-top: 10px; }
#boardTs:empty { display: none; }
.chalkboard.list { padding: 6px 14px; min-height: 160px; }
.bmsg { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1.5px dashed rgba(244, 244, 240, .16); }
.bmsg:last-of-type { border-bottom: 0; }
.bmsg.hidden { opacity: .5; }
.bmsg-av { flex: 0 0 44px; }
.bav-none { width: 44px; height: 44px; border-radius: 50%; border: 2px dashed rgba(244, 244, 240, .3); }
.bmsg-main { flex: 1; min-width: 0; }
.bmsg-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.bmsg-head b { color: var(--chalk); }
.bmsg-head span { color: var(--chalk-dim); font-size: .78rem; }
.bmsg-text { margin: .15em 0 0; font-size: 1.05rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; text-shadow: 0 0 1px currentColor; }
.bmsg-tools { display: flex; gap: 6px; margin-top: 4px; align-items: center; }
.chalk-btn { background: transparent; border: 1.5px solid rgba(244, 244, 240, .4); color: var(--chalk); border-radius: 999px; padding: 4px 12px; font-size: .82rem; min-height: 32px; }
.chalk-btn.dim { border-color: transparent; color: var(--chalk-dim); padding: 4px 6px; }
.chalk-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.chalk-more { text-align: center; padding: 10px 0 6px; }
.chalk-empty { text-align: center; color: var(--chalk-dim); padding: 28px 8px; margin: 0; }
.chalk-empty img { width: 120px; display: block; margin: 0 auto 8px; }
.tabs button { white-space: nowrap; }
@media (max-width: 400px) { .tabs button { font-size: .82rem; padding-left: 0; padding-right: 0; } }

/* ===== 心情指數 ===== */
.card.mood { padding: 12px 14px; }
.mood-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 8px; }
.mood-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mood-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--soft); border: 1.5px solid transparent; border-radius: 12px; padding: 8px 2px 6px; min-height: 64px; font-size: .78rem; color: var(--ink); }
.mood-pick i { display: block; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--ink);
  background: conic-gradient(var(--accent) calc(var(--lv) * 20%), transparent 0); }
.mood-pick.m1 i { background: radial-gradient(circle at 50% 40%, #9a9a9d 0 45%, #6e6e72 46%); }
.mood-pick.on { border-color: var(--ink); background: var(--card); font-weight: 700; }
.mood-pick.on.m5 { background: var(--accent); color: #1c1c1e; }
/* 心情最差：頭頂冒煙（霧化） */
.smoke { position: absolute; left: 50%; top: -6%; width: 70%; height: 45%; transform: translateX(-50%); pointer-events: none; z-index: 3; }
.smoke::before { content: ''; position: absolute; left: 15%; right: 15%; bottom: 0; height: 45%; border-radius: 50%; background: rgba(110, 110, 114, .45); filter: blur(10px); }
.smoke i { position: absolute; bottom: 0; left: 50%; width: 48%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 88, 92, .95), rgba(120, 120, 124, .6) 55%, transparent 72%);
  filter: blur(4px); opacity: 0; animation: smoke 3.2s ease-out infinite; }
.smoke i:nth-child(2) { animation-delay: .8s; --sx: -60%; }
.smoke i:nth-child(3) { animation-delay: 1.6s; --sx: 30%; }
.smoke i:nth-child(4) { animation-delay: 2.4s; --sx: -20%; }
@keyframes smoke { 0% { opacity: 0; transform: translate(-50%, 30%) scale(.5); } 15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--sx, 15%)), -150%) scale(2); filter: blur(9px); } }
.me.gloomy .mon { filter: saturate(.55) brightness(.92); }
/* 心情最好：哼歌冒音符 */
.fx .note { position: absolute; left: 50%; top: 10%; font-size: 1.5rem; font-weight: 700; color: #1c1c1e; text-shadow: 0 0 0 #fff, 1px 1px 0 #fff, -1px -1px 0 #fff; opacity: 0; animation: note 2.6s ease-out forwards; }
.fx .note::before { content: '♪'; }
.fx .note:nth-child(even)::before { content: '♫'; }
@keyframes note { 0% { opacity: 0; transform: translate(0, 10px) rotate(-10deg) scale(.7); } 20% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(var(--x) * 1.4), -70px) rotate(12deg) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .smoke i { animation: none; opacity: .7; transform: translate(-50%, -40%); } .fx .note { animation-duration: .01s; } }

/* ===== 團隊合照（依默契排站位）與遠方旅行章 ===== */
.teamphoto { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #d3d2c3 center / cover no-repeat; border: 1.5px solid #1c1c1e; margin-top: 4px; }
.teamphoto.plain { background: linear-gradient(#e5e5e6 0 62%, #d3d2c3 62%); }
.tp-mon { position: absolute; transform: translateX(-50%); aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; }
.tp-mon .slot, .tp-mon .mon { width: 100%; height: 100%; }
.tp-mon .bdname { display: none !important; }
.tp-mon > span { position: absolute; top: 100%; margin-top: -6%; z-index: 5; background: rgba(255, 255, 255, .92); color: #1c1c1e; border: 1px solid #1c1c1e; border-radius: 99px; padding: 0 7px; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.tp-mon.far { transform: none; opacity: .85; }
.tp-mon.far > span { font-size: .58rem; padding: 0 5px; }
.teamslot.gone .ts-art .mon { filter: saturate(.6); opacity: .8; }
.teamslot .ts-left { display: flex; align-items: center; gap: 4px; font-size: .74rem; color: #5e5e62; align-self: flex-start; }
.teamslot .ts-left input { width: auto; }
.teamslot input[type="date"] { font-size: .74rem; }
.ts-art { position: relative; }
.travelstamp { position: absolute; right: -14px; bottom: -8px; width: 62px; aspect-ratio: 1; transform: rotate(-12deg); pointer-events: none; }
.travelstamp img { position: absolute; inset: 0; width: 100%; height: 100%; }
.travelstamp span { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; line-height: 1.05; color: #8a3f1f; }
.travelstamp b { font-size: .6rem; letter-spacing: .05em; }
.travelstamp small { font-size: .48rem; font-weight: 700; }
.travelstamp.noimg { border: 2.5px double #8a3f1f; border-radius: 50%; background: rgba(255, 255, 255, .55); }

/* 留言板素材：木框下緣的粉筆與板擦、擦乾淨提示、庭院立牌 */
.chalkboard { position: relative; }
.chalkboard .ledge { position: absolute; bottom: -34px; width: 50px; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.chalkboard .ledge.chalk { left: 46%; }
.chalkboard .ledge.eraser { right: 18px; bottom: -30px; width: 50px; }
.chalkboard.list { margin-bottom: 22px; }
.chalk-empty img { width: 132px; }
.chalk-cleared { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 0 4px; color: var(--chalk); font-weight: 700; transition: opacity .5s; }
.chalk-cleared img { width: 72px; }
.chalk-cleared.out { opacity: 0; }
.boardsign { position: absolute; left: 82%; bottom: 3%; width: 14%; transform: translateX(-50%); background: none; border: 0; padding: 0; z-index: 30; cursor: pointer; }
.boardsign img { width: 100%; display: block; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25)); transition: transform .15s; }
.boardsign:hover img, .boardsign:focus-visible img { transform: translateY(-3px) rotate(-2deg); }
/* 旅行章：有圖時跟著圖的空白帶傾斜；沒圖時用 CSS 圓框 */
.travelstamp { transform: none; }
.travelstamp span { transform: translateY(-50%) rotate(9deg); }
.travelstamp.noimg { transform: rotate(-12deg); }
.travelstamp.noimg span { transform: translateY(-50%); }
.teamslot .travelstamp { width: 78px; right: -20px; bottom: -14px; }
.travelstamp b { font-size: .66rem; } .travelstamp small { font-size: .52rem; }

/* ===== 占卜室：完整籤解、月老籤 ===== */
.qj { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: .88rem; }
.qj dt { color: var(--muted); white-space: nowrap; }
.qj dd { margin: 0; }
.fhint { text-align: center; font-size: .78rem; margin: .6em 0 0; }
/* 魔法師帽子的熱區（背景圖 1080×1620 裡帽子約在 x 26–72%、y 26–41%） */
.fhat { position: absolute; left: 26%; top: 26%; width: 46%; height: 15%; background: none; border: 0; padding: 0; z-index: 4; border-radius: 50%;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: none; cursor: pointer; }
.fhat i { position: absolute; inset: -6%; border-radius: 50%; pointer-events: none; opacity: 0;
  background: conic-gradient(#e0607a calc(var(--p, 0) * 1%), transparent 0); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); }
.fhat.holding i { opacity: .9; animation: hatfill 2s linear forwards; }
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
@keyframes hatfill { from { --p: 0; } to { --p: 100; } }
.fhat:focus-visible { outline: 3px solid var(--accent); }
.fscene.yl::after { background: radial-gradient(circle at 50% 40%, rgba(240, 120, 150, .18) 0, rgba(60, 20, 40, .25) 75%) !important; }
.fscene.yl .ftube { display: none; }
.ythread { position: absolute; left: 44%; top: 32%; width: 12%; height: 52%; pointer-events: none; z-index: 3; }
.ythread svg { width: 100%; height: 100%; overflow: visible; }
.ythread path { fill: none; stroke: #d6304f; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 220; animation: ythread 2.2s ease-out forwards; filter: drop-shadow(0 0 3px rgba(255, 120, 150, .9)); vector-effect: non-scaling-stroke; }
.yknot { position: absolute; left: 50%; bottom: -4%; width: 26px; height: 26px; transform: translate(-50%, 0) scale(0); border-radius: 50%;
  background: radial-gradient(circle, #ffd6df 0 25%, #d6304f 26% 60%, transparent 62%); animation: yknot .6s 1.9s ease-out forwards; }
@keyframes ythread { to { stroke-dashoffset: 0; } }
@keyframes yknot { to { transform: translate(-50%, 0) scale(1); } }
.ylcard .slip-core { color: #b02a47; }
.ylsit { border: 1.5px solid transparent; cursor: pointer; }
.ylsit.on { background: #f6d5dc; border-color: #b02a47; color: #1c1c1e; font-weight: 700; }
.ylsit-text { background: #fbeef1; color: #1c1c1e; border-radius: 12px; padding: 10px 12px; margin: .5em 0 .7em; line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { .ythread path { animation-duration: .01s; } .yknot { animation-delay: 0s; } }

/* 搭檔報告：一次看一段 */
.duonav .chip.on { background: #1c1c1e; color: #fff; }
.duonav .chip.ghost { border-style: dashed; background: transparent; }
.duopage { min-height: 40vh; }
.duopage > .duo-sec:first-child { margin-top: .4em; }
.duopager { position: sticky; bottom: -18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; margin-top: 12px; background: #dfe0e1; border-top: 1px solid #c4c5c7; }
.duopager .btn { max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 緣分雷達 ===== */
.entry-ph { display: block; width: 100%; aspect-ratio: 4 / 3; }
.entry-ph.ph-radar { background: radial-gradient(circle at 50% 60%, transparent 0 14%, rgba(238, 228, 103, .5) 14.5% 15.5%, transparent 16% 29%, rgba(238, 228, 103, .35) 29.5% 30.5%, transparent 31% 44%, rgba(238, 228, 103, .2) 44.5% 45.5%, transparent 46%),
  conic-gradient(from 20deg at 50% 60%, rgba(238, 228, 103, .45), transparent 18%), linear-gradient(#1f2a44, #2c2440); }
.radar-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.radar-ctl .mdbtn { min-width: 9em; }
.radar-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.radar-kind { border: 1.5px solid var(--line); background: var(--soft); color: var(--ink); border-radius: 12px; padding: 10px 4px; font-weight: 700; min-height: 44px; }
.radar-kind.on.k-work { background: #eee467; color: #1c1c1e; border-color: #1c1c1e; }
.radar-kind.on.k-friend { background: #b6c6d7; color: #1c1c1e; border-color: #1c1c1e; }
.radar-kind.on.k-love { background: #f2c4cf; color: #1c1c1e; border-color: #b02a47; }
.radar-hit { display: flex; gap: 12px; align-items: flex-start; }
.radar-hit.k-love { border-color: #f2c4cf; }
.radar-mon, .radar-mon .slot, .radar-mon .mon { width: 76px; height: 76px; flex: 0 0 76px; }
.radar-mon .bdname { display: none !important; }
.radar-main { flex: 1; min-width: 0; }
.radar-main p { margin: .25em 0 .5em; line-height: 1.65; }
.sep.love { color: #b02a47; font-weight: 700; }

/* 專案組隊參考 */
.proj { padding: 10px 12px; }
.proj-types, .proj-axes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.proj-axes { margin-top: 8px; }
.proj .chip { cursor: pointer; border: 1.5px solid transparent; }
.proj .chip.on { background: #1c1c1e; color: #fff; }
.proj-axes .chip.on { background: #eee467; color: #1c1c1e; border-color: #1c1c1e; }
.chip.fill { background: #eee467; color: #1c1c1e; }

/* 緣分雷達：小測驗、心動故事、問題卡 */
.radar-quiz { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; width: 100%; padding-top: 4px; border-top: 1px dashed var(--line); }
.radar-quiz > .muted { flex: 1 1 12em; font-size: .82rem; }
.radar-src { display: flex; gap: 6px; }
.radar-src .chip, .loveq .chip, .likert .chip { cursor: pointer; border: 1.5px solid transparent; }
.radar-src .chip.on { background: #1c1c1e; color: #fff; }
.radar-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.love-intro { display: grid; gap: 8px; }
.love-mon { display: flex; gap: 10px; align-items: center; margin: 0; padding: 10px 12px; }
.love-mon .slot, .love-mon .mon { width: 64px; height: 64px; flex: 0 0 64px; }
.love-mon .bdname { display: none !important; }
.loveq-item { margin: .3em 0 .7em; }
.loveq-item p { margin: 0 0 .35em; font-weight: 700; }
.loveq .chip.on { background: #f2c4cf; border-color: #b02a47; color: #1c1c1e; font-weight: 700; }
.loveq .chip.ghost { background: transparent; border: 1.5px dashed var(--line); }
.quiz { padding-left: 1.4em; margin: 0 0 12px; }
.quiz li { margin: 0 0 .9em; }
.quiz li p { margin: 0 0 .35em; }
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.likert .chip { font-size: .72rem; padding: 6px 2px; text-align: center; white-space: normal; line-height: 1.25; }
.likert .chip.on { background: #eee467; color: #1c1c1e; border-color: #1c1c1e; font-weight: 700; }
.b5 li { margin: .5em 0 .8em; }
.b5 .abar { display: block; margin: .25em 0; }

/* 焚信小屋：寫信畫面（橫幅＋透明信紙） */
.burn-banner { display: block; width: 100%; aspect-ratio: 1600 / 520; object-fit: cover; border-radius: 18px; margin: 0 0 10px; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.letterpaper { position: relative; aspect-ratio: 1000 / 1300; max-height: 70vh; margin: 0 auto; width: 100%; max-width: 460px;
  background: transparent url(../assets/healing/burn/letter-paper.webp) center / 100% 100% no-repeat; border-radius: 8px; }
.letterpaper textarea { position: absolute; left: 18%; top: 17%; width: 64%; height: 67%; border: 0; resize: none; background: transparent;
  color: #3b2a1e; font: inherit; font-size: clamp(12px, 3.2vw, 16px); line-height: 1.5; padding: 0 4px; outline-offset: 4px; }
.letterpaper textarea::placeholder { color: #a8957a; }

/* 療癒角落入口：兩欄小卡，避免跟上方橫幅混在一起 */
.entries { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.entry img, .entry .entry-ph { aspect-ratio: 4 / 3; }
.entry .entry-t { padding: 8px 10px 10px; }
.entry .entry-t b { font-size: 1rem; }
.entry .entry-t small { font-size: .76rem; line-height: 1.45; display: block; margin-top: 2px; }

/* 緣分雷達頁面配色：粉 #f2dbe1、橄欖綠 #898c4e（不論淺色、深色模式都用這組） */
body.theme-radar { --bg: #f2dbe1; --card: #fff7f9; --ink: #1c1c1e; --muted: #5f5a4a; --line: #d9b9c2; --soft: #ead0d7; background: #f2dbe1; color: #1c1c1e; }
body.theme-radar .topbar .title, body.theme-radar h1 { color: #1c1c1e; }
body.theme-radar h1 { border-left: 6px solid #898c4e; padding-left: 10px; }
body.theme-radar .chip { background: #ead0d7; color: #1c1c1e; }
body.theme-radar .radar-kind { background: #fff7f9; border-color: #d9b9c2; }
body.theme-radar .radar-kind.on, body.theme-radar .radar-kind.on.k-work, body.theme-radar .radar-kind.on.k-friend, body.theme-radar .radar-kind.on.k-love { background: #898c4e; color: #fff; border-color: #6d7039; }
body.theme-radar .radar-src .chip.on { background: #898c4e; color: #fff; }
body.theme-radar .btn { background: #898c4e; color: #fff; border-color: #6d7039; }
body.theme-radar .btn.ghost { background: #fff7f9; color: #1c1c1e; border-color: #d9b9c2; }
body.theme-radar .radar-hit, body.theme-radar .radar-hit.k-love { border-color: #d9b9c2; }
body.theme-radar .tabs { background: #fff7f9; border-top-color: #d9b9c2; }
body.theme-radar .tabs button { color: #5f5a4a; }
body.theme-radar .tabs button[aria-current="page"] { color: #1c1c1e; box-shadow: inset 0 3px 0 #898c4e; }
body.theme-radar .mdbtn { background: #fff; color: #1c1c1e; border-color: #d9b9c2; }
