/* f-pet: added 2026-11-21 — 🐾 寵物 tab (scene, info bar, roster, medal wall, titles, collection). Scoped to .pet-screen. */

/* scene: background + frame + decor wings + pet */
.pet-screen .scene-card { padding: 0; overflow: hidden; }
.pet-screen .scene { position: relative; aspect-ratio: 3 / 2; border-radius: var(--radius) var(--radius) 0 0; background-size: cover; background-position: center;
  box-sizing: border-box; overflow: hidden; display: grid; place-items: center; }
.pet-screen .scene-pet { position: absolute; left: 50%; bottom: 7%; height: 64%; aspect-ratio: 1; transform: translateX(-50%); z-index: 2; }
.pet-screen .scene-pet .pet-art { width: 100% !important; height: 100% !important; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(31, 41, 51, .18)); }
.pet-screen .scene-pet .pet-art.sleeping { filter: grayscale(.35) brightness(.92) drop-shadow(0 6px 8px rgba(31, 41, 51, .18)); }
.pet-screen .scene::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 13%; height: 7%; border-radius: 50%; background: rgba(31, 41, 51, .12); z-index: 1; }
.pet-screen .scene.has-img::after { display: none; }
.pet-screen .scene-decor { position: absolute; width: 24%; aspect-ratio: 1; display: grid; place-items: center; z-index: 3; pointer-events: none; }
.pet-screen .scene-decor img { width: 100%; height: 100%; object-fit: contain; }
.pet-screen .scene-decor span { font-size: clamp(2rem, 9vw, 3rem); line-height: 1; }
.pet-screen .scene-decor.ground { left: 4%; bottom: 4%; }
.pet-screen .scene-decor.high { right: 4%; top: 4%; }
.pet-screen .scene-zz { position: absolute; right: 30%; top: 18%; font-size: 1.5rem; z-index: 3; animation: pet-zz 2.4s ease-in-out infinite; }
@keyframes pet-zz { 50% { transform: translateY(-6px); opacity: .6; } }

/* info bar */
.pet-screen .pet-bar { padding: 12px 16px 14px; }
.pet-screen .pet-bar-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pet-screen .pet-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pet-screen .pet-who b { font-size: 1.1rem; color: var(--navy); }
.pet-screen .title-plate { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--gold-ink); background: #fff4d6; border: 1px solid #f0d899;
  border-radius: 6px; padding: 2px 8px; letter-spacing: .05em; }
.pet-screen .lv-badge { flex-shrink: 0; background: var(--navy); color: #fff; font-weight: 800; border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.pet-screen .xp-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; }
.pet-screen .xp-row .bar { flex: 1; margin: 0; }
.pet-screen .xp-row small { flex-shrink: 0; font-size: .72rem; }
.pet-screen .pet-stats { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.pet-screen .stat { background: #faf7f0; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pet-screen .stat b { font-size: 1.3rem; color: var(--navy); line-height: 1.1; }
.pet-screen .stat small { font-size: .72rem; }
.pet-screen .stat .up { color: var(--ok); font-weight: 700; }
.pet-screen .stat .down { color: var(--no); font-weight: 700; }
.pet-screen .showcase { display: flex; gap: 6px; align-items: center; min-height: 36px; }
.pet-screen .pet-name-line { margin: 8px 0 0; }

/* medal chip: round, tier-coloured ring */
.pet-screen .medal-chip { --tier: #2f6fb3; display: inline-grid; place-items: center; border-radius: 50%; flex-shrink: 0;
  background: #fff; background: radial-gradient(circle at 35% 30%, #fff, #fff 40%, color-mix(in srgb, var(--tier) 22%, #fff));
  border: 3px solid var(--tier); box-shadow: 0 1px 3px rgba(31, 41, 51, .15); }
.pet-screen .medal-chip.md { width: 36px; height: 36px; font-size: 1.05rem; }
.pet-screen .medal-chip.dim { filter: grayscale(1); opacity: .4; }
.pet-screen .medal-icon { line-height: 1; }

/* section switcher */
.pet-screen .pet-tabs { display: flex; gap: 6px; margin: 4px 0; overflow-x: auto; }
.pet-screen .pet-tabs button { flex: 1; white-space: nowrap; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 10px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.pet-screen .pet-tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* guardian roster */
.pet-screen .next-unlock { background: #eef3fa; border-radius: 10px; padding: 6px 10px; margin: 6px 0 10px; }
.pet-screen .roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pet-screen .roster-cell { background: #fff; border: 2px solid var(--line); border-top: 4px solid var(--gtier); border-radius: 12px; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.pet-screen .roster-cell small { font-size: .66rem; line-height: 1.2; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pet-screen .roster-cell.locked { background: #f4f1ea; color: var(--muted); }
.pet-screen .roster-cell.active { box-shadow: 0 0 0 3px var(--gold); }
.pet-screen .pet-sil { display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #efe9dd, #ddd3c0); color: #8c826f; }
.pet-screen .pet-sil.locked { background: #d9d2c4; color: #f4f1ea; font-weight: 800; }
.pet-screen .pet-art.locked:not(.pet-sil) { filter: brightness(0) opacity(.3); }
.pet-screen .species { text-align: center; }
.pet-screen .species-art { display: grid; place-items: center; margin: 8px 0; }
.pet-screen .species-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.pet-screen .species .fact { text-align: left; background: #faf7f0; border-radius: 10px; padding: 8px 10px; }

/* medal wall */
.pet-screen .ladder { border-top: 1px dashed var(--line); padding: 8px 0; }
.pet-screen .ladder-name { margin: 0 0 6px; font-weight: 700; font-size: .9rem; }
.pet-screen .ladder-name small { font-weight: 400; font-size: .72rem; }
.pet-screen .ladder-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pet-screen .medal-cell { position: relative; background: none; border: 0; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.pet-screen .medal-cell small { font-size: .64rem; color: var(--muted); text-align: center; line-height: 1.2; }
.pet-screen .medal-cell.earned small { color: var(--ink); font-weight: 600; }
.pet-screen .medal-cell.pinned .medal-chip { box-shadow: 0 0 0 3px var(--navy); }
.pet-screen .medal-cell .pin { position: absolute; top: 0; right: 14%; font-style: normal; font-size: .7rem; color: var(--gold-ink); }
.pet-screen .mini-bar { width: 70%; height: 4px; border-radius: 4px; background: #efe9dd; overflow: hidden; }
.pet-screen .mini-bar span { display: block; height: 100%; background: var(--accent); }

/* titles */
.pet-screen .title-list { display: flex; flex-direction: column; gap: 6px; }
.pet-screen .title-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; }
.pet-screen .title-row.on { border-color: var(--gold); background: #fffaf0; }
.pet-screen .title-row.locked { background: #f4f1ea; } .pet-screen .title-row:disabled { opacity: 1; }
.pet-screen .title-row.locked .title-plate { background: #e6dfd2; border-color: #e6dfd2; color: var(--muted); }

/* collection */
.pet-screen .slot-name { font-size: .8rem; color: var(--muted); font-weight: 700; margin: 12px 0 6px; }
.pet-screen .item-icon img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; display: block; }
.pet-screen .equip-tag { font-size: .6rem; color: var(--accent); }
.pet-screen .equip-tag.on { color: var(--navy); font-weight: 700; }
.pet-screen .reveal-img { width: 140px; height: 140px; object-fit: cover; border-radius: 14px; }

/* v2 (2026-11-21): drawn frame overlay + corner HUD (UI review: Z1 title/level, Z2 medals, Z3 accuracy) */
.pet-screen .scene { container-type: inline-size; }
.pet-screen .scene-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.pet-screen .scene.framed { border-radius: var(--radius) var(--radius) 0 0; }
.pet-screen .hud { position: absolute; inset: 0; z-index: 5; pointer-events: none; font-weight: 700; }
.pet-screen .hud > * { pointer-events: auto; position: absolute; }
.pet-screen .hud-z1 { left: 7%; top: 7.5%; display: flex; align-items: center; }
.pet-screen .hud-lv { position: relative; z-index: 2; width: 9.5cqw; height: 9.5cqw; min-width: 38px; min-height: 38px; display: grid; place-items: center; align-content: center;
  background: url(../assets/ui/level_emblem.webp) center / contain no-repeat; color: #3a2a10; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.pet-screen .hud-lv small { font-size: 9px; } .pet-screen .hud-lv b { font-size: 15px; }
.pet-screen .hud-plate { margin-left: -8px; padding: 4px 14px 4px 14px; font-size: 13px; color: #3a2a10; white-space: nowrap; min-height: 26px; display: grid; place-items: center;
  background: center / 100% 100% no-repeat; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.pet-screen .hud-plate.wood { background-image: url(../assets/ui/plate_level.webp); }
.pet-screen .hud-plate.ribbon { background-image: url(../assets/ui/plate_achievement.webp); color: #5a1f1f; }
.pet-screen .hud-z2 { right: 6.5%; top: 6.5%; display: flex; gap: 3px; padding: 3px 4px; border: 0; border-radius: 999px; background: rgba(250, 244, 230, .72);
  box-shadow: 0 1px 3px rgba(0,0,0,.18); cursor: pointer; min-height: 44px; align-items: center; }
.pet-screen .hud-medal { width: 32px; height: 32px; display: grid; place-items: center; }
.pet-screen .hud-medal .medal-img { width: 100%; height: 100%; object-fit: contain; }
.pet-screen .hud-medal .medal-emoji { font-size: 22px; }
.pet-screen .hud-count { border-radius: 50%; background: #fff7e0; border: 1.5px solid #3a2a10; flex-direction: column; line-height: 1; }
.pet-screen .hud-count b { font-size: 13px; } .pet-screen .hud-count small { font-size: 8px; font-weight: 600; }
.pet-screen .hud-z3 { right: 6.5%; bottom: 7.5%; background: #fbf3df; border: 1.5px solid #3a2a10; border-radius: 999px; padding: 3px 10px; font-size: 12px; color: #3a2a10;
  display: flex; gap: 6px; align-items: baseline; }
.pet-screen .hud-z3 b { font-size: 14px; }
.pet-screen .hud-z3 .up { color: #1f7a4d; } .pet-screen .hud-z3 .flat { color: #6b7680; }
.pet-screen .medal-chip .medal-img { width: 100%; height: 100%; object-fit: contain; }
.pet-screen .ladder-ic { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; }
/* keep decor out of the HUD zones; level number readable on the dark emblem */
.pet-screen .scene-decor { width: 20%; }
.pet-screen .scene-decor.high { right: 5%; left: auto; top: 30%; }
.pet-screen .scene-decor.ground { left: 6%; bottom: 7%; }
.pet-screen .hud-lv { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.pet-screen .hud-lv small { color: #ffe9a8; }
/* v2 art (pastel emblem): dark number, no white glow */
.pet-screen .hud-lv { color: #5a3d1e; text-shadow: 0 0 2px rgba(255,255,255,.9); }
.pet-screen .hud-lv small { color: #8a6a3a; }

/* 系列卡包 (2026-11-21): series picker, selected series panel and the 收藏冊 grouped by series.
   --sc is the series theme colour (soft pastel, game.js SERIES). */
.pet-screen .series-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 10px; }
.pet-screen .series-card { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 6px;
  border-radius: 12px; border: 2px solid var(--sc); color: var(--ink); font: inherit;
  background: #fff; background: color-mix(in srgb, var(--sc) 28%, #fff); }
.pet-screen .series-card .sc-icon { font-size: 1.35rem; line-height: 1.2; }
.pet-screen .series-card b { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pet-screen .series-card small { font-size: .68rem; color: var(--muted); }
.pet-screen .series-card.on { background: color-mix(in srgb, var(--sc) 55%, #fff); box-shadow: 0 0 0 3px var(--navy); }
.pet-screen .sc-done { font-style: normal; font-weight: 800; color: #1f7a4d; }
.pet-screen .series-pick { display: flex; gap: 12px; align-items: center; padding: 10px; margin-bottom: 10px; border-radius: 14px;
  background: #faf7f0; background: color-mix(in srgb, var(--sc) 18%, #fff); border: 1px solid var(--sc); }
.pet-screen .series-pick p { margin: 2px 0; }
.pet-screen .sp-name b { font-size: 1rem; }
/* 收藏冊 groups */
.pet-screen .coll-group { border-top: 1px dashed var(--line); }
.pet-screen .coll-group:first-of-type { border-top: 0; }
.pet-screen .coll-group summary { cursor: pointer; list-style-position: inside; }
.pet-screen .coll-group summary.series-head { padding-left: 8px; border-left: 5px solid var(--sc); }
.pet-screen .coll-group summary small { font-weight: 400; margin-left: 4px; }
.pet-screen .coll-group summary .sc-done { margin-left: 6px; font-size: .75rem; }
.pet-screen .coll-group .items { margin-bottom: 8px; }
.pet-screen .item.pending { background: repeating-linear-gradient(45deg, #f6f2ea 0 8px, #efe9dd 8px 16px); color: var(--muted); border-style: dashed; }
.pet-screen .item.pending .item-icon { opacity: .55; }
