/* ==========================================================================
   今天誰坐在我頭上？ v2 直式療癒版
   ========================================================================== */
:root {
  --cream: #fffaf2;
  --cream2: #fff3e3;
  --ink: #5a4038;
  --ink2: #9a7f70;
  --pink: #ff8fab;
  --pink2: #ffd2dc;
  --yellow: #ffd36e;
  --mint: #9fdcc4;
  --sky: #9fd3ff;
  --wood: #d9a46f;
  --shadow: 0 6px 18px rgba(120, 80, 50, 0.18);
  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font); color: var(--ink);
  background: #fbe9d7;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 210, 220, 0.6) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px);
  background-size: 34px 34px, 46px 46px;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none;
}
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; touch-action: manipulation; }
.hidden { display: none !important; }

#app { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: #f6e3cc;
}
@media (min-width: 560px) {
  #stage { width: min(440px, calc((100dvh - 40px) * 0.5)); height: min(940px, calc(100dvh - 40px)); min-width: 360px; border-radius: 34px; box-shadow: 0 24px 60px rgba(140, 90, 60, 0.3), 0 0 0 8px #fff7ee; }
}
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#safeProbe { position: absolute; visibility: hidden; pointer-events: none; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---------------- 共用 ---------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px;
  background: var(--cream); border-radius: 999px; box-shadow: var(--shadow); font-size: 17px; font-weight: 800;
}
.pill-ico { font-size: 18px; }
.pill.bump { animation: bump 0.45s ease; }
@keyframes bump { 30% { transform: scale(1.16); } 100% { transform: scale(1); } }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--cream); box-shadow: var(--shadow);
  display: grid; place-items: center; font-size: 20px; font-weight: 800;
}
.round-btn:active, .tool:active, .big-btn:active, .soft-btn:active, .chip:active { transform: translateY(2px) scale(0.97); }
.pause-ico { width: 14px; height: 15px; border-left: 4.5px solid var(--ink); border-right: 4.5px solid var(--ink); border-radius: 2px; }
.gear-ico { font-size: 22px; line-height: 1; }
.big-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100%; min-height: 62px; border-radius: 22px; font-size: 21px; font-weight: 900; letter-spacing: 0.04em;
  color: #fff; background: linear-gradient(#ffa3bb, #ff7f9f); box-shadow: 0 5px 0 #e0607f, 0 10px 22px rgba(255, 110, 140, 0.35);
  text-shadow: 0 1px 0 rgba(200, 60, 90, 0.35);
}
.big-btn small { font-size: 12.5px; font-weight: 700; opacity: 0.9; letter-spacing: 0; }
.soft-btn {
  width: 100%; min-height: 52px; border-radius: 18px; font-size: 17px; font-weight: 800;
  background: var(--cream2); box-shadow: 0 4px 0 #ecd3b8;
}
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 58px; padding: 7px 6px 6px;
  border-radius: 16px; background: #fff; box-shadow: 0 3px 0 #f0dcc6; font-size: 12px; font-weight: 800; position: relative;
}
.chip .em { font-size: 24px; line-height: 1.1; }
.chip.on { background: #fff0f4; box-shadow: 0 3px 0 var(--pink), inset 0 0 0 2px var(--pink); }
.chip .fav { position: absolute; top: -4px; right: -3px; font-size: 13px; }

/* ---------------- HUD ---------------- */
#hud {
  position: absolute; left: 14px; right: 14px; top: calc(var(--sat) + 12px); height: 42px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; z-index: 5; pointer-events: none;
}
#hud > * { pointer-events: auto; }
#napPill {
  flex: 1; max-width: 190px; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--cream); border-radius: 999px; box-shadow: var(--shadow); font-weight: 800; font-size: 15px;
}
.nap-track { position: relative; flex: 1; height: 8px; border-radius: 6px; background: linear-gradient(90deg, #ffe0a8, #ffc2d0 60%, #b9b4ff); }
#napSun { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); font-style: normal; font-size: 17px; transition: left 0.5s linear; }
#napTime { min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- 名牌 ---------------- */
#nameplate {
  position: absolute; left: 36px; top: calc(var(--sat) + 86px); z-index: 4;
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: rgba(255, 250, 242, 0.93); box-shadow: var(--shadow); animation: dropIn 0.35s ease;
}
#nameplate img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #fff3e3; }
.np-txt { display: flex; flex-direction: column; line-height: 1.15; }
.np-txt b { font-size: 15px; }
.np-txt small { font-size: 11px; color: var(--ink2); font-weight: 700; }
.np-hearts { display: flex; gap: 2px; margin-left: 2px; }
.np-hearts i { position: relative; width: 17px; height: 16px; display: block;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21s-9-5.6-9-12A5 5 0 0 1 12 6a5 5 0 0 1 9 3c0 6.4-9 12-9 12z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21s-9-5.6-9-12A5 5 0 0 1 12 6a5 5 0 0 1 9 3c0 6.4-9 12-9 12z'/%3E%3C/svg%3E") center/contain no-repeat;
  background: #f1dccd; }
.np-hearts i s { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #ff7f9f; transition: width 0.3s ease; }
@keyframes dropIn { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 心願泡泡 ---------------- */
#wish {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px 12px 8px; min-width: 150px; max-width: 250px;
  background: #fff; border-radius: 22px; box-shadow: 0 6px 20px rgba(120, 70, 80, 0.22), 0 0 0 3px #ffd2dc;
  transform: translate(-50%, var(--ty, -100%)); will-change: left, top;
}
#wish.below { --ty: 0%; }
#wish::after {
  content: ''; position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px; background: #fff;
  transform: translateX(-50%) rotate(45deg); border-radius: 0 0 5px 0; box-shadow: 3px 3px 0 0 #ffd2dc;
}
#wish.below::after { bottom: auto; top: -9px; border-radius: 5px 0 0 0; box-shadow: -3px -3px 0 0 #ffd2dc; }
#wish.pop { animation: wishPop 0.45s cubic-bezier(.3, 1.6, .5, 1); }
#wish.done { animation: wishDone 0.7s ease forwards; }
#wish.gone { animation: wishGone 0.5s ease forwards; }
@keyframes wishPop { from { transform: translate(-50%, calc(var(--ty, -100%) + 20%)) scale(0.3); opacity: 0; } to { transform: translate(-50%, var(--ty, -100%)) scale(1); opacity: 1; } }
@keyframes wishDone { 30% { transform: translate(-50%, var(--ty, -100%)) scale(1.15); } 100% { transform: translate(-50%, calc(var(--ty, -100%) - 30%)) scale(0.6); opacity: 0; } }
@keyframes wishGone { to { transform: translate(-50%, var(--ty, -100%)) scale(0.85); opacity: 0; } }
.wish-ico { position: relative; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#ff8fab var(--left, 100%), #f6e7ee 0); }
.wish-ico span { width: 37px; height: 37px; border-radius: 50%; background: #fff5f7; display: grid; place-items: center; font-size: 22px; }
.wish-txt { display: flex; flex-direction: column; line-height: 1.2; }
.wish-txt b { font-size: 15.5px; }
.wish-txt small { font-size: 11.5px; color: var(--ink2); font-weight: 700; margin-top: 2px; }
.wish-bar { position: absolute; left: 60px; right: 14px; bottom: 6px; height: 5px; border-radius: 3px; background: #f6e7ee; overflow: hidden; }
.wish-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb0c4, #ff7f9f); border-radius: 3px; transition: width 0.15s; }
#wish.nobar .wish-bar { display: none; }
#wish.check .wish-ico span { background: #e9fbef; }

/* ---------------- 悄悄話 / 吐司 ---------------- */
#whisper {
  position: absolute; left: 50%; bottom: calc(var(--sab) + 110px); transform: translateX(-50%); z-index: 6;
  max-width: 86%; padding: 9px 16px; border-radius: 18px; font-size: 14px; font-weight: 800; text-align: center; line-height: 1.35;
  background: rgba(90, 64, 56, 0.86); color: #fff8ef; box-shadow: var(--shadow); pointer-events: none;
  animation: fadeUp 0.35s ease;
}
#whisper.out { opacity: 0; transition: opacity 0.4s; }
@keyframes fadeUp { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
#toasts { position: absolute; left: 50%; top: calc(var(--sat) + 62px); transform: translateX(-50%); width: min(92%, 380px); z-index: 9; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 9px; border-radius: 20px;
  background: var(--cream); box-shadow: 0 8px 24px rgba(120, 80, 50, 0.25); animation: toastIn 0.45s cubic-bezier(.3, 1.4, .5, 1);
}
.toast.out { animation: toastOut 0.4s ease forwards; }
.toast .t-ico { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: #fff0e0; overflow: hidden; }
.toast .t-ico img { width: 100%; height: 100%; object-fit: cover; }
.toast .t-txt { display: flex; flex-direction: column; line-height: 1.3; }
.toast b { font-size: 15.5px; }
.toast span { font-size: 12.5px; color: var(--ink2); font-weight: 700; }
.toast.new { box-shadow: 0 8px 24px rgba(255, 120, 150, 0.35), 0 0 0 3px #ffd2dc; }
.toast .tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; background: var(--pink); color: #fff; margin-right: 5px; vertical-align: 1px; }
@keyframes toastIn { from { transform: translateY(-16px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-12px); opacity: 0; } }

/* ---------------- 工具列 ---------------- */
#tools {
  position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 12px); z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 26px; pointer-events: none;
}
#tools > * { pointer-events: auto; }
.tool {
  width: 68px; height: 68px; border-radius: 24px; background: var(--cream); box-shadow: 0 4px 0 #ecd3b8, var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.tool-ico { font-size: 27px; line-height: 1; }
.tool-lbl { font-size: 12.5px; font-weight: 800; }
.tool.on { background: #fff0f4; box-shadow: 0 4px 0 var(--pink), var(--shadow); }
.tool.glow { animation: toolGlow 1.1s ease-in-out infinite; }
@keyframes toolGlow { 50% { box-shadow: 0 4px 0 var(--pink), 0 0 0 6px rgba(255, 143, 171, 0.35); transform: translateY(-2px); } }
#shutter {
  width: 80px; height: 80px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  box-shadow: 0 5px 0 #ecd3b8, 0 0 0 5px rgba(255, 255, 255, 0.6), var(--shadow);
}
#shutter span { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #ffd2dc 19% 100%); box-shadow: inset 0 0 0 3px #ff9fb6; }
#shutter:active span { transform: scale(0.9); }
#shutter.glow span { animation: shutterGlow 1s ease-in-out infinite; }
@keyframes shutterGlow { 50% { box-shadow: inset 0 0 0 3px #ff9fb6, 0 0 0 7px rgba(255, 143, 171, 0.45); } }

#tray {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--sab) + 104px); z-index: 7;
  padding: 10px 10px 4px; border-radius: 24px; background: var(--cream); box-shadow: 0 10px 30px rgba(120, 80, 50, 0.28);
  animation: trayIn 0.3s cubic-bezier(.3, 1.4, .5, 1);
}
#tray p { margin: 0 4px 8px; font-size: 13px; font-weight: 800; color: var(--ink2); }
@keyframes trayIn { from { transform: translateY(16px) scale(0.95); opacity: 0; } to { transform: none; opacity: 1; } }

#flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 20; }
#flash.on { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
#polaroid { position: absolute; left: 50%; top: 42%; z-index: 21; width: 46%; transform: translate(-50%, -50%) rotate(-4deg); pointer-events: none; animation: polIn 2.1s ease forwards; }
#polaroid img { width: 100%; display: block; border-radius: 6px; box-shadow: 0 14px 30px rgba(80, 50, 30, 0.35); }
#polaroid span { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 800; background: var(--cream); padding: 4px 10px; border-radius: 10px; box-shadow: var(--shadow); }
@keyframes polIn {
  0% { transform: translate(-50%, -40%) rotate(-12deg) scale(0.4); opacity: 0; }
  18% { transform: translate(-50%, -50%) rotate(-4deg) scale(1.04); opacity: 1; }
  28% { transform: translate(-50%, -50%) rotate(-4deg) scale(1); }
  78% { transform: translate(-50%, -50%) rotate(-4deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, 60%) rotate(6deg) scale(0.3); opacity: 0; }
}

/* ---------------- 首頁 ---------------- */
#home { position: absolute; inset: 0; z-index: 8; pointer-events: none; display: flex; flex-direction: column; }
#home > * { pointer-events: auto; }
.home-top { display: flex; justify-content: space-between; padding: calc(var(--sat) + 12px) 14px 0; }
.logo { pointer-events: none !important; text-align: center; margin-top: 18px; animation: logoIn 0.8s cubic-bezier(.3, 1.4, .5, 1); }
.logo small { display: inline-block; font-size: 13px; font-weight: 800; padding: 3px 12px; border-radius: 10px; background: rgba(255, 250, 242, 0.9); color: #e0708e; box-shadow: var(--shadow); }
.logo h1 {
  margin: 8px 0 0; font-size: clamp(30px, 9.5vw, 40px); line-height: 1.12; font-weight: 900; letter-spacing: 0.04em; color: #fff;
  -webkit-text-stroke: 7px #7a5244; paint-order: stroke fill; text-shadow: 0 5px 0 rgba(122, 82, 68, 0.35);
}
@keyframes logoIn { from { transform: translateY(-20px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
.home-sheet {
  margin-top: auto; padding: 16px 16px calc(var(--sab) + 14px); border-radius: 30px 30px 0 0;
  background: rgba(255, 250, 242, 0.97); box-shadow: 0 -10px 30px rgba(120, 80, 50, 0.16);
  display: flex; flex-direction: column; gap: 12px; animation: sheetIn 0.5s cubic-bezier(.3, 1.2, .5, 1);
}
@media (min-width: 560px) { .home-sheet { border-radius: 30px; margin: auto 10px 10px; } }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.forecast { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 18px; background: #eaf5ff; }
.forecast .fc-ico { font-size: 30px; }
.forecast b { display: block; font-size: 15.5px; }
.forecast small { font-size: 12.5px; color: #6a7f95; font-weight: 700; }
.bait p { margin: 0 0 8px 2px; font-weight: 900; font-size: 14.5px; }
.bait p small { font-weight: 700; color: var(--ink2); font-size: 12px; margin-left: 4px; }
.home-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.home-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 4px 7px; border-radius: 18px;
  background: #fff; box-shadow: 0 4px 0 #f0dcc6;
}
.home-nav span { font-size: 25px; line-height: 1.15; }
.home-nav b { font-size: 14px; }
.home-nav small { font-size: 11px; color: var(--ink2); font-weight: 700; }

/* ---------------- 午睡日記 ---------------- */
#summary { position: absolute; inset: 0; z-index: 12; display: flex; align-items: flex-end; justify-content: center; background: rgba(70, 50, 60, 0.35); animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; } }
.sum-card {
  width: 100%; max-height: 92%; overflow-y: auto; padding: 18px 16px calc(var(--sab) + 16px); border-radius: 30px 30px 0 0;
  background: var(--cream); box-shadow: 0 -12px 40px rgba(80, 50, 40, 0.3); animation: sheetIn 0.55s cubic-bezier(.3, 1.2, .5, 1);
}
@media (min-width: 560px) { .sum-card { border-radius: 30px; margin: 10px; } }
.sum-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sum-sun { font-size: 38px; }
.sum-head h2 { margin: 0; font-size: 24px; font-weight: 900; }
.sum-head small { color: var(--ink2); font-weight: 700; font-size: 13px; }
#sumList { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#sumList li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 #f2e2d0; animation: rowIn 0.4s ease backwards; }
#sumList li img { width: 46px; height: 46px; border-radius: 14px; object-fit: cover; }
#sumList .s-name { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
#sumList .s-name b { font-size: 15.5px; }
#sumList .s-name small { font-size: 11.5px; color: var(--ink2); font-weight: 700; }
#sumList .s-hearts { font-size: 15px; letter-spacing: 1px; white-space: nowrap; }
#sumList .badge { display: inline-block; font-size: 10.5px; padding: 1px 6px; border-radius: 7px; color: #fff; background: var(--pink); margin-right: 3px; }
#sumList .badge.lv { background: #a88be0; }
#sumList .badge.love { background: #ff6f91; }
#sumList .empty { justify-content: center; color: var(--ink2); font-weight: 700; font-size: 14px; }
@keyframes rowIn { from { transform: translateX(-14px); opacity: 0; } }
.sum-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 6px; }
.sum-stats div { text-align: center; padding: 8px 2px; border-radius: 14px; background: #fff3e3; font-size: 12px; font-weight: 700; color: var(--ink2); }
.sum-stats b { display: block; font-size: 19px; color: var(--ink); }
.sum-extra { font-size: 13px; font-weight: 700; color: var(--ink2); text-align: center; margin: 4px 0 12px; line-height: 1.5; }
.sum-btns { display: flex; flex-direction: column; gap: 10px; }

/* ---------------- 面板 ---------------- */
#panel { position: absolute; inset: 0; z-index: 15; display: flex; align-items: flex-end; justify-content: center; background: rgba(70, 50, 60, 0.35); animation: fade 0.3s ease; }
.panel-card {
  width: 100%; height: 88%; display: flex; flex-direction: column; border-radius: 30px 30px 0 0; background: var(--cream);
  box-shadow: 0 -12px 40px rgba(80, 50, 40, 0.3); animation: sheetIn 0.45s cubic-bezier(.3, 1.2, .5, 1); overflow: hidden;
}
@media (min-width: 560px) { .panel-card { border-radius: 30px; margin: 10px; height: calc(88% - 20px); } }
#panel.small .panel-card { height: auto; max-height: 88%; }
.panel-card header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; }
.panel-card h2 { margin: 0; font-size: 21px; font-weight: 900; }
.x-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 #f0dcc6; }
.x-btn::before, .x-btn::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 3px; border-radius: 2px; background: var(--ink); }
.x-btn::before { transform: translate(-50%, -50%) rotate(45deg); }
.x-btn::after { transform: translate(-50%, -50%) rotate(-45deg); }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 16px calc(var(--sab) + 18px); -webkit-overflow-scrolling: touch; }
.sub { font-size: 13px; color: var(--ink2); font-weight: 700; margin: 0 0 12px; }

/* 圖鑑 */
.dex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.dex-card { position: relative; padding: 6px 6px 8px; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 #f0dcc6; text-align: center; }
.dex-card .ph { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #fff3e3; }
.dex-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dex-card.locked img { filter: brightness(0) opacity(0.16); }
.dex-card.locked .q { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: #d8c2ae; }
.dex-card b { display: block; font-size: 13.5px; margin-top: 4px; }
.dex-card small { display: block; font-size: 10.5px; color: var(--ink2); font-weight: 700; line-height: 1.25; min-height: 13px; }
.dex-card .lvh { font-size: 10px; letter-spacing: -1px; color: #ff7f9f; }
.dex-card .rar { position: absolute; top: 10px; left: 10px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.dex-card .stamp { position: absolute; top: 8px; right: 8px; font-size: 14px; }
.dex-detail .dd-top { display: flex; gap: 14px; align-items: center; }
.dex-detail .dd-top img { width: 116px; height: 116px; border-radius: 26px; object-fit: cover; box-shadow: var(--shadow); }
.dex-detail h3 { margin: 0; font-size: 22px; }
.dex-detail .kind { font-size: 13px; color: var(--ink2); font-weight: 700; }
.dex-detail .rar-tag { display: inline-block; font-size: 11.5px; color: #fff; padding: 1px 8px; border-radius: 8px; margin-top: 4px; }
.lvbar { margin: 14px 0 6px; padding: 10px 12px; border-radius: 16px; background: #fff0f4; }
.lvbar .row { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 800; }
.lvbar .bar { height: 9px; margin-top: 6px; border-radius: 5px; background: #fff; overflow: hidden; }
.lvbar .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb0c4, #ff7f9f); border-radius: 5px; }
.dd-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.dd-facts div { padding: 8px 10px; border-radius: 14px; background: #fff; box-shadow: 0 2px 0 #f2e2d0; font-size: 12px; color: var(--ink2); font-weight: 700; }
.dd-facts b { display: block; font-size: 15px; color: var(--ink); margin-top: 2px; }
.dd-poses { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.dd-poses span { padding: 4px 9px; border-radius: 10px; background: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 2px 0 #f2e2d0; }
.dd-poses span.no { opacity: 0.35; }
.dd-desc { font-size: 14px; line-height: 1.6; margin: 10px 0; }
.dd-desc i { display: block; font-style: normal; color: var(--ink2); font-size: 13px; margin-top: 4px; }
.letters { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.letters div { padding: 9px 12px; border-radius: 14px; background: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 2px 0 #f2e2d0; }
.letters div small { display: block; font-size: 10.5px; color: #e0708e; font-weight: 800; }
.letters div.locked { color: #c8b4a4; background: #fbf3ea; box-shadow: none; }
.back-link { display: inline-block; margin-bottom: 10px; font-weight: 800; font-size: 14px; color: #e0708e; }
h4 { margin: 14px 0 4px; font-size: 15px; }

/* 相簿 */
.album-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.album-grid button { display: block; border-radius: 8px; overflow: hidden; box-shadow: 0 6px 14px rgba(120, 80, 50, 0.18); }
.album-grid button:nth-child(odd) { transform: rotate(-1.5deg); }
.album-grid button:nth-child(even) { transform: rotate(1.5deg); }
.album-grid img { width: 100%; display: block; }
.empty-note { text-align: center; padding: 50px 10px; color: var(--ink2); font-weight: 700; line-height: 1.7; }
.empty-note span { font-size: 44px; display: block; }
.viewer img { width: 100%; border-radius: 8px; box-shadow: 0 10px 26px rgba(120, 80, 50, 0.25); }
.viewer .vbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* 佈置 */
.decor-list { display: flex; flex-direction: column; gap: 10px; }
.decor-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 #f0dcc6; }
.decor-item .di-ico { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: #fff3e3; }
.decor-item .di-txt { flex: 1; line-height: 1.3; }
.decor-item .di-txt b { font-size: 15px; }
.decor-item .di-txt small { display: block; font-size: 11.5px; color: var(--ink2); font-weight: 700; }
.decor-item .di-txt em { display: block; font-style: normal; font-size: 11px; color: #e0708e; font-weight: 800; margin-top: 2px; }
.buy-btn { min-width: 78px; height: 40px; padding: 0 10px; border-radius: 14px; font-weight: 900; font-size: 14px; background: linear-gradient(#ffe08f, #ffc94a); box-shadow: 0 3px 0 #e0a830; }
.buy-btn.cant { background: #f4e9dc; box-shadow: 0 3px 0 #e6d6c4; color: #b8a090; }
.buy-btn.toggle { background: #e9f8f0; box-shadow: 0 3px 0 #a8dcc0; }
.buy-btn.toggle.off { background: #fff; box-shadow: 0 3px 0 #f0dcc6; color: var(--ink2); }
.buy-btn.lock { background: #f4e9dc; box-shadow: none; color: #b8a090; font-size: 12px; }

/* 設定 */
.set-list { display: flex; flex-direction: column; gap: 10px; }
.set-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: 0 3px 0 #f0dcc6; font-weight: 800; font-size: 15px; }
.set-row small { display: block; font-size: 11.5px; color: var(--ink2); font-weight: 700; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 15px; background: #ead9c8; transition: background 0.2s; flex: 0 0 52px; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); transition: transform 0.2s; }
.switch.on { background: var(--pink); }
.switch.on::after { transform: translateX(22px); }
.about { font-size: 12.5px; color: var(--ink2); font-weight: 700; line-height: 1.7; text-align: center; margin-top: 16px; }
.danger { color: #d0607e; background: #fff0f2 !important; }

/* 暫停 */
.pause-btns { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }

#loading { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: #f6e3cc; transition: opacity 0.5s; }
#loading.out { opacity: 0; pointer-events: none; }
.ld-paw { font-size: 40px; animation: bump 0.8s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
/* 比較矮的手機（SE、小螢幕）：首頁收緊，讓睡在窗上的朋友露出來 */
@media (max-height: 760px) {
  .logo { margin-top: 2px; }
  .logo small { display: none; }
  .logo h1 { margin-top: 0; font-size: clamp(24px, 7.6vw, 31px); -webkit-text-stroke-width: 6px; }
  .logo h1 br { display: none; }
  .home-sheet { gap: 9px; padding-top: 12px; }
  .forecast { padding: 6px 12px; }
  .forecast .fc-ico { font-size: 24px; }
  .forecast small { display: none; }
  .bait p { margin-bottom: 6px; }
  .big-btn { min-height: 54px; font-size: 19px; }
  .home-nav button { padding: 5px 4px; }
  .home-nav span { font-size: 21px; }
}
/* 很矮的螢幕（橫放手機）：收緊一點 */
@media (max-height: 560px) {
  .logo { display: none; }
  .home-sheet { gap: 8px; padding-top: 10px; }
}
